[
  {
    "path": ".circleci/config.yml",
    "content": "workflows:\n  version: 2\n  main:\n    jobs:\n      - build\n      - run-tests-1:\n          requires:\n            - build\n      - run-tests-2:\n          requires:\n            - build\n      - run-checks:\n          requires:\n            - build\n\nversion: 2\njobs:\n  build:\n    docker:\n      - image: circleci/node:8.9.4\n    steps:\n      - checkout\n      - run:\n          name: \"Checkout Submodules & Prep\"\n          command: |\n            git submodule sync\n            git submodule update --init # use submodules\n            echo \"export PATH=${PATH}:${HOME}/${CIRCLE_PROJECT_REPONAME}/node_modules/.bin\" >> $BASH_ENV\n      - restore_cache:\n          keys:\n            - yarn-v1--{{ .Branch }}--{{ checksum \"yarn.lock\" }}\n      - run:\n          name: \"Install Dependencies\"\n          command: yarn install --frozen-lockfile # make sure that lockfile is up-to-date\n      - save_cache:\n          key: yarn-v1--{{ .Branch }}--{{ checksum \"yarn.lock\" }}\n          paths:\n            - ~/.cache/yarn\n      - run:\n          name: \"Build Assets\"\n          command: |\n            yarn build\n            yarn build-scripts\n      - persist_to_workspace:\n          root: /home/circleci\n          paths:\n            - project\n\n  run-tests-1:\n    docker:\n      - image: circleci/node:8.9.4\n    steps:\n      - attach_workspace:\n          at: /home/circleci\n      - run:\n          name: \"Run Tests\"\n          command: |\n            mkdir ~/artifacts\n            yarn test-react\n            yarn test-sourcemaps\n            yarn test-std-in\n            yarn test-test262 --expectedCounts 11944,5641,0 --statusFile ~/artifacts/test262-status.txt --timeout 140 --cpuScale 0.25 --verbose\n            #yarn test-test262-new --statusFile ~/artifacts/test262-new-status.txt --timeout 120 --verbose\n      - store_artifacts:\n          path: ~/artifacts/\n\n  run-tests-2:\n    docker:\n      - image: circleci/node:8.9.4\n    steps:\n      - attach_workspace:\n          at: /home/circleci\n      - run:\n          name: \"Run Tests\"\n          command: |\n            mkdir ~/artifacts\n            yarn test-serializer-with-coverage\n            mv coverage/lcov-report ~/artifacts/coverage-report\n            mv coverage-sourcemapped ~/artifacts/coverage-report-sourcemapped\n      - store_artifacts:\n          path: ~/artifacts/\n\n  run-checks:\n    docker:\n      - image: circleci/node:8.9.4\n    steps:\n      - attach_workspace:\n          at: /home/circleci\n      - run:\n          name: \"Run Checks\"\n          command: |\n            yarn prettier-ci\n            yarn lint\n            yarn flow-ci\n            yarn depcheck\n"
  },
  {
    "path": ".eslintignore",
    "content": "test262\nlib\n/fb-www\nunderscore-with-tests.js\nflow-typed\ntest/**/*.js\nbabel.config.js\n"
  },
  {
    "path": ".eslintrc",
    "content": "// Adapted from React Native .eslintrc.\n// However, at this time, some rules have been disabled to ease the transition\n\n{\n  \"parser\": \"babel-eslint\",\n\n  \"plugins\": [\n    \"flowtype\",\n    \"header\",\n    \"flow-header\",\n    \"prettier\"\n  ],\n\n  \"env\": {\n    \"es6\": true,\n    \"jasmine\": true,\n  },\n\n  \"globals\": {\n    \"console\": false,\n    \"process\": false,\n    \"require\": false,\n    \"setTimeout\": false,\n    \"setInterval\": false,\n    \"clearTimeout\": false,\n    \"clearInterval\": false,\n    \"__dirname\": false,\n    \"Set\": false,\n    \"gc\": false\n  },\n\n  \"rules\": {\n    \"comma-dangle\": 0,               // disallow trailing commas in object literals\n    \"no-cond-assign\": 2,             // disallow assignment in conditional expressions\n    \"no-console\": 0,                 // disallow use of console (off by default in the node environment)\n    \"no-const-assign\": 2,            // disallow assignment to const-declared variables\n    \"no-constant-condition\": 0,      // disallow use of constant expressions in conditions\n    \"no-control-regex\": 2,           // disallow control characters in regular expressions\n    \"no-debugger\": 2,                // disallow use of debugger\n    \"no-dupe-keys\": 2,               // disallow duplicate keys when creating object literals\n    \"no-empty\": 0,                   // disallow empty statements\n    \"no-ex-assign\": 2,               // disallow assigning to the exception in a catch block\n    \"no-extra-boolean-cast\": 2,      // disallow double-negation boolean casts in a boolean context\n    \"no-extra-parens\": 0,            // disallow unnecessary parentheses (off by default)\n    \"no-extra-semi\": 2,              // disallow unnecessary semicolons\n    \"no-func-assign\": 2,             // disallow overwriting functions written as function declarations\n    \"no-inner-declarations\": 0,      // disallow function or variable declarations in nested blocks\n    \"no-invalid-regexp\": 2,          // disallow invalid regular expression strings in the RegExp constructor\n    \"no-negated-in-lhs\": 2,          // disallow negation of the left operand of an in expression\n    \"no-obj-calls\": 2,               // disallow the use of object properties of the global object (Math and JSON) as functions\n    \"no-regex-spaces\": 2,            // disallow multiple spaces in a regular expression literal\n    \"no-reserved-keys\": 0,           // disallow reserved words being used as object literal keys (off by default)\n    \"no-sparse-arrays\": 2,           // disallow sparse arrays\n    // \"no-unreachable\": 1,             // disallow unreachable statements after a return, throw, continue, or break statement\n    \"use-isnan\": 2,                  // disallow comparisons with the value NaN\n    \"valid-jsdoc\": 0,                // Ensure JSDoc comments are valid (off by default)\n    \"valid-typeof\": 2,               // Ensure that the results of typeof are compared against a valid string\n    \"no-var\": 2,\n\n  // Best Practices\n  // These are rules designed to prevent you from making mistakes. They either prescribe a better way of doing something or help you avoid footguns.\n\n    \"block-scoped-var\": 0,           // treat var statements as if they were block scoped (off by default)\n    \"complexity\": 0,                 // specify the maximum cyclomatic complexity allowed in a program (off by default)\n    \"consistent-return\": 0,          // require return statements to either always or never specify values\n    // \"curly\": 1,                      // specify curly brace conventions for all control statements\n    \"default-case\": 2,               // require default case in switch statements (off by default)\n    \"dot-notation\": 2,               // encourages use of dot notation whenever possible\n    \"eqeqeq\": [2, \"allow-null\"],     // require the use of === and !==\n    \"guard-for-in\": 0,               // make sure for-in loops have an if statement (off by default)\n    \"no-alert\": 2,                   // disallow the use of alert, confirm, and prompt\n    \"no-caller\": 2,                  // disallow use of arguments.caller or arguments.callee\n    \"no-div-regex\": 2,               // disallow division operators explicitly at beginning of regular expression (off by default)\n    \"no-else-return\": 0,             // disallow else after a return in an if (off by default)\n    \"no-eq-null\": 0,                 // disallow comparisons to null without a type-checking operator (off by default)\n    \"no-eval\": 2,                    // disallow use of eval()\n    \"no-extend-native\": 2,           // disallow adding to native types\n    \"no-extra-bind\": 2,              // disallow unnecessary function binding\n    \"no-fallthrough\": 2,             // disallow fallthrough of case statements\n    \"no-floating-decimal\": 2,        // disallow the use of leading or trailing decimal points in numeric literals (off by default)\n    \"no-implicit-globals\": 2,\n    \"no-implied-eval\": 2,            // disallow use of eval()-like methods\n    \"no-invalid-this\": 2,\n    \"no-labels\": 0,                  // disallow use of labeled statements\n    \"no-iterator\": 2,                // disallow usage of __iterator__ property\n    \"no-lone-blocks\": 2,             // disallow unnecessary nested blocks\n    \"no-loop-func\": 0,               // disallow creation of functions within loops\n    \"no-multi-str\": 0,               // disallow use of multiline strings\n    \"no-native-reassign\": 0,         // disallow reassignments of native objects\n    \"no-new\": 2,                     // disallow use of new operator when not part of the assignment or comparison\n    \"no-new-func\": 2,                // disallow use of new operator for Function object\n    \"no-new-wrappers\": 2,            // disallows creating new instances of String,Number, and Boolean\n    \"no-octal\": 2,                   // disallow use of octal literals\n    \"no-octal-escape\": 2,            // disallow use of octal escape sequences in string literals, such as var foo = \"Copyright \\251\";\n    \"no-proto\": 2,                   // disallow usage of __proto__ property\n    \"no-redeclare\": 2,               // disallow declaring the same variable more then once\n    \"no-return-assign\": 2,           // disallow use of assignment in return statement\n    \"no-script-url\": 2,              // disallow use of javascript: urls.\n    \"no-self-assign\": 2,\n    \"no-self-compare\": 2,            // disallow comparisons where both sides are exactly the same (off by default)\n    \"no-sequences\": 2,               // disallow use of comma operator\n    \"no-throw-literal\": 2,\n    \"no-unused-expressions\": 0,      // disallow usage of expressions in statement position\n    \"no-void\": 2,                    // disallow use of void operator (off by default)\n    \"no-warning-comments\": 0,        // disallow usage of configurable warning terms in comments\": 1,                        // e.g. TODO or FIXME (off by default)\n    \"no-with\": 2,                    // disallow use of the with statement\n    \"radix\": 2,                      // require use of the second argument for parseInt() (off by default)\n    \"semi-spacing\": 2,               // require a space after a semi-colon\n    \"vars-on-top\": 0,                // requires to declare all vars on top of their containing scope (off by default)\n    \"wrap-iife\": 0,                  // require immediate function invocation to be wrapped in parentheses (off by default)\n    \"yoda\": 2,                       // require or disallow Yoda conditions\n\n  // Variables\n  // These rules have to do with variable declarations.\n\n    \"no-catch-shadow\": 2,            // disallow the catch clause parameter name being the same as a variable in the outer scope (off by default in the node environment)\n    \"no-delete-var\": 2,              // disallow deletion of variables\n    \"no-label-var\": 2,               // disallow labels that share a name with a variable\n    \"no-shadow\": 2,                  // disallow declaration of variables already declared in the outer scope\n    \"no-shadow-restricted-names\": 2, // disallow shadowing of names such as arguments\n    \"no-undef\": 2,                   // disallow use of undeclared variables unless mentioned in a /*global */ block\n    \"no-undefined\": 0,               // disallow use of undefined variable (off by default)\n    \"no-undef-init\": 2,              // disallow use of undefined when initializing variables\n    \"no-unused-vars\": [2, {\"vars\": \"all\", \"args\": \"none\"}], // disallow declaration of variables that are not used in the code\n    \"no-use-before-define\": 0,       // disallow use of variables before they are defined\n\n  // Node.js\n  // These rules are specific to JavaScript running on Node.js.\n\n    \"handle-callback-err\": 2,        // enforces error handling in callbacks (off by default) (on by default in the node environment)\n    \"no-mixed-requires\": 2,          // disallow mixing regular variable and require declarations (off by default) (on by default in the node environment)\n    \"no-new-require\": 2,             // disallow use of new operator with the require function (off by default) (on by default in the node environment)\n    \"no-path-concat\": 2,             // disallow string concatenation with __dirname and __filename (off by default) (on by default in the node environment)\n    \"no-process-exit\": 0,            // disallow process.exit() (on by default in the node environment)\n    \"no-restricted-modules\": 2,      // restrict usage of specified node modules (off by default)\n    \"no-sync\": 0,                    // disallow use of synchronous methods (off by default)\n\n  // Stylistic Issues\n  // These rules are purely matters of style and are quite subjective.\n\n    \"key-spacing\": 2,\n    \"keyword-spacing\": 2,            // enforce spacing before and after keywords\n    \"jsx-quotes\": [2, \"prefer-double\"],\n    \"comma-spacing\": 2,\n    \"comma-style\": 2,\n    \"no-multi-spaces\": 0,\n    \"brace-style\": 2,                // enforce one true brace style (off by default)\n    \"camelcase\": 0,                  // require camel case names\n    \"consistent-this\": [0, \"self\"],            // enforces consistent naming when capturing the current execution context (off by default)\n    \"eol-last\": 2,                   // enforce newline at the end of file, with no multiple empty lines\n    \"func-names\": 0,                 // require function expressions to have a name (off by default)\n    \"func-name-matching\": 2,\n    \"func-call-spacing\": 2,\n    \"func-style\": 0,                 // enforces use of function declarations or expressions (off by default)\n    \"new-cap\": [2, { \"capIsNew\": false }],                    // require a capital letter for constructors\n    \"new-parens\": 2,                 // disallow the omission of parentheses when invoking a constructor with no arguments\n    \"no-nested-ternary\": 0,          // disallow nested ternary expressions (off by default)\n    \"no-array-constructor\": 2,       // disallow use of the Array constructor\n    \"no-lonely-if\": 0,               // disallow if as the only statement in an else block (off by default)\n    \"no-new-object\": 2,              // disallow use of the Object constructor\n    \"no-spaced-func\": 2,             // disallow space between function identifier and application\n    \"no-tabs\": 2,\n    \"no-ternary\": 0,                 // disallow the use of ternary operators (off by default)\n    \"no-trailing-spaces\": 2,         // disallow trailing whitespace at the end of lines\n    \"no-underscore-dangle\": 0,       // disallow dangling underscores in identifiers\n    \"no-mixed-spaces-and-tabs\": 2,   // disallow mixed spaces and tabs for indentation\n    // \"quotes\": [1, \"single\", \"avoid-escape\"], // specify whether double or single quotes should be used\n    \"quote-props\": 0,                // require quotes around object literal property names (off by default)\n    \"semi\": 2,                       // require or disallow use of semicolons instead of ASI\n    \"sort-vars\": 0,                  // sort variables within the same declaration block (off by default)\n    \"object-curly-spacing\": [2, \"always\"],\n    \"array-bracket-spacing\": 2,\n    \"computed-property-spacing\": 2,\n    \"space-in-parens\": 2,            // require or disallow spaces inside parentheses (off by default)\n    \"space-infix-ops\": 2,            // require spaces around operators\n    \"space-unary-ops\": [2, { \"words\": true, \"nonwords\": false }], // require or disallow spaces before/after unary operators (words on by default, nonwords off by default)\n    \"max-nested-callbacks\": 0,       // specify the maximum depth callbacks can be nested (off by default)\n    \"one-var\": 0,                    // allow just one var statement per function (off by default)\n    \"wrap-regex\": 0,                 // require regex literals to be wrapped in parentheses (off by default)\n\n  // Legacy\n  // The following rules are included for compatibility with JSHint and JSLint. While the names of the rules may not match up with the JSHint/JSLint counterpart, the functionality is the same.\n\n    \"max-depth\": 0,                  // specify the maximum depth that blocks can be nested (off by default)\n    \"max-len\": 0,                    // specify the maximum length of a line in your program (off by default)\n    \"max-params\": 0,                 // limits the number of parameters that can be used in the function declaration. (off by default)\n    \"max-statements\": 0,             // specify the maximum number of statement allowed in a function (off by default)\n    \"no-bitwise\": 0,                 // disallow use of bitwise operators (off by default)\n    \"no-plusplus\": 0,                // disallow use of unary operators, ++ and -- (off by default)\n\n  // Flow\n    \"flowtype/boolean-style\": [2, \"boolean\"], // a problem is raised when using bool instead of boolean\n    \"flowtype/define-flow-type\": 2,\n    \"flowtype/generic-spacing\": 0,\n    \"flowtype/space-before-type-colon\": [2, \"never\"],\n    \"flowtype/space-before-generic-bracket\": [2, \"never\"],\n    \"flowtype/space-after-type-colon\": 0,\n    \"flowtype/no-dupe-keys\": 2,\n    \"flowtype/union-intersection-spacing\": [2, \"always\"],\n    \"flowtype/no-weak-types\": [2, {\"any\": false, \"Object\": true, \"Function\": false}],\n    \"flow-header/flow-header\": 2,\n\n  // Headers\n    \"header/header\": [2, \"block\", [\n      \"*\",\n      \" * Copyright (c) 2017-present, Facebook, Inc.\",\n      \" * All rights reserved.\",\n      \" *\",\n      \" * This source code is licensed under the BSD-style license found in the\",\n      \" * LICENSE file in the root directory of this source tree. An additional grant\",\n      \" * of patent rights can be found in the PATENTS file in the same directory.\",\n      \" \",\n      ]\n    ],\n\n  // Prettier\n    \"prettier/prettier\": [\"error\", {\n      \"parser\": \"flow\",\n      \"trailingComma\": \"es5\",\n      \"printWidth\": 120,\n    }],\n\n  // Reject imports from lib/*\n    \"no-restricted-imports\": [\"error\", {\n      \"patterns\": [\"**/../lib/**\"]\n    }]\n  }\n}\n"
  },
  {
    "path": ".flowconfig",
    "content": "[ignore]\n.*/node_modules/@babel/.*\n.*/test262/.*\n.*/node_modules/.*\\.json\n.*/lib/.*\n.*/fb-www/input*.js\n.*/fb-www/output*.js\n.*/test/serializer/.*\n.*/scripts/prettier.js\n.*/tmp_website_build/.*\nbabel.config.js\n\n[include]\n\n[libs]\nflow-libs\n\n[options]\nmerge_timeout=0\nsuppress_comment= \\\\(.\\\\|\\n\\\\)*\\\\$FlowFixMe\nesproposal.class_static_fields=enable\nesproposal.class_instance_fields=enable\nmodule.name_mapper='/lib/' -> '/src/'\n\n[strict]\nnonstrict-import\nunclear-type\nunsafe-getters-setters\nuntyped-import\nuntyped-type-import\nsketchy-null\n\n[version]\n^0.83.0\n"
  },
  {
    "path": ".gitignore",
    "content": ".*.haste_cache.*\n*~\n**/node_modules/\n/lib\nnpm-debug.log\nyarn-error.log\n.DS_Store\nbuild/\n.idea/\ntmp_website_build/\ncoverage*/\n.vscode\n/fb-www\nfacebook/test\nfacebook/test-react\nfacebook/tutorial\nprepack.min.js\n"
  },
  {
    "path": ".gitmodules",
    "content": "[submodule \"test/test262\"]\n\tpath = test/test262\n\turl = https://github.com/tc39/test262\nignore = all"
  },
  {
    "path": ".prettierrc",
    "content": "{\n  \"trailingComma\": \"es5\",\n  \"parser\": \"babylon\",\n  \"printWidth\": 120\n}"
  },
  {
    "path": ".watchmanconfig",
    "content": ""
  },
  {
    "path": "CODE_OF_CONDUCT.md",
    "content": "# Code of Conduct\n\nFacebook has adopted a Code of Conduct that we expect project participants to adhere to. Please [read the full text](https://code.fb.com/codeofconduct/) so that you can understand what actions will and will not be tolerated.\n"
  },
  {
    "path": "CONTRIBUTING.md",
    "content": "# Contributing to Prepack\nWe want to make contributing to this project as easy and transparent as\npossible.\n\nTo read more about the project, check out this [suggested reading wiki](https://github.com/facebook/prepack/wiki/Suggested-reading)\n\n## Code of Conduct\n\nFacebook has adopted a Code of Conduct that we expect project participants to adhere to. Please [read the full text](https://code.fb.com/codeofconduct/) so that you can understand what actions will and will not be tolerated.\n\n## Our Development Process\nThe GitHub repository is the source of truth for us and all development takes place here.\n\n## Pull Requests\nWe actively welcome your pull requests. If you are planning on doing a larger chunk of work, make sure to file an issue first to get feedback on your idea.\n\n1. Fork the repo and create your branch from `master`.\n2. If you've added code that should be tested, add tests.\n3. If you've changed APIs, update the documentation.\n4. Ensure the test suite passes, your code lints and typechecks. Your pull request might not get the attention it deserves if it fails in our automated continuous integration system.\n5. If you haven't already, complete the Contributor License Agreement (\"CLA\").\n6. Consider quashing your commits (`git rebase -i`). One intent alongside one commit makes it clearer for people to review and easier to understand your intention.\n7. The main comment of a pull request must start with a sentence to be used in release notes prefixed with \"Release Note: \". If the change is negligible, say \"Release Note: none\".\n\n## Copyright Notice for files\n\nCopy and paste this to the top of your new file(s):\n\n```\n/**\n * Copyright (c) 2017-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n```\n\n## Contributor License Agreement (\"CLA\")\nIn order to accept your pull request, we need you to submit a CLA. You only need\nto do this once to work on any of Facebook's open source projects.\n\nComplete your CLA here: <https://code.facebook.com/cla>\n\n## Issues\nWe use GitHub issues to track public bugs. Please ensure your description is\nclear and has sufficient instructions to be able to reproduce the issue.\n\nFacebook has a [bounty program](https://www.facebook.com/whitehat/) for the safe\ndisclosure of security bugs. In those cases, please go through the process\noutlined on that page and do not file a public issue.\n\n## Coding Style\n*Most important: Look around.* Match the style you see used in the rest of the project. This includes formatting, naming things in code, naming things in documentation.\n\nOur basic code formatting rules are encoded in `.eslintrc` and are enforced by the linter.\nWhen encoding functionality described in the JavaScript spec (http://www.ecma-international.org/ecma-262/7.0/), \nensure that you copy+paste the relevant section number and individual steps.\n\n## License\nBy contributing to Prepack, you agree that your contributions will be licensed\nunder the LICENSE file in the root directory of this source tree.\n"
  },
  {
    "path": "LICENSE",
    "content": "BSD License\n\nFor Prepack software\n\nCopyright (c) 2017-present, Facebook, Inc. All rights reserved.\n\nRedistribution and use in source and binary forms, with or without modification,\nare permitted provided that the following conditions are met:\n\n * Redistributions of source code must retain the above copyright notice, this\n   list of conditions and the following disclaimer.\n\n * Redistributions in binary form must reproduce the above copyright notice,\n   this list of conditions and the following disclaimer in the documentation\n   and/or other materials provided with the distribution.\n\n * Neither the name Facebook nor the names of its contributors may be used to\n   endorse or promote products derived from this software without specific\n   prior written permission.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND\nANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\nWARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\nDISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR\nANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\nLOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON\nANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS\nSOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n"
  },
  {
    "path": "PATENTS",
    "content": "Additional Grant of Patent Rights Version 2\n\n\"Software\" means the Prepack software contributed by Facebook, Inc.\n\nFacebook, Inc. (\"Facebook\") hereby grants to each recipient of the Software\n(\"you\") a perpetual, worldwide, royalty-free, non-exclusive, irrevocable\n(subject to the termination provision below) license under any Necessary\nClaims, to make, have made, use, sell, offer to sell, import, and otherwise\ntransfer the Software. For avoidance of doubt, no license is granted under\nFacebook’s rights in any patent claims that are infringed by (i) modifications\nto the Software made by you or any third party or (ii) the Software in\ncombination with any software or other technology.\n\nThe license granted hereunder will terminate, automatically and without notice,\nif you (or any of your subsidiaries, corporate affiliates or agents) initiate\ndirectly or indirectly, or take a direct financial interest in, any Patent\nAssertion: (i) against Facebook or any of its subsidiaries or corporate\naffiliates, (ii) against any party if such Patent Assertion arises in whole or\nin part from any software, technology, product or service of Facebook or any of\nits subsidiaries or corporate affiliates, or (iii) against any party relating\nto the Software. Notwithstanding the foregoing, if Facebook or any of its\nsubsidiaries or corporate affiliates files a lawsuit alleging patent\ninfringement against you in the first instance, and you respond by filing a\npatent infringement counterclaim in that lawsuit against that party that is\nunrelated to the Software, the license granted hereunder will not terminate\nunder section (i) of this paragraph due to such counterclaim.\n\nA \"Necessary Claim\" is a claim of a patent owned by Facebook that is\nnecessarily infringed by the Software standing alone.\n\nA \"Patent Assertion\" is any lawsuit or other action alleging direct, indirect,\nor contributory infringement or inducement to infringe any patent, including a\ncross-claim or counterclaim.\n"
  },
  {
    "path": "README.md",
    "content": "# Prepack [![Circle CI](https://circleci.com/gh/facebook/prepack.png?style=shield&circle-token=1109197a81e634fd06e162c25d309a420585acd5)](https://circleci.com/gh/facebook/prepack)\n\n<img src=\"assets/PrepackLogo.png\" width=150 align=right>\n\nPrepack is a partial evaluator for JavaScript. Prepack rewrites a JavaScript bundle, resulting in JavaScript code that executes more efficiently.\nFor initialization-heavy code, Prepack works best in an environment where JavaScript parsing is effectively cached.\n\nSee the official [prepack.io](https://prepack.io) website for an introduction and an [interactive REPL playground](https://prepack.io/repl.html).\n\n## Status\n\n**We, the Prepack team at Facebook, have temporarily set down work on Prepack including the React compiler project. You won't see many Prepack PRs while we are currently prioritizing some other projects.**\n\n## How to use Prepack\n\nInstall the CLI via npm,\n\n```bash\n$ npm install -g prepack\n```\n\nOr if you prefer yarn, make sure you get yarn first,\n```bash\n$ npm install -g yarn\n```\nand then install the Prepack CLI via yarn:\n\n```bash\n$ yarn global add prepack\n```\nYou may need to `prepend` (pun intended!) the command with `sudo` in some cases.\n\n### Let the party begin\n\nTo compile a file and print the output to the console:\n\n```bash\n$ prepack script.js\n```\n\nIf you want to compile a file and output to another file:\n\n```bash\n$ prepack script.js --out script-processed.js\n```\n\nDetailed instructions and the API can be found at [Prepack CLI: Getting Started](https://prepack.io/getting-started.html)\n\n### Plugins to other tools\nThe following are a few plugins to other tools. They have been created and are maintained separately from Prepack itself. If you run into any issues with those plugins, please ask the plugin maintainers for support.\n\n- [A Rollup plugin for Prepack](https://www.npmjs.com/package/rollup-plugin-prepack)\n- [A Webpack plugin for Prepack](https://www.npmjs.com/package/prepack-webpack-plugin)\n- [A Parcel plugin for Prepack](https://www.npmjs.com/package/parcel-plugin-prepack)\n- [A Visual Studio code plugin for Prepack](https://marketplace.visualstudio.com/items?itemName=RobinMalfait.prepack-vscode)\n- [A babel plugin which transforms Flow annotations into prepack model declarations](https://www.npmjs.com/package/babel-plugin-flow-prepack).\n\n## Test Results and Code Coverage\n\n- [test262 status on master branch](https://circleci.com/api/v1/project/facebook/prepack/latest/artifacts/0/$CIRCLE_ARTIFACTS/test262-status.txt?branch=master)\n- [code coverage report for serialization tests](https://circleci.com/api/v1/project/facebook/prepack/latest/artifacts/0/$CIRCLE_ARTIFACTS/coverage-report-sourcemapped/index.html?branch=master)\n- To see the status for a pull request, look for the message *All checks have passed* or *All checks have failed*. Click on *Show all checks*, *Details*, *Artifacts*, and then *test262-status.txt* or *coverage-report-sourcemapped/index.html*.\n\n## How to get the code\n\n0. Clone repository and make it your current directory.\n1. `git submodule init`\n2. `git submodule update --init`\n3. Get yarn and node, then do\n   `yarn`\n\nNote: For development work you really need `yarn`, as many scripts require it.\n\n### How to build, lint, type check\n\n0. Get the code\n1. `yarn build`  \n   You can later run `yarn watch` in the background to just compile changed files on the fly.\n2. `yarn lint`\n3. `yarn flow`\n\n### How to run tests\n\n0. Get the code\n1. Make sure the code is built, either by running `yarn build` or `yarn watch`\n2. `yarn test`\n\nYou can run individual test suites as follows:\n- `yarn test-serializer`  \n  This tests the interpreter and serializer. All tests should pass.\n- `yarn test-test262`  \n  This tests conformance against the test262 suite. Not all will pass, increasing conformance is work in progress.\n\n## How to run the interpreter\n\n0. Get the code\n1. Make sure the code is built, either by running `yarn build` or `yarn watch`\n2. `yarn repl`  \n   This starts an interactive interpreter session.\n\n## How to run Prepack\n\n0. Get the code\n1. Make sure the code is built, either by running `yarn build` or `yarn watch`.\n2. Have a JavaScript file handy that you want to prepack, for example:  \n   `echo \"function hello() { return 'hello'; } function world() { return 'world'; } s = hello() + ' ' + world();\" >/tmp/sample.js`\n\n3. `cat /tmp/sample.js | yarn prepack-cli`  \n   Try `--help` for more options.\n\n## How to validate changes\n\nInstead of building, linting, type checking, testing separately, the following does everything together:  \n`yarn validate`\n\n## How to edit the website\n\nThe content for [prepack.io](https://prepack.io) resides in the [website directory](https://github.com/facebook/prepack/tree/master/website) of this repository. To make changes, submit a pull request, just like for any code changes.\n\nIn order to run the website locally at [localhost:8000](http://localhost:8000):\n1. Build prepack into the website: `yarn build && mv prepack.min.js website/js`\n2. Run `python -m SimpleHTTPServer` (Python 2) or `python -m http.server` (Python 3) from the `website/` directory\n\n## How to contribute\n\nTo read more about the project, check out this [suggested reading wiki](https://github.com/facebook/prepack/wiki/Suggested-reading)\n\nFor more information about contributing pull requests and issues, see our [Contribution Guidelines](./CONTRIBUTING.md).\n\n## License\n\nPrepack is BSD-licensed. We also provide an additional patent grant.\n"
  },
  {
    "path": "babel.config.js",
    "content": "/**\n * Copyright (c) 2017-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\nmodule.exports = function(api) {\n  api.cache(true);\n\n  const plugins = [\n    \"@babel/plugin-syntax-flow\",\n    \"@babel/plugin-syntax-jsx\",\n    \"@babel/plugin-transform-flow-strip-types\",\n    \"@babel/plugin-transform-react-jsx\",\n    \"@babel/plugin-transform-react-display-name\",\n    \"@babel/plugin-proposal-class-properties\",\n    \"@babel/plugin-proposal-object-rest-spread\",\n  ];\n\n  // Webpack bundle\n  if (process.env.NODE_ENV === \"production\") {\n    return {\n      presets: [\n        [\n          \"@babel/env\",\n          {\n            targets: {\n              ie: \"10\",\n            },\n            forceAllTransforms: true,\n          },\n        ],\n        \"@babel/preset-flow\",\n      ],\n      plugins,\n    };\n  }\n  // Default\n  return {\n    presets: [\n      [\n        \"@babel/env\",\n        {\n          targets: {\n            node: \"6.10\",\n          },\n        },\n      ],\n      \"@babel/preset-flow\",\n    ],\n    plugins,\n    // `lib` files are already compiled with Babel. Don't try to compile them again.\n    ignore: [\"lib/**/*.js\"],\n  };\n};\n"
  },
  {
    "path": "bin/prepack-repl.js",
    "content": "#!/usr/bin/env node\n\nrequire(\"../lib/repl-cli\");\n"
  },
  {
    "path": "bin/prepack.js",
    "content": "#!/usr/bin/env node\n\nrequire(\"../lib/prepack-cli\");\n"
  },
  {
    "path": "flow-libs/vscode-debugadapter.js.flow",
    "content": "/**\n * Copyright (c) 2017-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n/* @flow */\n\n// Generated using flowgen from vscode-debugadapter npm package and modified\n\nimport DebugProtocol from 'vscode-debugprotocol'\nimport * as ee from 'events';\ndeclare module 'vscode-debugadapter' {\n\n  declare export class Message mixins DebugProtocol.ProtocolMessage {\n      seq: number;\n      type: string;\n      constructor(type: string): this\n  }\n  declare export class Response mixins Message, DebugProtocol.Response {\n      request_seq: number;\n      success: boolean;\n      command: string;\n      constructor(request: DebugProtocol.Request, message?: string): this\n  }\n  declare export class Event mixins Message, DebugProtocol.Event {\n      event: string;\n      constructor(event: string, body?: any): this\n  }\n  declare export class StoppedEvent mixins Event, DebugProtocol.StoppedEvent {\n      body: {\n          reason: string,\n          threadId: number\n      };\n      constructor(reason: string, threadId: number, exception_text?: string): this\n  }\n  declare export class InitializedEvent mixins Event, DebugProtocol.InitializedEvent {\n      constructor(): this\n  }\n  declare export class TerminatedEvent mixins Event, DebugProtocol.TerminatedEvent {\n    /** Protocol: A debug adapter may set 'restart' to true (or to an arbitrary object) to request that the front end restarts the session.\n      The value is not interpreted by the client and passed unmodified as an attribute '__restart' to the launchRequest.\n      */\n      constructor(restart?: any): this\n  }\n  declare export class OutputEvent mixins Event, DebugProtocol.OutputEvent {\n      body: {\n          category: string,\n          output: string,\n          // Protocol: this can be any optional data to report\n          data?: any\n      };\n      constructor(output: string, category?: string, data?: any): this\n  }\n  declare export class ProtocolServer mixins ee.EventEmitter {\n      constructor(): this;\n      start(inStream: ee.EventEmitter.ReadableStream, outStream: ee.EventEmitter.WritableStream): void;\n      stop(): void;\n      sendEvent(event: DebugProtocol.Event): void;\n      sendResponse(response: DebugProtocol.Response): void;\n      sendRequest(\n          command: string,\n          args: any,\n          timeout: number,\n          cb: (response: DebugProtocol.Response) => void): void;\n      dispatchRequest(request: DebugProtocol.Request): void\n  }\n  declare export type ErrorDestination = {\n    User: 1,\n    Telemetry: 2,\n  }\n  declare export class DebugSession mixins ProtocolServer {\n      _isServer: boolean;\n      constructor(obsolete_debuggerLinesAndColumnsStartAt1?: boolean, obsolete_isServer?: boolean): this;\n      setDebuggerPathFormat(format: string): void;\n      setDebuggerLinesStartAt1(enable: boolean): void;\n      setDebuggerColumnsStartAt1(enable: boolean): void;\n      setRunAsServer(enable: boolean): void;\n\n      /**\n       * A virtual constructor...\n       */\n      static run(debugSession: typeof DebugSession): void;\n      shutdown(): void;\n      sendErrorResponse(\n          response: DebugProtocol.Response,\n          codeOrMessage: number | DebugProtocol.Message,\n          format?: string,\n          variables?: any,\n          dest?: ErrorDestination): void;\n      runInTerminalRequest(\n          args: DebugProtocol.RunInTerminalRequestArguments,\n          timeout: number,\n          cb: (response: DebugProtocol.RunInTerminalResponse) => void): void;\n      dispatchRequest(request: DebugProtocol.Request): void;\n      initializeRequest(\n          response: DebugProtocol.InitializeResponse,\n          args: DebugProtocol.InitializeRequestArguments): void;\n      disconnectRequest(\n          response: DebugProtocol.DisconnectResponse,\n          args: DebugProtocol.DisconnectArguments): void;\n      launchRequest(\n          response: DebugProtocol.LaunchResponse,\n          args: DebugProtocol.LaunchRequestArguments): void;\n      attachRequest(\n          response: DebugProtocol.AttachResponse,\n          args: DebugProtocol.AttachRequestArguments): void;\n      restartRequest(\n          response: DebugProtocol.RestartResponse,\n          args: DebugProtocol.RestartArguments): void;\n      setBreakPointsRequest(\n          response: DebugProtocol.SetBreakpointsResponse,\n          args: DebugProtocol.SetBreakpointsArguments): void;\n      setFunctionBreakPointsRequest(\n          response: DebugProtocol.SetFunctionBreakpointsResponse,\n          args: DebugProtocol.SetFunctionBreakpointsArguments): void;\n      setExceptionBreakPointsRequest(\n          response: DebugProtocol.SetExceptionBreakpointsResponse,\n          args: DebugProtocol.SetExceptionBreakpointsArguments): void;\n      configurationDoneRequest(\n          response: DebugProtocol.ConfigurationDoneResponse,\n          args: DebugProtocol.ConfigurationDoneArguments): void;\n      continueRequest(\n          response: DebugProtocol.ContinueResponse,\n          args: DebugProtocol.ContinueArguments): void;\n      nextRequest(response: DebugProtocol.NextResponse, args: DebugProtocol.NextArguments): void;\n      stepInRequest(\n          response: DebugProtocol.StepInResponse,\n          args: DebugProtocol.StepInArguments): void;\n      stepOutRequest(\n          response: DebugProtocol.StepOutResponse,\n          args: DebugProtocol.StepOutArguments): void;\n      stepBackRequest(\n          response: DebugProtocol.StepBackResponse,\n          args: DebugProtocol.StepBackArguments): void;\n      reverseContinueRequest(\n          response: DebugProtocol.ReverseContinueResponse,\n          args: DebugProtocol.ReverseContinueArguments): void;\n      restartFrameRequest(\n          response: DebugProtocol.RestartFrameResponse,\n          args: DebugProtocol.RestartFrameArguments): void;\n      gotoRequest(response: DebugProtocol.GotoResponse, args: DebugProtocol.GotoArguments): void;\n      pauseRequest(\n          response: DebugProtocol.PauseResponse,\n          args: DebugProtocol.PauseArguments): void;\n      sourceRequest(\n          response: DebugProtocol.SourceResponse,\n          args: DebugProtocol.SourceArguments): void;\n      threadsRequest(response: DebugProtocol.ThreadsResponse): void;\n      stackTraceRequest(\n          response: DebugProtocol.StackTraceResponse,\n          args: DebugProtocol.StackTraceArguments): void;\n      scopesRequest(\n          response: DebugProtocol.ScopesResponse,\n          args: DebugProtocol.ScopesArguments): void;\n      variablesRequest(\n          response: DebugProtocol.VariablesResponse,\n          args: DebugProtocol.VariablesArguments): void;\n      setVariableRequest(\n          response: DebugProtocol.SetVariableResponse,\n          args: DebugProtocol.SetVariableArguments): void;\n      evaluateRequest(\n          response: DebugProtocol.EvaluateResponse,\n          args: DebugProtocol.EvaluateArguments): void;\n      stepInTargetsRequest(\n          response: DebugProtocol.StepInTargetsResponse,\n          args: DebugProtocol.StepInTargetsArguments): void;\n      gotoTargetsRequest(\n          response: DebugProtocol.GotoTargetsResponse,\n          args: DebugProtocol.GotoTargetsArguments): void;\n      completionsRequest(\n          response: DebugProtocol.CompletionsResponse,\n          args: DebugProtocol.CompletionsArguments): void;\n      exceptionInfoRequest(\n          response: DebugProtocol.ExceptionInfoResponse,\n          args: DebugProtocol.ExceptionInfoArguments): void;\n      loadedSourcesRequest(\n          response: DebugProtocol.LoadedSourcesResponse,\n          args: DebugProtocol.LoadedSourcesArguments): void;\n\n      /**\n       * Override this hook to implement custom requests.\n       */\n      customRequest(command: string, response: DebugProtocol.Response, args: any): void;\n      convertClientLineToDebugger(line: number): number;\n      convertDebuggerLineToClient(line: number): number;\n      convertClientColumnToDebugger(column: number): number;\n      convertDebuggerColumnToClient(column: number): number;\n      convertClientPathToDebugger(clientPath: string): string;\n      convertDebuggerPathToClient(debuggerPath: string): string\n  }\n  declare export class LoggingDebugSession mixins DebugSession {\n      constructor(_logFilePath: string, obsolete_debuggerLinesAndColumnsStartAt1?: boolean, obsolete_isServer?: boolean): this;\n      start(inStream: ee.EventEmitter.ReadableStream, outStream: ee.EventEmitter.WritableStream): void;\n\n      /**\n       * Overload sendEvent to log\n       */\n      sendEvent(event: DebugProtocol.Event): void;\n\n      /**\n       * Overload sendRequest to log\n       */\n      sendRequest(\n          command: string,\n          args: any,\n          timeout: number,\n          cb: (response: DebugProtocol.Response) => void): void;\n\n      /**\n       * Overload sendResponse to log\n       */\n      sendResponse(response: DebugProtocol.Response): void;\n      dispatchRequest(request: DebugProtocol.Request): void\n  }\n}\n"
  },
  {
    "path": "flow-libs/vscode-debugprotocol.js.flow",
    "content": "/**\n * Copyright (c) 2017-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n/* @flow */\n\n// Ported from https://github.com/Microsoft/vscode-debugadapter-node/blob/master/protocol/src/debugProtocol.ts\n\ndeclare module 'vscode-debugprotocol' {\n  declare interface base$ProtocolMessage {\n    /** Sequence number. */\n    seq: number,\n    /** One of 'request', 'response', or 'event'. */\n    +type: 'request' | 'response' | 'event',\n  }\n\n  declare type ProtocolMessage = Request | Event | Response;\n\n  declare interface base$Request extends base$ProtocolMessage {\n    type: 'request',\n    /** The command to execute. */\n    +command: string,\n    /** Object containing arguments for the command. */\n    +arguments?: any,\n  }\n\n  /** Server-initiated event. */\n  declare interface base$Event extends base$ProtocolMessage {\n    type: 'event',\n    /** Type of event. */\n    +event: string,\n    /** Event-specific information. */\n    +body?: any,\n  }\n\n  /** Response to a request. */\n  declare interface base$Response extends base$ProtocolMessage {\n    type: 'response',\n    /** Sequence number of the corresponding request. */\n    request_seq: number,\n    /** Outcome of the request. */\n    success: boolean,\n    /** The command requested. */\n    command: string,\n    /** Contains error message if success == false. */\n    message?: string,\n    /** Contains request result if success is true and optional error details if success is false. */\n    +body?: any,\n  }\n\n  declare interface InitializedEvent extends base$Event {\n    event: 'initialized',\n  }\n\n  declare interface StoppedEvent extends base$Event {\n    event: 'stopped',\n    body: {\n      /** The reason for the event (such as: 'step', 'breakpoint', 'exception', 'pause', 'entry').\n        For backward compatibility this string is shown in the UI if the 'description' attribute is missing (but it must not be translated).\n      */\n      reason: string,\n      /** The full reason for the event, e.g. 'Paused on exception'. This string is shown in the UI as is. */\n      description?: string,\n      /** The thread which was stopped. */\n      threadId?: number,\n      /** Additional information. E.g. if reason is 'exception', text contains the exception name. This string is shown in the UI. */\n      text?: string,\n      /** If allThreadsStopped is true, a debug adapter can announce that all threads have stopped.\n        *  The client should use this information to enable that all threads can be expanded to access their stacktraces.\n        *  If the attribute is missing or false, only the thread with the given threadId can be expanded.\n      */\n      allThreadsStopped?: boolean,\n    },\n  }\n\n  declare interface ContinuedEvent extends base$Event {\n    event: 'continued',\n    body: {\n      /** The thread which was continued. */\n      threadId: number,\n      /** If allThreadsContinued is true, a debug adapter can announce that all threads have continued. */\n      allThreadsContinued?: boolean,\n    },\n  }\n\n  /** Event message for 'exited' event type.\n    The event indicates that the debuggee has exited.\n  */\n  declare interface ExitedEvent extends base$Event {\n    event: 'exited',\n    body: {\n      /** The exit code returned from the debuggee. */\n      exitCode: number,\n    },\n  }\n\n  /** Event message for 'terminated' event types.\n    The event indicates that debugging of the debuggee has terminated.\n  */\n  declare interface TerminatedEvent extends base$Event {\n    event: 'terminated',\n    body?: {\n      /** A debug adapter may set 'restart' to true to request that the front end restarts the session. */\n      restart?: boolean,\n    },\n  }\n\n  /** Event message for 'thread' event type.\n    The event indicates that a thread has started or exited.\n  */\n  declare interface ThreadEvent extends base$Event {\n    event: 'thread',\n    body: {\n      /** The reason for the event (such as: 'started', 'exited'). */\n      reason: string,\n      /** The identifier of the thread. */\n      threadId: number,\n    },\n  }\n\n  /** Event message for 'output' event type.\n    The event indicates that the target has produced some output.\n  */\n  declare interface OutputEvent extends base$Event {\n    event: 'output',\n    body: {\n      /** The category of output (such as: 'console', 'stdout', 'stderr', 'telemetry'). If not specified, 'console' is assumed. */\n      category?: string,\n      /** The output to report. */\n      output: string,\n      /** If an attribute 'variablesReference' exists and its value is > 0, the output contains objects which can be retrieved by passing variablesReference to the VariablesRequest. */\n      variablesReference?: number,\n      /** Optional data to report. For the 'telemetry' category the data will be sent to telemetry, for the other categories the data is shown in JSON format. */\n      data?: any,\n    },\n  }\n\n  /** Event message for 'breakpoint' event type.\n    The event indicates that some information about a breakpoint has changed.\n  */\n  declare interface BreakpointEvent extends base$Event {\n    event: 'breakpoint',\n    body: {\n      /** The reason for the event (such as: 'changed', 'new'). */\n      reason: string,\n      /** The breakpoint. */\n      breakpoint: Breakpoint,\n    },\n  }\n\n  /** Event message for 'module' event type.\n    The event indicates that some information about a module has changed.\n  */\n  declare interface ModuleEvent extends base$Event {\n    event: 'module',\n    body: {\n      /** The reason for the event. */\n      reason: 'new' | 'changed' | 'removed',\n      /** The new, changed, or removed module. In case of 'removed' only the module id is used. */\n      module: Module,\n    },\n  }\n\n  /** runInTerminal request; value of command field is 'runInTerminal'.\n    With this request a debug adapter can run a command in a terminal.\n  */\n  declare interface RunInTerminalRequest extends base$Request {\n    command: 'runInTerminal',\n    arguments: RunInTerminalRequestArguments,\n  }\n\n  /** Arguments for 'runInTerminal' request. */\n  declare type RunInTerminalRequestArguments = {\n    /** What kind of terminal to launch. */\n    kind?: 'integrated' | 'external',\n    /** Optional title of the terminal. */\n    title?: string,\n    /** Working directory of the command. */\n    cwd: string,\n    /** List of arguments. The first argument is the command to run. */\n    args: string[],\n    /** Environment key-value pairs that are added to the default environment. */\n    env?: {[key: string]: string},\n  };\n\n  /** Response to Initialize request. */\n  declare interface RunInTerminalResponse extends base$Response {\n    body: {\n      /** The process ID. */\n      processId?: number,\n    },\n  }\n\n  /** On error that is whenever 'success' is false, the body can provide more details. */\n  declare interface ErrorResponse extends base$Response {\n    body: {\n      /** An optional, structured error message. */\n      error?: Message,\n    },\n  }\n\n  /** Initialize request; value of command field is 'initialize'. */\n  declare interface InitializeRequest extends base$Request {\n    command: 'initialize',\n    arguments: InitializeRequestArguments,\n  }\n\n  /** Arguments for 'initialize' request. */\n  declare type InitializeRequestArguments = {\n    /** The ID of the (frontend) client using this adapter. */\n    clientID?: string,\n    /** The ID of the debug adapter. */\n    adapterID: string,\n    /** If true all line numbers are 1-based (default). */\n    linesStartAt1?: boolean,\n    /** If true all column numbers are 1-based (default). */\n    columnsStartAt1?: boolean,\n    /** Determines in what format paths are specified. Possible values are 'path' or 'uri'. The default is 'path', which is the native format. */\n    pathFormat?: string,\n    /** Client supports the optional type attribute for variables. */\n    supportsVariableType?: boolean,\n    /** Client supports the paging of variables. */\n    supportsVariablePaging?: boolean,\n    /** Client supports the runInTerminal request. */\n    supportsRunInTerminalRequest?: boolean,\n  };\n\n  /** Response to 'initialize' request. */\n  declare interface InitializeResponse extends base$Response {\n    /** The capabilities of this debug adapter. */\n    body?: Capabilities,\n  }\n\n  /** ConfigurationDone request; value of command field is 'configurationDone'.\n    The client of the debug protocol must send this request at the end of the sequence of configuration requests (which was started by the InitializedEvent).\n  */\n  declare interface ConfigurationDoneRequest extends base$Request {\n    command: 'configurationDone',\n    arguments?: ConfigurationDoneArguments,\n  }\n\n  /** Arguments for 'configurationDone' request.\n    The configurationDone request has no standardized attributes.\n  */\n  declare type ConfigurationDoneArguments = {};\n\n  /** Response to 'configurationDone' request. This is just an acknowledgement, so no body field is required. */\n  declare interface ConfigurationDoneResponse extends base$Response {}\n\n  /** Launch request; value of command field is 'launch'. */\n  declare interface LaunchRequest extends base$Request {\n    command: 'launch',\n    arguments: LaunchRequestArguments,\n  }\n\n  /** Arguments for 'launch' request. */\n  declare type LaunchRequestArguments = {\n    /** If noDebug is true the launch request should launch the program without enabling debugging. */\n    noDebug?: boolean,\n  };\n\n  /** Response to 'launch' request. This is just an acknowledgement, so no body field is required. */\n  declare interface LaunchResponse extends base$Response {}\n\n  /** Attach request; value of command field is 'attach'. */\n  declare interface AttachRequest extends base$Request {\n    command: 'attach',\n    arguments: AttachRequestArguments,\n  }\n\n  /** Arguments for 'attach' request.\n    The attach request has no standardized attributes.\n  */\n  declare type AttachRequestArguments = {};\n\n  /** Response to 'attach' request. This is just an acknowledgement, so no body field is required. */\n  declare interface AttachResponse extends base$Response {}\n\n  /** Restart request; value of command field is 'restart'.\n    Restarts a debug session. If the capability 'supportsRestartRequest' is missing or has the value false,\n    the client will implement 'restart' by terminating the debug adapter first and then launching it anew.\n    A debug adapter can override this default behaviour by implementing a restart request\n    and setting the capability 'supportsRestartRequest' to true.\n  */\n  declare interface RestartRequest extends base$Request {\n    command: 'restart',\n    arguments?: RestartArguments,\n  }\n\n  /** Arguments for 'restart' request.\n    The restart request has no standardized attributes.\n  */\n  declare type RestartArguments = {};\n\n  /** Response to 'restart' request. This is just an acknowledgement, so no body field is required. */\n  declare interface RestartResponse extends base$Response {}\n\n  /** Disconnect request; value of command field is 'disconnect'. */\n  declare interface DisconnectRequest extends base$Request {\n    command: 'disconnect',\n    arguments?: DisconnectArguments,\n  }\n\n  /** Arguments for 'disconnect' request. */\n  declare type DisconnectArguments = {\n    /** Indicates whether the debuggee should be terminated when the debugger is disconnected.\n      If unspecified, the debug adapter is free to do whatever it thinks is best.\n      A client can only rely on this attribute being properly honored if a debug adapter returns true for the 'supportTerminateDebuggee' capability.\n    */\n    terminateDebuggee?: boolean,\n  };\n\n  /** Response to 'disconnect' request. This is just an acknowledgement, so no body field is required. */\n  declare interface DisconnectResponse extends base$Response {}\n\n  /** SetBreakpoints request; value of command field is 'setBreakpoints'.\n    Sets multiple breakpoints for a single source and clears all previous breakpoints in that source.\n    To clear all breakpoint for a source, specify an empty array.\n    When a breakpoint is hit, a StoppedEvent (event type 'breakpoint') is generated.\n  */\n  declare interface SetBreakpointsRequest extends base$Request {\n    command: 'setBreakpoints',\n    arguments: SetBreakpointsArguments,\n  }\n\n  /** Arguments for 'setBreakpoints' request. */\n  declare type SetBreakpointsArguments = {\n    /** The source location of the breakpoints; either source.path or source.reference must be specified. */\n    source: Source,\n    /** The code locations of the breakpoints. */\n    breakpoints?: SourceBreakpoint[],\n    /** Deprecated: The code locations of the breakpoints. */\n    lines?: number[],\n    /** A value of true indicates that the underlying source has been modified which results in new breakpoint locations. */\n    sourceModified?: boolean,\n  };\n\n  /** Response to 'setBreakpoints' request.\n    Returned is information about each breakpoint created by this request.\n    This includes the actual code location and whether the breakpoint could be verified.\n    The breakpoints returned are in the same order as the elements of the 'breakpoints'\n    (or the deprecated 'lines') in the SetBreakpointsArguments.\n  */\n  declare interface SetBreakpointsResponse extends base$Response {\n    body: {\n      /** Information about the breakpoints. The array elements are in the same order as the elements of the 'breakpoints' (or the deprecated 'lines') in the SetBreakpointsArguments. */\n      breakpoints: Breakpoint[],\n    },\n  }\n\n  /** SetFunctionBreakpoints request; value of command field is 'setFunctionBreakpoints'.\n    Sets multiple function breakpoints and clears all previous function breakpoints.\n    To clear all function breakpoint, specify an empty array.\n    When a function breakpoint is hit, a StoppedEvent (event type 'function breakpoint') is generated.\n  */\n  declare interface SetFunctionBreakpointsRequest extends base$Request {\n    command: 'setFunctionBreakpoints',\n    arguments: SetFunctionBreakpointsArguments,\n  }\n\n  /** Arguments for 'setFunctionBreakpoints' request. */\n  declare type SetFunctionBreakpointsArguments = {\n    /** The function names of the breakpoints. */\n    breakpoints: FunctionBreakpoint[],\n  };\n\n  /** Response to 'setFunctionBreakpoints' request.\n    Returned is information about each breakpoint created by this request.\n  */\n  declare interface SetFunctionBreakpointsResponse extends base$Response {\n    body: {\n      /** Information about the breakpoints. The array elements correspond to the elements of the 'breakpoints' array. */\n      breakpoints: Breakpoint[],\n    },\n  }\n\n  /** SetExceptionBreakpoints request; value of command field is 'setExceptionBreakpoints'.\n    The request configures the debuggers response to thrown exceptions. If an exception is configured to break, a StoppedEvent is fired (event type 'exception').\n  */\n  declare interface SetExceptionBreakpointsRequest extends base$Request {\n    command: 'setExceptionBreakpoints',\n    arguments: SetExceptionBreakpointsArguments,\n  }\n\n  /** Arguments for 'setExceptionBreakpoints' request. */\n  declare type SetExceptionBreakpointsArguments = {\n    /** IDs of checked exception options. The set of IDs is returned via the 'exceptionBreakpointFilters' capability. */\n    filters: string[],\n    /** Configuration options for selected exceptions. */\n    exceptionOptions?: ExceptionOptions[],\n  };\n\n  /** Response to 'setExceptionBreakpoints' request. This is just an acknowledgement, so no body field is required. */\n  declare interface SetExceptionBreakpointsResponse extends base$Response {}\n\n  /** Continue request; value of command field is 'continue'.\n    The request starts the debuggee to run again.\n  */\n  declare interface ContinueRequest extends base$Request {\n    command: 'continue',\n    arguments: ContinueArguments,\n  }\n\n  /** Arguments for 'continue' request. */\n  declare type ContinueArguments = {\n    /** Continue execution for the specified thread (if possible). If the backend cannot continue on a single thread but will continue on all threads, it should set the allThreadsContinued attribute in the response to true. */\n    threadId: number,\n  };\n\n  /** Response to 'continue' request. */\n  declare interface ContinueResponse extends base$Response {\n    body: {\n      /** If true, the continue request has ignored the specified thread and continued all threads instead. If this attribute is missing a value of 'true' is assumed for backward compatibility. */\n      allThreadsContinued?: boolean,\n    },\n  }\n\n  declare interface nuclide_ContinueToLocationRequest extends base$Request {\n    command: 'nuclide_continueToLocation',\n    arguments: nuclide_ContinueToLocationArguments,\n  }\n\n  /** Arguments for 'nuclide_continueToLocation' request. */\n  declare interface nuclide_ContinueToLocationArguments {\n    /** The source location for which the goto targets are determined. */\n    source: Source,\n    /** The line location for which the goto targets are determined. */\n    line: number,\n    /** An optional column location for which the goto targets are determined. */\n    column?: number,\n  }\n\n  /** Response to 'nuclide_continueToLocation' request. */\n  declare interface nuclide_ContinueToLocationResponse extends base$Response {}\n\n  /** Next request; value of command field is 'next'.\n    The request starts the debuggee to run again for one step.\n    The debug adapter first sends the NextResponse and then a StoppedEvent (event type 'step') after the step has completed.\n  */\n  declare interface NextRequest extends base$Request {\n    command: 'next',\n    arguments: NextArguments,\n  }\n\n  /** Arguments for 'next' request. */\n  declare type NextArguments = {\n    /** Execute 'next' for this thread. */\n    threadId: number,\n  };\n\n  /** Response to 'next' request. This is just an acknowledgement, so no body field is required. */\n  declare interface NextResponse extends base$Response {}\n\n  /** StepIn request; value of command field is 'stepIn'.\n    The request starts the debuggee to step into a function/method if possible.\n    If it cannot step into a target, 'stepIn' behaves like 'next'.\n    The debug adapter first sends the StepInResponse and then a StoppedEvent (event type 'step') after the step has completed.\n    If there are multiple function/method calls (or other targets) on the source line,\n    the optional argument 'targetId' can be used to control into which target the 'stepIn' should occur.\n    The list of possible targets for a given source line can be retrieved via the 'stepInTargets' request.\n  */\n  declare interface StepInRequest extends base$Request {\n    command: 'stepIn',\n    arguments: StepInArguments,\n  }\n\n  /** Arguments for 'stepIn' request. */\n  declare type StepInArguments = {\n    /** Execute 'stepIn' for this thread. */\n    threadId: number,\n    /** Optional id of the target to step into. */\n    targetId?: number,\n  };\n\n  /** Response to 'stepIn' request. This is just an acknowledgement, so no body field is required. */\n  declare interface StepInResponse extends base$Response {}\n\n  /** StepOut request; value of command field is 'stepOut'.\n    The request starts the debuggee to run again for one step.\n    The debug adapter first sends the StepOutResponse and then a StoppedEvent (event type 'step') after the step has completed.\n  */\n  declare interface StepOutRequest extends base$Request {\n    command: 'stepOut',\n    arguments: StepOutArguments,\n  }\n\n  /** Arguments for 'stepOut' request. */\n  declare type StepOutArguments = {\n    /** Execute 'stepOut' for this thread. */\n    threadId: number,\n  };\n\n  /** Response to 'stepOut' request. This is just an acknowledgement, so no body field is required. */\n  declare interface StepOutResponse extends base$Response {}\n\n  /** StepBack request; value of command field is 'stepBack'.\n    The request starts the debuggee to run one step backwards.\n    The debug adapter first sends the StepBackResponse and then a StoppedEvent (event type 'step') after the step has completed. Clients should only call this request if the capability supportsStepBack is true.\n  */\n  declare interface StepBackRequest extends base$Request {\n    command: 'stepBack',\n    arguments: StepBackArguments,\n  }\n\n  /** Arguments for 'stepBack' request. */\n  declare type StepBackArguments = {\n    /** Exceute 'stepBack' for this thread. */\n    threadId: number,\n  };\n\n  /** Response to 'stepBack' request. This is just an acknowledgement, so no body field is required. */\n  declare interface StepBackResponse extends base$Response {}\n\n  /** ReverseContinue request; value of command field is 'reverseContinue'.\n    The request starts the debuggee to run backward. Clients should only call this request if the capability supportsStepBack is true.\n  */\n  declare interface ReverseContinueRequest extends base$Request {\n    command: 'reverseContinue',\n    arguments: ReverseContinueArguments,\n  }\n\n  /** Arguments for 'reverseContinue' request. */\n  declare type ReverseContinueArguments = {\n    /** Exceute 'reverseContinue' for this thread. */\n    threadId: number,\n  };\n\n  /** Response to 'reverseContinue' request. This is just an acknowledgement, so no body field is required. */\n  declare interface ReverseContinueResponse extends base$Response {}\n\n  /** RestartFrame request; value of command field is 'restartFrame'.\n    The request restarts execution of the specified stackframe.\n    The debug adapter first sends the RestartFrameResponse and then a StoppedEvent (event type 'restart') after the restart has completed.\n  */\n  declare interface RestartFrameRequest extends base$Request {\n    command: 'restartFrame',\n    arguments: RestartFrameArguments,\n  }\n\n  /** Arguments for 'restartFrame' request. */\n  declare type RestartFrameArguments = {\n    /** Restart this stackframe. */\n    frameId: number,\n  };\n\n  /** Response to 'restartFrame' request. This is just an acknowledgement, so no body field is required. */\n  declare interface RestartFrameResponse extends base$Response {}\n\n  /** Goto request; value of command field is 'goto'.\n    The request sets the location where the debuggee will continue to run.\n    This makes it possible to skip the execution of code or to executed code again.\n    The code between the current location and the goto target is not executed but skipped.\n    The debug adapter first sends the GotoResponse and then a StoppedEvent (event type 'goto').\n  */\n  declare interface GotoRequest extends base$Request {\n    command: 'goto',\n    arguments: GotoArguments,\n  }\n\n  /** Arguments for 'goto' request. */\n  declare type GotoArguments = {\n    /** Set the goto target for this thread. */\n    threadId: number,\n    /** The location where the debuggee will continue to run. */\n    targetId: number,\n  };\n\n  /** Response to 'goto' request. This is just an acknowledgement, so no body field is required. */\n  declare interface GotoResponse extends base$Response {}\n\n  /** Pause request; value of command field is 'pause'.\n    The request suspenses the debuggee.\n    The debug adapter first sends the PauseResponse and then a StoppedEvent (event type 'pause') after the thread has been paused successfully.\n  */\n  declare interface PauseRequest extends base$Request {\n    command: 'pause',\n    arguments: PauseArguments,\n  }\n\n  /** Arguments for 'pause' request. */\n  declare type PauseArguments = {\n    /** Pause execution for this thread. */\n    threadId: number,\n  };\n\n  /** Response to 'pause' request. This is just an acknowledgement, so no body field is required. */\n  declare interface PauseResponse extends base$Response {}\n\n  /** StackTrace request; value of command field is 'stackTrace'. The request returns a stacktrace from the current execution state. */\n  declare interface StackTraceRequest extends base$Request {\n    command: 'stackTrace',\n    arguments: StackTraceArguments,\n  }\n\n  /** Arguments for 'stackTrace' request. */\n  declare type StackTraceArguments = {\n    /** Retrieve the stacktrace for this thread. */\n    threadId: number,\n    /** The index of the first frame to return; if omitted frames start at 0. */\n    startFrame?: number,\n    /** The maximum number of frames to return. If levels is not specified or 0, all frames are returned. */\n    levels?: number,\n    /** Specifies details on how to format the stack frames. */\n    format?: StackFrameFormat,\n  };\n\n  /** Response to 'stackTrace' request. */\n  declare interface StackTraceResponse extends base$Response {\n    body: {\n      /** The frames of the stackframe. If the array has length zero, there are no stackframes available.\n        This means that there is no location information available.\n      */\n      stackFrames: StackFrame[],\n      /** The total number of frames available. */\n      totalFrames?: number,\n    },\n  }\n\n  /** Scopes request; value of command field is 'scopes'.\n    The request returns the variable scopes for a given stackframe ID.\n  */\n  declare interface ScopesRequest extends base$Request {\n    command: 'scopes',\n    arguments: ScopesArguments,\n  }\n\n  /** Arguments for 'scopes' request. */\n  declare type ScopesArguments = {\n    /** Retrieve the scopes for this stackframe. */\n    frameId: number,\n  };\n\n  /** Response to 'scopes' request. */\n  declare interface ScopesResponse extends base$Response {\n    body: {\n      /** The scopes of the stackframe. If the array has length zero, there are no scopes available. */\n      scopes: Scope[],\n    },\n  }\n\n  /** Variables request; value of command field is 'variables'.\n    Retrieves all child variables for the given variable reference.\n    An optional filter can be used to limit the fetched children to either named or indexed children.\n  */\n  declare interface VariablesRequest extends base$Request {\n    command: 'variables',\n    arguments: VariablesArguments,\n  }\n\n  /** Arguments for 'variables' request. */\n  declare type VariablesArguments = {\n    /** The Variable reference. */\n    variablesReference: number,\n    /** Optional filter to limit the child variables to either named or indexed. If omitted, both types are fetched. */\n    filter?: 'indexed' | 'named',\n    /** The index of the first variable to return; if omitted children start at 0. */\n    start?: number,\n    /** The number of variables to return. If count is missing or 0, all variables are returned. */\n    count?: number,\n    /** Specifies details on how to format the Variable values. */\n    format?: ValueFormat,\n  };\n\n  /** Response to 'variables' request. */\n  declare interface VariablesResponse extends base$Response {\n    body: {\n      /** All (or a range) of variables for the given variable reference. */\n      variables: Variable[],\n    },\n  }\n\n  /** setVariable request; value of command field is 'setVariable'.\n    Set the variable with the given name in the variable container to a new value.\n  */\n  declare interface SetVariableRequest extends base$Request {\n    command: 'setVariable',\n    arguments: SetVariableArguments,\n  }\n\n  /** Arguments for 'setVariable' request. */\n  declare type SetVariableArguments = {\n    /** The reference of the variable container. */\n    variablesReference: number,\n    /** The name of the variable. */\n    name: string,\n    /** The value of the variable. */\n    value: string,\n    /** Specifies details on how to format the response value. */\n    format?: ValueFormat,\n  };\n\n  /** Response to 'setVariable' request. */\n  declare interface SetVariableResponse extends base$Response {\n    body: {\n      /** The new value of the variable. */\n      value: string,\n      /** The type of the new value. Typically shown in the UI when hovering over the value. */\n      type?: string,\n      /** If variablesReference is > 0, the new value is structured and its children can be retrieved by passing variablesReference to the VariablesRequest. */\n      variablesReference?: number,\n      /** The number of named child variables.\n        The client can use this optional information to present the variables in a paged UI and fetch them in chunks.\n      */\n      namedVariables?: number,\n      /** The number of indexed child variables.\n        The client can use this optional information to present the variables in a paged UI and fetch them in chunks.\n      */\n      indexedVariables?: number,\n    },\n  }\n\n  /** Source request; value of command field is 'source'.\n    The request retrieves the source code for a given source reference.\n  */\n  declare interface SourceRequest extends base$Request {\n    command: 'source',\n    arguments: SourceArguments,\n  }\n\n  /** Arguments for 'source' request. */\n  declare type SourceArguments = {\n    /** Specifies the source content to load. Either source.path or source.sourceReference must be specified. */\n    source?: Source,\n    /** The reference to the source. This is the same as source.sourceReference. This is provided for backward compatibility since old backends do not understand the 'source' attribute. */\n    sourceReference: number,\n  };\n\n  /** Response to 'source' request. */\n  declare interface SourceResponse extends base$Response {\n    body: {\n      /** Content of the source reference. */\n      content: string,\n      /** Optional content type (mime type) of the source. */\n      mimeType?: string,\n    },\n  }\n\n  /** Thread request; value of command field is 'threads'.\n    The request retrieves a list of all threads.\n  */\n  declare interface ThreadsRequest extends base$Request {\n    command: 'threads',\n  }\n\n  /** Response to 'threads' request. */\n  declare interface ThreadsResponse extends base$Response {\n    body: {\n      /** All threads. */\n      threads: Thread[],\n    },\n  }\n\n  /** Modules can be retrieved from the debug adapter with the ModulesRequest which can either return all modules or a range of modules to support paging. */\n  declare interface ModulesRequest extends base$Request {\n    command: 'modules',\n    arguments: ModulesArguments,\n  }\n\n  /** Arguments for 'modules' request. */\n  declare type ModulesArguments = {\n    /** The index of the first module to return; if omitted modules start at 0. */\n    startModule?: number,\n    /** The number of modules to return. If moduleCount is not specified or 0, all modules are returned. */\n    moduleCount?: number,\n  };\n\n  /** Response to 'modules' request. */\n  declare interface ModulesResponse extends base$Response {\n    body: {\n      /** All modules or range of modules. */\n      modules: Module[],\n      /** The total number of modules available. */\n      totalModules?: number,\n    },\n  }\n\n  /** Evaluate request; value of command field is 'evaluate'.\n    Evaluates the given expression in the context of the top most stack frame.\n    The expression has access to any variables and arguments that are in scope.\n  */\n  declare interface EvaluateRequest extends base$Request {\n    command: 'evaluate',\n    arguments: EvaluateArguments,\n  }\n\n  /** Arguments for 'evaluate' request. */\n  declare type EvaluateArguments = {\n    /** The expression to evaluate. */\n    expression: string,\n    /** Evaluate the expression in the scope of this stack frame. If not specified, the expression is evaluated in the global scope. */\n    frameId?: number,\n    /** The context in which the evaluate request is run. Possible values are 'watch' if evaluate is run in a watch, 'repl' if run from the REPL console, or 'hover' if run from a data hover. */\n    context?: string,\n    /** Specifies details on how to format the Evaluate result. */\n    format?: ValueFormat,\n  };\n\n  /** Response to 'evaluate' request. */\n  declare interface EvaluateResponse extends base$Response {\n    body: {\n      /** The result of the evaluate request. */\n      result: string,\n      /** The optional type of the evaluate result. */\n      type?: string,\n      /** If variablesReference is > 0, the evaluate result is structured and its children can be retrieved by passing variablesReference to the VariablesRequest. */\n      variablesReference: number,\n      /** The number of named child variables.\n        The client can use this optional information to present the variables in a paged UI and fetch them in chunks.\n      */\n      namedVariables?: number,\n      /** The number of indexed child variables.\n        The client can use this optional information to present the variables in a paged UI and fetch them in chunks.\n      */\n      indexedVariables?: number,\n    },\n  }\n\n  /** StepInTargets request; value of command field is 'stepInTargets'.\n    This request retrieves the possible stepIn targets for the specified stack frame.\n    These targets can be used in the 'stepIn' request.\n    The StepInTargets may only be called if the 'supportsStepInTargetsRequest' capability exists and is true.\n  */\n  declare interface StepInTargetsRequest extends base$Request {\n    command: 'stepInTargets',\n    arguments: StepInTargetsArguments,\n  }\n\n  /** Arguments for 'stepInTargets' request. */\n  declare type StepInTargetsArguments = {\n    /** The stack frame for which to retrieve the possible stepIn targets. */\n    frameId: number,\n  };\n\n  /** Response to 'stepInTargets' request. */\n  declare interface StepInTargetsResponse extends base$Response {\n    body: {\n      /** The possible stepIn targets of the specified source location. */\n      targets: StepInTarget[],\n    },\n  }\n\n  /** GotoTargets request; value of command field is 'gotoTargets'.\n    This request retrieves the possible goto targets for the specified source location.\n    These targets can be used in the 'goto' request.\n    The GotoTargets request may only be called if the 'supportsGotoTargetsRequest' capability exists and is true.\n  */\n  declare interface GotoTargetsRequest extends base$Request {\n    command: 'gotoTargets',\n    arguments: GotoTargetsArguments,\n  }\n\n  /** Arguments for 'gotoTargets' request. */\n  declare type GotoTargetsArguments = {\n    /** The source location for which the goto targets are determined. */\n    source: Source,\n    /** The line location for which the goto targets are determined. */\n    line: number,\n    /** An optional column location for which the goto targets are determined. */\n    column?: number,\n  };\n\n  /** Response to 'gotoTargets' request. */\n  declare interface GotoTargetsResponse extends base$Response {\n    body: {\n      /** The possible goto targets of the specified location. */\n      targets: GotoTarget[],\n    },\n  }\n\n  /** CompletionsRequest request; value of command field is 'completions'.\n    Returns a list of possible completions for a given caret position and text.\n    The CompletionsRequest may only be called if the 'supportsCompletionsRequest' capability exists and is true.\n  */\n  declare interface CompletionsRequest extends base$Request {\n    command: 'completions',\n    arguments: CompletionsArguments,\n  }\n\n  /** Arguments for 'completions' request. */\n  declare type CompletionsArguments = {\n    /** Returns completions in the scope of this stack frame. If not specified, the completions are returned for the global scope. */\n    frameId?: number,\n    /** One or more source lines. Typically this is the text a user has typed into the debug console before he asked for completion. */\n    text: string,\n    /** The character position for which to determine the completion proposals. */\n    column: number,\n    /** An optional line for which to determine the completion proposals. If missing the first line of the text is assumed. */\n    line?: number,\n  };\n\n  /** Response to 'completions' request. */\n  declare interface CompletionsResponse extends base$Response {\n    body: {\n      /** The possible completions for . */\n      targets: CompletionItem[],\n    },\n  }\n\n  /** ExceptionInfoRequest request; value of command field is 'exceptionInfo'.\n    Retrieves the details of the exception that caused the StoppedEvent to be raised.\n  */\n  declare interface ExceptionInfoRequest extends base$Request {\n    command: 'exceptionInfo',\n    arguments: ExceptionInfoArguments,\n  }\n\n  /** Arguments for 'exceptionInfo' request. */\n  declare interface ExceptionInfoArguments {\n    /** Thread for which exception information should be retrieved. */\n    threadId: number,\n  }\n\n  /** Response to 'exceptionInfo' request. */\n  declare interface ExceptionInfoResponse extends base$Response {\n    body: {\n      /** ID of the exception that was thrown. */\n      exceptionId: string,\n      /** Descriptive text for the exception provided by the debug adapter. */\n      description?: string,\n      /** Mode that caused the exception notification to be raised. */\n      breakMode: ExceptionBreakMode,\n      /** Detailed information about the exception. */\n      details?: ExceptionDetails,\n    },\n  }\n\n  declare interface CustomRequest extends base$Request {}\n  declare interface CustomResponse extends base$Response {}\n\n  declare type Request =\n    | RunInTerminalRequest\n    | InitializeRequest\n    | ConfigurationDoneRequest\n    | LaunchRequest\n    | AttachRequest\n    | RestartRequest\n    | DisconnectRequest\n    | SetBreakpointsRequest\n    | SetFunctionBreakpointsRequest\n    | SetExceptionBreakpointsRequest\n    | ContinueRequest\n    | NextRequest\n    | StepInRequest\n    | StepOutRequest\n    | StepBackRequest\n    | ReverseContinueRequest\n    | RestartFrameRequest\n    | GotoRequest\n    | PauseRequest\n    | StackTraceRequest\n    | ScopesRequest\n    | VariablesRequest\n    | SetVariableRequest\n    | SourceRequest\n    | ThreadsRequest\n    | ModulesRequest\n    | EvaluateRequest\n    | StepInTargetsRequest\n    | GotoTargetsRequest\n    | CompletionsRequest\n    | ExceptionInfoRequest\n    | nuclide_ContinueToLocationRequest\n    | CustomRequest;\n  declare type Response =\n    | RunInTerminalResponse\n    | InitializeResponse\n    | ConfigurationDoneResponse\n    | LaunchResponse\n    | AttachResponse\n    | RestartResponse\n    | DisconnectResponse\n    | SetBreakpointsResponse\n    | SetFunctionBreakpointsResponse\n    | SetExceptionBreakpointsResponse\n    | ContinueResponse\n    | NextResponse\n    | StepInResponse\n    | StepOutResponse\n    | StepBackResponse\n    | ReverseContinueResponse\n    | RestartFrameResponse\n    | GotoResponse\n    | PauseResponse\n    | StackTraceResponse\n    | ScopesResponse\n    | VariablesResponse\n    | SetVariableResponse\n    | SourceResponse\n    | ThreadsResponse\n    | ModulesResponse\n    | EvaluateResponse\n    | StepInTargetsResponse\n    | GotoTargetsResponse\n    | CompletionsResponse\n    | ExceptionInfoResponse\n    | nuclide_ContinueToLocationResponse\n    | CustomResponse;\n  declare type Event =\n    | InitializedEvent\n    | StoppedEvent\n    | ContinuedEvent\n    | ExitedEvent\n    | TerminatedEvent\n    | ThreadEvent\n    | OutputEvent\n    | BreakpointEvent\n    | ModuleEvent;\n\n  declare type Capabilities = {\n    /** The debug adapter supports the configurationDoneRequest. */\n    supportsConfigurationDoneRequest?: boolean,\n    /** The debug adapter supports function breakpoints. */\n    supportsFunctionBreakpoints?: boolean,\n    /** The debug adapter supports conditional breakpoints. */\n    supportsConditionalBreakpoints?: boolean,\n    /** The debug adapter supports breakpoints that break execution after a specified number of hits. */\n    supportsHitConditionalBreakpoints?: boolean,\n    /** The debug adapter supports a (side effect free) evaluate request for data hovers. */\n    supportsEvaluateForHovers?: boolean,\n    /** Available filters or options for the setExceptionBreakpoints request. */\n    exceptionBreakpointFilters?: ExceptionBreakpointsFilter[],\n    /** The debug adapter supports stepping back via the stepBack and reverseContinue requests. */\n    supportsStepBack?: boolean,\n    /** The debug adapter supports setting a variable to a value. */\n    supportsSetVariable?: boolean,\n    /** The debug adapter supports restarting a frame. */\n    supportsRestartFrame?: boolean,\n    /** The debug adapter supports the gotoTargetsRequest. */\n    supportsGotoTargetsRequest?: boolean,\n    /** The debug adapter supports the stepInTargetsRequest. */\n    supportsStepInTargetsRequest?: boolean,\n    /** The debug adapter supports the completionsRequest. */\n    supportsCompletionsRequest?: boolean,\n    /** The debug adapter supports the modules request. */\n    supportsModulesRequest?: boolean,\n    /** The set of additional module information exposed by the debug adapter. */\n    // additionalModuleColumns?: ColumnDescriptor[];\n    /** Checksum algorithms supported by the debug adapter. */\n    // supportedChecksumAlgorithms?: ChecksumAlgorithm[];\n    /** The debug adapter supports the RestartRequest. In this case a client should not implement 'restart' by terminating and relaunching the adapter but by calling the RestartRequest. */\n    supportsRestartRequest?: boolean,\n    /** The debug adapter supports 'exceptionOptions' on the setExceptionBreakpoints request. */\n    supportsExceptionOptions?: boolean,\n    /** The debug adapter supports a 'format' attribute on the stackTraceRequest, variablesRequest, and evaluateRequest. */\n    supportsValueFormattingOptions?: boolean,\n    /** The debug adapter supports the exceptionInfo request. */\n    supportsExceptionInfoRequest?: boolean,\n    /** The debug adapter supports the 'terminateDebuggee' attribute on the 'disconnect' request. */\n    supportTerminateDebuggee?: boolean,\n  };\n\n  /** An ExceptionBreakpointsFilter is shown in the UI as an option for configuring how exceptions are dealt with. */\n  declare type ExceptionBreakpointsFilter = {\n    /** The internal ID of the filter. This value is passed to the setExceptionBreakpoints request. */\n    filter: string,\n    /** The name of the filter. This will be shown in the UI. */\n    label: string,\n    /** Initial value of the filter. If not specified a value 'false' is assumed. */\n    default?: boolean,\n  };\n\n  /** A structured message object. Used to return errors from requests. */\n  declare type Message = {\n    /** Unique identifier for the message. */\n    id: number,\n    /** A format string for the message. Embedded variables have the form '{name}'.\n      If variable name starts with an underscore character, the variable does not contain user data (PII) and can be safely used for telemetry purposes.\n    */\n    format: string,\n    /** An object used as a dictionary for looking up the variables in the format string. */\n    variables?: {[key: string]: string},\n    /** If true send to telemetry. */\n    sendTelemetry?: boolean,\n    /** If true show user. */\n    showUser?: boolean,\n    /** An optional url where additional information about this message can be found. */\n    url?: string,\n    /** An optional label that is presented to the user as the UI for opening the url. */\n    urlLabel?: string,\n  };\n\n  /** A Module object represents a row in the modules view.\n    Two attributes are mandatory: an id identifies a module in the modules view and is used in a ModuleEvent for identifying a module for adding, updating or deleting.\n    The name is used to minimally render the module in the UI.\n\n    Additional attributes can be added to the module. They will show up in the module View if they have a corresponding ColumnDescriptor.\n\n    To avoid an unnecessary proliferation of additional attributes with similar semantics but different names\n    we recommend to re-use attributes from the 'recommended' list below first, and only introduce new attributes if nothing appropriate could be found.\n  */\n  declare type Module = {\n    /** Unique identifier for the module. */\n    id: number | string,\n    /** A name of the module. */\n    name: string,\n    /** optional but recommended attributes.\n      always try to use these first before introducing additional attributes.\n\n      Logical full path to the module. The exact definition is implementation defined, but usually this would be a full path to the on-disk file for the module.\n    */\n    path?: string,\n    /** True if the module is optimized. */\n    isOptimized?: boolean,\n    /** True if the module is considered 'user code' by a debugger that supports 'Just My Code'. */\n    isUserCode?: boolean,\n    /** Version of Module. */\n    version?: string,\n    /** User understandable description of if symbols were found for the module (ex: 'Symbols Loaded', 'Symbols not found', etc. */\n    symbolStatus?: string,\n    /** Logical full path to the symbol file. The exact definition is implementation defined. */\n    symbolFilePath?: string,\n    /** Module created or modified. */\n    dateTimeStamp?: string,\n    /** Address range covered by this module. */\n    addressRange?: string,\n  };\n\n  /** A ColumnDescriptor specifies what module attribute to show in a column of the ModulesView, how to format it, and what the column's label should be.\n    It is only used if the underlying UI actually supports this level of customization.\n  */\n  declare type ColumnDescriptor = {\n    /** Name of the attribute rendered in this column. */\n    attributeName: string,\n    /** Header UI label of column. */\n    label: string,\n    /** Format to use for the rendered values in this column. TBD how the format strings looks like. */\n    format?: string,\n    /** Datatype of values in this column.  Defaults to 'string' if not specified. */\n    type?: 'string' | 'number' | 'boolean' | 'unixTimestampUTC',\n    /** Width of this column in characters (hint only). */\n    width?: number,\n  };\n\n  /** The ModulesViewDescriptor is the container for all declarative configuration options of a ModuleView.\n    For now it only specifies the columns to be shown in the modules view.\n  */\n  declare type ModulesViewDescriptor = {\n    columns: ColumnDescriptor[],\n  };\n\n  /** A Thread */\n  declare type Thread = {\n    /** Unique identifier for the thread. */\n    id: number,\n    /** A name of the thread. */\n    name: string,\n  };\n\n  /** A Source is a descriptor for source code. It is returned from the debug adapter as part of a StackFrame and it is used by clients when specifying breakpoints. */\n  declare type Source = {\n    /** The short name of the source. Every source returned from the debug adapter has a name. When sending a source to the debug adapter this name is optional. */\n    name?: string,\n    /** The path of the source to be shown in the UI. It is only used to locate and load the content of the source if no sourceReference is specified (or its vaule is 0). */\n    path?: string,\n    /** If sourceReference > 0 the contents of the source must be retrieved through the SourceRequest (even if a path is specified). A sourceReference is only valid for a session, so it must not be used to persist a source. */\n    sourceReference?: number,\n    /** An optional hint for how to present the source in the UI. A value of 'deemphasize' can be used to indicate that the source is not available or that it is skipped on stepping. */\n    presentationHint?: 'emphasize' | 'deemphasize',\n    /** The (optional) origin of this source: possible values 'internal module', 'inlined content from source map', etc. */\n    origin?: string,\n    /** Optional data that a debug adapter might want to loop through the client. The client should leave the data intact and persist it across sessions. The client should not interpret the data. */\n    adapterData?: any,\n    /** The checksums associated with this file. */\n    checksums?: Checksum[],\n  };\n\n  /** A Stackframe contains the source location. */\n  declare type StackFrame = {\n    /** An identifier for the stack frame. It must be unique across all threads. This id can be used to retrieve the scopes of the frame with the 'scopesRequest' or to restart the execution of a stackframe. */\n    id: number,\n    /** The name of the stack frame, typically a method name. */\n    name: string,\n    /** The optional source of the frame. */\n    source?: Source,\n    /** The line within the file of the frame. If source is null or doesn't exist, line is 0 and must be ignored. */\n    line: number,\n    /** The column within the line. If source is null or doesn't exist, column is 0 and must be ignored. */\n    column: number,\n    /** An optional end line of the range covered by the stack frame. */\n    endLine?: number,\n    /** An optional end column of the range covered by the stack frame. */\n    endColumn?: number,\n    /** The module associated with this frame, if any. */\n    moduleId?: number | string,\n    /** An optional hint for how to present this frame in the UI. A value of 'label' can be used to indicate that the frame is an artificial frame that is used as a visual label or separator. */\n    presentationHint?: 'normal' | 'label',\n  };\n\n  /** A Scope is a named container for variables. Optionally a scope can map to a source or a range within a source. */\n  declare type Scope = {\n    /** Name of the scope such as 'Arguments', 'Locals'. */\n    name: string,\n    /** The variables of this scope can be retrieved by passing the value of variablesReference to the VariablesRequest. */\n    variablesReference: number,\n    /** The number of named variables in this scope.\n      The client can use this optional information to present the variables in a paged UI and fetch them in chunks.\n    */\n    namedVariables?: number,\n    /** The number of indexed variables in this scope.\n      The client can use this optional information to present the variables in a paged UI and fetch them in chunks.\n    */\n    indexedVariables?: number,\n    /** If true, the number of variables in this scope is large or expensive to retrieve. */\n    expensive: boolean,\n    /** Optional source for this scope. */\n    source?: Source,\n    /** Optional start line of the range covered by this scope. */\n    line?: number,\n    /** Optional start column of the range covered by this scope. */\n    column?: number,\n    /** Optional end line of the range covered by this scope. */\n    endLine?: number,\n    /** Optional end column of the range covered by this scope. */\n    endColumn?: number,\n  };\n\n  /** A Variable is a name/value pair.\n    Optionally a variable can have a 'type' that is shown if space permits or when hovering over the variable's name.\n    An optional 'kind' is used to render additional properties of the variable, e.g. different icons can be used to indicate that a variable is public or private.\n    If the value is structured (has children), a handle is provided to retrieve the children with the VariablesRequest.\n    If the number of named or indexed children is large, the numbers should be returned via the optional 'namedVariables' and 'indexedVariables' attributes.\n    The client can use this optional information to present the children in a paged UI and fetch them in chunks.\n  */\n  declare type Variable = {\n    /** The variable's name. */\n    name: string,\n    /** The variable's value. This can be a multi-line text, e.g. for a function the body of a function. */\n    value: string,\n    /** The type of the variable's value. Typically shown in the UI when hovering over the value. */\n    type?: string,\n    /** Properties of a variable that can be used to determine how to render the variable in the UI. Format of the string value: TBD. */\n    kind?: string,\n    /** Optional evaluatable name of this variable which can be passed to the 'EvaluateRequest' to fetch the variable's value. */\n    evaluateName?: string,\n    /** If variablesReference is > 0, the variable is structured and its children can be retrieved by passing variablesReference to the VariablesRequest. */\n    variablesReference: number,\n    /** The number of named child variables.\n      The client can use this optional information to present the children in a paged UI and fetch them in chunks.\n    */\n    namedVariables?: number,\n    /** The number of indexed child variables.\n      The client can use this optional information to present the children in a paged UI and fetch them in chunks.\n    */\n    indexedVariables?: number,\n  };\n\n  /** Properties of a breakpoint passed to the setBreakpoints request. */\n  declare type SourceBreakpoint = {\n    /** The source line of the breakpoint. */\n    line: number,\n    /** An optional source column of the breakpoint. */\n    column?: number,\n    /** An optional expression for conditional breakpoints. */\n    condition?: string,\n    /** An optional expression that controls how many hits of the breakpoint are ignored. The backend is expected to interpret the expression as needed. */\n    hitCondition?: string,\n  };\n\n  /** Properties of a breakpoint passed to the setFunctionBreakpoints request. */\n  declare type FunctionBreakpoint = {\n    /** The name of the function. */\n    name: string,\n    /** An optional expression for conditional breakpoints. */\n    condition?: string,\n    /** An optional expression that controls how many hits of the breakpoint are ignored. The backend is expected to interpret the expression as needed. */\n    hitCondition?: string,\n  };\n\n  /** Information about a Breakpoint created in setBreakpoints or setFunctionBreakpoints. */\n  declare type Breakpoint = {\n    /** An optional unique identifier for the breakpoint. */\n    id?: number,\n    /** If true breakpoint could be set (but not necessarily at the desired location). */\n    verified: boolean,\n    /** An optional message about the state of the breakpoint. This is shown to the user and can be used to explain why a breakpoint could not be verified. */\n    message?: string,\n    /** The source where the breakpoint is located. */\n    source?: Source,\n    /** The start line of the actual range covered by the breakpoint. */\n    line?: number,\n    /** An optional start column of the actual range covered by the breakpoint. */\n    column?: number,\n    /** An optional end line of the actual range covered by the breakpoint. */\n    endLine?: number,\n    /** An optional end column of the actual range covered by the breakpoint. If no end line is given, then the end column is assumed to be in the start line. */\n    endColumn?: number,\n\n    /** Nuclide custom extensions **/\n    nuclide_hitCount?: number,\n  };\n\n  /** A StepInTarget can be used in the 'stepIn' request and determines into which single target the stepIn request should step. */\n  declare type StepInTarget = {\n    /** Unique identifier for a stepIn target. */\n    id: number,\n    /** The name of the stepIn target (shown in the UI). */\n    label: string,\n  };\n\n  /** A GotoTarget describes a code location that can be used as a target in the 'goto' request.\n    The possible goto targets can be determined via the 'gotoTargets' request.\n  */\n  declare type GotoTarget = {\n    /** Unique identifier for a goto target. This is used in the goto request. */\n    id: number,\n    /** The name of the goto target (shown in the UI). */\n    label: string,\n    /** The line of the goto target. */\n    line: number,\n    /** An optional column of the goto target. */\n    column?: number,\n    /** An optional end line of the range covered by the goto target. */\n    endLine?: number,\n    /** An optional end column of the range covered by the goto target. */\n    endColumn?: number,\n  };\n\n  /** CompletionItems are the suggestions returned from the CompletionsRequest. */\n  declare type CompletionItem = {\n    /** The label of this completion item. By default this is also the text that is inserted when selecting this completion. */\n    label: string,\n    /** If text is not falsy then it is inserted instead of the label. */\n    text?: string,\n    /** The item's type. Typically the client uses this information to render the item in the UI with an icon. */\n    type?: CompletionItemType,\n    /** This value determines the location (in the CompletionsRequest's 'text' attribute) where the completion text is added.\n      If missing the text is added at the location specified by the CompletionsRequest's 'column' attribute.\n    */\n    start?: number,\n    /** This value determines how many characters are overwritten by the completion text.\n      If missing the value 0 is assumed which results in the completion text being inserted.\n    */\n    length?: number,\n  };\n\n  /** Some predefined types for the CompletionItem. Please note that not all clients have specific icons for all of them. */\n  declare type CompletionItemType =\n    | 'method'\n    | 'function'\n    | 'constructor'\n    | 'field'\n    | 'variable'\n    | 'class'\n    | 'interface'\n    | 'module'\n    | 'property'\n    | 'unit'\n    | 'value'\n    | 'enum'\n    | 'keyword'\n    | 'snippet'\n    | 'text'\n    | 'color'\n    | 'file'\n    | 'reference'\n    | 'customcolor';\n\n  /** Names of checksum algorithms that may be supported by a debug adapter. */\n  declare type ChecksumAlgorithm = 'MD5' | 'SHA1' | 'SHA256' | 'timestamp';\n\n  /** The checksum of an item calculated by the specified algorithm. */\n  declare type Checksum = {\n    /** The algorithm used to calculate this checksum. */\n    algorithm: ChecksumAlgorithm,\n    /** Value of the checksum. */\n    checksum: string,\n  };\n\n  /** Provides formatting information for a value. */\n  declare type ValueFormat = {\n    /** Display the value in hex. */\n    hex?: boolean,\n  };\n\n  /** Provides formatting information for a stack frame. */\n  declare type StackFrameFormat = ValueFormat & {\n    /** Displays parameters for the stack frame. */\n    parameters?: boolean,\n    /** Displays the types of parameters for the stack frame. */\n    parameterTypes?: boolean,\n    /** Displays the names of parameters for the stack frame. */\n    parameterNames?: boolean,\n    /** Displays the values of parameters for the stack frame. */\n    parameterValues?: boolean,\n    /** Displays the line number of the stack frame. */\n    line?: boolean,\n    /** Displays the module of the stack frame. */\n    module?: boolean,\n  };\n\n  /** An ExceptionOptions assigns configuration options to a set of exceptions. */\n  declare type ExceptionOptions = {\n    /** A path that selects a single or multiple exceptions in a tree. If 'path' is missing, the whole tree is selected. By convention the first segment of the path is a category that is used to group exceptions in the UI. */\n    path?: ExceptionPathSegment[],\n    /** Condition when a thrown exception should result in a break. */\n    breakMode: ExceptionBreakMode,\n  };\n\n  /** This enumeration defines all possible conditions when a thrown exception should result in a break.\n    never: never breaks,\n    always: always breaks,\n    unhandled: breaks when excpetion unhandled,\n    userUnhandled: breaks if the exception is not handled by user code.\n  */\n  declare type ExceptionBreakMode =\n    | 'never'\n    | 'always'\n    | 'unhandled'\n    | 'userUnhandled';\n\n  /** An ExceptionPathSegment represents a segment in a path that is used to match leafs or nodes in a tree of exceptions. If a segment consists of more than one name, it matches the names provided if 'negate' is false or missing or it matches anything except the names provided if 'negate' is true. */\n  declare type ExceptionPathSegment = {\n    /** If false or missing this segment matches the names provided, otherwise it matches anything except the names provided. */\n    negate?: boolean,\n    /** Depending on the value of 'negate' the names that should match or not match. */\n    names: string[],\n  };\n\n  /** Detailed information about an exception that has occurred. */\n  declare type ExceptionDetails = {\n    /** Message contained in the exception. */\n    message?: string,\n    /** Short type name of the exception object. */\n    typeName?: string,\n    /** Fully-qualified type name of the exception object. */\n    fullTypeName?: string,\n    /** Optional expression that can be evaluated in the current scope to obtain the exception object. */\n    evaluateName?: string,\n    /** Stack trace at the time the exception was thrown. */\n    stackTrace?: string,\n    /** Details of the exception contained by this exception, if any. */\n    innerException?: ExceptionDetails[],\n  };\n}\n"
  },
  {
    "path": "flow-typed/npm/@babel/cli_vx.x.x.js",
    "content": "// flow-typed signature: 88e150a250102d8b47b86c4a28175644\n// flow-typed version: <<STUB>>/@babel/cli_v^7.0.0-beta.53/flow_v0.76.0\n\n/**\n * This is an autogenerated libdef stub for:\n *\n *   '@babel/cli'\n *\n * Fill this stub out by replacing all the `any` types.\n *\n * Once filled out, we encourage you to share your work with the\n * community by sending a pull request to:\n * https://github.com/flowtype/flow-typed\n */\n\ndeclare module '@babel/cli' {\n  declare module.exports: any;\n}\n\n/**\n * We include stubs for each file inside this npm package in case you need to\n * require those files directly. Feel free to delete any files that aren't\n * needed.\n */\ndeclare module '@babel/cli/bin/babel-external-helpers' {\n  declare module.exports: any;\n}\n\ndeclare module '@babel/cli/bin/babel' {\n  declare module.exports: any;\n}\n\ndeclare module '@babel/cli/lib/babel-external-helpers' {\n  declare module.exports: any;\n}\n\ndeclare module '@babel/cli/lib/babel/dir' {\n  declare module.exports: any;\n}\n\ndeclare module '@babel/cli/lib/babel/file' {\n  declare module.exports: any;\n}\n\ndeclare module '@babel/cli/lib/babel/index' {\n  declare module.exports: any;\n}\n\ndeclare module '@babel/cli/lib/babel/options' {\n  declare module.exports: any;\n}\n\ndeclare module '@babel/cli/lib/babel/util' {\n  declare module.exports: any;\n}\n\n// Filename aliases\ndeclare module '@babel/cli/bin/babel-external-helpers.js' {\n  declare module.exports: $Exports<'@babel/cli/bin/babel-external-helpers'>;\n}\ndeclare module '@babel/cli/bin/babel.js' {\n  declare module.exports: $Exports<'@babel/cli/bin/babel'>;\n}\ndeclare module '@babel/cli/index' {\n  declare module.exports: $Exports<'@babel/cli'>;\n}\ndeclare module '@babel/cli/index.js' {\n  declare module.exports: $Exports<'@babel/cli'>;\n}\ndeclare module '@babel/cli/lib/babel-external-helpers.js' {\n  declare module.exports: $Exports<'@babel/cli/lib/babel-external-helpers'>;\n}\ndeclare module '@babel/cli/lib/babel/dir.js' {\n  declare module.exports: $Exports<'@babel/cli/lib/babel/dir'>;\n}\ndeclare module '@babel/cli/lib/babel/file.js' {\n  declare module.exports: $Exports<'@babel/cli/lib/babel/file'>;\n}\ndeclare module '@babel/cli/lib/babel/index.js' {\n  declare module.exports: $Exports<'@babel/cli/lib/babel/index'>;\n}\ndeclare module '@babel/cli/lib/babel/options.js' {\n  declare module.exports: $Exports<'@babel/cli/lib/babel/options'>;\n}\ndeclare module '@babel/cli/lib/babel/util.js' {\n  declare module.exports: $Exports<'@babel/cli/lib/babel/util'>;\n}\n"
  },
  {
    "path": "flow-typed/npm/@babel/core_vx.x.x.js",
    "content": "// flow-typed signature: 452003906fe2b34678ff70b013729409\n// flow-typed version: <<STUB>>/@babel/core_v^7.0.0-beta.53/flow_v0.76.0\n\n/**\n * This is an autogenerated libdef stub for:\n *\n *   '@babel/core'\n *\n * Fill this stub out by replacing all the `any` types.\n *\n * Once filled out, we encourage you to share your work with the\n * community by sending a pull request to:\n * https://github.com/flowtype/flow-typed\n */\n\ndeclare module '@babel/core' {\n  declare module.exports: any;\n}\n\n/**\n * We include stubs for each file inside this npm package in case you need to\n * require those files directly. Feel free to delete any files that aren't\n * needed.\n */\ndeclare module '@babel/core/lib/config/caching' {\n  declare module.exports: any;\n}\n\ndeclare module '@babel/core/lib/config/config-chain' {\n  declare module.exports: any;\n}\n\ndeclare module '@babel/core/lib/config/config-descriptors' {\n  declare module.exports: any;\n}\n\ndeclare module '@babel/core/lib/config/files/configuration' {\n  declare module.exports: any;\n}\n\ndeclare module '@babel/core/lib/config/files/index-browser' {\n  declare module.exports: any;\n}\n\ndeclare module '@babel/core/lib/config/files/index' {\n  declare module.exports: any;\n}\n\ndeclare module '@babel/core/lib/config/files/package' {\n  declare module.exports: any;\n}\n\ndeclare module '@babel/core/lib/config/files/plugins' {\n  declare module.exports: any;\n}\n\ndeclare module '@babel/core/lib/config/files/types' {\n  declare module.exports: any;\n}\n\ndeclare module '@babel/core/lib/config/files/utils' {\n  declare module.exports: any;\n}\n\ndeclare module '@babel/core/lib/config/full' {\n  declare module.exports: any;\n}\n\ndeclare module '@babel/core/lib/config/helpers/config-api' {\n  declare module.exports: any;\n}\n\ndeclare module '@babel/core/lib/config/helpers/environment' {\n  declare module.exports: any;\n}\n\ndeclare module '@babel/core/lib/config/index' {\n  declare module.exports: any;\n}\n\ndeclare module '@babel/core/lib/config/item' {\n  declare module.exports: any;\n}\n\ndeclare module '@babel/core/lib/config/partial' {\n  declare module.exports: any;\n}\n\ndeclare module '@babel/core/lib/config/plugin' {\n  declare module.exports: any;\n}\n\ndeclare module '@babel/core/lib/config/util' {\n  declare module.exports: any;\n}\n\ndeclare module '@babel/core/lib/config/validation/option-assertions' {\n  declare module.exports: any;\n}\n\ndeclare module '@babel/core/lib/config/validation/options' {\n  declare module.exports: any;\n}\n\ndeclare module '@babel/core/lib/config/validation/plugins' {\n  declare module.exports: any;\n}\n\ndeclare module '@babel/core/lib/config/validation/removed' {\n  declare module.exports: any;\n}\n\ndeclare module '@babel/core/lib/index' {\n  declare module.exports: any;\n}\n\ndeclare module '@babel/core/lib/parse' {\n  declare module.exports: any;\n}\n\ndeclare module '@babel/core/lib/tools/build-external-helpers' {\n  declare module.exports: any;\n}\n\ndeclare module '@babel/core/lib/transform-ast' {\n  declare module.exports: any;\n}\n\ndeclare module '@babel/core/lib/transform-file-browser' {\n  declare module.exports: any;\n}\n\ndeclare module '@babel/core/lib/transform-file-sync-browser' {\n  declare module.exports: any;\n}\n\ndeclare module '@babel/core/lib/transform-file' {\n  declare module.exports: any;\n}\n\ndeclare module '@babel/core/lib/transform' {\n  declare module.exports: any;\n}\n\ndeclare module '@babel/core/lib/transformation/block-hoist-plugin' {\n  declare module.exports: any;\n}\n\ndeclare module '@babel/core/lib/transformation/file/file' {\n  declare module.exports: any;\n}\n\ndeclare module '@babel/core/lib/transformation/file/generate' {\n  declare module.exports: any;\n}\n\ndeclare module '@babel/core/lib/transformation/file/merge-map' {\n  declare module.exports: any;\n}\n\ndeclare module '@babel/core/lib/transformation/index' {\n  declare module.exports: any;\n}\n\ndeclare module '@babel/core/lib/transformation/normalize-file' {\n  declare module.exports: any;\n}\n\ndeclare module '@babel/core/lib/transformation/normalize-opts' {\n  declare module.exports: any;\n}\n\ndeclare module '@babel/core/lib/transformation/plugin-pass' {\n  declare module.exports: any;\n}\n\ndeclare module '@babel/core/lib/transformation/util/missing-plugin-helper' {\n  declare module.exports: any;\n}\n\n// Filename aliases\ndeclare module '@babel/core/lib/config/caching.js' {\n  declare module.exports: $Exports<'@babel/core/lib/config/caching'>;\n}\ndeclare module '@babel/core/lib/config/config-chain.js' {\n  declare module.exports: $Exports<'@babel/core/lib/config/config-chain'>;\n}\ndeclare module '@babel/core/lib/config/config-descriptors.js' {\n  declare module.exports: $Exports<'@babel/core/lib/config/config-descriptors'>;\n}\ndeclare module '@babel/core/lib/config/files/configuration.js' {\n  declare module.exports: $Exports<'@babel/core/lib/config/files/configuration'>;\n}\ndeclare module '@babel/core/lib/config/files/index-browser.js' {\n  declare module.exports: $Exports<'@babel/core/lib/config/files/index-browser'>;\n}\ndeclare module '@babel/core/lib/config/files/index.js' {\n  declare module.exports: $Exports<'@babel/core/lib/config/files/index'>;\n}\ndeclare module '@babel/core/lib/config/files/package.js' {\n  declare module.exports: $Exports<'@babel/core/lib/config/files/package'>;\n}\ndeclare module '@babel/core/lib/config/files/plugins.js' {\n  declare module.exports: $Exports<'@babel/core/lib/config/files/plugins'>;\n}\ndeclare module '@babel/core/lib/config/files/types.js' {\n  declare module.exports: $Exports<'@babel/core/lib/config/files/types'>;\n}\ndeclare module '@babel/core/lib/config/files/utils.js' {\n  declare module.exports: $Exports<'@babel/core/lib/config/files/utils'>;\n}\ndeclare module '@babel/core/lib/config/full.js' {\n  declare module.exports: $Exports<'@babel/core/lib/config/full'>;\n}\ndeclare module '@babel/core/lib/config/helpers/config-api.js' {\n  declare module.exports: $Exports<'@babel/core/lib/config/helpers/config-api'>;\n}\ndeclare module '@babel/core/lib/config/helpers/environment.js' {\n  declare module.exports: $Exports<'@babel/core/lib/config/helpers/environment'>;\n}\ndeclare module '@babel/core/lib/config/index.js' {\n  declare module.exports: $Exports<'@babel/core/lib/config/index'>;\n}\ndeclare module '@babel/core/lib/config/item.js' {\n  declare module.exports: $Exports<'@babel/core/lib/config/item'>;\n}\ndeclare module '@babel/core/lib/config/partial.js' {\n  declare module.exports: $Exports<'@babel/core/lib/config/partial'>;\n}\ndeclare module '@babel/core/lib/config/plugin.js' {\n  declare module.exports: $Exports<'@babel/core/lib/config/plugin'>;\n}\ndeclare module '@babel/core/lib/config/util.js' {\n  declare module.exports: $Exports<'@babel/core/lib/config/util'>;\n}\ndeclare module '@babel/core/lib/config/validation/option-assertions.js' {\n  declare module.exports: $Exports<'@babel/core/lib/config/validation/option-assertions'>;\n}\ndeclare module '@babel/core/lib/config/validation/options.js' {\n  declare module.exports: $Exports<'@babel/core/lib/config/validation/options'>;\n}\ndeclare module '@babel/core/lib/config/validation/plugins.js' {\n  declare module.exports: $Exports<'@babel/core/lib/config/validation/plugins'>;\n}\ndeclare module '@babel/core/lib/config/validation/removed.js' {\n  declare module.exports: $Exports<'@babel/core/lib/config/validation/removed'>;\n}\ndeclare module '@babel/core/lib/index.js' {\n  declare module.exports: $Exports<'@babel/core/lib/index'>;\n}\ndeclare module '@babel/core/lib/parse.js' {\n  declare module.exports: $Exports<'@babel/core/lib/parse'>;\n}\ndeclare module '@babel/core/lib/tools/build-external-helpers.js' {\n  declare module.exports: $Exports<'@babel/core/lib/tools/build-external-helpers'>;\n}\ndeclare module '@babel/core/lib/transform-ast.js' {\n  declare module.exports: $Exports<'@babel/core/lib/transform-ast'>;\n}\ndeclare module '@babel/core/lib/transform-file-browser.js' {\n  declare module.exports: $Exports<'@babel/core/lib/transform-file-browser'>;\n}\ndeclare module '@babel/core/lib/transform-file-sync-browser.js' {\n  declare module.exports: $Exports<'@babel/core/lib/transform-file-sync-browser'>;\n}\ndeclare module '@babel/core/lib/transform-file.js' {\n  declare module.exports: $Exports<'@babel/core/lib/transform-file'>;\n}\ndeclare module '@babel/core/lib/transform.js' {\n  declare module.exports: $Exports<'@babel/core/lib/transform'>;\n}\ndeclare module '@babel/core/lib/transformation/block-hoist-plugin.js' {\n  declare module.exports: $Exports<'@babel/core/lib/transformation/block-hoist-plugin'>;\n}\ndeclare module '@babel/core/lib/transformation/file/file.js' {\n  declare module.exports: $Exports<'@babel/core/lib/transformation/file/file'>;\n}\ndeclare module '@babel/core/lib/transformation/file/generate.js' {\n  declare module.exports: $Exports<'@babel/core/lib/transformation/file/generate'>;\n}\ndeclare module '@babel/core/lib/transformation/file/merge-map.js' {\n  declare module.exports: $Exports<'@babel/core/lib/transformation/file/merge-map'>;\n}\ndeclare module '@babel/core/lib/transformation/index.js' {\n  declare module.exports: $Exports<'@babel/core/lib/transformation/index'>;\n}\ndeclare module '@babel/core/lib/transformation/normalize-file.js' {\n  declare module.exports: $Exports<'@babel/core/lib/transformation/normalize-file'>;\n}\ndeclare module '@babel/core/lib/transformation/normalize-opts.js' {\n  declare module.exports: $Exports<'@babel/core/lib/transformation/normalize-opts'>;\n}\ndeclare module '@babel/core/lib/transformation/plugin-pass.js' {\n  declare module.exports: $Exports<'@babel/core/lib/transformation/plugin-pass'>;\n}\ndeclare module '@babel/core/lib/transformation/util/missing-plugin-helper.js' {\n  declare module.exports: $Exports<'@babel/core/lib/transformation/util/missing-plugin-helper'>;\n}\n"
  },
  {
    "path": "flow-typed/npm/@babel/generator_vx.x.x.js",
    "content": "// flow-typed signature: 14710e733fa392245cb84e68ee4c89a0\n// flow-typed version: <<STUB>>/@babel/generator_v^7.0.0-beta.53/flow_v0.76.0\n\n/**\n * This is an autogenerated libdef stub for:\n *\n *   '@babel/generator'\n *\n * Fill this stub out by replacing all the `any` types.\n *\n * Once filled out, we encourage you to share your work with the\n * community by sending a pull request to:\n * https://github.com/flowtype/flow-typed\n */\n\ndeclare module '@babel/generator' {\n  declare module.exports: any;\n}\n\n/**\n * We include stubs for each file inside this npm package in case you need to\n * require those files directly. Feel free to delete any files that aren't\n * needed.\n */\ndeclare module '@babel/generator/lib/buffer' {\n  declare module.exports: any;\n}\n\ndeclare module '@babel/generator/lib/generators/base' {\n  declare module.exports: any;\n}\n\ndeclare module '@babel/generator/lib/generators/classes' {\n  declare module.exports: any;\n}\n\ndeclare module '@babel/generator/lib/generators/expressions' {\n  declare module.exports: any;\n}\n\ndeclare module '@babel/generator/lib/generators/flow' {\n  declare module.exports: any;\n}\n\ndeclare module '@babel/generator/lib/generators/index' {\n  declare module.exports: any;\n}\n\ndeclare module '@babel/generator/lib/generators/jsx' {\n  declare module.exports: any;\n}\n\ndeclare module '@babel/generator/lib/generators/methods' {\n  declare module.exports: any;\n}\n\ndeclare module '@babel/generator/lib/generators/modules' {\n  declare module.exports: any;\n}\n\ndeclare module '@babel/generator/lib/generators/statements' {\n  declare module.exports: any;\n}\n\ndeclare module '@babel/generator/lib/generators/template-literals' {\n  declare module.exports: any;\n}\n\ndeclare module '@babel/generator/lib/generators/types' {\n  declare module.exports: any;\n}\n\ndeclare module '@babel/generator/lib/generators/typescript' {\n  declare module.exports: any;\n}\n\ndeclare module '@babel/generator/lib/index' {\n  declare module.exports: any;\n}\n\ndeclare module '@babel/generator/lib/node/index' {\n  declare module.exports: any;\n}\n\ndeclare module '@babel/generator/lib/node/parentheses' {\n  declare module.exports: any;\n}\n\ndeclare module '@babel/generator/lib/node/whitespace' {\n  declare module.exports: any;\n}\n\ndeclare module '@babel/generator/lib/printer' {\n  declare module.exports: any;\n}\n\ndeclare module '@babel/generator/lib/source-map' {\n  declare module.exports: any;\n}\n\n// Filename aliases\ndeclare module '@babel/generator/lib/buffer.js' {\n  declare module.exports: $Exports<'@babel/generator/lib/buffer'>;\n}\ndeclare module '@babel/generator/lib/generators/base.js' {\n  declare module.exports: $Exports<'@babel/generator/lib/generators/base'>;\n}\ndeclare module '@babel/generator/lib/generators/classes.js' {\n  declare module.exports: $Exports<'@babel/generator/lib/generators/classes'>;\n}\ndeclare module '@babel/generator/lib/generators/expressions.js' {\n  declare module.exports: $Exports<'@babel/generator/lib/generators/expressions'>;\n}\ndeclare module '@babel/generator/lib/generators/flow.js' {\n  declare module.exports: $Exports<'@babel/generator/lib/generators/flow'>;\n}\ndeclare module '@babel/generator/lib/generators/index.js' {\n  declare module.exports: $Exports<'@babel/generator/lib/generators/index'>;\n}\ndeclare module '@babel/generator/lib/generators/jsx.js' {\n  declare module.exports: $Exports<'@babel/generator/lib/generators/jsx'>;\n}\ndeclare module '@babel/generator/lib/generators/methods.js' {\n  declare module.exports: $Exports<'@babel/generator/lib/generators/methods'>;\n}\ndeclare module '@babel/generator/lib/generators/modules.js' {\n  declare module.exports: $Exports<'@babel/generator/lib/generators/modules'>;\n}\ndeclare module '@babel/generator/lib/generators/statements.js' {\n  declare module.exports: $Exports<'@babel/generator/lib/generators/statements'>;\n}\ndeclare module '@babel/generator/lib/generators/template-literals.js' {\n  declare module.exports: $Exports<'@babel/generator/lib/generators/template-literals'>;\n}\ndeclare module '@babel/generator/lib/generators/types.js' {\n  declare module.exports: $Exports<'@babel/generator/lib/generators/types'>;\n}\ndeclare module '@babel/generator/lib/generators/typescript.js' {\n  declare module.exports: $Exports<'@babel/generator/lib/generators/typescript'>;\n}\ndeclare module '@babel/generator/lib/index.js' {\n  declare module.exports: $Exports<'@babel/generator/lib/index'>;\n}\ndeclare module '@babel/generator/lib/node/index.js' {\n  declare module.exports: $Exports<'@babel/generator/lib/node/index'>;\n}\ndeclare module '@babel/generator/lib/node/parentheses.js' {\n  declare module.exports: $Exports<'@babel/generator/lib/node/parentheses'>;\n}\ndeclare module '@babel/generator/lib/node/whitespace.js' {\n  declare module.exports: $Exports<'@babel/generator/lib/node/whitespace'>;\n}\ndeclare module '@babel/generator/lib/printer.js' {\n  declare module.exports: $Exports<'@babel/generator/lib/printer'>;\n}\ndeclare module '@babel/generator/lib/source-map.js' {\n  declare module.exports: $Exports<'@babel/generator/lib/source-map'>;\n}\n"
  },
  {
    "path": "flow-typed/npm/@babel/node_vx.x.x.js",
    "content": "// flow-typed signature: e6bc151ed1aadbc8df76d137336ee3dd\n// flow-typed version: <<STUB>>/@babel/node_v^7.0.0-beta.53/flow_v0.76.0\n\n/**\n * This is an autogenerated libdef stub for:\n *\n *   '@babel/node'\n *\n * Fill this stub out by replacing all the `any` types.\n *\n * Once filled out, we encourage you to share your work with the\n * community by sending a pull request to:\n * https://github.com/flowtype/flow-typed\n */\n\ndeclare module '@babel/node' {\n  declare module.exports: any;\n}\n\n/**\n * We include stubs for each file inside this npm package in case you need to\n * require those files directly. Feel free to delete any files that aren't\n * needed.\n */\ndeclare module '@babel/node/bin/babel-node' {\n  declare module.exports: any;\n}\n\ndeclare module '@babel/node/lib/_babel-node' {\n  declare module.exports: any;\n}\n\ndeclare module '@babel/node/lib/babel-node' {\n  declare module.exports: any;\n}\n\n// Filename aliases\ndeclare module '@babel/node/bin/babel-node.js' {\n  declare module.exports: $Exports<'@babel/node/bin/babel-node'>;\n}\ndeclare module '@babel/node/lib/_babel-node.js' {\n  declare module.exports: $Exports<'@babel/node/lib/_babel-node'>;\n}\ndeclare module '@babel/node/lib/babel-node.js' {\n  declare module.exports: $Exports<'@babel/node/lib/babel-node'>;\n}\n"
  },
  {
    "path": "flow-typed/npm/@babel/parser_vx.x.x.js",
    "content": "// flow-typed signature: 1f224679c72df69bc1a83214bdcd84b3\n// flow-typed version: <<STUB>>/@babel/parser_v^7.0.0-beta.53/flow_v0.76.0\n\n/**\n * This is an autogenerated libdef stub for:\n *\n *   '@babel/parser'\n *\n * Fill this stub out by replacing all the `any` types.\n *\n * Once filled out, we encourage you to share your work with the\n * community by sending a pull request to:\n * https://github.com/flowtype/flow-typed\n */\n\ndeclare module '@babel/parser' {\n  declare module.exports: any;\n}\n\n/**\n * We include stubs for each file inside this npm package in case you need to\n * require those files directly. Feel free to delete any files that aren't\n * needed.\n */\ndeclare module '@babel/parser/bin/babel-parser' {\n  declare module.exports: any;\n}\n\ndeclare module '@babel/parser/lib/index' {\n  declare module.exports: any;\n}\n\n// Filename aliases\ndeclare module '@babel/parser/bin/babel-parser.js' {\n  declare module.exports: $Exports<'@babel/parser/bin/babel-parser'>;\n}\ndeclare module '@babel/parser/lib/index.js' {\n  declare module.exports: $Exports<'@babel/parser/lib/index'>;\n}\n"
  },
  {
    "path": "flow-typed/npm/@babel/plugin-proposal-class-properties_vx.x.x.js",
    "content": "// flow-typed signature: 83df03cc398d7b8e8b44e95e7ee8b5f3\n// flow-typed version: <<STUB>>/@babel/plugin-proposal-class-properties_v^7.0.0-beta.53/flow_v0.76.0\n\n/**\n * This is an autogenerated libdef stub for:\n *\n *   '@babel/plugin-proposal-class-properties'\n *\n * Fill this stub out by replacing all the `any` types.\n *\n * Once filled out, we encourage you to share your work with the\n * community by sending a pull request to:\n * https://github.com/flowtype/flow-typed\n */\n\ndeclare module '@babel/plugin-proposal-class-properties' {\n  declare module.exports: any;\n}\n\n/**\n * We include stubs for each file inside this npm package in case you need to\n * require those files directly. Feel free to delete any files that aren't\n * needed.\n */\ndeclare module '@babel/plugin-proposal-class-properties/lib/index' {\n  declare module.exports: any;\n}\n\n// Filename aliases\ndeclare module '@babel/plugin-proposal-class-properties/lib/index.js' {\n  declare module.exports: $Exports<'@babel/plugin-proposal-class-properties/lib/index'>;\n}\n"
  },
  {
    "path": "flow-typed/npm/@babel/plugin-proposal-export-default-from_vx.x.x.js",
    "content": "// flow-typed signature: c0525799a7f3fe4fa2f7f8222226590d\n// flow-typed version: <<STUB>>/@babel/plugin-proposal-export-default-from_v^7.0.0-beta.53/flow_v0.76.0\n\n/**\n * This is an autogenerated libdef stub for:\n *\n *   '@babel/plugin-proposal-export-default-from'\n *\n * Fill this stub out by replacing all the `any` types.\n *\n * Once filled out, we encourage you to share your work with the\n * community by sending a pull request to:\n * https://github.com/flowtype/flow-typed\n */\n\ndeclare module '@babel/plugin-proposal-export-default-from' {\n  declare module.exports: any;\n}\n\n/**\n * We include stubs for each file inside this npm package in case you need to\n * require those files directly. Feel free to delete any files that aren't\n * needed.\n */\ndeclare module '@babel/plugin-proposal-export-default-from/lib/index' {\n  declare module.exports: any;\n}\n\n// Filename aliases\ndeclare module '@babel/plugin-proposal-export-default-from/lib/index.js' {\n  declare module.exports: $Exports<'@babel/plugin-proposal-export-default-from/lib/index'>;\n}\n"
  },
  {
    "path": "flow-typed/npm/@babel/plugin-proposal-object-rest-spread_vx.x.x.js",
    "content": "// flow-typed signature: b11d576ca33e869b67e87d3031edbda2\n// flow-typed version: <<STUB>>/@babel/plugin-proposal-object-rest-spread_v^7.0.0-beta.53/flow_v0.76.0\n\n/**\n * This is an autogenerated libdef stub for:\n *\n *   '@babel/plugin-proposal-object-rest-spread'\n *\n * Fill this stub out by replacing all the `any` types.\n *\n * Once filled out, we encourage you to share your work with the\n * community by sending a pull request to:\n * https://github.com/flowtype/flow-typed\n */\n\ndeclare module '@babel/plugin-proposal-object-rest-spread' {\n  declare module.exports: any;\n}\n\n/**\n * We include stubs for each file inside this npm package in case you need to\n * require those files directly. Feel free to delete any files that aren't\n * needed.\n */\ndeclare module '@babel/plugin-proposal-object-rest-spread/lib/index' {\n  declare module.exports: any;\n}\n\n// Filename aliases\ndeclare module '@babel/plugin-proposal-object-rest-spread/lib/index.js' {\n  declare module.exports: $Exports<'@babel/plugin-proposal-object-rest-spread/lib/index'>;\n}\n"
  },
  {
    "path": "flow-typed/npm/@babel/plugin-syntax-flow_vx.x.x.js",
    "content": "// flow-typed signature: 5dfb0ad96c92f4f384c9529bd39e0188\n// flow-typed version: <<STUB>>/@babel/plugin-syntax-flow_v^7.0.0-beta.53/flow_v0.76.0\n\n/**\n * This is an autogenerated libdef stub for:\n *\n *   '@babel/plugin-syntax-flow'\n *\n * Fill this stub out by replacing all the `any` types.\n *\n * Once filled out, we encourage you to share your work with the\n * community by sending a pull request to:\n * https://github.com/flowtype/flow-typed\n */\n\ndeclare module '@babel/plugin-syntax-flow' {\n  declare module.exports: any;\n}\n\n/**\n * We include stubs for each file inside this npm package in case you need to\n * require those files directly. Feel free to delete any files that aren't\n * needed.\n */\ndeclare module '@babel/plugin-syntax-flow/lib/index' {\n  declare module.exports: any;\n}\n\n// Filename aliases\ndeclare module '@babel/plugin-syntax-flow/lib/index.js' {\n  declare module.exports: $Exports<'@babel/plugin-syntax-flow/lib/index'>;\n}\n"
  },
  {
    "path": "flow-typed/npm/@babel/plugin-transform-flow-strip-types_vx.x.x.js",
    "content": "// flow-typed signature: b92f6ddfb42052b92d5e5360291b06f3\n// flow-typed version: <<STUB>>/@babel/plugin-transform-flow-strip-types_v^7.0.0-beta.53/flow_v0.76.0\n\n/**\n * This is an autogenerated libdef stub for:\n *\n *   '@babel/plugin-transform-flow-strip-types'\n *\n * Fill this stub out by replacing all the `any` types.\n *\n * Once filled out, we encourage you to share your work with the\n * community by sending a pull request to:\n * https://github.com/flowtype/flow-typed\n */\n\ndeclare module '@babel/plugin-transform-flow-strip-types' {\n  declare module.exports: any;\n}\n\n/**\n * We include stubs for each file inside this npm package in case you need to\n * require those files directly. Feel free to delete any files that aren't\n * needed.\n */\ndeclare module '@babel/plugin-transform-flow-strip-types/lib/index' {\n  declare module.exports: any;\n}\n\n// Filename aliases\ndeclare module '@babel/plugin-transform-flow-strip-types/lib/index.js' {\n  declare module.exports: $Exports<'@babel/plugin-transform-flow-strip-types/lib/index'>;\n}\n"
  },
  {
    "path": "flow-typed/npm/@babel/plugin-transform-modules-commonjs_vx.x.x.js",
    "content": "// flow-typed signature: c23dd6d679255581300a2c6a1da17b2c\n// flow-typed version: <<STUB>>/@babel/plugin-transform-modules-commonjs_v^7.0.0-beta.53/flow_v0.76.0\n\n/**\n * This is an autogenerated libdef stub for:\n *\n *   '@babel/plugin-transform-modules-commonjs'\n *\n * Fill this stub out by replacing all the `any` types.\n *\n * Once filled out, we encourage you to share your work with the\n * community by sending a pull request to:\n * https://github.com/flowtype/flow-typed\n */\n\ndeclare module '@babel/plugin-transform-modules-commonjs' {\n  declare module.exports: any;\n}\n\n/**\n * We include stubs for each file inside this npm package in case you need to\n * require those files directly. Feel free to delete any files that aren't\n * needed.\n */\ndeclare module '@babel/plugin-transform-modules-commonjs/lib/index' {\n  declare module.exports: any;\n}\n\n// Filename aliases\ndeclare module '@babel/plugin-transform-modules-commonjs/lib/index.js' {\n  declare module.exports: $Exports<'@babel/plugin-transform-modules-commonjs/lib/index'>;\n}\n"
  },
  {
    "path": "flow-typed/npm/@babel/plugin-transform-react-jsx_vx.x.x.js",
    "content": "// flow-typed signature: 38f417a8d521428256be3fcbcea40031\n// flow-typed version: <<STUB>>/@babel/plugin-transform-react-jsx_v^7.0.0-beta.53/flow_v0.76.0\n\n/**\n * This is an autogenerated libdef stub for:\n *\n *   '@babel/plugin-transform-react-jsx'\n *\n * Fill this stub out by replacing all the `any` types.\n *\n * Once filled out, we encourage you to share your work with the\n * community by sending a pull request to:\n * https://github.com/flowtype/flow-typed\n */\n\ndeclare module '@babel/plugin-transform-react-jsx' {\n  declare module.exports: any;\n}\n\n/**\n * We include stubs for each file inside this npm package in case you need to\n * require those files directly. Feel free to delete any files that aren't\n * needed.\n */\ndeclare module '@babel/plugin-transform-react-jsx/lib/index' {\n  declare module.exports: any;\n}\n\n// Filename aliases\ndeclare module '@babel/plugin-transform-react-jsx/lib/index.js' {\n  declare module.exports: $Exports<'@babel/plugin-transform-react-jsx/lib/index'>;\n}\n"
  },
  {
    "path": "flow-typed/npm/@babel/preset-env_vx.x.x.js",
    "content": "// flow-typed signature: 1d1f10974da327836a8a8761e7c4ed01\n// flow-typed version: <<STUB>>/@babel/preset-env_v^7.0.0-beta.53/flow_v0.76.0\n\n/**\n * This is an autogenerated libdef stub for:\n *\n *   '@babel/preset-env'\n *\n * Fill this stub out by replacing all the `any` types.\n *\n * Once filled out, we encourage you to share your work with the\n * community by sending a pull request to:\n * https://github.com/flowtype/flow-typed\n */\n\ndeclare module '@babel/preset-env' {\n  declare module.exports: any;\n}\n\n/**\n * We include stubs for each file inside this npm package in case you need to\n * require those files directly. Feel free to delete any files that aren't\n * needed.\n */\ndeclare module '@babel/preset-env/data/built-in-features' {\n  declare module.exports: any;\n}\n\ndeclare module '@babel/preset-env/data/plugin-features' {\n  declare module.exports: any;\n}\n\ndeclare module '@babel/preset-env/data/shipped-proposals' {\n  declare module.exports: any;\n}\n\ndeclare module '@babel/preset-env/data/unreleased-labels' {\n  declare module.exports: any;\n}\n\ndeclare module '@babel/preset-env/lib/available-plugins' {\n  declare module.exports: any;\n}\n\ndeclare module '@babel/preset-env/lib/built-in-definitions' {\n  declare module.exports: any;\n}\n\ndeclare module '@babel/preset-env/lib/debug' {\n  declare module.exports: any;\n}\n\ndeclare module '@babel/preset-env/lib/default-includes' {\n  declare module.exports: any;\n}\n\ndeclare module '@babel/preset-env/lib/defaults' {\n  declare module.exports: any;\n}\n\ndeclare module '@babel/preset-env/lib/index' {\n  declare module.exports: any;\n}\n\ndeclare module '@babel/preset-env/lib/module-transformations' {\n  declare module.exports: any;\n}\n\ndeclare module '@babel/preset-env/lib/normalize-options' {\n  declare module.exports: any;\n}\n\ndeclare module '@babel/preset-env/lib/options' {\n  declare module.exports: any;\n}\n\ndeclare module '@babel/preset-env/lib/targets-parser' {\n  declare module.exports: any;\n}\n\ndeclare module '@babel/preset-env/lib/use-built-ins-entry-plugin' {\n  declare module.exports: any;\n}\n\ndeclare module '@babel/preset-env/lib/use-built-ins-plugin' {\n  declare module.exports: any;\n}\n\ndeclare module '@babel/preset-env/lib/utils' {\n  declare module.exports: any;\n}\n\n// Filename aliases\ndeclare module '@babel/preset-env/data/built-in-features.js' {\n  declare module.exports: $Exports<'@babel/preset-env/data/built-in-features'>;\n}\ndeclare module '@babel/preset-env/data/plugin-features.js' {\n  declare module.exports: $Exports<'@babel/preset-env/data/plugin-features'>;\n}\ndeclare module '@babel/preset-env/data/shipped-proposals.js' {\n  declare module.exports: $Exports<'@babel/preset-env/data/shipped-proposals'>;\n}\ndeclare module '@babel/preset-env/data/unreleased-labels.js' {\n  declare module.exports: $Exports<'@babel/preset-env/data/unreleased-labels'>;\n}\ndeclare module '@babel/preset-env/lib/available-plugins.js' {\n  declare module.exports: $Exports<'@babel/preset-env/lib/available-plugins'>;\n}\ndeclare module '@babel/preset-env/lib/built-in-definitions.js' {\n  declare module.exports: $Exports<'@babel/preset-env/lib/built-in-definitions'>;\n}\ndeclare module '@babel/preset-env/lib/debug.js' {\n  declare module.exports: $Exports<'@babel/preset-env/lib/debug'>;\n}\ndeclare module '@babel/preset-env/lib/default-includes.js' {\n  declare module.exports: $Exports<'@babel/preset-env/lib/default-includes'>;\n}\ndeclare module '@babel/preset-env/lib/defaults.js' {\n  declare module.exports: $Exports<'@babel/preset-env/lib/defaults'>;\n}\ndeclare module '@babel/preset-env/lib/index.js' {\n  declare module.exports: $Exports<'@babel/preset-env/lib/index'>;\n}\ndeclare module '@babel/preset-env/lib/module-transformations.js' {\n  declare module.exports: $Exports<'@babel/preset-env/lib/module-transformations'>;\n}\ndeclare module '@babel/preset-env/lib/normalize-options.js' {\n  declare module.exports: $Exports<'@babel/preset-env/lib/normalize-options'>;\n}\ndeclare module '@babel/preset-env/lib/options.js' {\n  declare module.exports: $Exports<'@babel/preset-env/lib/options'>;\n}\ndeclare module '@babel/preset-env/lib/targets-parser.js' {\n  declare module.exports: $Exports<'@babel/preset-env/lib/targets-parser'>;\n}\ndeclare module '@babel/preset-env/lib/use-built-ins-entry-plugin.js' {\n  declare module.exports: $Exports<'@babel/preset-env/lib/use-built-ins-entry-plugin'>;\n}\ndeclare module '@babel/preset-env/lib/use-built-ins-plugin.js' {\n  declare module.exports: $Exports<'@babel/preset-env/lib/use-built-ins-plugin'>;\n}\ndeclare module '@babel/preset-env/lib/utils.js' {\n  declare module.exports: $Exports<'@babel/preset-env/lib/utils'>;\n}\n"
  },
  {
    "path": "flow-typed/npm/@babel/preset-flow_vx.x.x.js",
    "content": "// flow-typed signature: 2257b5d93c569a2365772ed531a8a9a7\n// flow-typed version: <<STUB>>/@babel/preset-flow_v7.0.0-beta.53/flow_v0.76.0\n\n/**\n * This is an autogenerated libdef stub for:\n *\n *   '@babel/preset-flow'\n *\n * Fill this stub out by replacing all the `any` types.\n *\n * Once filled out, we encourage you to share your work with the\n * community by sending a pull request to:\n * https://github.com/flowtype/flow-typed\n */\n\ndeclare module '@babel/preset-flow' {\n  declare module.exports: any;\n}\n\n/**\n * We include stubs for each file inside this npm package in case you need to\n * require those files directly. Feel free to delete any files that aren't\n * needed.\n */\ndeclare module '@babel/preset-flow/lib/index' {\n  declare module.exports: any;\n}\n\n// Filename aliases\ndeclare module '@babel/preset-flow/lib/index.js' {\n  declare module.exports: $Exports<'@babel/preset-flow/lib/index'>;\n}\n"
  },
  {
    "path": "flow-typed/npm/@babel/preset-react_vx.x.x.js",
    "content": "// flow-typed signature: c7881c92495e1a8d652c9443241d6abe\n// flow-typed version: <<STUB>>/@babel/preset-react_v^7.0.0-beta.53/flow_v0.76.0\n\n/**\n * This is an autogenerated libdef stub for:\n *\n *   '@babel/preset-react'\n *\n * Fill this stub out by replacing all the `any` types.\n *\n * Once filled out, we encourage you to share your work with the\n * community by sending a pull request to:\n * https://github.com/flowtype/flow-typed\n */\n\ndeclare module '@babel/preset-react' {\n  declare module.exports: any;\n}\n\n/**\n * We include stubs for each file inside this npm package in case you need to\n * require those files directly. Feel free to delete any files that aren't\n * needed.\n */\ndeclare module '@babel/preset-react/lib/index' {\n  declare module.exports: any;\n}\n\n// Filename aliases\ndeclare module '@babel/preset-react/lib/index.js' {\n  declare module.exports: $Exports<'@babel/preset-react/lib/index'>;\n}\n"
  },
  {
    "path": "flow-typed/npm/@babel/register_vx.x.x.js",
    "content": "// flow-typed signature: 0588d3f96fe247210bcba05ea43f8d5d\n// flow-typed version: <<STUB>>/@babel/register_v^7.0.0-beta.53/flow_v0.76.0\n\n/**\n * This is an autogenerated libdef stub for:\n *\n *   '@babel/register'\n *\n * Fill this stub out by replacing all the `any` types.\n *\n * Once filled out, we encourage you to share your work with the\n * community by sending a pull request to:\n * https://github.com/flowtype/flow-typed\n */\n\ndeclare module '@babel/register' {\n  declare module.exports: any;\n}\n\n/**\n * We include stubs for each file inside this npm package in case you need to\n * require those files directly. Feel free to delete any files that aren't\n * needed.\n */\ndeclare module '@babel/register/lib/browser' {\n  declare module.exports: any;\n}\n\ndeclare module '@babel/register/lib/cache' {\n  declare module.exports: any;\n}\n\ndeclare module '@babel/register/lib/index' {\n  declare module.exports: any;\n}\n\ndeclare module '@babel/register/lib/node' {\n  declare module.exports: any;\n}\n\n// Filename aliases\ndeclare module '@babel/register/lib/browser.js' {\n  declare module.exports: $Exports<'@babel/register/lib/browser'>;\n}\ndeclare module '@babel/register/lib/cache.js' {\n  declare module.exports: $Exports<'@babel/register/lib/cache'>;\n}\ndeclare module '@babel/register/lib/index.js' {\n  declare module.exports: $Exports<'@babel/register/lib/index'>;\n}\ndeclare module '@babel/register/lib/node.js' {\n  declare module.exports: $Exports<'@babel/register/lib/node'>;\n}\n"
  },
  {
    "path": "flow-typed/npm/@babel/template_vx.x.x.js",
    "content": "// flow-typed signature: b5676378d55f7376bc725520ab242644\n// flow-typed version: <<STUB>>/@babel/template_v^7.0.0-beta.53/flow_v0.76.0\n\n/**\n * This is an autogenerated libdef stub for:\n *\n *   '@babel/template'\n *\n * Fill this stub out by replacing all the `any` types.\n *\n * Once filled out, we encourage you to share your work with the\n * community by sending a pull request to:\n * https://github.com/flowtype/flow-typed\n */\n\ndeclare module '@babel/template' {\n  declare module.exports: any;\n}\n\n/**\n * We include stubs for each file inside this npm package in case you need to\n * require those files directly. Feel free to delete any files that aren't\n * needed.\n */\ndeclare module '@babel/template/lib/builder' {\n  declare module.exports: any;\n}\n\ndeclare module '@babel/template/lib/formatters' {\n  declare module.exports: any;\n}\n\ndeclare module '@babel/template/lib/index' {\n  declare module.exports: any;\n}\n\ndeclare module '@babel/template/lib/literal' {\n  declare module.exports: any;\n}\n\ndeclare module '@babel/template/lib/options' {\n  declare module.exports: any;\n}\n\ndeclare module '@babel/template/lib/parse' {\n  declare module.exports: any;\n}\n\ndeclare module '@babel/template/lib/populate' {\n  declare module.exports: any;\n}\n\ndeclare module '@babel/template/lib/string' {\n  declare module.exports: any;\n}\n\n// Filename aliases\ndeclare module '@babel/template/lib/builder.js' {\n  declare module.exports: $Exports<'@babel/template/lib/builder'>;\n}\ndeclare module '@babel/template/lib/formatters.js' {\n  declare module.exports: $Exports<'@babel/template/lib/formatters'>;\n}\ndeclare module '@babel/template/lib/index.js' {\n  declare module.exports: $Exports<'@babel/template/lib/index'>;\n}\ndeclare module '@babel/template/lib/literal.js' {\n  declare module.exports: $Exports<'@babel/template/lib/literal'>;\n}\ndeclare module '@babel/template/lib/options.js' {\n  declare module.exports: $Exports<'@babel/template/lib/options'>;\n}\ndeclare module '@babel/template/lib/parse.js' {\n  declare module.exports: $Exports<'@babel/template/lib/parse'>;\n}\ndeclare module '@babel/template/lib/populate.js' {\n  declare module.exports: $Exports<'@babel/template/lib/populate'>;\n}\ndeclare module '@babel/template/lib/string.js' {\n  declare module.exports: $Exports<'@babel/template/lib/string'>;\n}\n"
  },
  {
    "path": "flow-typed/npm/@babel/traverse_vx.x.x.js",
    "content": "// flow-typed signature: 81d29dd140776ffb4e2075ed0b37f16e\n// flow-typed version: <<STUB>>/@babel/traverse_v^7.0.0-beta.53/flow_v0.76.0\n\n/**\n * This is an autogenerated libdef stub for:\n *\n *   '@babel/traverse'\n *\n * Fill this stub out by replacing all the `any` types.\n *\n * Once filled out, we encourage you to share your work with the\n * community by sending a pull request to:\n * https://github.com/flowtype/flow-typed\n */\n\ndeclare module '@babel/traverse' {\n  declare module.exports: any;\n}\n\n/**\n * We include stubs for each file inside this npm package in case you need to\n * require those files directly. Feel free to delete any files that aren't\n * needed.\n */\ndeclare module '@babel/traverse/lib/cache' {\n  declare module.exports: any;\n}\n\ndeclare module '@babel/traverse/lib/context' {\n  declare module.exports: any;\n}\n\ndeclare module '@babel/traverse/lib/hub' {\n  declare module.exports: any;\n}\n\ndeclare module '@babel/traverse/lib/index' {\n  declare module.exports: any;\n}\n\ndeclare module '@babel/traverse/lib/path/ancestry' {\n  declare module.exports: any;\n}\n\ndeclare module '@babel/traverse/lib/path/comments' {\n  declare module.exports: any;\n}\n\ndeclare module '@babel/traverse/lib/path/context' {\n  declare module.exports: any;\n}\n\ndeclare module '@babel/traverse/lib/path/conversion' {\n  declare module.exports: any;\n}\n\ndeclare module '@babel/traverse/lib/path/evaluation' {\n  declare module.exports: any;\n}\n\ndeclare module '@babel/traverse/lib/path/family' {\n  declare module.exports: any;\n}\n\ndeclare module '@babel/traverse/lib/path/index' {\n  declare module.exports: any;\n}\n\ndeclare module '@babel/traverse/lib/path/inference/index' {\n  declare module.exports: any;\n}\n\ndeclare module '@babel/traverse/lib/path/inference/inferer-reference' {\n  declare module.exports: any;\n}\n\ndeclare module '@babel/traverse/lib/path/inference/inferers' {\n  declare module.exports: any;\n}\n\ndeclare module '@babel/traverse/lib/path/introspection' {\n  declare module.exports: any;\n}\n\ndeclare module '@babel/traverse/lib/path/lib/hoister' {\n  declare module.exports: any;\n}\n\ndeclare module '@babel/traverse/lib/path/lib/removal-hooks' {\n  declare module.exports: any;\n}\n\ndeclare module '@babel/traverse/lib/path/lib/virtual-types' {\n  declare module.exports: any;\n}\n\ndeclare module '@babel/traverse/lib/path/modification' {\n  declare module.exports: any;\n}\n\ndeclare module '@babel/traverse/lib/path/removal' {\n  declare module.exports: any;\n}\n\ndeclare module '@babel/traverse/lib/path/replacement' {\n  declare module.exports: any;\n}\n\ndeclare module '@babel/traverse/lib/scope/binding' {\n  declare module.exports: any;\n}\n\ndeclare module '@babel/traverse/lib/scope/index' {\n  declare module.exports: any;\n}\n\ndeclare module '@babel/traverse/lib/scope/lib/renamer' {\n  declare module.exports: any;\n}\n\ndeclare module '@babel/traverse/lib/visitors' {\n  declare module.exports: any;\n}\n\n// Filename aliases\ndeclare module '@babel/traverse/lib/cache.js' {\n  declare module.exports: $Exports<'@babel/traverse/lib/cache'>;\n}\ndeclare module '@babel/traverse/lib/context.js' {\n  declare module.exports: $Exports<'@babel/traverse/lib/context'>;\n}\ndeclare module '@babel/traverse/lib/hub.js' {\n  declare module.exports: $Exports<'@babel/traverse/lib/hub'>;\n}\ndeclare module '@babel/traverse/lib/index.js' {\n  declare module.exports: $Exports<'@babel/traverse/lib/index'>;\n}\ndeclare module '@babel/traverse/lib/path/ancestry.js' {\n  declare module.exports: $Exports<'@babel/traverse/lib/path/ancestry'>;\n}\ndeclare module '@babel/traverse/lib/path/comments.js' {\n  declare module.exports: $Exports<'@babel/traverse/lib/path/comments'>;\n}\ndeclare module '@babel/traverse/lib/path/context.js' {\n  declare module.exports: $Exports<'@babel/traverse/lib/path/context'>;\n}\ndeclare module '@babel/traverse/lib/path/conversion.js' {\n  declare module.exports: $Exports<'@babel/traverse/lib/path/conversion'>;\n}\ndeclare module '@babel/traverse/lib/path/evaluation.js' {\n  declare module.exports: $Exports<'@babel/traverse/lib/path/evaluation'>;\n}\ndeclare module '@babel/traverse/lib/path/family.js' {\n  declare module.exports: $Exports<'@babel/traverse/lib/path/family'>;\n}\ndeclare module '@babel/traverse/lib/path/index.js' {\n  declare module.exports: $Exports<'@babel/traverse/lib/path/index'>;\n}\ndeclare module '@babel/traverse/lib/path/inference/index.js' {\n  declare module.exports: $Exports<'@babel/traverse/lib/path/inference/index'>;\n}\ndeclare module '@babel/traverse/lib/path/inference/inferer-reference.js' {\n  declare module.exports: $Exports<'@babel/traverse/lib/path/inference/inferer-reference'>;\n}\ndeclare module '@babel/traverse/lib/path/inference/inferers.js' {\n  declare module.exports: $Exports<'@babel/traverse/lib/path/inference/inferers'>;\n}\ndeclare module '@babel/traverse/lib/path/introspection.js' {\n  declare module.exports: $Exports<'@babel/traverse/lib/path/introspection'>;\n}\ndeclare module '@babel/traverse/lib/path/lib/hoister.js' {\n  declare module.exports: $Exports<'@babel/traverse/lib/path/lib/hoister'>;\n}\ndeclare module '@babel/traverse/lib/path/lib/removal-hooks.js' {\n  declare module.exports: $Exports<'@babel/traverse/lib/path/lib/removal-hooks'>;\n}\ndeclare module '@babel/traverse/lib/path/lib/virtual-types.js' {\n  declare module.exports: $Exports<'@babel/traverse/lib/path/lib/virtual-types'>;\n}\ndeclare module '@babel/traverse/lib/path/modification.js' {\n  declare module.exports: $Exports<'@babel/traverse/lib/path/modification'>;\n}\ndeclare module '@babel/traverse/lib/path/removal.js' {\n  declare module.exports: $Exports<'@babel/traverse/lib/path/removal'>;\n}\ndeclare module '@babel/traverse/lib/path/replacement.js' {\n  declare module.exports: $Exports<'@babel/traverse/lib/path/replacement'>;\n}\ndeclare module '@babel/traverse/lib/scope/binding.js' {\n  declare module.exports: $Exports<'@babel/traverse/lib/scope/binding'>;\n}\ndeclare module '@babel/traverse/lib/scope/index.js' {\n  declare module.exports: $Exports<'@babel/traverse/lib/scope/index'>;\n}\ndeclare module '@babel/traverse/lib/scope/lib/renamer.js' {\n  declare module.exports: $Exports<'@babel/traverse/lib/scope/lib/renamer'>;\n}\ndeclare module '@babel/traverse/lib/visitors.js' {\n  declare module.exports: $Exports<'@babel/traverse/lib/visitors'>;\n}\n"
  },
  {
    "path": "flow-typed/npm/babel-cli_vx.x.x.js",
    "content": "// flow-typed signature: 4435fbf02a5bad6d14e094416a80e996\n// flow-typed version: <<STUB>>/babel-cli_v^6.18.0/flow_v0.38.0\n\n/**\n * This is an autogenerated libdef stub for:\n *\n *   'babel-cli'\n *\n * Fill this stub out by replacing all the `any` types.\n *\n * Once filled out, we encourage you to share your work with the \n * community by sending a pull request to: \n * https://github.com/flowtype/flow-typed\n */\n\ndeclare module 'babel-cli' {\n  declare module.exports: any;\n}\n\n/**\n * We include stubs for each file inside this npm package in case you need to\n * require those files directly. Feel free to delete any files that aren't\n * needed.\n */\ndeclare module 'babel-cli/bin/babel-doctor' {\n  declare module.exports: any;\n}\n\ndeclare module 'babel-cli/bin/babel-external-helpers' {\n  declare module.exports: any;\n}\n\ndeclare module 'babel-cli/bin/babel-node' {\n  declare module.exports: any;\n}\n\ndeclare module 'babel-cli/bin/babel' {\n  declare module.exports: any;\n}\n\ndeclare module 'babel-cli/lib/_babel-node' {\n  declare module.exports: any;\n}\n\ndeclare module 'babel-cli/lib/babel-external-helpers' {\n  declare module.exports: any;\n}\n\ndeclare module 'babel-cli/lib/babel-node' {\n  declare module.exports: any;\n}\n\ndeclare module 'babel-cli/lib/babel/dir' {\n  declare module.exports: any;\n}\n\ndeclare module 'babel-cli/lib/babel/file' {\n  declare module.exports: any;\n}\n\ndeclare module 'babel-cli/lib/babel/index' {\n  declare module.exports: any;\n}\n\ndeclare module 'babel-cli/lib/babel/util' {\n  declare module.exports: any;\n}\n\n// Filename aliases\ndeclare module 'babel-cli/bin/babel-doctor.js' {\n  declare module.exports: $Exports<'babel-cli/bin/babel-doctor'>;\n}\ndeclare module 'babel-cli/bin/babel-external-helpers.js' {\n  declare module.exports: $Exports<'babel-cli/bin/babel-external-helpers'>;\n}\ndeclare module 'babel-cli/bin/babel-node.js' {\n  declare module.exports: $Exports<'babel-cli/bin/babel-node'>;\n}\ndeclare module 'babel-cli/bin/babel.js' {\n  declare module.exports: $Exports<'babel-cli/bin/babel'>;\n}\ndeclare module 'babel-cli/index' {\n  declare module.exports: $Exports<'babel-cli'>;\n}\ndeclare module 'babel-cli/index.js' {\n  declare module.exports: $Exports<'babel-cli'>;\n}\ndeclare module 'babel-cli/lib/_babel-node.js' {\n  declare module.exports: $Exports<'babel-cli/lib/_babel-node'>;\n}\ndeclare module 'babel-cli/lib/babel-external-helpers.js' {\n  declare module.exports: $Exports<'babel-cli/lib/babel-external-helpers'>;\n}\ndeclare module 'babel-cli/lib/babel-node.js' {\n  declare module.exports: $Exports<'babel-cli/lib/babel-node'>;\n}\ndeclare module 'babel-cli/lib/babel/dir.js' {\n  declare module.exports: $Exports<'babel-cli/lib/babel/dir'>;\n}\ndeclare module 'babel-cli/lib/babel/file.js' {\n  declare module.exports: $Exports<'babel-cli/lib/babel/file'>;\n}\ndeclare module 'babel-cli/lib/babel/index.js' {\n  declare module.exports: $Exports<'babel-cli/lib/babel/index'>;\n}\ndeclare module 'babel-cli/lib/babel/util.js' {\n  declare module.exports: $Exports<'babel-cli/lib/babel/util'>;\n}\n"
  },
  {
    "path": "flow-typed/npm/babel-core_vx.x.x.js",
    "content": "// flow-typed signature: 7540130584c1e9577ca2798f7b6328d6\n// flow-typed version: <<STUB>>/babel-core_v7.0.0-bridge.0/flow_v0.76.0\n\n/**\n * This is an autogenerated libdef stub for:\n *\n *   'babel-core'\n *\n * Fill this stub out by replacing all the `any` types.\n *\n * Once filled out, we encourage you to share your work with the\n * community by sending a pull request to:\n * https://github.com/flowtype/flow-typed\n */\n\ndeclare module 'babel-core' {\n  declare module.exports: any;\n}\n\n/**\n * We include stubs for each file inside this npm package in case you need to\n * require those files directly. Feel free to delete any files that aren't\n * needed.\n */\n\n\n// Filename aliases\ndeclare module 'babel-core/index' {\n  declare module.exports: $Exports<'babel-core'>;\n}\ndeclare module 'babel-core/index.js' {\n  declare module.exports: $Exports<'babel-core'>;\n}\n"
  },
  {
    "path": "flow-typed/npm/babel-eslint_vx.x.x.js",
    "content": "// flow-typed signature: 898fc9205f942f10e1958989fc3958fb\n// flow-typed version: <<STUB>>/babel-eslint_v^7.1.1/flow_v0.38.0\n\n/**\n * This is an autogenerated libdef stub for:\n *\n *   'babel-eslint'\n *\n * Fill this stub out by replacing all the `any` types.\n *\n * Once filled out, we encourage you to share your work with the \n * community by sending a pull request to: \n * https://github.com/flowtype/flow-typed\n */\n\ndeclare module 'babel-eslint' {\n  declare module.exports: any;\n}\n\n/**\n * We include stubs for each file inside this npm package in case you need to\n * require those files directly. Feel free to delete any files that aren't\n * needed.\n */\ndeclare module 'babel-eslint/babylon-to-espree/attachComments' {\n  declare module.exports: any;\n}\n\ndeclare module 'babel-eslint/babylon-to-espree/convertTemplateType' {\n  declare module.exports: any;\n}\n\ndeclare module 'babel-eslint/babylon-to-espree/index' {\n  declare module.exports: any;\n}\n\ndeclare module 'babel-eslint/babylon-to-espree/toAST' {\n  declare module.exports: any;\n}\n\ndeclare module 'babel-eslint/babylon-to-espree/toToken' {\n  declare module.exports: any;\n}\n\ndeclare module 'babel-eslint/babylon-to-espree/toTokens' {\n  declare module.exports: any;\n}\n\n// Filename aliases\ndeclare module 'babel-eslint/babylon-to-espree/attachComments.js' {\n  declare module.exports: $Exports<'babel-eslint/babylon-to-espree/attachComments'>;\n}\ndeclare module 'babel-eslint/babylon-to-espree/convertTemplateType.js' {\n  declare module.exports: $Exports<'babel-eslint/babylon-to-espree/convertTemplateType'>;\n}\ndeclare module 'babel-eslint/babylon-to-espree/index.js' {\n  declare module.exports: $Exports<'babel-eslint/babylon-to-espree/index'>;\n}\ndeclare module 'babel-eslint/babylon-to-espree/toAST.js' {\n  declare module.exports: $Exports<'babel-eslint/babylon-to-espree/toAST'>;\n}\ndeclare module 'babel-eslint/babylon-to-espree/toToken.js' {\n  declare module.exports: $Exports<'babel-eslint/babylon-to-espree/toToken'>;\n}\ndeclare module 'babel-eslint/babylon-to-espree/toTokens.js' {\n  declare module.exports: $Exports<'babel-eslint/babylon-to-espree/toTokens'>;\n}\ndeclare module 'babel-eslint/index' {\n  declare module.exports: $Exports<'babel-eslint'>;\n}\ndeclare module 'babel-eslint/index.js' {\n  declare module.exports: $Exports<'babel-eslint'>;\n}\n"
  },
  {
    "path": "flow-typed/npm/babel-generator_vx.x.x.js",
    "content": "// flow-typed signature: 6cdfff6fe7ed58305bf9148269d1186d\n// flow-typed version: <<STUB>>/babel-generator_v^6.8.0/flow_v0.38.0\n\n/**\n * This is an autogenerated libdef stub for:\n *\n *   'babel-generator'\n *\n * Fill this stub out by replacing all the `any` types.\n *\n * Once filled out, we encourage you to share your work with the\n * community by sending a pull request to:\n * https://github.com/flowtype/flow-typed\n */\n\nimport { BabelNode } from \"@babel/types\";\n\ntype SourceMap = {\n  sources: Array<string>,\n  names: Array<string>,\n  mappings: string,\n  sourcesContent: Array<string>\n};\n\ndeclare module 'babel-generator' {\n  declare module.exports: (ast: BabelNode, opts: Object, code: string) => { code: string, map?: SourceMap };\n}\n\n/**\n * We include stubs for each file inside this npm package in case you need to\n * require those files directly. Feel free to delete any files that aren't\n * needed.\n */\ndeclare module 'babel-generator/lib/buffer' {\n  declare module.exports: any;\n}\n\ndeclare module 'babel-generator/lib/generators/base' {\n  declare module.exports: any;\n}\n\ndeclare module 'babel-generator/lib/generators/classes' {\n  declare module.exports: any;\n}\n\ndeclare module 'babel-generator/lib/generators/expressions' {\n  declare module.exports: any;\n}\n\ndeclare module 'babel-generator/lib/generators/flow' {\n  declare module.exports: any;\n}\n\ndeclare module 'babel-generator/lib/generators/jsx' {\n  declare module.exports: any;\n}\n\ndeclare module 'babel-generator/lib/generators/methods' {\n  declare module.exports: any;\n}\n\ndeclare module 'babel-generator/lib/generators/modules' {\n  declare module.exports: any;\n}\n\ndeclare module 'babel-generator/lib/generators/statements' {\n  declare module.exports: any;\n}\n\ndeclare module 'babel-generator/lib/generators/template-literals' {\n  declare module.exports: any;\n}\n\ndeclare module 'babel-generator/lib/generators/types' {\n  declare module.exports: any;\n}\n\ndeclare module 'babel-generator/lib/index' {\n  declare module.exports: any;\n}\n\ndeclare module 'babel-generator/lib/node/index' {\n  declare module.exports: any;\n}\n\ndeclare module 'babel-generator/lib/node/parentheses' {\n  declare module.exports: any;\n}\n\ndeclare module 'babel-generator/lib/node/whitespace' {\n  declare module.exports: any;\n}\n\ndeclare module 'babel-generator/lib/printer' {\n  declare module.exports: any;\n}\n\ndeclare module 'babel-generator/lib/source-map' {\n  declare module.exports: any;\n}\n\ndeclare module 'babel-generator/lib/whitespace' {\n  declare module.exports: any;\n}\n\n// Filename aliases\ndeclare module 'babel-generator/lib/buffer.js' {\n  declare module.exports: $Exports<'babel-generator/lib/buffer'>;\n}\ndeclare module 'babel-generator/lib/generators/base.js' {\n  declare module.exports: $Exports<'babel-generator/lib/generators/base'>;\n}\ndeclare module 'babel-generator/lib/generators/classes.js' {\n  declare module.exports: $Exports<'babel-generator/lib/generators/classes'>;\n}\ndeclare module 'babel-generator/lib/generators/expressions.js' {\n  declare module.exports: $Exports<'babel-generator/lib/generators/expressions'>;\n}\ndeclare module 'babel-generator/lib/generators/flow.js' {\n  declare module.exports: $Exports<'babel-generator/lib/generators/flow'>;\n}\ndeclare module 'babel-generator/lib/generators/jsx.js' {\n  declare module.exports: $Exports<'babel-generator/lib/generators/jsx'>;\n}\ndeclare module 'babel-generator/lib/generators/methods.js' {\n  declare module.exports: $Exports<'babel-generator/lib/generators/methods'>;\n}\ndeclare module 'babel-generator/lib/generators/modules.js' {\n  declare module.exports: $Exports<'babel-generator/lib/generators/modules'>;\n}\ndeclare module 'babel-generator/lib/generators/statements.js' {\n  declare module.exports: $Exports<'babel-generator/lib/generators/statements'>;\n}\ndeclare module 'babel-generator/lib/generators/template-literals.js' {\n  declare module.exports: $Exports<'babel-generator/lib/generators/template-literals'>;\n}\ndeclare module 'babel-generator/lib/generators/types.js' {\n  declare module.exports: $Exports<'babel-generator/lib/generators/types'>;\n}\ndeclare module 'babel-generator/lib/index.js' {\n  declare module.exports: $Exports<'babel-generator/lib/index'>;\n}\ndeclare module 'babel-generator/lib/node/index.js' {\n  declare module.exports: $Exports<'babel-generator/lib/node/index'>;\n}\ndeclare module 'babel-generator/lib/node/parentheses.js' {\n  declare module.exports: $Exports<'babel-generator/lib/node/parentheses'>;\n}\ndeclare module 'babel-generator/lib/node/whitespace.js' {\n  declare module.exports: $Exports<'babel-generator/lib/node/whitespace'>;\n}\ndeclare module 'babel-generator/lib/printer.js' {\n  declare module.exports: $Exports<'babel-generator/lib/printer'>;\n}\ndeclare module 'babel-generator/lib/source-map.js' {\n  declare module.exports: $Exports<'babel-generator/lib/source-map'>;\n}\ndeclare module 'babel-generator/lib/whitespace.js' {\n  declare module.exports: $Exports<'babel-generator/lib/whitespace'>;\n}\n"
  },
  {
    "path": "flow-typed/npm/babel-helper-function-name_vx.x.x.js",
    "content": "// flow-typed signature: 00b8ab338c10ac6b548eacb2b78c1d81\n// flow-typed version: <<STUB>>/babel-helper-function-name_v^6.8.0/flow_v0.38.0\n\n/**\n * This is an autogenerated libdef stub for:\n *\n *   'babel-helper-function-name'\n *\n * Fill this stub out by replacing all the `any` types.\n *\n * Once filled out, we encourage you to share your work with the \n * community by sending a pull request to: \n * https://github.com/flowtype/flow-typed\n */\n\ndeclare module 'babel-helper-function-name' {\n  declare module.exports: any;\n}\n\n/**\n * We include stubs for each file inside this npm package in case you need to\n * require those files directly. Feel free to delete any files that aren't\n * needed.\n */\ndeclare module 'babel-helper-function-name/lib/index' {\n  declare module.exports: any;\n}\n\n// Filename aliases\ndeclare module 'babel-helper-function-name/lib/index.js' {\n  declare module.exports: $Exports<'babel-helper-function-name/lib/index'>;\n}\n"
  },
  {
    "path": "flow-typed/npm/babel-helper-get-function-arity_vx.x.x.js",
    "content": "// flow-typed signature: 91253616435274658664be70a5673e3c\n// flow-typed version: <<STUB>>/babel-helper-get-function-arity_v^6.8.0/flow_v0.38.0\n\n/**\n * This is an autogenerated libdef stub for:\n *\n *   'babel-helper-get-function-arity'\n *\n * Fill this stub out by replacing all the `any` types.\n *\n * Once filled out, we encourage you to share your work with the \n * community by sending a pull request to: \n * https://github.com/flowtype/flow-typed\n */\n\ndeclare module 'babel-helper-get-function-arity' {\n  declare module.exports: any;\n}\n\n/**\n * We include stubs for each file inside this npm package in case you need to\n * require those files directly. Feel free to delete any files that aren't\n * needed.\n */\ndeclare module 'babel-helper-get-function-arity/lib/index' {\n  declare module.exports: any;\n}\n\n// Filename aliases\ndeclare module 'babel-helper-get-function-arity/lib/index.js' {\n  declare module.exports: $Exports<'babel-helper-get-function-arity/lib/index'>;\n}\n"
  },
  {
    "path": "flow-typed/npm/babel-jest_vx.x.x.js",
    "content": "// flow-typed signature: fd955224b4ff20689118b3df4ec748c1\n// flow-typed version: <<STUB>>/babel-jest_v^23.4.0/flow_v0.76.0\n\n/**\n * This is an autogenerated libdef stub for:\n *\n *   'babel-jest'\n *\n * Fill this stub out by replacing all the `any` types.\n *\n * Once filled out, we encourage you to share your work with the\n * community by sending a pull request to:\n * https://github.com/flowtype/flow-typed\n */\n\ndeclare module 'babel-jest' {\n  declare module.exports: any;\n}\n\n/**\n * We include stubs for each file inside this npm package in case you need to\n * require those files directly. Feel free to delete any files that aren't\n * needed.\n */\ndeclare module 'babel-jest/build/index' {\n  declare module.exports: any;\n}\n\n// Filename aliases\ndeclare module 'babel-jest/build/index.js' {\n  declare module.exports: $Exports<'babel-jest/build/index'>;\n}\n"
  },
  {
    "path": "flow-typed/npm/babel-plugin-jest-hoist_vx.x.x.js",
    "content": "// flow-typed signature: fe7e54a98300f409fd3c32a79a2e317f\n// flow-typed version: <<STUB>>/babel-plugin-jest-hoist_v^23.2.0/flow_v0.76.0\n\n/**\n * This is an autogenerated libdef stub for:\n *\n *   'babel-plugin-jest-hoist'\n *\n * Fill this stub out by replacing all the `any` types.\n *\n * Once filled out, we encourage you to share your work with the\n * community by sending a pull request to:\n * https://github.com/flowtype/flow-typed\n */\n\ndeclare module 'babel-plugin-jest-hoist' {\n  declare module.exports: any;\n}\n\n/**\n * We include stubs for each file inside this npm package in case you need to\n * require those files directly. Feel free to delete any files that aren't\n * needed.\n */\ndeclare module 'babel-plugin-jest-hoist/build/index' {\n  declare module.exports: any;\n}\n\n// Filename aliases\ndeclare module 'babel-plugin-jest-hoist/build/index.js' {\n  declare module.exports: $Exports<'babel-plugin-jest-hoist/build/index'>;\n}\n"
  },
  {
    "path": "flow-typed/npm/babel-plugin-transform-class-properties_vx.x.x.js",
    "content": "// flow-typed signature: d319b6e3a99c5e22f50a21448401b4bb\n// flow-typed version: <<STUB>>/babel-plugin-transform-class-properties_v^6.6.0/flow_v0.38.0\n\n/**\n * This is an autogenerated libdef stub for:\n *\n *   'babel-plugin-transform-class-properties'\n *\n * Fill this stub out by replacing all the `any` types.\n *\n * Once filled out, we encourage you to share your work with the \n * community by sending a pull request to: \n * https://github.com/flowtype/flow-typed\n */\n\ndeclare module 'babel-plugin-transform-class-properties' {\n  declare module.exports: any;\n}\n\n/**\n * We include stubs for each file inside this npm package in case you need to\n * require those files directly. Feel free to delete any files that aren't\n * needed.\n */\ndeclare module 'babel-plugin-transform-class-properties/lib/index' {\n  declare module.exports: any;\n}\n\n// Filename aliases\ndeclare module 'babel-plugin-transform-class-properties/lib/index.js' {\n  declare module.exports: $Exports<'babel-plugin-transform-class-properties/lib/index'>;\n}\n"
  },
  {
    "path": "flow-typed/npm/babel-plugin-transform-object-rest-spread_vx.x.x.js",
    "content": "// flow-typed signature: a3f1c558566ae53820e9a04cdba6c6ba\n// flow-typed version: <<STUB>>/babel-plugin-transform-object-rest-spread_v^6.8.0/flow_v0.38.0\n\n/**\n * This is an autogenerated libdef stub for:\n *\n *   'babel-plugin-transform-object-rest-spread'\n *\n * Fill this stub out by replacing all the `any` types.\n *\n * Once filled out, we encourage you to share your work with the \n * community by sending a pull request to: \n * https://github.com/flowtype/flow-typed\n */\n\ndeclare module 'babel-plugin-transform-object-rest-spread' {\n  declare module.exports: any;\n}\n\n/**\n * We include stubs for each file inside this npm package in case you need to\n * require those files directly. Feel free to delete any files that aren't\n * needed.\n */\ndeclare module 'babel-plugin-transform-object-rest-spread/lib/index' {\n  declare module.exports: any;\n}\n\n// Filename aliases\ndeclare module 'babel-plugin-transform-object-rest-spread/lib/index.js' {\n  declare module.exports: $Exports<'babel-plugin-transform-object-rest-spread/lib/index'>;\n}\n"
  },
  {
    "path": "flow-typed/npm/babel-preset-es2015_vx.x.x.js",
    "content": "// flow-typed signature: 9336b10ac614a30819f5a15db1fd5758\n// flow-typed version: <<STUB>>/babel-preset-es2015_v^6.5.0/flow_v0.38.0\n\n/**\n * This is an autogenerated libdef stub for:\n *\n *   'babel-preset-es2015'\n *\n * Fill this stub out by replacing all the `any` types.\n *\n * Once filled out, we encourage you to share your work with the \n * community by sending a pull request to: \n * https://github.com/flowtype/flow-typed\n */\n\ndeclare module 'babel-preset-es2015' {\n  declare module.exports: any;\n}\n\n/**\n * We include stubs for each file inside this npm package in case you need to\n * require those files directly. Feel free to delete any files that aren't\n * needed.\n */\ndeclare module 'babel-preset-es2015/lib/index' {\n  declare module.exports: any;\n}\n\n// Filename aliases\ndeclare module 'babel-preset-es2015/lib/index.js' {\n  declare module.exports: $Exports<'babel-preset-es2015/lib/index'>;\n}\n"
  },
  {
    "path": "flow-typed/npm/babel-preset-react_vx.x.x.js",
    "content": "// flow-typed signature: ed358ef4a88d50ce624eb3dd4847f82a\n// flow-typed version: <<STUB>>/babel-preset-react_v^6.5.0/flow_v0.38.0\n\n/**\n * This is an autogenerated libdef stub for:\n *\n *   'babel-preset-react'\n *\n * Fill this stub out by replacing all the `any` types.\n *\n * Once filled out, we encourage you to share your work with the \n * community by sending a pull request to: \n * https://github.com/flowtype/flow-typed\n */\n\ndeclare module 'babel-preset-react' {\n  declare module.exports: any;\n}\n\n/**\n * We include stubs for each file inside this npm package in case you need to\n * require those files directly. Feel free to delete any files that aren't\n * needed.\n */\ndeclare module 'babel-preset-react/lib/index' {\n  declare module.exports: any;\n}\n\n// Filename aliases\ndeclare module 'babel-preset-react/lib/index.js' {\n  declare module.exports: $Exports<'babel-preset-react/lib/index'>;\n}\n"
  },
  {
    "path": "flow-typed/npm/babel-template_vx.x.x.js",
    "content": "// flow-typed signature: ff9ff3b60b305a3308b20c3420f15c37\n// flow-typed version: <<STUB>>/babel-template_v^6.9.0/flow_v0.38.0\n\n/**\n * This is an autogenerated libdef stub for:\n *\n *   'babel-template'\n *\n * Fill this stub out by replacing all the `any` types.\n *\n * Once filled out, we encourage you to share your work with the\n * community by sending a pull request to:\n * https://github.com/flowtype/flow-typed\n */\n\n import { BabelNodeStatement } from \"@babel/types\";\n\ndeclare module 'babel-template' {\n  declare module.exports: (code: string, opts?: Object) => Object => BabelNodeStatement;\n}\n\n/**\n * We include stubs for each file inside this npm package in case you need to\n * require those files directly. Feel free to delete any files that aren't\n * needed.\n */\ndeclare module 'babel-template/lib/index' {\n  declare module.exports: any;\n}\n\n// Filename aliases\ndeclare module 'babel-template/lib/index.js' {\n  declare module.exports: $Exports<'babel-template/lib/index'>;\n}\n"
  },
  {
    "path": "flow-typed/npm/babel-traverse_vx.x.x.js",
    "content": "// flow-typed signature: e044f91300344c6b466bbb8596699612\n// flow-typed version: <<STUB>>/babel-traverse_v^6.9.0/flow_v0.38.0\n\n/**\n * This is an autogenerated libdef stub for:\n *\n *   'babel-traverse'\n *\n * Fill this stub out by replacing all the `any` types.\n *\n * Once filled out, we encourage you to share your work with the\n * community by sending a pull request to:\n * https://github.com/flowtype/flow-typed\n */\n\nimport type { BabelNode, BabelNodeIdentifier } from \"@babel/types\";\n\ndeclare module 'babel-traverse' {\n  declare export class BabelTraversePath {\n    getBindingIdentifierPaths(): { [key: string]: BabelTraversePath };\n    getBindingIdentifiers(): { [key: string]: BabelNodeIdentifier };\n    replaceWith(node: BabelNode): void;\n    remove(): void;\n    scope: BabelTraverseScope;\n    node: BabelNode;\n    parent: BabelNode;\n    parentPath: BabelTraversePath;\n  }\n\n  declare export class BabelTraverseScope {\n    hasBinding(name: string, noGlobals: boolean): boolean;\n  }\n\n  declare export default (\n    parent?: BabelNode | Array<BabelNode>,\n    opts?: Object,\n    scope: ?BabelTraverseScope,\n    state: Object,\n    parentPath?: BabelTraversePath,\n  ) => void;\n}\n\n/**\n * We include stubs for each file inside this npm package in case you need to\n * require those files directly. Feel free to delete any files that aren't\n * needed.\n */\ndeclare module 'babel-traverse/lib/cache' {\n  declare module.exports: any;\n}\n\ndeclare module 'babel-traverse/lib/context' {\n  declare module.exports: any;\n}\n\ndeclare module 'babel-traverse/lib/hub' {\n  declare module.exports: any;\n}\n\ndeclare module 'babel-traverse/lib/index' {\n  declare module.exports: any;\n}\n\ndeclare module 'babel-traverse/lib/path/ancestry' {\n  declare module.exports: any;\n}\n\ndeclare module 'babel-traverse/lib/path/comments' {\n  declare module.exports: any;\n}\n\ndeclare module 'babel-traverse/lib/path/context' {\n  declare module.exports: any;\n}\n\ndeclare module 'babel-traverse/lib/path/conversion' {\n  declare module.exports: any;\n}\n\ndeclare module 'babel-traverse/lib/path/evaluation' {\n  declare module.exports: any;\n}\n\ndeclare module 'babel-traverse/lib/path/family' {\n  declare module.exports: any;\n}\n\ndeclare module 'babel-traverse/lib/path/index' {\n  declare module.exports: any;\n}\n\ndeclare module 'babel-traverse/lib/path/inference/index' {\n  declare module.exports: any;\n}\n\ndeclare module 'babel-traverse/lib/path/inference/inferer-reference' {\n  declare module.exports: any;\n}\n\ndeclare module 'babel-traverse/lib/path/inference/inferers' {\n  declare module.exports: any;\n}\n\ndeclare module 'babel-traverse/lib/path/introspection' {\n  declare module.exports: any;\n}\n\ndeclare module 'babel-traverse/lib/path/lib/hoister' {\n  declare module.exports: any;\n}\n\ndeclare module 'babel-traverse/lib/path/lib/removal-hooks' {\n  declare module.exports: any;\n}\n\ndeclare module 'babel-traverse/lib/path/lib/virtual-types' {\n  declare module.exports: any;\n}\n\ndeclare module 'babel-traverse/lib/path/modification' {\n  declare module.exports: any;\n}\n\ndeclare module 'babel-traverse/lib/path/removal' {\n  declare module.exports: any;\n}\n\ndeclare module 'babel-traverse/lib/path/replacement' {\n  declare module.exports: any;\n}\n\ndeclare module 'babel-traverse/lib/scope/binding' {\n  declare module.exports: any;\n}\n\ndeclare module 'babel-traverse/lib/scope/index' {\n  declare module.exports: any;\n}\n\ndeclare module 'babel-traverse/lib/scope/lib/renamer' {\n  declare module.exports: any;\n}\n\ndeclare module 'babel-traverse/lib/visitors' {\n  declare module.exports: any;\n}\n\n// Filename aliases\ndeclare module 'babel-traverse/lib/cache.js' {\n  declare module.exports: $Exports<'babel-traverse/lib/cache'>;\n}\ndeclare module 'babel-traverse/lib/context.js' {\n  declare module.exports: $Exports<'babel-traverse/lib/context'>;\n}\ndeclare module 'babel-traverse/lib/hub.js' {\n  declare module.exports: $Exports<'babel-traverse/lib/hub'>;\n}\ndeclare module 'babel-traverse/lib/index.js' {\n  declare module.exports: $Exports<'babel-traverse/lib/index'>;\n}\ndeclare module 'babel-traverse/lib/path/ancestry.js' {\n  declare module.exports: $Exports<'babel-traverse/lib/path/ancestry'>;\n}\ndeclare module 'babel-traverse/lib/path/comments.js' {\n  declare module.exports: $Exports<'babel-traverse/lib/path/comments'>;\n}\ndeclare module 'babel-traverse/lib/path/context.js' {\n  declare module.exports: $Exports<'babel-traverse/lib/path/context'>;\n}\ndeclare module 'babel-traverse/lib/path/conversion.js' {\n  declare module.exports: $Exports<'babel-traverse/lib/path/conversion'>;\n}\ndeclare module 'babel-traverse/lib/path/evaluation.js' {\n  declare module.exports: $Exports<'babel-traverse/lib/path/evaluation'>;\n}\ndeclare module 'babel-traverse/lib/path/family.js' {\n  declare module.exports: $Exports<'babel-traverse/lib/path/family'>;\n}\ndeclare module 'babel-traverse/lib/path/index.js' {\n  declare module.exports: $Exports<'babel-traverse/lib/path/index'>;\n}\ndeclare module 'babel-traverse/lib/path/inference/index.js' {\n  declare module.exports: $Exports<'babel-traverse/lib/path/inference/index'>;\n}\ndeclare module 'babel-traverse/lib/path/inference/inferer-reference.js' {\n  declare module.exports: $Exports<'babel-traverse/lib/path/inference/inferer-reference'>;\n}\ndeclare module 'babel-traverse/lib/path/inference/inferers.js' {\n  declare module.exports: $Exports<'babel-traverse/lib/path/inference/inferers'>;\n}\ndeclare module 'babel-traverse/lib/path/introspection.js' {\n  declare module.exports: $Exports<'babel-traverse/lib/path/introspection'>;\n}\ndeclare module 'babel-traverse/lib/path/lib/hoister.js' {\n  declare module.exports: $Exports<'babel-traverse/lib/path/lib/hoister'>;\n}\ndeclare module 'babel-traverse/lib/path/lib/removal-hooks.js' {\n  declare module.exports: $Exports<'babel-traverse/lib/path/lib/removal-hooks'>;\n}\ndeclare module 'babel-traverse/lib/path/lib/virtual-types.js' {\n  declare module.exports: $Exports<'babel-traverse/lib/path/lib/virtual-types'>;\n}\ndeclare module 'babel-traverse/lib/path/modification.js' {\n  declare module.exports: $Exports<'babel-traverse/lib/path/modification'>;\n}\ndeclare module 'babel-traverse/lib/path/removal.js' {\n  declare module.exports: $Exports<'babel-traverse/lib/path/removal'>;\n}\ndeclare module 'babel-traverse/lib/path/replacement.js' {\n  declare module.exports: $Exports<'babel-traverse/lib/path/replacement'>;\n}\ndeclare module 'babel-traverse/lib/scope/binding.js' {\n  declare module.exports: $Exports<'babel-traverse/lib/scope/binding'>;\n}\ndeclare module 'babel-traverse/lib/scope/index.js' {\n  declare module.exports: $Exports<'babel-traverse/lib/scope/index'>;\n}\ndeclare module 'babel-traverse/lib/scope/lib/renamer.js' {\n  declare module.exports: $Exports<'babel-traverse/lib/scope/lib/renamer'>;\n}\ndeclare module 'babel-traverse/lib/visitors.js' {\n  declare module.exports: $Exports<'babel-traverse/lib/visitors'>;\n}\n"
  },
  {
    "path": "flow-typed/npm/babel-types_vx.x.x.js",
    "content": "// flow-typed signature: e65b014cd6fc2636d93a98c55ee45a1a\n// flow-typed version: <<STUB>>/babel-types_v^6.9.0/flow_v0.38.0\n\n/**\n * This is an autogenerated libdef stub for:\n *\n *   'babel-types'\n *\n * Fill this stub out by replacing all the `any` types.\n *\n * Once filled out, we encourage you to share your work with the\n * community by sending a pull request to:\n * https://github.com/flowtype/flow-typed\n */\n// NOTE: This file is autogenerated. Do not modify.\n// See [babel GIT root]/scripts/generate-interfaces.js for script used.\n\n\ndeclare module \"@babel/types\" {\n  declare type BabelObjectMethodKind = \"get\" | \"set\" | \"method\";\n  declare type BabelLogicalOperator = \"||\" | \"&&\";\n  declare type BabelAssignmentOperator = \"=\" | \"+=\" | \"-=\" | \"*=\" | \"/=\" | \"%=\" | \"<<=\" | \">>=\" | \">>>=\" | \"|=\" | \"^=\" | \"&=\";\n  declare type BabelBinaryOperator = \"+\" | \"-\" | \"/\" | \"%\" | \"*\" | \"**\" | \"&\" | \"|\" | \">>\" | \">>>\" | \"<<\" | \"^\" | \"==\" | \"===\" | \"!=\" | \"!==\" | \"in\" | \"instanceof\" | \">\" | \"<\" | \">=\" | \"<=\";\n  declare type BabelUnaryOperator = \"void\" | \"delete\" | \"!\" | \"+\" | \"-\" | \"++\" | \"--\" | \"~\" | \"typeof\";\n  declare type BabelUpdateOperator = \"++\" | \"--\";\n  declare type BabelVariableKind = \"var\" | \"let\" | \"const\";\n\n  declare class BabelNodeComment {\n    +type: \"BlockComment\" | \"LineComment\";\n    value: string;\n    start: number;\n    end: number;\n    loc: BabelNodeSourceLocation;\n  }\n\n  declare class BabelNodeBlockComment extends BabelNodeComment {\n    type: \"BlockComment\";\n  }\n\n  declare class BabelNodeLineComment extends BabelNodeComment {\n    type: \"LineComment\";\n  }\n\n  declare class BabelNodePosition {\n    line: number;\n    column: number;\n  }\n\n  declare class BabelNodeSourceLocation {\n    source: string | null;\n    start: BabelNodePosition;\n    end: BabelNodePosition;\n  }\n\n  declare class BabelNode {\n    +type: \"ArrayExpression\" |\n      \"AssignmentExpression\" |\n      \"BinaryExpression\" |\n      \"Directive\" |\n      \"DirectiveLiteral\" |\n      \"BlockStatement\" |\n      \"BreakStatement\" |\n      \"CallExpression\" |\n      \"CatchClause\" |\n      \"ConditionalExpression\" |\n      \"ContinueStatement\" |\n      \"DebuggerStatement\" |\n      \"DoWhileStatement\" |\n      \"EmptyStatement\" |\n      \"ExpressionStatement\" |\n      \"File\" |\n      \"ForInStatement\" |\n      \"ForStatement\" |\n      \"FunctionDeclaration\" |\n      \"FunctionExpression\" |\n      \"Identifier\" |\n      \"IfStatement\" |\n      \"LabeledStatement\" |\n      \"StringLiteral\" |\n      \"NumericLiteral\" |\n      \"NullLiteral\" |\n      \"BooleanLiteral\" |\n      \"RegExpLiteral\" |\n      \"LogicalExpression\" |\n      \"MemberExpression\" |\n      \"NewExpression\" |\n      \"Program\" |\n      \"ObjectExpression\" |\n      \"ObjectMethod\" |\n      \"ObjectProperty\" |\n      \"RestElement\" |\n      \"ReturnStatement\" |\n      \"SequenceExpression\" |\n      \"SwitchCase\" |\n      \"SwitchStatement\" |\n      \"ThisExpression\" |\n      \"ThrowStatement\" |\n      \"TryStatement\" |\n      \"UnaryExpression\" |\n      \"UpdateExpression\" |\n      \"VariableDeclaration\" |\n      \"VariableDeclarator\" |\n      \"WhileStatement\" |\n      \"WithStatement\" |\n      \"AssignmentPattern\" |\n      \"ArrayPattern\" |\n      \"ArrowFunctionExpression\" |\n      \"ClassBody\" |\n      \"ClassDeclaration\" |\n      \"ClassExpression\" |\n      \"ExportAllDeclaration\" |\n      \"ExportDefaultDeclaration\" |\n      \"ExportNamedDeclaration\" |\n      \"ExportSpecifier\" |\n      \"ForOfStatement\" |\n      \"ImportDeclaration\" |\n      \"ImportDefaultSpecifier\" |\n      \"ImportNamespaceSpecifier\" |\n      \"ImportSpecifier\" |\n      \"MetaProperty\" |\n      \"ClassMethod\" |\n      \"ObjectPattern\" |\n      \"SpreadElement\" |\n      \"Super\" |\n      \"TaggedTemplateExpression\" |\n      \"TemplateElement\" |\n      \"TemplateLiteral\" |\n      \"YieldExpression\" |\n      \"AnyTypeAnnotation\" |\n      \"ArrayTypeAnnotation\" |\n      \"BooleanTypeAnnotation\" |\n      \"BooleanLiteralTypeAnnotation\" |\n      \"NullLiteralTypeAnnotation\" |\n      \"ClassImplements\" |\n      \"ClassProperty\" |\n      \"DeclareClass\" |\n      \"DeclareFunction\" |\n      \"DeclareInterface\" |\n      \"DeclareModule\" |\n      \"DeclareModuleExports\" |\n      \"DeclareTypeAlias\" |\n      \"DeclareVariable\" |\n      \"ExistentialTypeParam\" |\n      \"FunctionTypeAnnotation\" |\n      \"FunctionTypeParam\" |\n      \"GenericTypeAnnotation\" |\n      \"InterfaceExtends\" |\n      \"InterfaceDeclaration\" |\n      \"IntersectionTypeAnnotation\" |\n      \"MixedTypeAnnotation\" |\n      \"EmptyTypeAnnotation\" |\n      \"NullableTypeAnnotation\" |\n      \"NumericLiteralTypeAnnotation\" |\n      \"NumberTypeAnnotation\" |\n      \"StringLiteralTypeAnnotation\" |\n      \"StringTypeAnnotation\" |\n      \"ThisTypeAnnotation\" |\n      \"TupleTypeAnnotation\" |\n      \"TypeofTypeAnnotation\" |\n      \"TypeAlias\" |\n      \"TypeAnnotation\" |\n      \"TypeCastExpression\" |\n      \"TypeParameter\" |\n      \"TypeParameterDeclaration\" |\n      \"TypeParameterInstantiation\" |\n      \"ObjectTypeAnnotation\" |\n      \"ObjectTypeCallProperty\" |\n      \"ObjectTypeIndexer\" |\n      \"ObjectTypeProperty\" |\n      \"QualifiedTypeIdentifier\" |\n      \"UnionTypeAnnotation\" |\n      \"VoidTypeAnnotation\" |\n      \"JSXAttribute\" |\n      \"JSXClosingElement\" |\n      \"JSXElement\" |\n      \"JSXEmptyExpression\" |\n      \"JSXExpressionContainer\" |\n      \"JSXIdentifier\" |\n      \"JSXMemberExpression\" |\n      \"JSXNamespacedName\" |\n      \"JSXOpeningElement\" |\n      \"JSXSpreadAttribute\" |\n      \"JSXText\" |\n      \"Noop\" |\n      \"ParenthesizedExpression\" |\n      \"AwaitExpression\" |\n      \"ForAwaitStatement\" |\n      \"BindExpression\" |\n      \"Decorator\" |\n      \"DoExpression\" |\n      \"ExportDefaultSpecifier\" |\n      \"ExportNamespaceSpecifier\" |\n      \"RestProperty\" ;\n    leadingComments: ?Array<BabelNodeComment>;\n    innerComments: ?Array<BabelNodeComment>;\n    trailingComments: ?Array<BabelNodeComment>;\n    start: ?number;\n    end: ?number;\n    loc: ?BabelNodeSourceLocation;\n  }\n\n  declare class BabelNodeArrayExpression extends BabelNode {\n    type: \"ArrayExpression\";\n    elements: Array<void | BabelNodeExpression | BabelNodeSpreadElement>;\n  }\n\n  declare class BabelNodeAssignmentExpression extends BabelNode {\n    type: \"AssignmentExpression\";\n    operator: BabelAssignmentOperator;\n    left: BabelNodeLVal;\n    right: BabelNodeExpression;\n  }\n\n  declare class BabelNodeBinaryExpression extends BabelNode {\n    type: \"BinaryExpression\";\n    operator: BabelBinaryOperator;\n    left: BabelNodeExpression;\n    right: BabelNodeExpression;\n  }\n\n  declare class BabelNodeDirective extends BabelNode {\n    type: \"Directive\";\n    value: BabelNodeDirectiveLiteral;\n  }\n\n  declare class BabelNodeDirectiveLiteral extends BabelNode {\n    type: \"DirectiveLiteral\";\n    value: string;\n  }\n\n  declare class BabelNodeBlockStatement extends BabelNode {\n    type: \"BlockStatement\";\n    directives?: Array<BabelNodeDirective>;\n    body: Array<BabelNodeStatement>;\n  }\n\n  declare class BabelNodeBreakStatement extends BabelNode {\n    type: \"BreakStatement\";\n    label?: ?BabelNodeIdentifier;\n  }\n\n  declare class BabelNodeCallExpression extends BabelNode {\n    type: \"CallExpression\";\n    callee: BabelNodeExpression;\n    arguments: Array<BabelNodeExpression | BabelNodeSpreadElement>;\n  }\n\n  declare class BabelNodeCatchClause extends BabelNode {\n    type: \"CatchClause\";\n    param: BabelNodePattern;\n    body: BabelNodeBlockStatement;\n  }\n\n  declare class BabelNodeConditionalExpression extends BabelNode {\n    type: \"ConditionalExpression\";\n    test: BabelNodeExpression;\n    consequent: BabelNodeExpression;\n    alternate: BabelNodeExpression;\n  }\n\n  declare class BabelNodeContinueStatement extends BabelNode {\n    type: \"ContinueStatement\";\n    label?: ?BabelNodeIdentifier;\n  }\n\n  declare class BabelNodeDebuggerStatement extends BabelNode {\n    type: \"DebuggerStatement\";\n  }\n\n  declare class BabelNodeDoWhileStatement extends BabelNode {\n    type: \"DoWhileStatement\";\n    test: BabelNodeExpression;\n    body: BabelNodeStatement;\n  }\n\n  declare class BabelNodeEmptyStatement extends BabelNode {\n    type: \"EmptyStatement\";\n  }\n\n  declare class BabelNodeExpressionStatement extends BabelNode {\n    type: \"ExpressionStatement\";\n    expression: BabelNodeExpression;\n  }\n\n  declare class BabelNodeFile extends BabelNode {\n    type: \"File\";\n    program: BabelNodeProgram;\n    comments: any;\n    tokens: any;\n  }\n\n  declare class BabelNodeForInStatement extends BabelNode {\n    type: \"ForInStatement\";\n    left: BabelNodeVariableDeclaration | BabelNodeLVal;\n    right: BabelNodeExpression;\n    body: BabelNodeStatement;\n  }\n\n  declare class BabelNodeForStatement extends BabelNode {\n    type: \"ForStatement\";\n    init?: ?BabelNodeVariableDeclaration | BabelNodeExpression;\n    test?: ?BabelNodeExpression;\n    update?: ?BabelNodeExpression;\n    body: BabelNodeStatement;\n  }\n\n  declare class BabelNodeFunctionDeclaration extends BabelNode {\n    type: \"FunctionDeclaration\";\n    id: BabelNodeIdentifier;\n    params: Array<BabelNodeLVal>;\n    body: BabelNodeBlockStatement;\n    generator: boolean;\n    async: boolean;\n    returnType?: any;\n    typeParameters?: any;\n  }\n\n  declare class BabelNodeFunctionExpression extends BabelNode {\n    type: \"FunctionExpression\";\n    id?: ?BabelNodeIdentifier;\n    params: Array<BabelNodeLVal>;\n    body: BabelNodeBlockStatement;\n    generator?: boolean;\n    async?: boolean;\n    returnType?: any;\n    typeParameters?: any;\n  }\n\n  declare class BabelNodeIdentifier extends BabelNode {\n    type: \"Identifier\";\n    name: string;\n    decorators?: any;\n    typeAnnotation?: any;\n  }\n\n  declare class BabelNodeIfStatement extends BabelNode {\n    type: \"IfStatement\";\n    test: BabelNodeExpression;\n    consequent: BabelNodeStatement;\n    alternate?: ?BabelNodeStatement;\n  }\n\n  declare class BabelNodeLabeledStatement extends BabelNode {\n    type: \"LabeledStatement\";\n    label: BabelNodeIdentifier;\n    body: BabelNodeStatement;\n  }\n\n  declare class BabelNodeStringLiteral extends BabelNode {\n    type: \"StringLiteral\";\n    value: string;\n  }\n\n  declare class BabelNodeNumericLiteral extends BabelNode {\n    type: \"NumericLiteral\";\n    value: number;\n  }\n\n  declare class BabelNodeNullLiteral extends BabelNode {\n    type: \"NullLiteral\";\n  }\n\n  declare class BabelNodeBooleanLiteral extends BabelNode {\n    type: \"BooleanLiteral\";\n    value: boolean;\n  }\n\n  declare class BabelNodeRegExpLiteral extends BabelNode {\n    type: \"RegExpLiteral\";\n    pattern: string;\n    flags?: string;\n  }\n\n  declare class BabelNodeLogicalExpression extends BabelNode {\n    type: \"LogicalExpression\";\n    operator: BabelLogicalOperator;\n    left: BabelNodeExpression;\n    right: BabelNodeExpression;\n  }\n\n  declare class BabelNodeMemberExpression extends BabelNode {\n    type: \"MemberExpression\";\n    object: BabelNodeExpression;\n    property: any;\n    computed?: boolean;\n  }\n\n  declare class BabelNodeNewExpression extends BabelNode {\n    type: \"NewExpression\";\n    callee: BabelNodeExpression;\n    arguments: Array<BabelNode>;\n  }\n\n  declare class BabelNodeProgram extends BabelNode {\n    type: \"Program\";\n    sourceType: \"script\" | \"module\";\n    directives?: Array<BabelNodeDirective>;\n    body: Array<BabelNodeStatement | BabelNodeModuleDeclaration>;\n  }\n\n  declare class BabelNodeObjectExpression extends BabelNode {\n    type: \"ObjectExpression\";\n    properties: Array<BabelNodeObjectProperty>;\n  }\n\n  declare class BabelNodeObjectMethod extends BabelNode {\n    type: \"ObjectMethod\";\n    kind: BabelObjectMethodKind;\n    computed: boolean;\n    key: BabelNodeExpression;\n    decorators: Array<BabelNodeDecorator>;\n    value: BabelNodeExpression;\n    id?: ?BabelNodeIdentifier;\n    params: Array<BabelNodeLVal>;\n    body: BabelNodeBlockStatement;\n    generator?: boolean;\n    async: boolean;\n  }\n\n  declare class BabelNodeObjectProperty extends BabelNode {\n    type: \"ObjectProperty\";\n    computed: boolean;\n    key: BabelNodeExpression;\n    decorators: Array<BabelNodeDecorator>;\n    value: BabelNodeExpression;\n  }\n\n  declare class BabelNodeRestElement extends BabelNode {\n    type: \"RestElement\";\n    argument: BabelNodePattern;\n    decorators?: any;\n    typeAnnotation: any;\n  }\n\n  declare class BabelNodeReturnStatement extends BabelNode {\n    type: \"ReturnStatement\";\n    argument?: ?BabelNodeExpression;\n  }\n\n  declare class BabelNodeSequenceExpression extends BabelNode {\n    type: \"SequenceExpression\";\n    expressions: Array<BabelNodeExpression>;\n  }\n\n  declare class BabelNodeSwitchCase extends BabelNode {\n    type: \"SwitchCase\";\n    test?: ?BabelNodeExpression;\n    consequent: Array<BabelNodeStatement>;\n  }\n\n  declare class BabelNodeSwitchStatement extends BabelNode {\n    type: \"SwitchStatement\";\n    discriminant: BabelNodeExpression;\n    cases: Array<BabelNodeSwitchCase>;\n  }\n\n  declare class BabelNodeThisExpression extends BabelNode {\n    type: \"ThisExpression\";\n  }\n\n  declare class BabelNodeThrowStatement extends BabelNode {\n    type: \"ThrowStatement\";\n    argument: BabelNodeExpression;\n  }\n\n  declare class BabelNodeTryStatement extends BabelNode {\n    type: \"TryStatement\";\n    body?: ?BabelNodeBlockStatement;\n    handler?: ?BabelNodeCatchClause;\n    finalizer?: ?BabelNodeBlockStatement;\n    block: BabelNodeBlockStatement;\n  }\n\n  declare class BabelNodeUnaryExpression extends BabelNode {\n    type: \"UnaryExpression\";\n    prefix?: boolean;\n    argument: BabelNodeExpression;\n    operator: BabelUnaryOperator;\n  }\n\n  declare class BabelNodeUpdateExpression extends BabelNode {\n    type: \"UpdateExpression\";\n    prefix?: boolean;\n    argument: BabelNodeExpression;\n    operator: BabelUpdateOperator;\n  }\n\n  declare class BabelNodeVariableDeclaration extends BabelNode {\n    type: \"VariableDeclaration\";\n    kind: BabelVariableKind;\n    declarations: Array<BabelNodeVariableDeclarator>;\n  }\n\n  declare class BabelNodeVariableDeclarator extends BabelNode {\n    type: \"VariableDeclarator\";\n    id: BabelNodeLVal;\n    init?: ?BabelNodeExpression;\n  }\n\n  declare class BabelNodeWhileStatement extends BabelNode {\n    type: \"WhileStatement\";\n    test: BabelNodeExpression;\n    body: BabelNodeStatement;\n  }\n\n  declare class BabelNodeWithStatement extends BabelNode {\n    type: \"WithStatement\";\n    object: BabelNodeExpression;\n    body: BabelNodeStatement;\n  }\n\n  declare class BabelNodeAssignmentPattern extends BabelNode {\n    type: \"AssignmentPattern\";\n    left: BabelNodeIdentifier;\n    right: BabelNodeExpression;\n    decorators?: any;\n  }\n\n  declare class BabelNodeArrayPattern extends BabelNode {\n    type: \"ArrayPattern\";\n    elements: any;\n    decorators?: any;\n    typeAnnotation: any;\n  }\n\n  declare class BabelNodeArrowFunctionExpression extends BabelNode {\n    type: \"ArrowFunctionExpression\";\n    body: BabelNodeBlockStatement | BabelNodeExpression;\n    expression: boolean;\n    id?: ?BabelNodeIdentifier;\n    params: Array<BabelNodeLVal>;\n    generator?: boolean;\n    async: boolean;\n    returnType?: any;\n    typeParameters?: any;\n  }\n\n  declare class BabelNodeClassBody extends BabelNode {\n    type: \"ClassBody\";\n    body: Array<BabelNodeClassMethod | BabelNodeClassProperty>;\n  }\n\n  declare class BabelNodeClassDeclaration extends BabelNode {\n    type: \"ClassDeclaration\";\n    id: BabelNodeIdentifier;\n    body: BabelNodeClassBody;\n    superClass?: ?BabelNodeExpression;\n    decorators: Array<BabelNodeDecorator>;\n    mixins?: any;\n    typeParameters?: any;\n    superTypeParameters?: any;\n  }\n\n  declare class BabelNodeClassExpression extends BabelNode {\n    type: \"ClassExpression\";\n    id?: ?BabelNodeIdentifier;\n    body: BabelNodeClassBody;\n    superClass?: ?BabelNodeExpression;\n    decorators: any;\n    mixins?: any;\n    typeParameters?: any;\n    superTypeParameters?: any;\n  }\n\n  declare class BabelNodeExportAllDeclaration extends BabelNode {\n    type: \"ExportAllDeclaration\";\n    source: BabelNodeStringLiteral;\n  }\n\n  declare class BabelNodeExportDefaultDeclaration extends BabelNode {\n    type: \"ExportDefaultDeclaration\";\n    declaration: BabelNodeFunctionDeclaration | BabelNodeClassDeclaration | BabelNodeExpression;\n  }\n\n  declare class BabelNodeExportNamedDeclaration extends BabelNode {\n    type: \"ExportNamedDeclaration\";\n    declaration?: ?BabelNodeDeclaration;\n    specifiers: Array<BabelNodeExportSpecifier>;\n    source?: ?BabelNodeStringLiteral;\n  }\n\n  declare class BabelNodeExportSpecifier extends BabelNode {\n    type: \"ExportSpecifier\";\n    local: BabelNodeIdentifier;\n    exported: BabelNodeIdentifier;\n  }\n\n  declare class BabelNodeForOfStatement extends BabelNode {\n    type: \"ForOfStatement\";\n    left: BabelNodeVariableDeclaration | BabelNodeLVal;\n    right: BabelNodeExpression;\n    body: BabelNodeStatement;\n  }\n\n  declare class BabelNodeImportDeclaration extends BabelNode {\n    type: \"ImportDeclaration\";\n    specifiers: [BabelNodeImportSpecifier | BabelNodeImportDefaultSpecifier | BabelNodeImportNamespaceSpecifier];\n    source: BabelNodeStringLiteral;\n  }\n\n  declare class BabelNodeImportDefaultSpecifier extends BabelNode {\n    type: \"ImportDefaultSpecifier\";\n    local: BabelNodeIdentifier;\n  }\n\n  declare class BabelNodeImportNamespaceSpecifier extends BabelNode {\n    type: \"ImportNamespaceSpecifier\";\n    local: BabelNodeIdentifier;\n  }\n\n  declare class BabelNodeImportSpecifier extends BabelNode {\n    type: \"ImportSpecifier\";\n    local: BabelNodeIdentifier;\n    imported: BabelNodeIdentifier;\n  }\n\n  declare class BabelNodeMetaProperty extends BabelNode {\n    type: \"MetaProperty\";\n    meta: BabelNodeIdentifier;\n    property: BabelNodeIdentifier;\n  }\n\n  declare class BabelNodeClassMethod extends BabelNode {\n    type: \"ClassMethod\";\n    kind?: any;\n    computed?: boolean;\n    key: any;\n    params: Array<BabelNodeLVal>;\n    body: BabelNodeBlockStatement;\n    generator?: boolean;\n    async?: boolean;\n    decorators: Array<BabelNodeDecorator>;\n    returnType?: any;\n    typeParameters?: any;\n  }\n\n  declare class BabelNodeObjectPattern extends BabelNode {\n    type: \"ObjectPattern\";\n    properties: any;\n    decorators?: any;\n    typeAnnotation: any;\n  }\n\n  declare class BabelNodeSpreadElement extends BabelNode {\n    type: \"SpreadElement\";\n    argument: BabelNodeExpression;\n  }\n\n  declare class BabelNodeSuper extends BabelNode {\n    type: \"Super\";\n  }\n\n  declare class BabelNodeTaggedTemplateExpression extends BabelNode {\n    type: \"TaggedTemplateExpression\";\n    tag: BabelNodeExpression;\n    quasi: BabelNodeTemplateLiteral;\n  }\n\n  declare class BabelNodeTemplateElement extends BabelNode {\n    type: \"TemplateElement\";\n    value: { cooked: string, raw: string };\n    tail: boolean;\n  }\n\n  declare class BabelNodeTemplateLiteral extends BabelNode {\n    type: \"TemplateLiteral\";\n    quasis: Array<BabelNodeTemplateElement>;\n    expressions: Array<BabelNodeExpression>;\n  }\n\n  declare class BabelNodeYieldExpression extends BabelNode {\n    type: \"YieldExpression\";\n    delegate: boolean;\n    argument?: ?BabelNodeExpression;\n  }\n\n  declare class BabelNodeAnyTypeAnnotation extends BabelNode {\n    type: \"AnyTypeAnnotation\";\n  }\n\n  declare class BabelNodeArrayTypeAnnotation extends BabelNode {\n    type: \"ArrayTypeAnnotation\";\n    elementType: any;\n  }\n\n  declare class BabelNodeBooleanTypeAnnotation extends BabelNode {\n    type: \"BooleanTypeAnnotation\";\n  }\n\n  declare class BabelNodeBooleanLiteralTypeAnnotation extends BabelNode {\n    type: \"BooleanLiteralTypeAnnotation\";\n  }\n\n  declare class BabelNodeNullLiteralTypeAnnotation extends BabelNode {\n    type: \"NullLiteralTypeAnnotation\";\n  }\n\n  declare class BabelNodeClassImplements extends BabelNode {\n    type: \"ClassImplements\";\n    id: any;\n    typeParameters: any;\n  }\n\n  declare class BabelNodeClassProperty extends BabelNode {\n    type: \"ClassProperty\";\n    computed: boolean;\n    key: BabelNodeIdentifier;\n    value: BabelNodeExpression;\n    typeAnnotation: any;\n    decorators: Array<BabelNodeDecorator>;\n  }\n\n  declare class BabelNodeDeclareClass extends BabelNode {\n    type: \"DeclareClass\";\n    id: any;\n    typeParameters: any;\n    body: any;\n  }\n\n  declare class BabelNodeDeclareFunction extends BabelNode {\n    type: \"DeclareFunction\";\n    id: any;\n  }\n\n  declare class BabelNodeDeclareInterface extends BabelNode {\n    type: \"DeclareInterface\";\n    id: any;\n    typeParameters: any;\n    body: any;\n  }\n\n  declare class BabelNodeDeclareModule extends BabelNode {\n    type: \"DeclareModule\";\n    id: any;\n    body: any;\n  }\n\n  declare class BabelNodeDeclareModuleExports extends BabelNode {\n    type: \"DeclareModuleExports\";\n    typeAnnotation: any;\n  }\n\n  declare class BabelNodeDeclareTypeAlias extends BabelNode {\n    type: \"DeclareTypeAlias\";\n    id: any;\n    typeParameters: any;\n    right: any;\n  }\n\n  declare class BabelNodeDeclareVariable extends BabelNode {\n    type: \"DeclareVariable\";\n    id: any;\n  }\n\n  declare class BabelNodeExistentialTypeParam extends BabelNode {\n    type: \"ExistentialTypeParam\";\n  }\n\n  declare class BabelNodeFunctionTypeAnnotation extends BabelNode {\n    type: \"FunctionTypeAnnotation\";\n    typeParameters: any;\n    params: any;\n    rest: any;\n    returnType: any;\n  }\n\n  declare class BabelNodeFunctionTypeParam extends BabelNode {\n    type: \"FunctionTypeParam\";\n    name: any;\n    typeAnnotation: any;\n  }\n\n  declare class BabelNodeGenericTypeAnnotation extends BabelNode {\n    type: \"GenericTypeAnnotation\";\n    id: any;\n    typeParameters: any;\n  }\n\n  declare class BabelNodeInterfaceExtends extends BabelNode {\n    type: \"InterfaceExtends\";\n    id: any;\n    typeParameters: any;\n  }\n\n  declare class BabelNodeInterfaceDeclaration extends BabelNode {\n    type: \"InterfaceDeclaration\";\n    id: any;\n    typeParameters: any;\n    body: any;\n  }\n\n  declare class BabelNodeIntersectionTypeAnnotation extends BabelNode {\n    type: \"IntersectionTypeAnnotation\";\n    types: any;\n  }\n\n  declare class BabelNodeMixedTypeAnnotation extends BabelNode {\n    type: \"MixedTypeAnnotation\";\n  }\n\n  declare class BabelNodeEmptyTypeAnnotation extends BabelNode {\n    type: \"EmptyTypeAnnotation\";\n  }\n\n  declare class BabelNodeNullableTypeAnnotation extends BabelNode {\n    type: \"NullableTypeAnnotation\";\n    typeAnnotation: any;\n  }\n\n  declare class BabelNodeNumericLiteralTypeAnnotation extends BabelNode {\n    type: \"NumericLiteralTypeAnnotation\";\n  }\n\n  declare class BabelNodeNumberTypeAnnotation extends BabelNode {\n    type: \"NumberTypeAnnotation\";\n  }\n\n  declare class BabelNodeStringLiteralTypeAnnotation extends BabelNode {\n    type: \"StringLiteralTypeAnnotation\";\n  }\n\n  declare class BabelNodeStringTypeAnnotation extends BabelNode {\n    type: \"StringTypeAnnotation\";\n  }\n\n  declare class BabelNodeThisTypeAnnotation extends BabelNode {\n    type: \"ThisTypeAnnotation\";\n  }\n\n  declare class BabelNodeTupleTypeAnnotation extends BabelNode {\n    type: \"TupleTypeAnnotation\";\n    types: any;\n  }\n\n  declare class BabelNodeTypeofTypeAnnotation extends BabelNode {\n    type: \"TypeofTypeAnnotation\";\n    argument: any;\n  }\n\n  declare class BabelNodeTypeAlias extends BabelNode {\n    type: \"TypeAlias\";\n    id: any;\n    typeParameters: any;\n    right: any;\n  }\n\n  declare class BabelNodeTypeAnnotation extends BabelNode {\n    type: \"TypeAnnotation\";\n    typeAnnotation: any;\n  }\n\n  declare class BabelNodeTypeCastExpression extends BabelNode {\n    type: \"TypeCastExpression\";\n    expression: any;\n    typeAnnotation: any;\n  }\n\n  declare class BabelNodeTypeParameter extends BabelNode {\n    type: \"TypeParameter\";\n    bound: any;\n  }\n\n  declare class BabelNodeTypeParameterDeclaration extends BabelNode {\n    type: \"TypeParameterDeclaration\";\n    params: any;\n  }\n\n  declare class BabelNodeTypeParameterInstantiation extends BabelNode {\n    type: \"TypeParameterInstantiation\";\n    params: any;\n  }\n\n  declare class BabelNodeObjectTypeAnnotation extends BabelNode {\n    type: \"ObjectTypeAnnotation\";\n    properties: any;\n    indexers: any;\n    callProperties: any;\n  }\n\n  declare class BabelNodeObjectTypeCallProperty extends BabelNode {\n    type: \"ObjectTypeCallProperty\";\n    value: any;\n  }\n\n  declare class BabelNodeObjectTypeIndexer extends BabelNode {\n    type: \"ObjectTypeIndexer\";\n    id: any;\n    key: any;\n    value: any;\n  }\n\n  declare class BabelNodeObjectTypeProperty extends BabelNode {\n    type: \"ObjectTypeProperty\";\n    key: any;\n    value: any;\n  }\n\n  declare class BabelNodeQualifiedTypeIdentifier extends BabelNode {\n    type: \"QualifiedTypeIdentifier\";\n    id: any;\n    qualification: any;\n  }\n\n  declare class BabelNodeUnionTypeAnnotation extends BabelNode {\n    type: \"UnionTypeAnnotation\";\n    types: any;\n  }\n\n  declare class BabelNodeVoidTypeAnnotation extends BabelNode {\n    type: \"VoidTypeAnnotation\";\n  }\n\n  declare class BabelNodeJSXAttribute extends BabelNode {\n    type: \"JSXAttribute\";\n    name: BabelNodeJSXIdentifier | BabelNodeJSXNamespacedName;\n    value?: ?BabelNodeJSXElement | BabelNodeStringLiteral | BabelNodeJSXExpressionContainer;\n  }\n\n  declare class BabelNodeJSXClosingElement extends BabelNode {\n    type: \"JSXClosingElement\";\n    name: BabelNodeJSXIdentifier | BabelNodeJSXMemberExpression;\n  }\n\n  declare class BabelNodeJSXElement extends BabelNode {\n    type: \"JSXElement\";\n    openingElement: BabelNodeJSXOpeningElement;\n    closingElement?: ?BabelNodeJSXClosingElement;\n    children: any;\n    selfClosing: any;\n  }\n\n  declare class BabelNodeJSXEmptyExpression extends BabelNode {\n    type: \"JSXEmptyExpression\";\n  }\n\n  declare class BabelNodeJSXExpressionContainer extends BabelNode {\n    type: \"JSXExpressionContainer\";\n    expression: BabelNodeExpression;\n  }\n\n  declare class BabelNodeJSXIdentifier extends BabelNode {\n    type: \"JSXIdentifier\";\n    name: string;\n  }\n\n  declare class BabelNodeJSXMemberExpression extends BabelNode {\n    type: \"JSXMemberExpression\";\n    object: BabelNodeJSXMemberExpression | BabelNodeJSXIdentifier;\n    property: BabelNodeJSXIdentifier;\n  }\n\n  declare class BabelNodeJSXNamespacedName extends BabelNode {\n    type: \"JSXNamespacedName\";\n    namespace: BabelNodeJSXIdentifier;\n    name: BabelNodeJSXIdentifier;\n  }\n\n  declare class BabelNodeJSXOpeningElement extends BabelNode {\n    type: \"JSXOpeningElement\";\n    name: BabelNodeJSXIdentifier | BabelNodeJSXMemberExpression;\n    selfClosing?: boolean;\n    attributes: any;\n  }\n\n  declare class BabelNodeJSXSpreadAttribute extends BabelNode {\n    type: \"JSXSpreadAttribute\";\n    argument: BabelNodeExpression;\n  }\n\n  declare class BabelNodeJSXText extends BabelNode {\n    type: \"JSXText\";\n    value: string;\n  }\n\n  declare class BabelNodeNoop extends BabelNode {\n    type: \"Noop\";\n  }\n\n  declare class BabelNodeParenthesizedExpression extends BabelNode {\n    type: \"ParenthesizedExpression\";\n    expression: BabelNodeExpression;\n  }\n\n  declare class BabelNodeAwaitExpression extends BabelNode {\n    type: \"AwaitExpression\";\n    argument: BabelNodeExpression;\n  }\n\n  declare class BabelNodeForAwaitStatement extends BabelNode {\n    type: \"ForAwaitStatement\";\n    left: BabelNodeVariableDeclaration | BabelNodeLVal;\n    right: BabelNodeExpression;\n    body: BabelNodeStatement;\n  }\n\n  declare class BabelNodeBindExpression extends BabelNode {\n    type: \"BindExpression\";\n    object: any;\n    callee: any;\n  }\n\n  declare class BabelNodeDecorator extends BabelNode {\n    type: \"Decorator\";\n    expression: BabelNodeExpression;\n  }\n\n  declare class BabelNodeDoExpression extends BabelNode {\n    type: \"DoExpression\";\n    body: BabelNodeBlockStatement;\n  }\n\n  declare class BabelNodeExportDefaultSpecifier extends BabelNode {\n    type: \"ExportDefaultSpecifier\";\n    exported: BabelNodeIdentifier;\n  }\n\n  declare class BabelNodeExportNamespaceSpecifier extends BabelNode {\n    type: \"ExportNamespaceSpecifier\";\n    exported: BabelNodeIdentifier;\n  }\n\n  declare class BabelNodeRestProperty extends BabelNode {\n    type: \"RestProperty\";\n    argument: BabelNodeLVal;\n  }\n\n  declare type BabelNodeExpression = BabelNodeArrayExpression | BabelNodeAssignmentExpression | BabelNodeBinaryExpression | BabelNodeCallExpression | BabelNodeConditionalExpression | BabelNodeFunctionExpression | BabelNodeIdentifier | BabelNodeStringLiteral | BabelNodeNumericLiteral | BabelNodeNullLiteral | BabelNodeBooleanLiteral | BabelNodeRegExpLiteral | BabelNodeLogicalExpression | BabelNodeMemberExpression | BabelNodeNewExpression | BabelNodeObjectExpression | BabelNodeSequenceExpression | BabelNodeThisExpression | BabelNodeUnaryExpression | BabelNodeUpdateExpression | BabelNodeArrowFunctionExpression | BabelNodeClassExpression | BabelNodeMetaProperty | BabelNodeSuper | BabelNodeTaggedTemplateExpression | BabelNodeTemplateLiteral | BabelNodeYieldExpression | BabelNodeTypeCastExpression | BabelNodeJSXElement | BabelNodeJSXEmptyExpression | BabelNodeJSXIdentifier | BabelNodeJSXMemberExpression | BabelNodeParenthesizedExpression | BabelNodeAwaitExpression | BabelNodeBindExpression | BabelNodeDoExpression;\n  declare type BabelNodeBinary = BabelNodeBinaryExpression | BabelNodeLogicalExpression;\n  declare type BabelNodeScopable = BabelNodeBlockStatement | BabelNodeCatchClause | BabelNodeDoWhileStatement | BabelNodeForInStatement | BabelNodeForStatement | BabelNodeFunctionDeclaration | BabelNodeFunctionExpression | BabelNodeProgram | BabelNodeObjectMethod | BabelNodeSwitchStatement | BabelNodeWhileStatement | BabelNodeArrowFunctionExpression | BabelNodeClassDeclaration | BabelNodeClassExpression | BabelNodeForOfStatement | BabelNodeClassMethod | BabelNodeForAwaitStatement;\n  declare type BabelNodeBlockParent = BabelNodeBlockStatement | BabelNodeDoWhileStatement | BabelNodeForInStatement | BabelNodeForStatement | BabelNodeFunctionDeclaration | BabelNodeFunctionExpression | BabelNodeProgram | BabelNodeObjectMethod | BabelNodeSwitchStatement | BabelNodeWhileStatement | BabelNodeArrowFunctionExpression | BabelNodeForOfStatement | BabelNodeClassMethod | BabelNodeForAwaitStatement;\n  declare type BabelNodeBlock = BabelNodeBlockStatement | BabelNodeProgram;\n  declare type BabelNodeStatement = BabelNodeBlockStatement | BabelNodeBreakStatement | BabelNodeContinueStatement | BabelNodeDebuggerStatement | BabelNodeDoWhileStatement | BabelNodeEmptyStatement | BabelNodeExpressionStatement | BabelNodeForInStatement | BabelNodeForStatement | BabelNodeFunctionDeclaration | BabelNodeIfStatement | BabelNodeLabeledStatement | BabelNodeReturnStatement | BabelNodeSwitchStatement | BabelNodeThrowStatement | BabelNodeTryStatement | BabelNodeVariableDeclaration | BabelNodeWhileStatement | BabelNodeWithStatement | BabelNodeClassDeclaration | BabelNodeExportAllDeclaration | BabelNodeExportDefaultDeclaration | BabelNodeExportNamedDeclaration | BabelNodeForOfStatement | BabelNodeImportDeclaration | BabelNodeDeclareClass | BabelNodeDeclareFunction | BabelNodeDeclareInterface | BabelNodeDeclareModule | BabelNodeDeclareModuleExports | BabelNodeDeclareTypeAlias | BabelNodeDeclareVariable | BabelNodeInterfaceDeclaration | BabelNodeTypeAlias | BabelNodeForAwaitStatement;\n  declare type BabelNodeTerminatorless = BabelNodeBreakStatement | BabelNodeContinueStatement | BabelNodeReturnStatement | BabelNodeThrowStatement | BabelNodeYieldExpression | BabelNodeAwaitExpression;\n  declare type BabelNodeCompletionStatement = BabelNodeBreakStatement | BabelNodeContinueStatement | BabelNodeReturnStatement | BabelNodeThrowStatement;\n  declare type BabelNodeConditional = BabelNodeConditionalExpression | BabelNodeIfStatement;\n  declare type BabelNodeLoop = BabelNodeDoWhileStatement | BabelNodeForInStatement | BabelNodeForStatement | BabelNodeWhileStatement | BabelNodeForOfStatement | BabelNodeForAwaitStatement;\n  declare type BabelNodeWhile = BabelNodeDoWhileStatement | BabelNodeWhileStatement;\n  declare type BabelNodeExpressionWrapper = BabelNodeExpressionStatement | BabelNodeTypeCastExpression | BabelNodeParenthesizedExpression;\n  declare type BabelNodeFor = BabelNodeForInStatement | BabelNodeForStatement | BabelNodeForOfStatement | BabelNodeForAwaitStatement;\n  declare type BabelNodeForXStatement = BabelNodeForInStatement | BabelNodeForOfStatement | BabelNodeForAwaitStatement;\n  declare type BabelNodeFunction = BabelNodeFunctionDeclaration | BabelNodeFunctionExpression | BabelNodeObjectMethod | BabelNodeArrowFunctionExpression | BabelNodeClassMethod;\n  declare type BabelNodeFunctionParent = BabelNodeFunctionDeclaration | BabelNodeFunctionExpression | BabelNodeProgram | BabelNodeObjectMethod | BabelNodeArrowFunctionExpression | BabelNodeClassMethod;\n  declare type BabelNodePureish = BabelNodeFunctionDeclaration | BabelNodeFunctionExpression | BabelNodeStringLiteral | BabelNodeNumericLiteral | BabelNodeNullLiteral | BabelNodeBooleanLiteral | BabelNodeArrowFunctionExpression | BabelNodeClassDeclaration | BabelNodeClassExpression;\n  declare type BabelNodeDeclaration = BabelNodeFunctionDeclaration | BabelNodeVariableDeclaration | BabelNodeClassDeclaration | BabelNodeExportAllDeclaration | BabelNodeExportDefaultDeclaration | BabelNodeExportNamedDeclaration | BabelNodeImportDeclaration | BabelNodeDeclareClass | BabelNodeDeclareFunction | BabelNodeDeclareInterface | BabelNodeDeclareModule | BabelNodeDeclareModuleExports | BabelNodeDeclareTypeAlias | BabelNodeDeclareVariable | BabelNodeInterfaceDeclaration | BabelNodeTypeAlias;\n  declare type BabelNodeLVal = BabelNodeIdentifier | BabelNodeMemberExpression | BabelNodeRestElement | BabelNodeAssignmentPattern | BabelNodeArrayPattern | BabelNodeObjectPattern;\n  declare type BabelNodeLiteral = BabelNodeStringLiteral | BabelNodeNumericLiteral | BabelNodeNullLiteral | BabelNodeBooleanLiteral | BabelNodeRegExpLiteral | BabelNodeTemplateLiteral;\n  declare type BabelNodeImmutable = BabelNodeStringLiteral | BabelNodeNumericLiteral | BabelNodeNullLiteral | BabelNodeBooleanLiteral | BabelNodeJSXAttribute | BabelNodeJSXClosingElement | BabelNodeJSXElement | BabelNodeJSXExpressionContainer | BabelNodeJSXOpeningElement | BabelNodeJSXText;\n  declare type BabelNodeUserWhitespacable = BabelNodeObjectMethod | BabelNodeObjectProperty | BabelNodeObjectTypeCallProperty | BabelNodeObjectTypeIndexer | BabelNodeObjectTypeProperty;\n  declare type BabelNodeMethod = BabelNodeObjectMethod | BabelNodeClassMethod;\n  declare type BabelNodeObjectMember = BabelNodeObjectMethod | BabelNodeObjectProperty;\n  declare type BabelNodeProperty = BabelNodeObjectProperty | BabelNodeClassProperty;\n  declare type BabelNodeUnaryLike = BabelNodeUnaryExpression | BabelNodeSpreadElement | BabelNodeRestProperty;\n  declare type BabelNodePattern = BabelNodeAssignmentPattern | BabelNodeArrayPattern | BabelNodeObjectPattern | BabelNodeRestElement;\n  declare type BabelNodeClass = BabelNodeClassDeclaration | BabelNodeClassExpression;\n  declare type BabelNodeModuleDeclaration = BabelNodeExportAllDeclaration | BabelNodeExportDefaultDeclaration | BabelNodeExportNamedDeclaration | BabelNodeImportDeclaration;\n  declare type BabelNodeExportDeclaration = BabelNodeExportAllDeclaration | BabelNodeExportDefaultDeclaration | BabelNodeExportNamedDeclaration;\n  declare type BabelNodeModuleSpecifier = BabelNodeExportSpecifier | BabelNodeImportDefaultSpecifier | BabelNodeImportNamespaceSpecifier | BabelNodeImportSpecifier | BabelNodeExportDefaultSpecifier | BabelNodeExportNamespaceSpecifier;\n  declare type BabelNodeFlow = BabelNodeAnyTypeAnnotation | BabelNodeArrayTypeAnnotation | BabelNodeBooleanTypeAnnotation | BabelNodeBooleanLiteralTypeAnnotation | BabelNodeNullLiteralTypeAnnotation | BabelNodeClassImplements | BabelNodeDeclareClass | BabelNodeDeclareFunction | BabelNodeDeclareInterface | BabelNodeDeclareModule | BabelNodeDeclareModuleExports | BabelNodeDeclareTypeAlias | BabelNodeDeclareVariable | BabelNodeExistentialTypeParam | BabelNodeFunctionTypeAnnotation | BabelNodeFunctionTypeParam | BabelNodeGenericTypeAnnotation | BabelNodeInterfaceExtends | BabelNodeInterfaceDeclaration | BabelNodeIntersectionTypeAnnotation | BabelNodeMixedTypeAnnotation | BabelNodeEmptyTypeAnnotation | BabelNodeNullableTypeAnnotation | BabelNodeNumericLiteralTypeAnnotation | BabelNodeNumberTypeAnnotation | BabelNodeStringLiteralTypeAnnotation | BabelNodeStringTypeAnnotation | BabelNodeThisTypeAnnotation | BabelNodeTupleTypeAnnotation | BabelNodeTypeofTypeAnnotation | BabelNodeTypeAlias | BabelNodeTypeAnnotation | BabelNodeTypeCastExpression | BabelNodeTypeParameter | BabelNodeTypeParameterDeclaration | BabelNodeTypeParameterInstantiation | BabelNodeObjectTypeAnnotation | BabelNodeObjectTypeCallProperty | BabelNodeObjectTypeIndexer | BabelNodeObjectTypeProperty | BabelNodeQualifiedTypeIdentifier | BabelNodeUnionTypeAnnotation | BabelNodeVoidTypeAnnotation;\n  declare type BabelNodeFlowBaseAnnotation = BabelNodeAnyTypeAnnotation | BabelNodeBooleanTypeAnnotation | BabelNodeNullLiteralTypeAnnotation | BabelNodeMixedTypeAnnotation | BabelNodeEmptyTypeAnnotation | BabelNodeNumberTypeAnnotation | BabelNodeStringTypeAnnotation | BabelNodeThisTypeAnnotation | BabelNodeVoidTypeAnnotation;\n  declare type BabelNodeFlowDeclaration = BabelNodeDeclareClass | BabelNodeDeclareFunction | BabelNodeDeclareInterface | BabelNodeDeclareModule | BabelNodeDeclareModuleExports | BabelNodeDeclareTypeAlias | BabelNodeDeclareVariable | BabelNodeInterfaceDeclaration | BabelNodeTypeAlias;\n  declare type BabelNodeJSX = BabelNodeJSXAttribute | BabelNodeJSXClosingElement | BabelNodeJSXElement | BabelNodeJSXEmptyExpression | BabelNodeJSXExpressionContainer | BabelNodeJSXIdentifier | BabelNodeJSXMemberExpression | BabelNodeJSXNamespacedName | BabelNodeJSXOpeningElement | BabelNodeJSXSpreadAttribute | BabelNodeJSXText;\n\n  declare function anyTypeAnnotation(): BabelNodeAnyTypeAnnotation;\n  declare function arrayExpression(elements: Array<null | BabelNodeExpression | BabelNodeSpreadElement>): BabelNodeArrayExpression;\n  declare function arrayPattern(elements: Array<BabelNodeExpression>, typeAnnotation: any, decorators?: Array<BabelNodeDecorator>): BabelNodeArrayPattern;\n  declare function arrayTypeAnnotation(elementType: any): BabelNodeArrayTypeAnnotation;\n  declare function arrowFunctionExpression(params: Array<BabelNodeLVal>, body: BabelNodeBlockStatement | BabelNodeExpression, async?: boolean, returnType?: any, typeParameters?: any): BabelNodeArrowFunctionExpression;\n  declare function assignmentExpression(operator: BabelAssignmentOperator, left: BabelNodeLVal, right: BabelNodeExpression): BabelNodeAssignmentExpression;\n  declare function assignmentPattern(left: BabelNodeIdentifier, right: BabelNodeExpression, decorators?: any): BabelNodeAssignmentPattern;\n  declare function awaitExpression(argument: BabelNodeExpression): BabelNodeAwaitExpression;\n  declare function binaryExpression(operator: BabelBinaryOperator, left: BabelNodeExpression, right: BabelNodeExpression): BabelNodeBinaryExpression;\n  declare function bindExpression(object: any, callee: any): BabelNodeBindExpression;\n  declare function blockStatement(body: Array<BabelNodeStatement>, directives?: Array<BabelNodeDirective>): BabelNodeBlockStatement;\n  declare function booleanLiteral(value: boolean): BabelNodeBooleanLiteral;\n  declare function booleanLiteralTypeAnnotation(): BabelNodeBooleanLiteralTypeAnnotation;\n  declare function booleanTypeAnnotation(): BabelNodeBooleanTypeAnnotation;\n  declare function breakStatement(label?: ?BabelNodeIdentifier): BabelNodeBreakStatement;\n  declare function callExpression(callee: BabelNodeExpression, _arguments: Array<BabelNodeExpression | BabelNodeSpreadElement>): BabelNodeCallExpression;\n  declare function catchClause(param: BabelNodeIdentifier, body: BabelNodeBlockStatement): BabelNodeCatchClause;\n  declare function classBody(body: Array<BabelNodeClassMethod | BabelNodeClassProperty>): BabelNodeClassBody;\n  declare function classDeclaration(id: BabelNodeIdentifier, superClass?: ?BabelNodeExpression, body: BabelNodeClassBody, decorators: Array<BabelNodeDecorator>, mixins?: any, typeParameters?: any, superTypeParameters?: any, _implements?: any): BabelNodeClassDeclaration;\n  declare function classExpression(id?: ?BabelNodeIdentifier,  superClass?: ?BabelNodeExpression, body: BabelNodeClassBody, decorators: Array<BabelNodeDecorator>, _implements?: any, mixins?: any, superTypeParameters?: any, typeParameters?: any): BabelNodeClassExpression;\n  declare function classImplements(id: any, typeParameters: any): BabelNodeClassImplements;\n  declare function classMethod(kind: ?(\"get\" | \"set\" | \"method\" | \"constructor\"), key: BabelNodeExpression | BabelNodeIdentifier | BabelNodeLiteral, params: Array<BabelNodeLVal>, body: BabelNodeBlockStatement, computed?: boolean, _static?: boolean, async?: boolean, decorators?: any, generator?: boolean, returnType?: any, typeParameters?: any): BabelNodeClassMethod;\n  declare function classProperty(key: any, value: any, typeAnnotation: any, decorators: any, computed?: boolean): BabelNodeClassProperty;\n  declare function conditionalExpression(test: BabelNodeExpression, consequent: BabelNodeExpression, alternate: BabelNodeExpression): BabelNodeConditionalExpression;\n  declare function continueStatement(label?: ?BabelNodeIdentifier): BabelNodeContinueStatement;\n  declare function debuggerStatement(): BabelNodeDebuggerStatement;\n  declare function declareClass(id: any, typeParameters: any, _extends: any, body: any): BabelNodeDeclareClass;\n  declare function declareFunction(id: any): BabelNodeDeclareFunction;\n  declare function declareInterface(id: any, typeParameters: any, _extends: any, body: any): BabelNodeDeclareInterface;\n  declare function declareModule(id: any, body: any): BabelNodeDeclareModule;\n  declare function declareModuleExports(typeAnnotation: any): BabelNodeDeclareModuleExports;\n  declare function declareTypeAlias(id: any, typeParameters: any, right: any): BabelNodeDeclareTypeAlias;\n  declare function declareVariable(id: any): BabelNodeDeclareVariable;\n  declare function decorator(expression: BabelNodeExpression): BabelNodeDecorator;\n  declare function directive(value: BabelNodeDirectiveLiteral): BabelNodeDirective;\n  declare function directiveLiteral(value: string): BabelNodeDirectiveLiteral;\n  declare function doExpression(body: BabelNodeBlockStatement): BabelNodeDoExpression;\n  declare function doWhileStatement(test: BabelNodeExpression, body: BabelNodeStatement): BabelNodeDoWhileStatement;\n  declare function emptyStatement(): BabelNodeEmptyStatement;\n  declare function emptyTypeAnnotation(): BabelNodeEmptyTypeAnnotation;\n  declare function existentialTypeParam(): BabelNodeExistentialTypeParam;\n  declare function exportAllDeclaration(source: BabelNodeStringLiteral): BabelNodeExportAllDeclaration;\n  declare function exportDefaultDeclaration(declaration: BabelNodeFunctionDeclaration | BabelNodeClassDeclaration | BabelNodeExpression): BabelNodeExportDefaultDeclaration;\n  declare function exportDefaultSpecifier(exported: BabelNodeIdentifier): BabelNodeExportDefaultSpecifier;\n  declare function exportNamedDeclaration(declaration?: ?BabelNodeDeclaration, specifiers: Array<BabelNodeExportSpecifier>, source?: ?BabelNodeStringLiteral): BabelNodeExportNamedDeclaration;\n  declare function exportNamespaceSpecifier(exported: BabelNodeIdentifier): BabelNodeExportNamespaceSpecifier;\n  declare function exportSpecifier(local: BabelNodeIdentifier, exported: BabelNodeIdentifier): BabelNodeExportSpecifier;\n  declare function expressionStatement(expression: BabelNodeExpression): BabelNodeExpressionStatement;\n  declare function file(program: BabelNodeProgram, comments: any, tokens: any): BabelNodeFile;\n  declare function forAwaitStatement(left: BabelNodeVariableDeclaration | BabelNodeLVal, right: BabelNodeExpression, body: BabelNodeStatement): BabelNodeForAwaitStatement;\n  declare function forInStatement(left: BabelNodeVariableDeclaration | BabelNodeLVal, right: BabelNodeExpression, body: BabelNodeStatement): BabelNodeForInStatement;\n  declare function forOfStatement(left: BabelNodeVariableDeclaration | BabelNodeLVal, right: BabelNodeExpression, body: BabelNodeStatement): BabelNodeForOfStatement;\n  declare function forStatement(init?: ?BabelNodeVariableDeclaration | BabelNodeExpression, test?: ?BabelNodeExpression, update?: ?BabelNodeExpression, body: BabelNodeStatement): BabelNodeForStatement;\n  declare function functionDeclaration(id: BabelNodeIdentifier, params: Array<BabelNodeLVal>, body: BabelNodeBlockStatement, generator?: boolean, async?: boolean, returnType?: any, typeParameters?: any): BabelNodeFunctionDeclaration;\n  declare function functionExpression(id?: ?BabelNodeIdentifier, params: Array<BabelNodeLVal>, body: BabelNodeBlockStatement, generator?: boolean, async?: boolean, returnType?: any, typeParameters?: any): BabelNodeFunctionExpression;\n  declare function functionTypeAnnotation(typeParameters: any, params: any, rest: any, returnType: any): BabelNodeFunctionTypeAnnotation;\n  declare function functionTypeParam(name: any, typeAnnotation: any): BabelNodeFunctionTypeParam;\n  declare function genericTypeAnnotation(id: any, typeParameters: any): BabelNodeGenericTypeAnnotation;\n  declare function identifier(name: string, decorators?: Array<BabelNodeDecorator>, typeAnnotation?: any): BabelNodeIdentifier;\n  declare function ifStatement(test: BabelNodeExpression, consequent: BabelNodeStatement, alternate?: ?BabelNodeStatement): BabelNodeIfStatement;\n  declare function importDeclaration(specifiers: any, source: BabelNodeStringLiteral): BabelNodeImportDeclaration;\n  declare function importDefaultSpecifier(local: BabelNodeIdentifier): BabelNodeImportDefaultSpecifier;\n  declare function importNamespaceSpecifier(local: BabelNodeIdentifier): BabelNodeImportNamespaceSpecifier;\n  declare function importSpecifier(local: BabelNodeIdentifier, imported: BabelNodeIdentifier): BabelNodeImportSpecifier;\n  declare function interfaceDeclaration(id: any, typeParameters: any, _extends: any, body: any): BabelNodeInterfaceDeclaration;\n  declare function interfaceExtends(id: any, typeParameters: any): BabelNodeInterfaceExtends;\n  declare function intersectionTypeAnnotation(types: any): BabelNodeIntersectionTypeAnnotation;\n  declare function jSXAttribute(name: BabelNodeJSXIdentifier | BabelNodeJSXNamespacedName, value?: ?BabelNodeJSXElement | BabelNodeStringLiteral | BabelNodeJSXExpressionContainer): BabelNodeJSXAttribute;\n  declare function jSXClosingElement(name: BabelNodeJSXIdentifier | BabelNodeJSXMemberExpression): BabelNodeJSXClosingElement;\n  declare function jSXElement(openingElement: BabelNodeJSXOpeningElement, closingElement?: ?BabelNodeJSXClosingElement, children: any, selfClosing: any): BabelNodeJSXElement;\n  declare function jSXEmptyExpression(): BabelNodeJSXEmptyExpression;\n  declare function jSXExpressionContainer(expression: BabelNodeExpression): BabelNodeJSXExpressionContainer;\n  declare function jSXIdentifier(name: string): BabelNodeJSXIdentifier;\n  declare function jSXMemberExpression(object: BabelNodeJSXMemberExpression | BabelNodeJSXIdentifier, property: BabelNodeJSXIdentifier): BabelNodeJSXMemberExpression;\n  declare function jSXNamespacedName(namespace: BabelNodeJSXIdentifier, name: BabelNodeJSXIdentifier): BabelNodeJSXNamespacedName;\n  declare function jSXOpeningElement(name: BabelNodeJSXIdentifier | BabelNodeJSXMemberExpression, selfClosing?: boolean, attributes: any): BabelNodeJSXOpeningElement;\n  declare function jSXSpreadAttribute(argument: BabelNodeExpression): BabelNodeJSXSpreadAttribute;\n  declare function jSXText(value: string): BabelNodeJSXText;\n  declare function labeledStatement(label: BabelNodeIdentifier, body: BabelNodeStatement): BabelNodeLabeledStatement;\n  declare function logicalExpression(operator: BabelLogicalOperator, left: BabelNodeExpression, right: BabelNodeExpression): BabelNodeLogicalExpression;\n  declare function memberExpression(object: BabelNodeExpression, property: BabelNodeExpression | BabelNodeIdentifier, computed?: boolean): BabelNodeMemberExpression;\n  declare function metaProperty(meta: string, property: string): BabelNodeMetaProperty;\n  declare function mixedTypeAnnotation(): BabelNodeMixedTypeAnnotation;\n  declare function newExpression(callee: BabelNodeExpression, _arguments: Array<BabelNodeExpression>): BabelNodeNewExpression;\n  declare function noop(): BabelNodeNoop;\n  declare function nullLiteral(): BabelNodeNullLiteral;\n  declare function nullLiteralTypeAnnotation(): BabelNodeNullLiteralTypeAnnotation;\n  declare function nullableTypeAnnotation(typeAnnotation: any): BabelNodeNullableTypeAnnotation;\n  declare function numberTypeAnnotation(): BabelNodeNumberTypeAnnotation;\n  declare function numericLiteral(value: number): BabelNodeNumericLiteral;\n  declare function numericLiteralTypeAnnotation(): BabelNodeNumericLiteralTypeAnnotation;\n  declare function objectExpression(properties: Array<BabelNodeObjectMethod | BabelNodeObjectProperty | BabelNodeSpreadElement>): BabelNodeObjectExpression;\n  declare function objectMethod(kind: BabelObjectMethodKind, key: BabelNodeExpression | BabelNodeIdentifier | BabelNodeLiteral, params: Array<BabelNodeLVal>, body: BabelNodeBlockStatement, computed?: boolean, async?: boolean, decorators?: any, generator?: boolean, returnType?: any, typeParameters?: any): BabelNodeObjectMethod;\n  declare function objectPattern(properties: Array<BabelNodeRestProperty | BabelNodeProperty>, typeAnnotation: any, decorators?: Array<BabelNodeDecorator>): BabelNodeObjectPattern;\n  declare function objectProperty(key: BabelNodeExpression | BabelNodeIdentifier | BabelNodeLiteral, value: BabelNodeExpression, computed?: boolean, shorthand?: boolean, decorators: ?Array<BabelNodeDecorator>): BabelNodeObjectProperty;\n  declare function objectTypeAnnotation(properties: any, indexers: any, callProperties: any): BabelNodeObjectTypeAnnotation;\n  declare function objectTypeCallProperty(value: any): BabelNodeObjectTypeCallProperty;\n  declare function objectTypeIndexer(id: any, key: any, value: any): BabelNodeObjectTypeIndexer;\n  declare function objectTypeProperty(key: any, value: any): BabelNodeObjectTypeProperty;\n  declare function parenthesizedExpression(expression: BabelNodeExpression): BabelNodeParenthesizedExpression;\n  declare function program(body: Array<BabelNodeStatement>, directives?: Array<BabelNodeDirective>): BabelNodeProgram;\n  declare function qualifiedTypeIdentifier(id: any, qualification: any): BabelNodeQualifiedTypeIdentifier;\n  declare function regExpLiteral(pattern: string, flags?: string): BabelNodeRegExpLiteral;\n  declare function restElement(argument: BabelNodeLVal, typeAnnotation: any, decorators?: any): BabelNodeRestElement;\n  declare function restProperty(argument: BabelNodeLVal): BabelNodeRestProperty;\n  declare function returnStatement(argument?: ?BabelNodeExpression): BabelNodeReturnStatement;\n  declare function sequenceExpression(expressions: Array<BabelNodeExpression>): BabelNodeSequenceExpression;\n  declare function spreadElement(argument: BabelNodeExpression): BabelNodeSpreadElement;\n  declare function stringLiteral(value: string): BabelNodeStringLiteral;\n  declare function stringLiteralTypeAnnotation(): BabelNodeStringLiteralTypeAnnotation;\n  declare function stringTypeAnnotation(): BabelNodeStringTypeAnnotation;\n  declare function switchCase(test?: ?BabelNodeExpression, consequent: Array<BabelNodeStatement>): BabelNodeSwitchCase;\n  declare function switchStatement(discriminant: BabelNodeExpression, cases: Array<BabelNodeSwitchCase>): BabelNodeSwitchStatement;\n  declare function taggedTemplateExpression(tag: BabelNodeExpression, quasi: BabelNodeTemplateLiteral): BabelNodeTaggedTemplateExpression;\n  declare function templateElement(value: any, tail?: boolean): BabelNodeTemplateElement;\n  declare function templateLiteral(quasis: Array<BabelNodeTemplateElement>, expressions: Array<BabelNodeExpression>): BabelNodeTemplateLiteral;\n  declare function thisExpression(): BabelNodeThisExpression;\n  declare function thisTypeAnnotation(): BabelNodeThisTypeAnnotation;\n  declare function throwStatement(argument: BabelNodeExpression): BabelNodeThrowStatement;\n  declare function tryStatement(block: any, handler?: any, finalizer?: ?BabelNodeBlockStatement, body?: ?BabelNodeBlockStatement): BabelNodeTryStatement;\n  declare function tupleTypeAnnotation(types: any): BabelNodeTupleTypeAnnotation;\n  declare function typeAlias(id: any, typeParameters: any, right: any): BabelNodeTypeAlias;\n  declare function typeAnnotation(typeAnnotation: any): BabelNodeTypeAnnotation;\n  declare function typeCastExpression(expression: any, typeAnnotation: any): BabelNodeTypeCastExpression;\n  declare function typeParameter(bound: any): BabelNodeTypeParameter;\n  declare function typeParameterDeclaration(params: any): BabelNodeTypeParameterDeclaration;\n  declare function typeParameterInstantiation(params: any): BabelNodeTypeParameterInstantiation;\n  declare function typeofTypeAnnotation(argument: any): BabelNodeTypeofTypeAnnotation;\n  declare function unaryExpression(operator: BabelUnaryOperator, argument: BabelNodeExpression, prefix?: boolean): BabelNodeUnaryExpression;\n  declare function unionTypeAnnotation(types: any): BabelNodeUnionTypeAnnotation;\n  declare function updateExpression(operator: BabelUpdateOperator, argument: BabelNodeExpression, prefix?: boolean): BabelNodeUpdateExpression;\n  declare function variableDeclaration(kind: BabelVariableKind, declarations: Array<BabelNodeVariableDeclarator>): BabelNodeVariableDeclaration;\n  declare function variableDeclarator(id: BabelNodeLVal, init?: ?BabelNodeExpression): BabelNodeVariableDeclarator;\n  declare function voidTypeAnnotation(): BabelNodeVoidTypeAnnotation;\n  declare function whileStatement(test: BabelNodeExpression, body: BabelNodeStatement): BabelNodeWhileStatement;\n  declare function withStatement(object: BabelNodeExpression, body: BabelNodeStatement): BabelNodeWithStatement;\n  declare function yieldExpression(argument?: ?BabelNodeExpression, delegate?: boolean): BabelNodeYieldExpression;\n\n  declare function isArrayExpression(node: Object, opts?: Object): boolean;\n  declare function isAssignmentExpression(node: Object, opts?: Object): boolean;\n  declare function isBinaryExpression(node: Object, opts?: Object): boolean;\n  declare function isDirective(node: Object, opts?: Object): boolean;\n  declare function isDirectiveLiteral(node: Object, opts?: Object): boolean;\n  declare function isBlockStatement(node: Object, opts?: Object): boolean;\n  declare function isBreakStatement(node: Object, opts?: Object): boolean;\n  declare function isCallExpression(node: Object, opts?: Object): boolean;\n  declare function isCatchClause(node: Object, opts?: Object): boolean;\n  declare function isConditionalExpression(node: Object, opts?: Object): boolean;\n  declare function isContinueStatement(node: Object, opts?: Object): boolean;\n  declare function isDebuggerStatement(node: Object, opts?: Object): boolean;\n  declare function isDoWhileStatement(node: Object, opts?: Object): boolean;\n  declare function isEmptyStatement(node: Object, opts?: Object): boolean;\n  declare function isExpressionStatement(node: Object, opts?: Object): boolean;\n  declare function isFile(node: Object, opts?: Object): boolean;\n  declare function isForInStatement(node: Object, opts?: Object): boolean;\n  declare function isForStatement(node: Object, opts?: Object): boolean;\n  declare function isFunctionDeclaration(node: Object, opts?: Object): boolean;\n  declare function isFunctionExpression(node: Object, opts?: Object): boolean;\n  declare function isIdentifier(node: Object, opts?: Object): boolean;\n  declare function isIfStatement(node: Object, opts?: Object): boolean;\n  declare function isLabeledStatement(node: Object, opts?: Object): boolean;\n  declare function isStringLiteral(node: Object, opts?: Object): boolean;\n  declare function isNumericLiteral(node: Object, opts?: Object): boolean;\n  declare function isNullLiteral(node: Object, opts?: Object): boolean;\n  declare function isBooleanLiteral(node: Object, opts?: Object): boolean;\n  declare function isRegExpLiteral(node: Object, opts?: Object): boolean;\n  declare function isLogicalExpression(node: Object, opts?: Object): boolean;\n  declare function isMemberExpression(node: Object, opts?: Object): boolean;\n  declare function isNewExpression(node: Object, opts?: Object): boolean;\n  declare function isProgram(node: Object, opts?: Object): boolean;\n  declare function isObjectExpression(node: Object, opts?: Object): boolean;\n  declare function isObjectMethod(node: Object, opts?: Object): boolean;\n  declare function isObjectProperty(node: Object, opts?: Object): boolean;\n  declare function isRestElement(node: Object, opts?: Object): boolean;\n  declare function isReturnStatement(node: Object, opts?: Object): boolean;\n  declare function isSequenceExpression(node: Object, opts?: Object): boolean;\n  declare function isSwitchCase(node: Object, opts?: Object): boolean;\n  declare function isSwitchStatement(node: Object, opts?: Object): boolean;\n  declare function isThisExpression(node: Object, opts?: Object): boolean;\n  declare function isThrowStatement(node: Object, opts?: Object): boolean;\n  declare function isTryStatement(node: Object, opts?: Object): boolean;\n  declare function isUnaryExpression(node: Object, opts?: Object): boolean;\n  declare function isUpdateExpression(node: Object, opts?: Object): boolean;\n  declare function isVariableDeclaration(node: Object, opts?: Object): boolean;\n  declare function isVariableDeclarator(node: Object, opts?: Object): boolean;\n  declare function isWhileStatement(node: Object, opts?: Object): boolean;\n  declare function isWithStatement(node: Object, opts?: Object): boolean;\n  declare function isAssignmentPattern(node: Object, opts?: Object): boolean;\n  declare function isArrayPattern(node: Object, opts?: Object): boolean;\n  declare function isArrowFunctionExpression(node: Object, opts?: Object): boolean;\n  declare function isClassBody(node: Object, opts?: Object): boolean;\n  declare function isClassDeclaration(node: Object, opts?: Object): boolean;\n  declare function isClassExpression(node: Object, opts?: Object): boolean;\n  declare function isExportAllDeclaration(node: Object, opts?: Object): boolean;\n  declare function isExportDefaultDeclaration(node: Object, opts?: Object): boolean;\n  declare function isExportNamedDeclaration(node: Object, opts?: Object): boolean;\n  declare function isExportSpecifier(node: Object, opts?: Object): boolean;\n  declare function isForOfStatement(node: Object, opts?: Object): boolean;\n  declare function isImportDeclaration(node: Object, opts?: Object): boolean;\n  declare function isImportDefaultSpecifier(node: Object, opts?: Object): boolean;\n  declare function isImportNamespaceSpecifier(node: Object, opts?: Object): boolean;\n  declare function isImportSpecifier(node: Object, opts?: Object): boolean;\n  declare function isMetaProperty(node: Object, opts?: Object): boolean;\n  declare function isClassMethod(node: Object, opts?: Object): boolean;\n  declare function isObjectPattern(node: Object, opts?: Object): boolean;\n  declare function isSpreadElement(node: Object, opts?: Object): boolean;\n  declare function isSuper(node: Object, opts?: Object): boolean;\n  declare function isTaggedTemplateExpression(node: Object, opts?: Object): boolean;\n  declare function isTemplateElement(node: Object, opts?: Object): boolean;\n  declare function isTemplateLiteral(node: Object, opts?: Object): boolean;\n  declare function isYieldExpression(node: Object, opts?: Object): boolean;\n  declare function isAnyTypeAnnotation(node: Object, opts?: Object): boolean;\n  declare function isArrayTypeAnnotation(node: Object, opts?: Object): boolean;\n  declare function isBooleanTypeAnnotation(node: Object, opts?: Object): boolean;\n  declare function isBooleanLiteralTypeAnnotation(node: Object, opts?: Object): boolean;\n  declare function isNullLiteralTypeAnnotation(node: Object, opts?: Object): boolean;\n  declare function isClassImplements(node: Object, opts?: Object): boolean;\n  declare function isClassProperty(node: Object, opts?: Object): boolean;\n  declare function isDeclareClass(node: Object, opts?: Object): boolean;\n  declare function isDeclareFunction(node: Object, opts?: Object): boolean;\n  declare function isDeclareInterface(node: Object, opts?: Object): boolean;\n  declare function isDeclareModule(node: Object, opts?: Object): boolean;\n  declare function isDeclareModuleExports(node: Object, opts?: Object): boolean;\n  declare function isDeclareTypeAlias(node: Object, opts?: Object): boolean;\n  declare function isDeclareVariable(node: Object, opts?: Object): boolean;\n  declare function isExistentialTypeParam(node: Object, opts?: Object): boolean;\n  declare function isFunctionTypeAnnotation(node: Object, opts?: Object): boolean;\n  declare function isFunctionTypeParam(node: Object, opts?: Object): boolean;\n  declare function isGenericTypeAnnotation(node: Object, opts?: Object): boolean;\n  declare function isInterfaceExtends(node: Object, opts?: Object): boolean;\n  declare function isInterfaceDeclaration(node: Object, opts?: Object): boolean;\n  declare function isIntersectionTypeAnnotation(node: Object, opts?: Object): boolean;\n  declare function isMixedTypeAnnotation(node: Object, opts?: Object): boolean;\n  declare function isEmptyTypeAnnotation(node: Object, opts?: Object): boolean;\n  declare function isNullableTypeAnnotation(node: Object, opts?: Object): boolean;\n  declare function isNumericLiteralTypeAnnotation(node: Object, opts?: Object): boolean;\n  declare function isNumberTypeAnnotation(node: Object, opts?: Object): boolean;\n  declare function isStringLiteralTypeAnnotation(node: Object, opts?: Object): boolean;\n  declare function isStringTypeAnnotation(node: Object, opts?: Object): boolean;\n  declare function isThisTypeAnnotation(node: Object, opts?: Object): boolean;\n  declare function isTupleTypeAnnotation(node: Object, opts?: Object): boolean;\n  declare function isTypeofTypeAnnotation(node: Object, opts?: Object): boolean;\n  declare function isTypeAlias(node: Object, opts?: Object): boolean;\n  declare function isTypeAnnotation(node: Object, opts?: Object): boolean;\n  declare function isTypeCastExpression(node: Object, opts?: Object): boolean;\n  declare function isTypeParameter(node: Object, opts?: Object): boolean;\n  declare function isTypeParameterDeclaration(node: Object, opts?: Object): boolean;\n  declare function isTypeParameterInstantiation(node: Object, opts?: Object): boolean;\n  declare function isObjectTypeAnnotation(node: Object, opts?: Object): boolean;\n  declare function isObjectTypeCallProperty(node: Object, opts?: Object): boolean;\n  declare function isObjectTypeIndexer(node: Object, opts?: Object): boolean;\n  declare function isObjectTypeProperty(node: Object, opts?: Object): boolean;\n  declare function isQualifiedTypeIdentifier(node: Object, opts?: Object): boolean;\n  declare function isUnionTypeAnnotation(node: Object, opts?: Object): boolean;\n  declare function isVoidTypeAnnotation(node: Object, opts?: Object): boolean;\n  declare function isJSXAttribute(node: Object, opts?: Object): boolean;\n  declare function isJSXClosingElement(node: Object, opts?: Object): boolean;\n  declare function isJSXElement(node: Object, opts?: Object): boolean;\n  declare function isJSXEmptyExpression(node: Object, opts?: Object): boolean;\n  declare function isJSXExpressionContainer(node: Object, opts?: Object): boolean;\n  declare function isJSXIdentifier(node: Object, opts?: Object): boolean;\n  declare function isJSXMemberExpression(node: Object, opts?: Object): boolean;\n  declare function isJSXNamespacedName(node: Object, opts?: Object): boolean;\n  declare function isJSXOpeningElement(node: Object, opts?: Object): boolean;\n  declare function isJSXSpreadAttribute(node: Object, opts?: Object): boolean;\n  declare function isJSXText(node: Object, opts?: Object): boolean;\n  declare function isNoop(node: Object, opts?: Object): boolean;\n  declare function isParenthesizedExpression(node: Object, opts?: Object): boolean;\n  declare function isAwaitExpression(node: Object, opts?: Object): boolean;\n  declare function isForAwaitStatement(node: Object, opts?: Object): boolean;\n  declare function isBindExpression(node: Object, opts?: Object): boolean;\n  declare function isDecorator(node: Object, opts?: Object): boolean;\n  declare function isDoExpression(node: Object, opts?: Object): boolean;\n  declare function isExportDefaultSpecifier(node: Object, opts?: Object): boolean;\n  declare function isExportNamespaceSpecifier(node: Object, opts?: Object): boolean;\n  declare function isRestProperty(node: Object, opts?: Object): boolean;\n  declare function isExpression(node: Object, opts?: Object): boolean;\n  declare function isBinary(node: Object, opts?: Object): boolean;\n  declare function isScopable(node: Object, opts?: Object): boolean;\n  declare function isBlockParent(node: Object, opts?: Object): boolean;\n  declare function isBlock(node: Object, opts?: Object): boolean;\n  declare function isStatement(node: Object, opts?: Object): boolean;\n  declare function isTerminatorless(node: Object, opts?: Object): boolean;\n  declare function isCompletionStatement(node: Object, opts?: Object): boolean;\n  declare function isConditional(node: Object, opts?: Object): boolean;\n  declare function isLoop(node: Object, opts?: Object): boolean;\n  declare function isWhile(node: Object, opts?: Object): boolean;\n  declare function isExpressionWrapper(node: Object, opts?: Object): boolean;\n  declare function isFor(node: Object, opts?: Object): boolean;\n  declare function isForXStatement(node: Object, opts?: Object): boolean;\n  declare function isFunction(node: Object, opts?: Object): boolean;\n  declare function isFunctionParent(node: Object, opts?: Object): boolean;\n  declare function isPureish(node: Object, opts?: Object): boolean;\n  declare function isDeclaration(node: Object, opts?: Object): boolean;\n  declare function isLVal(node: Object, opts?: Object): boolean;\n  declare function isLiteral(node: Object, opts?: Object): boolean;\n  declare function isImmutable(node: Object, opts?: Object): boolean;\n  declare function isUserWhitespacable(node: Object, opts?: Object): boolean;\n  declare function isMethod(node: Object, opts?: Object): boolean;\n  declare function isObjectMember(node: Object, opts?: Object): boolean;\n  declare function isProperty(node: Object, opts?: Object): boolean;\n  declare function isUnaryLike(node: Object, opts?: Object): boolean;\n  declare function isPattern(node: Object, opts?: Object): boolean;\n  declare function isClass(node: Object, opts?: Object): boolean;\n  declare function isModuleDeclaration(node: Object, opts?: Object): boolean;\n  declare function isExportDeclaration(node: Object, opts?: Object): boolean;\n  declare function isModuleSpecifier(node: Object, opts?: Object): boolean;\n  declare function isFlow(node: Object, opts?: Object): boolean;\n  declare function isFlowBaseAnnotation(node: Object, opts?: Object): boolean;\n  declare function isFlowDeclaration(node: Object, opts?: Object): boolean;\n  declare function isJSX(node: Object, opts?: Object): boolean;\n  declare function isNumberLiteral(node: Object, opts?: Object): boolean;\n  declare function isRegexLiteral(node: Object, opts?: Object): boolean;\n\n  declare function isValidIdentifier(name: string): boolean;\n  declare function getBindingIdentifiers(\n    node: Object | Array<Object>,\n    duplicates?: boolean,\n    outerOnly?: boolean\n  ): Object;\n  declare function getOuterBindingIdentifiers(\n    node: Object | Array<Object>,\n    duplicates?: boolean,\n  ): Object;\n  declare var VISITOR_KEYS: {[id:string]: Function};\n  declare function valueToNode(value: any): BabelNodeExpression;\n  declare function cloneDeep(node: BabelNode): BabelNode;\n}\n\ndeclare module \"babel-types\" {\n  declare type BabelObjectMethodKind = \"get\" | \"set\" | \"method\";\n  declare type BabelLogicalOperator = \"||\" | \"&&\";\n  declare type BabelAssignmentOperator = \"=\" | \"+=\" | \"-=\" | \"*=\" | \"/=\" | \"%=\" | \"<<=\" | \">>=\" | \">>>=\" | \"|=\" | \"^=\" | \"&=\";\n  declare type BabelBinaryOperator = \"+\" | \"-\" | \"/\" | \"%\" | \"*\" | \"**\" | \"&\" | \"|\" | \">>\" | \">>>\" | \"<<\" | \"^\" | \"==\" | \"===\" | \"!=\" | \"!==\" | \"in\" | \"instanceof\" | \">\" | \"<\" | \">=\" | \"<=\";\n  declare type BabelUnaryOperator = \"void\" | \"delete\" | \"!\" | \"+\" | \"-\" | \"++\" | \"--\" | \"~\" | \"typeof\";\n  declare type BabelUpdateOperator = \"++\" | \"--\";\n  declare type BabelVariableKind = \"var\" | \"let\" | \"const\";\n\n  declare class BabelNodeComment {\n    +type: \"BlockComment\" | \"LineComment\";\n    value: string;\n    start: number;\n    end: number;\n    loc: BabelNodeSourceLocation;\n  }\n\n  declare class BabelNodeBlockComment extends BabelNodeComment {\n    type: \"BlockComment\";\n  }\n\n  declare class BabelNodeLineComment extends BabelNodeComment {\n    type: \"LineComment\";\n  }\n\n  declare class BabelNodePosition {\n    line: number;\n    column: number;\n  }\n\n  declare class BabelNodeSourceLocation {\n    source: string | null;\n    start: BabelNodePosition;\n    end: BabelNodePosition;\n  }\n\n  declare class BabelNode {\n    +type: \"ArrayExpression\" |\n      \"AssignmentExpression\" |\n      \"BinaryExpression\" |\n      \"Directive\" |\n      \"DirectiveLiteral\" |\n      \"BlockStatement\" |\n      \"BreakStatement\" |\n      \"CallExpression\" |\n      \"CatchClause\" |\n      \"ConditionalExpression\" |\n      \"ContinueStatement\" |\n      \"DebuggerStatement\" |\n      \"DoWhileStatement\" |\n      \"EmptyStatement\" |\n      \"ExpressionStatement\" |\n      \"File\" |\n      \"ForInStatement\" |\n      \"ForStatement\" |\n      \"FunctionDeclaration\" |\n      \"FunctionExpression\" |\n      \"Identifier\" |\n      \"IfStatement\" |\n      \"LabeledStatement\" |\n      \"StringLiteral\" |\n      \"NumericLiteral\" |\n      \"NullLiteral\" |\n      \"BooleanLiteral\" |\n      \"RegExpLiteral\" |\n      \"LogicalExpression\" |\n      \"MemberExpression\" |\n      \"NewExpression\" |\n      \"Program\" |\n      \"ObjectExpression\" |\n      \"ObjectMethod\" |\n      \"ObjectProperty\" |\n      \"RestElement\" |\n      \"ReturnStatement\" |\n      \"SequenceExpression\" |\n      \"SwitchCase\" |\n      \"SwitchStatement\" |\n      \"ThisExpression\" |\n      \"ThrowStatement\" |\n      \"TryStatement\" |\n      \"UnaryExpression\" |\n      \"UpdateExpression\" |\n      \"VariableDeclaration\" |\n      \"VariableDeclarator\" |\n      \"WhileStatement\" |\n      \"WithStatement\" |\n      \"AssignmentPattern\" |\n      \"ArrayPattern\" |\n      \"ArrowFunctionExpression\" |\n      \"ClassBody\" |\n      \"ClassDeclaration\" |\n      \"ClassExpression\" |\n      \"ExportAllDeclaration\" |\n      \"ExportDefaultDeclaration\" |\n      \"ExportNamedDeclaration\" |\n      \"ExportSpecifier\" |\n      \"ForOfStatement\" |\n      \"ImportDeclaration\" |\n      \"ImportDefaultSpecifier\" |\n      \"ImportNamespaceSpecifier\" |\n      \"ImportSpecifier\" |\n      \"MetaProperty\" |\n      \"ClassMethod\" |\n      \"ObjectPattern\" |\n      \"SpreadElement\" |\n      \"Super\" |\n      \"TaggedTemplateExpression\" |\n      \"TemplateElement\" |\n      \"TemplateLiteral\" |\n      \"YieldExpression\" |\n      \"AnyTypeAnnotation\" |\n      \"ArrayTypeAnnotation\" |\n      \"BooleanTypeAnnotation\" |\n      \"BooleanLiteralTypeAnnotation\" |\n      \"NullLiteralTypeAnnotation\" |\n      \"ClassImplements\" |\n      \"ClassProperty\" |\n      \"DeclareClass\" |\n      \"DeclareFunction\" |\n      \"DeclareInterface\" |\n      \"DeclareModule\" |\n      \"DeclareModuleExports\" |\n      \"DeclareTypeAlias\" |\n      \"DeclareVariable\" |\n      \"ExistentialTypeParam\" |\n      \"FunctionTypeAnnotation\" |\n      \"FunctionTypeParam\" |\n      \"GenericTypeAnnotation\" |\n      \"InterfaceExtends\" |\n      \"InterfaceDeclaration\" |\n      \"IntersectionTypeAnnotation\" |\n      \"MixedTypeAnnotation\" |\n      \"EmptyTypeAnnotation\" |\n      \"NullableTypeAnnotation\" |\n      \"NumericLiteralTypeAnnotation\" |\n      \"NumberTypeAnnotation\" |\n      \"StringLiteralTypeAnnotation\" |\n      \"StringTypeAnnotation\" |\n      \"ThisTypeAnnotation\" |\n      \"TupleTypeAnnotation\" |\n      \"TypeofTypeAnnotation\" |\n      \"TypeAlias\" |\n      \"TypeAnnotation\" |\n      \"TypeCastExpression\" |\n      \"TypeParameter\" |\n      \"TypeParameterDeclaration\" |\n      \"TypeParameterInstantiation\" |\n      \"ObjectTypeAnnotation\" |\n      \"ObjectTypeCallProperty\" |\n      \"ObjectTypeIndexer\" |\n      \"ObjectTypeProperty\" |\n      \"QualifiedTypeIdentifier\" |\n      \"UnionTypeAnnotation\" |\n      \"VoidTypeAnnotation\" |\n      \"JSXAttribute\" |\n      \"JSXClosingElement\" |\n      \"JSXElement\" |\n      \"JSXEmptyExpression\" |\n      \"JSXExpressionContainer\" |\n      \"JSXIdentifier\" |\n      \"JSXMemberExpression\" |\n      \"JSXNamespacedName\" |\n      \"JSXOpeningElement\" |\n      \"JSXSpreadAttribute\" |\n      \"JSXText\" |\n      \"Noop\" |\n      \"ParenthesizedExpression\" |\n      \"AwaitExpression\" |\n      \"ForAwaitStatement\" |\n      \"BindExpression\" |\n      \"Decorator\" |\n      \"DoExpression\" |\n      \"ExportDefaultSpecifier\" |\n      \"ExportNamespaceSpecifier\" |\n      \"RestProperty\" ;\n    leadingComments: ?Array<BabelNodeComment>;\n    innerComments: ?Array<BabelNodeComment>;\n    trailingComments: ?Array<BabelNodeComment>;\n    start: ?number;\n    end: ?number;\n    loc: ?BabelNodeSourceLocation;\n  }\n\n  declare class BabelNodeArrayExpression extends BabelNode {\n    type: \"ArrayExpression\";\n    elements: Array<void | BabelNodeExpression | BabelNodeSpreadElement>;\n  }\n\n  declare class BabelNodeAssignmentExpression extends BabelNode {\n    type: \"AssignmentExpression\";\n    operator: BabelAssignmentOperator;\n    left: BabelNodeLVal;\n    right: BabelNodeExpression;\n  }\n\n  declare class BabelNodeBinaryExpression extends BabelNode {\n    type: \"BinaryExpression\";\n    operator: BabelBinaryOperator;\n    left: BabelNodeExpression;\n    right: BabelNodeExpression;\n  }\n\n  declare class BabelNodeDirective extends BabelNode {\n    type: \"Directive\";\n    value: BabelNodeDirectiveLiteral;\n  }\n\n  declare class BabelNodeDirectiveLiteral extends BabelNode {\n    type: \"DirectiveLiteral\";\n    value: string;\n  }\n\n  declare class BabelNodeBlockStatement extends BabelNode {\n    type: \"BlockStatement\";\n    directives?: Array<BabelNodeDirective>;\n    body: Array<BabelNodeStatement>;\n  }\n\n  declare class BabelNodeBreakStatement extends BabelNode {\n    type: \"BreakStatement\";\n    label?: ?BabelNodeIdentifier;\n  }\n\n  declare class BabelNodeCallExpression extends BabelNode {\n    type: \"CallExpression\";\n    callee: BabelNodeExpression;\n    arguments: Array<BabelNodeExpression | BabelNodeSpreadElement>;\n  }\n\n  declare class BabelNodeCatchClause extends BabelNode {\n    type: \"CatchClause\";\n    param: BabelNodePattern;\n    body: BabelNodeBlockStatement;\n  }\n\n  declare class BabelNodeConditionalExpression extends BabelNode {\n    type: \"ConditionalExpression\";\n    test: BabelNodeExpression;\n    consequent: BabelNodeExpression;\n    alternate: BabelNodeExpression;\n  }\n\n  declare class BabelNodeContinueStatement extends BabelNode {\n    type: \"ContinueStatement\";\n    label?: ?BabelNodeIdentifier;\n  }\n\n  declare class BabelNodeDebuggerStatement extends BabelNode {\n    type: \"DebuggerStatement\";\n  }\n\n  declare class BabelNodeDoWhileStatement extends BabelNode {\n    type: \"DoWhileStatement\";\n    test: BabelNodeExpression;\n    body: BabelNodeStatement;\n  }\n\n  declare class BabelNodeEmptyStatement extends BabelNode {\n    type: \"EmptyStatement\";\n  }\n\n  declare class BabelNodeExpressionStatement extends BabelNode {\n    type: \"ExpressionStatement\";\n    expression: BabelNodeExpression;\n  }\n\n  declare class BabelNodeFile extends BabelNode {\n    type: \"File\";\n    program: BabelNodeProgram;\n    comments: any;\n    tokens: any;\n  }\n\n  declare class BabelNodeForInStatement extends BabelNode {\n    type: \"ForInStatement\";\n    left: BabelNodeVariableDeclaration | BabelNodeLVal;\n    right: BabelNodeExpression;\n    body: BabelNodeStatement;\n  }\n\n  declare class BabelNodeForStatement extends BabelNode {\n    type: \"ForStatement\";\n    init?: ?BabelNodeVariableDeclaration | BabelNodeExpression;\n    test?: ?BabelNodeExpression;\n    update?: ?BabelNodeExpression;\n    body: BabelNodeStatement;\n  }\n\n  declare class BabelNodeFunctionDeclaration extends BabelNode {\n    type: \"FunctionDeclaration\";\n    id: BabelNodeIdentifier;\n    params: Array<BabelNodeLVal>;\n    body: BabelNodeBlockStatement;\n    generator: boolean;\n    async: boolean;\n    returnType?: any;\n    typeParameters?: any;\n  }\n\n  declare class BabelNodeFunctionExpression extends BabelNode {\n    type: \"FunctionExpression\";\n    id?: ?BabelNodeIdentifier;\n    params: Array<BabelNodeLVal>;\n    body: BabelNodeBlockStatement;\n    generator?: boolean;\n    async?: boolean;\n    returnType?: any;\n    typeParameters?: any;\n  }\n\n  declare class BabelNodeIdentifier extends BabelNode {\n    type: \"Identifier\";\n    name: string;\n    decorators?: any;\n    typeAnnotation?: any;\n  }\n\n  declare class BabelNodeIfStatement extends BabelNode {\n    type: \"IfStatement\";\n    test: BabelNodeExpression;\n    consequent: BabelNodeStatement;\n    alternate?: ?BabelNodeStatement;\n  }\n\n  declare class BabelNodeLabeledStatement extends BabelNode {\n    type: \"LabeledStatement\";\n    label: BabelNodeIdentifier;\n    body: BabelNodeStatement;\n  }\n\n  declare class BabelNodeStringLiteral extends BabelNode {\n    type: \"StringLiteral\";\n    value: string;\n  }\n\n  declare class BabelNodeNumericLiteral extends BabelNode {\n    type: \"NumericLiteral\";\n    value: number;\n  }\n\n  declare class BabelNodeNullLiteral extends BabelNode {\n    type: \"NullLiteral\";\n  }\n\n  declare class BabelNodeBooleanLiteral extends BabelNode {\n    type: \"BooleanLiteral\";\n    value: boolean;\n  }\n\n  declare class BabelNodeRegExpLiteral extends BabelNode {\n    type: \"RegExpLiteral\";\n    pattern: string;\n    flags?: string;\n  }\n\n  declare class BabelNodeLogicalExpression extends BabelNode {\n    type: \"LogicalExpression\";\n    operator: BabelLogicalOperator;\n    left: BabelNodeExpression;\n    right: BabelNodeExpression;\n  }\n\n  declare class BabelNodeMemberExpression extends BabelNode {\n    type: \"MemberExpression\";\n    object: BabelNodeExpression;\n    property: any;\n    computed?: boolean;\n  }\n\n  declare class BabelNodeNewExpression extends BabelNode {\n    type: \"NewExpression\";\n    callee: BabelNodeExpression;\n    arguments: Array<BabelNode>;\n  }\n\n  declare class BabelNodeProgram extends BabelNode {\n    type: \"Program\";\n    sourceType: \"script\" | \"module\";\n    directives?: Array<BabelNodeDirective>;\n    body: Array<BabelNodeStatement | BabelNodeModuleDeclaration>;\n  }\n\n  declare class BabelNodeObjectExpression extends BabelNode {\n    type: \"ObjectExpression\";\n    properties: Array<BabelNodeObjectProperty>;\n  }\n\n  declare class BabelNodeObjectMethod extends BabelNode {\n    type: \"ObjectMethod\";\n    kind: BabelObjectMethodKind;\n    computed: boolean;\n    key: BabelNodeExpression;\n    decorators: Array<BabelNodeDecorator>;\n    value: BabelNodeExpression;\n    id?: ?BabelNodeIdentifier;\n    params: Array<BabelNodeLVal>;\n    body: BabelNodeBlockStatement;\n    generator?: boolean;\n    async: boolean;\n  }\n\n  declare class BabelNodeObjectProperty extends BabelNode {\n    type: \"ObjectProperty\";\n    computed: boolean;\n    key: BabelNodeExpression;\n    decorators: Array<BabelNodeDecorator>;\n    value: BabelNodeExpression;\n  }\n\n  declare class BabelNodeRestElement extends BabelNode {\n    type: \"RestElement\";\n    argument: BabelNodePattern;\n    decorators?: any;\n    typeAnnotation: any;\n  }\n\n  declare class BabelNodeReturnStatement extends BabelNode {\n    type: \"ReturnStatement\";\n    argument?: ?BabelNodeExpression;\n  }\n\n  declare class BabelNodeSequenceExpression extends BabelNode {\n    type: \"SequenceExpression\";\n    expressions: Array<BabelNodeExpression>;\n  }\n\n  declare class BabelNodeSwitchCase extends BabelNode {\n    type: \"SwitchCase\";\n    test?: ?BabelNodeExpression;\n    consequent: Array<BabelNodeStatement>;\n  }\n\n  declare class BabelNodeSwitchStatement extends BabelNode {\n    type: \"SwitchStatement\";\n    discriminant: BabelNodeExpression;\n    cases: Array<BabelNodeSwitchCase>;\n  }\n\n  declare class BabelNodeThisExpression extends BabelNode {\n    type: \"ThisExpression\";\n  }\n\n  declare class BabelNodeThrowStatement extends BabelNode {\n    type: \"ThrowStatement\";\n    argument: BabelNodeExpression;\n  }\n\n  declare class BabelNodeTryStatement extends BabelNode {\n    type: \"TryStatement\";\n    body?: ?BabelNodeBlockStatement;\n    handler?: ?BabelNodeCatchClause;\n    finalizer?: ?BabelNodeBlockStatement;\n    block: BabelNodeBlockStatement;\n  }\n\n  declare class BabelNodeUnaryExpression extends BabelNode {\n    type: \"UnaryExpression\";\n    prefix?: boolean;\n    argument: BabelNodeExpression;\n    operator: BabelUnaryOperator;\n  }\n\n  declare class BabelNodeUpdateExpression extends BabelNode {\n    type: \"UpdateExpression\";\n    prefix?: boolean;\n    argument: BabelNodeExpression;\n    operator: BabelUpdateOperator;\n  }\n\n  declare class BabelNodeVariableDeclaration extends BabelNode {\n    type: \"VariableDeclaration\";\n    kind: BabelVariableKind;\n    declarations: Array<BabelNodeVariableDeclarator>;\n  }\n\n  declare class BabelNodeVariableDeclarator extends BabelNode {\n    type: \"VariableDeclarator\";\n    id: BabelNodeLVal;\n    init?: ?BabelNodeExpression;\n  }\n\n  declare class BabelNodeWhileStatement extends BabelNode {\n    type: \"WhileStatement\";\n    test: BabelNodeExpression;\n    body: BabelNodeStatement;\n  }\n\n  declare class BabelNodeWithStatement extends BabelNode {\n    type: \"WithStatement\";\n    object: BabelNodeExpression;\n    body: BabelNodeStatement;\n  }\n\n  declare class BabelNodeAssignmentPattern extends BabelNode {\n    type: \"AssignmentPattern\";\n    left: BabelNodeIdentifier;\n    right: BabelNodeExpression;\n    decorators?: any;\n  }\n\n  declare class BabelNodeArrayPattern extends BabelNode {\n    type: \"ArrayPattern\";\n    elements: any;\n    decorators?: any;\n    typeAnnotation: any;\n  }\n\n  declare class BabelNodeArrowFunctionExpression extends BabelNode {\n    type: \"ArrowFunctionExpression\";\n    body: BabelNodeBlockStatement | BabelNodeExpression;\n    expression: boolean;\n    id?: ?BabelNodeIdentifier;\n    params: Array<BabelNodeLVal>;\n    generator?: boolean;\n    async: boolean;\n    returnType?: any;\n    typeParameters?: any;\n  }\n\n  declare class BabelNodeClassBody extends BabelNode {\n    type: \"ClassBody\";\n    body: Array<BabelNodeClassMethod | BabelNodeClassProperty>;\n  }\n\n  declare class BabelNodeClassDeclaration extends BabelNode {\n    type: \"ClassDeclaration\";\n    id: BabelNodeIdentifier;\n    body: BabelNodeClassBody;\n    superClass?: ?BabelNodeExpression;\n    decorators: Array<BabelNodeDecorator>;\n    mixins?: any;\n    typeParameters?: any;\n    superTypeParameters?: any;\n  }\n\n  declare class BabelNodeClassExpression extends BabelNode {\n    type: \"ClassExpression\";\n    id?: ?BabelNodeIdentifier;\n    body: BabelNodeClassBody;\n    superClass?: ?BabelNodeExpression;\n    decorators: any;\n    mixins?: any;\n    typeParameters?: any;\n    superTypeParameters?: any;\n  }\n\n  declare class BabelNodeExportAllDeclaration extends BabelNode {\n    type: \"ExportAllDeclaration\";\n    source: BabelNodeStringLiteral;\n  }\n\n  declare class BabelNodeExportDefaultDeclaration extends BabelNode {\n    type: \"ExportDefaultDeclaration\";\n    declaration: BabelNodeFunctionDeclaration | BabelNodeClassDeclaration | BabelNodeExpression;\n  }\n\n  declare class BabelNodeExportNamedDeclaration extends BabelNode {\n    type: \"ExportNamedDeclaration\";\n    declaration?: ?BabelNodeDeclaration;\n    specifiers: Array<BabelNodeExportSpecifier>;\n    source?: ?BabelNodeStringLiteral;\n  }\n\n  declare class BabelNodeExportSpecifier extends BabelNode {\n    type: \"ExportSpecifier\";\n    local: BabelNodeIdentifier;\n    exported: BabelNodeIdentifier;\n  }\n\n  declare class BabelNodeForOfStatement extends BabelNode {\n    type: \"ForOfStatement\";\n    left: BabelNodeVariableDeclaration | BabelNodeLVal;\n    right: BabelNodeExpression;\n    body: BabelNodeStatement;\n  }\n\n  declare class BabelNodeImportDeclaration extends BabelNode {\n    type: \"ImportDeclaration\";\n    specifiers: [BabelNodeImportSpecifier | BabelNodeImportDefaultSpecifier | BabelNodeImportNamespaceSpecifier];\n    source: BabelNodeStringLiteral;\n  }\n\n  declare class BabelNodeImportDefaultSpecifier extends BabelNode {\n    type: \"ImportDefaultSpecifier\";\n    local: BabelNodeIdentifier;\n  }\n\n  declare class BabelNodeImportNamespaceSpecifier extends BabelNode {\n    type: \"ImportNamespaceSpecifier\";\n    local: BabelNodeIdentifier;\n  }\n\n  declare class BabelNodeImportSpecifier extends BabelNode {\n    type: \"ImportSpecifier\";\n    local: BabelNodeIdentifier;\n    imported: BabelNodeIdentifier;\n  }\n\n  declare class BabelNodeMetaProperty extends BabelNode {\n    type: \"MetaProperty\";\n    meta: BabelNodeIdentifier;\n    property: BabelNodeIdentifier;\n  }\n\n  declare class BabelNodeClassMethod extends BabelNode {\n    type: \"ClassMethod\";\n    kind?: any;\n    computed?: boolean;\n    key: any;\n    params: Array<BabelNodeLVal>;\n    body: BabelNodeBlockStatement;\n    generator?: boolean;\n    async?: boolean;\n    decorators: Array<BabelNodeDecorator>;\n    returnType?: any;\n    typeParameters?: any;\n  }\n\n  declare class BabelNodeObjectPattern extends BabelNode {\n    type: \"ObjectPattern\";\n    properties: any;\n    decorators?: any;\n    typeAnnotation: any;\n  }\n\n  declare class BabelNodeSpreadElement extends BabelNode {\n    type: \"SpreadElement\";\n    argument: BabelNodeExpression;\n  }\n\n  declare class BabelNodeSuper extends BabelNode {\n    type: \"Super\";\n  }\n\n  declare class BabelNodeTaggedTemplateExpression extends BabelNode {\n    type: \"TaggedTemplateExpression\";\n    tag: BabelNodeExpression;\n    quasi: BabelNodeTemplateLiteral;\n  }\n\n  declare class BabelNodeTemplateElement extends BabelNode {\n    type: \"TemplateElement\";\n    value: { cooked: string, raw: string };\n    tail: boolean;\n  }\n\n  declare class BabelNodeTemplateLiteral extends BabelNode {\n    type: \"TemplateLiteral\";\n    quasis: Array<BabelNodeTemplateElement>;\n    expressions: Array<BabelNodeExpression>;\n  }\n\n  declare class BabelNodeYieldExpression extends BabelNode {\n    type: \"YieldExpression\";\n    delegate: boolean;\n    argument?: ?BabelNodeExpression;\n  }\n\n  declare class BabelNodeAnyTypeAnnotation extends BabelNode {\n    type: \"AnyTypeAnnotation\";\n  }\n\n  declare class BabelNodeArrayTypeAnnotation extends BabelNode {\n    type: \"ArrayTypeAnnotation\";\n    elementType: any;\n  }\n\n  declare class BabelNodeBooleanTypeAnnotation extends BabelNode {\n    type: \"BooleanTypeAnnotation\";\n  }\n\n  declare class BabelNodeBooleanLiteralTypeAnnotation extends BabelNode {\n    type: \"BooleanLiteralTypeAnnotation\";\n  }\n\n  declare class BabelNodeNullLiteralTypeAnnotation extends BabelNode {\n    type: \"NullLiteralTypeAnnotation\";\n  }\n\n  declare class BabelNodeClassImplements extends BabelNode {\n    type: \"ClassImplements\";\n    id: any;\n    typeParameters: any;\n  }\n\n  declare class BabelNodeClassProperty extends BabelNode {\n    type: \"ClassProperty\";\n    computed: boolean;\n    key: BabelNodeIdentifier;\n    value: BabelNodeExpression;\n    typeAnnotation: any;\n    decorators: Array<BabelNodeDecorator>;\n  }\n\n  declare class BabelNodeDeclareClass extends BabelNode {\n    type: \"DeclareClass\";\n    id: any;\n    typeParameters: any;\n    body: any;\n  }\n\n  declare class BabelNodeDeclareFunction extends BabelNode {\n    type: \"DeclareFunction\";\n    id: any;\n  }\n\n  declare class BabelNodeDeclareInterface extends BabelNode {\n    type: \"DeclareInterface\";\n    id: any;\n    typeParameters: any;\n    body: any;\n  }\n\n  declare class BabelNodeDeclareModule extends BabelNode {\n    type: \"DeclareModule\";\n    id: any;\n    body: any;\n  }\n\n  declare class BabelNodeDeclareModuleExports extends BabelNode {\n    type: \"DeclareModuleExports\";\n    typeAnnotation: any;\n  }\n\n  declare class BabelNodeDeclareTypeAlias extends BabelNode {\n    type: \"DeclareTypeAlias\";\n    id: any;\n    typeParameters: any;\n    right: any;\n  }\n\n  declare class BabelNodeDeclareVariable extends BabelNode {\n    type: \"DeclareVariable\";\n    id: any;\n  }\n\n  declare class BabelNodeExistentialTypeParam extends BabelNode {\n    type: \"ExistentialTypeParam\";\n  }\n\n  declare class BabelNodeFunctionTypeAnnotation extends BabelNode {\n    type: \"FunctionTypeAnnotation\";\n    typeParameters: any;\n    params: any;\n    rest: any;\n    returnType: any;\n  }\n\n  declare class BabelNodeFunctionTypeParam extends BabelNode {\n    type: \"FunctionTypeParam\";\n    name: any;\n    typeAnnotation: any;\n  }\n\n  declare class BabelNodeGenericTypeAnnotation extends BabelNode {\n    type: \"GenericTypeAnnotation\";\n    id: any;\n    typeParameters: any;\n  }\n\n  declare class BabelNodeInterfaceExtends extends BabelNode {\n    type: \"InterfaceExtends\";\n    id: any;\n    typeParameters: any;\n  }\n\n  declare class BabelNodeInterfaceDeclaration extends BabelNode {\n    type: \"InterfaceDeclaration\";\n    id: any;\n    typeParameters: any;\n    body: any;\n  }\n\n  declare class BabelNodeIntersectionTypeAnnotation extends BabelNode {\n    type: \"IntersectionTypeAnnotation\";\n    types: any;\n  }\n\n  declare class BabelNodeMixedTypeAnnotation extends BabelNode {\n    type: \"MixedTypeAnnotation\";\n  }\n\n  declare class BabelNodeEmptyTypeAnnotation extends BabelNode {\n    type: \"EmptyTypeAnnotation\";\n  }\n\n  declare class BabelNodeNullableTypeAnnotation extends BabelNode {\n    type: \"NullableTypeAnnotation\";\n    typeAnnotation: any;\n  }\n\n  declare class BabelNodeNumericLiteralTypeAnnotation extends BabelNode {\n    type: \"NumericLiteralTypeAnnotation\";\n  }\n\n  declare class BabelNodeNumberTypeAnnotation extends BabelNode {\n    type: \"NumberTypeAnnotation\";\n  }\n\n  declare class BabelNodeStringLiteralTypeAnnotation extends BabelNode {\n    type: \"StringLiteralTypeAnnotation\";\n  }\n\n  declare class BabelNodeStringTypeAnnotation extends BabelNode {\n    type: \"StringTypeAnnotation\";\n  }\n\n  declare class BabelNodeThisTypeAnnotation extends BabelNode {\n    type: \"ThisTypeAnnotation\";\n  }\n\n  declare class BabelNodeTupleTypeAnnotation extends BabelNode {\n    type: \"TupleTypeAnnotation\";\n    types: any;\n  }\n\n  declare class BabelNodeTypeofTypeAnnotation extends BabelNode {\n    type: \"TypeofTypeAnnotation\";\n    argument: any;\n  }\n\n  declare class BabelNodeTypeAlias extends BabelNode {\n    type: \"TypeAlias\";\n    id: any;\n    typeParameters: any;\n    right: any;\n  }\n\n  declare class BabelNodeTypeAnnotation extends BabelNode {\n    type: \"TypeAnnotation\";\n    typeAnnotation: any;\n  }\n\n  declare class BabelNodeTypeCastExpression extends BabelNode {\n    type: \"TypeCastExpression\";\n    expression: any;\n    typeAnnotation: any;\n  }\n\n  declare class BabelNodeTypeParameter extends BabelNode {\n    type: \"TypeParameter\";\n    bound: any;\n  }\n\n  declare class BabelNodeTypeParameterDeclaration extends BabelNode {\n    type: \"TypeParameterDeclaration\";\n    params: any;\n  }\n\n  declare class BabelNodeTypeParameterInstantiation extends BabelNode {\n    type: \"TypeParameterInstantiation\";\n    params: any;\n  }\n\n  declare class BabelNodeObjectTypeAnnotation extends BabelNode {\n    type: \"ObjectTypeAnnotation\";\n    properties: any;\n    indexers: any;\n    callProperties: any;\n  }\n\n  declare class BabelNodeObjectTypeCallProperty extends BabelNode {\n    type: \"ObjectTypeCallProperty\";\n    value: any;\n  }\n\n  declare class BabelNodeObjectTypeIndexer extends BabelNode {\n    type: \"ObjectTypeIndexer\";\n    id: any;\n    key: any;\n    value: any;\n  }\n\n  declare class BabelNodeObjectTypeProperty extends BabelNode {\n    type: \"ObjectTypeProperty\";\n    key: any;\n    value: any;\n  }\n\n  declare class BabelNodeQualifiedTypeIdentifier extends BabelNode {\n    type: \"QualifiedTypeIdentifier\";\n    id: any;\n    qualification: any;\n  }\n\n  declare class BabelNodeUnionTypeAnnotation extends BabelNode {\n    type: \"UnionTypeAnnotation\";\n    types: any;\n  }\n\n  declare class BabelNodeVoidTypeAnnotation extends BabelNode {\n    type: \"VoidTypeAnnotation\";\n  }\n\n  declare class BabelNodeJSXAttribute extends BabelNode {\n    type: \"JSXAttribute\";\n    name: BabelNodeJSXIdentifier | BabelNodeJSXNamespacedName;\n    value?: ?BabelNodeJSXElement | BabelNodeStringLiteral | BabelNodeJSXExpressionContainer;\n  }\n\n  declare class BabelNodeJSXClosingElement extends BabelNode {\n    type: \"JSXClosingElement\";\n    name: BabelNodeJSXIdentifier | BabelNodeJSXMemberExpression;\n  }\n\n  declare class BabelNodeJSXElement extends BabelNode {\n    type: \"JSXElement\";\n    openingElement: BabelNodeJSXOpeningElement;\n    closingElement?: ?BabelNodeJSXClosingElement;\n    children: any;\n    selfClosing: any;\n  }\n\n  declare class BabelNodeJSXEmptyExpression extends BabelNode {\n    type: \"JSXEmptyExpression\";\n  }\n\n  declare class BabelNodeJSXExpressionContainer extends BabelNode {\n    type: \"JSXExpressionContainer\";\n    expression: BabelNodeExpression;\n  }\n\n  declare class BabelNodeJSXIdentifier extends BabelNode {\n    type: \"JSXIdentifier\";\n    name: string;\n  }\n\n  declare class BabelNodeJSXMemberExpression extends BabelNode {\n    type: \"JSXMemberExpression\";\n    object: BabelNodeJSXMemberExpression | BabelNodeJSXIdentifier;\n    property: BabelNodeJSXIdentifier;\n  }\n\n  declare class BabelNodeJSXNamespacedName extends BabelNode {\n    type: \"JSXNamespacedName\";\n    namespace: BabelNodeJSXIdentifier;\n    name: BabelNodeJSXIdentifier;\n  }\n\n  declare class BabelNodeJSXOpeningElement extends BabelNode {\n    type: \"JSXOpeningElement\";\n    name: BabelNodeJSXIdentifier | BabelNodeJSXMemberExpression;\n    selfClosing?: boolean;\n    attributes: any;\n  }\n\n  declare class BabelNodeJSXSpreadAttribute extends BabelNode {\n    type: \"JSXSpreadAttribute\";\n    argument: BabelNodeExpression;\n  }\n\n  declare class BabelNodeJSXText extends BabelNode {\n    type: \"JSXText\";\n    value: string;\n  }\n\n  declare class BabelNodeNoop extends BabelNode {\n    type: \"Noop\";\n  }\n\n  declare class BabelNodeParenthesizedExpression extends BabelNode {\n    type: \"ParenthesizedExpression\";\n    expression: BabelNodeExpression;\n  }\n\n  declare class BabelNodeAwaitExpression extends BabelNode {\n    type: \"AwaitExpression\";\n    argument: BabelNodeExpression;\n  }\n\n  declare class BabelNodeForAwaitStatement extends BabelNode {\n    type: \"ForAwaitStatement\";\n    left: BabelNodeVariableDeclaration | BabelNodeLVal;\n    right: BabelNodeExpression;\n    body: BabelNodeStatement;\n  }\n\n  declare class BabelNodeBindExpression extends BabelNode {\n    type: \"BindExpression\";\n    object: any;\n    callee: any;\n  }\n\n  declare class BabelNodeDecorator extends BabelNode {\n    type: \"Decorator\";\n    expression: BabelNodeExpression;\n  }\n\n  declare class BabelNodeDoExpression extends BabelNode {\n    type: \"DoExpression\";\n    body: BabelNodeBlockStatement;\n  }\n\n  declare class BabelNodeExportDefaultSpecifier extends BabelNode {\n    type: \"ExportDefaultSpecifier\";\n    exported: BabelNodeIdentifier;\n  }\n\n  declare class BabelNodeExportNamespaceSpecifier extends BabelNode {\n    type: \"ExportNamespaceSpecifier\";\n    exported: BabelNodeIdentifier;\n  }\n\n  declare class BabelNodeRestProperty extends BabelNode {\n    type: \"RestProperty\";\n    argument: BabelNodeLVal;\n  }\n\n  declare type BabelNodeExpression = BabelNodeArrayExpression | BabelNodeAssignmentExpression | BabelNodeBinaryExpression | BabelNodeCallExpression | BabelNodeConditionalExpression | BabelNodeFunctionExpression | BabelNodeIdentifier | BabelNodeStringLiteral | BabelNodeNumericLiteral | BabelNodeNullLiteral | BabelNodeBooleanLiteral | BabelNodeRegExpLiteral | BabelNodeLogicalExpression | BabelNodeMemberExpression | BabelNodeNewExpression | BabelNodeObjectExpression | BabelNodeSequenceExpression | BabelNodeThisExpression | BabelNodeUnaryExpression | BabelNodeUpdateExpression | BabelNodeArrowFunctionExpression | BabelNodeClassExpression | BabelNodeMetaProperty | BabelNodeSuper | BabelNodeTaggedTemplateExpression | BabelNodeTemplateLiteral | BabelNodeYieldExpression | BabelNodeTypeCastExpression | BabelNodeJSXElement | BabelNodeJSXEmptyExpression | BabelNodeJSXIdentifier | BabelNodeJSXMemberExpression | BabelNodeParenthesizedExpression | BabelNodeAwaitExpression | BabelNodeBindExpression | BabelNodeDoExpression;\n  declare type BabelNodeBinary = BabelNodeBinaryExpression | BabelNodeLogicalExpression;\n  declare type BabelNodeScopable = BabelNodeBlockStatement | BabelNodeCatchClause | BabelNodeDoWhileStatement | BabelNodeForInStatement | BabelNodeForStatement | BabelNodeFunctionDeclaration | BabelNodeFunctionExpression | BabelNodeProgram | BabelNodeObjectMethod | BabelNodeSwitchStatement | BabelNodeWhileStatement | BabelNodeArrowFunctionExpression | BabelNodeClassDeclaration | BabelNodeClassExpression | BabelNodeForOfStatement | BabelNodeClassMethod | BabelNodeForAwaitStatement;\n  declare type BabelNodeBlockParent = BabelNodeBlockStatement | BabelNodeDoWhileStatement | BabelNodeForInStatement | BabelNodeForStatement | BabelNodeFunctionDeclaration | BabelNodeFunctionExpression | BabelNodeProgram | BabelNodeObjectMethod | BabelNodeSwitchStatement | BabelNodeWhileStatement | BabelNodeArrowFunctionExpression | BabelNodeForOfStatement | BabelNodeClassMethod | BabelNodeForAwaitStatement;\n  declare type BabelNodeBlock = BabelNodeBlockStatement | BabelNodeProgram;\n  declare type BabelNodeStatement = BabelNodeBlockStatement | BabelNodeBreakStatement | BabelNodeContinueStatement | BabelNodeDebuggerStatement | BabelNodeDoWhileStatement | BabelNodeEmptyStatement | BabelNodeExpressionStatement | BabelNodeForInStatement | BabelNodeForStatement | BabelNodeFunctionDeclaration | BabelNodeIfStatement | BabelNodeLabeledStatement | BabelNodeReturnStatement | BabelNodeSwitchStatement | BabelNodeThrowStatement | BabelNodeTryStatement | BabelNodeVariableDeclaration | BabelNodeWhileStatement | BabelNodeWithStatement | BabelNodeClassDeclaration | BabelNodeExportAllDeclaration | BabelNodeExportDefaultDeclaration | BabelNodeExportNamedDeclaration | BabelNodeForOfStatement | BabelNodeImportDeclaration | BabelNodeDeclareClass | BabelNodeDeclareFunction | BabelNodeDeclareInterface | BabelNodeDeclareModule | BabelNodeDeclareModuleExports | BabelNodeDeclareTypeAlias | BabelNodeDeclareVariable | BabelNodeInterfaceDeclaration | BabelNodeTypeAlias | BabelNodeForAwaitStatement;\n  declare type BabelNodeTerminatorless = BabelNodeBreakStatement | BabelNodeContinueStatement | BabelNodeReturnStatement | BabelNodeThrowStatement | BabelNodeYieldExpression | BabelNodeAwaitExpression;\n  declare type BabelNodeCompletionStatement = BabelNodeBreakStatement | BabelNodeContinueStatement | BabelNodeReturnStatement | BabelNodeThrowStatement;\n  declare type BabelNodeConditional = BabelNodeConditionalExpression | BabelNodeIfStatement;\n  declare type BabelNodeLoop = BabelNodeDoWhileStatement | BabelNodeForInStatement | BabelNodeForStatement | BabelNodeWhileStatement | BabelNodeForOfStatement | BabelNodeForAwaitStatement;\n  declare type BabelNodeWhile = BabelNodeDoWhileStatement | BabelNodeWhileStatement;\n  declare type BabelNodeExpressionWrapper = BabelNodeExpressionStatement | BabelNodeTypeCastExpression | BabelNodeParenthesizedExpression;\n  declare type BabelNodeFor = BabelNodeForInStatement | BabelNodeForStatement | BabelNodeForOfStatement | BabelNodeForAwaitStatement;\n  declare type BabelNodeForXStatement = BabelNodeForInStatement | BabelNodeForOfStatement | BabelNodeForAwaitStatement;\n  declare type BabelNodeFunction = BabelNodeFunctionDeclaration | BabelNodeFunctionExpression | BabelNodeObjectMethod | BabelNodeArrowFunctionExpression | BabelNodeClassMethod;\n  declare type BabelNodeFunctionParent = BabelNodeFunctionDeclaration | BabelNodeFunctionExpression | BabelNodeProgram | BabelNodeObjectMethod | BabelNodeArrowFunctionExpression | BabelNodeClassMethod;\n  declare type BabelNodePureish = BabelNodeFunctionDeclaration | BabelNodeFunctionExpression | BabelNodeStringLiteral | BabelNodeNumericLiteral | BabelNodeNullLiteral | BabelNodeBooleanLiteral | BabelNodeArrowFunctionExpression | BabelNodeClassDeclaration | BabelNodeClassExpression;\n  declare type BabelNodeDeclaration = BabelNodeFunctionDeclaration | BabelNodeVariableDeclaration | BabelNodeClassDeclaration | BabelNodeExportAllDeclaration | BabelNodeExportDefaultDeclaration | BabelNodeExportNamedDeclaration | BabelNodeImportDeclaration | BabelNodeDeclareClass | BabelNodeDeclareFunction | BabelNodeDeclareInterface | BabelNodeDeclareModule | BabelNodeDeclareModuleExports | BabelNodeDeclareTypeAlias | BabelNodeDeclareVariable | BabelNodeInterfaceDeclaration | BabelNodeTypeAlias;\n  declare type BabelNodeLVal = BabelNodeIdentifier | BabelNodeMemberExpression | BabelNodeRestElement | BabelNodeAssignmentPattern | BabelNodeArrayPattern | BabelNodeObjectPattern;\n  declare type BabelNodeLiteral = BabelNodeStringLiteral | BabelNodeNumericLiteral | BabelNodeNullLiteral | BabelNodeBooleanLiteral | BabelNodeRegExpLiteral | BabelNodeTemplateLiteral;\n  declare type BabelNodeImmutable = BabelNodeStringLiteral | BabelNodeNumericLiteral | BabelNodeNullLiteral | BabelNodeBooleanLiteral | BabelNodeJSXAttribute | BabelNodeJSXClosingElement | BabelNodeJSXElement | BabelNodeJSXExpressionContainer | BabelNodeJSXOpeningElement | BabelNodeJSXText;\n  declare type BabelNodeUserWhitespacable = BabelNodeObjectMethod | BabelNodeObjectProperty | BabelNodeObjectTypeCallProperty | BabelNodeObjectTypeIndexer | BabelNodeObjectTypeProperty;\n  declare type BabelNodeMethod = BabelNodeObjectMethod | BabelNodeClassMethod;\n  declare type BabelNodeObjectMember = BabelNodeObjectMethod | BabelNodeObjectProperty;\n  declare type BabelNodeProperty = BabelNodeObjectProperty | BabelNodeClassProperty;\n  declare type BabelNodeUnaryLike = BabelNodeUnaryExpression | BabelNodeSpreadElement | BabelNodeRestProperty;\n  declare type BabelNodePattern = BabelNodeAssignmentPattern | BabelNodeArrayPattern | BabelNodeObjectPattern | BabelNodeRestElement;\n  declare type BabelNodeClass = BabelNodeClassDeclaration | BabelNodeClassExpression;\n  declare type BabelNodeModuleDeclaration = BabelNodeExportAllDeclaration | BabelNodeExportDefaultDeclaration | BabelNodeExportNamedDeclaration | BabelNodeImportDeclaration;\n  declare type BabelNodeExportDeclaration = BabelNodeExportAllDeclaration | BabelNodeExportDefaultDeclaration | BabelNodeExportNamedDeclaration;\n  declare type BabelNodeModuleSpecifier = BabelNodeExportSpecifier | BabelNodeImportDefaultSpecifier | BabelNodeImportNamespaceSpecifier | BabelNodeImportSpecifier | BabelNodeExportDefaultSpecifier | BabelNodeExportNamespaceSpecifier;\n  declare type BabelNodeFlow = BabelNodeAnyTypeAnnotation | BabelNodeArrayTypeAnnotation | BabelNodeBooleanTypeAnnotation | BabelNodeBooleanLiteralTypeAnnotation | BabelNodeNullLiteralTypeAnnotation | BabelNodeClassImplements | BabelNodeDeclareClass | BabelNodeDeclareFunction | BabelNodeDeclareInterface | BabelNodeDeclareModule | BabelNodeDeclareModuleExports | BabelNodeDeclareTypeAlias | BabelNodeDeclareVariable | BabelNodeExistentialTypeParam | BabelNodeFunctionTypeAnnotation | BabelNodeFunctionTypeParam | BabelNodeGenericTypeAnnotation | BabelNodeInterfaceExtends | BabelNodeInterfaceDeclaration | BabelNodeIntersectionTypeAnnotation | BabelNodeMixedTypeAnnotation | BabelNodeEmptyTypeAnnotation | BabelNodeNullableTypeAnnotation | BabelNodeNumericLiteralTypeAnnotation | BabelNodeNumberTypeAnnotation | BabelNodeStringLiteralTypeAnnotation | BabelNodeStringTypeAnnotation | BabelNodeThisTypeAnnotation | BabelNodeTupleTypeAnnotation | BabelNodeTypeofTypeAnnotation | BabelNodeTypeAlias | BabelNodeTypeAnnotation | BabelNodeTypeCastExpression | BabelNodeTypeParameter | BabelNodeTypeParameterDeclaration | BabelNodeTypeParameterInstantiation | BabelNodeObjectTypeAnnotation | BabelNodeObjectTypeCallProperty | BabelNodeObjectTypeIndexer | BabelNodeObjectTypeProperty | BabelNodeQualifiedTypeIdentifier | BabelNodeUnionTypeAnnotation | BabelNodeVoidTypeAnnotation;\n  declare type BabelNodeFlowBaseAnnotation = BabelNodeAnyTypeAnnotation | BabelNodeBooleanTypeAnnotation | BabelNodeNullLiteralTypeAnnotation | BabelNodeMixedTypeAnnotation | BabelNodeEmptyTypeAnnotation | BabelNodeNumberTypeAnnotation | BabelNodeStringTypeAnnotation | BabelNodeThisTypeAnnotation | BabelNodeVoidTypeAnnotation;\n  declare type BabelNodeFlowDeclaration = BabelNodeDeclareClass | BabelNodeDeclareFunction | BabelNodeDeclareInterface | BabelNodeDeclareModule | BabelNodeDeclareModuleExports | BabelNodeDeclareTypeAlias | BabelNodeDeclareVariable | BabelNodeInterfaceDeclaration | BabelNodeTypeAlias;\n  declare type BabelNodeJSX = BabelNodeJSXAttribute | BabelNodeJSXClosingElement | BabelNodeJSXElement | BabelNodeJSXEmptyExpression | BabelNodeJSXExpressionContainer | BabelNodeJSXIdentifier | BabelNodeJSXMemberExpression | BabelNodeJSXNamespacedName | BabelNodeJSXOpeningElement | BabelNodeJSXSpreadAttribute | BabelNodeJSXText;\n\n  declare function anyTypeAnnotation(): BabelNodeAnyTypeAnnotation;\n  declare function arrayExpression(elements: Array<null | BabelNodeExpression | BabelNodeSpreadElement>): BabelNodeArrayExpression;\n  declare function arrayPattern(elements: Array<BabelNodeExpression>, typeAnnotation: any, decorators?: Array<BabelNodeDecorator>): BabelNodeArrayPattern;\n  declare function arrayTypeAnnotation(elementType: any): BabelNodeArrayTypeAnnotation;\n  declare function arrowFunctionExpression(params: Array<BabelNodeLVal>, body: BabelNodeBlockStatement | BabelNodeExpression, async?: boolean, returnType?: any, typeParameters?: any): BabelNodeArrowFunctionExpression;\n  declare function assignmentExpression(operator: BabelAssignmentOperator, left: BabelNodeLVal, right: BabelNodeExpression): BabelNodeAssignmentExpression;\n  declare function assignmentPattern(left: BabelNodeIdentifier, right: BabelNodeExpression, decorators?: any): BabelNodeAssignmentPattern;\n  declare function awaitExpression(argument: BabelNodeExpression): BabelNodeAwaitExpression;\n  declare function binaryExpression(operator: BabelBinaryOperator, left: BabelNodeExpression, right: BabelNodeExpression): BabelNodeBinaryExpression;\n  declare function bindExpression(object: any, callee: any): BabelNodeBindExpression;\n  declare function blockStatement(body: Array<BabelNodeStatement>, directives?: Array<BabelNodeDirective>): BabelNodeBlockStatement;\n  declare function booleanLiteral(value: boolean): BabelNodeBooleanLiteral;\n  declare function booleanLiteralTypeAnnotation(): BabelNodeBooleanLiteralTypeAnnotation;\n  declare function booleanTypeAnnotation(): BabelNodeBooleanTypeAnnotation;\n  declare function breakStatement(label?: ?BabelNodeIdentifier): BabelNodeBreakStatement;\n  declare function callExpression(callee: BabelNodeExpression, _arguments: Array<BabelNodeExpression | BabelNodeSpreadElement>): BabelNodeCallExpression;\n  declare function catchClause(param: BabelNodeIdentifier, body: BabelNodeBlockStatement): BabelNodeCatchClause;\n  declare function classBody(body: Array<BabelNodeClassMethod | BabelNodeClassProperty>): BabelNodeClassBody;\n  declare function classDeclaration(id: BabelNodeIdentifier, superClass?: ?BabelNodeExpression, body: BabelNodeClassBody, decorators: Array<BabelNodeDecorator>, mixins?: any, typeParameters?: any, superTypeParameters?: any, _implements?: any): BabelNodeClassDeclaration;\n  declare function classExpression(id?: ?BabelNodeIdentifier,  superClass?: ?BabelNodeExpression, body: BabelNodeClassBody, decorators: Array<BabelNodeDecorator>, _implements?: any, mixins?: any, superTypeParameters?: any, typeParameters?: any): BabelNodeClassExpression;\n  declare function classImplements(id: any, typeParameters: any): BabelNodeClassImplements;\n  declare function classMethod(kind: ?(\"get\" | \"set\" | \"method\" | \"constructor\"), key: BabelNodeExpression | BabelNodeIdentifier | BabelNodeLiteral, params: Array<BabelNodeLVal>, body: BabelNodeBlockStatement, computed?: boolean, _static?: boolean, async?: boolean, decorators?: any, generator?: boolean, returnType?: any, typeParameters?: any): BabelNodeClassMethod;\n  declare function classProperty(key: any, value: any, typeAnnotation: any, decorators: any, computed?: boolean): BabelNodeClassProperty;\n  declare function conditionalExpression(test: BabelNodeExpression, consequent: BabelNodeExpression, alternate: BabelNodeExpression): BabelNodeConditionalExpression;\n  declare function continueStatement(label?: ?BabelNodeIdentifier): BabelNodeContinueStatement;\n  declare function debuggerStatement(): BabelNodeDebuggerStatement;\n  declare function declareClass(id: any, typeParameters: any, _extends: any, body: any): BabelNodeDeclareClass;\n  declare function declareFunction(id: any): BabelNodeDeclareFunction;\n  declare function declareInterface(id: any, typeParameters: any, _extends: any, body: any): BabelNodeDeclareInterface;\n  declare function declareModule(id: any, body: any): BabelNodeDeclareModule;\n  declare function declareModuleExports(typeAnnotation: any): BabelNodeDeclareModuleExports;\n  declare function declareTypeAlias(id: any, typeParameters: any, right: any): BabelNodeDeclareTypeAlias;\n  declare function declareVariable(id: any): BabelNodeDeclareVariable;\n  declare function decorator(expression: BabelNodeExpression): BabelNodeDecorator;\n  declare function directive(value: BabelNodeDirectiveLiteral): BabelNodeDirective;\n  declare function directiveLiteral(value: string): BabelNodeDirectiveLiteral;\n  declare function doExpression(body: BabelNodeBlockStatement): BabelNodeDoExpression;\n  declare function doWhileStatement(test: BabelNodeExpression, body: BabelNodeStatement): BabelNodeDoWhileStatement;\n  declare function emptyStatement(): BabelNodeEmptyStatement;\n  declare function emptyTypeAnnotation(): BabelNodeEmptyTypeAnnotation;\n  declare function existentialTypeParam(): BabelNodeExistentialTypeParam;\n  declare function exportAllDeclaration(source: BabelNodeStringLiteral): BabelNodeExportAllDeclaration;\n  declare function exportDefaultDeclaration(declaration: BabelNodeFunctionDeclaration | BabelNodeClassDeclaration | BabelNodeExpression): BabelNodeExportDefaultDeclaration;\n  declare function exportDefaultSpecifier(exported: BabelNodeIdentifier): BabelNodeExportDefaultSpecifier;\n  declare function exportNamedDeclaration(declaration?: ?BabelNodeDeclaration, specifiers: Array<BabelNodeExportSpecifier>, source?: ?BabelNodeStringLiteral): BabelNodeExportNamedDeclaration;\n  declare function exportNamespaceSpecifier(exported: BabelNodeIdentifier): BabelNodeExportNamespaceSpecifier;\n  declare function exportSpecifier(local: BabelNodeIdentifier, exported: BabelNodeIdentifier): BabelNodeExportSpecifier;\n  declare function expressionStatement(expression: BabelNodeExpression): BabelNodeExpressionStatement;\n  declare function file(program: BabelNodeProgram, comments: any, tokens: any): BabelNodeFile;\n  declare function forAwaitStatement(left: BabelNodeVariableDeclaration | BabelNodeLVal, right: BabelNodeExpression, body: BabelNodeStatement): BabelNodeForAwaitStatement;\n  declare function forInStatement(left: BabelNodeVariableDeclaration | BabelNodeLVal, right: BabelNodeExpression, body: BabelNodeStatement): BabelNodeForInStatement;\n  declare function forOfStatement(left: BabelNodeVariableDeclaration | BabelNodeLVal, right: BabelNodeExpression, body: BabelNodeStatement): BabelNodeForOfStatement;\n  declare function forStatement(init?: ?BabelNodeVariableDeclaration | BabelNodeExpression, test?: ?BabelNodeExpression, update?: ?BabelNodeExpression, body: BabelNodeStatement): BabelNodeForStatement;\n  declare function functionDeclaration(id: BabelNodeIdentifier, params: Array<BabelNodeLVal>, body: BabelNodeBlockStatement, generator?: boolean, async?: boolean, returnType?: any, typeParameters?: any): BabelNodeFunctionDeclaration;\n  declare function functionExpression(id?: ?BabelNodeIdentifier, params: Array<BabelNodeLVal>, body: BabelNodeBlockStatement, generator?: boolean, async?: boolean, returnType?: any, typeParameters?: any): BabelNodeFunctionExpression;\n  declare function functionTypeAnnotation(typeParameters: any, params: any, rest: any, returnType: any): BabelNodeFunctionTypeAnnotation;\n  declare function functionTypeParam(name: any, typeAnnotation: any): BabelNodeFunctionTypeParam;\n  declare function genericTypeAnnotation(id: any, typeParameters: any): BabelNodeGenericTypeAnnotation;\n  declare function identifier(name: string, decorators?: Array<BabelNodeDecorator>, typeAnnotation?: any): BabelNodeIdentifier;\n  declare function ifStatement(test: BabelNodeExpression, consequent: BabelNodeStatement, alternate?: ?BabelNodeStatement): BabelNodeIfStatement;\n  declare function importDeclaration(specifiers: any, source: BabelNodeStringLiteral): BabelNodeImportDeclaration;\n  declare function importDefaultSpecifier(local: BabelNodeIdentifier): BabelNodeImportDefaultSpecifier;\n  declare function importNamespaceSpecifier(local: BabelNodeIdentifier): BabelNodeImportNamespaceSpecifier;\n  declare function importSpecifier(local: BabelNodeIdentifier, imported: BabelNodeIdentifier): BabelNodeImportSpecifier;\n  declare function interfaceDeclaration(id: any, typeParameters: any, _extends: any, body: any): BabelNodeInterfaceDeclaration;\n  declare function interfaceExtends(id: any, typeParameters: any): BabelNodeInterfaceExtends;\n  declare function intersectionTypeAnnotation(types: any): BabelNodeIntersectionTypeAnnotation;\n  declare function jSXAttribute(name: BabelNodeJSXIdentifier | BabelNodeJSXNamespacedName, value?: ?BabelNodeJSXElement | BabelNodeStringLiteral | BabelNodeJSXExpressionContainer): BabelNodeJSXAttribute;\n  declare function jSXClosingElement(name: BabelNodeJSXIdentifier | BabelNodeJSXMemberExpression): BabelNodeJSXClosingElement;\n  declare function jSXElement(openingElement: BabelNodeJSXOpeningElement, closingElement?: ?BabelNodeJSXClosingElement, children: any, selfClosing: any): BabelNodeJSXElement;\n  declare function jSXEmptyExpression(): BabelNodeJSXEmptyExpression;\n  declare function jSXExpressionContainer(expression: BabelNodeExpression): BabelNodeJSXExpressionContainer;\n  declare function jSXIdentifier(name: string): BabelNodeJSXIdentifier;\n  declare function jSXMemberExpression(object: BabelNodeJSXMemberExpression | BabelNodeJSXIdentifier, property: BabelNodeJSXIdentifier): BabelNodeJSXMemberExpression;\n  declare function jSXNamespacedName(namespace: BabelNodeJSXIdentifier, name: BabelNodeJSXIdentifier): BabelNodeJSXNamespacedName;\n  declare function jSXOpeningElement(name: BabelNodeJSXIdentifier | BabelNodeJSXMemberExpression, selfClosing?: boolean, attributes: any): BabelNodeJSXOpeningElement;\n  declare function jSXSpreadAttribute(argument: BabelNodeExpression): BabelNodeJSXSpreadAttribute;\n  declare function jSXText(value: string): BabelNodeJSXText;\n  declare function labeledStatement(label: BabelNodeIdentifier, body: BabelNodeStatement): BabelNodeLabeledStatement;\n  declare function logicalExpression(operator: BabelLogicalOperator, left: BabelNodeExpression, right: BabelNodeExpression): BabelNodeLogicalExpression;\n  declare function memberExpression(object: BabelNodeExpression, property: BabelNodeExpression | BabelNodeIdentifier, computed?: boolean): BabelNodeMemberExpression;\n  declare function metaProperty(meta: string, property: string): BabelNodeMetaProperty;\n  declare function mixedTypeAnnotation(): BabelNodeMixedTypeAnnotation;\n  declare function newExpression(callee: BabelNodeExpression, _arguments: Array<BabelNodeExpression>): BabelNodeNewExpression;\n  declare function noop(): BabelNodeNoop;\n  declare function nullLiteral(): BabelNodeNullLiteral;\n  declare function nullLiteralTypeAnnotation(): BabelNodeNullLiteralTypeAnnotation;\n  declare function nullableTypeAnnotation(typeAnnotation: any): BabelNodeNullableTypeAnnotation;\n  declare function numberTypeAnnotation(): BabelNodeNumberTypeAnnotation;\n  declare function numericLiteral(value: number): BabelNodeNumericLiteral;\n  declare function numericLiteralTypeAnnotation(): BabelNodeNumericLiteralTypeAnnotation;\n  declare function objectExpression(properties: Array<BabelNodeObjectMethod | BabelNodeObjectProperty | BabelNodeSpreadElement>): BabelNodeObjectExpression;\n  declare function objectMethod(kind: BabelObjectMethodKind, key: BabelNodeExpression | BabelNodeIdentifier | BabelNodeLiteral, params: Array<BabelNodeLVal>, body: BabelNodeBlockStatement, computed?: boolean, async?: boolean, decorators?: any, generator?: boolean, returnType?: any, typeParameters?: any): BabelNodeObjectMethod;\n  declare function objectPattern(properties: Array<BabelNodeRestProperty | BabelNodeProperty>, typeAnnotation: any, decorators?: Array<BabelNodeDecorator>): BabelNodeObjectPattern;\n  declare function objectProperty(key: BabelNodeExpression | BabelNodeIdentifier | BabelNodeLiteral, value: BabelNodeExpression, computed?: boolean, shorthand?: boolean, decorators: ?Array<BabelNodeDecorator>): BabelNodeObjectProperty;\n  declare function objectTypeAnnotation(properties: any, indexers: any, callProperties: any): BabelNodeObjectTypeAnnotation;\n  declare function objectTypeCallProperty(value: any): BabelNodeObjectTypeCallProperty;\n  declare function objectTypeIndexer(id: any, key: any, value: any): BabelNodeObjectTypeIndexer;\n  declare function objectTypeProperty(key: any, value: any): BabelNodeObjectTypeProperty;\n  declare function parenthesizedExpression(expression: BabelNodeExpression): BabelNodeParenthesizedExpression;\n  declare function program(body: Array<BabelNodeStatement>, directives?: Array<BabelNodeDirective>): BabelNodeProgram;\n  declare function qualifiedTypeIdentifier(id: any, qualification: any): BabelNodeQualifiedTypeIdentifier;\n  declare function regExpLiteral(pattern: string, flags?: string): BabelNodeRegExpLiteral;\n  declare function restElement(argument: BabelNodeLVal, typeAnnotation: any, decorators?: any): BabelNodeRestElement;\n  declare function restProperty(argument: BabelNodeLVal): BabelNodeRestProperty;\n  declare function returnStatement(argument?: ?BabelNodeExpression): BabelNodeReturnStatement;\n  declare function sequenceExpression(expressions: Array<BabelNodeExpression>): BabelNodeSequenceExpression;\n  declare function spreadElement(argument: BabelNodeExpression): BabelNodeSpreadElement;\n  declare function stringLiteral(value: string): BabelNodeStringLiteral;\n  declare function stringLiteralTypeAnnotation(): BabelNodeStringLiteralTypeAnnotation;\n  declare function stringTypeAnnotation(): BabelNodeStringTypeAnnotation;\n  declare function switchCase(test?: ?BabelNodeExpression, consequent: Array<BabelNodeStatement>): BabelNodeSwitchCase;\n  declare function switchStatement(discriminant: BabelNodeExpression, cases: Array<BabelNodeSwitchCase>): BabelNodeSwitchStatement;\n  declare function taggedTemplateExpression(tag: BabelNodeExpression, quasi: BabelNodeTemplateLiteral): BabelNodeTaggedTemplateExpression;\n  declare function templateElement(value: any, tail?: boolean): BabelNodeTemplateElement;\n  declare function templateLiteral(quasis: Array<BabelNodeTemplateLiteral>, expressions: Array<BabelNodeExpression>): BabelNodeTemplateLiteral;\n  declare function thisExpression(): BabelNodeThisExpression;\n  declare function thisTypeAnnotation(): BabelNodeThisTypeAnnotation;\n  declare function throwStatement(argument: BabelNodeExpression): BabelNodeThrowStatement;\n  declare function tryStatement(block: any, handler?: any, finalizer?: ?BabelNodeBlockStatement, body?: ?BabelNodeBlockStatement): BabelNodeTryStatement;\n  declare function tupleTypeAnnotation(types: any): BabelNodeTupleTypeAnnotation;\n  declare function typeAlias(id: any, typeParameters: any, right: any): BabelNodeTypeAlias;\n  declare function typeAnnotation(typeAnnotation: any): BabelNodeTypeAnnotation;\n  declare function typeCastExpression(expression: any, typeAnnotation: any): BabelNodeTypeCastExpression;\n  declare function typeParameter(bound: any): BabelNodeTypeParameter;\n  declare function typeParameterDeclaration(params: any): BabelNodeTypeParameterDeclaration;\n  declare function typeParameterInstantiation(params: any): BabelNodeTypeParameterInstantiation;\n  declare function typeofTypeAnnotation(argument: any): BabelNodeTypeofTypeAnnotation;\n  declare function unaryExpression(operator: BabelUnaryOperator, argument: BabelNodeExpression, prefix?: boolean): BabelNodeUnaryExpression;\n  declare function unionTypeAnnotation(types: any): BabelNodeUnionTypeAnnotation;\n  declare function updateExpression(operator: BabelUpdateOperator, argument: BabelNodeExpression, prefix?: boolean): BabelNodeUpdateExpression;\n  declare function variableDeclaration(kind: BabelVariableKind, declarations: Array<BabelNodeVariableDeclarator>): BabelNodeVariableDeclaration;\n  declare function variableDeclarator(id: BabelNodeLVal, init?: ?BabelNodeExpression): BabelNodeVariableDeclarator;\n  declare function voidTypeAnnotation(): BabelNodeVoidTypeAnnotation;\n  declare function whileStatement(test: BabelNodeExpression, body: BabelNodeStatement): BabelNodeWhileStatement;\n  declare function withStatement(object: BabelNodeExpression, body: BabelNodeStatement): BabelNodeWithStatement;\n  declare function yieldExpression(argument?: ?BabelNodeExpression, delegate?: boolean): BabelNodeYieldExpression;\n\n  declare function isArrayExpression(node: Object, opts?: Object): boolean;\n  declare function isAssignmentExpression(node: Object, opts?: Object): boolean;\n  declare function isBinaryExpression(node: Object, opts?: Object): boolean;\n  declare function isDirective(node: Object, opts?: Object): boolean;\n  declare function isDirectiveLiteral(node: Object, opts?: Object): boolean;\n  declare function isBlockStatement(node: Object, opts?: Object): boolean;\n  declare function isBreakStatement(node: Object, opts?: Object): boolean;\n  declare function isCallExpression(node: Object, opts?: Object): boolean;\n  declare function isCatchClause(node: Object, opts?: Object): boolean;\n  declare function isConditionalExpression(node: Object, opts?: Object): boolean;\n  declare function isContinueStatement(node: Object, opts?: Object): boolean;\n  declare function isDebuggerStatement(node: Object, opts?: Object): boolean;\n  declare function isDoWhileStatement(node: Object, opts?: Object): boolean;\n  declare function isEmptyStatement(node: Object, opts?: Object): boolean;\n  declare function isExpressionStatement(node: Object, opts?: Object): boolean;\n  declare function isFile(node: Object, opts?: Object): boolean;\n  declare function isForInStatement(node: Object, opts?: Object): boolean;\n  declare function isForStatement(node: Object, opts?: Object): boolean;\n  declare function isFunctionDeclaration(node: Object, opts?: Object): boolean;\n  declare function isFunctionExpression(node: Object, opts?: Object): boolean;\n  declare function isIdentifier(node: Object, opts?: Object): boolean;\n  declare function isIfStatement(node: Object, opts?: Object): boolean;\n  declare function isLabeledStatement(node: Object, opts?: Object): boolean;\n  declare function isStringLiteral(node: Object, opts?: Object): boolean;\n  declare function isNumericLiteral(node: Object, opts?: Object): boolean;\n  declare function isNullLiteral(node: Object, opts?: Object): boolean;\n  declare function isBooleanLiteral(node: Object, opts?: Object): boolean;\n  declare function isRegExpLiteral(node: Object, opts?: Object): boolean;\n  declare function isLogicalExpression(node: Object, opts?: Object): boolean;\n  declare function isMemberExpression(node: Object, opts?: Object): boolean;\n  declare function isNewExpression(node: Object, opts?: Object): boolean;\n  declare function isProgram(node: Object, opts?: Object): boolean;\n  declare function isObjectExpression(node: Object, opts?: Object): boolean;\n  declare function isObjectMethod(node: Object, opts?: Object): boolean;\n  declare function isObjectProperty(node: Object, opts?: Object): boolean;\n  declare function isRestElement(node: Object, opts?: Object): boolean;\n  declare function isReturnStatement(node: Object, opts?: Object): boolean;\n  declare function isSequenceExpression(node: Object, opts?: Object): boolean;\n  declare function isSwitchCase(node: Object, opts?: Object): boolean;\n  declare function isSwitchStatement(node: Object, opts?: Object): boolean;\n  declare function isThisExpression(node: Object, opts?: Object): boolean;\n  declare function isThrowStatement(node: Object, opts?: Object): boolean;\n  declare function isTryStatement(node: Object, opts?: Object): boolean;\n  declare function isUnaryExpression(node: Object, opts?: Object): boolean;\n  declare function isUpdateExpression(node: Object, opts?: Object): boolean;\n  declare function isVariableDeclaration(node: Object, opts?: Object): boolean;\n  declare function isVariableDeclarator(node: Object, opts?: Object): boolean;\n  declare function isWhileStatement(node: Object, opts?: Object): boolean;\n  declare function isWithStatement(node: Object, opts?: Object): boolean;\n  declare function isAssignmentPattern(node: Object, opts?: Object): boolean;\n  declare function isArrayPattern(node: Object, opts?: Object): boolean;\n  declare function isArrowFunctionExpression(node: Object, opts?: Object): boolean;\n  declare function isClassBody(node: Object, opts?: Object): boolean;\n  declare function isClassDeclaration(node: Object, opts?: Object): boolean;\n  declare function isClassExpression(node: Object, opts?: Object): boolean;\n  declare function isExportAllDeclaration(node: Object, opts?: Object): boolean;\n  declare function isExportDefaultDeclaration(node: Object, opts?: Object): boolean;\n  declare function isExportNamedDeclaration(node: Object, opts?: Object): boolean;\n  declare function isExportSpecifier(node: Object, opts?: Object): boolean;\n  declare function isForOfStatement(node: Object, opts?: Object): boolean;\n  declare function isImportDeclaration(node: Object, opts?: Object): boolean;\n  declare function isImportDefaultSpecifier(node: Object, opts?: Object): boolean;\n  declare function isImportNamespaceSpecifier(node: Object, opts?: Object): boolean;\n  declare function isImportSpecifier(node: Object, opts?: Object): boolean;\n  declare function isMetaProperty(node: Object, opts?: Object): boolean;\n  declare function isClassMethod(node: Object, opts?: Object): boolean;\n  declare function isObjectPattern(node: Object, opts?: Object): boolean;\n  declare function isSpreadElement(node: Object, opts?: Object): boolean;\n  declare function isSuper(node: Object, opts?: Object): boolean;\n  declare function isTaggedTemplateExpression(node: Object, opts?: Object): boolean;\n  declare function isTemplateElement(node: Object, opts?: Object): boolean;\n  declare function isTemplateLiteral(node: Object, opts?: Object): boolean;\n  declare function isYieldExpression(node: Object, opts?: Object): boolean;\n  declare function isAnyTypeAnnotation(node: Object, opts?: Object): boolean;\n  declare function isArrayTypeAnnotation(node: Object, opts?: Object): boolean;\n  declare function isBooleanTypeAnnotation(node: Object, opts?: Object): boolean;\n  declare function isBooleanLiteralTypeAnnotation(node: Object, opts?: Object): boolean;\n  declare function isNullLiteralTypeAnnotation(node: Object, opts?: Object): boolean;\n  declare function isClassImplements(node: Object, opts?: Object): boolean;\n  declare function isClassProperty(node: Object, opts?: Object): boolean;\n  declare function isDeclareClass(node: Object, opts?: Object): boolean;\n  declare function isDeclareFunction(node: Object, opts?: Object): boolean;\n  declare function isDeclareInterface(node: Object, opts?: Object): boolean;\n  declare function isDeclareModule(node: Object, opts?: Object): boolean;\n  declare function isDeclareModuleExports(node: Object, opts?: Object): boolean;\n  declare function isDeclareTypeAlias(node: Object, opts?: Object): boolean;\n  declare function isDeclareVariable(node: Object, opts?: Object): boolean;\n  declare function isExistentialTypeParam(node: Object, opts?: Object): boolean;\n  declare function isFunctionTypeAnnotation(node: Object, opts?: Object): boolean;\n  declare function isFunctionTypeParam(node: Object, opts?: Object): boolean;\n  declare function isGenericTypeAnnotation(node: Object, opts?: Object): boolean;\n  declare function isInterfaceExtends(node: Object, opts?: Object): boolean;\n  declare function isInterfaceDeclaration(node: Object, opts?: Object): boolean;\n  declare function isIntersectionTypeAnnotation(node: Object, opts?: Object): boolean;\n  declare function isMixedTypeAnnotation(node: Object, opts?: Object): boolean;\n  declare function isEmptyTypeAnnotation(node: Object, opts?: Object): boolean;\n  declare function isNullableTypeAnnotation(node: Object, opts?: Object): boolean;\n  declare function isNumericLiteralTypeAnnotation(node: Object, opts?: Object): boolean;\n  declare function isNumberTypeAnnotation(node: Object, opts?: Object): boolean;\n  declare function isStringLiteralTypeAnnotation(node: Object, opts?: Object): boolean;\n  declare function isStringTypeAnnotation(node: Object, opts?: Object): boolean;\n  declare function isThisTypeAnnotation(node: Object, opts?: Object): boolean;\n  declare function isTupleTypeAnnotation(node: Object, opts?: Object): boolean;\n  declare function isTypeofTypeAnnotation(node: Object, opts?: Object): boolean;\n  declare function isTypeAlias(node: Object, opts?: Object): boolean;\n  declare function isTypeAnnotation(node: Object, opts?: Object): boolean;\n  declare function isTypeCastExpression(node: Object, opts?: Object): boolean;\n  declare function isTypeParameter(node: Object, opts?: Object): boolean;\n  declare function isTypeParameterDeclaration(node: Object, opts?: Object): boolean;\n  declare function isTypeParameterInstantiation(node: Object, opts?: Object): boolean;\n  declare function isObjectTypeAnnotation(node: Object, opts?: Object): boolean;\n  declare function isObjectTypeCallProperty(node: Object, opts?: Object): boolean;\n  declare function isObjectTypeIndexer(node: Object, opts?: Object): boolean;\n  declare function isObjectTypeProperty(node: Object, opts?: Object): boolean;\n  declare function isQualifiedTypeIdentifier(node: Object, opts?: Object): boolean;\n  declare function isUnionTypeAnnotation(node: Object, opts?: Object): boolean;\n  declare function isVoidTypeAnnotation(node: Object, opts?: Object): boolean;\n  declare function isJSXAttribute(node: Object, opts?: Object): boolean;\n  declare function isJSXClosingElement(node: Object, opts?: Object): boolean;\n  declare function isJSXElement(node: Object, opts?: Object): boolean;\n  declare function isJSXEmptyExpression(node: Object, opts?: Object): boolean;\n  declare function isJSXExpressionContainer(node: Object, opts?: Object): boolean;\n  declare function isJSXIdentifier(node: Object, opts?: Object): boolean;\n  declare function isJSXMemberExpression(node: Object, opts?: Object): boolean;\n  declare function isJSXNamespacedName(node: Object, opts?: Object): boolean;\n  declare function isJSXOpeningElement(node: Object, opts?: Object): boolean;\n  declare function isJSXSpreadAttribute(node: Object, opts?: Object): boolean;\n  declare function isJSXText(node: Object, opts?: Object): boolean;\n  declare function isNoop(node: Object, opts?: Object): boolean;\n  declare function isParenthesizedExpression(node: Object, opts?: Object): boolean;\n  declare function isAwaitExpression(node: Object, opts?: Object): boolean;\n  declare function isForAwaitStatement(node: Object, opts?: Object): boolean;\n  declare function isBindExpression(node: Object, opts?: Object): boolean;\n  declare function isDecorator(node: Object, opts?: Object): boolean;\n  declare function isDoExpression(node: Object, opts?: Object): boolean;\n  declare function isExportDefaultSpecifier(node: Object, opts?: Object): boolean;\n  declare function isExportNamespaceSpecifier(node: Object, opts?: Object): boolean;\n  declare function isRestProperty(node: Object, opts?: Object): boolean;\n  declare function isExpression(node: Object, opts?: Object): boolean;\n  declare function isBinary(node: Object, opts?: Object): boolean;\n  declare function isScopable(node: Object, opts?: Object): boolean;\n  declare function isBlockParent(node: Object, opts?: Object): boolean;\n  declare function isBlock(node: Object, opts?: Object): boolean;\n  declare function isStatement(node: Object, opts?: Object): boolean;\n  declare function isTerminatorless(node: Object, opts?: Object): boolean;\n  declare function isCompletionStatement(node: Object, opts?: Object): boolean;\n  declare function isConditional(node: Object, opts?: Object): boolean;\n  declare function isLoop(node: Object, opts?: Object): boolean;\n  declare function isWhile(node: Object, opts?: Object): boolean;\n  declare function isExpressionWrapper(node: Object, opts?: Object): boolean;\n  declare function isFor(node: Object, opts?: Object): boolean;\n  declare function isForXStatement(node: Object, opts?: Object): boolean;\n  declare function isFunction(node: Object, opts?: Object): boolean;\n  declare function isFunctionParent(node: Object, opts?: Object): boolean;\n  declare function isPureish(node: Object, opts?: Object): boolean;\n  declare function isDeclaration(node: Object, opts?: Object): boolean;\n  declare function isLVal(node: Object, opts?: Object): boolean;\n  declare function isLiteral(node: Object, opts?: Object): boolean;\n  declare function isImmutable(node: Object, opts?: Object): boolean;\n  declare function isUserWhitespacable(node: Object, opts?: Object): boolean;\n  declare function isMethod(node: Object, opts?: Object): boolean;\n  declare function isObjectMember(node: Object, opts?: Object): boolean;\n  declare function isProperty(node: Object, opts?: Object): boolean;\n  declare function isUnaryLike(node: Object, opts?: Object): boolean;\n  declare function isPattern(node: Object, opts?: Object): boolean;\n  declare function isClass(node: Object, opts?: Object): boolean;\n  declare function isModuleDeclaration(node: Object, opts?: Object): boolean;\n  declare function isExportDeclaration(node: Object, opts?: Object): boolean;\n  declare function isModuleSpecifier(node: Object, opts?: Object): boolean;\n  declare function isFlow(node: Object, opts?: Object): boolean;\n  declare function isFlowBaseAnnotation(node: Object, opts?: Object): boolean;\n  declare function isFlowDeclaration(node: Object, opts?: Object): boolean;\n  declare function isJSX(node: Object, opts?: Object): boolean;\n  declare function isNumberLiteral(node: Object, opts?: Object): boolean;\n  declare function isRegexLiteral(node: Object, opts?: Object): boolean;\n\n  declare function isValidIdentifier(name: string): boolean;\n  declare function getBindingIdentifiers(\n    node: Object | Array<Object>,\n    duplicates?: boolean,\n    outerOnly?: boolean\n  ): Object;\n  declare function getOuterBindingIdentifiers(\n    node: Object | Array<Object>,\n    duplicates?: boolean,\n  ): Object;\n  declare var VISITOR_KEYS: {[id:string]: Function};\n  declare function valueToNode(value: any): BabelNodeExpression;\n  declare function cloneDeep(node: BabelNode): BabelNode;\n}\n\n\n/**\n * We include stubs for each file inside this npm package in case you need to\n * require those files directly. Feel free to delete any files that aren't\n * needed.\n */\ndeclare module 'babel-types/lib/constants' {\n  declare module.exports: any;\n}\n\ndeclare module 'babel-types/lib/converters' {\n  declare module.exports: any;\n}\n\ndeclare module 'babel-types/lib/definitions/core' {\n  declare module.exports: any;\n}\n\ndeclare module 'babel-types/lib/definitions/es2015' {\n  declare module.exports: any;\n}\n\ndeclare module 'babel-types/lib/definitions/experimental' {\n  declare module.exports: any;\n}\n\ndeclare module 'babel-types/lib/definitions/flow' {\n  declare module.exports: any;\n}\n\ndeclare module 'babel-types/lib/definitions/index' {\n  declare module.exports: any;\n}\n\ndeclare module 'babel-types/lib/definitions/init' {\n  declare module.exports: any;\n}\n\ndeclare module 'babel-types/lib/definitions/jsx' {\n  declare module.exports: any;\n}\n\ndeclare module 'babel-types/lib/definitions/misc' {\n  declare module.exports: any;\n}\n\ndeclare module 'babel-types/lib/flow' {\n  declare module.exports: any;\n}\n\ndeclare module 'babel-types/lib/index' {\n  declare module.exports: any;\n}\n\ndeclare module 'babel-types/lib/react' {\n  declare module.exports: any;\n}\n\ndeclare module 'babel-types/lib/retrievers' {\n  declare module.exports: any;\n}\n\ndeclare module 'babel-types/lib/validators' {\n  declare module.exports: any;\n}\n\n// Filename aliases\ndeclare module 'babel-types/lib/constants.js' {\n  declare module.exports: $Exports<'babel-types/lib/constants'>;\n}\ndeclare module 'babel-types/lib/converters.js' {\n  declare module.exports: $Exports<'babel-types/lib/converters'>;\n}\ndeclare module 'babel-types/lib/definitions/core.js' {\n  declare module.exports: $Exports<'babel-types/lib/definitions/core'>;\n}\ndeclare module 'babel-types/lib/definitions/es2015.js' {\n  declare module.exports: $Exports<'babel-types/lib/definitions/es2015'>;\n}\ndeclare module 'babel-types/lib/definitions/experimental.js' {\n  declare module.exports: $Exports<'babel-types/lib/definitions/experimental'>;\n}\ndeclare module 'babel-types/lib/definitions/flow.js' {\n  declare module.exports: $Exports<'babel-types/lib/definitions/flow'>;\n}\ndeclare module 'babel-types/lib/definitions/index.js' {\n  declare module.exports: $Exports<'babel-types/lib/definitions/index'>;\n}\ndeclare module 'babel-types/lib/definitions/init.js' {\n  declare module.exports: $Exports<'babel-types/lib/definitions/init'>;\n}\ndeclare module 'babel-types/lib/definitions/jsx.js' {\n  declare module.exports: $Exports<'babel-types/lib/definitions/jsx'>;\n}\ndeclare module 'babel-types/lib/definitions/misc.js' {\n  declare module.exports: $Exports<'babel-types/lib/definitions/misc'>;\n}\ndeclare module 'babel-types/lib/flow.js' {\n  declare module.exports: $Exports<'babel-types/lib/flow'>;\n}\ndeclare module 'babel-types/lib/index.js' {\n  declare module.exports: $Exports<'babel-types/lib/index'>;\n}\ndeclare module 'babel-types/lib/react.js' {\n  declare module.exports: $Exports<'babel-types/lib/react'>;\n}\ndeclare module 'babel-types/lib/retrievers.js' {\n  declare module.exports: $Exports<'babel-types/lib/retrievers'>;\n}\ndeclare module 'babel-types/lib/validators.js' {\n  declare module.exports: $Exports<'babel-types/lib/validators'>;\n}\n"
  },
  {
    "path": "flow-typed/npm/babylon_vx.x.x.js",
    "content": "// flow-typed signature: ce9e068371b15477711e7cc8b3aba7da\n// flow-typed version: <<STUB>>/babylon_v^6.5.2/flow_v0.38.0\n\n/**\n * This is an autogenerated libdef stub for:\n *\n *   'babylon'\n *\n * Fill this stub out by replacing all the `any` types.\n *\n * Once filled out, we encourage you to share your work with the \n * community by sending a pull request to: \n * https://github.com/flowtype/flow-typed\n */\n\ndeclare module 'babylon' {\n  declare module.exports: any;\n}\n\n/**\n * We include stubs for each file inside this npm package in case you need to\n * require those files directly. Feel free to delete any files that aren't\n * needed.\n */\ndeclare module 'babylon/bin/babylon' {\n  declare module.exports: any;\n}\n\ndeclare module 'babylon/bin/generate-identifier-regex' {\n  declare module.exports: any;\n}\n\ndeclare module 'babylon/lib/index' {\n  declare module.exports: any;\n}\n\n// Filename aliases\ndeclare module 'babylon/bin/babylon.js' {\n  declare module.exports: $Exports<'babylon/bin/babylon'>;\n}\ndeclare module 'babylon/bin/generate-identifier-regex.js' {\n  declare module.exports: $Exports<'babylon/bin/generate-identifier-regex'>;\n}\ndeclare module 'babylon/lib/index.js' {\n  declare module.exports: $Exports<'babylon/lib/index'>;\n}\n"
  },
  {
    "path": "flow-typed/npm/chalk_v1.x.x.js",
    "content": "// flow-typed signature: f965116cdb881170be8c42b10554e195\n// flow-typed version: da30fe6876/chalk_v1.x.x/flow_>=v0.25.x\n\ntype $npm$chalk$StyleElement = {\n  open: string,\n  close: string\n};\n\ntype $npm$chalk$Chain = $npm$chalk$Style & ((...text: any[]) => string);\n\ntype $npm$chalk$Style = {\n  // General\n  reset: $npm$chalk$Chain,\n  bold: $npm$chalk$Chain,\n  dim: $npm$chalk$Chain,\n  italic: $npm$chalk$Chain,\n  underline: $npm$chalk$Chain,\n  inverse: $npm$chalk$Chain,\n  strikethrough: $npm$chalk$Chain,\n\n  // Text colors\n  black: $npm$chalk$Chain,\n  red: $npm$chalk$Chain,\n  green: $npm$chalk$Chain,\n  yellow: $npm$chalk$Chain,\n  blue: $npm$chalk$Chain,\n  magenta: $npm$chalk$Chain,\n  cyan: $npm$chalk$Chain,\n  white: $npm$chalk$Chain,\n  gray: $npm$chalk$Chain,\n  grey: $npm$chalk$Chain,\n\n  // Background colors\n  bgBlack: $npm$chalk$Chain,\n  bgRed: $npm$chalk$Chain,\n  bgGreen: $npm$chalk$Chain,\n  bgYellow: $npm$chalk$Chain,\n  bgBlue: $npm$chalk$Chain,\n  bgMagenta: $npm$chalk$Chain,\n  bgCyan: $npm$chalk$Chain,\n  bgWhite: $npm$chalk$Chain\n};\n\ntype $npm$chalk$StyleMap = {\n  // General\n  reset: $npm$chalk$StyleElement,\n  bold: $npm$chalk$StyleElement,\n  dim: $npm$chalk$StyleElement,\n  italic: $npm$chalk$StyleElement,\n  underline: $npm$chalk$StyleElement,\n  inverse: $npm$chalk$StyleElement,\n  strikethrough: $npm$chalk$StyleElement,\n\n  // Text colors\n  black: $npm$chalk$StyleElement,\n  red: $npm$chalk$StyleElement,\n  green: $npm$chalk$StyleElement,\n  yellow: $npm$chalk$StyleElement,\n  blue: $npm$chalk$StyleElement,\n  magenta: $npm$chalk$StyleElement,\n  cyan: $npm$chalk$StyleElement,\n  white: $npm$chalk$StyleElement,\n  gray: $npm$chalk$StyleElement,\n\n  // Background colors\n  bgBlack: $npm$chalk$StyleElement,\n  bgRed: $npm$chalk$StyleElement,\n  bgGreen: $npm$chalk$StyleElement,\n  bgYellow: $npm$chalk$StyleElement,\n  bgBlue: $npm$chalk$StyleElement,\n  bgMagenta: $npm$chalk$StyleElement,\n  bgCyan: $npm$chalk$StyleElement,\n  bgWhite: $npm$chalk$StyleElement\n};\n\ndeclare module \"chalk\" {\n  declare var enabled: boolean;\n  declare var supportsColor: boolean;\n  declare var styles: $npm$chalk$StyleMap;\n\n  declare function stripColor(value: string): any;\n  declare function hasColor(str: string): boolean;\n\n  // General\n  declare var reset: $npm$chalk$Chain;\n  declare var bold: $npm$chalk$Chain;\n  declare var dim: $npm$chalk$Chain;\n  declare var italic: $npm$chalk$Chain;\n  declare var underline: $npm$chalk$Chain;\n  declare var inverse: $npm$chalk$Chain;\n  declare var strikethrough: $npm$chalk$Chain;\n\n  // Text colors\n  declare var black: $npm$chalk$Chain;\n  declare var red: $npm$chalk$Chain;\n  declare var green: $npm$chalk$Chain;\n  declare var yellow: $npm$chalk$Chain;\n  declare var blue: $npm$chalk$Chain;\n  declare var magenta: $npm$chalk$Chain;\n  declare var cyan: $npm$chalk$Chain;\n  declare var white: $npm$chalk$Chain;\n  declare var gray: $npm$chalk$Chain;\n  declare var grey: $npm$chalk$Chain;\n\n  // Background colors\n  declare var bgBlack: $npm$chalk$Chain;\n  declare var bgRed: $npm$chalk$Chain;\n  declare var bgGreen: $npm$chalk$Chain;\n  declare var bgYellow: $npm$chalk$Chain;\n  declare var bgBlue: $npm$chalk$Chain;\n  declare var bgMagenta: $npm$chalk$Chain;\n  declare var bgCyan: $npm$chalk$Chain;\n  declare var bgWhite: $npm$chalk$Chain;\n}\n"
  },
  {
    "path": "flow-typed/npm/eslint-config-kittens_vx.x.x.js",
    "content": "// flow-typed signature: 4cb0251c6b76a7114e3fcf5df235a05d\n// flow-typed version: <<STUB>>/eslint-config-kittens_v^1.0.5/flow_v0.25.0\n\n/**\n * This is an autogenerated libdef stub for:\n *\n *   'eslint-config-kittens'\n *\n * Fill this stub out by replacing all the `any` types.\n *\n * Once filled out, we encourage you to share your work with the \n * community by sending a pull request to: \n * https://github.com/flowtype/flow-typed\n */\n\ndeclare module 'eslint-config-kittens' {\n  declare module.exports: any;\n}\n\n/**\n * We include stubs for each file inside this npm package in case you need to\n * require those files directly. Feel free to delete any files that aren't\n * needed.\n */\n\n\n// Filename aliases\ndeclare module 'eslint-config-kittens/index' {\n  declare module.exports: $Exports<'eslint-config-kittens'>;\n}\ndeclare module 'eslint-config-kittens/index.js' {\n  declare module.exports: $Exports<'eslint-config-kittens'>;\n}\n"
  },
  {
    "path": "flow-typed/npm/eslint-plugin-babel_vx.x.x.js",
    "content": "// flow-typed signature: 39d8e3656d5637c82acf64987fba7b5e\n// flow-typed version: <<STUB>>/eslint-plugin-babel_v^3.3.0/flow_v0.76.0\n\n/**\n * This is an autogenerated libdef stub for:\n *\n *   'eslint-plugin-babel'\n *\n * Fill this stub out by replacing all the `any` types.\n *\n * Once filled out, we encourage you to share your work with the\n * community by sending a pull request to:\n * https://github.com/flowtype/flow-typed\n */\n\ndeclare module 'eslint-plugin-babel' {\n  declare module.exports: any;\n}\n\n/**\n * We include stubs for each file inside this npm package in case you need to\n * require those files directly. Feel free to delete any files that aren't\n * needed.\n */\ndeclare module 'eslint-plugin-babel/rules/array-bracket-spacing' {\n  declare module.exports: any;\n}\n\ndeclare module 'eslint-plugin-babel/rules/arrow-parens' {\n  declare module.exports: any;\n}\n\ndeclare module 'eslint-plugin-babel/rules/flow-object-type' {\n  declare module.exports: any;\n}\n\ndeclare module 'eslint-plugin-babel/rules/func-params-comma-dangle' {\n  declare module.exports: any;\n}\n\ndeclare module 'eslint-plugin-babel/rules/generator-star-spacing' {\n  declare module.exports: any;\n}\n\ndeclare module 'eslint-plugin-babel/rules/new-cap' {\n  declare module.exports: any;\n}\n\ndeclare module 'eslint-plugin-babel/rules/no-await-in-loop' {\n  declare module.exports: any;\n}\n\ndeclare module 'eslint-plugin-babel/rules/object-curly-spacing' {\n  declare module.exports: any;\n}\n\ndeclare module 'eslint-plugin-babel/rules/object-shorthand' {\n  declare module.exports: any;\n}\n\ndeclare module 'eslint-plugin-babel/tests/array-bracket-spacing' {\n  declare module.exports: any;\n}\n\ndeclare module 'eslint-plugin-babel/tests/arrow-parens' {\n  declare module.exports: any;\n}\n\ndeclare module 'eslint-plugin-babel/tests/flow-object-type' {\n  declare module.exports: any;\n}\n\ndeclare module 'eslint-plugin-babel/tests/func-params-comma-dangle' {\n  declare module.exports: any;\n}\n\ndeclare module 'eslint-plugin-babel/tests/generator-star-spacing' {\n  declare module.exports: any;\n}\n\ndeclare module 'eslint-plugin-babel/tests/new-cap' {\n  declare module.exports: any;\n}\n\ndeclare module 'eslint-plugin-babel/tests/no-await-in-loop' {\n  declare module.exports: any;\n}\n\ndeclare module 'eslint-plugin-babel/tests/object-curly-spacing' {\n  declare module.exports: any;\n}\n\ndeclare module 'eslint-plugin-babel/tests/object-shorthand' {\n  declare module.exports: any;\n}\n\n// Filename aliases\ndeclare module 'eslint-plugin-babel/index' {\n  declare module.exports: $Exports<'eslint-plugin-babel'>;\n}\ndeclare module 'eslint-plugin-babel/index.js' {\n  declare module.exports: $Exports<'eslint-plugin-babel'>;\n}\ndeclare module 'eslint-plugin-babel/rules/array-bracket-spacing.js' {\n  declare module.exports: $Exports<'eslint-plugin-babel/rules/array-bracket-spacing'>;\n}\ndeclare module 'eslint-plugin-babel/rules/arrow-parens.js' {\n  declare module.exports: $Exports<'eslint-plugin-babel/rules/arrow-parens'>;\n}\ndeclare module 'eslint-plugin-babel/rules/flow-object-type.js' {\n  declare module.exports: $Exports<'eslint-plugin-babel/rules/flow-object-type'>;\n}\ndeclare module 'eslint-plugin-babel/rules/func-params-comma-dangle.js' {\n  declare module.exports: $Exports<'eslint-plugin-babel/rules/func-params-comma-dangle'>;\n}\ndeclare module 'eslint-plugin-babel/rules/generator-star-spacing.js' {\n  declare module.exports: $Exports<'eslint-plugin-babel/rules/generator-star-spacing'>;\n}\ndeclare module 'eslint-plugin-babel/rules/new-cap.js' {\n  declare module.exports: $Exports<'eslint-plugin-babel/rules/new-cap'>;\n}\ndeclare module 'eslint-plugin-babel/rules/no-await-in-loop.js' {\n  declare module.exports: $Exports<'eslint-plugin-babel/rules/no-await-in-loop'>;\n}\ndeclare module 'eslint-plugin-babel/rules/object-curly-spacing.js' {\n  declare module.exports: $Exports<'eslint-plugin-babel/rules/object-curly-spacing'>;\n}\ndeclare module 'eslint-plugin-babel/rules/object-shorthand.js' {\n  declare module.exports: $Exports<'eslint-plugin-babel/rules/object-shorthand'>;\n}\ndeclare module 'eslint-plugin-babel/tests/array-bracket-spacing.js' {\n  declare module.exports: $Exports<'eslint-plugin-babel/tests/array-bracket-spacing'>;\n}\ndeclare module 'eslint-plugin-babel/tests/arrow-parens.js' {\n  declare module.exports: $Exports<'eslint-plugin-babel/tests/arrow-parens'>;\n}\ndeclare module 'eslint-plugin-babel/tests/flow-object-type.js' {\n  declare module.exports: $Exports<'eslint-plugin-babel/tests/flow-object-type'>;\n}\ndeclare module 'eslint-plugin-babel/tests/func-params-comma-dangle.js' {\n  declare module.exports: $Exports<'eslint-plugin-babel/tests/func-params-comma-dangle'>;\n}\ndeclare module 'eslint-plugin-babel/tests/generator-star-spacing.js' {\n  declare module.exports: $Exports<'eslint-plugin-babel/tests/generator-star-spacing'>;\n}\ndeclare module 'eslint-plugin-babel/tests/new-cap.js' {\n  declare module.exports: $Exports<'eslint-plugin-babel/tests/new-cap'>;\n}\ndeclare module 'eslint-plugin-babel/tests/no-await-in-loop.js' {\n  declare module.exports: $Exports<'eslint-plugin-babel/tests/no-await-in-loop'>;\n}\ndeclare module 'eslint-plugin-babel/tests/object-curly-spacing.js' {\n  declare module.exports: $Exports<'eslint-plugin-babel/tests/object-curly-spacing'>;\n}\ndeclare module 'eslint-plugin-babel/tests/object-shorthand.js' {\n  declare module.exports: $Exports<'eslint-plugin-babel/tests/object-shorthand'>;\n}\n"
  },
  {
    "path": "flow-typed/npm/eslint-plugin-flow-header_vx.x.x.js",
    "content": "// flow-typed signature: 14f33c04f690dde93b4cc43045e81b6b\n// flow-typed version: <<STUB>>/eslint-plugin-flow-header_v^0.1.1/flow_v0.76.0\n\n/**\n * This is an autogenerated libdef stub for:\n *\n *   'eslint-plugin-flow-header'\n *\n * Fill this stub out by replacing all the `any` types.\n *\n * Once filled out, we encourage you to share your work with the\n * community by sending a pull request to:\n * https://github.com/flowtype/flow-typed\n */\n\ndeclare module 'eslint-plugin-flow-header' {\n  declare module.exports: any;\n}\n\n/**\n * We include stubs for each file inside this npm package in case you need to\n * require those files directly. Feel free to delete any files that aren't\n * needed.\n */\ndeclare module 'eslint-plugin-flow-header/lib/index' {\n  declare module.exports: any;\n}\n\ndeclare module 'eslint-plugin-flow-header/lib/rules/flow-header' {\n  declare module.exports: any;\n}\n\ndeclare module 'eslint-plugin-flow-header/tests/lib/rules/flow-header' {\n  declare module.exports: any;\n}\n\n// Filename aliases\ndeclare module 'eslint-plugin-flow-header/lib/index.js' {\n  declare module.exports: $Exports<'eslint-plugin-flow-header/lib/index'>;\n}\ndeclare module 'eslint-plugin-flow-header/lib/rules/flow-header.js' {\n  declare module.exports: $Exports<'eslint-plugin-flow-header/lib/rules/flow-header'>;\n}\ndeclare module 'eslint-plugin-flow-header/tests/lib/rules/flow-header.js' {\n  declare module.exports: $Exports<'eslint-plugin-flow-header/tests/lib/rules/flow-header'>;\n}\n"
  },
  {
    "path": "flow-typed/npm/eslint-plugin-flowtype_vx.x.x.js",
    "content": "// flow-typed signature: fac94262a2bf7f7b11e84411804f8fa6\n// flow-typed version: <<STUB>>/eslint-plugin-flowtype_v^2.40.0/flow_v0.76.0\n\n/**\n * This is an autogenerated libdef stub for:\n *\n *   'eslint-plugin-flowtype'\n *\n * Fill this stub out by replacing all the `any` types.\n *\n * Once filled out, we encourage you to share your work with the\n * community by sending a pull request to:\n * https://github.com/flowtype/flow-typed\n */\n\ndeclare module 'eslint-plugin-flowtype' {\n  declare module.exports: any;\n}\n\n/**\n * We include stubs for each file inside this npm package in case you need to\n * require those files directly. Feel free to delete any files that aren't\n * needed.\n */\ndeclare module 'eslint-plugin-flowtype/bin/readmeAssertions' {\n  declare module.exports: any;\n}\n\ndeclare module 'eslint-plugin-flowtype/dist/index' {\n  declare module.exports: any;\n}\n\ndeclare module 'eslint-plugin-flowtype/dist/rules/booleanStyle' {\n  declare module.exports: any;\n}\n\ndeclare module 'eslint-plugin-flowtype/dist/rules/defineFlowType' {\n  declare module.exports: any;\n}\n\ndeclare module 'eslint-plugin-flowtype/dist/rules/delimiterDangle' {\n  declare module.exports: any;\n}\n\ndeclare module 'eslint-plugin-flowtype/dist/rules/genericSpacing' {\n  declare module.exports: any;\n}\n\ndeclare module 'eslint-plugin-flowtype/dist/rules/newlineAfterFlowAnnotation' {\n  declare module.exports: any;\n}\n\ndeclare module 'eslint-plugin-flowtype/dist/rules/noDupeKeys' {\n  declare module.exports: any;\n}\n\ndeclare module 'eslint-plugin-flowtype/dist/rules/noExistentialType' {\n  declare module.exports: any;\n}\n\ndeclare module 'eslint-plugin-flowtype/dist/rules/noFlowFixMeComments' {\n  declare module.exports: any;\n}\n\ndeclare module 'eslint-plugin-flowtype/dist/rules/noMutableArray' {\n  declare module.exports: any;\n}\n\ndeclare module 'eslint-plugin-flowtype/dist/rules/noPrimitiveConstructorTypes' {\n  declare module.exports: any;\n}\n\ndeclare module 'eslint-plugin-flowtype/dist/rules/noTypesMissingFileAnnotation' {\n  declare module.exports: any;\n}\n\ndeclare module 'eslint-plugin-flowtype/dist/rules/noUnusedExpressions' {\n  declare module.exports: any;\n}\n\ndeclare module 'eslint-plugin-flowtype/dist/rules/noWeakTypes' {\n  declare module.exports: any;\n}\n\ndeclare module 'eslint-plugin-flowtype/dist/rules/objectTypeDelimiter' {\n  declare module.exports: any;\n}\n\ndeclare module 'eslint-plugin-flowtype/dist/rules/requireExactType' {\n  declare module.exports: any;\n}\n\ndeclare module 'eslint-plugin-flowtype/dist/rules/requireParameterType' {\n  declare module.exports: any;\n}\n\ndeclare module 'eslint-plugin-flowtype/dist/rules/requireReturnType' {\n  declare module.exports: any;\n}\n\ndeclare module 'eslint-plugin-flowtype/dist/rules/requireTypesAtTop' {\n  declare module.exports: any;\n}\n\ndeclare module 'eslint-plugin-flowtype/dist/rules/requireValidFileAnnotation' {\n  declare module.exports: any;\n}\n\ndeclare module 'eslint-plugin-flowtype/dist/rules/requireVariableType' {\n  declare module.exports: any;\n}\n\ndeclare module 'eslint-plugin-flowtype/dist/rules/semi' {\n  declare module.exports: any;\n}\n\ndeclare module 'eslint-plugin-flowtype/dist/rules/sortKeys' {\n  declare module.exports: any;\n}\n\ndeclare module 'eslint-plugin-flowtype/dist/rules/spaceAfterTypeColon' {\n  declare module.exports: any;\n}\n\ndeclare module 'eslint-plugin-flowtype/dist/rules/spaceBeforeGenericBracket' {\n  declare module.exports: any;\n}\n\ndeclare module 'eslint-plugin-flowtype/dist/rules/spaceBeforeTypeColon' {\n  declare module.exports: any;\n}\n\ndeclare module 'eslint-plugin-flowtype/dist/rules/typeColonSpacing/evaluateFunctions' {\n  declare module.exports: any;\n}\n\ndeclare module 'eslint-plugin-flowtype/dist/rules/typeColonSpacing/evaluateObjectTypeIndexer' {\n  declare module.exports: any;\n}\n\ndeclare module 'eslint-plugin-flowtype/dist/rules/typeColonSpacing/evaluateObjectTypeProperty' {\n  declare module.exports: any;\n}\n\ndeclare module 'eslint-plugin-flowtype/dist/rules/typeColonSpacing/evaluateReturnType' {\n  declare module.exports: any;\n}\n\ndeclare module 'eslint-plugin-flowtype/dist/rules/typeColonSpacing/evaluateTypeCastExpression' {\n  declare module.exports: any;\n}\n\ndeclare module 'eslint-plugin-flowtype/dist/rules/typeColonSpacing/evaluateTypical' {\n  declare module.exports: any;\n}\n\ndeclare module 'eslint-plugin-flowtype/dist/rules/typeColonSpacing/index' {\n  declare module.exports: any;\n}\n\ndeclare module 'eslint-plugin-flowtype/dist/rules/typeColonSpacing/reporter' {\n  declare module.exports: any;\n}\n\ndeclare module 'eslint-plugin-flowtype/dist/rules/typeIdMatch' {\n  declare module.exports: any;\n}\n\ndeclare module 'eslint-plugin-flowtype/dist/rules/typeImportStyle' {\n  declare module.exports: any;\n}\n\ndeclare module 'eslint-plugin-flowtype/dist/rules/unionIntersectionSpacing' {\n  declare module.exports: any;\n}\n\ndeclare module 'eslint-plugin-flowtype/dist/rules/useFlowType' {\n  declare module.exports: any;\n}\n\ndeclare module 'eslint-plugin-flowtype/dist/rules/validSyntax' {\n  declare module.exports: any;\n}\n\ndeclare module 'eslint-plugin-flowtype/dist/utilities/checkFlowFileAnnotation' {\n  declare module.exports: any;\n}\n\ndeclare module 'eslint-plugin-flowtype/dist/utilities/fuzzyStringMatch' {\n  declare module.exports: any;\n}\n\ndeclare module 'eslint-plugin-flowtype/dist/utilities/getParameterName' {\n  declare module.exports: any;\n}\n\ndeclare module 'eslint-plugin-flowtype/dist/utilities/getTokenAfterParens' {\n  declare module.exports: any;\n}\n\ndeclare module 'eslint-plugin-flowtype/dist/utilities/getTokenBeforeParens' {\n  declare module.exports: any;\n}\n\ndeclare module 'eslint-plugin-flowtype/dist/utilities/index' {\n  declare module.exports: any;\n}\n\ndeclare module 'eslint-plugin-flowtype/dist/utilities/isFlowFile' {\n  declare module.exports: any;\n}\n\ndeclare module 'eslint-plugin-flowtype/dist/utilities/isFlowFileAnnotation' {\n  declare module.exports: any;\n}\n\ndeclare module 'eslint-plugin-flowtype/dist/utilities/iterateFunctionNodes' {\n  declare module.exports: any;\n}\n\ndeclare module 'eslint-plugin-flowtype/dist/utilities/quoteName' {\n  declare module.exports: any;\n}\n\ndeclare module 'eslint-plugin-flowtype/dist/utilities/spacingFixers' {\n  declare module.exports: any;\n}\n\n// Filename aliases\ndeclare module 'eslint-plugin-flowtype/bin/readmeAssertions.js' {\n  declare module.exports: $Exports<'eslint-plugin-flowtype/bin/readmeAssertions'>;\n}\ndeclare module 'eslint-plugin-flowtype/dist/index.js' {\n  declare module.exports: $Exports<'eslint-plugin-flowtype/dist/index'>;\n}\ndeclare module 'eslint-plugin-flowtype/dist/rules/booleanStyle.js' {\n  declare module.exports: $Exports<'eslint-plugin-flowtype/dist/rules/booleanStyle'>;\n}\ndeclare module 'eslint-plugin-flowtype/dist/rules/defineFlowType.js' {\n  declare module.exports: $Exports<'eslint-plugin-flowtype/dist/rules/defineFlowType'>;\n}\ndeclare module 'eslint-plugin-flowtype/dist/rules/delimiterDangle.js' {\n  declare module.exports: $Exports<'eslint-plugin-flowtype/dist/rules/delimiterDangle'>;\n}\ndeclare module 'eslint-plugin-flowtype/dist/rules/genericSpacing.js' {\n  declare module.exports: $Exports<'eslint-plugin-flowtype/dist/rules/genericSpacing'>;\n}\ndeclare module 'eslint-plugin-flowtype/dist/rules/newlineAfterFlowAnnotation.js' {\n  declare module.exports: $Exports<'eslint-plugin-flowtype/dist/rules/newlineAfterFlowAnnotation'>;\n}\ndeclare module 'eslint-plugin-flowtype/dist/rules/noDupeKeys.js' {\n  declare module.exports: $Exports<'eslint-plugin-flowtype/dist/rules/noDupeKeys'>;\n}\ndeclare module 'eslint-plugin-flowtype/dist/rules/noExistentialType.js' {\n  declare module.exports: $Exports<'eslint-plugin-flowtype/dist/rules/noExistentialType'>;\n}\ndeclare module 'eslint-plugin-flowtype/dist/rules/noFlowFixMeComments.js' {\n  declare module.exports: $Exports<'eslint-plugin-flowtype/dist/rules/noFlowFixMeComments'>;\n}\ndeclare module 'eslint-plugin-flowtype/dist/rules/noMutableArray.js' {\n  declare module.exports: $Exports<'eslint-plugin-flowtype/dist/rules/noMutableArray'>;\n}\ndeclare module 'eslint-plugin-flowtype/dist/rules/noPrimitiveConstructorTypes.js' {\n  declare module.exports: $Exports<'eslint-plugin-flowtype/dist/rules/noPrimitiveConstructorTypes'>;\n}\ndeclare module 'eslint-plugin-flowtype/dist/rules/noTypesMissingFileAnnotation.js' {\n  declare module.exports: $Exports<'eslint-plugin-flowtype/dist/rules/noTypesMissingFileAnnotation'>;\n}\ndeclare module 'eslint-plugin-flowtype/dist/rules/noUnusedExpressions.js' {\n  declare module.exports: $Exports<'eslint-plugin-flowtype/dist/rules/noUnusedExpressions'>;\n}\ndeclare module 'eslint-plugin-flowtype/dist/rules/noWeakTypes.js' {\n  declare module.exports: $Exports<'eslint-plugin-flowtype/dist/rules/noWeakTypes'>;\n}\ndeclare module 'eslint-plugin-flowtype/dist/rules/objectTypeDelimiter.js' {\n  declare module.exports: $Exports<'eslint-plugin-flowtype/dist/rules/objectTypeDelimiter'>;\n}\ndeclare module 'eslint-plugin-flowtype/dist/rules/requireExactType.js' {\n  declare module.exports: $Exports<'eslint-plugin-flowtype/dist/rules/requireExactType'>;\n}\ndeclare module 'eslint-plugin-flowtype/dist/rules/requireParameterType.js' {\n  declare module.exports: $Exports<'eslint-plugin-flowtype/dist/rules/requireParameterType'>;\n}\ndeclare module 'eslint-plugin-flowtype/dist/rules/requireReturnType.js' {\n  declare module.exports: $Exports<'eslint-plugin-flowtype/dist/rules/requireReturnType'>;\n}\ndeclare module 'eslint-plugin-flowtype/dist/rules/requireTypesAtTop.js' {\n  declare module.exports: $Exports<'eslint-plugin-flowtype/dist/rules/requireTypesAtTop'>;\n}\ndeclare module 'eslint-plugin-flowtype/dist/rules/requireValidFileAnnotation.js' {\n  declare module.exports: $Exports<'eslint-plugin-flowtype/dist/rules/requireValidFileAnnotation'>;\n}\ndeclare module 'eslint-plugin-flowtype/dist/rules/requireVariableType.js' {\n  declare module.exports: $Exports<'eslint-plugin-flowtype/dist/rules/requireVariableType'>;\n}\ndeclare module 'eslint-plugin-flowtype/dist/rules/semi.js' {\n  declare module.exports: $Exports<'eslint-plugin-flowtype/dist/rules/semi'>;\n}\ndeclare module 'eslint-plugin-flowtype/dist/rules/sortKeys.js' {\n  declare module.exports: $Exports<'eslint-plugin-flowtype/dist/rules/sortKeys'>;\n}\ndeclare module 'eslint-plugin-flowtype/dist/rules/spaceAfterTypeColon.js' {\n  declare module.exports: $Exports<'eslint-plugin-flowtype/dist/rules/spaceAfterTypeColon'>;\n}\ndeclare module 'eslint-plugin-flowtype/dist/rules/spaceBeforeGenericBracket.js' {\n  declare module.exports: $Exports<'eslint-plugin-flowtype/dist/rules/spaceBeforeGenericBracket'>;\n}\ndeclare module 'eslint-plugin-flowtype/dist/rules/spaceBeforeTypeColon.js' {\n  declare module.exports: $Exports<'eslint-plugin-flowtype/dist/rules/spaceBeforeTypeColon'>;\n}\ndeclare module 'eslint-plugin-flowtype/dist/rules/typeColonSpacing/evaluateFunctions.js' {\n  declare module.exports: $Exports<'eslint-plugin-flowtype/dist/rules/typeColonSpacing/evaluateFunctions'>;\n}\ndeclare module 'eslint-plugin-flowtype/dist/rules/typeColonSpacing/evaluateObjectTypeIndexer.js' {\n  declare module.exports: $Exports<'eslint-plugin-flowtype/dist/rules/typeColonSpacing/evaluateObjectTypeIndexer'>;\n}\ndeclare module 'eslint-plugin-flowtype/dist/rules/typeColonSpacing/evaluateObjectTypeProperty.js' {\n  declare module.exports: $Exports<'eslint-plugin-flowtype/dist/rules/typeColonSpacing/evaluateObjectTypeProperty'>;\n}\ndeclare module 'eslint-plugin-flowtype/dist/rules/typeColonSpacing/evaluateReturnType.js' {\n  declare module.exports: $Exports<'eslint-plugin-flowtype/dist/rules/typeColonSpacing/evaluateReturnType'>;\n}\ndeclare module 'eslint-plugin-flowtype/dist/rules/typeColonSpacing/evaluateTypeCastExpression.js' {\n  declare module.exports: $Exports<'eslint-plugin-flowtype/dist/rules/typeColonSpacing/evaluateTypeCastExpression'>;\n}\ndeclare module 'eslint-plugin-flowtype/dist/rules/typeColonSpacing/evaluateTypical.js' {\n  declare module.exports: $Exports<'eslint-plugin-flowtype/dist/rules/typeColonSpacing/evaluateTypical'>;\n}\ndeclare module 'eslint-plugin-flowtype/dist/rules/typeColonSpacing/index.js' {\n  declare module.exports: $Exports<'eslint-plugin-flowtype/dist/rules/typeColonSpacing/index'>;\n}\ndeclare module 'eslint-plugin-flowtype/dist/rules/typeColonSpacing/reporter.js' {\n  declare module.exports: $Exports<'eslint-plugin-flowtype/dist/rules/typeColonSpacing/reporter'>;\n}\ndeclare module 'eslint-plugin-flowtype/dist/rules/typeIdMatch.js' {\n  declare module.exports: $Exports<'eslint-plugin-flowtype/dist/rules/typeIdMatch'>;\n}\ndeclare module 'eslint-plugin-flowtype/dist/rules/typeImportStyle.js' {\n  declare module.exports: $Exports<'eslint-plugin-flowtype/dist/rules/typeImportStyle'>;\n}\ndeclare module 'eslint-plugin-flowtype/dist/rules/unionIntersectionSpacing.js' {\n  declare module.exports: $Exports<'eslint-plugin-flowtype/dist/rules/unionIntersectionSpacing'>;\n}\ndeclare module 'eslint-plugin-flowtype/dist/rules/useFlowType.js' {\n  declare module.exports: $Exports<'eslint-plugin-flowtype/dist/rules/useFlowType'>;\n}\ndeclare module 'eslint-plugin-flowtype/dist/rules/validSyntax.js' {\n  declare module.exports: $Exports<'eslint-plugin-flowtype/dist/rules/validSyntax'>;\n}\ndeclare module 'eslint-plugin-flowtype/dist/utilities/checkFlowFileAnnotation.js' {\n  declare module.exports: $Exports<'eslint-plugin-flowtype/dist/utilities/checkFlowFileAnnotation'>;\n}\ndeclare module 'eslint-plugin-flowtype/dist/utilities/fuzzyStringMatch.js' {\n  declare module.exports: $Exports<'eslint-plugin-flowtype/dist/utilities/fuzzyStringMatch'>;\n}\ndeclare module 'eslint-plugin-flowtype/dist/utilities/getParameterName.js' {\n  declare module.exports: $Exports<'eslint-plugin-flowtype/dist/utilities/getParameterName'>;\n}\ndeclare module 'eslint-plugin-flowtype/dist/utilities/getTokenAfterParens.js' {\n  declare module.exports: $Exports<'eslint-plugin-flowtype/dist/utilities/getTokenAfterParens'>;\n}\ndeclare module 'eslint-plugin-flowtype/dist/utilities/getTokenBeforeParens.js' {\n  declare module.exports: $Exports<'eslint-plugin-flowtype/dist/utilities/getTokenBeforeParens'>;\n}\ndeclare module 'eslint-plugin-flowtype/dist/utilities/index.js' {\n  declare module.exports: $Exports<'eslint-plugin-flowtype/dist/utilities/index'>;\n}\ndeclare module 'eslint-plugin-flowtype/dist/utilities/isFlowFile.js' {\n  declare module.exports: $Exports<'eslint-plugin-flowtype/dist/utilities/isFlowFile'>;\n}\ndeclare module 'eslint-plugin-flowtype/dist/utilities/isFlowFileAnnotation.js' {\n  declare module.exports: $Exports<'eslint-plugin-flowtype/dist/utilities/isFlowFileAnnotation'>;\n}\ndeclare module 'eslint-plugin-flowtype/dist/utilities/iterateFunctionNodes.js' {\n  declare module.exports: $Exports<'eslint-plugin-flowtype/dist/utilities/iterateFunctionNodes'>;\n}\ndeclare module 'eslint-plugin-flowtype/dist/utilities/quoteName.js' {\n  declare module.exports: $Exports<'eslint-plugin-flowtype/dist/utilities/quoteName'>;\n}\ndeclare module 'eslint-plugin-flowtype/dist/utilities/spacingFixers.js' {\n  declare module.exports: $Exports<'eslint-plugin-flowtype/dist/utilities/spacingFixers'>;\n}\n"
  },
  {
    "path": "flow-typed/npm/eslint-plugin-header_vx.x.x.js",
    "content": "// flow-typed signature: ae49f73baa6e38423f28cfaa56cde4b6\n// flow-typed version: <<STUB>>/eslint-plugin-header_v^1.0.0/flow_v0.76.0\n\n/**\n * This is an autogenerated libdef stub for:\n *\n *   'eslint-plugin-header'\n *\n * Fill this stub out by replacing all the `any` types.\n *\n * Once filled out, we encourage you to share your work with the\n * community by sending a pull request to:\n * https://github.com/flowtype/flow-typed\n */\n\ndeclare module 'eslint-plugin-header' {\n  declare module.exports: any;\n}\n\n/**\n * We include stubs for each file inside this npm package in case you need to\n * require those files directly. Feel free to delete any files that aren't\n * needed.\n */\ndeclare module 'eslint-plugin-header/lib/comment-parser' {\n  declare module.exports: any;\n}\n\ndeclare module 'eslint-plugin-header/lib/rules/header' {\n  declare module.exports: any;\n}\n\ndeclare module 'eslint-plugin-header/tests/lib/comment-parser-test' {\n  declare module.exports: any;\n}\n\ndeclare module 'eslint-plugin-header/tests/lib/rules/header' {\n  declare module.exports: any;\n}\n\ndeclare module 'eslint-plugin-header/tests/support/block' {\n  declare module.exports: any;\n}\n\ndeclare module 'eslint-plugin-header/tests/support/line' {\n  declare module.exports: any;\n}\n\n// Filename aliases\ndeclare module 'eslint-plugin-header/index' {\n  declare module.exports: $Exports<'eslint-plugin-header'>;\n}\ndeclare module 'eslint-plugin-header/index.js' {\n  declare module.exports: $Exports<'eslint-plugin-header'>;\n}\ndeclare module 'eslint-plugin-header/lib/comment-parser.js' {\n  declare module.exports: $Exports<'eslint-plugin-header/lib/comment-parser'>;\n}\ndeclare module 'eslint-plugin-header/lib/rules/header.js' {\n  declare module.exports: $Exports<'eslint-plugin-header/lib/rules/header'>;\n}\ndeclare module 'eslint-plugin-header/tests/lib/comment-parser-test.js' {\n  declare module.exports: $Exports<'eslint-plugin-header/tests/lib/comment-parser-test'>;\n}\ndeclare module 'eslint-plugin-header/tests/lib/rules/header.js' {\n  declare module.exports: $Exports<'eslint-plugin-header/tests/lib/rules/header'>;\n}\ndeclare module 'eslint-plugin-header/tests/support/block.js' {\n  declare module.exports: $Exports<'eslint-plugin-header/tests/support/block'>;\n}\ndeclare module 'eslint-plugin-header/tests/support/line.js' {\n  declare module.exports: $Exports<'eslint-plugin-header/tests/support/line'>;\n}\n"
  },
  {
    "path": "flow-typed/npm/eslint-plugin-prettier_vx.x.x.js",
    "content": "// flow-typed signature: 70634101622a522f3dadf6402bddc6cf\n// flow-typed version: <<STUB>>/eslint-plugin-prettier_v^2.1.2/flow_v0.76.0\n\n/**\n * This is an autogenerated libdef stub for:\n *\n *   'eslint-plugin-prettier'\n *\n * Fill this stub out by replacing all the `any` types.\n *\n * Once filled out, we encourage you to share your work with the\n * community by sending a pull request to:\n * https://github.com/flowtype/flow-typed\n */\n\ndeclare module 'eslint-plugin-prettier' {\n  declare module.exports: any;\n}\n\n/**\n * We include stubs for each file inside this npm package in case you need to\n * require those files directly. Feel free to delete any files that aren't\n * needed.\n */\ndeclare module 'eslint-plugin-prettier/eslint-plugin-prettier' {\n  declare module.exports: any;\n}\n\n// Filename aliases\ndeclare module 'eslint-plugin-prettier/eslint-plugin-prettier.js' {\n  declare module.exports: $Exports<'eslint-plugin-prettier/eslint-plugin-prettier'>;\n}\n"
  },
  {
    "path": "flow-typed/npm/eslint_vx.x.x.js",
    "content": "// flow-typed signature: 5e0ea0fef73f4809eec046a100e9b8dd\n// flow-typed version: <<STUB>>/eslint_v^4.18.2/flow_v0.76.0\n\n/**\n * This is an autogenerated libdef stub for:\n *\n *   'eslint'\n *\n * Fill this stub out by replacing all the `any` types.\n *\n * Once filled out, we encourage you to share your work with the\n * community by sending a pull request to:\n * https://github.com/flowtype/flow-typed\n */\n\ndeclare module 'eslint' {\n  declare module.exports: any;\n}\n\n/**\n * We include stubs for each file inside this npm package in case you need to\n * require those files directly. Feel free to delete any files that aren't\n * needed.\n */\ndeclare module 'eslint/bin/eslint' {\n  declare module.exports: any;\n}\n\ndeclare module 'eslint/conf/config-schema' {\n  declare module.exports: any;\n}\n\ndeclare module 'eslint/conf/default-cli-options' {\n  declare module.exports: any;\n}\n\ndeclare module 'eslint/conf/environments' {\n  declare module.exports: any;\n}\n\ndeclare module 'eslint/conf/eslint-all' {\n  declare module.exports: any;\n}\n\ndeclare module 'eslint/conf/eslint-recommended' {\n  declare module.exports: any;\n}\n\ndeclare module 'eslint/lib/api' {\n  declare module.exports: any;\n}\n\ndeclare module 'eslint/lib/ast-utils' {\n  declare module.exports: any;\n}\n\ndeclare module 'eslint/lib/cli-engine' {\n  declare module.exports: any;\n}\n\ndeclare module 'eslint/lib/cli' {\n  declare module.exports: any;\n}\n\ndeclare module 'eslint/lib/code-path-analysis/code-path-analyzer' {\n  declare module.exports: any;\n}\n\ndeclare module 'eslint/lib/code-path-analysis/code-path-segment' {\n  declare module.exports: any;\n}\n\ndeclare module 'eslint/lib/code-path-analysis/code-path-state' {\n  declare module.exports: any;\n}\n\ndeclare module 'eslint/lib/code-path-analysis/code-path' {\n  declare module.exports: any;\n}\n\ndeclare module 'eslint/lib/code-path-analysis/debug-helpers' {\n  declare module.exports: any;\n}\n\ndeclare module 'eslint/lib/code-path-analysis/fork-context' {\n  declare module.exports: any;\n}\n\ndeclare module 'eslint/lib/code-path-analysis/id-generator' {\n  declare module.exports: any;\n}\n\ndeclare module 'eslint/lib/config' {\n  declare module.exports: any;\n}\n\ndeclare module 'eslint/lib/config/autoconfig' {\n  declare module.exports: any;\n}\n\ndeclare module 'eslint/lib/config/config-cache' {\n  declare module.exports: any;\n}\n\ndeclare module 'eslint/lib/config/config-file' {\n  declare module.exports: any;\n}\n\ndeclare module 'eslint/lib/config/config-initializer' {\n  declare module.exports: any;\n}\n\ndeclare module 'eslint/lib/config/config-ops' {\n  declare module.exports: any;\n}\n\ndeclare module 'eslint/lib/config/config-rule' {\n  declare module.exports: any;\n}\n\ndeclare module 'eslint/lib/config/config-validator' {\n  declare module.exports: any;\n}\n\ndeclare module 'eslint/lib/config/environments' {\n  declare module.exports: any;\n}\n\ndeclare module 'eslint/lib/config/plugins' {\n  declare module.exports: any;\n}\n\ndeclare module 'eslint/lib/file-finder' {\n  declare module.exports: any;\n}\n\ndeclare module 'eslint/lib/formatters/checkstyle' {\n  declare module.exports: any;\n}\n\ndeclare module 'eslint/lib/formatters/codeframe' {\n  declare module.exports: any;\n}\n\ndeclare module 'eslint/lib/formatters/compact' {\n  declare module.exports: any;\n}\n\ndeclare module 'eslint/lib/formatters/html' {\n  declare module.exports: any;\n}\n\ndeclare module 'eslint/lib/formatters/jslint-xml' {\n  declare module.exports: any;\n}\n\ndeclare module 'eslint/lib/formatters/json' {\n  declare module.exports: any;\n}\n\ndeclare module 'eslint/lib/formatters/junit' {\n  declare module.exports: any;\n}\n\ndeclare module 'eslint/lib/formatters/stylish' {\n  declare module.exports: any;\n}\n\ndeclare module 'eslint/lib/formatters/table' {\n  declare module.exports: any;\n}\n\ndeclare module 'eslint/lib/formatters/tap' {\n  declare module.exports: any;\n}\n\ndeclare module 'eslint/lib/formatters/unix' {\n  declare module.exports: any;\n}\n\ndeclare module 'eslint/lib/formatters/visualstudio' {\n  declare module.exports: any;\n}\n\ndeclare module 'eslint/lib/ignored-paths' {\n  declare module.exports: any;\n}\n\ndeclare module 'eslint/lib/linter' {\n  declare module.exports: any;\n}\n\ndeclare module 'eslint/lib/load-rules' {\n  declare module.exports: any;\n}\n\ndeclare module 'eslint/lib/logging' {\n  declare module.exports: any;\n}\n\ndeclare module 'eslint/lib/options' {\n  declare module.exports: any;\n}\n\ndeclare module 'eslint/lib/report-translator' {\n  declare module.exports: any;\n}\n\ndeclare module 'eslint/lib/rules' {\n  declare module.exports: any;\n}\n\ndeclare module 'eslint/lib/rules/accessor-pairs' {\n  declare module.exports: any;\n}\n\ndeclare module 'eslint/lib/rules/array-bracket-newline' {\n  declare module.exports: any;\n}\n\ndeclare module 'eslint/lib/rules/array-bracket-spacing' {\n  declare module.exports: any;\n}\n\ndeclare module 'eslint/lib/rules/array-callback-return' {\n  declare module.exports: any;\n}\n\ndeclare module 'eslint/lib/rules/array-element-newline' {\n  declare module.exports: any;\n}\n\ndeclare module 'eslint/lib/rules/arrow-body-style' {\n  declare module.exports: any;\n}\n\ndeclare module 'eslint/lib/rules/arrow-parens' {\n  declare module.exports: any;\n}\n\ndeclare module 'eslint/lib/rules/arrow-spacing' {\n  declare module.exports: any;\n}\n\ndeclare module 'eslint/lib/rules/block-scoped-var' {\n  declare module.exports: any;\n}\n\ndeclare module 'eslint/lib/rules/block-spacing' {\n  declare module.exports: any;\n}\n\ndeclare module 'eslint/lib/rules/brace-style' {\n  declare module.exports: any;\n}\n\ndeclare module 'eslint/lib/rules/callback-return' {\n  declare module.exports: any;\n}\n\ndeclare module 'eslint/lib/rules/camelcase' {\n  declare module.exports: any;\n}\n\ndeclare module 'eslint/lib/rules/capitalized-comments' {\n  declare module.exports: any;\n}\n\ndeclare module 'eslint/lib/rules/class-methods-use-this' {\n  declare module.exports: any;\n}\n\ndeclare module 'eslint/lib/rules/comma-dangle' {\n  declare module.exports: any;\n}\n\ndeclare module 'eslint/lib/rules/comma-spacing' {\n  declare module.exports: any;\n}\n\ndeclare module 'eslint/lib/rules/comma-style' {\n  declare module.exports: any;\n}\n\ndeclare module 'eslint/lib/rules/complexity' {\n  declare module.exports: any;\n}\n\ndeclare module 'eslint/lib/rules/computed-property-spacing' {\n  declare module.exports: any;\n}\n\ndeclare module 'eslint/lib/rules/consistent-return' {\n  declare module.exports: any;\n}\n\ndeclare module 'eslint/lib/rules/consistent-this' {\n  declare module.exports: any;\n}\n\ndeclare module 'eslint/lib/rules/constructor-super' {\n  declare module.exports: any;\n}\n\ndeclare module 'eslint/lib/rules/curly' {\n  declare module.exports: any;\n}\n\ndeclare module 'eslint/lib/rules/default-case' {\n  declare module.exports: any;\n}\n\ndeclare module 'eslint/lib/rules/dot-location' {\n  declare module.exports: any;\n}\n\ndeclare module 'eslint/lib/rules/dot-notation' {\n  declare module.exports: any;\n}\n\ndeclare module 'eslint/lib/rules/eol-last' {\n  declare module.exports: any;\n}\n\ndeclare module 'eslint/lib/rules/eqeqeq' {\n  declare module.exports: any;\n}\n\ndeclare module 'eslint/lib/rules/for-direction' {\n  declare module.exports: any;\n}\n\ndeclare module 'eslint/lib/rules/func-call-spacing' {\n  declare module.exports: any;\n}\n\ndeclare module 'eslint/lib/rules/func-name-matching' {\n  declare module.exports: any;\n}\n\ndeclare module 'eslint/lib/rules/func-names' {\n  declare module.exports: any;\n}\n\ndeclare module 'eslint/lib/rules/func-style' {\n  declare module.exports: any;\n}\n\ndeclare module 'eslint/lib/rules/function-paren-newline' {\n  declare module.exports: any;\n}\n\ndeclare module 'eslint/lib/rules/generator-star-spacing' {\n  declare module.exports: any;\n}\n\ndeclare module 'eslint/lib/rules/getter-return' {\n  declare module.exports: any;\n}\n\ndeclare module 'eslint/lib/rules/global-require' {\n  declare module.exports: any;\n}\n\ndeclare module 'eslint/lib/rules/guard-for-in' {\n  declare module.exports: any;\n}\n\ndeclare module 'eslint/lib/rules/handle-callback-err' {\n  declare module.exports: any;\n}\n\ndeclare module 'eslint/lib/rules/id-blacklist' {\n  declare module.exports: any;\n}\n\ndeclare module 'eslint/lib/rules/id-length' {\n  declare module.exports: any;\n}\n\ndeclare module 'eslint/lib/rules/id-match' {\n  declare module.exports: any;\n}\n\ndeclare module 'eslint/lib/rules/implicit-arrow-linebreak' {\n  declare module.exports: any;\n}\n\ndeclare module 'eslint/lib/rules/indent-legacy' {\n  declare module.exports: any;\n}\n\ndeclare module 'eslint/lib/rules/indent' {\n  declare module.exports: any;\n}\n\ndeclare module 'eslint/lib/rules/init-declarations' {\n  declare module.exports: any;\n}\n\ndeclare module 'eslint/lib/rules/jsx-quotes' {\n  declare module.exports: any;\n}\n\ndeclare module 'eslint/lib/rules/key-spacing' {\n  declare module.exports: any;\n}\n\ndeclare module 'eslint/lib/rules/keyword-spacing' {\n  declare module.exports: any;\n}\n\ndeclare module 'eslint/lib/rules/line-comment-position' {\n  declare module.exports: any;\n}\n\ndeclare module 'eslint/lib/rules/linebreak-style' {\n  declare module.exports: any;\n}\n\ndeclare module 'eslint/lib/rules/lines-around-comment' {\n  declare module.exports: any;\n}\n\ndeclare module 'eslint/lib/rules/lines-around-directive' {\n  declare module.exports: any;\n}\n\ndeclare module 'eslint/lib/rules/lines-between-class-members' {\n  declare module.exports: any;\n}\n\ndeclare module 'eslint/lib/rules/max-depth' {\n  declare module.exports: any;\n}\n\ndeclare module 'eslint/lib/rules/max-len' {\n  declare module.exports: any;\n}\n\ndeclare module 'eslint/lib/rules/max-lines' {\n  declare module.exports: any;\n}\n\ndeclare module 'eslint/lib/rules/max-nested-callbacks' {\n  declare module.exports: any;\n}\n\ndeclare module 'eslint/lib/rules/max-params' {\n  declare module.exports: any;\n}\n\ndeclare module 'eslint/lib/rules/max-statements-per-line' {\n  declare module.exports: any;\n}\n\ndeclare module 'eslint/lib/rules/max-statements' {\n  declare module.exports: any;\n}\n\ndeclare module 'eslint/lib/rules/multiline-comment-style' {\n  declare module.exports: any;\n}\n\ndeclare module 'eslint/lib/rules/multiline-ternary' {\n  declare module.exports: any;\n}\n\ndeclare module 'eslint/lib/rules/new-cap' {\n  declare module.exports: any;\n}\n\ndeclare module 'eslint/lib/rules/new-parens' {\n  declare module.exports: any;\n}\n\ndeclare module 'eslint/lib/rules/newline-after-var' {\n  declare module.exports: any;\n}\n\ndeclare module 'eslint/lib/rules/newline-before-return' {\n  declare module.exports: any;\n}\n\ndeclare module 'eslint/lib/rules/newline-per-chained-call' {\n  declare module.exports: any;\n}\n\ndeclare module 'eslint/lib/rules/no-alert' {\n  declare module.exports: any;\n}\n\ndeclare module 'eslint/lib/rules/no-array-constructor' {\n  declare module.exports: any;\n}\n\ndeclare module 'eslint/lib/rules/no-await-in-loop' {\n  declare module.exports: any;\n}\n\ndeclare module 'eslint/lib/rules/no-bitwise' {\n  declare module.exports: any;\n}\n\ndeclare module 'eslint/lib/rules/no-buffer-constructor' {\n  declare module.exports: any;\n}\n\ndeclare module 'eslint/lib/rules/no-caller' {\n  declare module.exports: any;\n}\n\ndeclare module 'eslint/lib/rules/no-case-declarations' {\n  declare module.exports: any;\n}\n\ndeclare module 'eslint/lib/rules/no-catch-shadow' {\n  declare module.exports: any;\n}\n\ndeclare module 'eslint/lib/rules/no-class-assign' {\n  declare module.exports: any;\n}\n\ndeclare module 'eslint/lib/rules/no-compare-neg-zero' {\n  declare module.exports: any;\n}\n\ndeclare module 'eslint/lib/rules/no-cond-assign' {\n  declare module.exports: any;\n}\n\ndeclare module 'eslint/lib/rules/no-confusing-arrow' {\n  declare module.exports: any;\n}\n\ndeclare module 'eslint/lib/rules/no-console' {\n  declare module.exports: any;\n}\n\ndeclare module 'eslint/lib/rules/no-const-assign' {\n  declare module.exports: any;\n}\n\ndeclare module 'eslint/lib/rules/no-constant-condition' {\n  declare module.exports: any;\n}\n\ndeclare module 'eslint/lib/rules/no-continue' {\n  declare module.exports: any;\n}\n\ndeclare module 'eslint/lib/rules/no-control-regex' {\n  declare module.exports: any;\n}\n\ndeclare module 'eslint/lib/rules/no-debugger' {\n  declare module.exports: any;\n}\n\ndeclare module 'eslint/lib/rules/no-delete-var' {\n  declare module.exports: any;\n}\n\ndeclare module 'eslint/lib/rules/no-div-regex' {\n  declare module.exports: any;\n}\n\ndeclare module 'eslint/lib/rules/no-dupe-args' {\n  declare module.exports: any;\n}\n\ndeclare module 'eslint/lib/rules/no-dupe-class-members' {\n  declare module.exports: any;\n}\n\ndeclare module 'eslint/lib/rules/no-dupe-keys' {\n  declare module.exports: any;\n}\n\ndeclare module 'eslint/lib/rules/no-duplicate-case' {\n  declare module.exports: any;\n}\n\ndeclare module 'eslint/lib/rules/no-duplicate-imports' {\n  declare module.exports: any;\n}\n\ndeclare module 'eslint/lib/rules/no-else-return' {\n  declare module.exports: any;\n}\n\ndeclare module 'eslint/lib/rules/no-empty-character-class' {\n  declare module.exports: any;\n}\n\ndeclare module 'eslint/lib/rules/no-empty-function' {\n  declare module.exports: any;\n}\n\ndeclare module 'eslint/lib/rules/no-empty-pattern' {\n  declare module.exports: any;\n}\n\ndeclare module 'eslint/lib/rules/no-empty' {\n  declare module.exports: any;\n}\n\ndeclare module 'eslint/lib/rules/no-eq-null' {\n  declare module.exports: any;\n}\n\ndeclare module 'eslint/lib/rules/no-eval' {\n  declare module.exports: any;\n}\n\ndeclare module 'eslint/lib/rules/no-ex-assign' {\n  declare module.exports: any;\n}\n\ndeclare module 'eslint/lib/rules/no-extend-native' {\n  declare module.exports: any;\n}\n\ndeclare module 'eslint/lib/rules/no-extra-bind' {\n  declare module.exports: any;\n}\n\ndeclare module 'eslint/lib/rules/no-extra-boolean-cast' {\n  declare module.exports: any;\n}\n\ndeclare module 'eslint/lib/rules/no-extra-label' {\n  declare module.exports: any;\n}\n\ndeclare module 'eslint/lib/rules/no-extra-parens' {\n  declare module.exports: any;\n}\n\ndeclare module 'eslint/lib/rules/no-extra-semi' {\n  declare module.exports: any;\n}\n\ndeclare module 'eslint/lib/rules/no-fallthrough' {\n  declare module.exports: any;\n}\n\ndeclare module 'eslint/lib/rules/no-floating-decimal' {\n  declare module.exports: any;\n}\n\ndeclare module 'eslint/lib/rules/no-func-assign' {\n  declare module.exports: any;\n}\n\ndeclare module 'eslint/lib/rules/no-global-assign' {\n  declare module.exports: any;\n}\n\ndeclare module 'eslint/lib/rules/no-implicit-coercion' {\n  declare module.exports: any;\n}\n\ndeclare module 'eslint/lib/rules/no-implicit-globals' {\n  declare module.exports: any;\n}\n\ndeclare module 'eslint/lib/rules/no-implied-eval' {\n  declare module.exports: any;\n}\n\ndeclare module 'eslint/lib/rules/no-inline-comments' {\n  declare module.exports: any;\n}\n\ndeclare module 'eslint/lib/rules/no-inner-declarations' {\n  declare module.exports: any;\n}\n\ndeclare module 'eslint/lib/rules/no-invalid-regexp' {\n  declare module.exports: any;\n}\n\ndeclare module 'eslint/lib/rules/no-invalid-this' {\n  declare module.exports: any;\n}\n\ndeclare module 'eslint/lib/rules/no-irregular-whitespace' {\n  declare module.exports: any;\n}\n\ndeclare module 'eslint/lib/rules/no-iterator' {\n  declare module.exports: any;\n}\n\ndeclare module 'eslint/lib/rules/no-label-var' {\n  declare module.exports: any;\n}\n\ndeclare module 'eslint/lib/rules/no-labels' {\n  declare module.exports: any;\n}\n\ndeclare module 'eslint/lib/rules/no-lone-blocks' {\n  declare module.exports: any;\n}\n\ndeclare module 'eslint/lib/rules/no-lonely-if' {\n  declare module.exports: any;\n}\n\ndeclare module 'eslint/lib/rules/no-loop-func' {\n  declare module.exports: any;\n}\n\ndeclare module 'eslint/lib/rules/no-magic-numbers' {\n  declare module.exports: any;\n}\n\ndeclare module 'eslint/lib/rules/no-mixed-operators' {\n  declare module.exports: any;\n}\n\ndeclare module 'eslint/lib/rules/no-mixed-requires' {\n  declare module.exports: any;\n}\n\ndeclare module 'eslint/lib/rules/no-mixed-spaces-and-tabs' {\n  declare module.exports: any;\n}\n\ndeclare module 'eslint/lib/rules/no-multi-assign' {\n  declare module.exports: any;\n}\n\ndeclare module 'eslint/lib/rules/no-multi-spaces' {\n  declare module.exports: any;\n}\n\ndeclare module 'eslint/lib/rules/no-multi-str' {\n  declare module.exports: any;\n}\n\ndeclare module 'eslint/lib/rules/no-multiple-empty-lines' {\n  declare module.exports: any;\n}\n\ndeclare module 'eslint/lib/rules/no-native-reassign' {\n  declare module.exports: any;\n}\n\ndeclare module 'eslint/lib/rules/no-negated-condition' {\n  declare module.exports: any;\n}\n\ndeclare module 'eslint/lib/rules/no-negated-in-lhs' {\n  declare module.exports: any;\n}\n\ndeclare module 'eslint/lib/rules/no-nested-ternary' {\n  declare module.exports: any;\n}\n\ndeclare module 'eslint/lib/rules/no-new-func' {\n  declare module.exports: any;\n}\n\ndeclare module 'eslint/lib/rules/no-new-object' {\n  declare module.exports: any;\n}\n\ndeclare module 'eslint/lib/rules/no-new-require' {\n  declare module.exports: any;\n}\n\ndeclare module 'eslint/lib/rules/no-new-symbol' {\n  declare module.exports: any;\n}\n\ndeclare module 'eslint/lib/rules/no-new-wrappers' {\n  declare module.exports: any;\n}\n\ndeclare module 'eslint/lib/rules/no-new' {\n  declare module.exports: any;\n}\n\ndeclare module 'eslint/lib/rules/no-obj-calls' {\n  declare module.exports: any;\n}\n\ndeclare module 'eslint/lib/rules/no-octal-escape' {\n  declare module.exports: any;\n}\n\ndeclare module 'eslint/lib/rules/no-octal' {\n  declare module.exports: any;\n}\n\ndeclare module 'eslint/lib/rules/no-param-reassign' {\n  declare module.exports: any;\n}\n\ndeclare module 'eslint/lib/rules/no-path-concat' {\n  declare module.exports: any;\n}\n\ndeclare module 'eslint/lib/rules/no-plusplus' {\n  declare module.exports: any;\n}\n\ndeclare module 'eslint/lib/rules/no-process-env' {\n  declare module.exports: any;\n}\n\ndeclare module 'eslint/lib/rules/no-process-exit' {\n  declare module.exports: any;\n}\n\ndeclare module 'eslint/lib/rules/no-proto' {\n  declare module.exports: any;\n}\n\ndeclare module 'eslint/lib/rules/no-prototype-builtins' {\n  declare module.exports: any;\n}\n\ndeclare module 'eslint/lib/rules/no-redeclare' {\n  declare module.exports: any;\n}\n\ndeclare module 'eslint/lib/rules/no-regex-spaces' {\n  declare module.exports: any;\n}\n\ndeclare module 'eslint/lib/rules/no-restricted-globals' {\n  declare module.exports: any;\n}\n\ndeclare module 'eslint/lib/rules/no-restricted-imports' {\n  declare module.exports: any;\n}\n\ndeclare module 'eslint/lib/rules/no-restricted-modules' {\n  declare module.exports: any;\n}\n\ndeclare module 'eslint/lib/rules/no-restricted-properties' {\n  declare module.exports: any;\n}\n\ndeclare module 'eslint/lib/rules/no-restricted-syntax' {\n  declare module.exports: any;\n}\n\ndeclare module 'eslint/lib/rules/no-return-assign' {\n  declare module.exports: any;\n}\n\ndeclare module 'eslint/lib/rules/no-return-await' {\n  declare module.exports: any;\n}\n\ndeclare module 'eslint/lib/rules/no-script-url' {\n  declare module.exports: any;\n}\n\ndeclare module 'eslint/lib/rules/no-self-assign' {\n  declare module.exports: any;\n}\n\ndeclare module 'eslint/lib/rules/no-self-compare' {\n  declare module.exports: any;\n}\n\ndeclare module 'eslint/lib/rules/no-sequences' {\n  declare module.exports: any;\n}\n\ndeclare module 'eslint/lib/rules/no-shadow-restricted-names' {\n  declare module.exports: any;\n}\n\ndeclare module 'eslint/lib/rules/no-shadow' {\n  declare module.exports: any;\n}\n\ndeclare module 'eslint/lib/rules/no-spaced-func' {\n  declare module.exports: any;\n}\n\ndeclare module 'eslint/lib/rules/no-sparse-arrays' {\n  declare module.exports: any;\n}\n\ndeclare module 'eslint/lib/rules/no-sync' {\n  declare module.exports: any;\n}\n\ndeclare module 'eslint/lib/rules/no-tabs' {\n  declare module.exports: any;\n}\n\ndeclare module 'eslint/lib/rules/no-template-curly-in-string' {\n  declare module.exports: any;\n}\n\ndeclare module 'eslint/lib/rules/no-ternary' {\n  declare module.exports: any;\n}\n\ndeclare module 'eslint/lib/rules/no-this-before-super' {\n  declare module.exports: any;\n}\n\ndeclare module 'eslint/lib/rules/no-throw-literal' {\n  declare module.exports: any;\n}\n\ndeclare module 'eslint/lib/rules/no-trailing-spaces' {\n  declare module.exports: any;\n}\n\ndeclare module 'eslint/lib/rules/no-undef-init' {\n  declare module.exports: any;\n}\n\ndeclare module 'eslint/lib/rules/no-undef' {\n  declare module.exports: any;\n}\n\ndeclare module 'eslint/lib/rules/no-undefined' {\n  declare module.exports: any;\n}\n\ndeclare module 'eslint/lib/rules/no-underscore-dangle' {\n  declare module.exports: any;\n}\n\ndeclare module 'eslint/lib/rules/no-unexpected-multiline' {\n  declare module.exports: any;\n}\n\ndeclare module 'eslint/lib/rules/no-unmodified-loop-condition' {\n  declare module.exports: any;\n}\n\ndeclare module 'eslint/lib/rules/no-unneeded-ternary' {\n  declare module.exports: any;\n}\n\ndeclare module 'eslint/lib/rules/no-unreachable' {\n  declare module.exports: any;\n}\n\ndeclare module 'eslint/lib/rules/no-unsafe-finally' {\n  declare module.exports: any;\n}\n\ndeclare module 'eslint/lib/rules/no-unsafe-negation' {\n  declare module.exports: any;\n}\n\ndeclare module 'eslint/lib/rules/no-unused-expressions' {\n  declare module.exports: any;\n}\n\ndeclare module 'eslint/lib/rules/no-unused-labels' {\n  declare module.exports: any;\n}\n\ndeclare module 'eslint/lib/rules/no-unused-vars' {\n  declare module.exports: any;\n}\n\ndeclare module 'eslint/lib/rules/no-use-before-define' {\n  declare module.exports: any;\n}\n\ndeclare module 'eslint/lib/rules/no-useless-call' {\n  declare module.exports: any;\n}\n\ndeclare module 'eslint/lib/rules/no-useless-computed-key' {\n  declare module.exports: any;\n}\n\ndeclare module 'eslint/lib/rules/no-useless-concat' {\n  declare module.exports: any;\n}\n\ndeclare module 'eslint/lib/rules/no-useless-constructor' {\n  declare module.exports: any;\n}\n\ndeclare module 'eslint/lib/rules/no-useless-escape' {\n  declare module.exports: any;\n}\n\ndeclare module 'eslint/lib/rules/no-useless-rename' {\n  declare module.exports: any;\n}\n\ndeclare module 'eslint/lib/rules/no-useless-return' {\n  declare module.exports: any;\n}\n\ndeclare module 'eslint/lib/rules/no-var' {\n  declare module.exports: any;\n}\n\ndeclare module 'eslint/lib/rules/no-void' {\n  declare module.exports: any;\n}\n\ndeclare module 'eslint/lib/rules/no-warning-comments' {\n  declare module.exports: any;\n}\n\ndeclare module 'eslint/lib/rules/no-whitespace-before-property' {\n  declare module.exports: any;\n}\n\ndeclare module 'eslint/lib/rules/no-with' {\n  declare module.exports: any;\n}\n\ndeclare module 'eslint/lib/rules/nonblock-statement-body-position' {\n  declare module.exports: any;\n}\n\ndeclare module 'eslint/lib/rules/object-curly-newline' {\n  declare module.exports: any;\n}\n\ndeclare module 'eslint/lib/rules/object-curly-spacing' {\n  declare module.exports: any;\n}\n\ndeclare module 'eslint/lib/rules/object-property-newline' {\n  declare module.exports: any;\n}\n\ndeclare module 'eslint/lib/rules/object-shorthand' {\n  declare module.exports: any;\n}\n\ndeclare module 'eslint/lib/rules/one-var-declaration-per-line' {\n  declare module.exports: any;\n}\n\ndeclare module 'eslint/lib/rules/one-var' {\n  declare module.exports: any;\n}\n\ndeclare module 'eslint/lib/rules/operator-assignment' {\n  declare module.exports: any;\n}\n\ndeclare module 'eslint/lib/rules/operator-linebreak' {\n  declare module.exports: any;\n}\n\ndeclare module 'eslint/lib/rules/padded-blocks' {\n  declare module.exports: any;\n}\n\ndeclare module 'eslint/lib/rules/padding-line-between-statements' {\n  declare module.exports: any;\n}\n\ndeclare module 'eslint/lib/rules/prefer-arrow-callback' {\n  declare module.exports: any;\n}\n\ndeclare module 'eslint/lib/rules/prefer-const' {\n  declare module.exports: any;\n}\n\ndeclare module 'eslint/lib/rules/prefer-destructuring' {\n  declare module.exports: any;\n}\n\ndeclare module 'eslint/lib/rules/prefer-numeric-literals' {\n  declare module.exports: any;\n}\n\ndeclare module 'eslint/lib/rules/prefer-promise-reject-errors' {\n  declare module.exports: any;\n}\n\ndeclare module 'eslint/lib/rules/prefer-reflect' {\n  declare module.exports: any;\n}\n\ndeclare module 'eslint/lib/rules/prefer-rest-params' {\n  declare module.exports: any;\n}\n\ndeclare module 'eslint/lib/rules/prefer-spread' {\n  declare module.exports: any;\n}\n\ndeclare module 'eslint/lib/rules/prefer-template' {\n  declare module.exports: any;\n}\n\ndeclare module 'eslint/lib/rules/quote-props' {\n  declare module.exports: any;\n}\n\ndeclare module 'eslint/lib/rules/quotes' {\n  declare module.exports: any;\n}\n\ndeclare module 'eslint/lib/rules/radix' {\n  declare module.exports: any;\n}\n\ndeclare module 'eslint/lib/rules/require-await' {\n  declare module.exports: any;\n}\n\ndeclare module 'eslint/lib/rules/require-jsdoc' {\n  declare module.exports: any;\n}\n\ndeclare module 'eslint/lib/rules/require-yield' {\n  declare module.exports: any;\n}\n\ndeclare module 'eslint/lib/rules/rest-spread-spacing' {\n  declare module.exports: any;\n}\n\ndeclare module 'eslint/lib/rules/semi-spacing' {\n  declare module.exports: any;\n}\n\ndeclare module 'eslint/lib/rules/semi-style' {\n  declare module.exports: any;\n}\n\ndeclare module 'eslint/lib/rules/semi' {\n  declare module.exports: any;\n}\n\ndeclare module 'eslint/lib/rules/sort-imports' {\n  declare module.exports: any;\n}\n\ndeclare module 'eslint/lib/rules/sort-keys' {\n  declare module.exports: any;\n}\n\ndeclare module 'eslint/lib/rules/sort-vars' {\n  declare module.exports: any;\n}\n\ndeclare module 'eslint/lib/rules/space-before-blocks' {\n  declare module.exports: any;\n}\n\ndeclare module 'eslint/lib/rules/space-before-function-paren' {\n  declare module.exports: any;\n}\n\ndeclare module 'eslint/lib/rules/space-in-parens' {\n  declare module.exports: any;\n}\n\ndeclare module 'eslint/lib/rules/space-infix-ops' {\n  declare module.exports: any;\n}\n\ndeclare module 'eslint/lib/rules/space-unary-ops' {\n  declare module.exports: any;\n}\n\ndeclare module 'eslint/lib/rules/spaced-comment' {\n  declare module.exports: any;\n}\n\ndeclare module 'eslint/lib/rules/strict' {\n  declare module.exports: any;\n}\n\ndeclare module 'eslint/lib/rules/switch-colon-spacing' {\n  declare module.exports: any;\n}\n\ndeclare module 'eslint/lib/rules/symbol-description' {\n  declare module.exports: any;\n}\n\ndeclare module 'eslint/lib/rules/template-curly-spacing' {\n  declare module.exports: any;\n}\n\ndeclare module 'eslint/lib/rules/template-tag-spacing' {\n  declare module.exports: any;\n}\n\ndeclare module 'eslint/lib/rules/unicode-bom' {\n  declare module.exports: any;\n}\n\ndeclare module 'eslint/lib/rules/use-isnan' {\n  declare module.exports: any;\n}\n\ndeclare module 'eslint/lib/rules/valid-jsdoc' {\n  declare module.exports: any;\n}\n\ndeclare module 'eslint/lib/rules/valid-typeof' {\n  declare module.exports: any;\n}\n\ndeclare module 'eslint/lib/rules/vars-on-top' {\n  declare module.exports: any;\n}\n\ndeclare module 'eslint/lib/rules/wrap-iife' {\n  declare module.exports: any;\n}\n\ndeclare module 'eslint/lib/rules/wrap-regex' {\n  declare module.exports: any;\n}\n\ndeclare module 'eslint/lib/rules/yield-star-spacing' {\n  declare module.exports: any;\n}\n\ndeclare module 'eslint/lib/rules/yoda' {\n  declare module.exports: any;\n}\n\ndeclare module 'eslint/lib/testers/rule-tester' {\n  declare module.exports: any;\n}\n\ndeclare module 'eslint/lib/timing' {\n  declare module.exports: any;\n}\n\ndeclare module 'eslint/lib/token-store/backward-token-comment-cursor' {\n  declare module.exports: any;\n}\n\ndeclare module 'eslint/lib/token-store/backward-token-cursor' {\n  declare module.exports: any;\n}\n\ndeclare module 'eslint/lib/token-store/cursor' {\n  declare module.exports: any;\n}\n\ndeclare module 'eslint/lib/token-store/cursors' {\n  declare module.exports: any;\n}\n\ndeclare module 'eslint/lib/token-store/decorative-cursor' {\n  declare module.exports: any;\n}\n\ndeclare module 'eslint/lib/token-store/filter-cursor' {\n  declare module.exports: any;\n}\n\ndeclare module 'eslint/lib/token-store/forward-token-comment-cursor' {\n  declare module.exports: any;\n}\n\ndeclare module 'eslint/lib/token-store/forward-token-cursor' {\n  declare module.exports: any;\n}\n\ndeclare module 'eslint/lib/token-store/index' {\n  declare module.exports: any;\n}\n\ndeclare module 'eslint/lib/token-store/limit-cursor' {\n  declare module.exports: any;\n}\n\ndeclare module 'eslint/lib/token-store/padded-token-cursor' {\n  declare module.exports: any;\n}\n\ndeclare module 'eslint/lib/token-store/skip-cursor' {\n  declare module.exports: any;\n}\n\ndeclare module 'eslint/lib/token-store/utils' {\n  declare module.exports: any;\n}\n\ndeclare module 'eslint/lib/util/ajv' {\n  declare module.exports: any;\n}\n\ndeclare module 'eslint/lib/util/apply-disable-directives' {\n  declare module.exports: any;\n}\n\ndeclare module 'eslint/lib/util/fix-tracker' {\n  declare module.exports: any;\n}\n\ndeclare module 'eslint/lib/util/glob-util' {\n  declare module.exports: any;\n}\n\ndeclare module 'eslint/lib/util/glob' {\n  declare module.exports: any;\n}\n\ndeclare module 'eslint/lib/util/hash' {\n  declare module.exports: any;\n}\n\ndeclare module 'eslint/lib/util/interpolate' {\n  declare module.exports: any;\n}\n\ndeclare module 'eslint/lib/util/keywords' {\n  declare module.exports: any;\n}\n\ndeclare module 'eslint/lib/util/module-resolver' {\n  declare module.exports: any;\n}\n\ndeclare module 'eslint/lib/util/naming' {\n  declare module.exports: any;\n}\n\ndeclare module 'eslint/lib/util/node-event-generator' {\n  declare module.exports: any;\n}\n\ndeclare module 'eslint/lib/util/npm-util' {\n  declare module.exports: any;\n}\n\ndeclare module 'eslint/lib/util/path-util' {\n  declare module.exports: any;\n}\n\ndeclare module 'eslint/lib/util/patterns/letters' {\n  declare module.exports: any;\n}\n\ndeclare module 'eslint/lib/util/rule-fixer' {\n  declare module.exports: any;\n}\n\ndeclare module 'eslint/lib/util/safe-emitter' {\n  declare module.exports: any;\n}\n\ndeclare module 'eslint/lib/util/source-code-fixer' {\n  declare module.exports: any;\n}\n\ndeclare module 'eslint/lib/util/source-code-util' {\n  declare module.exports: any;\n}\n\ndeclare module 'eslint/lib/util/source-code' {\n  declare module.exports: any;\n}\n\ndeclare module 'eslint/lib/util/traverser' {\n  declare module.exports: any;\n}\n\ndeclare module 'eslint/lib/util/xml-escape' {\n  declare module.exports: any;\n}\n\n// Filename aliases\ndeclare module 'eslint/bin/eslint.js' {\n  declare module.exports: $Exports<'eslint/bin/eslint'>;\n}\ndeclare module 'eslint/conf/config-schema.js' {\n  declare module.exports: $Exports<'eslint/conf/config-schema'>;\n}\ndeclare module 'eslint/conf/default-cli-options.js' {\n  declare module.exports: $Exports<'eslint/conf/default-cli-options'>;\n}\ndeclare module 'eslint/conf/environments.js' {\n  declare module.exports: $Exports<'eslint/conf/environments'>;\n}\ndeclare module 'eslint/conf/eslint-all.js' {\n  declare module.exports: $Exports<'eslint/conf/eslint-all'>;\n}\ndeclare module 'eslint/conf/eslint-recommended.js' {\n  declare module.exports: $Exports<'eslint/conf/eslint-recommended'>;\n}\ndeclare module 'eslint/lib/api.js' {\n  declare module.exports: $Exports<'eslint/lib/api'>;\n}\ndeclare module 'eslint/lib/ast-utils.js' {\n  declare module.exports: $Exports<'eslint/lib/ast-utils'>;\n}\ndeclare module 'eslint/lib/cli-engine.js' {\n  declare module.exports: $Exports<'eslint/lib/cli-engine'>;\n}\ndeclare module 'eslint/lib/cli.js' {\n  declare module.exports: $Exports<'eslint/lib/cli'>;\n}\ndeclare module 'eslint/lib/code-path-analysis/code-path-analyzer.js' {\n  declare module.exports: $Exports<'eslint/lib/code-path-analysis/code-path-analyzer'>;\n}\ndeclare module 'eslint/lib/code-path-analysis/code-path-segment.js' {\n  declare module.exports: $Exports<'eslint/lib/code-path-analysis/code-path-segment'>;\n}\ndeclare module 'eslint/lib/code-path-analysis/code-path-state.js' {\n  declare module.exports: $Exports<'eslint/lib/code-path-analysis/code-path-state'>;\n}\ndeclare module 'eslint/lib/code-path-analysis/code-path.js' {\n  declare module.exports: $Exports<'eslint/lib/code-path-analysis/code-path'>;\n}\ndeclare module 'eslint/lib/code-path-analysis/debug-helpers.js' {\n  declare module.exports: $Exports<'eslint/lib/code-path-analysis/debug-helpers'>;\n}\ndeclare module 'eslint/lib/code-path-analysis/fork-context.js' {\n  declare module.exports: $Exports<'eslint/lib/code-path-analysis/fork-context'>;\n}\ndeclare module 'eslint/lib/code-path-analysis/id-generator.js' {\n  declare module.exports: $Exports<'eslint/lib/code-path-analysis/id-generator'>;\n}\ndeclare module 'eslint/lib/config.js' {\n  declare module.exports: $Exports<'eslint/lib/config'>;\n}\ndeclare module 'eslint/lib/config/autoconfig.js' {\n  declare module.exports: $Exports<'eslint/lib/config/autoconfig'>;\n}\ndeclare module 'eslint/lib/config/config-cache.js' {\n  declare module.exports: $Exports<'eslint/lib/config/config-cache'>;\n}\ndeclare module 'eslint/lib/config/config-file.js' {\n  declare module.exports: $Exports<'eslint/lib/config/config-file'>;\n}\ndeclare module 'eslint/lib/config/config-initializer.js' {\n  declare module.exports: $Exports<'eslint/lib/config/config-initializer'>;\n}\ndeclare module 'eslint/lib/config/config-ops.js' {\n  declare module.exports: $Exports<'eslint/lib/config/config-ops'>;\n}\ndeclare module 'eslint/lib/config/config-rule.js' {\n  declare module.exports: $Exports<'eslint/lib/config/config-rule'>;\n}\ndeclare module 'eslint/lib/config/config-validator.js' {\n  declare module.exports: $Exports<'eslint/lib/config/config-validator'>;\n}\ndeclare module 'eslint/lib/config/environments.js' {\n  declare module.exports: $Exports<'eslint/lib/config/environments'>;\n}\ndeclare module 'eslint/lib/config/plugins.js' {\n  declare module.exports: $Exports<'eslint/lib/config/plugins'>;\n}\ndeclare module 'eslint/lib/file-finder.js' {\n  declare module.exports: $Exports<'eslint/lib/file-finder'>;\n}\ndeclare module 'eslint/lib/formatters/checkstyle.js' {\n  declare module.exports: $Exports<'eslint/lib/formatters/checkstyle'>;\n}\ndeclare module 'eslint/lib/formatters/codeframe.js' {\n  declare module.exports: $Exports<'eslint/lib/formatters/codeframe'>;\n}\ndeclare module 'eslint/lib/formatters/compact.js' {\n  declare module.exports: $Exports<'eslint/lib/formatters/compact'>;\n}\ndeclare module 'eslint/lib/formatters/html.js' {\n  declare module.exports: $Exports<'eslint/lib/formatters/html'>;\n}\ndeclare module 'eslint/lib/formatters/jslint-xml.js' {\n  declare module.exports: $Exports<'eslint/lib/formatters/jslint-xml'>;\n}\ndeclare module 'eslint/lib/formatters/json.js' {\n  declare module.exports: $Exports<'eslint/lib/formatters/json'>;\n}\ndeclare module 'eslint/lib/formatters/junit.js' {\n  declare module.exports: $Exports<'eslint/lib/formatters/junit'>;\n}\ndeclare module 'eslint/lib/formatters/stylish.js' {\n  declare module.exports: $Exports<'eslint/lib/formatters/stylish'>;\n}\ndeclare module 'eslint/lib/formatters/table.js' {\n  declare module.exports: $Exports<'eslint/lib/formatters/table'>;\n}\ndeclare module 'eslint/lib/formatters/tap.js' {\n  declare module.exports: $Exports<'eslint/lib/formatters/tap'>;\n}\ndeclare module 'eslint/lib/formatters/unix.js' {\n  declare module.exports: $Exports<'eslint/lib/formatters/unix'>;\n}\ndeclare module 'eslint/lib/formatters/visualstudio.js' {\n  declare module.exports: $Exports<'eslint/lib/formatters/visualstudio'>;\n}\ndeclare module 'eslint/lib/ignored-paths.js' {\n  declare module.exports: $Exports<'eslint/lib/ignored-paths'>;\n}\ndeclare module 'eslint/lib/linter.js' {\n  declare module.exports: $Exports<'eslint/lib/linter'>;\n}\ndeclare module 'eslint/lib/load-rules.js' {\n  declare module.exports: $Exports<'eslint/lib/load-rules'>;\n}\ndeclare module 'eslint/lib/logging.js' {\n  declare module.exports: $Exports<'eslint/lib/logging'>;\n}\ndeclare module 'eslint/lib/options.js' {\n  declare module.exports: $Exports<'eslint/lib/options'>;\n}\ndeclare module 'eslint/lib/report-translator.js' {\n  declare module.exports: $Exports<'eslint/lib/report-translator'>;\n}\ndeclare module 'eslint/lib/rules.js' {\n  declare module.exports: $Exports<'eslint/lib/rules'>;\n}\ndeclare module 'eslint/lib/rules/accessor-pairs.js' {\n  declare module.exports: $Exports<'eslint/lib/rules/accessor-pairs'>;\n}\ndeclare module 'eslint/lib/rules/array-bracket-newline.js' {\n  declare module.exports: $Exports<'eslint/lib/rules/array-bracket-newline'>;\n}\ndeclare module 'eslint/lib/rules/array-bracket-spacing.js' {\n  declare module.exports: $Exports<'eslint/lib/rules/array-bracket-spacing'>;\n}\ndeclare module 'eslint/lib/rules/array-callback-return.js' {\n  declare module.exports: $Exports<'eslint/lib/rules/array-callback-return'>;\n}\ndeclare module 'eslint/lib/rules/array-element-newline.js' {\n  declare module.exports: $Exports<'eslint/lib/rules/array-element-newline'>;\n}\ndeclare module 'eslint/lib/rules/arrow-body-style.js' {\n  declare module.exports: $Exports<'eslint/lib/rules/arrow-body-style'>;\n}\ndeclare module 'eslint/lib/rules/arrow-parens.js' {\n  declare module.exports: $Exports<'eslint/lib/rules/arrow-parens'>;\n}\ndeclare module 'eslint/lib/rules/arrow-spacing.js' {\n  declare module.exports: $Exports<'eslint/lib/rules/arrow-spacing'>;\n}\ndeclare module 'eslint/lib/rules/block-scoped-var.js' {\n  declare module.exports: $Exports<'eslint/lib/rules/block-scoped-var'>;\n}\ndeclare module 'eslint/lib/rules/block-spacing.js' {\n  declare module.exports: $Exports<'eslint/lib/rules/block-spacing'>;\n}\ndeclare module 'eslint/lib/rules/brace-style.js' {\n  declare module.exports: $Exports<'eslint/lib/rules/brace-style'>;\n}\ndeclare module 'eslint/lib/rules/callback-return.js' {\n  declare module.exports: $Exports<'eslint/lib/rules/callback-return'>;\n}\ndeclare module 'eslint/lib/rules/camelcase.js' {\n  declare module.exports: $Exports<'eslint/lib/rules/camelcase'>;\n}\ndeclare module 'eslint/lib/rules/capitalized-comments.js' {\n  declare module.exports: $Exports<'eslint/lib/rules/capitalized-comments'>;\n}\ndeclare module 'eslint/lib/rules/class-methods-use-this.js' {\n  declare module.exports: $Exports<'eslint/lib/rules/class-methods-use-this'>;\n}\ndeclare module 'eslint/lib/rules/comma-dangle.js' {\n  declare module.exports: $Exports<'eslint/lib/rules/comma-dangle'>;\n}\ndeclare module 'eslint/lib/rules/comma-spacing.js' {\n  declare module.exports: $Exports<'eslint/lib/rules/comma-spacing'>;\n}\ndeclare module 'eslint/lib/rules/comma-style.js' {\n  declare module.exports: $Exports<'eslint/lib/rules/comma-style'>;\n}\ndeclare module 'eslint/lib/rules/complexity.js' {\n  declare module.exports: $Exports<'eslint/lib/rules/complexity'>;\n}\ndeclare module 'eslint/lib/rules/computed-property-spacing.js' {\n  declare module.exports: $Exports<'eslint/lib/rules/computed-property-spacing'>;\n}\ndeclare module 'eslint/lib/rules/consistent-return.js' {\n  declare module.exports: $Exports<'eslint/lib/rules/consistent-return'>;\n}\ndeclare module 'eslint/lib/rules/consistent-this.js' {\n  declare module.exports: $Exports<'eslint/lib/rules/consistent-this'>;\n}\ndeclare module 'eslint/lib/rules/constructor-super.js' {\n  declare module.exports: $Exports<'eslint/lib/rules/constructor-super'>;\n}\ndeclare module 'eslint/lib/rules/curly.js' {\n  declare module.exports: $Exports<'eslint/lib/rules/curly'>;\n}\ndeclare module 'eslint/lib/rules/default-case.js' {\n  declare module.exports: $Exports<'eslint/lib/rules/default-case'>;\n}\ndeclare module 'eslint/lib/rules/dot-location.js' {\n  declare module.exports: $Exports<'eslint/lib/rules/dot-location'>;\n}\ndeclare module 'eslint/lib/rules/dot-notation.js' {\n  declare module.exports: $Exports<'eslint/lib/rules/dot-notation'>;\n}\ndeclare module 'eslint/lib/rules/eol-last.js' {\n  declare module.exports: $Exports<'eslint/lib/rules/eol-last'>;\n}\ndeclare module 'eslint/lib/rules/eqeqeq.js' {\n  declare module.exports: $Exports<'eslint/lib/rules/eqeqeq'>;\n}\ndeclare module 'eslint/lib/rules/for-direction.js' {\n  declare module.exports: $Exports<'eslint/lib/rules/for-direction'>;\n}\ndeclare module 'eslint/lib/rules/func-call-spacing.js' {\n  declare module.exports: $Exports<'eslint/lib/rules/func-call-spacing'>;\n}\ndeclare module 'eslint/lib/rules/func-name-matching.js' {\n  declare module.exports: $Exports<'eslint/lib/rules/func-name-matching'>;\n}\ndeclare module 'eslint/lib/rules/func-names.js' {\n  declare module.exports: $Exports<'eslint/lib/rules/func-names'>;\n}\ndeclare module 'eslint/lib/rules/func-style.js' {\n  declare module.exports: $Exports<'eslint/lib/rules/func-style'>;\n}\ndeclare module 'eslint/lib/rules/function-paren-newline.js' {\n  declare module.exports: $Exports<'eslint/lib/rules/function-paren-newline'>;\n}\ndeclare module 'eslint/lib/rules/generator-star-spacing.js' {\n  declare module.exports: $Exports<'eslint/lib/rules/generator-star-spacing'>;\n}\ndeclare module 'eslint/lib/rules/getter-return.js' {\n  declare module.exports: $Exports<'eslint/lib/rules/getter-return'>;\n}\ndeclare module 'eslint/lib/rules/global-require.js' {\n  declare module.exports: $Exports<'eslint/lib/rules/global-require'>;\n}\ndeclare module 'eslint/lib/rules/guard-for-in.js' {\n  declare module.exports: $Exports<'eslint/lib/rules/guard-for-in'>;\n}\ndeclare module 'eslint/lib/rules/handle-callback-err.js' {\n  declare module.exports: $Exports<'eslint/lib/rules/handle-callback-err'>;\n}\ndeclare module 'eslint/lib/rules/id-blacklist.js' {\n  declare module.exports: $Exports<'eslint/lib/rules/id-blacklist'>;\n}\ndeclare module 'eslint/lib/rules/id-length.js' {\n  declare module.exports: $Exports<'eslint/lib/rules/id-length'>;\n}\ndeclare module 'eslint/lib/rules/id-match.js' {\n  declare module.exports: $Exports<'eslint/lib/rules/id-match'>;\n}\ndeclare module 'eslint/lib/rules/implicit-arrow-linebreak.js' {\n  declare module.exports: $Exports<'eslint/lib/rules/implicit-arrow-linebreak'>;\n}\ndeclare module 'eslint/lib/rules/indent-legacy.js' {\n  declare module.exports: $Exports<'eslint/lib/rules/indent-legacy'>;\n}\ndeclare module 'eslint/lib/rules/indent.js' {\n  declare module.exports: $Exports<'eslint/lib/rules/indent'>;\n}\ndeclare module 'eslint/lib/rules/init-declarations.js' {\n  declare module.exports: $Exports<'eslint/lib/rules/init-declarations'>;\n}\ndeclare module 'eslint/lib/rules/jsx-quotes.js' {\n  declare module.exports: $Exports<'eslint/lib/rules/jsx-quotes'>;\n}\ndeclare module 'eslint/lib/rules/key-spacing.js' {\n  declare module.exports: $Exports<'eslint/lib/rules/key-spacing'>;\n}\ndeclare module 'eslint/lib/rules/keyword-spacing.js' {\n  declare module.exports: $Exports<'eslint/lib/rules/keyword-spacing'>;\n}\ndeclare module 'eslint/lib/rules/line-comment-position.js' {\n  declare module.exports: $Exports<'eslint/lib/rules/line-comment-position'>;\n}\ndeclare module 'eslint/lib/rules/linebreak-style.js' {\n  declare module.exports: $Exports<'eslint/lib/rules/linebreak-style'>;\n}\ndeclare module 'eslint/lib/rules/lines-around-comment.js' {\n  declare module.exports: $Exports<'eslint/lib/rules/lines-around-comment'>;\n}\ndeclare module 'eslint/lib/rules/lines-around-directive.js' {\n  declare module.exports: $Exports<'eslint/lib/rules/lines-around-directive'>;\n}\ndeclare module 'eslint/lib/rules/lines-between-class-members.js' {\n  declare module.exports: $Exports<'eslint/lib/rules/lines-between-class-members'>;\n}\ndeclare module 'eslint/lib/rules/max-depth.js' {\n  declare module.exports: $Exports<'eslint/lib/rules/max-depth'>;\n}\ndeclare module 'eslint/lib/rules/max-len.js' {\n  declare module.exports: $Exports<'eslint/lib/rules/max-len'>;\n}\ndeclare module 'eslint/lib/rules/max-lines.js' {\n  declare module.exports: $Exports<'eslint/lib/rules/max-lines'>;\n}\ndeclare module 'eslint/lib/rules/max-nested-callbacks.js' {\n  declare module.exports: $Exports<'eslint/lib/rules/max-nested-callbacks'>;\n}\ndeclare module 'eslint/lib/rules/max-params.js' {\n  declare module.exports: $Exports<'eslint/lib/rules/max-params'>;\n}\ndeclare module 'eslint/lib/rules/max-statements-per-line.js' {\n  declare module.exports: $Exports<'eslint/lib/rules/max-statements-per-line'>;\n}\ndeclare module 'eslint/lib/rules/max-statements.js' {\n  declare module.exports: $Exports<'eslint/lib/rules/max-statements'>;\n}\ndeclare module 'eslint/lib/rules/multiline-comment-style.js' {\n  declare module.exports: $Exports<'eslint/lib/rules/multiline-comment-style'>;\n}\ndeclare module 'eslint/lib/rules/multiline-ternary.js' {\n  declare module.exports: $Exports<'eslint/lib/rules/multiline-ternary'>;\n}\ndeclare module 'eslint/lib/rules/new-cap.js' {\n  declare module.exports: $Exports<'eslint/lib/rules/new-cap'>;\n}\ndeclare module 'eslint/lib/rules/new-parens.js' {\n  declare module.exports: $Exports<'eslint/lib/rules/new-parens'>;\n}\ndeclare module 'eslint/lib/rules/newline-after-var.js' {\n  declare module.exports: $Exports<'eslint/lib/rules/newline-after-var'>;\n}\ndeclare module 'eslint/lib/rules/newline-before-return.js' {\n  declare module.exports: $Exports<'eslint/lib/rules/newline-before-return'>;\n}\ndeclare module 'eslint/lib/rules/newline-per-chained-call.js' {\n  declare module.exports: $Exports<'eslint/lib/rules/newline-per-chained-call'>;\n}\ndeclare module 'eslint/lib/rules/no-alert.js' {\n  declare module.exports: $Exports<'eslint/lib/rules/no-alert'>;\n}\ndeclare module 'eslint/lib/rules/no-array-constructor.js' {\n  declare module.exports: $Exports<'eslint/lib/rules/no-array-constructor'>;\n}\ndeclare module 'eslint/lib/rules/no-await-in-loop.js' {\n  declare module.exports: $Exports<'eslint/lib/rules/no-await-in-loop'>;\n}\ndeclare module 'eslint/lib/rules/no-bitwise.js' {\n  declare module.exports: $Exports<'eslint/lib/rules/no-bitwise'>;\n}\ndeclare module 'eslint/lib/rules/no-buffer-constructor.js' {\n  declare module.exports: $Exports<'eslint/lib/rules/no-buffer-constructor'>;\n}\ndeclare module 'eslint/lib/rules/no-caller.js' {\n  declare module.exports: $Exports<'eslint/lib/rules/no-caller'>;\n}\ndeclare module 'eslint/lib/rules/no-case-declarations.js' {\n  declare module.exports: $Exports<'eslint/lib/rules/no-case-declarations'>;\n}\ndeclare module 'eslint/lib/rules/no-catch-shadow.js' {\n  declare module.exports: $Exports<'eslint/lib/rules/no-catch-shadow'>;\n}\ndeclare module 'eslint/lib/rules/no-class-assign.js' {\n  declare module.exports: $Exports<'eslint/lib/rules/no-class-assign'>;\n}\ndeclare module 'eslint/lib/rules/no-compare-neg-zero.js' {\n  declare module.exports: $Exports<'eslint/lib/rules/no-compare-neg-zero'>;\n}\ndeclare module 'eslint/lib/rules/no-cond-assign.js' {\n  declare module.exports: $Exports<'eslint/lib/rules/no-cond-assign'>;\n}\ndeclare module 'eslint/lib/rules/no-confusing-arrow.js' {\n  declare module.exports: $Exports<'eslint/lib/rules/no-confusing-arrow'>;\n}\ndeclare module 'eslint/lib/rules/no-console.js' {\n  declare module.exports: $Exports<'eslint/lib/rules/no-console'>;\n}\ndeclare module 'eslint/lib/rules/no-const-assign.js' {\n  declare module.exports: $Exports<'eslint/lib/rules/no-const-assign'>;\n}\ndeclare module 'eslint/lib/rules/no-constant-condition.js' {\n  declare module.exports: $Exports<'eslint/lib/rules/no-constant-condition'>;\n}\ndeclare module 'eslint/lib/rules/no-continue.js' {\n  declare module.exports: $Exports<'eslint/lib/rules/no-continue'>;\n}\ndeclare module 'eslint/lib/rules/no-control-regex.js' {\n  declare module.exports: $Exports<'eslint/lib/rules/no-control-regex'>;\n}\ndeclare module 'eslint/lib/rules/no-debugger.js' {\n  declare module.exports: $Exports<'eslint/lib/rules/no-debugger'>;\n}\ndeclare module 'eslint/lib/rules/no-delete-var.js' {\n  declare module.exports: $Exports<'eslint/lib/rules/no-delete-var'>;\n}\ndeclare module 'eslint/lib/rules/no-div-regex.js' {\n  declare module.exports: $Exports<'eslint/lib/rules/no-div-regex'>;\n}\ndeclare module 'eslint/lib/rules/no-dupe-args.js' {\n  declare module.exports: $Exports<'eslint/lib/rules/no-dupe-args'>;\n}\ndeclare module 'eslint/lib/rules/no-dupe-class-members.js' {\n  declare module.exports: $Exports<'eslint/lib/rules/no-dupe-class-members'>;\n}\ndeclare module 'eslint/lib/rules/no-dupe-keys.js' {\n  declare module.exports: $Exports<'eslint/lib/rules/no-dupe-keys'>;\n}\ndeclare module 'eslint/lib/rules/no-duplicate-case.js' {\n  declare module.exports: $Exports<'eslint/lib/rules/no-duplicate-case'>;\n}\ndeclare module 'eslint/lib/rules/no-duplicate-imports.js' {\n  declare module.exports: $Exports<'eslint/lib/rules/no-duplicate-imports'>;\n}\ndeclare module 'eslint/lib/rules/no-else-return.js' {\n  declare module.exports: $Exports<'eslint/lib/rules/no-else-return'>;\n}\ndeclare module 'eslint/lib/rules/no-empty-character-class.js' {\n  declare module.exports: $Exports<'eslint/lib/rules/no-empty-character-class'>;\n}\ndeclare module 'eslint/lib/rules/no-empty-function.js' {\n  declare module.exports: $Exports<'eslint/lib/rules/no-empty-function'>;\n}\ndeclare module 'eslint/lib/rules/no-empty-pattern.js' {\n  declare module.exports: $Exports<'eslint/lib/rules/no-empty-pattern'>;\n}\ndeclare module 'eslint/lib/rules/no-empty.js' {\n  declare module.exports: $Exports<'eslint/lib/rules/no-empty'>;\n}\ndeclare module 'eslint/lib/rules/no-eq-null.js' {\n  declare module.exports: $Exports<'eslint/lib/rules/no-eq-null'>;\n}\ndeclare module 'eslint/lib/rules/no-eval.js' {\n  declare module.exports: $Exports<'eslint/lib/rules/no-eval'>;\n}\ndeclare module 'eslint/lib/rules/no-ex-assign.js' {\n  declare module.exports: $Exports<'eslint/lib/rules/no-ex-assign'>;\n}\ndeclare module 'eslint/lib/rules/no-extend-native.js' {\n  declare module.exports: $Exports<'eslint/lib/rules/no-extend-native'>;\n}\ndeclare module 'eslint/lib/rules/no-extra-bind.js' {\n  declare module.exports: $Exports<'eslint/lib/rules/no-extra-bind'>;\n}\ndeclare module 'eslint/lib/rules/no-extra-boolean-cast.js' {\n  declare module.exports: $Exports<'eslint/lib/rules/no-extra-boolean-cast'>;\n}\ndeclare module 'eslint/lib/rules/no-extra-label.js' {\n  declare module.exports: $Exports<'eslint/lib/rules/no-extra-label'>;\n}\ndeclare module 'eslint/lib/rules/no-extra-parens.js' {\n  declare module.exports: $Exports<'eslint/lib/rules/no-extra-parens'>;\n}\ndeclare module 'eslint/lib/rules/no-extra-semi.js' {\n  declare module.exports: $Exports<'eslint/lib/rules/no-extra-semi'>;\n}\ndeclare module 'eslint/lib/rules/no-fallthrough.js' {\n  declare module.exports: $Exports<'eslint/lib/rules/no-fallthrough'>;\n}\ndeclare module 'eslint/lib/rules/no-floating-decimal.js' {\n  declare module.exports: $Exports<'eslint/lib/rules/no-floating-decimal'>;\n}\ndeclare module 'eslint/lib/rules/no-func-assign.js' {\n  declare module.exports: $Exports<'eslint/lib/rules/no-func-assign'>;\n}\ndeclare module 'eslint/lib/rules/no-global-assign.js' {\n  declare module.exports: $Exports<'eslint/lib/rules/no-global-assign'>;\n}\ndeclare module 'eslint/lib/rules/no-implicit-coercion.js' {\n  declare module.exports: $Exports<'eslint/lib/rules/no-implicit-coercion'>;\n}\ndeclare module 'eslint/lib/rules/no-implicit-globals.js' {\n  declare module.exports: $Exports<'eslint/lib/rules/no-implicit-globals'>;\n}\ndeclare module 'eslint/lib/rules/no-implied-eval.js' {\n  declare module.exports: $Exports<'eslint/lib/rules/no-implied-eval'>;\n}\ndeclare module 'eslint/lib/rules/no-inline-comments.js' {\n  declare module.exports: $Exports<'eslint/lib/rules/no-inline-comments'>;\n}\ndeclare module 'eslint/lib/rules/no-inner-declarations.js' {\n  declare module.exports: $Exports<'eslint/lib/rules/no-inner-declarations'>;\n}\ndeclare module 'eslint/lib/rules/no-invalid-regexp.js' {\n  declare module.exports: $Exports<'eslint/lib/rules/no-invalid-regexp'>;\n}\ndeclare module 'eslint/lib/rules/no-invalid-this.js' {\n  declare module.exports: $Exports<'eslint/lib/rules/no-invalid-this'>;\n}\ndeclare module 'eslint/lib/rules/no-irregular-whitespace.js' {\n  declare module.exports: $Exports<'eslint/lib/rules/no-irregular-whitespace'>;\n}\ndeclare module 'eslint/lib/rules/no-iterator.js' {\n  declare module.exports: $Exports<'eslint/lib/rules/no-iterator'>;\n}\ndeclare module 'eslint/lib/rules/no-label-var.js' {\n  declare module.exports: $Exports<'eslint/lib/rules/no-label-var'>;\n}\ndeclare module 'eslint/lib/rules/no-labels.js' {\n  declare module.exports: $Exports<'eslint/lib/rules/no-labels'>;\n}\ndeclare module 'eslint/lib/rules/no-lone-blocks.js' {\n  declare module.exports: $Exports<'eslint/lib/rules/no-lone-blocks'>;\n}\ndeclare module 'eslint/lib/rules/no-lonely-if.js' {\n  declare module.exports: $Exports<'eslint/lib/rules/no-lonely-if'>;\n}\ndeclare module 'eslint/lib/rules/no-loop-func.js' {\n  declare module.exports: $Exports<'eslint/lib/rules/no-loop-func'>;\n}\ndeclare module 'eslint/lib/rules/no-magic-numbers.js' {\n  declare module.exports: $Exports<'eslint/lib/rules/no-magic-numbers'>;\n}\ndeclare module 'eslint/lib/rules/no-mixed-operators.js' {\n  declare module.exports: $Exports<'eslint/lib/rules/no-mixed-operators'>;\n}\ndeclare module 'eslint/lib/rules/no-mixed-requires.js' {\n  declare module.exports: $Exports<'eslint/lib/rules/no-mixed-requires'>;\n}\ndeclare module 'eslint/lib/rules/no-mixed-spaces-and-tabs.js' {\n  declare module.exports: $Exports<'eslint/lib/rules/no-mixed-spaces-and-tabs'>;\n}\ndeclare module 'eslint/lib/rules/no-multi-assign.js' {\n  declare module.exports: $Exports<'eslint/lib/rules/no-multi-assign'>;\n}\ndeclare module 'eslint/lib/rules/no-multi-spaces.js' {\n  declare module.exports: $Exports<'eslint/lib/rules/no-multi-spaces'>;\n}\ndeclare module 'eslint/lib/rules/no-multi-str.js' {\n  declare module.exports: $Exports<'eslint/lib/rules/no-multi-str'>;\n}\ndeclare module 'eslint/lib/rules/no-multiple-empty-lines.js' {\n  declare module.exports: $Exports<'eslint/lib/rules/no-multiple-empty-lines'>;\n}\ndeclare module 'eslint/lib/rules/no-native-reassign.js' {\n  declare module.exports: $Exports<'eslint/lib/rules/no-native-reassign'>;\n}\ndeclare module 'eslint/lib/rules/no-negated-condition.js' {\n  declare module.exports: $Exports<'eslint/lib/rules/no-negated-condition'>;\n}\ndeclare module 'eslint/lib/rules/no-negated-in-lhs.js' {\n  declare module.exports: $Exports<'eslint/lib/rules/no-negated-in-lhs'>;\n}\ndeclare module 'eslint/lib/rules/no-nested-ternary.js' {\n  declare module.exports: $Exports<'eslint/lib/rules/no-nested-ternary'>;\n}\ndeclare module 'eslint/lib/rules/no-new-func.js' {\n  declare module.exports: $Exports<'eslint/lib/rules/no-new-func'>;\n}\ndeclare module 'eslint/lib/rules/no-new-object.js' {\n  declare module.exports: $Exports<'eslint/lib/rules/no-new-object'>;\n}\ndeclare module 'eslint/lib/rules/no-new-require.js' {\n  declare module.exports: $Exports<'eslint/lib/rules/no-new-require'>;\n}\ndeclare module 'eslint/lib/rules/no-new-symbol.js' {\n  declare module.exports: $Exports<'eslint/lib/rules/no-new-symbol'>;\n}\ndeclare module 'eslint/lib/rules/no-new-wrappers.js' {\n  declare module.exports: $Exports<'eslint/lib/rules/no-new-wrappers'>;\n}\ndeclare module 'eslint/lib/rules/no-new.js' {\n  declare module.exports: $Exports<'eslint/lib/rules/no-new'>;\n}\ndeclare module 'eslint/lib/rules/no-obj-calls.js' {\n  declare module.exports: $Exports<'eslint/lib/rules/no-obj-calls'>;\n}\ndeclare module 'eslint/lib/rules/no-octal-escape.js' {\n  declare module.exports: $Exports<'eslint/lib/rules/no-octal-escape'>;\n}\ndeclare module 'eslint/lib/rules/no-octal.js' {\n  declare module.exports: $Exports<'eslint/lib/rules/no-octal'>;\n}\ndeclare module 'eslint/lib/rules/no-param-reassign.js' {\n  declare module.exports: $Exports<'eslint/lib/rules/no-param-reassign'>;\n}\ndeclare module 'eslint/lib/rules/no-path-concat.js' {\n  declare module.exports: $Exports<'eslint/lib/rules/no-path-concat'>;\n}\ndeclare module 'eslint/lib/rules/no-plusplus.js' {\n  declare module.exports: $Exports<'eslint/lib/rules/no-plusplus'>;\n}\ndeclare module 'eslint/lib/rules/no-process-env.js' {\n  declare module.exports: $Exports<'eslint/lib/rules/no-process-env'>;\n}\ndeclare module 'eslint/lib/rules/no-process-exit.js' {\n  declare module.exports: $Exports<'eslint/lib/rules/no-process-exit'>;\n}\ndeclare module 'eslint/lib/rules/no-proto.js' {\n  declare module.exports: $Exports<'eslint/lib/rules/no-proto'>;\n}\ndeclare module 'eslint/lib/rules/no-prototype-builtins.js' {\n  declare module.exports: $Exports<'eslint/lib/rules/no-prototype-builtins'>;\n}\ndeclare module 'eslint/lib/rules/no-redeclare.js' {\n  declare module.exports: $Exports<'eslint/lib/rules/no-redeclare'>;\n}\ndeclare module 'eslint/lib/rules/no-regex-spaces.js' {\n  declare module.exports: $Exports<'eslint/lib/rules/no-regex-spaces'>;\n}\ndeclare module 'eslint/lib/rules/no-restricted-globals.js' {\n  declare module.exports: $Exports<'eslint/lib/rules/no-restricted-globals'>;\n}\ndeclare module 'eslint/lib/rules/no-restricted-imports.js' {\n  declare module.exports: $Exports<'eslint/lib/rules/no-restricted-imports'>;\n}\ndeclare module 'eslint/lib/rules/no-restricted-modules.js' {\n  declare module.exports: $Exports<'eslint/lib/rules/no-restricted-modules'>;\n}\ndeclare module 'eslint/lib/rules/no-restricted-properties.js' {\n  declare module.exports: $Exports<'eslint/lib/rules/no-restricted-properties'>;\n}\ndeclare module 'eslint/lib/rules/no-restricted-syntax.js' {\n  declare module.exports: $Exports<'eslint/lib/rules/no-restricted-syntax'>;\n}\ndeclare module 'eslint/lib/rules/no-return-assign.js' {\n  declare module.exports: $Exports<'eslint/lib/rules/no-return-assign'>;\n}\ndeclare module 'eslint/lib/rules/no-return-await.js' {\n  declare module.exports: $Exports<'eslint/lib/rules/no-return-await'>;\n}\ndeclare module 'eslint/lib/rules/no-script-url.js' {\n  declare module.exports: $Exports<'eslint/lib/rules/no-script-url'>;\n}\ndeclare module 'eslint/lib/rules/no-self-assign.js' {\n  declare module.exports: $Exports<'eslint/lib/rules/no-self-assign'>;\n}\ndeclare module 'eslint/lib/rules/no-self-compare.js' {\n  declare module.exports: $Exports<'eslint/lib/rules/no-self-compare'>;\n}\ndeclare module 'eslint/lib/rules/no-sequences.js' {\n  declare module.exports: $Exports<'eslint/lib/rules/no-sequences'>;\n}\ndeclare module 'eslint/lib/rules/no-shadow-restricted-names.js' {\n  declare module.exports: $Exports<'eslint/lib/rules/no-shadow-restricted-names'>;\n}\ndeclare module 'eslint/lib/rules/no-shadow.js' {\n  declare module.exports: $Exports<'eslint/lib/rules/no-shadow'>;\n}\ndeclare module 'eslint/lib/rules/no-spaced-func.js' {\n  declare module.exports: $Exports<'eslint/lib/rules/no-spaced-func'>;\n}\ndeclare module 'eslint/lib/rules/no-sparse-arrays.js' {\n  declare module.exports: $Exports<'eslint/lib/rules/no-sparse-arrays'>;\n}\ndeclare module 'eslint/lib/rules/no-sync.js' {\n  declare module.exports: $Exports<'eslint/lib/rules/no-sync'>;\n}\ndeclare module 'eslint/lib/rules/no-tabs.js' {\n  declare module.exports: $Exports<'eslint/lib/rules/no-tabs'>;\n}\ndeclare module 'eslint/lib/rules/no-template-curly-in-string.js' {\n  declare module.exports: $Exports<'eslint/lib/rules/no-template-curly-in-string'>;\n}\ndeclare module 'eslint/lib/rules/no-ternary.js' {\n  declare module.exports: $Exports<'eslint/lib/rules/no-ternary'>;\n}\ndeclare module 'eslint/lib/rules/no-this-before-super.js' {\n  declare module.exports: $Exports<'eslint/lib/rules/no-this-before-super'>;\n}\ndeclare module 'eslint/lib/rules/no-throw-literal.js' {\n  declare module.exports: $Exports<'eslint/lib/rules/no-throw-literal'>;\n}\ndeclare module 'eslint/lib/rules/no-trailing-spaces.js' {\n  declare module.exports: $Exports<'eslint/lib/rules/no-trailing-spaces'>;\n}\ndeclare module 'eslint/lib/rules/no-undef-init.js' {\n  declare module.exports: $Exports<'eslint/lib/rules/no-undef-init'>;\n}\ndeclare module 'eslint/lib/rules/no-undef.js' {\n  declare module.exports: $Exports<'eslint/lib/rules/no-undef'>;\n}\ndeclare module 'eslint/lib/rules/no-undefined.js' {\n  declare module.exports: $Exports<'eslint/lib/rules/no-undefined'>;\n}\ndeclare module 'eslint/lib/rules/no-underscore-dangle.js' {\n  declare module.exports: $Exports<'eslint/lib/rules/no-underscore-dangle'>;\n}\ndeclare module 'eslint/lib/rules/no-unexpected-multiline.js' {\n  declare module.exports: $Exports<'eslint/lib/rules/no-unexpected-multiline'>;\n}\ndeclare module 'eslint/lib/rules/no-unmodified-loop-condition.js' {\n  declare module.exports: $Exports<'eslint/lib/rules/no-unmodified-loop-condition'>;\n}\ndeclare module 'eslint/lib/rules/no-unneeded-ternary.js' {\n  declare module.exports: $Exports<'eslint/lib/rules/no-unneeded-ternary'>;\n}\ndeclare module 'eslint/lib/rules/no-unreachable.js' {\n  declare module.exports: $Exports<'eslint/lib/rules/no-unreachable'>;\n}\ndeclare module 'eslint/lib/rules/no-unsafe-finally.js' {\n  declare module.exports: $Exports<'eslint/lib/rules/no-unsafe-finally'>;\n}\ndeclare module 'eslint/lib/rules/no-unsafe-negation.js' {\n  declare module.exports: $Exports<'eslint/lib/rules/no-unsafe-negation'>;\n}\ndeclare module 'eslint/lib/rules/no-unused-expressions.js' {\n  declare module.exports: $Exports<'eslint/lib/rules/no-unused-expressions'>;\n}\ndeclare module 'eslint/lib/rules/no-unused-labels.js' {\n  declare module.exports: $Exports<'eslint/lib/rules/no-unused-labels'>;\n}\ndeclare module 'eslint/lib/rules/no-unused-vars.js' {\n  declare module.exports: $Exports<'eslint/lib/rules/no-unused-vars'>;\n}\ndeclare module 'eslint/lib/rules/no-use-before-define.js' {\n  declare module.exports: $Exports<'eslint/lib/rules/no-use-before-define'>;\n}\ndeclare module 'eslint/lib/rules/no-useless-call.js' {\n  declare module.exports: $Exports<'eslint/lib/rules/no-useless-call'>;\n}\ndeclare module 'eslint/lib/rules/no-useless-computed-key.js' {\n  declare module.exports: $Exports<'eslint/lib/rules/no-useless-computed-key'>;\n}\ndeclare module 'eslint/lib/rules/no-useless-concat.js' {\n  declare module.exports: $Exports<'eslint/lib/rules/no-useless-concat'>;\n}\ndeclare module 'eslint/lib/rules/no-useless-constructor.js' {\n  declare module.exports: $Exports<'eslint/lib/rules/no-useless-constructor'>;\n}\ndeclare module 'eslint/lib/rules/no-useless-escape.js' {\n  declare module.exports: $Exports<'eslint/lib/rules/no-useless-escape'>;\n}\ndeclare module 'eslint/lib/rules/no-useless-rename.js' {\n  declare module.exports: $Exports<'eslint/lib/rules/no-useless-rename'>;\n}\ndeclare module 'eslint/lib/rules/no-useless-return.js' {\n  declare module.exports: $Exports<'eslint/lib/rules/no-useless-return'>;\n}\ndeclare module 'eslint/lib/rules/no-var.js' {\n  declare module.exports: $Exports<'eslint/lib/rules/no-var'>;\n}\ndeclare module 'eslint/lib/rules/no-void.js' {\n  declare module.exports: $Exports<'eslint/lib/rules/no-void'>;\n}\ndeclare module 'eslint/lib/rules/no-warning-comments.js' {\n  declare module.exports: $Exports<'eslint/lib/rules/no-warning-comments'>;\n}\ndeclare module 'eslint/lib/rules/no-whitespace-before-property.js' {\n  declare module.exports: $Exports<'eslint/lib/rules/no-whitespace-before-property'>;\n}\ndeclare module 'eslint/lib/rules/no-with.js' {\n  declare module.exports: $Exports<'eslint/lib/rules/no-with'>;\n}\ndeclare module 'eslint/lib/rules/nonblock-statement-body-position.js' {\n  declare module.exports: $Exports<'eslint/lib/rules/nonblock-statement-body-position'>;\n}\ndeclare module 'eslint/lib/rules/object-curly-newline.js' {\n  declare module.exports: $Exports<'eslint/lib/rules/object-curly-newline'>;\n}\ndeclare module 'eslint/lib/rules/object-curly-spacing.js' {\n  declare module.exports: $Exports<'eslint/lib/rules/object-curly-spacing'>;\n}\ndeclare module 'eslint/lib/rules/object-property-newline.js' {\n  declare module.exports: $Exports<'eslint/lib/rules/object-property-newline'>;\n}\ndeclare module 'eslint/lib/rules/object-shorthand.js' {\n  declare module.exports: $Exports<'eslint/lib/rules/object-shorthand'>;\n}\ndeclare module 'eslint/lib/rules/one-var-declaration-per-line.js' {\n  declare module.exports: $Exports<'eslint/lib/rules/one-var-declaration-per-line'>;\n}\ndeclare module 'eslint/lib/rules/one-var.js' {\n  declare module.exports: $Exports<'eslint/lib/rules/one-var'>;\n}\ndeclare module 'eslint/lib/rules/operator-assignment.js' {\n  declare module.exports: $Exports<'eslint/lib/rules/operator-assignment'>;\n}\ndeclare module 'eslint/lib/rules/operator-linebreak.js' {\n  declare module.exports: $Exports<'eslint/lib/rules/operator-linebreak'>;\n}\ndeclare module 'eslint/lib/rules/padded-blocks.js' {\n  declare module.exports: $Exports<'eslint/lib/rules/padded-blocks'>;\n}\ndeclare module 'eslint/lib/rules/padding-line-between-statements.js' {\n  declare module.exports: $Exports<'eslint/lib/rules/padding-line-between-statements'>;\n}\ndeclare module 'eslint/lib/rules/prefer-arrow-callback.js' {\n  declare module.exports: $Exports<'eslint/lib/rules/prefer-arrow-callback'>;\n}\ndeclare module 'eslint/lib/rules/prefer-const.js' {\n  declare module.exports: $Exports<'eslint/lib/rules/prefer-const'>;\n}\ndeclare module 'eslint/lib/rules/prefer-destructuring.js' {\n  declare module.exports: $Exports<'eslint/lib/rules/prefer-destructuring'>;\n}\ndeclare module 'eslint/lib/rules/prefer-numeric-literals.js' {\n  declare module.exports: $Exports<'eslint/lib/rules/prefer-numeric-literals'>;\n}\ndeclare module 'eslint/lib/rules/prefer-promise-reject-errors.js' {\n  declare module.exports: $Exports<'eslint/lib/rules/prefer-promise-reject-errors'>;\n}\ndeclare module 'eslint/lib/rules/prefer-reflect.js' {\n  declare module.exports: $Exports<'eslint/lib/rules/prefer-reflect'>;\n}\ndeclare module 'eslint/lib/rules/prefer-rest-params.js' {\n  declare module.exports: $Exports<'eslint/lib/rules/prefer-rest-params'>;\n}\ndeclare module 'eslint/lib/rules/prefer-spread.js' {\n  declare module.exports: $Exports<'eslint/lib/rules/prefer-spread'>;\n}\ndeclare module 'eslint/lib/rules/prefer-template.js' {\n  declare module.exports: $Exports<'eslint/lib/rules/prefer-template'>;\n}\ndeclare module 'eslint/lib/rules/quote-props.js' {\n  declare module.exports: $Exports<'eslint/lib/rules/quote-props'>;\n}\ndeclare module 'eslint/lib/rules/quotes.js' {\n  declare module.exports: $Exports<'eslint/lib/rules/quotes'>;\n}\ndeclare module 'eslint/lib/rules/radix.js' {\n  declare module.exports: $Exports<'eslint/lib/rules/radix'>;\n}\ndeclare module 'eslint/lib/rules/require-await.js' {\n  declare module.exports: $Exports<'eslint/lib/rules/require-await'>;\n}\ndeclare module 'eslint/lib/rules/require-jsdoc.js' {\n  declare module.exports: $Exports<'eslint/lib/rules/require-jsdoc'>;\n}\ndeclare module 'eslint/lib/rules/require-yield.js' {\n  declare module.exports: $Exports<'eslint/lib/rules/require-yield'>;\n}\ndeclare module 'eslint/lib/rules/rest-spread-spacing.js' {\n  declare module.exports: $Exports<'eslint/lib/rules/rest-spread-spacing'>;\n}\ndeclare module 'eslint/lib/rules/semi-spacing.js' {\n  declare module.exports: $Exports<'eslint/lib/rules/semi-spacing'>;\n}\ndeclare module 'eslint/lib/rules/semi-style.js' {\n  declare module.exports: $Exports<'eslint/lib/rules/semi-style'>;\n}\ndeclare module 'eslint/lib/rules/semi.js' {\n  declare module.exports: $Exports<'eslint/lib/rules/semi'>;\n}\ndeclare module 'eslint/lib/rules/sort-imports.js' {\n  declare module.exports: $Exports<'eslint/lib/rules/sort-imports'>;\n}\ndeclare module 'eslint/lib/rules/sort-keys.js' {\n  declare module.exports: $Exports<'eslint/lib/rules/sort-keys'>;\n}\ndeclare module 'eslint/lib/rules/sort-vars.js' {\n  declare module.exports: $Exports<'eslint/lib/rules/sort-vars'>;\n}\ndeclare module 'eslint/lib/rules/space-before-blocks.js' {\n  declare module.exports: $Exports<'eslint/lib/rules/space-before-blocks'>;\n}\ndeclare module 'eslint/lib/rules/space-before-function-paren.js' {\n  declare module.exports: $Exports<'eslint/lib/rules/space-before-function-paren'>;\n}\ndeclare module 'eslint/lib/rules/space-in-parens.js' {\n  declare module.exports: $Exports<'eslint/lib/rules/space-in-parens'>;\n}\ndeclare module 'eslint/lib/rules/space-infix-ops.js' {\n  declare module.exports: $Exports<'eslint/lib/rules/space-infix-ops'>;\n}\ndeclare module 'eslint/lib/rules/space-unary-ops.js' {\n  declare module.exports: $Exports<'eslint/lib/rules/space-unary-ops'>;\n}\ndeclare module 'eslint/lib/rules/spaced-comment.js' {\n  declare module.exports: $Exports<'eslint/lib/rules/spaced-comment'>;\n}\ndeclare module 'eslint/lib/rules/strict.js' {\n  declare module.exports: $Exports<'eslint/lib/rules/strict'>;\n}\ndeclare module 'eslint/lib/rules/switch-colon-spacing.js' {\n  declare module.exports: $Exports<'eslint/lib/rules/switch-colon-spacing'>;\n}\ndeclare module 'eslint/lib/rules/symbol-description.js' {\n  declare module.exports: $Exports<'eslint/lib/rules/symbol-description'>;\n}\ndeclare module 'eslint/lib/rules/template-curly-spacing.js' {\n  declare module.exports: $Exports<'eslint/lib/rules/template-curly-spacing'>;\n}\ndeclare module 'eslint/lib/rules/template-tag-spacing.js' {\n  declare module.exports: $Exports<'eslint/lib/rules/template-tag-spacing'>;\n}\ndeclare module 'eslint/lib/rules/unicode-bom.js' {\n  declare module.exports: $Exports<'eslint/lib/rules/unicode-bom'>;\n}\ndeclare module 'eslint/lib/rules/use-isnan.js' {\n  declare module.exports: $Exports<'eslint/lib/rules/use-isnan'>;\n}\ndeclare module 'eslint/lib/rules/valid-jsdoc.js' {\n  declare module.exports: $Exports<'eslint/lib/rules/valid-jsdoc'>;\n}\ndeclare module 'eslint/lib/rules/valid-typeof.js' {\n  declare module.exports: $Exports<'eslint/lib/rules/valid-typeof'>;\n}\ndeclare module 'eslint/lib/rules/vars-on-top.js' {\n  declare module.exports: $Exports<'eslint/lib/rules/vars-on-top'>;\n}\ndeclare module 'eslint/lib/rules/wrap-iife.js' {\n  declare module.exports: $Exports<'eslint/lib/rules/wrap-iife'>;\n}\ndeclare module 'eslint/lib/rules/wrap-regex.js' {\n  declare module.exports: $Exports<'eslint/lib/rules/wrap-regex'>;\n}\ndeclare module 'eslint/lib/rules/yield-star-spacing.js' {\n  declare module.exports: $Exports<'eslint/lib/rules/yield-star-spacing'>;\n}\ndeclare module 'eslint/lib/rules/yoda.js' {\n  declare module.exports: $Exports<'eslint/lib/rules/yoda'>;\n}\ndeclare module 'eslint/lib/testers/rule-tester.js' {\n  declare module.exports: $Exports<'eslint/lib/testers/rule-tester'>;\n}\ndeclare module 'eslint/lib/timing.js' {\n  declare module.exports: $Exports<'eslint/lib/timing'>;\n}\ndeclare module 'eslint/lib/token-store/backward-token-comment-cursor.js' {\n  declare module.exports: $Exports<'eslint/lib/token-store/backward-token-comment-cursor'>;\n}\ndeclare module 'eslint/lib/token-store/backward-token-cursor.js' {\n  declare module.exports: $Exports<'eslint/lib/token-store/backward-token-cursor'>;\n}\ndeclare module 'eslint/lib/token-store/cursor.js' {\n  declare module.exports: $Exports<'eslint/lib/token-store/cursor'>;\n}\ndeclare module 'eslint/lib/token-store/cursors.js' {\n  declare module.exports: $Exports<'eslint/lib/token-store/cursors'>;\n}\ndeclare module 'eslint/lib/token-store/decorative-cursor.js' {\n  declare module.exports: $Exports<'eslint/lib/token-store/decorative-cursor'>;\n}\ndeclare module 'eslint/lib/token-store/filter-cursor.js' {\n  declare module.exports: $Exports<'eslint/lib/token-store/filter-cursor'>;\n}\ndeclare module 'eslint/lib/token-store/forward-token-comment-cursor.js' {\n  declare module.exports: $Exports<'eslint/lib/token-store/forward-token-comment-cursor'>;\n}\ndeclare module 'eslint/lib/token-store/forward-token-cursor.js' {\n  declare module.exports: $Exports<'eslint/lib/token-store/forward-token-cursor'>;\n}\ndeclare module 'eslint/lib/token-store/index.js' {\n  declare module.exports: $Exports<'eslint/lib/token-store/index'>;\n}\ndeclare module 'eslint/lib/token-store/limit-cursor.js' {\n  declare module.exports: $Exports<'eslint/lib/token-store/limit-cursor'>;\n}\ndeclare module 'eslint/lib/token-store/padded-token-cursor.js' {\n  declare module.exports: $Exports<'eslint/lib/token-store/padded-token-cursor'>;\n}\ndeclare module 'eslint/lib/token-store/skip-cursor.js' {\n  declare module.exports: $Exports<'eslint/lib/token-store/skip-cursor'>;\n}\ndeclare module 'eslint/lib/token-store/utils.js' {\n  declare module.exports: $Exports<'eslint/lib/token-store/utils'>;\n}\ndeclare module 'eslint/lib/util/ajv.js' {\n  declare module.exports: $Exports<'eslint/lib/util/ajv'>;\n}\ndeclare module 'eslint/lib/util/apply-disable-directives.js' {\n  declare module.exports: $Exports<'eslint/lib/util/apply-disable-directives'>;\n}\ndeclare module 'eslint/lib/util/fix-tracker.js' {\n  declare module.exports: $Exports<'eslint/lib/util/fix-tracker'>;\n}\ndeclare module 'eslint/lib/util/glob-util.js' {\n  declare module.exports: $Exports<'eslint/lib/util/glob-util'>;\n}\ndeclare module 'eslint/lib/util/glob.js' {\n  declare module.exports: $Exports<'eslint/lib/util/glob'>;\n}\ndeclare module 'eslint/lib/util/hash.js' {\n  declare module.exports: $Exports<'eslint/lib/util/hash'>;\n}\ndeclare module 'eslint/lib/util/interpolate.js' {\n  declare module.exports: $Exports<'eslint/lib/util/interpolate'>;\n}\ndeclare module 'eslint/lib/util/keywords.js' {\n  declare module.exports: $Exports<'eslint/lib/util/keywords'>;\n}\ndeclare module 'eslint/lib/util/module-resolver.js' {\n  declare module.exports: $Exports<'eslint/lib/util/module-resolver'>;\n}\ndeclare module 'eslint/lib/util/naming.js' {\n  declare module.exports: $Exports<'eslint/lib/util/naming'>;\n}\ndeclare module 'eslint/lib/util/node-event-generator.js' {\n  declare module.exports: $Exports<'eslint/lib/util/node-event-generator'>;\n}\ndeclare module 'eslint/lib/util/npm-util.js' {\n  declare module.exports: $Exports<'eslint/lib/util/npm-util'>;\n}\ndeclare module 'eslint/lib/util/path-util.js' {\n  declare module.exports: $Exports<'eslint/lib/util/path-util'>;\n}\ndeclare module 'eslint/lib/util/patterns/letters.js' {\n  declare module.exports: $Exports<'eslint/lib/util/patterns/letters'>;\n}\ndeclare module 'eslint/lib/util/rule-fixer.js' {\n  declare module.exports: $Exports<'eslint/lib/util/rule-fixer'>;\n}\ndeclare module 'eslint/lib/util/safe-emitter.js' {\n  declare module.exports: $Exports<'eslint/lib/util/safe-emitter'>;\n}\ndeclare module 'eslint/lib/util/source-code-fixer.js' {\n  declare module.exports: $Exports<'eslint/lib/util/source-code-fixer'>;\n}\ndeclare module 'eslint/lib/util/source-code-util.js' {\n  declare module.exports: $Exports<'eslint/lib/util/source-code-util'>;\n}\ndeclare module 'eslint/lib/util/source-code.js' {\n  declare module.exports: $Exports<'eslint/lib/util/source-code'>;\n}\ndeclare module 'eslint/lib/util/traverser.js' {\n  declare module.exports: $Exports<'eslint/lib/util/traverser'>;\n}\ndeclare module 'eslint/lib/util/xml-escape.js' {\n  declare module.exports: $Exports<'eslint/lib/util/xml-escape'>;\n}\n"
  },
  {
    "path": "flow-typed/npm/flow-typed_vx.x.x.js",
    "content": "// flow-typed signature: ec72cd943af888764fdb66e85aa5c067\n// flow-typed version: <<STUB>>/flow-typed_v^2.3.0/flow_v0.76.0\n\n/**\n * This is an autogenerated libdef stub for:\n *\n *   'flow-typed'\n *\n * Fill this stub out by replacing all the `any` types.\n *\n * Once filled out, we encourage you to share your work with the\n * community by sending a pull request to:\n * https://github.com/flowtype/flow-typed\n */\n\ndeclare module 'flow-typed' {\n  declare module.exports: any;\n}\n\n/**\n * We include stubs for each file inside this npm package in case you need to\n * require those files directly. Feel free to delete any files that aren't\n * needed.\n */\ndeclare module 'flow-typed/dist/cli' {\n  declare module.exports: any;\n}\n\ndeclare module 'flow-typed/dist/commands/create-stub' {\n  declare module.exports: any;\n}\n\ndeclare module 'flow-typed/dist/commands/install' {\n  declare module.exports: any;\n}\n\ndeclare module 'flow-typed/dist/commands/runTests' {\n  declare module.exports: any;\n}\n\ndeclare module 'flow-typed/dist/commands/search' {\n  declare module.exports: any;\n}\n\ndeclare module 'flow-typed/dist/commands/update-cache' {\n  declare module.exports: any;\n}\n\ndeclare module 'flow-typed/dist/commands/update' {\n  declare module.exports: any;\n}\n\ndeclare module 'flow-typed/dist/commands/validateDefs' {\n  declare module.exports: any;\n}\n\ndeclare module 'flow-typed/dist/commands/version' {\n  declare module.exports: any;\n}\n\ndeclare module 'flow-typed/dist/lib/cacheRepoUtils' {\n  declare module.exports: any;\n}\n\ndeclare module 'flow-typed/dist/lib/codeSign' {\n  declare module.exports: any;\n}\n\ndeclare module 'flow-typed/dist/lib/fileUtils' {\n  declare module.exports: any;\n}\n\ndeclare module 'flow-typed/dist/lib/flowProjectUtils' {\n  declare module.exports: any;\n}\n\ndeclare module 'flow-typed/dist/lib/flowVersion' {\n  declare module.exports: any;\n}\n\ndeclare module 'flow-typed/dist/lib/git' {\n  declare module.exports: any;\n}\n\ndeclare module 'flow-typed/dist/lib/github' {\n  declare module.exports: any;\n}\n\ndeclare module 'flow-typed/dist/lib/isInFlowTypedRepo' {\n  declare module.exports: any;\n}\n\ndeclare module 'flow-typed/dist/lib/libDefs' {\n  declare module.exports: any;\n}\n\ndeclare module 'flow-typed/dist/lib/node' {\n  declare module.exports: any;\n}\n\ndeclare module 'flow-typed/dist/lib/npm/npmLibDefs' {\n  declare module.exports: any;\n}\n\ndeclare module 'flow-typed/dist/lib/npm/npmProjectUtils' {\n  declare module.exports: any;\n}\n\ndeclare module 'flow-typed/dist/lib/semver' {\n  declare module.exports: any;\n}\n\ndeclare module 'flow-typed/dist/lib/stubUtils' {\n  declare module.exports: any;\n}\n\ndeclare module 'flow-typed/dist/lib/validationErrors' {\n  declare module.exports: any;\n}\n\n// Filename aliases\ndeclare module 'flow-typed/dist/cli.js' {\n  declare module.exports: $Exports<'flow-typed/dist/cli'>;\n}\ndeclare module 'flow-typed/dist/commands/create-stub.js' {\n  declare module.exports: $Exports<'flow-typed/dist/commands/create-stub'>;\n}\ndeclare module 'flow-typed/dist/commands/install.js' {\n  declare module.exports: $Exports<'flow-typed/dist/commands/install'>;\n}\ndeclare module 'flow-typed/dist/commands/runTests.js' {\n  declare module.exports: $Exports<'flow-typed/dist/commands/runTests'>;\n}\ndeclare module 'flow-typed/dist/commands/search.js' {\n  declare module.exports: $Exports<'flow-typed/dist/commands/search'>;\n}\ndeclare module 'flow-typed/dist/commands/update-cache.js' {\n  declare module.exports: $Exports<'flow-typed/dist/commands/update-cache'>;\n}\ndeclare module 'flow-typed/dist/commands/update.js' {\n  declare module.exports: $Exports<'flow-typed/dist/commands/update'>;\n}\ndeclare module 'flow-typed/dist/commands/validateDefs.js' {\n  declare module.exports: $Exports<'flow-typed/dist/commands/validateDefs'>;\n}\ndeclare module 'flow-typed/dist/commands/version.js' {\n  declare module.exports: $Exports<'flow-typed/dist/commands/version'>;\n}\ndeclare module 'flow-typed/dist/lib/cacheRepoUtils.js' {\n  declare module.exports: $Exports<'flow-typed/dist/lib/cacheRepoUtils'>;\n}\ndeclare module 'flow-typed/dist/lib/codeSign.js' {\n  declare module.exports: $Exports<'flow-typed/dist/lib/codeSign'>;\n}\ndeclare module 'flow-typed/dist/lib/fileUtils.js' {\n  declare module.exports: $Exports<'flow-typed/dist/lib/fileUtils'>;\n}\ndeclare module 'flow-typed/dist/lib/flowProjectUtils.js' {\n  declare module.exports: $Exports<'flow-typed/dist/lib/flowProjectUtils'>;\n}\ndeclare module 'flow-typed/dist/lib/flowVersion.js' {\n  declare module.exports: $Exports<'flow-typed/dist/lib/flowVersion'>;\n}\ndeclare module 'flow-typed/dist/lib/git.js' {\n  declare module.exports: $Exports<'flow-typed/dist/lib/git'>;\n}\ndeclare module 'flow-typed/dist/lib/github.js' {\n  declare module.exports: $Exports<'flow-typed/dist/lib/github'>;\n}\ndeclare module 'flow-typed/dist/lib/isInFlowTypedRepo.js' {\n  declare module.exports: $Exports<'flow-typed/dist/lib/isInFlowTypedRepo'>;\n}\ndeclare module 'flow-typed/dist/lib/libDefs.js' {\n  declare module.exports: $Exports<'flow-typed/dist/lib/libDefs'>;\n}\ndeclare module 'flow-typed/dist/lib/node.js' {\n  declare module.exports: $Exports<'flow-typed/dist/lib/node'>;\n}\ndeclare module 'flow-typed/dist/lib/npm/npmLibDefs.js' {\n  declare module.exports: $Exports<'flow-typed/dist/lib/npm/npmLibDefs'>;\n}\ndeclare module 'flow-typed/dist/lib/npm/npmProjectUtils.js' {\n  declare module.exports: $Exports<'flow-typed/dist/lib/npm/npmProjectUtils'>;\n}\ndeclare module 'flow-typed/dist/lib/semver.js' {\n  declare module.exports: $Exports<'flow-typed/dist/lib/semver'>;\n}\ndeclare module 'flow-typed/dist/lib/stubUtils.js' {\n  declare module.exports: $Exports<'flow-typed/dist/lib/stubUtils'>;\n}\ndeclare module 'flow-typed/dist/lib/validationErrors.js' {\n  declare module.exports: $Exports<'flow-typed/dist/lib/validationErrors'>;\n}\n"
  },
  {
    "path": "flow-typed/npm/graceful-fs_v4.1.x.js",
    "content": "// flow-typed signature: dddffa88c6bf519f7077a44e489c05c9\n// flow-typed version: 1b3bf95731/graceful-fs_v4.1.x/flow_>=v0.28.x\n\ndeclare module \"graceful-fs\" {\n  declare interface ErrnoError extends Error {\n    errno?: number;\n    code?: string;\n    path?: string;\n    syscall?: string;\n  }\n  declare class Stats {\n    dev: number;\n    ino: number;\n    mode: number;\n    nlink: number;\n    uid: number;\n    gid: number;\n    rdev: number;\n    size: number;\n    blksize: number;\n    blocks: number;\n    atime: Date;\n    mtime: Date;\n    ctime: Date;\n\n    isFile(): boolean;\n    isDirectory(): boolean;\n    isBlockDevice(): boolean;\n    isCharacterDevice(): boolean;\n    isSymbolicLink(): boolean;\n    isFIFO(): boolean;\n    isSocket(): boolean;\n  }\n\n  declare class FSWatcher extends events$EventEmitter {\n    close(): void\n  }\n\n  declare class ReadStream extends stream$Readable {\n    close(): void\n  }\n\n  declare class WriteStream extends stream$Writable {\n    close(): void\n  }\n\n  declare function gracefulify(fs: Object): void;\n  declare function rename(oldPath: string, newPath: string, callback?: (err: ?ErrnoError) => void): void;\n  declare function renameSync(oldPath: string, newPath: string): void;\n  declare function ftruncate(fd: number, len: number, callback?: (err: ?ErrnoError) => void): void;\n  declare function ftruncateSync(fd: number, len: number): void;\n  declare function truncate(path: string, len: number, callback?: (err: ?ErrnoError) => void): void;\n  declare function truncateSync(path: string, len: number): void;\n  declare function chown(path: string, uid: number, gid: number, callback?: (err: ?ErrnoError) => void): void;\n  declare function chownSync(path: string, uid: number, gid: number): void;\n  declare function fchown(fd: number, uid: number, gid: number, callback?: (err: ?ErrnoError) => void): void;\n  declare function fchownSync(fd: number, uid: number, gid: number): void;\n  declare function lchown(path: string, uid: number, gid: number, callback?: (err: ?ErrnoError) => void): void;\n  declare function lchownSync(path: string, uid: number, gid: number): void;\n  declare function chmod(path: string, mode: number | string, callback?: (err: ?ErrnoError) => void): void;\n  declare function chmodSync(path: string, mode: number | string): void;\n  declare function fchmod(fd: number, mode: number | string, callback?: (err: ?ErrnoError) => void): void;\n  declare function fchmodSync(fd: number, mode: number | string): void;\n  declare function lchmod(path: string, mode: number | string, callback?: (err: ?ErrnoError) => void): void;\n  declare function lchmodSync(path: string, mode: number | string): void;\n  declare function stat(path: string, callback?: (err: ?ErrnoError, stats: Stats) => any): void;\n  declare function statSync(path: string): Stats;\n  declare function fstat(fd: number, callback?: (err: ?ErrnoError, stats: Stats) => any): void;\n  declare function fstatSync(fd: number): Stats;\n  declare function lstat(path: string, callback?: (err: ?ErrnoError, stats: Stats) => any): void;\n  declare function lstatSync(path: string): Stats;\n  declare function link(srcpath: string, dstpath: string, callback?: (err: ?ErrnoError) => void): void;\n  declare function linkSync(srcpath: string, dstpath: string): void;\n  declare function symlink(srcpath: string, dtspath: string, type?: string, callback?: (err: ?ErrnoError) => void): void;\n  declare function symlinkSync(srcpath: string, dstpath: string, type: string): void;\n  declare function readlink(path: string, callback: (err: ?ErrnoError, linkString: string) => void): void;\n  declare function readlinkSync(path: string): string;\n  declare function realpath(path: string, cache?: Object, callback?: (err: ?ErrnoError, resolvedPath: string) => void): void;\n  declare function realpathSync(path: string, cache?: Object): string;\n  declare function unlink(path: string, callback?: (err: ?ErrnoError) => void): void;\n  declare function unlinkSync(path: string): void;\n  declare function rmdir(path: string, callback?: (err: ?ErrnoError) => void): void;\n  declare function rmdirSync(path: string): void;\n  declare function mkdir(path: string, mode: number, callback: (err: ?ErrnoError) => void): void;\n  declare function mkdir(path: string, callback: (err: ?ErrnoError) => void): void;\n  declare function mkdirSync(path: string, mode?: number): void;\n  declare function mkdtemp(prefix: string, callback: (err: ?ErrnoError, folderPath: string) => void): void;\n  declare function mkdtempSync(prefix: string): string;\n  declare function readdir(path: string, callback: (err: ?ErrnoError, files: Array<string>) => void): void;\n  declare function readdir(\n    path: string,\n    options: string | { encoding: string },\n    callback: (err: ?ErrnoError, files: Array<string>) => void): void;\n  declare function readdirSync(path: string, options?: string | { encoding: string }, ): Array<string>;\n  declare function close(fd: number, callback?: (err: ?ErrnoError) => void): void;\n  declare function closeSync(fd: number): void;\n  declare function open(\n    path: string | Buffer,\n    flags: string | number,\n    mode: number,\n    callback: (err: ?ErrnoError, fd: number) => void\n  ): void;\n  declare function open(\n    path: string | Buffer,\n    flags: string | number,\n    callback: (err: ?ErrnoError, fd: number) => void\n  ): void;\n  declare function openSync(path: string | Buffer, flags: string | number, mode?: number): number;\n  declare function utimes(path: string, atime: number, mtime: number, callback?: (err: ?ErrnoError) => void): void;\n  declare function utimesSync(path: string, atime: number, mtime: number): void;\n  declare function futimes(fd: number, atime: number, mtime: number, callback?: (err: ?ErrnoError) => void): void;\n  declare function futimesSync(fd: number, atime: number, mtime: number): void;\n  declare function fsync(fd: number, callback?: (err: ?ErrnoError) => void): void;\n  declare function fsyncSync(fd: number): void;\n  declare var write: (fd: number, buffer: Buffer, offset: number, length: number, position?: mixed, callback?: (err: ?ErrnoError, write: number, str: string) => void) => void\n                   | (fd: number, data: mixed, position?: mixed, encoding?: string, callback?: (err: ?ErrnoError, write: number, str: string) => void) => void;\n  declare var writeSync: (fd: number, buffer: Buffer, offset: number, length: number, position?: number) => number\n                       | (fd: number, data: mixed, position?: mixed, encoding?: string) => number;\n  declare function read(\n    fd: number,\n    buffer: Buffer,\n    offset: number,\n    length: number,\n    position: ?number,\n    callback?: (err: ?ErrnoError, bytesRead: number, buffer: Buffer) => void\n  ): void;\n  declare function readSync(\n    fd: number,\n    buffer: Buffer,\n    offset: number,\n    length: number,\n    position: number\n  ): number;\n  declare function readFile(\n    filename: string,\n    callback: (err: ?ErrnoError, data: Buffer) => void\n  ): void;\n  declare function readFile(\n    filename: string,\n    encoding: string,\n    callback: (err: ?ErrnoError, data: string) => void\n  ): void;\n  declare function readFile(\n    filename: string,\n    options: { encoding: string; flag?: string },\n    callback: (err: ?ErrnoError, data: string) => void\n  ): void;\n  declare function readFile(\n    filename: string,\n    options: { flag?: string },\n    callback: (err: ?ErrnoError, data: Buffer) => void\n  ): void;\n  declare function readFileSync(filename: string, _: void): Buffer;\n  declare function readFileSync(filename: string, encoding: string): string;\n  declare function readFileSync(filename: string, options: { encoding: string, flag?: string }): string;\n  declare function readFileSync(filename: string, options: { encoding?: void, flag?: string }): Buffer;\n  declare function writeFile(\n    filename: string,\n    data: Buffer | string,\n    options: Object | string,\n    callback?: (err: ?ErrnoError) => void\n  ): void;\n  declare function writeFile(\n    filename: string,\n    data: Buffer | string,\n    callback?: (err: ?ErrnoError) => void\n  ): void;\n  declare function writeFileSync(\n    filename: string,\n    data: Buffer | string,\n    options?: Object | string\n  ): void;\n  declare function appendFile(\n    filename: string,\n    data: string | Buffer,\n    callback: (err: ?ErrnoError) => void\n  ): void;\n  declare function appendFile(\n    filename: string,\n    data: string | Buffer,\n    options: string | Object,\n    callback: (err: ?ErrnoError) => void\n  ): void;\n  declare function appendFileSync(filename: string, data: string | Buffer, options?: Object): void;\n  declare function watchFile(filename: string, options?: Object, listener?: (curr: Stats, prev: Stats) => void): void;\n  declare function unwatchFile(filename: string, listener?: (curr: Stats, prev: Stats) => void): void;\n  declare function watch(filename: string, options?: Object, listener?: (event: string, filename: string) => void): FSWatcher;\n  declare function exists(path: string, callback?: (exists: boolean) => void): void;\n  declare function existsSync(path: string): boolean;\n  declare function access(path: string, mode?: any, callback?: (err: ?ErrnoError) => void): void;\n  declare function accessSync(path: string, mode?: any): void;\n  declare function createReadStream(path: string, options?: Object): ReadStream;\n  declare function createWriteStream(path: string, options?: Object): WriteStream;\n\n  declare var F_OK: number;\n  declare var R_OK: number;\n  declare var W_OK: number;\n  declare var X_OK: number;\n}\n"
  },
  {
    "path": "flow-typed/npm/invariant_v2.x.x.js",
    "content": "// flow-typed signature: 60de437d85342dea19dcd82c5a50f88a\n// flow-typed version: da30fe6876/invariant_v2.x.x/flow_>=v0.33.x\n\ndeclare module invariant {\n  declare module.exports: (condition: boolean, message: string) => void;\n}\n"
  },
  {
    "path": "flow-typed/npm/istanbul_vx.x.x.js",
    "content": "// flow-typed signature: d49f4afb0982435dce495db8f5e8752f\n// flow-typed version: <<STUB>>/istanbul_v^0.4.5/flow_v0.76.0\n\n/**\n * This is an autogenerated libdef stub for:\n *\n *   'istanbul'\n *\n * Fill this stub out by replacing all the `any` types.\n *\n * Once filled out, we encourage you to share your work with the\n * community by sending a pull request to:\n * https://github.com/flowtype/flow-typed\n */\n\ndeclare module 'istanbul' {\n  declare module.exports: any;\n}\n\n/**\n * We include stubs for each file inside this npm package in case you need to\n * require those files directly. Feel free to delete any files that aren't\n * needed.\n */\ndeclare module 'istanbul/lib/assets/sorter' {\n  declare module.exports: any;\n}\n\ndeclare module 'istanbul/lib/assets/vendor/prettify' {\n  declare module.exports: any;\n}\n\ndeclare module 'istanbul/lib/cli' {\n  declare module.exports: any;\n}\n\ndeclare module 'istanbul/lib/collector' {\n  declare module.exports: any;\n}\n\ndeclare module 'istanbul/lib/command/check-coverage' {\n  declare module.exports: any;\n}\n\ndeclare module 'istanbul/lib/command/common/run-with-cover' {\n  declare module.exports: any;\n}\n\ndeclare module 'istanbul/lib/command/cover' {\n  declare module.exports: any;\n}\n\ndeclare module 'istanbul/lib/command/help' {\n  declare module.exports: any;\n}\n\ndeclare module 'istanbul/lib/command/index' {\n  declare module.exports: any;\n}\n\ndeclare module 'istanbul/lib/command/instrument' {\n  declare module.exports: any;\n}\n\ndeclare module 'istanbul/lib/command/report' {\n  declare module.exports: any;\n}\n\ndeclare module 'istanbul/lib/command/test' {\n  declare module.exports: any;\n}\n\ndeclare module 'istanbul/lib/config' {\n  declare module.exports: any;\n}\n\ndeclare module 'istanbul/lib/hook' {\n  declare module.exports: any;\n}\n\ndeclare module 'istanbul/lib/instrumenter' {\n  declare module.exports: any;\n}\n\ndeclare module 'istanbul/lib/object-utils' {\n  declare module.exports: any;\n}\n\ndeclare module 'istanbul/lib/register-plugins' {\n  declare module.exports: any;\n}\n\ndeclare module 'istanbul/lib/report/clover' {\n  declare module.exports: any;\n}\n\ndeclare module 'istanbul/lib/report/cobertura' {\n  declare module.exports: any;\n}\n\ndeclare module 'istanbul/lib/report/common/defaults' {\n  declare module.exports: any;\n}\n\ndeclare module 'istanbul/lib/report/html' {\n  declare module.exports: any;\n}\n\ndeclare module 'istanbul/lib/report/index' {\n  declare module.exports: any;\n}\n\ndeclare module 'istanbul/lib/report/json-summary' {\n  declare module.exports: any;\n}\n\ndeclare module 'istanbul/lib/report/json' {\n  declare module.exports: any;\n}\n\ndeclare module 'istanbul/lib/report/lcov' {\n  declare module.exports: any;\n}\n\ndeclare module 'istanbul/lib/report/lcovonly' {\n  declare module.exports: any;\n}\n\ndeclare module 'istanbul/lib/report/none' {\n  declare module.exports: any;\n}\n\ndeclare module 'istanbul/lib/report/teamcity' {\n  declare module.exports: any;\n}\n\ndeclare module 'istanbul/lib/report/text-lcov' {\n  declare module.exports: any;\n}\n\ndeclare module 'istanbul/lib/report/text-summary' {\n  declare module.exports: any;\n}\n\ndeclare module 'istanbul/lib/report/text' {\n  declare module.exports: any;\n}\n\ndeclare module 'istanbul/lib/reporter' {\n  declare module.exports: any;\n}\n\ndeclare module 'istanbul/lib/store/fslookup' {\n  declare module.exports: any;\n}\n\ndeclare module 'istanbul/lib/store/index' {\n  declare module.exports: any;\n}\n\ndeclare module 'istanbul/lib/store/memory' {\n  declare module.exports: any;\n}\n\ndeclare module 'istanbul/lib/store/tmp' {\n  declare module.exports: any;\n}\n\ndeclare module 'istanbul/lib/util/factory' {\n  declare module.exports: any;\n}\n\ndeclare module 'istanbul/lib/util/file-matcher' {\n  declare module.exports: any;\n}\n\ndeclare module 'istanbul/lib/util/file-writer' {\n  declare module.exports: any;\n}\n\ndeclare module 'istanbul/lib/util/help-formatter' {\n  declare module.exports: any;\n}\n\ndeclare module 'istanbul/lib/util/input-error' {\n  declare module.exports: any;\n}\n\ndeclare module 'istanbul/lib/util/insertion-text' {\n  declare module.exports: any;\n}\n\ndeclare module 'istanbul/lib/util/meta' {\n  declare module.exports: any;\n}\n\ndeclare module 'istanbul/lib/util/tree-summarizer' {\n  declare module.exports: any;\n}\n\ndeclare module 'istanbul/lib/util/writer' {\n  declare module.exports: any;\n}\n\ndeclare module 'istanbul/lib/util/yui-load-hook' {\n  declare module.exports: any;\n}\n\n// Filename aliases\ndeclare module 'istanbul/index' {\n  declare module.exports: $Exports<'istanbul'>;\n}\ndeclare module 'istanbul/index.js' {\n  declare module.exports: $Exports<'istanbul'>;\n}\ndeclare module 'istanbul/lib/assets/sorter.js' {\n  declare module.exports: $Exports<'istanbul/lib/assets/sorter'>;\n}\ndeclare module 'istanbul/lib/assets/vendor/prettify.js' {\n  declare module.exports: $Exports<'istanbul/lib/assets/vendor/prettify'>;\n}\ndeclare module 'istanbul/lib/cli.js' {\n  declare module.exports: $Exports<'istanbul/lib/cli'>;\n}\ndeclare module 'istanbul/lib/collector.js' {\n  declare module.exports: $Exports<'istanbul/lib/collector'>;\n}\ndeclare module 'istanbul/lib/command/check-coverage.js' {\n  declare module.exports: $Exports<'istanbul/lib/command/check-coverage'>;\n}\ndeclare module 'istanbul/lib/command/common/run-with-cover.js' {\n  declare module.exports: $Exports<'istanbul/lib/command/common/run-with-cover'>;\n}\ndeclare module 'istanbul/lib/command/cover.js' {\n  declare module.exports: $Exports<'istanbul/lib/command/cover'>;\n}\ndeclare module 'istanbul/lib/command/help.js' {\n  declare module.exports: $Exports<'istanbul/lib/command/help'>;\n}\ndeclare module 'istanbul/lib/command/index.js' {\n  declare module.exports: $Exports<'istanbul/lib/command/index'>;\n}\ndeclare module 'istanbul/lib/command/instrument.js' {\n  declare module.exports: $Exports<'istanbul/lib/command/instrument'>;\n}\ndeclare module 'istanbul/lib/command/report.js' {\n  declare module.exports: $Exports<'istanbul/lib/command/report'>;\n}\ndeclare module 'istanbul/lib/command/test.js' {\n  declare module.exports: $Exports<'istanbul/lib/command/test'>;\n}\ndeclare module 'istanbul/lib/config.js' {\n  declare module.exports: $Exports<'istanbul/lib/config'>;\n}\ndeclare module 'istanbul/lib/hook.js' {\n  declare module.exports: $Exports<'istanbul/lib/hook'>;\n}\ndeclare module 'istanbul/lib/instrumenter.js' {\n  declare module.exports: $Exports<'istanbul/lib/instrumenter'>;\n}\ndeclare module 'istanbul/lib/object-utils.js' {\n  declare module.exports: $Exports<'istanbul/lib/object-utils'>;\n}\ndeclare module 'istanbul/lib/register-plugins.js' {\n  declare module.exports: $Exports<'istanbul/lib/register-plugins'>;\n}\ndeclare module 'istanbul/lib/report/clover.js' {\n  declare module.exports: $Exports<'istanbul/lib/report/clover'>;\n}\ndeclare module 'istanbul/lib/report/cobertura.js' {\n  declare module.exports: $Exports<'istanbul/lib/report/cobertura'>;\n}\ndeclare module 'istanbul/lib/report/common/defaults.js' {\n  declare module.exports: $Exports<'istanbul/lib/report/common/defaults'>;\n}\ndeclare module 'istanbul/lib/report/html.js' {\n  declare module.exports: $Exports<'istanbul/lib/report/html'>;\n}\ndeclare module 'istanbul/lib/report/index.js' {\n  declare module.exports: $Exports<'istanbul/lib/report/index'>;\n}\ndeclare module 'istanbul/lib/report/json-summary.js' {\n  declare module.exports: $Exports<'istanbul/lib/report/json-summary'>;\n}\ndeclare module 'istanbul/lib/report/json.js' {\n  declare module.exports: $Exports<'istanbul/lib/report/json'>;\n}\ndeclare module 'istanbul/lib/report/lcov.js' {\n  declare module.exports: $Exports<'istanbul/lib/report/lcov'>;\n}\ndeclare module 'istanbul/lib/report/lcovonly.js' {\n  declare module.exports: $Exports<'istanbul/lib/report/lcovonly'>;\n}\ndeclare module 'istanbul/lib/report/none.js' {\n  declare module.exports: $Exports<'istanbul/lib/report/none'>;\n}\ndeclare module 'istanbul/lib/report/teamcity.js' {\n  declare module.exports: $Exports<'istanbul/lib/report/teamcity'>;\n}\ndeclare module 'istanbul/lib/report/text-lcov.js' {\n  declare module.exports: $Exports<'istanbul/lib/report/text-lcov'>;\n}\ndeclare module 'istanbul/lib/report/text-summary.js' {\n  declare module.exports: $Exports<'istanbul/lib/report/text-summary'>;\n}\ndeclare module 'istanbul/lib/report/text.js' {\n  declare module.exports: $Exports<'istanbul/lib/report/text'>;\n}\ndeclare module 'istanbul/lib/reporter.js' {\n  declare module.exports: $Exports<'istanbul/lib/reporter'>;\n}\ndeclare module 'istanbul/lib/store/fslookup.js' {\n  declare module.exports: $Exports<'istanbul/lib/store/fslookup'>;\n}\ndeclare module 'istanbul/lib/store/index.js' {\n  declare module.exports: $Exports<'istanbul/lib/store/index'>;\n}\ndeclare module 'istanbul/lib/store/memory.js' {\n  declare module.exports: $Exports<'istanbul/lib/store/memory'>;\n}\ndeclare module 'istanbul/lib/store/tmp.js' {\n  declare module.exports: $Exports<'istanbul/lib/store/tmp'>;\n}\ndeclare module 'istanbul/lib/util/factory.js' {\n  declare module.exports: $Exports<'istanbul/lib/util/factory'>;\n}\ndeclare module 'istanbul/lib/util/file-matcher.js' {\n  declare module.exports: $Exports<'istanbul/lib/util/file-matcher'>;\n}\ndeclare module 'istanbul/lib/util/file-writer.js' {\n  declare module.exports: $Exports<'istanbul/lib/util/file-writer'>;\n}\ndeclare module 'istanbul/lib/util/help-formatter.js' {\n  declare module.exports: $Exports<'istanbul/lib/util/help-formatter'>;\n}\ndeclare module 'istanbul/lib/util/input-error.js' {\n  declare module.exports: $Exports<'istanbul/lib/util/input-error'>;\n}\ndeclare module 'istanbul/lib/util/insertion-text.js' {\n  declare module.exports: $Exports<'istanbul/lib/util/insertion-text'>;\n}\ndeclare module 'istanbul/lib/util/meta.js' {\n  declare module.exports: $Exports<'istanbul/lib/util/meta'>;\n}\ndeclare module 'istanbul/lib/util/tree-summarizer.js' {\n  declare module.exports: $Exports<'istanbul/lib/util/tree-summarizer'>;\n}\ndeclare module 'istanbul/lib/util/writer.js' {\n  declare module.exports: $Exports<'istanbul/lib/util/writer'>;\n}\ndeclare module 'istanbul/lib/util/yui-load-hook.js' {\n  declare module.exports: $Exports<'istanbul/lib/util/yui-load-hook'>;\n}\n"
  },
  {
    "path": "flow-typed/npm/jest_v23.x.x.js",
    "content": "// flow-typed signature: ad251f3a3446f6ab4e6691a94e701cad\n// flow-typed version: caa120caaa/jest_v23.x.x/flow_>=v0.39.x\n\ntype JestMockFn<TArguments: $ReadOnlyArray<*>, TReturn> = {\n  (...args: TArguments): TReturn,\n  /**\n   * An object for introspecting mock calls\n   */\n  mock: {\n    /**\n     * An array that represents all calls that have been made into this mock\n     * function. Each call is represented by an array of arguments that were\n     * passed during the call.\n     */\n    calls: Array<TArguments>,\n    /**\n     * An array that contains all the object instances that have been\n     * instantiated from this mock function.\n     */\n    instances: Array<TReturn>\n  },\n  /**\n   * Resets all information stored in the mockFn.mock.calls and\n   * mockFn.mock.instances arrays. Often this is useful when you want to clean\n   * up a mock's usage data between two assertions.\n   */\n  mockClear(): void,\n  /**\n   * Resets all information stored in the mock. This is useful when you want to\n   * completely restore a mock back to its initial state.\n   */\n  mockReset(): void,\n  /**\n   * Removes the mock and restores the initial implementation. This is useful\n   * when you want to mock functions in certain test cases and restore the\n   * original implementation in others. Beware that mockFn.mockRestore only\n   * works when mock was created with jest.spyOn. Thus you have to take care of\n   * restoration yourself when manually assigning jest.fn().\n   */\n  mockRestore(): void,\n  /**\n   * Accepts a function that should be used as the implementation of the mock.\n   * The mock itself will still record all calls that go into and instances\n   * that come from itself -- the only difference is that the implementation\n   * will also be executed when the mock is called.\n   */\n  mockImplementation(\n    fn: (...args: TArguments) => TReturn\n  ): JestMockFn<TArguments, TReturn>,\n  /**\n   * Accepts a function that will be used as an implementation of the mock for\n   * one call to the mocked function. Can be chained so that multiple function\n   * calls produce different results.\n   */\n  mockImplementationOnce(\n    fn: (...args: TArguments) => TReturn\n  ): JestMockFn<TArguments, TReturn>,\n  /**\n   * Accepts a string to use in test result output in place of \"jest.fn()\" to\n   * indicate which mock function is being referenced.\n   */\n  mockName(name: string): JestMockFn<TArguments, TReturn>,\n  /**\n   * Just a simple sugar function for returning `this`\n   */\n  mockReturnThis(): void,\n  /**\n   * Accepts a value that will be returned whenever the mock function is called.\n   */\n  mockReturnValue(value: TReturn): JestMockFn<TArguments, TReturn>,\n  /**\n   * Sugar for only returning a value once inside your mock\n   */\n  mockReturnValueOnce(value: TReturn): JestMockFn<TArguments, TReturn>,\n  /**\n   * Sugar for jest.fn().mockImplementation(() => Promise.resolve(value))\n   */\n  mockResolvedValue(value: TReturn): JestMockFn<TArguments, Promise<TReturn>>,\n  /**\n   * Sugar for jest.fn().mockImplementationOnce(() => Promise.resolve(value))\n   */\n  mockResolvedValueOnce(value: TReturn): JestMockFn<TArguments, Promise<TReturn>>,\n  /**\n   * Sugar for jest.fn().mockImplementation(() => Promise.reject(value))\n   */\n  mockRejectedValue(value: TReturn): JestMockFn<TArguments, Promise<any>>,\n  /**\n   * Sugar for jest.fn().mockImplementationOnce(() => Promise.reject(value))\n   */\n  mockRejectedValueOnce(value: TReturn): JestMockFn<TArguments, Promise<any>>\n};\n\ntype JestAsymmetricEqualityType = {\n  /**\n   * A custom Jasmine equality tester\n   */\n  asymmetricMatch(value: mixed): boolean\n};\n\ntype JestCallsType = {\n  allArgs(): mixed,\n  all(): mixed,\n  any(): boolean,\n  count(): number,\n  first(): mixed,\n  mostRecent(): mixed,\n  reset(): void\n};\n\ntype JestClockType = {\n  install(): void,\n  mockDate(date: Date): void,\n  tick(milliseconds?: number): void,\n  uninstall(): void\n};\n\ntype JestMatcherResult = {\n  message?: string | (() => string),\n  pass: boolean\n};\n\ntype JestMatcher = (actual: any, expected: any) => JestMatcherResult;\n\ntype JestPromiseType = {\n  /**\n   * Use rejects to unwrap the reason of a rejected promise so any other\n   * matcher can be chained. If the promise is fulfilled the assertion fails.\n   */\n  rejects: JestExpectType,\n  /**\n   * Use resolves to unwrap the value of a fulfilled promise so any other\n   * matcher can be chained. If the promise is rejected the assertion fails.\n   */\n  resolves: JestExpectType\n};\n\n/**\n * Jest allows functions and classes to be used as test names in test() and\n * describe()\n */\ntype JestTestName = string | Function;\n\n/**\n *  Plugin: jest-styled-components\n */\n\ntype JestStyledComponentsMatcherValue =\n  | string\n  | JestAsymmetricEqualityType\n  | RegExp\n  | typeof undefined;\n\ntype JestStyledComponentsMatcherOptions = {\n  media?: string;\n  modifier?: string;\n  supports?: string;\n}\n\ntype JestStyledComponentsMatchersType = {\n  toHaveStyleRule(\n    property: string,\n    value: JestStyledComponentsMatcherValue,\n    options?: JestStyledComponentsMatcherOptions\n  ): void,\n};\n\n/**\n *  Plugin: jest-enzyme\n */\ntype EnzymeMatchersType = {\n  toBeChecked(): void,\n  toBeDisabled(): void,\n  toBeEmpty(): void,\n  toBeEmptyRender(): void,\n  toBePresent(): void,\n  toContainReact(element: React$Element<any>): void,\n  toExist(): void,\n  toHaveClassName(className: string): void,\n  toHaveHTML(html: string): void,\n  toHaveProp: ((propKey: string, propValue?: any) => void) & ((props: Object) => void),\n  toHaveRef(refName: string): void,\n  toHaveState: ((stateKey: string, stateValue?: any) => void) & ((state: Object) => void),\n  toHaveStyle: ((styleKey: string, styleValue?: any) => void) & ((style: Object) => void),\n  toHaveTagName(tagName: string): void,\n  toHaveText(text: string): void,\n  toIncludeText(text: string): void,\n  toHaveValue(value: any): void,\n  toMatchElement(element: React$Element<any>): void,\n  toMatchSelector(selector: string): void\n};\n\n// DOM testing library extensions https://github.com/kentcdodds/dom-testing-library#custom-jest-matchers\ntype DomTestingLibraryType = {\n  toBeInTheDOM(): void,\n  toHaveTextContent(content: string): void,\n  toHaveAttribute(name: string, expectedValue?: string): void\n};\n\n// Jest JQuery Matchers: https://github.com/unindented/custom-jquery-matchers\ntype JestJQueryMatchersType = {\n  toExist(): void,\n  toHaveLength(len: number): void,\n  toHaveId(id: string): void,\n  toHaveClass(className: string): void,\n  toHaveTag(tag: string): void,\n  toHaveAttr(key: string, val?: any): void,\n  toHaveProp(key: string, val?: any): void,\n  toHaveText(text: string | RegExp): void,\n  toHaveData(key: string, val?: any): void,\n  toHaveValue(val: any): void,\n  toHaveCss(css: {[key: string]: any}): void,\n  toBeChecked(): void,\n  toBeDisabled(): void,\n  toBeEmpty(): void,\n  toBeHidden(): void,\n  toBeSelected(): void,\n  toBeVisible(): void,\n  toBeFocused(): void,\n  toBeInDom(): void,\n  toBeMatchedBy(sel: string): void,\n  toHaveDescendant(sel: string): void,\n  toHaveDescendantWithText(sel: string, text: string | RegExp): void\n};\n\n\n// Jest Extended Matchers: https://github.com/jest-community/jest-extended\ntype JestExtendedMatchersType = {\n  /**\n     * Note: Currently unimplemented\n     * Passing assertion\n     *\n     * @param {String} message\n     */\n  //  pass(message: string): void;\n\n    /**\n     * Note: Currently unimplemented\n     * Failing assertion\n     *\n     * @param {String} message\n     */\n  //  fail(message: string): void;\n\n    /**\n     * Use .toBeEmpty when checking if a String '', Array [] or Object {} is empty.\n     */\n    toBeEmpty(): void;\n\n    /**\n     * Use .toBeOneOf when checking if a value is a member of a given Array.\n     * @param {Array.<*>} members\n     */\n    toBeOneOf(members: any[]): void;\n\n    /**\n     * Use `.toBeNil` when checking a value is `null` or `undefined`.\n     */\n    toBeNil(): void;\n\n    /**\n     * Use `.toSatisfy` when you want to use a custom matcher by supplying a predicate function that returns a `Boolean`.\n     * @param {Function} predicate\n     */\n    toSatisfy(predicate: (n: any) => boolean): void;\n\n    /**\n     * Use `.toBeArray` when checking if a value is an `Array`.\n     */\n    toBeArray(): void;\n\n    /**\n     * Use `.toBeArrayOfSize` when checking if a value is an `Array` of size x.\n     * @param {Number} x\n     */\n    toBeArrayOfSize(x: number): void;\n\n    /**\n     * Use `.toIncludeAllMembers` when checking if an `Array` contains all of the same members of a given set.\n     * @param {Array.<*>} members\n     */\n    toIncludeAllMembers(members: any[]): void;\n\n    /**\n     * Use `.toIncludeAnyMembers` when checking if an `Array` contains any of the members of a given set.\n     * @param {Array.<*>} members\n     */\n    toIncludeAnyMembers(members: any[]): void;\n\n    /**\n     * Use `.toSatisfyAll` when you want to use a custom matcher by supplying a predicate function that returns a `Boolean` for all values in an array.\n     * @param {Function} predicate\n     */\n    toSatisfyAll(predicate: (n: any) => boolean): void;\n\n    /**\n     * Use `.toBeBoolean` when checking if a value is a `Boolean`.\n     */\n    toBeBoolean(): void;\n\n    /**\n     * Use `.toBeTrue` when checking a value is equal (===) to `true`.\n     */\n    toBeTrue(): void;\n\n    /**\n     * Use `.toBeFalse` when checking a value is equal (===) to `false`.\n     */\n    toBeFalse(): void;\n\n    /**\n     * Use .toBeDate when checking if a value is a Date.\n     */\n    toBeDate(): void;\n\n    /**\n     * Use `.toBeFunction` when checking if a value is a `Function`.\n     */\n    toBeFunction(): void;\n\n    /**\n     * Use `.toHaveBeenCalledBefore` when checking if a `Mock` was called before another `Mock`.\n     *\n     * Note: Required Jest version >22\n     * Note: Your mock functions will have to be asynchronous to cause the timestamps inside of Jest to occur in a differentJS event loop, otherwise the mock timestamps will all be the same\n     *\n     * @param {Mock} mock\n     */\n    toHaveBeenCalledBefore(mock: JestMockFn<any, any>): void;\n\n    /**\n     * Use `.toBeNumber` when checking if a value is a `Number`.\n     */\n    toBeNumber(): void;\n\n    /**\n     * Use `.toBeNaN` when checking a value is `NaN`.\n     */\n    toBeNaN(): void;\n\n    /**\n     * Use `.toBeFinite` when checking if a value is a `Number`, not `NaN` or `Infinity`.\n     */\n    toBeFinite(): void;\n\n    /**\n     * Use `.toBePositive` when checking if a value is a positive `Number`.\n     */\n    toBePositive(): void;\n\n    /**\n     * Use `.toBeNegative` when checking if a value is a negative `Number`.\n     */\n    toBeNegative(): void;\n\n    /**\n     * Use `.toBeEven` when checking if a value is an even `Number`.\n     */\n    toBeEven(): void;\n\n    /**\n     * Use `.toBeOdd` when checking if a value is an odd `Number`.\n     */\n    toBeOdd(): void;\n\n    /**\n     * Use `.toBeWithin` when checking if a number is in between the given bounds of: start (inclusive) and end (exclusive).\n     *\n     * @param {Number} start\n     * @param {Number} end\n     */\n    toBeWithin(start: number, end: number): void;\n\n    /**\n     * Use `.toBeObject` when checking if a value is an `Object`.\n     */\n    toBeObject(): void;\n\n    /**\n     * Use `.toContainKey` when checking if an object contains the provided key.\n     *\n     * @param {String} key\n     */\n    toContainKey(key: string): void;\n\n    /**\n     * Use `.toContainKeys` when checking if an object has all of the provided keys.\n     *\n     * @param {Array.<String>} keys\n     */\n    toContainKeys(keys: string[]): void;\n\n    /**\n     * Use `.toContainAllKeys` when checking if an object only contains all of the provided keys.\n     *\n     * @param {Array.<String>} keys\n     */\n    toContainAllKeys(keys: string[]): void;\n\n    /**\n     * Use `.toContainAnyKeys` when checking if an object contains at least one of the provided keys.\n     *\n     * @param {Array.<String>} keys\n     */\n    toContainAnyKeys(keys: string[]): void;\n\n    /**\n     * Use `.toContainValue` when checking if an object contains the provided value.\n     *\n     * @param {*} value\n     */\n    toContainValue(value: any): void;\n\n    /**\n     * Use `.toContainValues` when checking if an object contains all of the provided values.\n     *\n     * @param {Array.<*>} values\n     */\n    toContainValues(values: any[]): void;\n\n    /**\n     * Use `.toContainAllValues` when checking if an object only contains all of the provided values.\n     *\n     * @param {Array.<*>} values\n     */\n    toContainAllValues(values: any[]): void;\n\n    /**\n     * Use `.toContainAnyValues` when checking if an object contains at least one of the provided values.\n     *\n     * @param {Array.<*>} values\n     */\n    toContainAnyValues(values: any[]): void;\n\n    /**\n     * Use `.toContainEntry` when checking if an object contains the provided entry.\n     *\n     * @param {Array.<String, String>} entry\n     */\n    toContainEntry(entry: [string, string]): void;\n\n    /**\n     * Use `.toContainEntries` when checking if an object contains all of the provided entries.\n     *\n     * @param {Array.<Array.<String, String>>} entries\n     */\n    toContainEntries(entries: [string, string][]): void;\n\n    /**\n     * Use `.toContainAllEntries` when checking if an object only contains all of the provided entries.\n     *\n     * @param {Array.<Array.<String, String>>} entries\n     */\n    toContainAllEntries(entries: [string, string][]): void;\n\n    /**\n     * Use `.toContainAnyEntries` when checking if an object contains at least one of the provided entries.\n     *\n     * @param {Array.<Array.<String, String>>} entries\n     */\n    toContainAnyEntries(entries: [string, string][]): void;\n\n    /**\n     * Use `.toBeExtensible` when checking if an object is extensible.\n     */\n    toBeExtensible(): void;\n\n    /**\n     * Use `.toBeFrozen` when checking if an object is frozen.\n     */\n    toBeFrozen(): void;\n\n    /**\n     * Use `.toBeSealed` when checking if an object is sealed.\n     */\n    toBeSealed(): void;\n\n    /**\n     * Use `.toBeString` when checking if a value is a `String`.\n     */\n    toBeString(): void;\n\n    /**\n     * Use `.toEqualCaseInsensitive` when checking if a string is equal (===) to another ignoring the casing of both strings.\n     *\n     * @param {String} string\n     */\n    toEqualCaseInsensitive(string: string): void;\n\n    /**\n     * Use `.toStartWith` when checking if a `String` starts with a given `String` prefix.\n     *\n     * @param {String} prefix\n     */\n    toStartWith(prefix: string): void;\n\n    /**\n     * Use `.toEndWith` when checking if a `String` ends with a given `String` suffix.\n     *\n     * @param {String} suffix\n     */\n    toEndWith(suffix: string): void;\n\n    /**\n     * Use `.toInclude` when checking if a `String` includes the given `String` substring.\n     *\n     * @param {String} substring\n     */\n    toInclude(substring: string): void;\n\n    /**\n     * Use `.toIncludeRepeated` when checking if a `String` includes the given `String` substring the correct number of times.\n     *\n     * @param {String} substring\n     * @param {Number} times\n     */\n    toIncludeRepeated(substring: string, times: number): void;\n\n    /**\n     * Use `.toIncludeMultiple` when checking if a `String` includes all of the given substrings.\n     *\n     * @param {Array.<String>} substring\n     */\n    toIncludeMultiple(substring: string[]): void;\n};\n\ninterface JestExpectType {\n  not:\n    & JestExpectType\n    & EnzymeMatchersType\n    & DomTestingLibraryType\n    & JestJQueryMatchersType\n    & JestStyledComponentsMatchersType\n    & JestExtendedMatchersType,\n  /**\n   * If you have a mock function, you can use .lastCalledWith to test what\n   * arguments it was last called with.\n   */\n  lastCalledWith(...args: Array<any>): void,\n  /**\n   * toBe just checks that a value is what you expect. It uses === to check\n   * strict equality.\n   */\n  toBe(value: any): void,\n  /**\n   * Use .toBeCalledWith to ensure that a mock function was called with\n   * specific arguments.\n   */\n  toBeCalledWith(...args: Array<any>): void,\n  /**\n   * Using exact equality with floating point numbers is a bad idea. Rounding\n   * means that intuitive things fail.\n   */\n  toBeCloseTo(num: number, delta: any): void,\n  /**\n   * Use .toBeDefined to check that a variable is not undefined.\n   */\n  toBeDefined(): void,\n  /**\n   * Use .toBeFalsy when you don't care what a value is, you just want to\n   * ensure a value is false in a boolean context.\n   */\n  toBeFalsy(): void,\n  /**\n   * To compare floating point numbers, you can use toBeGreaterThan.\n   */\n  toBeGreaterThan(number: number): void,\n  /**\n   * To compare floating point numbers, you can use toBeGreaterThanOrEqual.\n   */\n  toBeGreaterThanOrEqual(number: number): void,\n  /**\n   * To compare floating point numbers, you can use toBeLessThan.\n   */\n  toBeLessThan(number: number): void,\n  /**\n   * To compare floating point numbers, you can use toBeLessThanOrEqual.\n   */\n  toBeLessThanOrEqual(number: number): void,\n  /**\n   * Use .toBeInstanceOf(Class) to check that an object is an instance of a\n   * class.\n   */\n  toBeInstanceOf(cls: Class<*>): void,\n  /**\n   * .toBeNull() is the same as .toBe(null) but the error messages are a bit\n   * nicer.\n   */\n  toBeNull(): void,\n  /**\n   * Use .toBeTruthy when you don't care what a value is, you just want to\n   * ensure a value is true in a boolean context.\n   */\n  toBeTruthy(): void,\n  /**\n   * Use .toBeUndefined to check that a variable is undefined.\n   */\n  toBeUndefined(): void,\n  /**\n   * Use .toContain when you want to check that an item is in a list. For\n   * testing the items in the list, this uses ===, a strict equality check.\n   */\n  toContain(item: any): void,\n  /**\n   * Use .toContainEqual when you want to check that an item is in a list. For\n   * testing the items in the list, this matcher recursively checks the\n   * equality of all fields, rather than checking for object identity.\n   */\n  toContainEqual(item: any): void,\n  /**\n   * Use .toEqual when you want to check that two objects have the same value.\n   * This matcher recursively checks the equality of all fields, rather than\n   * checking for object identity.\n   */\n  toEqual(value: any): void,\n  /**\n   * Use .toHaveBeenCalled to ensure that a mock function got called.\n   */\n  toHaveBeenCalled(): void,\n  toBeCalled(): void;\n  /**\n   * Use .toHaveBeenCalledTimes to ensure that a mock function got called exact\n   * number of times.\n   */\n  toHaveBeenCalledTimes(number: number): void,\n  toBeCalledTimes(number: number): void;\n  /**\n   *\n   */\n  toHaveBeenNthCalledWith(nthCall: number, ...args: Array<any>): void;\n  nthCalledWith(nthCall: number, ...args: Array<any>): void;\n  /**\n   *\n   */\n  toHaveReturned(): void;\n  toReturn(): void;\n  /**\n   *\n   */\n  toHaveReturnedTimes(number: number): void;\n  toReturnTimes(number: number): void;\n  /**\n   *\n   */\n  toHaveReturnedWith(value: any): void;\n  toReturnWith(value: any): void;\n  /**\n   *\n   */\n  toHaveLastReturnedWith(value: any): void;\n  lastReturnedWith(value: any): void;\n  /**\n   *\n   */\n  toHaveNthReturnedWith(nthCall: number, value: any): void;\n  nthReturnedWith(nthCall: number, value: any): void;\n  /**\n   * Use .toHaveBeenCalledWith to ensure that a mock function was called with\n   * specific arguments.\n   */\n  toHaveBeenCalledWith(...args: Array<any>): void,\n  toBeCalledWith(...args: Array<any>): void,\n  /**\n   * Use .toHaveBeenLastCalledWith to ensure that a mock function was last called\n   * with specific arguments.\n   */\n  toHaveBeenLastCalledWith(...args: Array<any>): void,\n  lastCalledWith(...args: Array<any>): void,\n  /**\n   * Check that an object has a .length property and it is set to a certain\n   * numeric value.\n   */\n  toHaveLength(number: number): void,\n  /**\n   *\n   */\n  toHaveProperty(propPath: string, value?: any): void,\n  /**\n   * Use .toMatch to check that a string matches a regular expression or string.\n   */\n  toMatch(regexpOrString: RegExp | string): void,\n  /**\n   * Use .toMatchObject to check that a javascript object matches a subset of the properties of an object.\n   */\n  toMatchObject(object: Object | Array<Object>): void,\n  /**\n   * Use .toStrictEqual to check that a javascript object matches a subset of the properties of an object.\n   */\n  toStrictEqual(value: any): void,\n  /**\n   * This ensures that an Object matches the most recent snapshot.\n   */\n  toMatchSnapshot(propertyMatchers?: {[key: string]: JestAsymmetricEqualityType}, name?: string): void,\n  /**\n   * This ensures that an Object matches the most recent snapshot.\n   */\n  toMatchSnapshot(name: string): void,\n  /**\n   * Use .toThrow to test that a function throws when it is called.\n   * If you want to test that a specific error gets thrown, you can provide an\n   * argument to toThrow. The argument can be a string for the error message,\n   * a class for the error, or a regex that should match the error.\n   *\n   * Alias: .toThrowError\n   */\n  toThrow(message?: string | Error | Class<Error> | RegExp): void,\n  toThrowError(message?: string | Error | Class<Error> | RegExp): void,\n  /**\n   * Use .toThrowErrorMatchingSnapshot to test that a function throws a error\n   * matching the most recent snapshot when it is called.\n   */\n  toThrowErrorMatchingSnapshot(): void\n}\n\ntype JestObjectType = {\n  /**\n   *  Disables automatic mocking in the module loader.\n   *\n   *  After this method is called, all `require()`s will return the real\n   *  versions of each module (rather than a mocked version).\n   */\n  disableAutomock(): JestObjectType,\n  /**\n   * An un-hoisted version of disableAutomock\n   */\n  autoMockOff(): JestObjectType,\n  /**\n   * Enables automatic mocking in the module loader.\n   */\n  enableAutomock(): JestObjectType,\n  /**\n   * An un-hoisted version of enableAutomock\n   */\n  autoMockOn(): JestObjectType,\n  /**\n   * Clears the mock.calls and mock.instances properties of all mocks.\n   * Equivalent to calling .mockClear() on every mocked function.\n   */\n  clearAllMocks(): JestObjectType,\n  /**\n   * Resets the state of all mocks. Equivalent to calling .mockReset() on every\n   * mocked function.\n   */\n  resetAllMocks(): JestObjectType,\n  /**\n   * Restores all mocks back to their original value.\n   */\n  restoreAllMocks(): JestObjectType,\n  /**\n   * Removes any pending timers from the timer system.\n   */\n  clearAllTimers(): void,\n  /**\n   * The same as `mock` but not moved to the top of the expectation by\n   * babel-jest.\n   */\n  doMock(moduleName: string, moduleFactory?: any): JestObjectType,\n  /**\n   * The same as `unmock` but not moved to the top of the expectation by\n   * babel-jest.\n   */\n  dontMock(moduleName: string): JestObjectType,\n  /**\n   * Returns a new, unused mock function. Optionally takes a mock\n   * implementation.\n   */\n  fn<TArguments: $ReadOnlyArray<*>, TReturn>(\n    implementation?: (...args: TArguments) => TReturn\n  ): JestMockFn<TArguments, TReturn>,\n  /**\n   * Determines if the given function is a mocked function.\n   */\n  isMockFunction(fn: Function): boolean,\n  /**\n   * Given the name of a module, use the automatic mocking system to generate a\n   * mocked version of the module for you.\n   */\n  genMockFromModule(moduleName: string): any,\n  /**\n   * Mocks a module with an auto-mocked version when it is being required.\n   *\n   * The second argument can be used to specify an explicit module factory that\n   * is being run instead of using Jest's automocking feature.\n   *\n   * The third argument can be used to create virtual mocks -- mocks of modules\n   * that don't exist anywhere in the system.\n   */\n  mock(\n    moduleName: string,\n    moduleFactory?: any,\n    options?: Object\n  ): JestObjectType,\n  /**\n   * Returns the actual module instead of a mock, bypassing all checks on\n   * whether the module should receive a mock implementation or not.\n   */\n  requireActual(moduleName: string): any,\n  /**\n   * Returns a mock module instead of the actual module, bypassing all checks\n   * on whether the module should be required normally or not.\n   */\n  requireMock(moduleName: string): any,\n  /**\n   * Resets the module registry - the cache of all required modules. This is\n   * useful to isolate modules where local state might conflict between tests.\n   */\n  resetModules(): JestObjectType,\n  /**\n   * Exhausts the micro-task queue (usually interfaced in node via\n   * process.nextTick).\n   */\n  runAllTicks(): void,\n  /**\n   * Exhausts the macro-task queue (i.e., all tasks queued by setTimeout(),\n   * setInterval(), and setImmediate()).\n   */\n  runAllTimers(): void,\n  /**\n   * Exhausts all tasks queued by setImmediate().\n   */\n  runAllImmediates(): void,\n  /**\n   * Executes only the macro task queue (i.e. all tasks queued by setTimeout()\n   * or setInterval() and setImmediate()).\n   */\n  advanceTimersByTime(msToRun: number): void,\n  /**\n   * Executes only the macro task queue (i.e. all tasks queued by setTimeout()\n   * or setInterval() and setImmediate()).\n   *\n   * Renamed to `advanceTimersByTime`.\n   */\n  runTimersToTime(msToRun: number): void,\n  /**\n   * Executes only the macro-tasks that are currently pending (i.e., only the\n   * tasks that have been queued by setTimeout() or setInterval() up to this\n   * point)\n   */\n  runOnlyPendingTimers(): void,\n  /**\n   * Explicitly supplies the mock object that the module system should return\n   * for the specified module. Note: It is recommended to use jest.mock()\n   * instead.\n   */\n  setMock(moduleName: string, moduleExports: any): JestObjectType,\n  /**\n   * Indicates that the module system should never return a mocked version of\n   * the specified module from require() (e.g. that it should always return the\n   * real module).\n   */\n  unmock(moduleName: string): JestObjectType,\n  /**\n   * Instructs Jest to use fake versions of the standard timer functions\n   * (setTimeout, setInterval, clearTimeout, clearInterval, nextTick,\n   * setImmediate and clearImmediate).\n   */\n  useFakeTimers(): JestObjectType,\n  /**\n   * Instructs Jest to use the real versions of the standard timer functions.\n   */\n  useRealTimers(): JestObjectType,\n  /**\n   * Creates a mock function similar to jest.fn but also tracks calls to\n   * object[methodName].\n   */\n  spyOn(object: Object, methodName: string, accessType?: \"get\" | \"set\"): JestMockFn<any, any>,\n  /**\n   * Set the default timeout interval for tests and before/after hooks in milliseconds.\n   * Note: The default timeout interval is 5 seconds if this method is not called.\n   */\n  setTimeout(timeout: number): JestObjectType\n};\n\ntype JestSpyType = {\n  calls: JestCallsType\n};\n\n/** Runs this function after every test inside this context */\ndeclare function afterEach(\n  fn: (done: () => void) => ?Promise<mixed>,\n  timeout?: number\n): void;\n/** Runs this function before every test inside this context */\ndeclare function beforeEach(\n  fn: (done: () => void) => ?Promise<mixed>,\n  timeout?: number\n): void;\n/** Runs this function after all tests have finished inside this context */\ndeclare function afterAll(\n  fn: (done: () => void) => ?Promise<mixed>,\n  timeout?: number\n): void;\n/** Runs this function before any tests have started inside this context */\ndeclare function beforeAll(\n  fn: (done: () => void) => ?Promise<mixed>,\n  timeout?: number\n): void;\n\n/** A context for grouping tests together */\ndeclare var describe: {\n  /**\n   * Creates a block that groups together several related tests in one \"test suite\"\n   */\n  (name: JestTestName, fn: () => void): void,\n\n  /**\n   * Only run this describe block\n   */\n  only(name: JestTestName, fn: () => void): void,\n\n  /**\n   * Skip running this describe block\n   */\n  skip(name: JestTestName, fn: () => void): void\n};\n\n/** An individual test unit */\ndeclare var it: {\n  /**\n   * An individual test unit\n   *\n   * @param {JestTestName} Name of Test\n   * @param {Function} Test\n   * @param {number} Timeout for the test, in milliseconds.\n   */\n  (\n    name: JestTestName,\n    fn?: (done: () => void) => ?Promise<mixed>,\n    timeout?: number\n  ): void,\n  /**\n   * each runs this test against array of argument arrays per each run\n   *\n   * @param {table} table of Test\n   */\n  each(\n    table: Array<Array<mixed>>\n  ): (\n    name: JestTestName,\n    fn?: (...args: Array<any>) => ?Promise<mixed>\n  ) => void,\n  /**\n   * Only run this test\n   *\n   * @param {JestTestName} Name of Test\n   * @param {Function} Test\n   * @param {number} Timeout for the test, in milliseconds.\n   */\n  only(\n    name: JestTestName,\n    fn?: (done: () => void) => ?Promise<mixed>,\n    timeout?: number\n  ): {\n    each(\n      table: Array<Array<mixed>>\n    ): (\n      name: JestTestName,\n      fn?: (...args: Array<any>) => ?Promise<mixed>\n    ) => void,\n  },\n  /**\n   * Skip running this test\n   *\n   * @param {JestTestName} Name of Test\n   * @param {Function} Test\n   * @param {number} Timeout for the test, in milliseconds.\n   */\n  skip(\n    name: JestTestName,\n    fn?: (done: () => void) => ?Promise<mixed>,\n    timeout?: number\n  ): void,\n  /**\n   * Run the test concurrently\n   *\n   * @param {JestTestName} Name of Test\n   * @param {Function} Test\n   * @param {number} Timeout for the test, in milliseconds.\n   */\n  concurrent(\n    name: JestTestName,\n    fn?: (done: () => void) => ?Promise<mixed>,\n    timeout?: number\n  ): void\n};\ndeclare function fit(\n  name: JestTestName,\n  fn: (done: () => void) => ?Promise<mixed>,\n  timeout?: number\n): void;\n/** An individual test unit */\ndeclare var test: typeof it;\n/** A disabled group of tests */\ndeclare var xdescribe: typeof describe;\n/** A focused group of tests */\ndeclare var fdescribe: typeof describe;\n/** A disabled individual test */\ndeclare var xit: typeof it;\n/** A disabled individual test */\ndeclare var xtest: typeof it;\n\ntype JestPrettyFormatColors = {\n  comment: { close: string, open: string },\n  content: { close: string, open: string },\n  prop: { close: string, open: string },\n  tag: { close: string, open: string },\n  value: { close: string, open: string },\n};\n\ntype JestPrettyFormatIndent = string => string;\ntype JestPrettyFormatRefs = Array<any>;\ntype JestPrettyFormatPrint = any => string;\ntype JestPrettyFormatStringOrNull = string | null;\n\ntype JestPrettyFormatOptions = {|\n  callToJSON: boolean,\n  edgeSpacing: string,\n  escapeRegex: boolean,\n  highlight: boolean,\n  indent: number,\n  maxDepth: number,\n  min: boolean,\n  plugins: JestPrettyFormatPlugins,\n  printFunctionName: boolean,\n  spacing: string,\n  theme: {|\n    comment: string,\n    content: string,\n    prop: string,\n    tag: string,\n    value: string,\n  |},\n|};\n\ntype JestPrettyFormatPlugin = {\n  print: (\n    val: any,\n    serialize: JestPrettyFormatPrint,\n    indent: JestPrettyFormatIndent,\n    opts: JestPrettyFormatOptions,\n    colors: JestPrettyFormatColors,\n  ) => string,\n  test: any => boolean,\n};\n\ntype JestPrettyFormatPlugins = Array<JestPrettyFormatPlugin>;\n\n/** The expect function is used every time you want to test a value */\ndeclare var expect: {\n  /** The object that you want to make assertions against */\n  (value: any):\n    & JestExpectType\n    & JestPromiseType\n    & EnzymeMatchersType\n    & DomTestingLibraryType\n    & JestJQueryMatchersType\n    & JestStyledComponentsMatchersType\n    & JestExtendedMatchersType,\n\n  /** Add additional Jasmine matchers to Jest's roster */\n  extend(matchers: { [name: string]: JestMatcher }): void,\n  /** Add a module that formats application-specific data structures. */\n  addSnapshotSerializer(pluginModule: JestPrettyFormatPlugin): void,\n  assertions(expectedAssertions: number): void,\n  hasAssertions(): void,\n  any(value: mixed): JestAsymmetricEqualityType,\n  anything(): any,\n  arrayContaining(value: Array<mixed>): Array<mixed>,\n  objectContaining(value: Object): Object,\n  /** Matches any received string that contains the exact expected string. */\n  stringContaining(value: string): string,\n  stringMatching(value: string | RegExp): string,\n  not: {\n    arrayContaining: (value: $ReadOnlyArray<mixed>) => Array<mixed>,\n    objectContaining: (value: {}) => Object,\n    stringContaining: (value: string) => string,\n    stringMatching: (value: string | RegExp) => string,\n  },\n};\n\n// TODO handle return type\n// http://jasmine.github.io/2.4/introduction.html#section-Spies\ndeclare function spyOn(value: mixed, method: string): Object;\n\n/** Holds all functions related to manipulating test runner */\ndeclare var jest: JestObjectType;\n\n/**\n * The global Jasmine object, this is generally not exposed as the public API,\n * using features inside here could break in later versions of Jest.\n */\ndeclare var jasmine: {\n  DEFAULT_TIMEOUT_INTERVAL: number,\n  any(value: mixed): JestAsymmetricEqualityType,\n  anything(): any,\n  arrayContaining(value: Array<mixed>): Array<mixed>,\n  clock(): JestClockType,\n  createSpy(name: string): JestSpyType,\n  createSpyObj(\n    baseName: string,\n    methodNames: Array<string>\n  ): { [methodName: string]: JestSpyType },\n  objectContaining(value: Object): Object,\n  stringMatching(value: string): string\n};\n"
  },
  {
    "path": "flow-typed/npm/js-beautify_v1.6.x.js",
    "content": "// flow-typed signature: 3e4bea59bad05fc51a94a6c3d0c65f75\n// flow-typed version: 11460f58fa/js-beautify_v1.6.x/flow_>=v0.25.x\n\ndeclare module 'js-beautify' {\n  declare type JSBeautifyJSOptions = {\n    indent_size?: number,\n    indent_char?: string,\n    indent_with_tabs?: boolean,\n    eol?: string,\n    end_with_newline?: boolean,\n    indent_level?: number,\n    preserve_newlines?: boolean,\n    max_preserve_newlines?: number,\n    space_in_paren?: boolean,\n    space_in_empty_paren?: boolean,\n    jslint_happy?: boolean,\n    space_after_anon_function?: boolean,\n    brace_style?: \"collapse\"\n      |\"collapse,preserve-inline\"\n      |\"expand\"\n      |\"expand,preserve-inline\"\n      |\"end-expand\"\n      |\"end-expand,preserve-inline\"\n      |\"none\"\n      |\"none,preserve-inline\",\n    break_chained_methods?: boolean,\n    keep_array_indentation?: boolean,\n    unescape_strings?: boolean,\n    wrap_line_length?: number,\n    e4x?: boolean,\n    comma_first?: boolean,\n    operator_position?: \"before-newline\"|\"after-newline\"|\"preserve-newline\",\n    eval_code?: boolean,\n    space_before_conditional?: boolean\n  };\n\n  declare type JSBeautifyCSSOptions = {\n    indent_size?: number,\n    indent_char?: string,\n    indent_with_tabs?: boolean,\n    eol?: string,\n    end_with_newline?: boolean,\n    selector_separator_newline?: boolean,\n    newline_between_rules?: boolean\n  };\n\n  declare type JSBeautifyHTMLOptions = {\n    indent_size?: number,\n    indent_char?: string,\n    indent_with_tabs?: boolean,\n    eol?: string,\n    end_with_newline?: boolean,\n    preserve_newlines?: boolean,\n    max_preserve_newlines?: number,\n    indent_inner_html?: boolean,\n    brace_style?: string,\n    indent_scripts?: \"keep\"|\"separate\"|\"normal\",\n    wrap_line_length?: number,\n    wrap_attributes?: \"auto\"|\"force\"|\"force-aligned\",\n    wrap_attributes_indent_size?: number,\n    unformatted?: string|Array<string>,\n    content_unformatted?: string|Array<string>,\n    extra_liners?: string|Array<string>,\n  };\n\n  declare module.exports: {\n    (code: string, options?: JSBeautifyJSOptions): string,\n    js: (code: string, options?: JSBeautifyJSOptions) => string,\n    css: (code: string, options?: JSBeautifyCSSOptions) => string,\n    html: (code: string, options?: JSBeautifyHTMLOptions) => string,\n    js_beautify: (code: string, options?: JSBeautifyJSOptions) => string,\n    css_beautify: (code: string, options?: JSBeautifyCSSOptions) => string,\n    html_beautify: (code: string, options?: JSBeautifyHTMLOptions) => string\n  };\n}\n"
  },
  {
    "path": "flow-typed/npm/js-yaml_vx.x.x.js",
    "content": "// flow-typed signature: 835ef6309457d7c95d7291f5c9c71d1f\n// flow-typed version: <<STUB>>/js-yaml_v^3.6.1/flow_v0.76.0\n\n/**\n * This is an autogenerated libdef stub for:\n *\n *   'js-yaml'\n *\n * Fill this stub out by replacing all the `any` types.\n *\n * Once filled out, we encourage you to share your work with the\n * community by sending a pull request to:\n * https://github.com/flowtype/flow-typed\n */\n\ndeclare module 'js-yaml' {\n  declare module.exports: any;\n}\n\n/**\n * We include stubs for each file inside this npm package in case you need to\n * require those files directly. Feel free to delete any files that aren't\n * needed.\n */\ndeclare module 'js-yaml/bin/js-yaml' {\n  declare module.exports: any;\n}\n\ndeclare module 'js-yaml/dist/js-yaml' {\n  declare module.exports: any;\n}\n\ndeclare module 'js-yaml/dist/js-yaml.min' {\n  declare module.exports: any;\n}\n\ndeclare module 'js-yaml/lib/js-yaml' {\n  declare module.exports: any;\n}\n\ndeclare module 'js-yaml/lib/js-yaml/common' {\n  declare module.exports: any;\n}\n\ndeclare module 'js-yaml/lib/js-yaml/dumper' {\n  declare module.exports: any;\n}\n\ndeclare module 'js-yaml/lib/js-yaml/exception' {\n  declare module.exports: any;\n}\n\ndeclare module 'js-yaml/lib/js-yaml/loader' {\n  declare module.exports: any;\n}\n\ndeclare module 'js-yaml/lib/js-yaml/mark' {\n  declare module.exports: any;\n}\n\ndeclare module 'js-yaml/lib/js-yaml/schema' {\n  declare module.exports: any;\n}\n\ndeclare module 'js-yaml/lib/js-yaml/schema/core' {\n  declare module.exports: any;\n}\n\ndeclare module 'js-yaml/lib/js-yaml/schema/default_full' {\n  declare module.exports: any;\n}\n\ndeclare module 'js-yaml/lib/js-yaml/schema/default_safe' {\n  declare module.exports: any;\n}\n\ndeclare module 'js-yaml/lib/js-yaml/schema/failsafe' {\n  declare module.exports: any;\n}\n\ndeclare module 'js-yaml/lib/js-yaml/schema/json' {\n  declare module.exports: any;\n}\n\ndeclare module 'js-yaml/lib/js-yaml/type' {\n  declare module.exports: any;\n}\n\ndeclare module 'js-yaml/lib/js-yaml/type/binary' {\n  declare module.exports: any;\n}\n\ndeclare module 'js-yaml/lib/js-yaml/type/bool' {\n  declare module.exports: any;\n}\n\ndeclare module 'js-yaml/lib/js-yaml/type/float' {\n  declare module.exports: any;\n}\n\ndeclare module 'js-yaml/lib/js-yaml/type/int' {\n  declare module.exports: any;\n}\n\ndeclare module 'js-yaml/lib/js-yaml/type/js/function' {\n  declare module.exports: any;\n}\n\ndeclare module 'js-yaml/lib/js-yaml/type/js/regexp' {\n  declare module.exports: any;\n}\n\ndeclare module 'js-yaml/lib/js-yaml/type/js/undefined' {\n  declare module.exports: any;\n}\n\ndeclare module 'js-yaml/lib/js-yaml/type/map' {\n  declare module.exports: any;\n}\n\ndeclare module 'js-yaml/lib/js-yaml/type/merge' {\n  declare module.exports: any;\n}\n\ndeclare module 'js-yaml/lib/js-yaml/type/null' {\n  declare module.exports: any;\n}\n\ndeclare module 'js-yaml/lib/js-yaml/type/omap' {\n  declare module.exports: any;\n}\n\ndeclare module 'js-yaml/lib/js-yaml/type/pairs' {\n  declare module.exports: any;\n}\n\ndeclare module 'js-yaml/lib/js-yaml/type/seq' {\n  declare module.exports: any;\n}\n\ndeclare module 'js-yaml/lib/js-yaml/type/set' {\n  declare module.exports: any;\n}\n\ndeclare module 'js-yaml/lib/js-yaml/type/str' {\n  declare module.exports: any;\n}\n\ndeclare module 'js-yaml/lib/js-yaml/type/timestamp' {\n  declare module.exports: any;\n}\n\n// Filename aliases\ndeclare module 'js-yaml/bin/js-yaml.js' {\n  declare module.exports: $Exports<'js-yaml/bin/js-yaml'>;\n}\ndeclare module 'js-yaml/dist/js-yaml.js' {\n  declare module.exports: $Exports<'js-yaml/dist/js-yaml'>;\n}\ndeclare module 'js-yaml/dist/js-yaml.min.js' {\n  declare module.exports: $Exports<'js-yaml/dist/js-yaml.min'>;\n}\ndeclare module 'js-yaml/index' {\n  declare module.exports: $Exports<'js-yaml'>;\n}\ndeclare module 'js-yaml/index.js' {\n  declare module.exports: $Exports<'js-yaml'>;\n}\ndeclare module 'js-yaml/lib/js-yaml.js' {\n  declare module.exports: $Exports<'js-yaml/lib/js-yaml'>;\n}\ndeclare module 'js-yaml/lib/js-yaml/common.js' {\n  declare module.exports: $Exports<'js-yaml/lib/js-yaml/common'>;\n}\ndeclare module 'js-yaml/lib/js-yaml/dumper.js' {\n  declare module.exports: $Exports<'js-yaml/lib/js-yaml/dumper'>;\n}\ndeclare module 'js-yaml/lib/js-yaml/exception.js' {\n  declare module.exports: $Exports<'js-yaml/lib/js-yaml/exception'>;\n}\ndeclare module 'js-yaml/lib/js-yaml/loader.js' {\n  declare module.exports: $Exports<'js-yaml/lib/js-yaml/loader'>;\n}\ndeclare module 'js-yaml/lib/js-yaml/mark.js' {\n  declare module.exports: $Exports<'js-yaml/lib/js-yaml/mark'>;\n}\ndeclare module 'js-yaml/lib/js-yaml/schema.js' {\n  declare module.exports: $Exports<'js-yaml/lib/js-yaml/schema'>;\n}\ndeclare module 'js-yaml/lib/js-yaml/schema/core.js' {\n  declare module.exports: $Exports<'js-yaml/lib/js-yaml/schema/core'>;\n}\ndeclare module 'js-yaml/lib/js-yaml/schema/default_full.js' {\n  declare module.exports: $Exports<'js-yaml/lib/js-yaml/schema/default_full'>;\n}\ndeclare module 'js-yaml/lib/js-yaml/schema/default_safe.js' {\n  declare module.exports: $Exports<'js-yaml/lib/js-yaml/schema/default_safe'>;\n}\ndeclare module 'js-yaml/lib/js-yaml/schema/failsafe.js' {\n  declare module.exports: $Exports<'js-yaml/lib/js-yaml/schema/failsafe'>;\n}\ndeclare module 'js-yaml/lib/js-yaml/schema/json.js' {\n  declare module.exports: $Exports<'js-yaml/lib/js-yaml/schema/json'>;\n}\ndeclare module 'js-yaml/lib/js-yaml/type.js' {\n  declare module.exports: $Exports<'js-yaml/lib/js-yaml/type'>;\n}\ndeclare module 'js-yaml/lib/js-yaml/type/binary.js' {\n  declare module.exports: $Exports<'js-yaml/lib/js-yaml/type/binary'>;\n}\ndeclare module 'js-yaml/lib/js-yaml/type/bool.js' {\n  declare module.exports: $Exports<'js-yaml/lib/js-yaml/type/bool'>;\n}\ndeclare module 'js-yaml/lib/js-yaml/type/float.js' {\n  declare module.exports: $Exports<'js-yaml/lib/js-yaml/type/float'>;\n}\ndeclare module 'js-yaml/lib/js-yaml/type/int.js' {\n  declare module.exports: $Exports<'js-yaml/lib/js-yaml/type/int'>;\n}\ndeclare module 'js-yaml/lib/js-yaml/type/js/function.js' {\n  declare module.exports: $Exports<'js-yaml/lib/js-yaml/type/js/function'>;\n}\ndeclare module 'js-yaml/lib/js-yaml/type/js/regexp.js' {\n  declare module.exports: $Exports<'js-yaml/lib/js-yaml/type/js/regexp'>;\n}\ndeclare module 'js-yaml/lib/js-yaml/type/js/undefined.js' {\n  declare module.exports: $Exports<'js-yaml/lib/js-yaml/type/js/undefined'>;\n}\ndeclare module 'js-yaml/lib/js-yaml/type/map.js' {\n  declare module.exports: $Exports<'js-yaml/lib/js-yaml/type/map'>;\n}\ndeclare module 'js-yaml/lib/js-yaml/type/merge.js' {\n  declare module.exports: $Exports<'js-yaml/lib/js-yaml/type/merge'>;\n}\ndeclare module 'js-yaml/lib/js-yaml/type/null.js' {\n  declare module.exports: $Exports<'js-yaml/lib/js-yaml/type/null'>;\n}\ndeclare module 'js-yaml/lib/js-yaml/type/omap.js' {\n  declare module.exports: $Exports<'js-yaml/lib/js-yaml/type/omap'>;\n}\ndeclare module 'js-yaml/lib/js-yaml/type/pairs.js' {\n  declare module.exports: $Exports<'js-yaml/lib/js-yaml/type/pairs'>;\n}\ndeclare module 'js-yaml/lib/js-yaml/type/seq.js' {\n  declare module.exports: $Exports<'js-yaml/lib/js-yaml/type/seq'>;\n}\ndeclare module 'js-yaml/lib/js-yaml/type/set.js' {\n  declare module.exports: $Exports<'js-yaml/lib/js-yaml/type/set'>;\n}\ndeclare module 'js-yaml/lib/js-yaml/type/str.js' {\n  declare module.exports: $Exports<'js-yaml/lib/js-yaml/type/str'>;\n}\ndeclare module 'js-yaml/lib/js-yaml/type/timestamp.js' {\n  declare module.exports: $Exports<'js-yaml/lib/js-yaml/type/timestamp'>;\n}\n"
  },
  {
    "path": "flow-typed/npm/jsdom_vx.x.x.js",
    "content": "// flow-typed signature: a418fd1b3dcf753c803d7c085363569d\n// flow-typed version: <<STUB>>/jsdom_v^9.2.1/flow_v0.76.0\n\n/**\n * This is an autogenerated libdef stub for:\n *\n *   'jsdom'\n *\n * Fill this stub out by replacing all the `any` types.\n *\n * Once filled out, we encourage you to share your work with the\n * community by sending a pull request to:\n * https://github.com/flowtype/flow-typed\n */\n\ndeclare module 'jsdom' {\n  declare module.exports: any;\n}\n\n/**\n * We include stubs for each file inside this npm package in case you need to\n * require those files directly. Feel free to delete any files that aren't\n * needed.\n */\ndeclare module 'jsdom/lib/jsdom' {\n  declare module.exports: any;\n}\n\ndeclare module 'jsdom/lib/jsdom/browser/default-stylesheet' {\n  declare module.exports: any;\n}\n\ndeclare module 'jsdom/lib/jsdom/browser/documentAdapter' {\n  declare module.exports: any;\n}\n\ndeclare module 'jsdom/lib/jsdom/browser/documentfeatures' {\n  declare module.exports: any;\n}\n\ndeclare module 'jsdom/lib/jsdom/browser/domtohtml' {\n  declare module.exports: any;\n}\n\ndeclare module 'jsdom/lib/jsdom/browser/htmltodom' {\n  declare module.exports: any;\n}\n\ndeclare module 'jsdom/lib/jsdom/browser/not-implemented' {\n  declare module.exports: any;\n}\n\ndeclare module 'jsdom/lib/jsdom/browser/resource-loader' {\n  declare module.exports: any;\n}\n\ndeclare module 'jsdom/lib/jsdom/browser/Window' {\n  declare module.exports: any;\n}\n\ndeclare module 'jsdom/lib/jsdom/level2/style' {\n  declare module.exports: any;\n}\n\ndeclare module 'jsdom/lib/jsdom/level3/xpath' {\n  declare module.exports: any;\n}\n\ndeclare module 'jsdom/lib/jsdom/living/attributes' {\n  declare module.exports: any;\n}\n\ndeclare module 'jsdom/lib/jsdom/living/attributes/Attr-impl' {\n  declare module.exports: any;\n}\n\ndeclare module 'jsdom/lib/jsdom/living/dom-token-list' {\n  declare module.exports: any;\n}\n\ndeclare module 'jsdom/lib/jsdom/living/domparsing/DOMParser-impl' {\n  declare module.exports: any;\n}\n\ndeclare module 'jsdom/lib/jsdom/living/events/CustomEvent-impl' {\n  declare module.exports: any;\n}\n\ndeclare module 'jsdom/lib/jsdom/living/events/ErrorEvent-impl' {\n  declare module.exports: any;\n}\n\ndeclare module 'jsdom/lib/jsdom/living/events/Event-impl' {\n  declare module.exports: any;\n}\n\ndeclare module 'jsdom/lib/jsdom/living/events/EventTarget-impl' {\n  declare module.exports: any;\n}\n\ndeclare module 'jsdom/lib/jsdom/living/events/FocusEvent-impl' {\n  declare module.exports: any;\n}\n\ndeclare module 'jsdom/lib/jsdom/living/events/HashChangeEvent-impl' {\n  declare module.exports: any;\n}\n\ndeclare module 'jsdom/lib/jsdom/living/events/KeyboardEvent-impl' {\n  declare module.exports: any;\n}\n\ndeclare module 'jsdom/lib/jsdom/living/events/MessageEvent-impl' {\n  declare module.exports: any;\n}\n\ndeclare module 'jsdom/lib/jsdom/living/events/MouseEvent-impl' {\n  declare module.exports: any;\n}\n\ndeclare module 'jsdom/lib/jsdom/living/events/PopStateEvent-impl' {\n  declare module.exports: any;\n}\n\ndeclare module 'jsdom/lib/jsdom/living/events/ProgressEvent-impl' {\n  declare module.exports: any;\n}\n\ndeclare module 'jsdom/lib/jsdom/living/events/TouchEvent-impl' {\n  declare module.exports: any;\n}\n\ndeclare module 'jsdom/lib/jsdom/living/events/UIEvent-impl' {\n  declare module.exports: any;\n}\n\ndeclare module 'jsdom/lib/jsdom/living/file-api/Blob-impl' {\n  declare module.exports: any;\n}\n\ndeclare module 'jsdom/lib/jsdom/living/file-api/File-impl' {\n  declare module.exports: any;\n}\n\ndeclare module 'jsdom/lib/jsdom/living/file-api/FileList-impl' {\n  declare module.exports: any;\n}\n\ndeclare module 'jsdom/lib/jsdom/living/file-api/FileReader-impl' {\n  declare module.exports: any;\n}\n\ndeclare module 'jsdom/lib/jsdom/living/form-data-symbols' {\n  declare module.exports: any;\n}\n\ndeclare module 'jsdom/lib/jsdom/living/generated/AddEventListenerOptions' {\n  declare module.exports: any;\n}\n\ndeclare module 'jsdom/lib/jsdom/living/generated/Attr' {\n  declare module.exports: any;\n}\n\ndeclare module 'jsdom/lib/jsdom/living/generated/Blob' {\n  declare module.exports: any;\n}\n\ndeclare module 'jsdom/lib/jsdom/living/generated/BlobPropertyBag' {\n  declare module.exports: any;\n}\n\ndeclare module 'jsdom/lib/jsdom/living/generated/CDATASection' {\n  declare module.exports: any;\n}\n\ndeclare module 'jsdom/lib/jsdom/living/generated/CharacterData' {\n  declare module.exports: any;\n}\n\ndeclare module 'jsdom/lib/jsdom/living/generated/ChildNode' {\n  declare module.exports: any;\n}\n\ndeclare module 'jsdom/lib/jsdom/living/generated/Comment' {\n  declare module.exports: any;\n}\n\ndeclare module 'jsdom/lib/jsdom/living/generated/CustomEvent' {\n  declare module.exports: any;\n}\n\ndeclare module 'jsdom/lib/jsdom/living/generated/CustomEventInit' {\n  declare module.exports: any;\n}\n\ndeclare module 'jsdom/lib/jsdom/living/generated/Document' {\n  declare module.exports: any;\n}\n\ndeclare module 'jsdom/lib/jsdom/living/generated/DocumentFragment' {\n  declare module.exports: any;\n}\n\ndeclare module 'jsdom/lib/jsdom/living/generated/DocumentType' {\n  declare module.exports: any;\n}\n\ndeclare module 'jsdom/lib/jsdom/living/generated/DOMImplementation' {\n  declare module.exports: any;\n}\n\ndeclare module 'jsdom/lib/jsdom/living/generated/DOMParser' {\n  declare module.exports: any;\n}\n\ndeclare module 'jsdom/lib/jsdom/living/generated/Element' {\n  declare module.exports: any;\n}\n\ndeclare module 'jsdom/lib/jsdom/living/generated/ElementContentEditable' {\n  declare module.exports: any;\n}\n\ndeclare module 'jsdom/lib/jsdom/living/generated/ElementCSSInlineStyle' {\n  declare module.exports: any;\n}\n\ndeclare module 'jsdom/lib/jsdom/living/generated/ErrorEvent' {\n  declare module.exports: any;\n}\n\ndeclare module 'jsdom/lib/jsdom/living/generated/ErrorEventInit' {\n  declare module.exports: any;\n}\n\ndeclare module 'jsdom/lib/jsdom/living/generated/Event' {\n  declare module.exports: any;\n}\n\ndeclare module 'jsdom/lib/jsdom/living/generated/EventInit' {\n  declare module.exports: any;\n}\n\ndeclare module 'jsdom/lib/jsdom/living/generated/EventListenerOptions' {\n  declare module.exports: any;\n}\n\ndeclare module 'jsdom/lib/jsdom/living/generated/EventModifierInit' {\n  declare module.exports: any;\n}\n\ndeclare module 'jsdom/lib/jsdom/living/generated/EventTarget' {\n  declare module.exports: any;\n}\n\ndeclare module 'jsdom/lib/jsdom/living/generated/File' {\n  declare module.exports: any;\n}\n\ndeclare module 'jsdom/lib/jsdom/living/generated/FileList' {\n  declare module.exports: any;\n}\n\ndeclare module 'jsdom/lib/jsdom/living/generated/FilePropertyBag' {\n  declare module.exports: any;\n}\n\ndeclare module 'jsdom/lib/jsdom/living/generated/FileReader' {\n  declare module.exports: any;\n}\n\ndeclare module 'jsdom/lib/jsdom/living/generated/FocusEvent' {\n  declare module.exports: any;\n}\n\ndeclare module 'jsdom/lib/jsdom/living/generated/FocusEventInit' {\n  declare module.exports: any;\n}\n\ndeclare module 'jsdom/lib/jsdom/living/generated/FormData' {\n  declare module.exports: any;\n}\n\ndeclare module 'jsdom/lib/jsdom/living/generated/GlobalEventHandlers' {\n  declare module.exports: any;\n}\n\ndeclare module 'jsdom/lib/jsdom/living/generated/HashChangeEvent' {\n  declare module.exports: any;\n}\n\ndeclare module 'jsdom/lib/jsdom/living/generated/HashChangeEventInit' {\n  declare module.exports: any;\n}\n\ndeclare module 'jsdom/lib/jsdom/living/generated/History' {\n  declare module.exports: any;\n}\n\ndeclare module 'jsdom/lib/jsdom/living/generated/HTMLAnchorElement' {\n  declare module.exports: any;\n}\n\ndeclare module 'jsdom/lib/jsdom/living/generated/HTMLAppletElement' {\n  declare module.exports: any;\n}\n\ndeclare module 'jsdom/lib/jsdom/living/generated/HTMLAreaElement' {\n  declare module.exports: any;\n}\n\ndeclare module 'jsdom/lib/jsdom/living/generated/HTMLAudioElement' {\n  declare module.exports: any;\n}\n\ndeclare module 'jsdom/lib/jsdom/living/generated/HTMLBaseElement' {\n  declare module.exports: any;\n}\n\ndeclare module 'jsdom/lib/jsdom/living/generated/HTMLBodyElement' {\n  declare module.exports: any;\n}\n\ndeclare module 'jsdom/lib/jsdom/living/generated/HTMLBRElement' {\n  declare module.exports: any;\n}\n\ndeclare module 'jsdom/lib/jsdom/living/generated/HTMLButtonElement' {\n  declare module.exports: any;\n}\n\ndeclare module 'jsdom/lib/jsdom/living/generated/HTMLCanvasElement' {\n  declare module.exports: any;\n}\n\ndeclare module 'jsdom/lib/jsdom/living/generated/HTMLDataElement' {\n  declare module.exports: any;\n}\n\ndeclare module 'jsdom/lib/jsdom/living/generated/HTMLDataListElement' {\n  declare module.exports: any;\n}\n\ndeclare module 'jsdom/lib/jsdom/living/generated/HTMLDialogElement' {\n  declare module.exports: any;\n}\n\ndeclare module 'jsdom/lib/jsdom/living/generated/HTMLDirectoryElement' {\n  declare module.exports: any;\n}\n\ndeclare module 'jsdom/lib/jsdom/living/generated/HTMLDivElement' {\n  declare module.exports: any;\n}\n\ndeclare module 'jsdom/lib/jsdom/living/generated/HTMLDListElement' {\n  declare module.exports: any;\n}\n\ndeclare module 'jsdom/lib/jsdom/living/generated/HTMLElement' {\n  declare module.exports: any;\n}\n\ndeclare module 'jsdom/lib/jsdom/living/generated/HTMLEmbedElement' {\n  declare module.exports: any;\n}\n\ndeclare module 'jsdom/lib/jsdom/living/generated/HTMLFieldSetElement' {\n  declare module.exports: any;\n}\n\ndeclare module 'jsdom/lib/jsdom/living/generated/HTMLFontElement' {\n  declare module.exports: any;\n}\n\ndeclare module 'jsdom/lib/jsdom/living/generated/HTMLFormElement' {\n  declare module.exports: any;\n}\n\ndeclare module 'jsdom/lib/jsdom/living/generated/HTMLFrameElement' {\n  declare module.exports: any;\n}\n\ndeclare module 'jsdom/lib/jsdom/living/generated/HTMLFrameSetElement' {\n  declare module.exports: any;\n}\n\ndeclare module 'jsdom/lib/jsdom/living/generated/HTMLHeadElement' {\n  declare module.exports: any;\n}\n\ndeclare module 'jsdom/lib/jsdom/living/generated/HTMLHeadingElement' {\n  declare module.exports: any;\n}\n\ndeclare module 'jsdom/lib/jsdom/living/generated/HTMLHRElement' {\n  declare module.exports: any;\n}\n\ndeclare module 'jsdom/lib/jsdom/living/generated/HTMLHtmlElement' {\n  declare module.exports: any;\n}\n\ndeclare module 'jsdom/lib/jsdom/living/generated/HTMLHyperlinkElementUtils' {\n  declare module.exports: any;\n}\n\ndeclare module 'jsdom/lib/jsdom/living/generated/HTMLIFrameElement' {\n  declare module.exports: any;\n}\n\ndeclare module 'jsdom/lib/jsdom/living/generated/HTMLImageElement' {\n  declare module.exports: any;\n}\n\ndeclare module 'jsdom/lib/jsdom/living/generated/HTMLInputElement' {\n  declare module.exports: any;\n}\n\ndeclare module 'jsdom/lib/jsdom/living/generated/HTMLLabelElement' {\n  declare module.exports: any;\n}\n\ndeclare module 'jsdom/lib/jsdom/living/generated/HTMLLegendElement' {\n  declare module.exports: any;\n}\n\ndeclare module 'jsdom/lib/jsdom/living/generated/HTMLLIElement' {\n  declare module.exports: any;\n}\n\ndeclare module 'jsdom/lib/jsdom/living/generated/HTMLLinkElement' {\n  declare module.exports: any;\n}\n\ndeclare module 'jsdom/lib/jsdom/living/generated/HTMLMapElement' {\n  declare module.exports: any;\n}\n\ndeclare module 'jsdom/lib/jsdom/living/generated/HTMLMediaElement' {\n  declare module.exports: any;\n}\n\ndeclare module 'jsdom/lib/jsdom/living/generated/HTMLMenuElement' {\n  declare module.exports: any;\n}\n\ndeclare module 'jsdom/lib/jsdom/living/generated/HTMLMetaElement' {\n  declare module.exports: any;\n}\n\ndeclare module 'jsdom/lib/jsdom/living/generated/HTMLMeterElement' {\n  declare module.exports: any;\n}\n\ndeclare module 'jsdom/lib/jsdom/living/generated/HTMLModElement' {\n  declare module.exports: any;\n}\n\ndeclare module 'jsdom/lib/jsdom/living/generated/HTMLObjectElement' {\n  declare module.exports: any;\n}\n\ndeclare module 'jsdom/lib/jsdom/living/generated/HTMLOListElement' {\n  declare module.exports: any;\n}\n\ndeclare module 'jsdom/lib/jsdom/living/generated/HTMLOptGroupElement' {\n  declare module.exports: any;\n}\n\ndeclare module 'jsdom/lib/jsdom/living/generated/HTMLOptionElement' {\n  declare module.exports: any;\n}\n\ndeclare module 'jsdom/lib/jsdom/living/generated/HTMLOutputElement' {\n  declare module.exports: any;\n}\n\ndeclare module 'jsdom/lib/jsdom/living/generated/HTMLParagraphElement' {\n  declare module.exports: any;\n}\n\ndeclare module 'jsdom/lib/jsdom/living/generated/HTMLParamElement' {\n  declare module.exports: any;\n}\n\ndeclare module 'jsdom/lib/jsdom/living/generated/HTMLPreElement' {\n  declare module.exports: any;\n}\n\ndeclare module 'jsdom/lib/jsdom/living/generated/HTMLProgressElement' {\n  declare module.exports: any;\n}\n\ndeclare module 'jsdom/lib/jsdom/living/generated/HTMLQuoteElement' {\n  declare module.exports: any;\n}\n\ndeclare module 'jsdom/lib/jsdom/living/generated/HTMLScriptElement' {\n  declare module.exports: any;\n}\n\ndeclare module 'jsdom/lib/jsdom/living/generated/HTMLSelectElement' {\n  declare module.exports: any;\n}\n\ndeclare module 'jsdom/lib/jsdom/living/generated/HTMLSourceElement' {\n  declare module.exports: any;\n}\n\ndeclare module 'jsdom/lib/jsdom/living/generated/HTMLSpanElement' {\n  declare module.exports: any;\n}\n\ndeclare module 'jsdom/lib/jsdom/living/generated/HTMLStyleElement' {\n  declare module.exports: any;\n}\n\ndeclare module 'jsdom/lib/jsdom/living/generated/HTMLTableCaptionElement' {\n  declare module.exports: any;\n}\n\ndeclare module 'jsdom/lib/jsdom/living/generated/HTMLTableCellElement' {\n  declare module.exports: any;\n}\n\ndeclare module 'jsdom/lib/jsdom/living/generated/HTMLTableColElement' {\n  declare module.exports: any;\n}\n\ndeclare module 'jsdom/lib/jsdom/living/generated/HTMLTableDataCellElement' {\n  declare module.exports: any;\n}\n\ndeclare module 'jsdom/lib/jsdom/living/generated/HTMLTableElement' {\n  declare module.exports: any;\n}\n\ndeclare module 'jsdom/lib/jsdom/living/generated/HTMLTableHeaderCellElement' {\n  declare module.exports: any;\n}\n\ndeclare module 'jsdom/lib/jsdom/living/generated/HTMLTableRowElement' {\n  declare module.exports: any;\n}\n\ndeclare module 'jsdom/lib/jsdom/living/generated/HTMLTableSectionElement' {\n  declare module.exports: any;\n}\n\ndeclare module 'jsdom/lib/jsdom/living/generated/HTMLTemplateElement' {\n  declare module.exports: any;\n}\n\ndeclare module 'jsdom/lib/jsdom/living/generated/HTMLTextAreaElement' {\n  declare module.exports: any;\n}\n\ndeclare module 'jsdom/lib/jsdom/living/generated/HTMLTimeElement' {\n  declare module.exports: any;\n}\n\ndeclare module 'jsdom/lib/jsdom/living/generated/HTMLTitleElement' {\n  declare module.exports: any;\n}\n\ndeclare module 'jsdom/lib/jsdom/living/generated/HTMLTrackElement' {\n  declare module.exports: any;\n}\n\ndeclare module 'jsdom/lib/jsdom/living/generated/HTMLUListElement' {\n  declare module.exports: any;\n}\n\ndeclare module 'jsdom/lib/jsdom/living/generated/HTMLUnknownElement' {\n  declare module.exports: any;\n}\n\ndeclare module 'jsdom/lib/jsdom/living/generated/HTMLVideoElement' {\n  declare module.exports: any;\n}\n\ndeclare module 'jsdom/lib/jsdom/living/generated/KeyboardEvent' {\n  declare module.exports: any;\n}\n\ndeclare module 'jsdom/lib/jsdom/living/generated/KeyboardEventInit' {\n  declare module.exports: any;\n}\n\ndeclare module 'jsdom/lib/jsdom/living/generated/LinkStyle' {\n  declare module.exports: any;\n}\n\ndeclare module 'jsdom/lib/jsdom/living/generated/Location' {\n  declare module.exports: any;\n}\n\ndeclare module 'jsdom/lib/jsdom/living/generated/MessageEvent' {\n  declare module.exports: any;\n}\n\ndeclare module 'jsdom/lib/jsdom/living/generated/MessageEventInit' {\n  declare module.exports: any;\n}\n\ndeclare module 'jsdom/lib/jsdom/living/generated/MouseEvent' {\n  declare module.exports: any;\n}\n\ndeclare module 'jsdom/lib/jsdom/living/generated/MouseEventInit' {\n  declare module.exports: any;\n}\n\ndeclare module 'jsdom/lib/jsdom/living/generated/MutationEvent' {\n  declare module.exports: any;\n}\n\ndeclare module 'jsdom/lib/jsdom/living/generated/Navigator' {\n  declare module.exports: any;\n}\n\ndeclare module 'jsdom/lib/jsdom/living/generated/NavigatorConcurrentHardware' {\n  declare module.exports: any;\n}\n\ndeclare module 'jsdom/lib/jsdom/living/generated/NavigatorCookies' {\n  declare module.exports: any;\n}\n\ndeclare module 'jsdom/lib/jsdom/living/generated/NavigatorID' {\n  declare module.exports: any;\n}\n\ndeclare module 'jsdom/lib/jsdom/living/generated/NavigatorLanguage' {\n  declare module.exports: any;\n}\n\ndeclare module 'jsdom/lib/jsdom/living/generated/NavigatorOnLine' {\n  declare module.exports: any;\n}\n\ndeclare module 'jsdom/lib/jsdom/living/generated/NavigatorPlugins' {\n  declare module.exports: any;\n}\n\ndeclare module 'jsdom/lib/jsdom/living/generated/Node' {\n  declare module.exports: any;\n}\n\ndeclare module 'jsdom/lib/jsdom/living/generated/NonDocumentTypeChildNode' {\n  declare module.exports: any;\n}\n\ndeclare module 'jsdom/lib/jsdom/living/generated/NonElementParentNode' {\n  declare module.exports: any;\n}\n\ndeclare module 'jsdom/lib/jsdom/living/generated/ParentNode' {\n  declare module.exports: any;\n}\n\ndeclare module 'jsdom/lib/jsdom/living/generated/PopStateEvent' {\n  declare module.exports: any;\n}\n\ndeclare module 'jsdom/lib/jsdom/living/generated/PopStateEventInit' {\n  declare module.exports: any;\n}\n\ndeclare module 'jsdom/lib/jsdom/living/generated/ProcessingInstruction' {\n  declare module.exports: any;\n}\n\ndeclare module 'jsdom/lib/jsdom/living/generated/ProgressEvent' {\n  declare module.exports: any;\n}\n\ndeclare module 'jsdom/lib/jsdom/living/generated/ProgressEventInit' {\n  declare module.exports: any;\n}\n\ndeclare module 'jsdom/lib/jsdom/living/generated/ScrollIntoViewOptions' {\n  declare module.exports: any;\n}\n\ndeclare module 'jsdom/lib/jsdom/living/generated/ScrollOptions' {\n  declare module.exports: any;\n}\n\ndeclare module 'jsdom/lib/jsdom/living/generated/Text' {\n  declare module.exports: any;\n}\n\ndeclare module 'jsdom/lib/jsdom/living/generated/TouchEvent' {\n  declare module.exports: any;\n}\n\ndeclare module 'jsdom/lib/jsdom/living/generated/TreeWalker' {\n  declare module.exports: any;\n}\n\ndeclare module 'jsdom/lib/jsdom/living/generated/UIEvent' {\n  declare module.exports: any;\n}\n\ndeclare module 'jsdom/lib/jsdom/living/generated/UIEventInit' {\n  declare module.exports: any;\n}\n\ndeclare module 'jsdom/lib/jsdom/living/generated/utils' {\n  declare module.exports: any;\n}\n\ndeclare module 'jsdom/lib/jsdom/living/generated/WindowEventHandlers' {\n  declare module.exports: any;\n}\n\ndeclare module 'jsdom/lib/jsdom/living/generated/XMLDocument' {\n  declare module.exports: any;\n}\n\ndeclare module 'jsdom/lib/jsdom/living/helpers/document-base-url' {\n  declare module.exports: any;\n}\n\ndeclare module 'jsdom/lib/jsdom/living/helpers/focusing' {\n  declare module.exports: any;\n}\n\ndeclare module 'jsdom/lib/jsdom/living/helpers/form-controls' {\n  declare module.exports: any;\n}\n\ndeclare module 'jsdom/lib/jsdom/living/helpers/internal-constants' {\n  declare module.exports: any;\n}\n\ndeclare module 'jsdom/lib/jsdom/living/helpers/ordered-set-parser' {\n  declare module.exports: any;\n}\n\ndeclare module 'jsdom/lib/jsdom/living/helpers/proxied-window-event-handlers' {\n  declare module.exports: any;\n}\n\ndeclare module 'jsdom/lib/jsdom/living/helpers/runtime-script-errors' {\n  declare module.exports: any;\n}\n\ndeclare module 'jsdom/lib/jsdom/living/helpers/selectors' {\n  declare module.exports: any;\n}\n\ndeclare module 'jsdom/lib/jsdom/living/helpers/strings' {\n  declare module.exports: any;\n}\n\ndeclare module 'jsdom/lib/jsdom/living/helpers/stylesheets' {\n  declare module.exports: any;\n}\n\ndeclare module 'jsdom/lib/jsdom/living/helpers/traversal' {\n  declare module.exports: any;\n}\n\ndeclare module 'jsdom/lib/jsdom/living/helpers/validate-names' {\n  declare module.exports: any;\n}\n\ndeclare module 'jsdom/lib/jsdom/living/html-collection' {\n  declare module.exports: any;\n}\n\ndeclare module 'jsdom/lib/jsdom/living/index' {\n  declare module.exports: any;\n}\n\ndeclare module 'jsdom/lib/jsdom/living/named-properties-window' {\n  declare module.exports: any;\n}\n\ndeclare module 'jsdom/lib/jsdom/living/navigator/Navigator-impl' {\n  declare module.exports: any;\n}\n\ndeclare module 'jsdom/lib/jsdom/living/navigator/NavigatorConcurrentHardware-impl' {\n  declare module.exports: any;\n}\n\ndeclare module 'jsdom/lib/jsdom/living/navigator/NavigatorCookies-impl' {\n  declare module.exports: any;\n}\n\ndeclare module 'jsdom/lib/jsdom/living/navigator/NavigatorID-impl' {\n  declare module.exports: any;\n}\n\ndeclare module 'jsdom/lib/jsdom/living/navigator/NavigatorLanguage-impl' {\n  declare module.exports: any;\n}\n\ndeclare module 'jsdom/lib/jsdom/living/navigator/NavigatorOnLine-impl' {\n  declare module.exports: any;\n}\n\ndeclare module 'jsdom/lib/jsdom/living/navigator/NavigatorPlugins-impl' {\n  declare module.exports: any;\n}\n\ndeclare module 'jsdom/lib/jsdom/living/node-document-position' {\n  declare module.exports: any;\n}\n\ndeclare module 'jsdom/lib/jsdom/living/node-filter' {\n  declare module.exports: any;\n}\n\ndeclare module 'jsdom/lib/jsdom/living/node-iterator' {\n  declare module.exports: any;\n}\n\ndeclare module 'jsdom/lib/jsdom/living/node-list' {\n  declare module.exports: any;\n}\n\ndeclare module 'jsdom/lib/jsdom/living/node-type' {\n  declare module.exports: any;\n}\n\ndeclare module 'jsdom/lib/jsdom/living/node' {\n  declare module.exports: any;\n}\n\ndeclare module 'jsdom/lib/jsdom/living/nodes/CDATASection-impl' {\n  declare module.exports: any;\n}\n\ndeclare module 'jsdom/lib/jsdom/living/nodes/CharacterData-impl' {\n  declare module.exports: any;\n}\n\ndeclare module 'jsdom/lib/jsdom/living/nodes/ChildNode-impl' {\n  declare module.exports: any;\n}\n\ndeclare module 'jsdom/lib/jsdom/living/nodes/Comment-impl' {\n  declare module.exports: any;\n}\n\ndeclare module 'jsdom/lib/jsdom/living/nodes/Document-impl' {\n  declare module.exports: any;\n}\n\ndeclare module 'jsdom/lib/jsdom/living/nodes/DocumentFragment-impl' {\n  declare module.exports: any;\n}\n\ndeclare module 'jsdom/lib/jsdom/living/nodes/DocumentType-impl' {\n  declare module.exports: any;\n}\n\ndeclare module 'jsdom/lib/jsdom/living/nodes/DOMImplementation-impl' {\n  declare module.exports: any;\n}\n\ndeclare module 'jsdom/lib/jsdom/living/nodes/Element-impl' {\n  declare module.exports: any;\n}\n\ndeclare module 'jsdom/lib/jsdom/living/nodes/ElementContentEditable-impl' {\n  declare module.exports: any;\n}\n\ndeclare module 'jsdom/lib/jsdom/living/nodes/ElementCSSInlineStyle-impl' {\n  declare module.exports: any;\n}\n\ndeclare module 'jsdom/lib/jsdom/living/nodes/GlobalEventHandlers-impl' {\n  declare module.exports: any;\n}\n\ndeclare module 'jsdom/lib/jsdom/living/nodes/HTMLAnchorElement-impl' {\n  declare module.exports: any;\n}\n\ndeclare module 'jsdom/lib/jsdom/living/nodes/HTMLAppletElement-impl' {\n  declare module.exports: any;\n}\n\ndeclare module 'jsdom/lib/jsdom/living/nodes/HTMLAreaElement-impl' {\n  declare module.exports: any;\n}\n\ndeclare module 'jsdom/lib/jsdom/living/nodes/HTMLAudioElement-impl' {\n  declare module.exports: any;\n}\n\ndeclare module 'jsdom/lib/jsdom/living/nodes/HTMLBaseElement-impl' {\n  declare module.exports: any;\n}\n\ndeclare module 'jsdom/lib/jsdom/living/nodes/HTMLBodyElement-impl' {\n  declare module.exports: any;\n}\n\ndeclare module 'jsdom/lib/jsdom/living/nodes/HTMLBRElement-impl' {\n  declare module.exports: any;\n}\n\ndeclare module 'jsdom/lib/jsdom/living/nodes/HTMLButtonElement-impl' {\n  declare module.exports: any;\n}\n\ndeclare module 'jsdom/lib/jsdom/living/nodes/HTMLCanvasElement-impl' {\n  declare module.exports: any;\n}\n\ndeclare module 'jsdom/lib/jsdom/living/nodes/HTMLDataElement-impl' {\n  declare module.exports: any;\n}\n\ndeclare module 'jsdom/lib/jsdom/living/nodes/HTMLDataListElement-impl' {\n  declare module.exports: any;\n}\n\ndeclare module 'jsdom/lib/jsdom/living/nodes/HTMLDialogElement-impl' {\n  declare module.exports: any;\n}\n\ndeclare module 'jsdom/lib/jsdom/living/nodes/HTMLDirectoryElement-impl' {\n  declare module.exports: any;\n}\n\ndeclare module 'jsdom/lib/jsdom/living/nodes/HTMLDivElement-impl' {\n  declare module.exports: any;\n}\n\ndeclare module 'jsdom/lib/jsdom/living/nodes/HTMLDListElement-impl' {\n  declare module.exports: any;\n}\n\ndeclare module 'jsdom/lib/jsdom/living/nodes/HTMLElement-impl' {\n  declare module.exports: any;\n}\n\ndeclare module 'jsdom/lib/jsdom/living/nodes/HTMLEmbedElement-impl' {\n  declare module.exports: any;\n}\n\ndeclare module 'jsdom/lib/jsdom/living/nodes/HTMLFieldSetElement-impl' {\n  declare module.exports: any;\n}\n\ndeclare module 'jsdom/lib/jsdom/living/nodes/HTMLFontElement-impl' {\n  declare module.exports: any;\n}\n\ndeclare module 'jsdom/lib/jsdom/living/nodes/HTMLFormElement-impl' {\n  declare module.exports: any;\n}\n\ndeclare module 'jsdom/lib/jsdom/living/nodes/HTMLFrameElement-impl' {\n  declare module.exports: any;\n}\n\ndeclare module 'jsdom/lib/jsdom/living/nodes/HTMLFrameSetElement-impl' {\n  declare module.exports: any;\n}\n\ndeclare module 'jsdom/lib/jsdom/living/nodes/HTMLHeadElement-impl' {\n  declare module.exports: any;\n}\n\ndeclare module 'jsdom/lib/jsdom/living/nodes/HTMLHeadingElement-impl' {\n  declare module.exports: any;\n}\n\ndeclare module 'jsdom/lib/jsdom/living/nodes/HTMLHRElement-impl' {\n  declare module.exports: any;\n}\n\ndeclare module 'jsdom/lib/jsdom/living/nodes/HTMLHtmlElement-impl' {\n  declare module.exports: any;\n}\n\ndeclare module 'jsdom/lib/jsdom/living/nodes/HTMLHyperlinkElementUtils-impl' {\n  declare module.exports: any;\n}\n\ndeclare module 'jsdom/lib/jsdom/living/nodes/HTMLIFrameElement-impl' {\n  declare module.exports: any;\n}\n\ndeclare module 'jsdom/lib/jsdom/living/nodes/HTMLImageElement-impl' {\n  declare module.exports: any;\n}\n\ndeclare module 'jsdom/lib/jsdom/living/nodes/HTMLInputElement-impl' {\n  declare module.exports: any;\n}\n\ndeclare module 'jsdom/lib/jsdom/living/nodes/HTMLLabelElement-impl' {\n  declare module.exports: any;\n}\n\ndeclare module 'jsdom/lib/jsdom/living/nodes/HTMLLegendElement-impl' {\n  declare module.exports: any;\n}\n\ndeclare module 'jsdom/lib/jsdom/living/nodes/HTMLLIElement-impl' {\n  declare module.exports: any;\n}\n\ndeclare module 'jsdom/lib/jsdom/living/nodes/HTMLLinkElement-impl' {\n  declare module.exports: any;\n}\n\ndeclare module 'jsdom/lib/jsdom/living/nodes/HTMLMapElement-impl' {\n  declare module.exports: any;\n}\n\ndeclare module 'jsdom/lib/jsdom/living/nodes/HTMLMediaElement-impl' {\n  declare module.exports: any;\n}\n\ndeclare module 'jsdom/lib/jsdom/living/nodes/HTMLMenuElement-impl' {\n  declare module.exports: any;\n}\n\ndeclare module 'jsdom/lib/jsdom/living/nodes/HTMLMetaElement-impl' {\n  declare module.exports: any;\n}\n\ndeclare module 'jsdom/lib/jsdom/living/nodes/HTMLMeterElement-impl' {\n  declare module.exports: any;\n}\n\ndeclare module 'jsdom/lib/jsdom/living/nodes/HTMLModElement-impl' {\n  declare module.exports: any;\n}\n\ndeclare module 'jsdom/lib/jsdom/living/nodes/HTMLObjectElement-impl' {\n  declare module.exports: any;\n}\n\ndeclare module 'jsdom/lib/jsdom/living/nodes/HTMLOListElement-impl' {\n  declare module.exports: any;\n}\n\ndeclare module 'jsdom/lib/jsdom/living/nodes/HTMLOptGroupElement-impl' {\n  declare module.exports: any;\n}\n\ndeclare module 'jsdom/lib/jsdom/living/nodes/HTMLOptionElement-impl' {\n  declare module.exports: any;\n}\n\ndeclare module 'jsdom/lib/jsdom/living/nodes/HTMLOutputElement-impl' {\n  declare module.exports: any;\n}\n\ndeclare module 'jsdom/lib/jsdom/living/nodes/HTMLParagraphElement-impl' {\n  declare module.exports: any;\n}\n\ndeclare module 'jsdom/lib/jsdom/living/nodes/HTMLParamElement-impl' {\n  declare module.exports: any;\n}\n\ndeclare module 'jsdom/lib/jsdom/living/nodes/HTMLPreElement-impl' {\n  declare module.exports: any;\n}\n\ndeclare module 'jsdom/lib/jsdom/living/nodes/HTMLProgressElement-impl' {\n  declare module.exports: any;\n}\n\ndeclare module 'jsdom/lib/jsdom/living/nodes/HTMLQuoteElement-impl' {\n  declare module.exports: any;\n}\n\ndeclare module 'jsdom/lib/jsdom/living/nodes/HTMLScriptElement-impl' {\n  declare module.exports: any;\n}\n\ndeclare module 'jsdom/lib/jsdom/living/nodes/HTMLSelectElement-impl' {\n  declare module.exports: any;\n}\n\ndeclare module 'jsdom/lib/jsdom/living/nodes/HTMLSourceElement-impl' {\n  declare module.exports: any;\n}\n\ndeclare module 'jsdom/lib/jsdom/living/nodes/HTMLSpanElement-impl' {\n  declare module.exports: any;\n}\n\ndeclare module 'jsdom/lib/jsdom/living/nodes/HTMLStyleElement-impl' {\n  declare module.exports: any;\n}\n\ndeclare module 'jsdom/lib/jsdom/living/nodes/HTMLTableCaptionElement-impl' {\n  declare module.exports: any;\n}\n\ndeclare module 'jsdom/lib/jsdom/living/nodes/HTMLTableCellElement-impl' {\n  declare module.exports: any;\n}\n\ndeclare module 'jsdom/lib/jsdom/living/nodes/HTMLTableColElement-impl' {\n  declare module.exports: any;\n}\n\ndeclare module 'jsdom/lib/jsdom/living/nodes/HTMLTableDataCellElement-impl' {\n  declare module.exports: any;\n}\n\ndeclare module 'jsdom/lib/jsdom/living/nodes/HTMLTableElement-impl' {\n  declare module.exports: any;\n}\n\ndeclare module 'jsdom/lib/jsdom/living/nodes/HTMLTableHeaderCellElement-impl' {\n  declare module.exports: any;\n}\n\ndeclare module 'jsdom/lib/jsdom/living/nodes/HTMLTableRowElement-impl' {\n  declare module.exports: any;\n}\n\ndeclare module 'jsdom/lib/jsdom/living/nodes/HTMLTableSectionElement-impl' {\n  declare module.exports: any;\n}\n\ndeclare module 'jsdom/lib/jsdom/living/nodes/HTMLTemplateElement-impl' {\n  declare module.exports: any;\n}\n\ndeclare module 'jsdom/lib/jsdom/living/nodes/HTMLTextAreaElement-impl' {\n  declare module.exports: any;\n}\n\ndeclare module 'jsdom/lib/jsdom/living/nodes/HTMLTimeElement-impl' {\n  declare module.exports: any;\n}\n\ndeclare module 'jsdom/lib/jsdom/living/nodes/HTMLTitleElement-impl' {\n  declare module.exports: any;\n}\n\ndeclare module 'jsdom/lib/jsdom/living/nodes/HTMLTrackElement-impl' {\n  declare module.exports: any;\n}\n\ndeclare module 'jsdom/lib/jsdom/living/nodes/HTMLUListElement-impl' {\n  declare module.exports: any;\n}\n\ndeclare module 'jsdom/lib/jsdom/living/nodes/HTMLUnknownElement-impl' {\n  declare module.exports: any;\n}\n\ndeclare module 'jsdom/lib/jsdom/living/nodes/HTMLVideoElement-impl' {\n  declare module.exports: any;\n}\n\ndeclare module 'jsdom/lib/jsdom/living/nodes/LinkStyle-impl' {\n  declare module.exports: any;\n}\n\ndeclare module 'jsdom/lib/jsdom/living/nodes/Node-impl' {\n  declare module.exports: any;\n}\n\ndeclare module 'jsdom/lib/jsdom/living/nodes/NonDocumentTypeChildNode-impl' {\n  declare module.exports: any;\n}\n\ndeclare module 'jsdom/lib/jsdom/living/nodes/NonElementParentNode-impl' {\n  declare module.exports: any;\n}\n\ndeclare module 'jsdom/lib/jsdom/living/nodes/ParentNode-impl' {\n  declare module.exports: any;\n}\n\ndeclare module 'jsdom/lib/jsdom/living/nodes/ProcessingInstruction-impl' {\n  declare module.exports: any;\n}\n\ndeclare module 'jsdom/lib/jsdom/living/nodes/Text-impl' {\n  declare module.exports: any;\n}\n\ndeclare module 'jsdom/lib/jsdom/living/nodes/WindowEventHandlers-impl' {\n  declare module.exports: any;\n}\n\ndeclare module 'jsdom/lib/jsdom/living/nodes/XMLDocument-impl' {\n  declare module.exports: any;\n}\n\ndeclare module 'jsdom/lib/jsdom/living/post-message' {\n  declare module.exports: any;\n}\n\ndeclare module 'jsdom/lib/jsdom/living/register-elements' {\n  declare module.exports: any;\n}\n\ndeclare module 'jsdom/lib/jsdom/living/traversal/TreeWalker-impl' {\n  declare module.exports: any;\n}\n\ndeclare module 'jsdom/lib/jsdom/living/window/History-impl' {\n  declare module.exports: any;\n}\n\ndeclare module 'jsdom/lib/jsdom/living/window/Location-impl' {\n  declare module.exports: any;\n}\n\ndeclare module 'jsdom/lib/jsdom/living/window/navigation' {\n  declare module.exports: any;\n}\n\ndeclare module 'jsdom/lib/jsdom/living/xhr-sync-worker' {\n  declare module.exports: any;\n}\n\ndeclare module 'jsdom/lib/jsdom/living/xhr-utils' {\n  declare module.exports: any;\n}\n\ndeclare module 'jsdom/lib/jsdom/living/xhr/FormData-impl' {\n  declare module.exports: any;\n}\n\ndeclare module 'jsdom/lib/jsdom/living/xmlhttprequest-event-target' {\n  declare module.exports: any;\n}\n\ndeclare module 'jsdom/lib/jsdom/living/xmlhttprequest-symbols' {\n  declare module.exports: any;\n}\n\ndeclare module 'jsdom/lib/jsdom/living/xmlhttprequest-upload' {\n  declare module.exports: any;\n}\n\ndeclare module 'jsdom/lib/jsdom/living/xmlhttprequest' {\n  declare module.exports: any;\n}\n\ndeclare module 'jsdom/lib/jsdom/named-properties-tracker' {\n  declare module.exports: any;\n}\n\ndeclare module 'jsdom/lib/jsdom/utils' {\n  declare module.exports: any;\n}\n\ndeclare module 'jsdom/lib/jsdom/virtual-console' {\n  declare module.exports: any;\n}\n\ndeclare module 'jsdom/lib/jsdom/vm-shim' {\n  declare module.exports: any;\n}\n\ndeclare module 'jsdom/lib/jsdom/web-idl/DOMException' {\n  declare module.exports: any;\n}\n\n// Filename aliases\ndeclare module 'jsdom/lib/jsdom.js' {\n  declare module.exports: $Exports<'jsdom/lib/jsdom'>;\n}\ndeclare module 'jsdom/lib/jsdom/browser/default-stylesheet.js' {\n  declare module.exports: $Exports<'jsdom/lib/jsdom/browser/default-stylesheet'>;\n}\ndeclare module 'jsdom/lib/jsdom/browser/documentAdapter.js' {\n  declare module.exports: $Exports<'jsdom/lib/jsdom/browser/documentAdapter'>;\n}\ndeclare module 'jsdom/lib/jsdom/browser/documentfeatures.js' {\n  declare module.exports: $Exports<'jsdom/lib/jsdom/browser/documentfeatures'>;\n}\ndeclare module 'jsdom/lib/jsdom/browser/domtohtml.js' {\n  declare module.exports: $Exports<'jsdom/lib/jsdom/browser/domtohtml'>;\n}\ndeclare module 'jsdom/lib/jsdom/browser/htmltodom.js' {\n  declare module.exports: $Exports<'jsdom/lib/jsdom/browser/htmltodom'>;\n}\ndeclare module 'jsdom/lib/jsdom/browser/not-implemented.js' {\n  declare module.exports: $Exports<'jsdom/lib/jsdom/browser/not-implemented'>;\n}\ndeclare module 'jsdom/lib/jsdom/browser/resource-loader.js' {\n  declare module.exports: $Exports<'jsdom/lib/jsdom/browser/resource-loader'>;\n}\ndeclare module 'jsdom/lib/jsdom/browser/Window.js' {\n  declare module.exports: $Exports<'jsdom/lib/jsdom/browser/Window'>;\n}\ndeclare module 'jsdom/lib/jsdom/level2/style.js' {\n  declare module.exports: $Exports<'jsdom/lib/jsdom/level2/style'>;\n}\ndeclare module 'jsdom/lib/jsdom/level3/xpath.js' {\n  declare module.exports: $Exports<'jsdom/lib/jsdom/level3/xpath'>;\n}\ndeclare module 'jsdom/lib/jsdom/living/attributes.js' {\n  declare module.exports: $Exports<'jsdom/lib/jsdom/living/attributes'>;\n}\ndeclare module 'jsdom/lib/jsdom/living/attributes/Attr-impl.js' {\n  declare module.exports: $Exports<'jsdom/lib/jsdom/living/attributes/Attr-impl'>;\n}\ndeclare module 'jsdom/lib/jsdom/living/dom-token-list.js' {\n  declare module.exports: $Exports<'jsdom/lib/jsdom/living/dom-token-list'>;\n}\ndeclare module 'jsdom/lib/jsdom/living/domparsing/DOMParser-impl.js' {\n  declare module.exports: $Exports<'jsdom/lib/jsdom/living/domparsing/DOMParser-impl'>;\n}\ndeclare module 'jsdom/lib/jsdom/living/events/CustomEvent-impl.js' {\n  declare module.exports: $Exports<'jsdom/lib/jsdom/living/events/CustomEvent-impl'>;\n}\ndeclare module 'jsdom/lib/jsdom/living/events/ErrorEvent-impl.js' {\n  declare module.exports: $Exports<'jsdom/lib/jsdom/living/events/ErrorEvent-impl'>;\n}\ndeclare module 'jsdom/lib/jsdom/living/events/Event-impl.js' {\n  declare module.exports: $Exports<'jsdom/lib/jsdom/living/events/Event-impl'>;\n}\ndeclare module 'jsdom/lib/jsdom/living/events/EventTarget-impl.js' {\n  declare module.exports: $Exports<'jsdom/lib/jsdom/living/events/EventTarget-impl'>;\n}\ndeclare module 'jsdom/lib/jsdom/living/events/FocusEvent-impl.js' {\n  declare module.exports: $Exports<'jsdom/lib/jsdom/living/events/FocusEvent-impl'>;\n}\ndeclare module 'jsdom/lib/jsdom/living/events/HashChangeEvent-impl.js' {\n  declare module.exports: $Exports<'jsdom/lib/jsdom/living/events/HashChangeEvent-impl'>;\n}\ndeclare module 'jsdom/lib/jsdom/living/events/KeyboardEvent-impl.js' {\n  declare module.exports: $Exports<'jsdom/lib/jsdom/living/events/KeyboardEvent-impl'>;\n}\ndeclare module 'jsdom/lib/jsdom/living/events/MessageEvent-impl.js' {\n  declare module.exports: $Exports<'jsdom/lib/jsdom/living/events/MessageEvent-impl'>;\n}\ndeclare module 'jsdom/lib/jsdom/living/events/MouseEvent-impl.js' {\n  declare module.exports: $Exports<'jsdom/lib/jsdom/living/events/MouseEvent-impl'>;\n}\ndeclare module 'jsdom/lib/jsdom/living/events/PopStateEvent-impl.js' {\n  declare module.exports: $Exports<'jsdom/lib/jsdom/living/events/PopStateEvent-impl'>;\n}\ndeclare module 'jsdom/lib/jsdom/living/events/ProgressEvent-impl.js' {\n  declare module.exports: $Exports<'jsdom/lib/jsdom/living/events/ProgressEvent-impl'>;\n}\ndeclare module 'jsdom/lib/jsdom/living/events/TouchEvent-impl.js' {\n  declare module.exports: $Exports<'jsdom/lib/jsdom/living/events/TouchEvent-impl'>;\n}\ndeclare module 'jsdom/lib/jsdom/living/events/UIEvent-impl.js' {\n  declare module.exports: $Exports<'jsdom/lib/jsdom/living/events/UIEvent-impl'>;\n}\ndeclare module 'jsdom/lib/jsdom/living/file-api/Blob-impl.js' {\n  declare module.exports: $Exports<'jsdom/lib/jsdom/living/file-api/Blob-impl'>;\n}\ndeclare module 'jsdom/lib/jsdom/living/file-api/File-impl.js' {\n  declare module.exports: $Exports<'jsdom/lib/jsdom/living/file-api/File-impl'>;\n}\ndeclare module 'jsdom/lib/jsdom/living/file-api/FileList-impl.js' {\n  declare module.exports: $Exports<'jsdom/lib/jsdom/living/file-api/FileList-impl'>;\n}\ndeclare module 'jsdom/lib/jsdom/living/file-api/FileReader-impl.js' {\n  declare module.exports: $Exports<'jsdom/lib/jsdom/living/file-api/FileReader-impl'>;\n}\ndeclare module 'jsdom/lib/jsdom/living/form-data-symbols.js' {\n  declare module.exports: $Exports<'jsdom/lib/jsdom/living/form-data-symbols'>;\n}\ndeclare module 'jsdom/lib/jsdom/living/generated/AddEventListenerOptions.js' {\n  declare module.exports: $Exports<'jsdom/lib/jsdom/living/generated/AddEventListenerOptions'>;\n}\ndeclare module 'jsdom/lib/jsdom/living/generated/Attr.js' {\n  declare module.exports: $Exports<'jsdom/lib/jsdom/living/generated/Attr'>;\n}\ndeclare module 'jsdom/lib/jsdom/living/generated/Blob.js' {\n  declare module.exports: $Exports<'jsdom/lib/jsdom/living/generated/Blob'>;\n}\ndeclare module 'jsdom/lib/jsdom/living/generated/BlobPropertyBag.js' {\n  declare module.exports: $Exports<'jsdom/lib/jsdom/living/generated/BlobPropertyBag'>;\n}\ndeclare module 'jsdom/lib/jsdom/living/generated/CDATASection.js' {\n  declare module.exports: $Exports<'jsdom/lib/jsdom/living/generated/CDATASection'>;\n}\ndeclare module 'jsdom/lib/jsdom/living/generated/CharacterData.js' {\n  declare module.exports: $Exports<'jsdom/lib/jsdom/living/generated/CharacterData'>;\n}\ndeclare module 'jsdom/lib/jsdom/living/generated/ChildNode.js' {\n  declare module.exports: $Exports<'jsdom/lib/jsdom/living/generated/ChildNode'>;\n}\ndeclare module 'jsdom/lib/jsdom/living/generated/Comment.js' {\n  declare module.exports: $Exports<'jsdom/lib/jsdom/living/generated/Comment'>;\n}\ndeclare module 'jsdom/lib/jsdom/living/generated/CustomEvent.js' {\n  declare module.exports: $Exports<'jsdom/lib/jsdom/living/generated/CustomEvent'>;\n}\ndeclare module 'jsdom/lib/jsdom/living/generated/CustomEventInit.js' {\n  declare module.exports: $Exports<'jsdom/lib/jsdom/living/generated/CustomEventInit'>;\n}\ndeclare module 'jsdom/lib/jsdom/living/generated/Document.js' {\n  declare module.exports: $Exports<'jsdom/lib/jsdom/living/generated/Document'>;\n}\ndeclare module 'jsdom/lib/jsdom/living/generated/DocumentFragment.js' {\n  declare module.exports: $Exports<'jsdom/lib/jsdom/living/generated/DocumentFragment'>;\n}\ndeclare module 'jsdom/lib/jsdom/living/generated/DocumentType.js' {\n  declare module.exports: $Exports<'jsdom/lib/jsdom/living/generated/DocumentType'>;\n}\ndeclare module 'jsdom/lib/jsdom/living/generated/DOMImplementation.js' {\n  declare module.exports: $Exports<'jsdom/lib/jsdom/living/generated/DOMImplementation'>;\n}\ndeclare module 'jsdom/lib/jsdom/living/generated/DOMParser.js' {\n  declare module.exports: $Exports<'jsdom/lib/jsdom/living/generated/DOMParser'>;\n}\ndeclare module 'jsdom/lib/jsdom/living/generated/Element.js' {\n  declare module.exports: $Exports<'jsdom/lib/jsdom/living/generated/Element'>;\n}\ndeclare module 'jsdom/lib/jsdom/living/generated/ElementContentEditable.js' {\n  declare module.exports: $Exports<'jsdom/lib/jsdom/living/generated/ElementContentEditable'>;\n}\ndeclare module 'jsdom/lib/jsdom/living/generated/ElementCSSInlineStyle.js' {\n  declare module.exports: $Exports<'jsdom/lib/jsdom/living/generated/ElementCSSInlineStyle'>;\n}\ndeclare module 'jsdom/lib/jsdom/living/generated/ErrorEvent.js' {\n  declare module.exports: $Exports<'jsdom/lib/jsdom/living/generated/ErrorEvent'>;\n}\ndeclare module 'jsdom/lib/jsdom/living/generated/ErrorEventInit.js' {\n  declare module.exports: $Exports<'jsdom/lib/jsdom/living/generated/ErrorEventInit'>;\n}\ndeclare module 'jsdom/lib/jsdom/living/generated/Event.js' {\n  declare module.exports: $Exports<'jsdom/lib/jsdom/living/generated/Event'>;\n}\ndeclare module 'jsdom/lib/jsdom/living/generated/EventInit.js' {\n  declare module.exports: $Exports<'jsdom/lib/jsdom/living/generated/EventInit'>;\n}\ndeclare module 'jsdom/lib/jsdom/living/generated/EventListenerOptions.js' {\n  declare module.exports: $Exports<'jsdom/lib/jsdom/living/generated/EventListenerOptions'>;\n}\ndeclare module 'jsdom/lib/jsdom/living/generated/EventModifierInit.js' {\n  declare module.exports: $Exports<'jsdom/lib/jsdom/living/generated/EventModifierInit'>;\n}\ndeclare module 'jsdom/lib/jsdom/living/generated/EventTarget.js' {\n  declare module.exports: $Exports<'jsdom/lib/jsdom/living/generated/EventTarget'>;\n}\ndeclare module 'jsdom/lib/jsdom/living/generated/File.js' {\n  declare module.exports: $Exports<'jsdom/lib/jsdom/living/generated/File'>;\n}\ndeclare module 'jsdom/lib/jsdom/living/generated/FileList.js' {\n  declare module.exports: $Exports<'jsdom/lib/jsdom/living/generated/FileList'>;\n}\ndeclare module 'jsdom/lib/jsdom/living/generated/FilePropertyBag.js' {\n  declare module.exports: $Exports<'jsdom/lib/jsdom/living/generated/FilePropertyBag'>;\n}\ndeclare module 'jsdom/lib/jsdom/living/generated/FileReader.js' {\n  declare module.exports: $Exports<'jsdom/lib/jsdom/living/generated/FileReader'>;\n}\ndeclare module 'jsdom/lib/jsdom/living/generated/FocusEvent.js' {\n  declare module.exports: $Exports<'jsdom/lib/jsdom/living/generated/FocusEvent'>;\n}\ndeclare module 'jsdom/lib/jsdom/living/generated/FocusEventInit.js' {\n  declare module.exports: $Exports<'jsdom/lib/jsdom/living/generated/FocusEventInit'>;\n}\ndeclare module 'jsdom/lib/jsdom/living/generated/FormData.js' {\n  declare module.exports: $Exports<'jsdom/lib/jsdom/living/generated/FormData'>;\n}\ndeclare module 'jsdom/lib/jsdom/living/generated/GlobalEventHandlers.js' {\n  declare module.exports: $Exports<'jsdom/lib/jsdom/living/generated/GlobalEventHandlers'>;\n}\ndeclare module 'jsdom/lib/jsdom/living/generated/HashChangeEvent.js' {\n  declare module.exports: $Exports<'jsdom/lib/jsdom/living/generated/HashChangeEvent'>;\n}\ndeclare module 'jsdom/lib/jsdom/living/generated/HashChangeEventInit.js' {\n  declare module.exports: $Exports<'jsdom/lib/jsdom/living/generated/HashChangeEventInit'>;\n}\ndeclare module 'jsdom/lib/jsdom/living/generated/History.js' {\n  declare module.exports: $Exports<'jsdom/lib/jsdom/living/generated/History'>;\n}\ndeclare module 'jsdom/lib/jsdom/living/generated/HTMLAnchorElement.js' {\n  declare module.exports: $Exports<'jsdom/lib/jsdom/living/generated/HTMLAnchorElement'>;\n}\ndeclare module 'jsdom/lib/jsdom/living/generated/HTMLAppletElement.js' {\n  declare module.exports: $Exports<'jsdom/lib/jsdom/living/generated/HTMLAppletElement'>;\n}\ndeclare module 'jsdom/lib/jsdom/living/generated/HTMLAreaElement.js' {\n  declare module.exports: $Exports<'jsdom/lib/jsdom/living/generated/HTMLAreaElement'>;\n}\ndeclare module 'jsdom/lib/jsdom/living/generated/HTMLAudioElement.js' {\n  declare module.exports: $Exports<'jsdom/lib/jsdom/living/generated/HTMLAudioElement'>;\n}\ndeclare module 'jsdom/lib/jsdom/living/generated/HTMLBaseElement.js' {\n  declare module.exports: $Exports<'jsdom/lib/jsdom/living/generated/HTMLBaseElement'>;\n}\ndeclare module 'jsdom/lib/jsdom/living/generated/HTMLBodyElement.js' {\n  declare module.exports: $Exports<'jsdom/lib/jsdom/living/generated/HTMLBodyElement'>;\n}\ndeclare module 'jsdom/lib/jsdom/living/generated/HTMLBRElement.js' {\n  declare module.exports: $Exports<'jsdom/lib/jsdom/living/generated/HTMLBRElement'>;\n}\ndeclare module 'jsdom/lib/jsdom/living/generated/HTMLButtonElement.js' {\n  declare module.exports: $Exports<'jsdom/lib/jsdom/living/generated/HTMLButtonElement'>;\n}\ndeclare module 'jsdom/lib/jsdom/living/generated/HTMLCanvasElement.js' {\n  declare module.exports: $Exports<'jsdom/lib/jsdom/living/generated/HTMLCanvasElement'>;\n}\ndeclare module 'jsdom/lib/jsdom/living/generated/HTMLDataElement.js' {\n  declare module.exports: $Exports<'jsdom/lib/jsdom/living/generated/HTMLDataElement'>;\n}\ndeclare module 'jsdom/lib/jsdom/living/generated/HTMLDataListElement.js' {\n  declare module.exports: $Exports<'jsdom/lib/jsdom/living/generated/HTMLDataListElement'>;\n}\ndeclare module 'jsdom/lib/jsdom/living/generated/HTMLDialogElement.js' {\n  declare module.exports: $Exports<'jsdom/lib/jsdom/living/generated/HTMLDialogElement'>;\n}\ndeclare module 'jsdom/lib/jsdom/living/generated/HTMLDirectoryElement.js' {\n  declare module.exports: $Exports<'jsdom/lib/jsdom/living/generated/HTMLDirectoryElement'>;\n}\ndeclare module 'jsdom/lib/jsdom/living/generated/HTMLDivElement.js' {\n  declare module.exports: $Exports<'jsdom/lib/jsdom/living/generated/HTMLDivElement'>;\n}\ndeclare module 'jsdom/lib/jsdom/living/generated/HTMLDListElement.js' {\n  declare module.exports: $Exports<'jsdom/lib/jsdom/living/generated/HTMLDListElement'>;\n}\ndeclare module 'jsdom/lib/jsdom/living/generated/HTMLElement.js' {\n  declare module.exports: $Exports<'jsdom/lib/jsdom/living/generated/HTMLElement'>;\n}\ndeclare module 'jsdom/lib/jsdom/living/generated/HTMLEmbedElement.js' {\n  declare module.exports: $Exports<'jsdom/lib/jsdom/living/generated/HTMLEmbedElement'>;\n}\ndeclare module 'jsdom/lib/jsdom/living/generated/HTMLFieldSetElement.js' {\n  declare module.exports: $Exports<'jsdom/lib/jsdom/living/generated/HTMLFieldSetElement'>;\n}\ndeclare module 'jsdom/lib/jsdom/living/generated/HTMLFontElement.js' {\n  declare module.exports: $Exports<'jsdom/lib/jsdom/living/generated/HTMLFontElement'>;\n}\ndeclare module 'jsdom/lib/jsdom/living/generated/HTMLFormElement.js' {\n  declare module.exports: $Exports<'jsdom/lib/jsdom/living/generated/HTMLFormElement'>;\n}\ndeclare module 'jsdom/lib/jsdom/living/generated/HTMLFrameElement.js' {\n  declare module.exports: $Exports<'jsdom/lib/jsdom/living/generated/HTMLFrameElement'>;\n}\ndeclare module 'jsdom/lib/jsdom/living/generated/HTMLFrameSetElement.js' {\n  declare module.exports: $Exports<'jsdom/lib/jsdom/living/generated/HTMLFrameSetElement'>;\n}\ndeclare module 'jsdom/lib/jsdom/living/generated/HTMLHeadElement.js' {\n  declare module.exports: $Exports<'jsdom/lib/jsdom/living/generated/HTMLHeadElement'>;\n}\ndeclare module 'jsdom/lib/jsdom/living/generated/HTMLHeadingElement.js' {\n  declare module.exports: $Exports<'jsdom/lib/jsdom/living/generated/HTMLHeadingElement'>;\n}\ndeclare module 'jsdom/lib/jsdom/living/generated/HTMLHRElement.js' {\n  declare module.exports: $Exports<'jsdom/lib/jsdom/living/generated/HTMLHRElement'>;\n}\ndeclare module 'jsdom/lib/jsdom/living/generated/HTMLHtmlElement.js' {\n  declare module.exports: $Exports<'jsdom/lib/jsdom/living/generated/HTMLHtmlElement'>;\n}\ndeclare module 'jsdom/lib/jsdom/living/generated/HTMLHyperlinkElementUtils.js' {\n  declare module.exports: $Exports<'jsdom/lib/jsdom/living/generated/HTMLHyperlinkElementUtils'>;\n}\ndeclare module 'jsdom/lib/jsdom/living/generated/HTMLIFrameElement.js' {\n  declare module.exports: $Exports<'jsdom/lib/jsdom/living/generated/HTMLIFrameElement'>;\n}\ndeclare module 'jsdom/lib/jsdom/living/generated/HTMLImageElement.js' {\n  declare module.exports: $Exports<'jsdom/lib/jsdom/living/generated/HTMLImageElement'>;\n}\ndeclare module 'jsdom/lib/jsdom/living/generated/HTMLInputElement.js' {\n  declare module.exports: $Exports<'jsdom/lib/jsdom/living/generated/HTMLInputElement'>;\n}\ndeclare module 'jsdom/lib/jsdom/living/generated/HTMLLabelElement.js' {\n  declare module.exports: $Exports<'jsdom/lib/jsdom/living/generated/HTMLLabelElement'>;\n}\ndeclare module 'jsdom/lib/jsdom/living/generated/HTMLLegendElement.js' {\n  declare module.exports: $Exports<'jsdom/lib/jsdom/living/generated/HTMLLegendElement'>;\n}\ndeclare module 'jsdom/lib/jsdom/living/generated/HTMLLIElement.js' {\n  declare module.exports: $Exports<'jsdom/lib/jsdom/living/generated/HTMLLIElement'>;\n}\ndeclare module 'jsdom/lib/jsdom/living/generated/HTMLLinkElement.js' {\n  declare module.exports: $Exports<'jsdom/lib/jsdom/living/generated/HTMLLinkElement'>;\n}\ndeclare module 'jsdom/lib/jsdom/living/generated/HTMLMapElement.js' {\n  declare module.exports: $Exports<'jsdom/lib/jsdom/living/generated/HTMLMapElement'>;\n}\ndeclare module 'jsdom/lib/jsdom/living/generated/HTMLMediaElement.js' {\n  declare module.exports: $Exports<'jsdom/lib/jsdom/living/generated/HTMLMediaElement'>;\n}\ndeclare module 'jsdom/lib/jsdom/living/generated/HTMLMenuElement.js' {\n  declare module.exports: $Exports<'jsdom/lib/jsdom/living/generated/HTMLMenuElement'>;\n}\ndeclare module 'jsdom/lib/jsdom/living/generated/HTMLMetaElement.js' {\n  declare module.exports: $Exports<'jsdom/lib/jsdom/living/generated/HTMLMetaElement'>;\n}\ndeclare module 'jsdom/lib/jsdom/living/generated/HTMLMeterElement.js' {\n  declare module.exports: $Exports<'jsdom/lib/jsdom/living/generated/HTMLMeterElement'>;\n}\ndeclare module 'jsdom/lib/jsdom/living/generated/HTMLModElement.js' {\n  declare module.exports: $Exports<'jsdom/lib/jsdom/living/generated/HTMLModElement'>;\n}\ndeclare module 'jsdom/lib/jsdom/living/generated/HTMLObjectElement.js' {\n  declare module.exports: $Exports<'jsdom/lib/jsdom/living/generated/HTMLObjectElement'>;\n}\ndeclare module 'jsdom/lib/jsdom/living/generated/HTMLOListElement.js' {\n  declare module.exports: $Exports<'jsdom/lib/jsdom/living/generated/HTMLOListElement'>;\n}\ndeclare module 'jsdom/lib/jsdom/living/generated/HTMLOptGroupElement.js' {\n  declare module.exports: $Exports<'jsdom/lib/jsdom/living/generated/HTMLOptGroupElement'>;\n}\ndeclare module 'jsdom/lib/jsdom/living/generated/HTMLOptionElement.js' {\n  declare module.exports: $Exports<'jsdom/lib/jsdom/living/generated/HTMLOptionElement'>;\n}\ndeclare module 'jsdom/lib/jsdom/living/generated/HTMLOutputElement.js' {\n  declare module.exports: $Exports<'jsdom/lib/jsdom/living/generated/HTMLOutputElement'>;\n}\ndeclare module 'jsdom/lib/jsdom/living/generated/HTMLParagraphElement.js' {\n  declare module.exports: $Exports<'jsdom/lib/jsdom/living/generated/HTMLParagraphElement'>;\n}\ndeclare module 'jsdom/lib/jsdom/living/generated/HTMLParamElement.js' {\n  declare module.exports: $Exports<'jsdom/lib/jsdom/living/generated/HTMLParamElement'>;\n}\ndeclare module 'jsdom/lib/jsdom/living/generated/HTMLPreElement.js' {\n  declare module.exports: $Exports<'jsdom/lib/jsdom/living/generated/HTMLPreElement'>;\n}\ndeclare module 'jsdom/lib/jsdom/living/generated/HTMLProgressElement.js' {\n  declare module.exports: $Exports<'jsdom/lib/jsdom/living/generated/HTMLProgressElement'>;\n}\ndeclare module 'jsdom/lib/jsdom/living/generated/HTMLQuoteElement.js' {\n  declare module.exports: $Exports<'jsdom/lib/jsdom/living/generated/HTMLQuoteElement'>;\n}\ndeclare module 'jsdom/lib/jsdom/living/generated/HTMLScriptElement.js' {\n  declare module.exports: $Exports<'jsdom/lib/jsdom/living/generated/HTMLScriptElement'>;\n}\ndeclare module 'jsdom/lib/jsdom/living/generated/HTMLSelectElement.js' {\n  declare module.exports: $Exports<'jsdom/lib/jsdom/living/generated/HTMLSelectElement'>;\n}\ndeclare module 'jsdom/lib/jsdom/living/generated/HTMLSourceElement.js' {\n  declare module.exports: $Exports<'jsdom/lib/jsdom/living/generated/HTMLSourceElement'>;\n}\ndeclare module 'jsdom/lib/jsdom/living/generated/HTMLSpanElement.js' {\n  declare module.exports: $Exports<'jsdom/lib/jsdom/living/generated/HTMLSpanElement'>;\n}\ndeclare module 'jsdom/lib/jsdom/living/generated/HTMLStyleElement.js' {\n  declare module.exports: $Exports<'jsdom/lib/jsdom/living/generated/HTMLStyleElement'>;\n}\ndeclare module 'jsdom/lib/jsdom/living/generated/HTMLTableCaptionElement.js' {\n  declare module.exports: $Exports<'jsdom/lib/jsdom/living/generated/HTMLTableCaptionElement'>;\n}\ndeclare module 'jsdom/lib/jsdom/living/generated/HTMLTableCellElement.js' {\n  declare module.exports: $Exports<'jsdom/lib/jsdom/living/generated/HTMLTableCellElement'>;\n}\ndeclare module 'jsdom/lib/jsdom/living/generated/HTMLTableColElement.js' {\n  declare module.exports: $Exports<'jsdom/lib/jsdom/living/generated/HTMLTableColElement'>;\n}\ndeclare module 'jsdom/lib/jsdom/living/generated/HTMLTableDataCellElement.js' {\n  declare module.exports: $Exports<'jsdom/lib/jsdom/living/generated/HTMLTableDataCellElement'>;\n}\ndeclare module 'jsdom/lib/jsdom/living/generated/HTMLTableElement.js' {\n  declare module.exports: $Exports<'jsdom/lib/jsdom/living/generated/HTMLTableElement'>;\n}\ndeclare module 'jsdom/lib/jsdom/living/generated/HTMLTableHeaderCellElement.js' {\n  declare module.exports: $Exports<'jsdom/lib/jsdom/living/generated/HTMLTableHeaderCellElement'>;\n}\ndeclare module 'jsdom/lib/jsdom/living/generated/HTMLTableRowElement.js' {\n  declare module.exports: $Exports<'jsdom/lib/jsdom/living/generated/HTMLTableRowElement'>;\n}\ndeclare module 'jsdom/lib/jsdom/living/generated/HTMLTableSectionElement.js' {\n  declare module.exports: $Exports<'jsdom/lib/jsdom/living/generated/HTMLTableSectionElement'>;\n}\ndeclare module 'jsdom/lib/jsdom/living/generated/HTMLTemplateElement.js' {\n  declare module.exports: $Exports<'jsdom/lib/jsdom/living/generated/HTMLTemplateElement'>;\n}\ndeclare module 'jsdom/lib/jsdom/living/generated/HTMLTextAreaElement.js' {\n  declare module.exports: $Exports<'jsdom/lib/jsdom/living/generated/HTMLTextAreaElement'>;\n}\ndeclare module 'jsdom/lib/jsdom/living/generated/HTMLTimeElement.js' {\n  declare module.exports: $Exports<'jsdom/lib/jsdom/living/generated/HTMLTimeElement'>;\n}\ndeclare module 'jsdom/lib/jsdom/living/generated/HTMLTitleElement.js' {\n  declare module.exports: $Exports<'jsdom/lib/jsdom/living/generated/HTMLTitleElement'>;\n}\ndeclare module 'jsdom/lib/jsdom/living/generated/HTMLTrackElement.js' {\n  declare module.exports: $Exports<'jsdom/lib/jsdom/living/generated/HTMLTrackElement'>;\n}\ndeclare module 'jsdom/lib/jsdom/living/generated/HTMLUListElement.js' {\n  declare module.exports: $Exports<'jsdom/lib/jsdom/living/generated/HTMLUListElement'>;\n}\ndeclare module 'jsdom/lib/jsdom/living/generated/HTMLUnknownElement.js' {\n  declare module.exports: $Exports<'jsdom/lib/jsdom/living/generated/HTMLUnknownElement'>;\n}\ndeclare module 'jsdom/lib/jsdom/living/generated/HTMLVideoElement.js' {\n  declare module.exports: $Exports<'jsdom/lib/jsdom/living/generated/HTMLVideoElement'>;\n}\ndeclare module 'jsdom/lib/jsdom/living/generated/KeyboardEvent.js' {\n  declare module.exports: $Exports<'jsdom/lib/jsdom/living/generated/KeyboardEvent'>;\n}\ndeclare module 'jsdom/lib/jsdom/living/generated/KeyboardEventInit.js' {\n  declare module.exports: $Exports<'jsdom/lib/jsdom/living/generated/KeyboardEventInit'>;\n}\ndeclare module 'jsdom/lib/jsdom/living/generated/LinkStyle.js' {\n  declare module.exports: $Exports<'jsdom/lib/jsdom/living/generated/LinkStyle'>;\n}\ndeclare module 'jsdom/lib/jsdom/living/generated/Location.js' {\n  declare module.exports: $Exports<'jsdom/lib/jsdom/living/generated/Location'>;\n}\ndeclare module 'jsdom/lib/jsdom/living/generated/MessageEvent.js' {\n  declare module.exports: $Exports<'jsdom/lib/jsdom/living/generated/MessageEvent'>;\n}\ndeclare module 'jsdom/lib/jsdom/living/generated/MessageEventInit.js' {\n  declare module.exports: $Exports<'jsdom/lib/jsdom/living/generated/MessageEventInit'>;\n}\ndeclare module 'jsdom/lib/jsdom/living/generated/MouseEvent.js' {\n  declare module.exports: $Exports<'jsdom/lib/jsdom/living/generated/MouseEvent'>;\n}\ndeclare module 'jsdom/lib/jsdom/living/generated/MouseEventInit.js' {\n  declare module.exports: $Exports<'jsdom/lib/jsdom/living/generated/MouseEventInit'>;\n}\ndeclare module 'jsdom/lib/jsdom/living/generated/MutationEvent.js' {\n  declare module.exports: $Exports<'jsdom/lib/jsdom/living/generated/MutationEvent'>;\n}\ndeclare module 'jsdom/lib/jsdom/living/generated/Navigator.js' {\n  declare module.exports: $Exports<'jsdom/lib/jsdom/living/generated/Navigator'>;\n}\ndeclare module 'jsdom/lib/jsdom/living/generated/NavigatorConcurrentHardware.js' {\n  declare module.exports: $Exports<'jsdom/lib/jsdom/living/generated/NavigatorConcurrentHardware'>;\n}\ndeclare module 'jsdom/lib/jsdom/living/generated/NavigatorCookies.js' {\n  declare module.exports: $Exports<'jsdom/lib/jsdom/living/generated/NavigatorCookies'>;\n}\ndeclare module 'jsdom/lib/jsdom/living/generated/NavigatorID.js' {\n  declare module.exports: $Exports<'jsdom/lib/jsdom/living/generated/NavigatorID'>;\n}\ndeclare module 'jsdom/lib/jsdom/living/generated/NavigatorLanguage.js' {\n  declare module.exports: $Exports<'jsdom/lib/jsdom/living/generated/NavigatorLanguage'>;\n}\ndeclare module 'jsdom/lib/jsdom/living/generated/NavigatorOnLine.js' {\n  declare module.exports: $Exports<'jsdom/lib/jsdom/living/generated/NavigatorOnLine'>;\n}\ndeclare module 'jsdom/lib/jsdom/living/generated/NavigatorPlugins.js' {\n  declare module.exports: $Exports<'jsdom/lib/jsdom/living/generated/NavigatorPlugins'>;\n}\ndeclare module 'jsdom/lib/jsdom/living/generated/Node.js' {\n  declare module.exports: $Exports<'jsdom/lib/jsdom/living/generated/Node'>;\n}\ndeclare module 'jsdom/lib/jsdom/living/generated/NonDocumentTypeChildNode.js' {\n  declare module.exports: $Exports<'jsdom/lib/jsdom/living/generated/NonDocumentTypeChildNode'>;\n}\ndeclare module 'jsdom/lib/jsdom/living/generated/NonElementParentNode.js' {\n  declare module.exports: $Exports<'jsdom/lib/jsdom/living/generated/NonElementParentNode'>;\n}\ndeclare module 'jsdom/lib/jsdom/living/generated/ParentNode.js' {\n  declare module.exports: $Exports<'jsdom/lib/jsdom/living/generated/ParentNode'>;\n}\ndeclare module 'jsdom/lib/jsdom/living/generated/PopStateEvent.js' {\n  declare module.exports: $Exports<'jsdom/lib/jsdom/living/generated/PopStateEvent'>;\n}\ndeclare module 'jsdom/lib/jsdom/living/generated/PopStateEventInit.js' {\n  declare module.exports: $Exports<'jsdom/lib/jsdom/living/generated/PopStateEventInit'>;\n}\ndeclare module 'jsdom/lib/jsdom/living/generated/ProcessingInstruction.js' {\n  declare module.exports: $Exports<'jsdom/lib/jsdom/living/generated/ProcessingInstruction'>;\n}\ndeclare module 'jsdom/lib/jsdom/living/generated/ProgressEvent.js' {\n  declare module.exports: $Exports<'jsdom/lib/jsdom/living/generated/ProgressEvent'>;\n}\ndeclare module 'jsdom/lib/jsdom/living/generated/ProgressEventInit.js' {\n  declare module.exports: $Exports<'jsdom/lib/jsdom/living/generated/ProgressEventInit'>;\n}\ndeclare module 'jsdom/lib/jsdom/living/generated/ScrollIntoViewOptions.js' {\n  declare module.exports: $Exports<'jsdom/lib/jsdom/living/generated/ScrollIntoViewOptions'>;\n}\ndeclare module 'jsdom/lib/jsdom/living/generated/ScrollOptions.js' {\n  declare module.exports: $Exports<'jsdom/lib/jsdom/living/generated/ScrollOptions'>;\n}\ndeclare module 'jsdom/lib/jsdom/living/generated/Text.js' {\n  declare module.exports: $Exports<'jsdom/lib/jsdom/living/generated/Text'>;\n}\ndeclare module 'jsdom/lib/jsdom/living/generated/TouchEvent.js' {\n  declare module.exports: $Exports<'jsdom/lib/jsdom/living/generated/TouchEvent'>;\n}\ndeclare module 'jsdom/lib/jsdom/living/generated/TreeWalker.js' {\n  declare module.exports: $Exports<'jsdom/lib/jsdom/living/generated/TreeWalker'>;\n}\ndeclare module 'jsdom/lib/jsdom/living/generated/UIEvent.js' {\n  declare module.exports: $Exports<'jsdom/lib/jsdom/living/generated/UIEvent'>;\n}\ndeclare module 'jsdom/lib/jsdom/living/generated/UIEventInit.js' {\n  declare module.exports: $Exports<'jsdom/lib/jsdom/living/generated/UIEventInit'>;\n}\ndeclare module 'jsdom/lib/jsdom/living/generated/utils.js' {\n  declare module.exports: $Exports<'jsdom/lib/jsdom/living/generated/utils'>;\n}\ndeclare module 'jsdom/lib/jsdom/living/generated/WindowEventHandlers.js' {\n  declare module.exports: $Exports<'jsdom/lib/jsdom/living/generated/WindowEventHandlers'>;\n}\ndeclare module 'jsdom/lib/jsdom/living/generated/XMLDocument.js' {\n  declare module.exports: $Exports<'jsdom/lib/jsdom/living/generated/XMLDocument'>;\n}\ndeclare module 'jsdom/lib/jsdom/living/helpers/document-base-url.js' {\n  declare module.exports: $Exports<'jsdom/lib/jsdom/living/helpers/document-base-url'>;\n}\ndeclare module 'jsdom/lib/jsdom/living/helpers/focusing.js' {\n  declare module.exports: $Exports<'jsdom/lib/jsdom/living/helpers/focusing'>;\n}\ndeclare module 'jsdom/lib/jsdom/living/helpers/form-controls.js' {\n  declare module.exports: $Exports<'jsdom/lib/jsdom/living/helpers/form-controls'>;\n}\ndeclare module 'jsdom/lib/jsdom/living/helpers/internal-constants.js' {\n  declare module.exports: $Exports<'jsdom/lib/jsdom/living/helpers/internal-constants'>;\n}\ndeclare module 'jsdom/lib/jsdom/living/helpers/ordered-set-parser.js' {\n  declare module.exports: $Exports<'jsdom/lib/jsdom/living/helpers/ordered-set-parser'>;\n}\ndeclare module 'jsdom/lib/jsdom/living/helpers/proxied-window-event-handlers.js' {\n  declare module.exports: $Exports<'jsdom/lib/jsdom/living/helpers/proxied-window-event-handlers'>;\n}\ndeclare module 'jsdom/lib/jsdom/living/helpers/runtime-script-errors.js' {\n  declare module.exports: $Exports<'jsdom/lib/jsdom/living/helpers/runtime-script-errors'>;\n}\ndeclare module 'jsdom/lib/jsdom/living/helpers/selectors.js' {\n  declare module.exports: $Exports<'jsdom/lib/jsdom/living/helpers/selectors'>;\n}\ndeclare module 'jsdom/lib/jsdom/living/helpers/strings.js' {\n  declare module.exports: $Exports<'jsdom/lib/jsdom/living/helpers/strings'>;\n}\ndeclare module 'jsdom/lib/jsdom/living/helpers/stylesheets.js' {\n  declare module.exports: $Exports<'jsdom/lib/jsdom/living/helpers/stylesheets'>;\n}\ndeclare module 'jsdom/lib/jsdom/living/helpers/traversal.js' {\n  declare module.exports: $Exports<'jsdom/lib/jsdom/living/helpers/traversal'>;\n}\ndeclare module 'jsdom/lib/jsdom/living/helpers/validate-names.js' {\n  declare module.exports: $Exports<'jsdom/lib/jsdom/living/helpers/validate-names'>;\n}\ndeclare module 'jsdom/lib/jsdom/living/html-collection.js' {\n  declare module.exports: $Exports<'jsdom/lib/jsdom/living/html-collection'>;\n}\ndeclare module 'jsdom/lib/jsdom/living/index.js' {\n  declare module.exports: $Exports<'jsdom/lib/jsdom/living/index'>;\n}\ndeclare module 'jsdom/lib/jsdom/living/named-properties-window.js' {\n  declare module.exports: $Exports<'jsdom/lib/jsdom/living/named-properties-window'>;\n}\ndeclare module 'jsdom/lib/jsdom/living/navigator/Navigator-impl.js' {\n  declare module.exports: $Exports<'jsdom/lib/jsdom/living/navigator/Navigator-impl'>;\n}\ndeclare module 'jsdom/lib/jsdom/living/navigator/NavigatorConcurrentHardware-impl.js' {\n  declare module.exports: $Exports<'jsdom/lib/jsdom/living/navigator/NavigatorConcurrentHardware-impl'>;\n}\ndeclare module 'jsdom/lib/jsdom/living/navigator/NavigatorCookies-impl.js' {\n  declare module.exports: $Exports<'jsdom/lib/jsdom/living/navigator/NavigatorCookies-impl'>;\n}\ndeclare module 'jsdom/lib/jsdom/living/navigator/NavigatorID-impl.js' {\n  declare module.exports: $Exports<'jsdom/lib/jsdom/living/navigator/NavigatorID-impl'>;\n}\ndeclare module 'jsdom/lib/jsdom/living/navigator/NavigatorLanguage-impl.js' {\n  declare module.exports: $Exports<'jsdom/lib/jsdom/living/navigator/NavigatorLanguage-impl'>;\n}\ndeclare module 'jsdom/lib/jsdom/living/navigator/NavigatorOnLine-impl.js' {\n  declare module.exports: $Exports<'jsdom/lib/jsdom/living/navigator/NavigatorOnLine-impl'>;\n}\ndeclare module 'jsdom/lib/jsdom/living/navigator/NavigatorPlugins-impl.js' {\n  declare module.exports: $Exports<'jsdom/lib/jsdom/living/navigator/NavigatorPlugins-impl'>;\n}\ndeclare module 'jsdom/lib/jsdom/living/node-document-position.js' {\n  declare module.exports: $Exports<'jsdom/lib/jsdom/living/node-document-position'>;\n}\ndeclare module 'jsdom/lib/jsdom/living/node-filter.js' {\n  declare module.exports: $Exports<'jsdom/lib/jsdom/living/node-filter'>;\n}\ndeclare module 'jsdom/lib/jsdom/living/node-iterator.js' {\n  declare module.exports: $Exports<'jsdom/lib/jsdom/living/node-iterator'>;\n}\ndeclare module 'jsdom/lib/jsdom/living/node-list.js' {\n  declare module.exports: $Exports<'jsdom/lib/jsdom/living/node-list'>;\n}\ndeclare module 'jsdom/lib/jsdom/living/node-type.js' {\n  declare module.exports: $Exports<'jsdom/lib/jsdom/living/node-type'>;\n}\ndeclare module 'jsdom/lib/jsdom/living/node.js' {\n  declare module.exports: $Exports<'jsdom/lib/jsdom/living/node'>;\n}\ndeclare module 'jsdom/lib/jsdom/living/nodes/CDATASection-impl.js' {\n  declare module.exports: $Exports<'jsdom/lib/jsdom/living/nodes/CDATASection-impl'>;\n}\ndeclare module 'jsdom/lib/jsdom/living/nodes/CharacterData-impl.js' {\n  declare module.exports: $Exports<'jsdom/lib/jsdom/living/nodes/CharacterData-impl'>;\n}\ndeclare module 'jsdom/lib/jsdom/living/nodes/ChildNode-impl.js' {\n  declare module.exports: $Exports<'jsdom/lib/jsdom/living/nodes/ChildNode-impl'>;\n}\ndeclare module 'jsdom/lib/jsdom/living/nodes/Comment-impl.js' {\n  declare module.exports: $Exports<'jsdom/lib/jsdom/living/nodes/Comment-impl'>;\n}\ndeclare module 'jsdom/lib/jsdom/living/nodes/Document-impl.js' {\n  declare module.exports: $Exports<'jsdom/lib/jsdom/living/nodes/Document-impl'>;\n}\ndeclare module 'jsdom/lib/jsdom/living/nodes/DocumentFragment-impl.js' {\n  declare module.exports: $Exports<'jsdom/lib/jsdom/living/nodes/DocumentFragment-impl'>;\n}\ndeclare module 'jsdom/lib/jsdom/living/nodes/DocumentType-impl.js' {\n  declare module.exports: $Exports<'jsdom/lib/jsdom/living/nodes/DocumentType-impl'>;\n}\ndeclare module 'jsdom/lib/jsdom/living/nodes/DOMImplementation-impl.js' {\n  declare module.exports: $Exports<'jsdom/lib/jsdom/living/nodes/DOMImplementation-impl'>;\n}\ndeclare module 'jsdom/lib/jsdom/living/nodes/Element-impl.js' {\n  declare module.exports: $Exports<'jsdom/lib/jsdom/living/nodes/Element-impl'>;\n}\ndeclare module 'jsdom/lib/jsdom/living/nodes/ElementContentEditable-impl.js' {\n  declare module.exports: $Exports<'jsdom/lib/jsdom/living/nodes/ElementContentEditable-impl'>;\n}\ndeclare module 'jsdom/lib/jsdom/living/nodes/ElementCSSInlineStyle-impl.js' {\n  declare module.exports: $Exports<'jsdom/lib/jsdom/living/nodes/ElementCSSInlineStyle-impl'>;\n}\ndeclare module 'jsdom/lib/jsdom/living/nodes/GlobalEventHandlers-impl.js' {\n  declare module.exports: $Exports<'jsdom/lib/jsdom/living/nodes/GlobalEventHandlers-impl'>;\n}\ndeclare module 'jsdom/lib/jsdom/living/nodes/HTMLAnchorElement-impl.js' {\n  declare module.exports: $Exports<'jsdom/lib/jsdom/living/nodes/HTMLAnchorElement-impl'>;\n}\ndeclare module 'jsdom/lib/jsdom/living/nodes/HTMLAppletElement-impl.js' {\n  declare module.exports: $Exports<'jsdom/lib/jsdom/living/nodes/HTMLAppletElement-impl'>;\n}\ndeclare module 'jsdom/lib/jsdom/living/nodes/HTMLAreaElement-impl.js' {\n  declare module.exports: $Exports<'jsdom/lib/jsdom/living/nodes/HTMLAreaElement-impl'>;\n}\ndeclare module 'jsdom/lib/jsdom/living/nodes/HTMLAudioElement-impl.js' {\n  declare module.exports: $Exports<'jsdom/lib/jsdom/living/nodes/HTMLAudioElement-impl'>;\n}\ndeclare module 'jsdom/lib/jsdom/living/nodes/HTMLBaseElement-impl.js' {\n  declare module.exports: $Exports<'jsdom/lib/jsdom/living/nodes/HTMLBaseElement-impl'>;\n}\ndeclare module 'jsdom/lib/jsdom/living/nodes/HTMLBodyElement-impl.js' {\n  declare module.exports: $Exports<'jsdom/lib/jsdom/living/nodes/HTMLBodyElement-impl'>;\n}\ndeclare module 'jsdom/lib/jsdom/living/nodes/HTMLBRElement-impl.js' {\n  declare module.exports: $Exports<'jsdom/lib/jsdom/living/nodes/HTMLBRElement-impl'>;\n}\ndeclare module 'jsdom/lib/jsdom/living/nodes/HTMLButtonElement-impl.js' {\n  declare module.exports: $Exports<'jsdom/lib/jsdom/living/nodes/HTMLButtonElement-impl'>;\n}\ndeclare module 'jsdom/lib/jsdom/living/nodes/HTMLCanvasElement-impl.js' {\n  declare module.exports: $Exports<'jsdom/lib/jsdom/living/nodes/HTMLCanvasElement-impl'>;\n}\ndeclare module 'jsdom/lib/jsdom/living/nodes/HTMLDataElement-impl.js' {\n  declare module.exports: $Exports<'jsdom/lib/jsdom/living/nodes/HTMLDataElement-impl'>;\n}\ndeclare module 'jsdom/lib/jsdom/living/nodes/HTMLDataListElement-impl.js' {\n  declare module.exports: $Exports<'jsdom/lib/jsdom/living/nodes/HTMLDataListElement-impl'>;\n}\ndeclare module 'jsdom/lib/jsdom/living/nodes/HTMLDialogElement-impl.js' {\n  declare module.exports: $Exports<'jsdom/lib/jsdom/living/nodes/HTMLDialogElement-impl'>;\n}\ndeclare module 'jsdom/lib/jsdom/living/nodes/HTMLDirectoryElement-impl.js' {\n  declare module.exports: $Exports<'jsdom/lib/jsdom/living/nodes/HTMLDirectoryElement-impl'>;\n}\ndeclare module 'jsdom/lib/jsdom/living/nodes/HTMLDivElement-impl.js' {\n  declare module.exports: $Exports<'jsdom/lib/jsdom/living/nodes/HTMLDivElement-impl'>;\n}\ndeclare module 'jsdom/lib/jsdom/living/nodes/HTMLDListElement-impl.js' {\n  declare module.exports: $Exports<'jsdom/lib/jsdom/living/nodes/HTMLDListElement-impl'>;\n}\ndeclare module 'jsdom/lib/jsdom/living/nodes/HTMLElement-impl.js' {\n  declare module.exports: $Exports<'jsdom/lib/jsdom/living/nodes/HTMLElement-impl'>;\n}\ndeclare module 'jsdom/lib/jsdom/living/nodes/HTMLEmbedElement-impl.js' {\n  declare module.exports: $Exports<'jsdom/lib/jsdom/living/nodes/HTMLEmbedElement-impl'>;\n}\ndeclare module 'jsdom/lib/jsdom/living/nodes/HTMLFieldSetElement-impl.js' {\n  declare module.exports: $Exports<'jsdom/lib/jsdom/living/nodes/HTMLFieldSetElement-impl'>;\n}\ndeclare module 'jsdom/lib/jsdom/living/nodes/HTMLFontElement-impl.js' {\n  declare module.exports: $Exports<'jsdom/lib/jsdom/living/nodes/HTMLFontElement-impl'>;\n}\ndeclare module 'jsdom/lib/jsdom/living/nodes/HTMLFormElement-impl.js' {\n  declare module.exports: $Exports<'jsdom/lib/jsdom/living/nodes/HTMLFormElement-impl'>;\n}\ndeclare module 'jsdom/lib/jsdom/living/nodes/HTMLFrameElement-impl.js' {\n  declare module.exports: $Exports<'jsdom/lib/jsdom/living/nodes/HTMLFrameElement-impl'>;\n}\ndeclare module 'jsdom/lib/jsdom/living/nodes/HTMLFrameSetElement-impl.js' {\n  declare module.exports: $Exports<'jsdom/lib/jsdom/living/nodes/HTMLFrameSetElement-impl'>;\n}\ndeclare module 'jsdom/lib/jsdom/living/nodes/HTMLHeadElement-impl.js' {\n  declare module.exports: $Exports<'jsdom/lib/jsdom/living/nodes/HTMLHeadElement-impl'>;\n}\ndeclare module 'jsdom/lib/jsdom/living/nodes/HTMLHeadingElement-impl.js' {\n  declare module.exports: $Exports<'jsdom/lib/jsdom/living/nodes/HTMLHeadingElement-impl'>;\n}\ndeclare module 'jsdom/lib/jsdom/living/nodes/HTMLHRElement-impl.js' {\n  declare module.exports: $Exports<'jsdom/lib/jsdom/living/nodes/HTMLHRElement-impl'>;\n}\ndeclare module 'jsdom/lib/jsdom/living/nodes/HTMLHtmlElement-impl.js' {\n  declare module.exports: $Exports<'jsdom/lib/jsdom/living/nodes/HTMLHtmlElement-impl'>;\n}\ndeclare module 'jsdom/lib/jsdom/living/nodes/HTMLHyperlinkElementUtils-impl.js' {\n  declare module.exports: $Exports<'jsdom/lib/jsdom/living/nodes/HTMLHyperlinkElementUtils-impl'>;\n}\ndeclare module 'jsdom/lib/jsdom/living/nodes/HTMLIFrameElement-impl.js' {\n  declare module.exports: $Exports<'jsdom/lib/jsdom/living/nodes/HTMLIFrameElement-impl'>;\n}\ndeclare module 'jsdom/lib/jsdom/living/nodes/HTMLImageElement-impl.js' {\n  declare module.exports: $Exports<'jsdom/lib/jsdom/living/nodes/HTMLImageElement-impl'>;\n}\ndeclare module 'jsdom/lib/jsdom/living/nodes/HTMLInputElement-impl.js' {\n  declare module.exports: $Exports<'jsdom/lib/jsdom/living/nodes/HTMLInputElement-impl'>;\n}\ndeclare module 'jsdom/lib/jsdom/living/nodes/HTMLLabelElement-impl.js' {\n  declare module.exports: $Exports<'jsdom/lib/jsdom/living/nodes/HTMLLabelElement-impl'>;\n}\ndeclare module 'jsdom/lib/jsdom/living/nodes/HTMLLegendElement-impl.js' {\n  declare module.exports: $Exports<'jsdom/lib/jsdom/living/nodes/HTMLLegendElement-impl'>;\n}\ndeclare module 'jsdom/lib/jsdom/living/nodes/HTMLLIElement-impl.js' {\n  declare module.exports: $Exports<'jsdom/lib/jsdom/living/nodes/HTMLLIElement-impl'>;\n}\ndeclare module 'jsdom/lib/jsdom/living/nodes/HTMLLinkElement-impl.js' {\n  declare module.exports: $Exports<'jsdom/lib/jsdom/living/nodes/HTMLLinkElement-impl'>;\n}\ndeclare module 'jsdom/lib/jsdom/living/nodes/HTMLMapElement-impl.js' {\n  declare module.exports: $Exports<'jsdom/lib/jsdom/living/nodes/HTMLMapElement-impl'>;\n}\ndeclare module 'jsdom/lib/jsdom/living/nodes/HTMLMediaElement-impl.js' {\n  declare module.exports: $Exports<'jsdom/lib/jsdom/living/nodes/HTMLMediaElement-impl'>;\n}\ndeclare module 'jsdom/lib/jsdom/living/nodes/HTMLMenuElement-impl.js' {\n  declare module.exports: $Exports<'jsdom/lib/jsdom/living/nodes/HTMLMenuElement-impl'>;\n}\ndeclare module 'jsdom/lib/jsdom/living/nodes/HTMLMetaElement-impl.js' {\n  declare module.exports: $Exports<'jsdom/lib/jsdom/living/nodes/HTMLMetaElement-impl'>;\n}\ndeclare module 'jsdom/lib/jsdom/living/nodes/HTMLMeterElement-impl.js' {\n  declare module.exports: $Exports<'jsdom/lib/jsdom/living/nodes/HTMLMeterElement-impl'>;\n}\ndeclare module 'jsdom/lib/jsdom/living/nodes/HTMLModElement-impl.js' {\n  declare module.exports: $Exports<'jsdom/lib/jsdom/living/nodes/HTMLModElement-impl'>;\n}\ndeclare module 'jsdom/lib/jsdom/living/nodes/HTMLObjectElement-impl.js' {\n  declare module.exports: $Exports<'jsdom/lib/jsdom/living/nodes/HTMLObjectElement-impl'>;\n}\ndeclare module 'jsdom/lib/jsdom/living/nodes/HTMLOListElement-impl.js' {\n  declare module.exports: $Exports<'jsdom/lib/jsdom/living/nodes/HTMLOListElement-impl'>;\n}\ndeclare module 'jsdom/lib/jsdom/living/nodes/HTMLOptGroupElement-impl.js' {\n  declare module.exports: $Exports<'jsdom/lib/jsdom/living/nodes/HTMLOptGroupElement-impl'>;\n}\ndeclare module 'jsdom/lib/jsdom/living/nodes/HTMLOptionElement-impl.js' {\n  declare module.exports: $Exports<'jsdom/lib/jsdom/living/nodes/HTMLOptionElement-impl'>;\n}\ndeclare module 'jsdom/lib/jsdom/living/nodes/HTMLOutputElement-impl.js' {\n  declare module.exports: $Exports<'jsdom/lib/jsdom/living/nodes/HTMLOutputElement-impl'>;\n}\ndeclare module 'jsdom/lib/jsdom/living/nodes/HTMLParagraphElement-impl.js' {\n  declare module.exports: $Exports<'jsdom/lib/jsdom/living/nodes/HTMLParagraphElement-impl'>;\n}\ndeclare module 'jsdom/lib/jsdom/living/nodes/HTMLParamElement-impl.js' {\n  declare module.exports: $Exports<'jsdom/lib/jsdom/living/nodes/HTMLParamElement-impl'>;\n}\ndeclare module 'jsdom/lib/jsdom/living/nodes/HTMLPreElement-impl.js' {\n  declare module.exports: $Exports<'jsdom/lib/jsdom/living/nodes/HTMLPreElement-impl'>;\n}\ndeclare module 'jsdom/lib/jsdom/living/nodes/HTMLProgressElement-impl.js' {\n  declare module.exports: $Exports<'jsdom/lib/jsdom/living/nodes/HTMLProgressElement-impl'>;\n}\ndeclare module 'jsdom/lib/jsdom/living/nodes/HTMLQuoteElement-impl.js' {\n  declare module.exports: $Exports<'jsdom/lib/jsdom/living/nodes/HTMLQuoteElement-impl'>;\n}\ndeclare module 'jsdom/lib/jsdom/living/nodes/HTMLScriptElement-impl.js' {\n  declare module.exports: $Exports<'jsdom/lib/jsdom/living/nodes/HTMLScriptElement-impl'>;\n}\ndeclare module 'jsdom/lib/jsdom/living/nodes/HTMLSelectElement-impl.js' {\n  declare module.exports: $Exports<'jsdom/lib/jsdom/living/nodes/HTMLSelectElement-impl'>;\n}\ndeclare module 'jsdom/lib/jsdom/living/nodes/HTMLSourceElement-impl.js' {\n  declare module.exports: $Exports<'jsdom/lib/jsdom/living/nodes/HTMLSourceElement-impl'>;\n}\ndeclare module 'jsdom/lib/jsdom/living/nodes/HTMLSpanElement-impl.js' {\n  declare module.exports: $Exports<'jsdom/lib/jsdom/living/nodes/HTMLSpanElement-impl'>;\n}\ndeclare module 'jsdom/lib/jsdom/living/nodes/HTMLStyleElement-impl.js' {\n  declare module.exports: $Exports<'jsdom/lib/jsdom/living/nodes/HTMLStyleElement-impl'>;\n}\ndeclare module 'jsdom/lib/jsdom/living/nodes/HTMLTableCaptionElement-impl.js' {\n  declare module.exports: $Exports<'jsdom/lib/jsdom/living/nodes/HTMLTableCaptionElement-impl'>;\n}\ndeclare module 'jsdom/lib/jsdom/living/nodes/HTMLTableCellElement-impl.js' {\n  declare module.exports: $Exports<'jsdom/lib/jsdom/living/nodes/HTMLTableCellElement-impl'>;\n}\ndeclare module 'jsdom/lib/jsdom/living/nodes/HTMLTableColElement-impl.js' {\n  declare module.exports: $Exports<'jsdom/lib/jsdom/living/nodes/HTMLTableColElement-impl'>;\n}\ndeclare module 'jsdom/lib/jsdom/living/nodes/HTMLTableDataCellElement-impl.js' {\n  declare module.exports: $Exports<'jsdom/lib/jsdom/living/nodes/HTMLTableDataCellElement-impl'>;\n}\ndeclare module 'jsdom/lib/jsdom/living/nodes/HTMLTableElement-impl.js' {\n  declare module.exports: $Exports<'jsdom/lib/jsdom/living/nodes/HTMLTableElement-impl'>;\n}\ndeclare module 'jsdom/lib/jsdom/living/nodes/HTMLTableHeaderCellElement-impl.js' {\n  declare module.exports: $Exports<'jsdom/lib/jsdom/living/nodes/HTMLTableHeaderCellElement-impl'>;\n}\ndeclare module 'jsdom/lib/jsdom/living/nodes/HTMLTableRowElement-impl.js' {\n  declare module.exports: $Exports<'jsdom/lib/jsdom/living/nodes/HTMLTableRowElement-impl'>;\n}\ndeclare module 'jsdom/lib/jsdom/living/nodes/HTMLTableSectionElement-impl.js' {\n  declare module.exports: $Exports<'jsdom/lib/jsdom/living/nodes/HTMLTableSectionElement-impl'>;\n}\ndeclare module 'jsdom/lib/jsdom/living/nodes/HTMLTemplateElement-impl.js' {\n  declare module.exports: $Exports<'jsdom/lib/jsdom/living/nodes/HTMLTemplateElement-impl'>;\n}\ndeclare module 'jsdom/lib/jsdom/living/nodes/HTMLTextAreaElement-impl.js' {\n  declare module.exports: $Exports<'jsdom/lib/jsdom/living/nodes/HTMLTextAreaElement-impl'>;\n}\ndeclare module 'jsdom/lib/jsdom/living/nodes/HTMLTimeElement-impl.js' {\n  declare module.exports: $Exports<'jsdom/lib/jsdom/living/nodes/HTMLTimeElement-impl'>;\n}\ndeclare module 'jsdom/lib/jsdom/living/nodes/HTMLTitleElement-impl.js' {\n  declare module.exports: $Exports<'jsdom/lib/jsdom/living/nodes/HTMLTitleElement-impl'>;\n}\ndeclare module 'jsdom/lib/jsdom/living/nodes/HTMLTrackElement-impl.js' {\n  declare module.exports: $Exports<'jsdom/lib/jsdom/living/nodes/HTMLTrackElement-impl'>;\n}\ndeclare module 'jsdom/lib/jsdom/living/nodes/HTMLUListElement-impl.js' {\n  declare module.exports: $Exports<'jsdom/lib/jsdom/living/nodes/HTMLUListElement-impl'>;\n}\ndeclare module 'jsdom/lib/jsdom/living/nodes/HTMLUnknownElement-impl.js' {\n  declare module.exports: $Exports<'jsdom/lib/jsdom/living/nodes/HTMLUnknownElement-impl'>;\n}\ndeclare module 'jsdom/lib/jsdom/living/nodes/HTMLVideoElement-impl.js' {\n  declare module.exports: $Exports<'jsdom/lib/jsdom/living/nodes/HTMLVideoElement-impl'>;\n}\ndeclare module 'jsdom/lib/jsdom/living/nodes/LinkStyle-impl.js' {\n  declare module.exports: $Exports<'jsdom/lib/jsdom/living/nodes/LinkStyle-impl'>;\n}\ndeclare module 'jsdom/lib/jsdom/living/nodes/Node-impl.js' {\n  declare module.exports: $Exports<'jsdom/lib/jsdom/living/nodes/Node-impl'>;\n}\ndeclare module 'jsdom/lib/jsdom/living/nodes/NonDocumentTypeChildNode-impl.js' {\n  declare module.exports: $Exports<'jsdom/lib/jsdom/living/nodes/NonDocumentTypeChildNode-impl'>;\n}\ndeclare module 'jsdom/lib/jsdom/living/nodes/NonElementParentNode-impl.js' {\n  declare module.exports: $Exports<'jsdom/lib/jsdom/living/nodes/NonElementParentNode-impl'>;\n}\ndeclare module 'jsdom/lib/jsdom/living/nodes/ParentNode-impl.js' {\n  declare module.exports: $Exports<'jsdom/lib/jsdom/living/nodes/ParentNode-impl'>;\n}\ndeclare module 'jsdom/lib/jsdom/living/nodes/ProcessingInstruction-impl.js' {\n  declare module.exports: $Exports<'jsdom/lib/jsdom/living/nodes/ProcessingInstruction-impl'>;\n}\ndeclare module 'jsdom/lib/jsdom/living/nodes/Text-impl.js' {\n  declare module.exports: $Exports<'jsdom/lib/jsdom/living/nodes/Text-impl'>;\n}\ndeclare module 'jsdom/lib/jsdom/living/nodes/WindowEventHandlers-impl.js' {\n  declare module.exports: $Exports<'jsdom/lib/jsdom/living/nodes/WindowEventHandlers-impl'>;\n}\ndeclare module 'jsdom/lib/jsdom/living/nodes/XMLDocument-impl.js' {\n  declare module.exports: $Exports<'jsdom/lib/jsdom/living/nodes/XMLDocument-impl'>;\n}\ndeclare module 'jsdom/lib/jsdom/living/post-message.js' {\n  declare module.exports: $Exports<'jsdom/lib/jsdom/living/post-message'>;\n}\ndeclare module 'jsdom/lib/jsdom/living/register-elements.js' {\n  declare module.exports: $Exports<'jsdom/lib/jsdom/living/register-elements'>;\n}\ndeclare module 'jsdom/lib/jsdom/living/traversal/TreeWalker-impl.js' {\n  declare module.exports: $Exports<'jsdom/lib/jsdom/living/traversal/TreeWalker-impl'>;\n}\ndeclare module 'jsdom/lib/jsdom/living/window/History-impl.js' {\n  declare module.exports: $Exports<'jsdom/lib/jsdom/living/window/History-impl'>;\n}\ndeclare module 'jsdom/lib/jsdom/living/window/Location-impl.js' {\n  declare module.exports: $Exports<'jsdom/lib/jsdom/living/window/Location-impl'>;\n}\ndeclare module 'jsdom/lib/jsdom/living/window/navigation.js' {\n  declare module.exports: $Exports<'jsdom/lib/jsdom/living/window/navigation'>;\n}\ndeclare module 'jsdom/lib/jsdom/living/xhr-sync-worker.js' {\n  declare module.exports: $Exports<'jsdom/lib/jsdom/living/xhr-sync-worker'>;\n}\ndeclare module 'jsdom/lib/jsdom/living/xhr-utils.js' {\n  declare module.exports: $Exports<'jsdom/lib/jsdom/living/xhr-utils'>;\n}\ndeclare module 'jsdom/lib/jsdom/living/xhr/FormData-impl.js' {\n  declare module.exports: $Exports<'jsdom/lib/jsdom/living/xhr/FormData-impl'>;\n}\ndeclare module 'jsdom/lib/jsdom/living/xmlhttprequest-event-target.js' {\n  declare module.exports: $Exports<'jsdom/lib/jsdom/living/xmlhttprequest-event-target'>;\n}\ndeclare module 'jsdom/lib/jsdom/living/xmlhttprequest-symbols.js' {\n  declare module.exports: $Exports<'jsdom/lib/jsdom/living/xmlhttprequest-symbols'>;\n}\ndeclare module 'jsdom/lib/jsdom/living/xmlhttprequest-upload.js' {\n  declare module.exports: $Exports<'jsdom/lib/jsdom/living/xmlhttprequest-upload'>;\n}\ndeclare module 'jsdom/lib/jsdom/living/xmlhttprequest.js' {\n  declare module.exports: $Exports<'jsdom/lib/jsdom/living/xmlhttprequest'>;\n}\ndeclare module 'jsdom/lib/jsdom/named-properties-tracker.js' {\n  declare module.exports: $Exports<'jsdom/lib/jsdom/named-properties-tracker'>;\n}\ndeclare module 'jsdom/lib/jsdom/utils.js' {\n  declare module.exports: $Exports<'jsdom/lib/jsdom/utils'>;\n}\ndeclare module 'jsdom/lib/jsdom/virtual-console.js' {\n  declare module.exports: $Exports<'jsdom/lib/jsdom/virtual-console'>;\n}\ndeclare module 'jsdom/lib/jsdom/vm-shim.js' {\n  declare module.exports: $Exports<'jsdom/lib/jsdom/vm-shim'>;\n}\ndeclare module 'jsdom/lib/jsdom/web-idl/DOMException.js' {\n  declare module.exports: $Exports<'jsdom/lib/jsdom/web-idl/DOMException'>;\n}\n"
  },
  {
    "path": "flow-typed/npm/madge_vx.x.x.js",
    "content": "// flow-typed signature: 691184973888acc24da609e46f85c0c9\n// flow-typed version: <<STUB>>/madge_v^1.6.0/flow_v0.76.0\n\n/**\n * This is an autogenerated libdef stub for:\n *\n *   'madge'\n *\n * Fill this stub out by replacing all the `any` types.\n *\n * Once filled out, we encourage you to share your work with the\n * community by sending a pull request to:\n * https://github.com/flowtype/flow-typed\n */\n\ndeclare module 'madge' {\n  declare module.exports: any;\n}\n\n/**\n * We include stubs for each file inside this npm package in case you need to\n * require those files directly. Feel free to delete any files that aren't\n * needed.\n */\ndeclare module 'madge/bin/cli' {\n  declare module.exports: any;\n}\n\ndeclare module 'madge/lib/api' {\n  declare module.exports: any;\n}\n\ndeclare module 'madge/lib/cyclic' {\n  declare module.exports: any;\n}\n\ndeclare module 'madge/lib/graph' {\n  declare module.exports: any;\n}\n\ndeclare module 'madge/lib/log' {\n  declare module.exports: any;\n}\n\ndeclare module 'madge/lib/output' {\n  declare module.exports: any;\n}\n\ndeclare module 'madge/lib/tree' {\n  declare module.exports: any;\n}\n\n// Filename aliases\ndeclare module 'madge/bin/cli.js' {\n  declare module.exports: $Exports<'madge/bin/cli'>;\n}\ndeclare module 'madge/lib/api.js' {\n  declare module.exports: $Exports<'madge/lib/api'>;\n}\ndeclare module 'madge/lib/cyclic.js' {\n  declare module.exports: $Exports<'madge/lib/cyclic'>;\n}\ndeclare module 'madge/lib/graph.js' {\n  declare module.exports: $Exports<'madge/lib/graph'>;\n}\ndeclare module 'madge/lib/log.js' {\n  declare module.exports: $Exports<'madge/lib/log'>;\n}\ndeclare module 'madge/lib/output.js' {\n  declare module.exports: $Exports<'madge/lib/output'>;\n}\ndeclare module 'madge/lib/tree.js' {\n  declare module.exports: $Exports<'madge/lib/tree'>;\n}\n"
  },
  {
    "path": "flow-typed/npm/minimist_v1.x.x.js",
    "content": "// flow-typed signature: 50bc453586282fb18e63201750049659\n// flow-typed version: e6f7626e10/minimist_v1.x.x/flow_>=v0.28.x\n\ndeclare module 'minimist' {\n  declare type minimistOptions = {\n    string?: string | Array<string>,\n    boolean?: boolean | string | Array<string>,\n    alias?: { [arg: string]: string | Array<string> },\n    default?: { [arg: string]: any },\n    stopEarly?: boolean,\n    // TODO: Strings as keys don't work...\n    // '--'? boolean,\n    unknown?: (param: string) => boolean\n  };\n\n  declare type minimistOutput = {\n    _: Array<string>,\n    [flag: string]: string | boolean\n  };\n\n  declare module.exports: (argv: Array<string>, opts?: minimistOptions) => minimistOutput;\n}\n"
  },
  {
    "path": "flow-typed/npm/node-zip_vx.x.x.js",
    "content": "// flow-typed signature: c7a3b2fc0f3ed597543216830a7c5c47\n// flow-typed version: <<STUB>>/node-zip_v^1.1.1/flow_v0.76.0\n\n/**\n * This is an autogenerated libdef stub for:\n *\n *   'node-zip'\n *\n * Fill this stub out by replacing all the `any` types.\n *\n * Once filled out, we encourage you to share your work with the\n * community by sending a pull request to:\n * https://github.com/flowtype/flow-typed\n */\n\ndeclare module 'node-zip' {\n  declare module.exports: any;\n}\n\n/**\n * We include stubs for each file inside this npm package in case you need to\n * require those files directly. Feel free to delete any files that aren't\n * needed.\n */\ndeclare module 'node-zip/lib/nodezip-cli' {\n  declare module.exports: any;\n}\n\ndeclare module 'node-zip/lib/nodezip' {\n  declare module.exports: any;\n}\n\ndeclare module 'node-zip/test/nodezip_spec' {\n  declare module.exports: any;\n}\n\n// Filename aliases\ndeclare module 'node-zip/lib/nodezip-cli.js' {\n  declare module.exports: $Exports<'node-zip/lib/nodezip-cli'>;\n}\ndeclare module 'node-zip/lib/nodezip.js' {\n  declare module.exports: $Exports<'node-zip/lib/nodezip'>;\n}\ndeclare module 'node-zip/test/nodezip_spec.js' {\n  declare module.exports: $Exports<'node-zip/test/nodezip_spec'>;\n}\n"
  },
  {
    "path": "flow-typed/npm/prettier_v1.x.x.js",
    "content": "// flow-typed signature: 4eed8da2dc730dc33e7710b465eaa44b\n// flow-typed version: cc7a557b34/prettier_v1.x.x/flow_>=v0.56.x\n\ndeclare module \"prettier\" {\n  declare type AST = Object;\n  declare type Doc = Object;\n  declare type FastPath = Object;\n\n  declare type PrettierParserName =\n    | \"babylon\"\n    | \"flow\"\n    | \"typescript\"\n    | \"postcss\"\n    | \"css\"\n    | \"less\"\n    | \"scss\"\n    | \"json\"\n    | \"graphql\"\n    | \"markdown\"\n    | \"vue\";\n\n  declare type PrettierParser = {\n    [name: PrettierParserName]: (text: string, options?: Object) => AST\n  };\n\n  declare type CustomParser = (\n    text: string,\n    parsers: PrettierParser,\n    options: Options\n  ) => AST;\n\n  declare type Options = {|\n    printWidth?: number,\n    tabWidth?: number,\n    useTabs?: boolean,\n    semi?: boolean,\n    singleQuote?: boolean,\n    trailingComma?: \"none\" | \"es5\" | \"all\",\n    bracketSpacing?: boolean,\n    jsxBracketSameLine?: boolean,\n    arrowParens?: \"avoid\" | \"always\",\n    rangeStart?: number,\n    rangeEnd?: number,\n    parser?: PrettierParserName | CustomParser,\n    filepath?: string,\n    requirePragma?: boolean,\n    insertPragma?: boolean,\n    proseWrap?: \"always\" | \"never\" | \"preserve\",\n    plugins?: Array<string | Plugin>\n  |};\n\n  declare type Plugin = {\n    languages: SupportLanguage,\n    parsers: { [parserName: string]: Parser },\n    printers: { [astFormat: string]: Printer }\n  };\n\n  declare type Parser = {\n    parse: (\n      text: string,\n      parsers: { [parserName: string]: Parser },\n      options: Object\n    ) => AST,\n    astFormat: string\n  };\n\n  declare type Printer = {\n    print: (\n      path: FastPath,\n      options: Object,\n      print: (path: FastPath) => Doc\n    ) => Doc,\n    embed: (\n      path: FastPath,\n      print: (path: FastPath) => Doc,\n      textToDoc: (text: string, options: Object) => Doc,\n      options: Object\n    ) => ?Doc\n  };\n\n  declare type CursorOptions = {|\n    cursorOffset: number,\n    printWidth?: $PropertyType<Options, \"printWidth\">,\n    tabWidth?: $PropertyType<Options, \"tabWidth\">,\n    useTabs?: $PropertyType<Options, \"useTabs\">,\n    semi?: $PropertyType<Options, \"semi\">,\n    singleQuote?: $PropertyType<Options, \"singleQuote\">,\n    trailingComma?: $PropertyType<Options, \"trailingComma\">,\n    bracketSpacing?: $PropertyType<Options, \"bracketSpacing\">,\n    jsxBracketSameLine?: $PropertyType<Options, \"jsxBracketSameLine\">,\n    arrowParens?: $PropertyType<Options, \"arrowParens\">,\n    parser?: $PropertyType<Options, \"parser\">,\n    filepath?: $PropertyType<Options, \"filepath\">,\n    requirePragma?: $PropertyType<Options, \"requirePragma\">,\n    insertPragma?: $PropertyType<Options, \"insertPragma\">,\n    proseWrap?: $PropertyType<Options, \"proseWrap\">,\n    plugins?: $PropertyType<Options, \"plugins\">\n  |};\n\n  declare type CursorResult = {|\n    formatted: string,\n    cursorOffset: number\n  |};\n\n  declare type ResolveConfigOptions = {|\n    useCache?: boolean,\n    config?: string,\n    editorconfig?: boolean\n  |};\n\n  declare type SupportLanguage = {\n    name: string,\n    since: string,\n    parsers: Array<string>,\n    group?: string,\n    tmScope: string,\n    aceMode: string,\n    codemirrorMode: string,\n    codemirrorMimeType: string,\n    aliases?: Array<string>,\n    extensions: Array<string>,\n    filenames?: Array<string>,\n    linguistLanguageId: number,\n    vscodeLanguageIds: Array<string>\n  };\n\n  declare type SupportOption = {|\n    since: string,\n    type: \"int\" | \"boolean\" | \"choice\" | \"path\",\n    deprecated?: string,\n    redirect?: SupportOptionRedirect,\n    description: string,\n    oppositeDescription?: string,\n    default: SupportOptionValue,\n    range?: SupportOptionRange,\n    choices?: SupportOptionChoice\n  |};\n\n  declare type SupportOptionRedirect = {|\n    options: string,\n    value: SupportOptionValue\n  |};\n\n  declare type SupportOptionRange = {|\n    start: number,\n    end: number,\n    step: number\n  |};\n\n  declare type SupportOptionChoice = {|\n    value: boolean | string,\n    description?: string,\n    since?: string,\n    deprecated?: string,\n    redirect?: SupportOptionValue\n  |};\n\n  declare type SupportOptionValue = number | boolean | string;\n\n  declare type SupportInfo = {|\n    languages: Array<SupportLanguage>,\n    options: Array<SupportOption>\n  |};\n\n  declare type Prettier = {|\n    format: (source: string, options?: Options) => string,\n    check: (source: string, options?: Options) => boolean,\n    formatWithCursor: (source: string, options: CursorOptions) => CursorResult,\n    resolveConfig: {\n      (filePath: string, options?: ResolveConfigOptions): Promise<?Options>,\n      sync(filePath: string, options?: ResolveConfigOptions): Promise<?Options>\n    },\n    clearConfigCache: () => void,\n    getSupportInfo: (version?: string) => SupportInfo\n  |};\n\n  declare export default Prettier;\n}\n"
  },
  {
    "path": "flow-typed/npm/prop-types_v15.x.x.js",
    "content": "// flow-typed signature: d9a983bb1ac458a256c31c139047bdbb\n// flow-typed version: 927687984d/prop-types_v15.x.x/flow_>=v0.41.x\n\ntype $npm$propTypes$ReactPropsCheckType = (\n  props: any,\n  propName: string,\n  componentName: string,\n  href?: string) => ?Error;\n\ndeclare module 'prop-types' {\n  declare var array: React$PropType$Primitive<Array<any>>;\n  declare var bool: React$PropType$Primitive<boolean>;\n  declare var func: React$PropType$Primitive<Function>;\n  declare var number: React$PropType$Primitive<number>;\n  declare var object: React$PropType$Primitive<Object>;\n  declare var string: React$PropType$Primitive<string>;\n  declare var symbol: React$PropType$Primitive<Symbol>;\n  declare var any: React$PropType$Primitive<any>;\n  declare var arrayOf: React$PropType$ArrayOf;\n  declare var element: React$PropType$Primitive<any>; /* TODO */\n  declare var instanceOf: React$PropType$InstanceOf;\n  declare var node: React$PropType$Primitive<any>; /* TODO */\n  declare var objectOf: React$PropType$ObjectOf;\n  declare var oneOf: React$PropType$OneOf;\n  declare var oneOfType: React$PropType$OneOfType;\n  declare var shape: React$PropType$Shape;\n\n  declare function checkPropTypes<V>(\n    propTypes: {[_: $Keys<V>]: $npm$propTypes$ReactPropsCheckType},\n    values: V,\n    location: string,\n    componentName: string,\n    getStack: ?(() => ?string)\n  ) : void;\n}\n"
  },
  {
    "path": "flow-typed/npm/queue-fifo_vx.x.x.js",
    "content": "// flow-typed signature: 32d4e4a79ef4ec16683f87120b5178b5\n// flow-typed version: <<STUB>>/queue-fifo_v^0.2.3/flow_v0.76.0\n\n/**\n * This is an autogenerated libdef stub for:\n *\n *   'queue-fifo'\n *\n * Fill this stub out by replacing all the `any` types.\n *\n * Once filled out, we encourage you to share your work with the\n * community by sending a pull request to:\n * https://github.com/flowtype/flow-typed\n */\n\ndeclare module 'queue-fifo' {\n  declare module.exports: any;\n}\n\n/**\n * We include stubs for each file inside this npm package in case you need to\n * require those files directly. Feel free to delete any files that aren't\n * needed.\n */\ndeclare module 'queue-fifo/gulpfile' {\n  declare module.exports: any;\n}\n\ndeclare module 'queue-fifo/test/queue-test' {\n  declare module.exports: any;\n}\n\n// Filename aliases\ndeclare module 'queue-fifo/gulpfile.js' {\n  declare module.exports: $Exports<'queue-fifo/gulpfile'>;\n}\ndeclare module 'queue-fifo/index' {\n  declare module.exports: $Exports<'queue-fifo'>;\n}\ndeclare module 'queue-fifo/index.js' {\n  declare module.exports: $Exports<'queue-fifo'>;\n}\ndeclare module 'queue-fifo/test/queue-test.js' {\n  declare module.exports: $Exports<'queue-fifo/test/queue-test'>;\n}\n"
  },
  {
    "path": "flow-typed/npm/react-native_vx.x.x.js",
    "content": "// flow-typed signature: d06c970656acd3c84b00351852291246\n// flow-typed version: <<STUB>>/react-native_v^0.55.4/flow_v0.76.0\n\n/**\n * This is an autogenerated libdef stub for:\n *\n *   'react-native'\n *\n * Fill this stub out by replacing all the `any` types.\n *\n * Once filled out, we encourage you to share your work with the\n * community by sending a pull request to:\n * https://github.com/flowtype/flow-typed\n */\n\ndeclare module 'react-native' {\n  declare module.exports: any;\n}\n\n/**\n * We include stubs for each file inside this npm package in case you need to\n * require those files directly. Feel free to delete any files that aren't\n * needed.\n */\ndeclare module 'react-native/cli' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/flow-github/metro' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/flow/console' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/flow/create-react-class' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/flow/fbjs' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/flow/Map' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/flow/Position' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/flow/Promise' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/flow/prop-types' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/flow/Set' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/jest/assetFileTransformer' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/jest/mockComponent' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/jest/preprocessor' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/jest/setup' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/lib/deepDiffer' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/lib/deepFreezeAndThrowOnMutationInDev' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/lib/flattenStyle' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/lib/InitializeJavaScriptAppEngine' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/lib/RCTEventEmitter' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/lib/TextInputState' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/lib/UIManager' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/lib/UIManagerStatTracker' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/lib/View' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/Libraries/ActionSheetIOS/ActionSheetIOS' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/Libraries/Alert/Alert' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/Libraries/Alert/AlertIOS' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/Libraries/Alert/RCTAlertManager.android' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/Libraries/Alert/RCTAlertManager.ios' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/Libraries/Animated/release/gulpfile' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/Libraries/Animated/src/Animated' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/Libraries/Animated/src/AnimatedEvent' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/Libraries/Animated/src/AnimatedImplementation' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/Libraries/Animated/src/AnimatedWeb' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/Libraries/Animated/src/animations/Animation' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/Libraries/Animated/src/animations/DecayAnimation' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/Libraries/Animated/src/animations/SpringAnimation' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/Libraries/Animated/src/animations/TimingAnimation' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/Libraries/Animated/src/bezier' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/Libraries/Animated/src/createAnimatedComponent' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/Libraries/Animated/src/Easing' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/Libraries/Animated/src/NativeAnimatedHelper' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/Libraries/Animated/src/nodes/AnimatedAddition' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/Libraries/Animated/src/nodes/AnimatedDiffClamp' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/Libraries/Animated/src/nodes/AnimatedDivision' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/Libraries/Animated/src/nodes/AnimatedInterpolation' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/Libraries/Animated/src/nodes/AnimatedModulo' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/Libraries/Animated/src/nodes/AnimatedMultiplication' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/Libraries/Animated/src/nodes/AnimatedNode' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/Libraries/Animated/src/nodes/AnimatedProps' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/Libraries/Animated/src/nodes/AnimatedStyle' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/Libraries/Animated/src/nodes/AnimatedTracking' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/Libraries/Animated/src/nodes/AnimatedTransform' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/Libraries/Animated/src/nodes/AnimatedValue' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/Libraries/Animated/src/nodes/AnimatedValueXY' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/Libraries/Animated/src/nodes/AnimatedWithChildren' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/Libraries/Animated/src/polyfills/flattenStyle' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/Libraries/Animated/src/polyfills/InteractionManager' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/Libraries/Animated/src/polyfills/Set' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/Libraries/Animated/src/SpringConfig' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/Libraries/AppState/AppState' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/Libraries/ART/ARTSerializablePath' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/Libraries/ART/ReactNativeART' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/Libraries/BatchedBridge/__mocks__/MessageQueueTestConfig' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/Libraries/BatchedBridge/__mocks__/MessageQueueTestModule' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/Libraries/BatchedBridge/BatchedBridge' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/Libraries/BatchedBridge/MessageQueue' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/Libraries/BatchedBridge/NativeModules' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/Libraries/Blob/__mocks__/BlobModule' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/Libraries/Blob/__mocks__/FileReaderModule' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/Libraries/Blob/Blob' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/Libraries/Blob/BlobManager' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/Libraries/Blob/BlobRegistry' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/Libraries/Blob/BlobTypes' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/Libraries/Blob/File' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/Libraries/Blob/FileReader' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/Libraries/Blob/URL' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/Libraries/BugReporting/BugReporting' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/Libraries/BugReporting/dumpReactTree' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/Libraries/BugReporting/getReactData' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/Libraries/CameraRoll/CameraRoll' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/Libraries/CameraRoll/ImagePickerIOS' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/Libraries/Components/AccessibilityInfo/AccessibilityInfo.android' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/Libraries/Components/AccessibilityInfo/AccessibilityInfo.ios' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/Libraries/Components/ActivityIndicator/ActivityIndicator' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/Libraries/Components/AppleTV/TVEventHandler' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/Libraries/Components/AppleTV/TVViewPropTypes' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/Libraries/Components/Button' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/Libraries/Components/CheckBox/CheckBox.android' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/Libraries/Components/CheckBox/CheckBox.ios' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/Libraries/Components/Clipboard/Clipboard' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/Libraries/Components/DatePicker/DatePickerIOS.android' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/Libraries/Components/DatePicker/DatePickerIOS.ios' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/Libraries/Components/DatePickerAndroid/DatePickerAndroid.android' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/Libraries/Components/DatePickerAndroid/DatePickerAndroid.ios' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/Libraries/Components/DrawerAndroid/DrawerLayoutAndroid.android' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/Libraries/Components/DrawerAndroid/DrawerLayoutAndroid.ios' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/Libraries/Components/Keyboard/Keyboard' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/Libraries/Components/Keyboard/KeyboardAvoidingView' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/Libraries/Components/LazyRenderer' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/Libraries/Components/MaskedView/MaskedViewIOS.android' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/Libraries/Components/MaskedView/MaskedViewIOS.ios' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/Libraries/Components/Navigation/NavigatorIOS.android' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/Libraries/Components/Navigation/NavigatorIOS.ios' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/Libraries/Components/Picker/Picker' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/Libraries/Components/Picker/PickerAndroid.android' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/Libraries/Components/Picker/PickerAndroid.ios' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/Libraries/Components/Picker/PickerIOS.android' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/Libraries/Components/Picker/PickerIOS.ios' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/Libraries/Components/ProgressBarAndroid/ProgressBarAndroid.android' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/Libraries/Components/ProgressBarAndroid/ProgressBarAndroid.ios' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/Libraries/Components/ProgressViewIOS/ProgressViewIOS.android' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/Libraries/Components/ProgressViewIOS/ProgressViewIOS.ios' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/Libraries/Components/RefreshControl/__mocks__/RefreshControlMock' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/Libraries/Components/RefreshControl/RefreshControl' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/Libraries/Components/SafeAreaView/SafeAreaView.android' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/Libraries/Components/SafeAreaView/SafeAreaView.ios' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/Libraries/Components/ScrollResponder' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/Libraries/Components/ScrollView/__mocks__/ScrollViewMock' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/Libraries/Components/ScrollView/processDecelerationRate' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/Libraries/Components/ScrollView/ScrollView' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/Libraries/Components/ScrollView/ScrollViewStickyHeader' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/Libraries/Components/SegmentedControlIOS/SegmentedControlIOS.android' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/Libraries/Components/SegmentedControlIOS/SegmentedControlIOS.ios' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/Libraries/Components/Slider/Slider' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/Libraries/Components/StaticContainer.react' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/Libraries/Components/StaticRenderer' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/Libraries/Components/StatusBar/StatusBar' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/Libraries/Components/StatusBar/StatusBarIOS.android' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/Libraries/Components/StatusBar/StatusBarIOS.ios' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/Libraries/Components/Subscribable' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/Libraries/Components/Switch/Switch' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/Libraries/Components/TabBarIOS/TabBarIOS.android' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/Libraries/Components/TabBarIOS/TabBarIOS.ios' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/Libraries/Components/TabBarIOS/TabBarItemIOS.android' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/Libraries/Components/TabBarIOS/TabBarItemIOS.ios' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/Libraries/Components/TextInput/InputAccessoryView' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/Libraries/Components/TextInput/TextInput' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/Libraries/Components/TextInput/TextInputState' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/Libraries/Components/TimePickerAndroid/TimePickerAndroid.android' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/Libraries/Components/TimePickerAndroid/TimePickerAndroid.ios' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/Libraries/Components/ToastAndroid/ToastAndroid.android' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/Libraries/Components/ToastAndroid/ToastAndroid.ios' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/Libraries/Components/ToolbarAndroid/ToolbarAndroid.android' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/Libraries/Components/ToolbarAndroid/ToolbarAndroid.ios' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/Libraries/Components/Touchable/__mocks__/ensureComponentIsNative' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/Libraries/Components/Touchable/BoundingDimensions' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/Libraries/Components/Touchable/ensureComponentIsNative' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/Libraries/Components/Touchable/ensurePositiveDelayProps' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/Libraries/Components/Touchable/PooledClass' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/Libraries/Components/Touchable/Position' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/Libraries/Components/Touchable/Touchable' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/Libraries/Components/Touchable/TouchableBounce' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/Libraries/Components/Touchable/TouchableHighlight' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/Libraries/Components/Touchable/TouchableNativeFeedback.android' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/Libraries/Components/Touchable/TouchableNativeFeedback.ios' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/Libraries/Components/Touchable/TouchableOpacity' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/Libraries/Components/Touchable/TouchableWithoutFeedback' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/Libraries/Components/UnimplementedViews/UnimplementedView' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/Libraries/Components/View/FabricView' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/Libraries/Components/View/PlatformViewPropTypes' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/Libraries/Components/View/ReactNativeStyleAttributes' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/Libraries/Components/View/ReactNativeViewAttributes' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/Libraries/Components/View/ShadowPropTypesIOS' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/Libraries/Components/View/View' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/Libraries/Components/View/ViewAccessibility' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/Libraries/Components/View/ViewContext' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/Libraries/Components/View/ViewPropTypes' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/Libraries/Components/View/ViewStylePropTypes' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/Libraries/Components/ViewPager/ViewPagerAndroid.android' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/Libraries/Components/ViewPager/ViewPagerAndroid.ios' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/Libraries/Components/WebView/WebView.android' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/Libraries/Components/WebView/WebView.ios' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/Libraries/Core/__mocks__/ErrorUtils' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/Libraries/Core/Devtools/getDevServer' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/Libraries/Core/Devtools/openFileInEditor' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/Libraries/Core/Devtools/parseErrorStack' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/Libraries/Core/Devtools/setupDevtools' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/Libraries/Core/Devtools/symbolicateStackTrace' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/Libraries/Core/ExceptionsManager' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/Libraries/Core/InitializeCore' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/Libraries/Core/ReactNativeVersion' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/Libraries/Core/ReactNativeVersionCheck' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/Libraries/Core/Timers/JSTimers' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/Libraries/EventEmitter/__mocks__/NativeEventEmitter' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/Libraries/EventEmitter/MissingNativeEventEmitterShim' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/Libraries/EventEmitter/NativeEventEmitter' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/Libraries/EventEmitter/RCTDeviceEventEmitter' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/Libraries/EventEmitter/RCTEventEmitter' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/Libraries/EventEmitter/RCTNativeAppEventEmitter' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/Libraries/Experimental/Incremental' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/Libraries/Experimental/IncrementalExample' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/Libraries/Experimental/IncrementalGroup' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/Libraries/Experimental/IncrementalPresenter' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/Libraries/Experimental/SwipeableRow/SwipeableFlatList' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/Libraries/Experimental/SwipeableRow/SwipeableListView' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/Libraries/Experimental/SwipeableRow/SwipeableListViewDataSource' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/Libraries/Experimental/SwipeableRow/SwipeableQuickActionButton' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/Libraries/Experimental/SwipeableRow/SwipeableQuickActions' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/Libraries/Experimental/SwipeableRow/SwipeableRow' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/Libraries/Experimental/WindowedListView' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/Libraries/Geolocation/Geolocation' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/Libraries/Image/AssetRegistry' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/Libraries/Image/AssetSourceResolver' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/Libraries/Image/Image.android' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/Libraries/Image/Image.ios' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/Libraries/Image/ImageBackground' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/Libraries/Image/ImageEditor' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/Libraries/Image/ImageResizeMode' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/Libraries/Image/ImageSource' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/Libraries/Image/ImageSourcePropType' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/Libraries/Image/ImageStore' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/Libraries/Image/ImageStylePropTypes' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/Libraries/Image/nativeImageSource' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/Libraries/Image/RelativeImageStub' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/Libraries/Image/resolveAssetSource' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/Libraries/Inspector/BorderBox' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/Libraries/Inspector/BoxInspector' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/Libraries/Inspector/ElementBox' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/Libraries/Inspector/ElementProperties' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/Libraries/Inspector/Inspector' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/Libraries/Inspector/InspectorOverlay' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/Libraries/Inspector/InspectorPanel' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/Libraries/Inspector/NetworkOverlay' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/Libraries/Inspector/PerformanceOverlay' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/Libraries/Inspector/resolveBoxStyle' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/Libraries/Inspector/StyleInspector' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/Libraries/Interaction/Batchinator' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/Libraries/Interaction/BridgeSpyStallHandler' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/Libraries/Interaction/FrameRateLogger' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/Libraries/Interaction/InteractionManager' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/Libraries/Interaction/InteractionMixin' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/Libraries/Interaction/InteractionStallDebugger' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/Libraries/Interaction/JSEventLoopWatchdog' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/Libraries/Interaction/PanResponder' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/Libraries/Interaction/ReactPerfStallHandler' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/Libraries/Interaction/TaskQueue' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/Libraries/JSInspector/InspectorAgent' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/Libraries/JSInspector/JSInspector' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/Libraries/JSInspector/NetworkAgent' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/Libraries/LayoutAnimation/LayoutAnimation' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/Libraries/Linking/Linking' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/Libraries/Lists/__flowtests__/FlatList-flowtest' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/Libraries/Lists/__flowtests__/SectionList-flowtest' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/Libraries/Lists/FillRateHelper' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/Libraries/Lists/FlatList' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/Libraries/Lists/ListView/__mocks__/ListViewMock' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/Libraries/Lists/ListView/ListView' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/Libraries/Lists/ListView/ListViewDataSource' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/Libraries/Lists/MetroListView' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/Libraries/Lists/SectionList' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/Libraries/Lists/ViewabilityHelper' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/Libraries/Lists/VirtualizedList' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/Libraries/Lists/VirtualizedSectionList' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/Libraries/Lists/VirtualizeUtils' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/Libraries/Modal/Modal' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/Libraries/Network/convertRequestBody' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/Libraries/Network/fetch' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/Libraries/Network/FormData' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/Libraries/Network/NetInfo' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/Libraries/Network/RCTNetworking.android' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/Libraries/Network/RCTNetworking.ios' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/Libraries/Network/XHRInterceptor' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/Libraries/Network/XMLHttpRequest' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/Libraries/Performance/QuickPerformanceLogger' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/Libraries/Performance/SamplingProfiler' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/Libraries/Performance/Systrace' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/Libraries/PermissionsAndroid/PermissionsAndroid' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/Libraries/polyfills/Array.es6' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/Libraries/polyfills/Array.prototype.es6' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/Libraries/polyfills/babelHelpers' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/Libraries/polyfills/console' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/Libraries/polyfills/error-guard' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/Libraries/polyfills/Number.es6' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/Libraries/polyfills/Object.es6' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/Libraries/polyfills/Object.es7' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/Libraries/polyfills/String.prototype.es6' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/Libraries/Promise' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/Libraries/promiseRejectionIsError' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/Libraries/PushNotificationIOS/PushNotificationIOS' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/Libraries/RCTTest/SnapshotViewIOS.android' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/Libraries/RCTTest/SnapshotViewIOS.ios' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/Libraries/react-native/react-native-implementation' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/Libraries/react-native/react-native-interface' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/Libraries/react-native/React' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/Libraries/ReactNative/AppContainer' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/Libraries/ReactNative/AppRegistry' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/Libraries/ReactNative/FabricUIManager' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/Libraries/ReactNative/I18nManager' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/Libraries/ReactNative/queryLayoutByID' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/Libraries/ReactNative/renderApplication' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/Libraries/ReactNative/renderFabricSurface' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/Libraries/ReactNative/requireFabricComponent' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/Libraries/ReactNative/requireNativeComponent' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/Libraries/ReactNative/UIManager' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/Libraries/ReactNative/UIManagerStatTracker' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/Libraries/ReactNative/verifyPropTypes' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/Libraries/ReactNative/YellowBox' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/Libraries/Renderer/ReactFabric-dev' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/Libraries/Renderer/ReactFabric-prod' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/Libraries/Renderer/ReactNativeRenderer-dev' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/Libraries/Renderer/ReactNativeRenderer-prod' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/Libraries/Renderer/shims/createReactNativeComponentClass' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/Libraries/Renderer/shims/NativeMethodsMixin' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/Libraries/Renderer/shims/ReactDebugTool' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/Libraries/Renderer/shims/ReactFabric' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/Libraries/Renderer/shims/ReactFabricInternals' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/Libraries/Renderer/shims/ReactFeatureFlags' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/Libraries/Renderer/shims/ReactNative' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/Libraries/Renderer/shims/ReactNativeBridgeEventPlugin' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/Libraries/Renderer/shims/ReactNativeComponentTree' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/Libraries/Renderer/shims/ReactNativePropRegistry' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/Libraries/Renderer/shims/ReactNativeTypes' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/Libraries/Renderer/shims/ReactPerf' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/Libraries/Renderer/shims/ReactTypes' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/Libraries/Renderer/shims/takeSnapshot' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/Libraries/Renderer/shims/TouchHistoryMath' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/Libraries/Sample/Sample.android' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/Libraries/Sample/Sample.ios' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/Libraries/Settings/Settings.android' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/Libraries/Settings/Settings.ios' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/Libraries/Share/Share' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/Libraries/Storage/AsyncStorage' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/Libraries/StyleSheet/ColorPropType' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/Libraries/StyleSheet/EdgeInsetsPropType' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/Libraries/StyleSheet/flattenStyle' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/Libraries/StyleSheet/LayoutPropTypes' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/Libraries/StyleSheet/normalizeColor' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/Libraries/StyleSheet/PointPropType' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/Libraries/StyleSheet/processColor' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/Libraries/StyleSheet/processTransform' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/Libraries/StyleSheet/setNormalizedColorAlpha' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/Libraries/StyleSheet/StyleSheet' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/Libraries/StyleSheet/StyleSheetPropType' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/Libraries/StyleSheet/StyleSheetTypes' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/Libraries/StyleSheet/StyleSheetValidation' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/Libraries/StyleSheet/TransformPropTypes' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/Libraries/Text/Text' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/Libraries/Text/TextProps' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/Libraries/Text/TextPropTypes' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/Libraries/Text/TextStylePropTypes' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/Libraries/Text/TextUpdateTest' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/Libraries/Types/CoreEventTypes' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/Libraries/UTFSequence' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/Libraries/Utilities/__mocks__/BackHandler' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/Libraries/Utilities/__mocks__/PixelRatio' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/Libraries/Utilities/BackAndroid' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/Libraries/Utilities/BackHandler.android' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/Libraries/Utilities/BackHandler.ios' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/Libraries/Utilities/binaryToBase64' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/Libraries/Utilities/buildStyleInterpolator' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/Libraries/Utilities/clamp' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/Libraries/Utilities/createStrictShapeTypeChecker' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/Libraries/Utilities/deepFreezeAndThrowOnMutationInDev' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/Libraries/Utilities/defineLazyObjectProperty' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/Libraries/Utilities/deprecatedPropType' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/Libraries/Utilities/DeviceInfo' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/Libraries/Utilities/differ/deepDiffer' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/Libraries/Utilities/differ/insetsDiffer' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/Libraries/Utilities/differ/matricesDiffer' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/Libraries/Utilities/differ/pointsDiffer' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/Libraries/Utilities/differ/sizesDiffer' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/Libraries/Utilities/Dimensions' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/Libraries/Utilities/dismissKeyboard' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/Libraries/Utilities/groupByEveryN' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/Libraries/Utilities/HeapCapture' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/Libraries/Utilities/HMRClient' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/Libraries/Utilities/HMRLoadingView.android' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/Libraries/Utilities/HMRLoadingView.ios' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/Libraries/Utilities/infoLog' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/Libraries/Utilities/JSDevSupportModule' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/Libraries/Utilities/logError' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/Libraries/Utilities/mapWithSeparator' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/Libraries/Utilities/MatrixMath' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/Libraries/Utilities/mergeFast' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/Libraries/Utilities/mergeIntoFast' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/Libraries/Utilities/PerformanceLogger' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/Libraries/Utilities/PixelRatio' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/Libraries/Utilities/Platform.android' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/Libraries/Utilities/Platform.ios' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/Libraries/Utilities/PlatformOS.android' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/Libraries/Utilities/PlatformOS.ios' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/Libraries/Utilities/PolyfillFunctions' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/Libraries/Utilities/RCTLog' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/Libraries/Utilities/SceneTracker' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/Libraries/Utilities/stringifySafe' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/Libraries/Utilities/truncate' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/Libraries/vendor/core/_shouldPolyfillES6Collection' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/Libraries/vendor/core/ErrorUtils' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/Libraries/vendor/core/getObjectValues' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/Libraries/vendor/core/guid' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/Libraries/vendor/core/isEmpty' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/Libraries/vendor/core/Map' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/Libraries/vendor/core/merge' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/Libraries/vendor/core/mergeHelpers' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/Libraries/vendor/core/mergeInto' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/Libraries/vendor/core/Set' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/Libraries/vendor/core/toIterator' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/Libraries/vendor/document/selection/DocumentSelectionState' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/Libraries/vendor/emitter/EmitterSubscription' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/Libraries/vendor/emitter/EventEmitter' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/Libraries/vendor/emitter/EventEmitterWithHolding' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/Libraries/vendor/emitter/EventHolder' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/Libraries/vendor/emitter/EventSubscription' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/Libraries/vendor/emitter/EventSubscriptionVendor' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/Libraries/vendor/emitter/EventValidator' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/Libraries/vendor/emitter/mixInEventEmitter' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/Libraries/Vibration/Vibration' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/Libraries/Vibration/VibrationIOS.android' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/Libraries/Vibration/VibrationIOS.ios' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/Libraries/WebSocket/__mocks__/event-target-shim' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/Libraries/WebSocket/WebSocket' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/Libraries/WebSocket/WebSocketEvent' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/Libraries/WebSocket/WebSocketInterceptor' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/local-cli/__mocks__/beeper' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/local-cli/__mocks__/fs' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/local-cli/bundle/__mocks__/sign' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/local-cli/bundle/assetPathUtils' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/local-cli/bundle/buildBundle' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/local-cli/bundle/bundle' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/local-cli/bundle/bundleCommandLineArgs' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/local-cli/bundle/filterPlatformAssetScales' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/local-cli/bundle/getAssetDestPathAndroid' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/local-cli/bundle/getAssetDestPathIOS' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/local-cli/bundle/saveAssets' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/local-cli/bundle/types.flow' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/local-cli/bundle/unbundle' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/local-cli/cli' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/local-cli/cliEntry' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/local-cli/commands' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/local-cli/core/android/findAndroidAppFolder' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/local-cli/core/android/findManifest' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/local-cli/core/android/findPackageClassName' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/local-cli/core/android/index' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/local-cli/core/android/readManifest' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/local-cli/core/Constants' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/local-cli/core/findAssets' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/local-cli/core/findPlugins' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/local-cli/core/index' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/local-cli/core/ios/findPodfilePath' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/local-cli/core/ios/findPodspecName' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/local-cli/core/ios/findProject' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/local-cli/core/ios/index' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/local-cli/core/makeCommand' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/local-cli/core/wrapCommands' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/local-cli/dependencies/dependencies' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/local-cli/eject/eject' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/local-cli/generator/copyProjectTemplateAndReplace' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/local-cli/generator/printRunInstructions' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/local-cli/generator/promptSync' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/local-cli/generator/templates' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/local-cli/info/info' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/local-cli/init/init' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/local-cli/install/install' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/local-cli/install/uninstall' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/local-cli/library/library' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/local-cli/link/android/copyAssets' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/local-cli/link/android/fs' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/local-cli/link/android/index' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/local-cli/link/android/isInstalled' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/local-cli/link/android/patches/applyParams' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/local-cli/link/android/patches/applyPatch' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/local-cli/link/android/patches/makeBuildPatch' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/local-cli/link/android/patches/makeImportPatch' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/local-cli/link/android/patches/makePackagePatch' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/local-cli/link/android/patches/makeSettingsPatch' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/local-cli/link/android/patches/makeStringsPatch' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/local-cli/link/android/patches/revokePatch' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/local-cli/link/android/registerNativeModule' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/local-cli/link/android/unlinkAssets' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/local-cli/link/android/unregisterNativeModule' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/local-cli/link/commandStub' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/local-cli/link/getDependencyConfig' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/local-cli/link/getProjectDependencies' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/local-cli/link/groupFilesByType' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/local-cli/link/ios/addFileToProject' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/local-cli/link/ios/addProjectToLibraries' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/local-cli/link/ios/addSharedLibraries' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/local-cli/link/ios/addToHeaderSearchPaths' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/local-cli/link/ios/common/isInstalled' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/local-cli/link/ios/common/registerNativeModule' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/local-cli/link/ios/common/unregisterNativeModule' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/local-cli/link/ios/copyAssets' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/local-cli/link/ios/createGroup' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/local-cli/link/ios/createGroupWithMessage' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/local-cli/link/ios/getBuildProperty' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/local-cli/link/ios/getGroup' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/local-cli/link/ios/getHeaderSearchPath' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/local-cli/link/ios/getHeadersInFolder' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/local-cli/link/ios/getPlist' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/local-cli/link/ios/getPlistPath' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/local-cli/link/ios/getProducts' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/local-cli/link/ios/getTargets' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/local-cli/link/ios/hasLibraryImported' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/local-cli/link/ios/index' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/local-cli/link/ios/isInstalled' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/local-cli/link/ios/mapHeaderSearchPaths' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/local-cli/link/ios/registerNativeModule' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/local-cli/link/ios/removeFromHeaderSearchPaths' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/local-cli/link/ios/removeFromPbxItemContainerProxySection' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/local-cli/link/ios/removeFromPbxReferenceProxySection' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/local-cli/link/ios/removeFromProjectReferences' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/local-cli/link/ios/removeFromStaticLibraries' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/local-cli/link/ios/removeProductGroup' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/local-cli/link/ios/removeProjectFromLibraries' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/local-cli/link/ios/removeProjectFromProject' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/local-cli/link/ios/removeSharedLibraries' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/local-cli/link/ios/unlinkAssets' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/local-cli/link/ios/unregisterNativeModule' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/local-cli/link/ios/writePlist' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/local-cli/link/link' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/local-cli/link/pods/addPodEntry' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/local-cli/link/pods/findLineToAddPod' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/local-cli/link/pods/findMarkedLinesInPodfile' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/local-cli/link/pods/findPodTargetLine' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/local-cli/link/pods/isInstalled' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/local-cli/link/pods/readPodfile' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/local-cli/link/pods/registerNativeModule' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/local-cli/link/pods/removePodEntry' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/local-cli/link/pods/savePodFile' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/local-cli/link/pods/unregisterNativeModule' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/local-cli/link/pollParams' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/local-cli/link/promiseWaterfall' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/local-cli/link/promisify' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/local-cli/link/unlink' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/local-cli/logAndroid/logAndroid' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/local-cli/logIOS/logIOS' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/local-cli/runAndroid/adb' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/local-cli/runAndroid/runAndroid' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/local-cli/runIOS/findMatchingSimulator' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/local-cli/runIOS/findXcodeProject' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/local-cli/runIOS/parseIOSDevicesList' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/local-cli/runIOS/runIOS' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/local-cli/server/checkNodeVersion' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/local-cli/server/middleware/copyToClipBoardMiddleware' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/local-cli/server/middleware/getDevToolsMiddleware' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/local-cli/server/middleware/indexPage' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/local-cli/server/middleware/loadRawBodyMiddleware' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/local-cli/server/middleware/openStackFrameInEditorMiddleware' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/local-cli/server/middleware/statusPageMiddleware' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/local-cli/server/middleware/systraceProfileMiddleware' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/local-cli/server/middleware/unless' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/local-cli/server/runServer' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/local-cli/server/server' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/local-cli/server/util/attachWebsocketServer' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/local-cli/server/util/copyToClipBoard' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/local-cli/server/util/debugger-ui/debuggerWorker' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/local-cli/server/util/debugger-ui/DeltaPatcher' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/local-cli/server/util/debugger-ui/deltaUrlToBlobUrl' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/local-cli/server/util/jsPackagerClient' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/local-cli/server/util/launchChrome' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/local-cli/server/util/launchEditor' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/local-cli/server/util/messageSocket' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/local-cli/server/util/webSocketProxy' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/local-cli/templates/HelloNavigation/App' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/local-cli/templates/HelloNavigation/components/KeyboardSpacer' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/local-cli/templates/HelloNavigation/components/ListItem' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/local-cli/templates/HelloNavigation/lib/Backend' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/local-cli/templates/HelloNavigation/views/chat/ChatListScreen' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/local-cli/templates/HelloNavigation/views/chat/ChatScreen' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/local-cli/templates/HelloNavigation/views/HomeScreenTabNavigator' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/local-cli/templates/HelloNavigation/views/welcome/WelcomeScreen' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/local-cli/templates/HelloNavigation/views/welcome/WelcomeText.android' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/local-cli/templates/HelloNavigation/views/welcome/WelcomeText.ios' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/local-cli/templates/HelloWorld/App' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/local-cli/templates/HelloWorld/index' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/local-cli/upgrade/upgrade' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/local-cli/util/__mocks__/log' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/local-cli/util/assertRequiredOptions' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/local-cli/util/Config' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/local-cli/util/copyAndReplace' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/local-cli/util/findReactNativeScripts' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/local-cli/util/findSymlinkedModules' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/local-cli/util/findSymlinksPaths' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/local-cli/util/isPackagerRunning' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/local-cli/util/isValidPackageName' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/local-cli/util/log' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/local-cli/util/PackageManager' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/local-cli/util/parseCommandLine' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/local-cli/util/walk' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/local-cli/util/yarn' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/local-cli/wrong-react-native' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/ReactAndroid/src/androidTest/js/Asserts' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/ReactAndroid/src/androidTest/js/CatalystRootViewTestModule' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/ReactAndroid/src/androidTest/js/DatePickerDialogTestModule' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/ReactAndroid/src/androidTest/js/InitialPropsTestApp' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/ReactAndroid/src/androidTest/js/JSResponderTestApp' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/ReactAndroid/src/androidTest/js/LayoutEventsTestApp' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/ReactAndroid/src/androidTest/js/MeasureLayoutTestModule' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/ReactAndroid/src/androidTest/js/MultitouchHandlingTestAppModule' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/ReactAndroid/src/androidTest/js/NativeIdTestModule' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/ReactAndroid/src/androidTest/js/PickerAndroidTestModule' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/ReactAndroid/src/androidTest/js/ProgressBarTestModule' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/ReactAndroid/src/androidTest/js/ScrollViewTestModule' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/ReactAndroid/src/androidTest/js/ShareTestModule' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/ReactAndroid/src/androidTest/js/SubviewsClippingTestModule' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/ReactAndroid/src/androidTest/js/SwipeRefreshLayoutTestModule' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/ReactAndroid/src/androidTest/js/TestBundle' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/ReactAndroid/src/androidTest/js/TestIdTestModule' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/ReactAndroid/src/androidTest/js/TestJavaToJSArgumentsModule' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/ReactAndroid/src/androidTest/js/TestJavaToJSReturnValuesModule' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/ReactAndroid/src/androidTest/js/TestJSLocaleModule' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/ReactAndroid/src/androidTest/js/TestJSToJavaParametersModule' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/ReactAndroid/src/androidTest/js/TextInputTestModule' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/ReactAndroid/src/androidTest/js/TimePickerDialogTestModule' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/ReactAndroid/src/androidTest/js/TouchBubblingTestAppModule' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/ReactAndroid/src/androidTest/js/UIManagerTestModule' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/ReactAndroid/src/androidTest/js/ViewRenderingTestModule' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/rn-get-polyfills' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-native/setupBabel' {\n  declare module.exports: any;\n}\n\n// Filename aliases\ndeclare module 'react-native/cli.js' {\n  declare module.exports: $Exports<'react-native/cli'>;\n}\ndeclare module 'react-native/flow-github/metro.js' {\n  declare module.exports: $Exports<'react-native/flow-github/metro'>;\n}\ndeclare module 'react-native/flow/console.js' {\n  declare module.exports: $Exports<'react-native/flow/console'>;\n}\ndeclare module 'react-native/flow/create-react-class.js' {\n  declare module.exports: $Exports<'react-native/flow/create-react-class'>;\n}\ndeclare module 'react-native/flow/fbjs.js' {\n  declare module.exports: $Exports<'react-native/flow/fbjs'>;\n}\ndeclare module 'react-native/flow/Map.js' {\n  declare module.exports: $Exports<'react-native/flow/Map'>;\n}\ndeclare module 'react-native/flow/Position.js' {\n  declare module.exports: $Exports<'react-native/flow/Position'>;\n}\ndeclare module 'react-native/flow/Promise.js' {\n  declare module.exports: $Exports<'react-native/flow/Promise'>;\n}\ndeclare module 'react-native/flow/prop-types.js' {\n  declare module.exports: $Exports<'react-native/flow/prop-types'>;\n}\ndeclare module 'react-native/flow/Set.js' {\n  declare module.exports: $Exports<'react-native/flow/Set'>;\n}\ndeclare module 'react-native/jest/assetFileTransformer.js' {\n  declare module.exports: $Exports<'react-native/jest/assetFileTransformer'>;\n}\ndeclare module 'react-native/jest/mockComponent.js' {\n  declare module.exports: $Exports<'react-native/jest/mockComponent'>;\n}\ndeclare module 'react-native/jest/preprocessor.js' {\n  declare module.exports: $Exports<'react-native/jest/preprocessor'>;\n}\ndeclare module 'react-native/jest/setup.js' {\n  declare module.exports: $Exports<'react-native/jest/setup'>;\n}\ndeclare module 'react-native/lib/deepDiffer.js' {\n  declare module.exports: $Exports<'react-native/lib/deepDiffer'>;\n}\ndeclare module 'react-native/lib/deepFreezeAndThrowOnMutationInDev.js' {\n  declare module.exports: $Exports<'react-native/lib/deepFreezeAndThrowOnMutationInDev'>;\n}\ndeclare module 'react-native/lib/flattenStyle.js' {\n  declare module.exports: $Exports<'react-native/lib/flattenStyle'>;\n}\ndeclare module 'react-native/lib/InitializeJavaScriptAppEngine.js' {\n  declare module.exports: $Exports<'react-native/lib/InitializeJavaScriptAppEngine'>;\n}\ndeclare module 'react-native/lib/RCTEventEmitter.js' {\n  declare module.exports: $Exports<'react-native/lib/RCTEventEmitter'>;\n}\ndeclare module 'react-native/lib/TextInputState.js' {\n  declare module.exports: $Exports<'react-native/lib/TextInputState'>;\n}\ndeclare module 'react-native/lib/UIManager.js' {\n  declare module.exports: $Exports<'react-native/lib/UIManager'>;\n}\ndeclare module 'react-native/lib/UIManagerStatTracker.js' {\n  declare module.exports: $Exports<'react-native/lib/UIManagerStatTracker'>;\n}\ndeclare module 'react-native/lib/View.js' {\n  declare module.exports: $Exports<'react-native/lib/View'>;\n}\ndeclare module 'react-native/Libraries/ActionSheetIOS/ActionSheetIOS.js' {\n  declare module.exports: $Exports<'react-native/Libraries/ActionSheetIOS/ActionSheetIOS'>;\n}\ndeclare module 'react-native/Libraries/Alert/Alert.js' {\n  declare module.exports: $Exports<'react-native/Libraries/Alert/Alert'>;\n}\ndeclare module 'react-native/Libraries/Alert/AlertIOS.js' {\n  declare module.exports: $Exports<'react-native/Libraries/Alert/AlertIOS'>;\n}\ndeclare module 'react-native/Libraries/Alert/RCTAlertManager.android.js' {\n  declare module.exports: $Exports<'react-native/Libraries/Alert/RCTAlertManager.android'>;\n}\ndeclare module 'react-native/Libraries/Alert/RCTAlertManager.ios.js' {\n  declare module.exports: $Exports<'react-native/Libraries/Alert/RCTAlertManager.ios'>;\n}\ndeclare module 'react-native/Libraries/Animated/release/gulpfile.js' {\n  declare module.exports: $Exports<'react-native/Libraries/Animated/release/gulpfile'>;\n}\ndeclare module 'react-native/Libraries/Animated/src/Animated.js' {\n  declare module.exports: $Exports<'react-native/Libraries/Animated/src/Animated'>;\n}\ndeclare module 'react-native/Libraries/Animated/src/AnimatedEvent.js' {\n  declare module.exports: $Exports<'react-native/Libraries/Animated/src/AnimatedEvent'>;\n}\ndeclare module 'react-native/Libraries/Animated/src/AnimatedImplementation.js' {\n  declare module.exports: $Exports<'react-native/Libraries/Animated/src/AnimatedImplementation'>;\n}\ndeclare module 'react-native/Libraries/Animated/src/AnimatedWeb.js' {\n  declare module.exports: $Exports<'react-native/Libraries/Animated/src/AnimatedWeb'>;\n}\ndeclare module 'react-native/Libraries/Animated/src/animations/Animation.js' {\n  declare module.exports: $Exports<'react-native/Libraries/Animated/src/animations/Animation'>;\n}\ndeclare module 'react-native/Libraries/Animated/src/animations/DecayAnimation.js' {\n  declare module.exports: $Exports<'react-native/Libraries/Animated/src/animations/DecayAnimation'>;\n}\ndeclare module 'react-native/Libraries/Animated/src/animations/SpringAnimation.js' {\n  declare module.exports: $Exports<'react-native/Libraries/Animated/src/animations/SpringAnimation'>;\n}\ndeclare module 'react-native/Libraries/Animated/src/animations/TimingAnimation.js' {\n  declare module.exports: $Exports<'react-native/Libraries/Animated/src/animations/TimingAnimation'>;\n}\ndeclare module 'react-native/Libraries/Animated/src/bezier.js' {\n  declare module.exports: $Exports<'react-native/Libraries/Animated/src/bezier'>;\n}\ndeclare module 'react-native/Libraries/Animated/src/createAnimatedComponent.js' {\n  declare module.exports: $Exports<'react-native/Libraries/Animated/src/createAnimatedComponent'>;\n}\ndeclare module 'react-native/Libraries/Animated/src/Easing.js' {\n  declare module.exports: $Exports<'react-native/Libraries/Animated/src/Easing'>;\n}\ndeclare module 'react-native/Libraries/Animated/src/NativeAnimatedHelper.js' {\n  declare module.exports: $Exports<'react-native/Libraries/Animated/src/NativeAnimatedHelper'>;\n}\ndeclare module 'react-native/Libraries/Animated/src/nodes/AnimatedAddition.js' {\n  declare module.exports: $Exports<'react-native/Libraries/Animated/src/nodes/AnimatedAddition'>;\n}\ndeclare module 'react-native/Libraries/Animated/src/nodes/AnimatedDiffClamp.js' {\n  declare module.exports: $Exports<'react-native/Libraries/Animated/src/nodes/AnimatedDiffClamp'>;\n}\ndeclare module 'react-native/Libraries/Animated/src/nodes/AnimatedDivision.js' {\n  declare module.exports: $Exports<'react-native/Libraries/Animated/src/nodes/AnimatedDivision'>;\n}\ndeclare module 'react-native/Libraries/Animated/src/nodes/AnimatedInterpolation.js' {\n  declare module.exports: $Exports<'react-native/Libraries/Animated/src/nodes/AnimatedInterpolation'>;\n}\ndeclare module 'react-native/Libraries/Animated/src/nodes/AnimatedModulo.js' {\n  declare module.exports: $Exports<'react-native/Libraries/Animated/src/nodes/AnimatedModulo'>;\n}\ndeclare module 'react-native/Libraries/Animated/src/nodes/AnimatedMultiplication.js' {\n  declare module.exports: $Exports<'react-native/Libraries/Animated/src/nodes/AnimatedMultiplication'>;\n}\ndeclare module 'react-native/Libraries/Animated/src/nodes/AnimatedNode.js' {\n  declare module.exports: $Exports<'react-native/Libraries/Animated/src/nodes/AnimatedNode'>;\n}\ndeclare module 'react-native/Libraries/Animated/src/nodes/AnimatedProps.js' {\n  declare module.exports: $Exports<'react-native/Libraries/Animated/src/nodes/AnimatedProps'>;\n}\ndeclare module 'react-native/Libraries/Animated/src/nodes/AnimatedStyle.js' {\n  declare module.exports: $Exports<'react-native/Libraries/Animated/src/nodes/AnimatedStyle'>;\n}\ndeclare module 'react-native/Libraries/Animated/src/nodes/AnimatedTracking.js' {\n  declare module.exports: $Exports<'react-native/Libraries/Animated/src/nodes/AnimatedTracking'>;\n}\ndeclare module 'react-native/Libraries/Animated/src/nodes/AnimatedTransform.js' {\n  declare module.exports: $Exports<'react-native/Libraries/Animated/src/nodes/AnimatedTransform'>;\n}\ndeclare module 'react-native/Libraries/Animated/src/nodes/AnimatedValue.js' {\n  declare module.exports: $Exports<'react-native/Libraries/Animated/src/nodes/AnimatedValue'>;\n}\ndeclare module 'react-native/Libraries/Animated/src/nodes/AnimatedValueXY.js' {\n  declare module.exports: $Exports<'react-native/Libraries/Animated/src/nodes/AnimatedValueXY'>;\n}\ndeclare module 'react-native/Libraries/Animated/src/nodes/AnimatedWithChildren.js' {\n  declare module.exports: $Exports<'react-native/Libraries/Animated/src/nodes/AnimatedWithChildren'>;\n}\ndeclare module 'react-native/Libraries/Animated/src/polyfills/flattenStyle.js' {\n  declare module.exports: $Exports<'react-native/Libraries/Animated/src/polyfills/flattenStyle'>;\n}\ndeclare module 'react-native/Libraries/Animated/src/polyfills/InteractionManager.js' {\n  declare module.exports: $Exports<'react-native/Libraries/Animated/src/polyfills/InteractionManager'>;\n}\ndeclare module 'react-native/Libraries/Animated/src/polyfills/Set.js' {\n  declare module.exports: $Exports<'react-native/Libraries/Animated/src/polyfills/Set'>;\n}\ndeclare module 'react-native/Libraries/Animated/src/SpringConfig.js' {\n  declare module.exports: $Exports<'react-native/Libraries/Animated/src/SpringConfig'>;\n}\ndeclare module 'react-native/Libraries/AppState/AppState.js' {\n  declare module.exports: $Exports<'react-native/Libraries/AppState/AppState'>;\n}\ndeclare module 'react-native/Libraries/ART/ARTSerializablePath.js' {\n  declare module.exports: $Exports<'react-native/Libraries/ART/ARTSerializablePath'>;\n}\ndeclare module 'react-native/Libraries/ART/ReactNativeART.js' {\n  declare module.exports: $Exports<'react-native/Libraries/ART/ReactNativeART'>;\n}\ndeclare module 'react-native/Libraries/BatchedBridge/__mocks__/MessageQueueTestConfig.js' {\n  declare module.exports: $Exports<'react-native/Libraries/BatchedBridge/__mocks__/MessageQueueTestConfig'>;\n}\ndeclare module 'react-native/Libraries/BatchedBridge/__mocks__/MessageQueueTestModule.js' {\n  declare module.exports: $Exports<'react-native/Libraries/BatchedBridge/__mocks__/MessageQueueTestModule'>;\n}\ndeclare module 'react-native/Libraries/BatchedBridge/BatchedBridge.js' {\n  declare module.exports: $Exports<'react-native/Libraries/BatchedBridge/BatchedBridge'>;\n}\ndeclare module 'react-native/Libraries/BatchedBridge/MessageQueue.js' {\n  declare module.exports: $Exports<'react-native/Libraries/BatchedBridge/MessageQueue'>;\n}\ndeclare module 'react-native/Libraries/BatchedBridge/NativeModules.js' {\n  declare module.exports: $Exports<'react-native/Libraries/BatchedBridge/NativeModules'>;\n}\ndeclare module 'react-native/Libraries/Blob/__mocks__/BlobModule.js' {\n  declare module.exports: $Exports<'react-native/Libraries/Blob/__mocks__/BlobModule'>;\n}\ndeclare module 'react-native/Libraries/Blob/__mocks__/FileReaderModule.js' {\n  declare module.exports: $Exports<'react-native/Libraries/Blob/__mocks__/FileReaderModule'>;\n}\ndeclare module 'react-native/Libraries/Blob/Blob.js' {\n  declare module.exports: $Exports<'react-native/Libraries/Blob/Blob'>;\n}\ndeclare module 'react-native/Libraries/Blob/BlobManager.js' {\n  declare module.exports: $Exports<'react-native/Libraries/Blob/BlobManager'>;\n}\ndeclare module 'react-native/Libraries/Blob/BlobRegistry.js' {\n  declare module.exports: $Exports<'react-native/Libraries/Blob/BlobRegistry'>;\n}\ndeclare module 'react-native/Libraries/Blob/BlobTypes.js' {\n  declare module.exports: $Exports<'react-native/Libraries/Blob/BlobTypes'>;\n}\ndeclare module 'react-native/Libraries/Blob/File.js' {\n  declare module.exports: $Exports<'react-native/Libraries/Blob/File'>;\n}\ndeclare module 'react-native/Libraries/Blob/FileReader.js' {\n  declare module.exports: $Exports<'react-native/Libraries/Blob/FileReader'>;\n}\ndeclare module 'react-native/Libraries/Blob/URL.js' {\n  declare module.exports: $Exports<'react-native/Libraries/Blob/URL'>;\n}\ndeclare module 'react-native/Libraries/BugReporting/BugReporting.js' {\n  declare module.exports: $Exports<'react-native/Libraries/BugReporting/BugReporting'>;\n}\ndeclare module 'react-native/Libraries/BugReporting/dumpReactTree.js' {\n  declare module.exports: $Exports<'react-native/Libraries/BugReporting/dumpReactTree'>;\n}\ndeclare module 'react-native/Libraries/BugReporting/getReactData.js' {\n  declare module.exports: $Exports<'react-native/Libraries/BugReporting/getReactData'>;\n}\ndeclare module 'react-native/Libraries/CameraRoll/CameraRoll.js' {\n  declare module.exports: $Exports<'react-native/Libraries/CameraRoll/CameraRoll'>;\n}\ndeclare module 'react-native/Libraries/CameraRoll/ImagePickerIOS.js' {\n  declare module.exports: $Exports<'react-native/Libraries/CameraRoll/ImagePickerIOS'>;\n}\ndeclare module 'react-native/Libraries/Components/AccessibilityInfo/AccessibilityInfo.android.js' {\n  declare module.exports: $Exports<'react-native/Libraries/Components/AccessibilityInfo/AccessibilityInfo.android'>;\n}\ndeclare module 'react-native/Libraries/Components/AccessibilityInfo/AccessibilityInfo.ios.js' {\n  declare module.exports: $Exports<'react-native/Libraries/Components/AccessibilityInfo/AccessibilityInfo.ios'>;\n}\ndeclare module 'react-native/Libraries/Components/ActivityIndicator/ActivityIndicator.js' {\n  declare module.exports: $Exports<'react-native/Libraries/Components/ActivityIndicator/ActivityIndicator'>;\n}\ndeclare module 'react-native/Libraries/Components/AppleTV/TVEventHandler.js' {\n  declare module.exports: $Exports<'react-native/Libraries/Components/AppleTV/TVEventHandler'>;\n}\ndeclare module 'react-native/Libraries/Components/AppleTV/TVViewPropTypes.js' {\n  declare module.exports: $Exports<'react-native/Libraries/Components/AppleTV/TVViewPropTypes'>;\n}\ndeclare module 'react-native/Libraries/Components/Button.js' {\n  declare module.exports: $Exports<'react-native/Libraries/Components/Button'>;\n}\ndeclare module 'react-native/Libraries/Components/CheckBox/CheckBox.android.js' {\n  declare module.exports: $Exports<'react-native/Libraries/Components/CheckBox/CheckBox.android'>;\n}\ndeclare module 'react-native/Libraries/Components/CheckBox/CheckBox.ios.js' {\n  declare module.exports: $Exports<'react-native/Libraries/Components/CheckBox/CheckBox.ios'>;\n}\ndeclare module 'react-native/Libraries/Components/Clipboard/Clipboard.js' {\n  declare module.exports: $Exports<'react-native/Libraries/Components/Clipboard/Clipboard'>;\n}\ndeclare module 'react-native/Libraries/Components/DatePicker/DatePickerIOS.android.js' {\n  declare module.exports: $Exports<'react-native/Libraries/Components/DatePicker/DatePickerIOS.android'>;\n}\ndeclare module 'react-native/Libraries/Components/DatePicker/DatePickerIOS.ios.js' {\n  declare module.exports: $Exports<'react-native/Libraries/Components/DatePicker/DatePickerIOS.ios'>;\n}\ndeclare module 'react-native/Libraries/Components/DatePickerAndroid/DatePickerAndroid.android.js' {\n  declare module.exports: $Exports<'react-native/Libraries/Components/DatePickerAndroid/DatePickerAndroid.android'>;\n}\ndeclare module 'react-native/Libraries/Components/DatePickerAndroid/DatePickerAndroid.ios.js' {\n  declare module.exports: $Exports<'react-native/Libraries/Components/DatePickerAndroid/DatePickerAndroid.ios'>;\n}\ndeclare module 'react-native/Libraries/Components/DrawerAndroid/DrawerLayoutAndroid.android.js' {\n  declare module.exports: $Exports<'react-native/Libraries/Components/DrawerAndroid/DrawerLayoutAndroid.android'>;\n}\ndeclare module 'react-native/Libraries/Components/DrawerAndroid/DrawerLayoutAndroid.ios.js' {\n  declare module.exports: $Exports<'react-native/Libraries/Components/DrawerAndroid/DrawerLayoutAndroid.ios'>;\n}\ndeclare module 'react-native/Libraries/Components/Keyboard/Keyboard.js' {\n  declare module.exports: $Exports<'react-native/Libraries/Components/Keyboard/Keyboard'>;\n}\ndeclare module 'react-native/Libraries/Components/Keyboard/KeyboardAvoidingView.js' {\n  declare module.exports: $Exports<'react-native/Libraries/Components/Keyboard/KeyboardAvoidingView'>;\n}\ndeclare module 'react-native/Libraries/Components/LazyRenderer.js' {\n  declare module.exports: $Exports<'react-native/Libraries/Components/LazyRenderer'>;\n}\ndeclare module 'react-native/Libraries/Components/MaskedView/MaskedViewIOS.android.js' {\n  declare module.exports: $Exports<'react-native/Libraries/Components/MaskedView/MaskedViewIOS.android'>;\n}\ndeclare module 'react-native/Libraries/Components/MaskedView/MaskedViewIOS.ios.js' {\n  declare module.exports: $Exports<'react-native/Libraries/Components/MaskedView/MaskedViewIOS.ios'>;\n}\ndeclare module 'react-native/Libraries/Components/Navigation/NavigatorIOS.android.js' {\n  declare module.exports: $Exports<'react-native/Libraries/Components/Navigation/NavigatorIOS.android'>;\n}\ndeclare module 'react-native/Libraries/Components/Navigation/NavigatorIOS.ios.js' {\n  declare module.exports: $Exports<'react-native/Libraries/Components/Navigation/NavigatorIOS.ios'>;\n}\ndeclare module 'react-native/Libraries/Components/Picker/Picker.js' {\n  declare module.exports: $Exports<'react-native/Libraries/Components/Picker/Picker'>;\n}\ndeclare module 'react-native/Libraries/Components/Picker/PickerAndroid.android.js' {\n  declare module.exports: $Exports<'react-native/Libraries/Components/Picker/PickerAndroid.android'>;\n}\ndeclare module 'react-native/Libraries/Components/Picker/PickerAndroid.ios.js' {\n  declare module.exports: $Exports<'react-native/Libraries/Components/Picker/PickerAndroid.ios'>;\n}\ndeclare module 'react-native/Libraries/Components/Picker/PickerIOS.android.js' {\n  declare module.exports: $Exports<'react-native/Libraries/Components/Picker/PickerIOS.android'>;\n}\ndeclare module 'react-native/Libraries/Components/Picker/PickerIOS.ios.js' {\n  declare module.exports: $Exports<'react-native/Libraries/Components/Picker/PickerIOS.ios'>;\n}\ndeclare module 'react-native/Libraries/Components/ProgressBarAndroid/ProgressBarAndroid.android.js' {\n  declare module.exports: $Exports<'react-native/Libraries/Components/ProgressBarAndroid/ProgressBarAndroid.android'>;\n}\ndeclare module 'react-native/Libraries/Components/ProgressBarAndroid/ProgressBarAndroid.ios.js' {\n  declare module.exports: $Exports<'react-native/Libraries/Components/ProgressBarAndroid/ProgressBarAndroid.ios'>;\n}\ndeclare module 'react-native/Libraries/Components/ProgressViewIOS/ProgressViewIOS.android.js' {\n  declare module.exports: $Exports<'react-native/Libraries/Components/ProgressViewIOS/ProgressViewIOS.android'>;\n}\ndeclare module 'react-native/Libraries/Components/ProgressViewIOS/ProgressViewIOS.ios.js' {\n  declare module.exports: $Exports<'react-native/Libraries/Components/ProgressViewIOS/ProgressViewIOS.ios'>;\n}\ndeclare module 'react-native/Libraries/Components/RefreshControl/__mocks__/RefreshControlMock.js' {\n  declare module.exports: $Exports<'react-native/Libraries/Components/RefreshControl/__mocks__/RefreshControlMock'>;\n}\ndeclare module 'react-native/Libraries/Components/RefreshControl/RefreshControl.js' {\n  declare module.exports: $Exports<'react-native/Libraries/Components/RefreshControl/RefreshControl'>;\n}\ndeclare module 'react-native/Libraries/Components/SafeAreaView/SafeAreaView.android.js' {\n  declare module.exports: $Exports<'react-native/Libraries/Components/SafeAreaView/SafeAreaView.android'>;\n}\ndeclare module 'react-native/Libraries/Components/SafeAreaView/SafeAreaView.ios.js' {\n  declare module.exports: $Exports<'react-native/Libraries/Components/SafeAreaView/SafeAreaView.ios'>;\n}\ndeclare module 'react-native/Libraries/Components/ScrollResponder.js' {\n  declare module.exports: $Exports<'react-native/Libraries/Components/ScrollResponder'>;\n}\ndeclare module 'react-native/Libraries/Components/ScrollView/__mocks__/ScrollViewMock.js' {\n  declare module.exports: $Exports<'react-native/Libraries/Components/ScrollView/__mocks__/ScrollViewMock'>;\n}\ndeclare module 'react-native/Libraries/Components/ScrollView/processDecelerationRate.js' {\n  declare module.exports: $Exports<'react-native/Libraries/Components/ScrollView/processDecelerationRate'>;\n}\ndeclare module 'react-native/Libraries/Components/ScrollView/ScrollView.js' {\n  declare module.exports: $Exports<'react-native/Libraries/Components/ScrollView/ScrollView'>;\n}\ndeclare module 'react-native/Libraries/Components/ScrollView/ScrollViewStickyHeader.js' {\n  declare module.exports: $Exports<'react-native/Libraries/Components/ScrollView/ScrollViewStickyHeader'>;\n}\ndeclare module 'react-native/Libraries/Components/SegmentedControlIOS/SegmentedControlIOS.android.js' {\n  declare module.exports: $Exports<'react-native/Libraries/Components/SegmentedControlIOS/SegmentedControlIOS.android'>;\n}\ndeclare module 'react-native/Libraries/Components/SegmentedControlIOS/SegmentedControlIOS.ios.js' {\n  declare module.exports: $Exports<'react-native/Libraries/Components/SegmentedControlIOS/SegmentedControlIOS.ios'>;\n}\ndeclare module 'react-native/Libraries/Components/Slider/Slider.js' {\n  declare module.exports: $Exports<'react-native/Libraries/Components/Slider/Slider'>;\n}\ndeclare module 'react-native/Libraries/Components/StaticContainer.react.js' {\n  declare module.exports: $Exports<'react-native/Libraries/Components/StaticContainer.react'>;\n}\ndeclare module 'react-native/Libraries/Components/StaticRenderer.js' {\n  declare module.exports: $Exports<'react-native/Libraries/Components/StaticRenderer'>;\n}\ndeclare module 'react-native/Libraries/Components/StatusBar/StatusBar.js' {\n  declare module.exports: $Exports<'react-native/Libraries/Components/StatusBar/StatusBar'>;\n}\ndeclare module 'react-native/Libraries/Components/StatusBar/StatusBarIOS.android.js' {\n  declare module.exports: $Exports<'react-native/Libraries/Components/StatusBar/StatusBarIOS.android'>;\n}\ndeclare module 'react-native/Libraries/Components/StatusBar/StatusBarIOS.ios.js' {\n  declare module.exports: $Exports<'react-native/Libraries/Components/StatusBar/StatusBarIOS.ios'>;\n}\ndeclare module 'react-native/Libraries/Components/Subscribable.js' {\n  declare module.exports: $Exports<'react-native/Libraries/Components/Subscribable'>;\n}\ndeclare module 'react-native/Libraries/Components/Switch/Switch.js' {\n  declare module.exports: $Exports<'react-native/Libraries/Components/Switch/Switch'>;\n}\ndeclare module 'react-native/Libraries/Components/TabBarIOS/TabBarIOS.android.js' {\n  declare module.exports: $Exports<'react-native/Libraries/Components/TabBarIOS/TabBarIOS.android'>;\n}\ndeclare module 'react-native/Libraries/Components/TabBarIOS/TabBarIOS.ios.js' {\n  declare module.exports: $Exports<'react-native/Libraries/Components/TabBarIOS/TabBarIOS.ios'>;\n}\ndeclare module 'react-native/Libraries/Components/TabBarIOS/TabBarItemIOS.android.js' {\n  declare module.exports: $Exports<'react-native/Libraries/Components/TabBarIOS/TabBarItemIOS.android'>;\n}\ndeclare module 'react-native/Libraries/Components/TabBarIOS/TabBarItemIOS.ios.js' {\n  declare module.exports: $Exports<'react-native/Libraries/Components/TabBarIOS/TabBarItemIOS.ios'>;\n}\ndeclare module 'react-native/Libraries/Components/TextInput/InputAccessoryView.js' {\n  declare module.exports: $Exports<'react-native/Libraries/Components/TextInput/InputAccessoryView'>;\n}\ndeclare module 'react-native/Libraries/Components/TextInput/TextInput.js' {\n  declare module.exports: $Exports<'react-native/Libraries/Components/TextInput/TextInput'>;\n}\ndeclare module 'react-native/Libraries/Components/TextInput/TextInputState.js' {\n  declare module.exports: $Exports<'react-native/Libraries/Components/TextInput/TextInputState'>;\n}\ndeclare module 'react-native/Libraries/Components/TimePickerAndroid/TimePickerAndroid.android.js' {\n  declare module.exports: $Exports<'react-native/Libraries/Components/TimePickerAndroid/TimePickerAndroid.android'>;\n}\ndeclare module 'react-native/Libraries/Components/TimePickerAndroid/TimePickerAndroid.ios.js' {\n  declare module.exports: $Exports<'react-native/Libraries/Components/TimePickerAndroid/TimePickerAndroid.ios'>;\n}\ndeclare module 'react-native/Libraries/Components/ToastAndroid/ToastAndroid.android.js' {\n  declare module.exports: $Exports<'react-native/Libraries/Components/ToastAndroid/ToastAndroid.android'>;\n}\ndeclare module 'react-native/Libraries/Components/ToastAndroid/ToastAndroid.ios.js' {\n  declare module.exports: $Exports<'react-native/Libraries/Components/ToastAndroid/ToastAndroid.ios'>;\n}\ndeclare module 'react-native/Libraries/Components/ToolbarAndroid/ToolbarAndroid.android.js' {\n  declare module.exports: $Exports<'react-native/Libraries/Components/ToolbarAndroid/ToolbarAndroid.android'>;\n}\ndeclare module 'react-native/Libraries/Components/ToolbarAndroid/ToolbarAndroid.ios.js' {\n  declare module.exports: $Exports<'react-native/Libraries/Components/ToolbarAndroid/ToolbarAndroid.ios'>;\n}\ndeclare module 'react-native/Libraries/Components/Touchable/__mocks__/ensureComponentIsNative.js' {\n  declare module.exports: $Exports<'react-native/Libraries/Components/Touchable/__mocks__/ensureComponentIsNative'>;\n}\ndeclare module 'react-native/Libraries/Components/Touchable/BoundingDimensions.js' {\n  declare module.exports: $Exports<'react-native/Libraries/Components/Touchable/BoundingDimensions'>;\n}\ndeclare module 'react-native/Libraries/Components/Touchable/ensureComponentIsNative.js' {\n  declare module.exports: $Exports<'react-native/Libraries/Components/Touchable/ensureComponentIsNative'>;\n}\ndeclare module 'react-native/Libraries/Components/Touchable/ensurePositiveDelayProps.js' {\n  declare module.exports: $Exports<'react-native/Libraries/Components/Touchable/ensurePositiveDelayProps'>;\n}\ndeclare module 'react-native/Libraries/Components/Touchable/PooledClass.js' {\n  declare module.exports: $Exports<'react-native/Libraries/Components/Touchable/PooledClass'>;\n}\ndeclare module 'react-native/Libraries/Components/Touchable/Position.js' {\n  declare module.exports: $Exports<'react-native/Libraries/Components/Touchable/Position'>;\n}\ndeclare module 'react-native/Libraries/Components/Touchable/Touchable.js' {\n  declare module.exports: $Exports<'react-native/Libraries/Components/Touchable/Touchable'>;\n}\ndeclare module 'react-native/Libraries/Components/Touchable/TouchableBounce.js' {\n  declare module.exports: $Exports<'react-native/Libraries/Components/Touchable/TouchableBounce'>;\n}\ndeclare module 'react-native/Libraries/Components/Touchable/TouchableHighlight.js' {\n  declare module.exports: $Exports<'react-native/Libraries/Components/Touchable/TouchableHighlight'>;\n}\ndeclare module 'react-native/Libraries/Components/Touchable/TouchableNativeFeedback.android.js' {\n  declare module.exports: $Exports<'react-native/Libraries/Components/Touchable/TouchableNativeFeedback.android'>;\n}\ndeclare module 'react-native/Libraries/Components/Touchable/TouchableNativeFeedback.ios.js' {\n  declare module.exports: $Exports<'react-native/Libraries/Components/Touchable/TouchableNativeFeedback.ios'>;\n}\ndeclare module 'react-native/Libraries/Components/Touchable/TouchableOpacity.js' {\n  declare module.exports: $Exports<'react-native/Libraries/Components/Touchable/TouchableOpacity'>;\n}\ndeclare module 'react-native/Libraries/Components/Touchable/TouchableWithoutFeedback.js' {\n  declare module.exports: $Exports<'react-native/Libraries/Components/Touchable/TouchableWithoutFeedback'>;\n}\ndeclare module 'react-native/Libraries/Components/UnimplementedViews/UnimplementedView.js' {\n  declare module.exports: $Exports<'react-native/Libraries/Components/UnimplementedViews/UnimplementedView'>;\n}\ndeclare module 'react-native/Libraries/Components/View/FabricView.js' {\n  declare module.exports: $Exports<'react-native/Libraries/Components/View/FabricView'>;\n}\ndeclare module 'react-native/Libraries/Components/View/PlatformViewPropTypes.js' {\n  declare module.exports: $Exports<'react-native/Libraries/Components/View/PlatformViewPropTypes'>;\n}\ndeclare module 'react-native/Libraries/Components/View/ReactNativeStyleAttributes.js' {\n  declare module.exports: $Exports<'react-native/Libraries/Components/View/ReactNativeStyleAttributes'>;\n}\ndeclare module 'react-native/Libraries/Components/View/ReactNativeViewAttributes.js' {\n  declare module.exports: $Exports<'react-native/Libraries/Components/View/ReactNativeViewAttributes'>;\n}\ndeclare module 'react-native/Libraries/Components/View/ShadowPropTypesIOS.js' {\n  declare module.exports: $Exports<'react-native/Libraries/Components/View/ShadowPropTypesIOS'>;\n}\ndeclare module 'react-native/Libraries/Components/View/View.js' {\n  declare module.exports: $Exports<'react-native/Libraries/Components/View/View'>;\n}\ndeclare module 'react-native/Libraries/Components/View/ViewAccessibility.js' {\n  declare module.exports: $Exports<'react-native/Libraries/Components/View/ViewAccessibility'>;\n}\ndeclare module 'react-native/Libraries/Components/View/ViewContext.js' {\n  declare module.exports: $Exports<'react-native/Libraries/Components/View/ViewContext'>;\n}\ndeclare module 'react-native/Libraries/Components/View/ViewPropTypes.js' {\n  declare module.exports: $Exports<'react-native/Libraries/Components/View/ViewPropTypes'>;\n}\ndeclare module 'react-native/Libraries/Components/View/ViewStylePropTypes.js' {\n  declare module.exports: $Exports<'react-native/Libraries/Components/View/ViewStylePropTypes'>;\n}\ndeclare module 'react-native/Libraries/Components/ViewPager/ViewPagerAndroid.android.js' {\n  declare module.exports: $Exports<'react-native/Libraries/Components/ViewPager/ViewPagerAndroid.android'>;\n}\ndeclare module 'react-native/Libraries/Components/ViewPager/ViewPagerAndroid.ios.js' {\n  declare module.exports: $Exports<'react-native/Libraries/Components/ViewPager/ViewPagerAndroid.ios'>;\n}\ndeclare module 'react-native/Libraries/Components/WebView/WebView.android.js' {\n  declare module.exports: $Exports<'react-native/Libraries/Components/WebView/WebView.android'>;\n}\ndeclare module 'react-native/Libraries/Components/WebView/WebView.ios.js' {\n  declare module.exports: $Exports<'react-native/Libraries/Components/WebView/WebView.ios'>;\n}\ndeclare module 'react-native/Libraries/Core/__mocks__/ErrorUtils.js' {\n  declare module.exports: $Exports<'react-native/Libraries/Core/__mocks__/ErrorUtils'>;\n}\ndeclare module 'react-native/Libraries/Core/Devtools/getDevServer.js' {\n  declare module.exports: $Exports<'react-native/Libraries/Core/Devtools/getDevServer'>;\n}\ndeclare module 'react-native/Libraries/Core/Devtools/openFileInEditor.js' {\n  declare module.exports: $Exports<'react-native/Libraries/Core/Devtools/openFileInEditor'>;\n}\ndeclare module 'react-native/Libraries/Core/Devtools/parseErrorStack.js' {\n  declare module.exports: $Exports<'react-native/Libraries/Core/Devtools/parseErrorStack'>;\n}\ndeclare module 'react-native/Libraries/Core/Devtools/setupDevtools.js' {\n  declare module.exports: $Exports<'react-native/Libraries/Core/Devtools/setupDevtools'>;\n}\ndeclare module 'react-native/Libraries/Core/Devtools/symbolicateStackTrace.js' {\n  declare module.exports: $Exports<'react-native/Libraries/Core/Devtools/symbolicateStackTrace'>;\n}\ndeclare module 'react-native/Libraries/Core/ExceptionsManager.js' {\n  declare module.exports: $Exports<'react-native/Libraries/Core/ExceptionsManager'>;\n}\ndeclare module 'react-native/Libraries/Core/InitializeCore.js' {\n  declare module.exports: $Exports<'react-native/Libraries/Core/InitializeCore'>;\n}\ndeclare module 'react-native/Libraries/Core/ReactNativeVersion.js' {\n  declare module.exports: $Exports<'react-native/Libraries/Core/ReactNativeVersion'>;\n}\ndeclare module 'react-native/Libraries/Core/ReactNativeVersionCheck.js' {\n  declare module.exports: $Exports<'react-native/Libraries/Core/ReactNativeVersionCheck'>;\n}\ndeclare module 'react-native/Libraries/Core/Timers/JSTimers.js' {\n  declare module.exports: $Exports<'react-native/Libraries/Core/Timers/JSTimers'>;\n}\ndeclare module 'react-native/Libraries/EventEmitter/__mocks__/NativeEventEmitter.js' {\n  declare module.exports: $Exports<'react-native/Libraries/EventEmitter/__mocks__/NativeEventEmitter'>;\n}\ndeclare module 'react-native/Libraries/EventEmitter/MissingNativeEventEmitterShim.js' {\n  declare module.exports: $Exports<'react-native/Libraries/EventEmitter/MissingNativeEventEmitterShim'>;\n}\ndeclare module 'react-native/Libraries/EventEmitter/NativeEventEmitter.js' {\n  declare module.exports: $Exports<'react-native/Libraries/EventEmitter/NativeEventEmitter'>;\n}\ndeclare module 'react-native/Libraries/EventEmitter/RCTDeviceEventEmitter.js' {\n  declare module.exports: $Exports<'react-native/Libraries/EventEmitter/RCTDeviceEventEmitter'>;\n}\ndeclare module 'react-native/Libraries/EventEmitter/RCTEventEmitter.js' {\n  declare module.exports: $Exports<'react-native/Libraries/EventEmitter/RCTEventEmitter'>;\n}\ndeclare module 'react-native/Libraries/EventEmitter/RCTNativeAppEventEmitter.js' {\n  declare module.exports: $Exports<'react-native/Libraries/EventEmitter/RCTNativeAppEventEmitter'>;\n}\ndeclare module 'react-native/Libraries/Experimental/Incremental.js' {\n  declare module.exports: $Exports<'react-native/Libraries/Experimental/Incremental'>;\n}\ndeclare module 'react-native/Libraries/Experimental/IncrementalExample.js' {\n  declare module.exports: $Exports<'react-native/Libraries/Experimental/IncrementalExample'>;\n}\ndeclare module 'react-native/Libraries/Experimental/IncrementalGroup.js' {\n  declare module.exports: $Exports<'react-native/Libraries/Experimental/IncrementalGroup'>;\n}\ndeclare module 'react-native/Libraries/Experimental/IncrementalPresenter.js' {\n  declare module.exports: $Exports<'react-native/Libraries/Experimental/IncrementalPresenter'>;\n}\ndeclare module 'react-native/Libraries/Experimental/SwipeableRow/SwipeableFlatList.js' {\n  declare module.exports: $Exports<'react-native/Libraries/Experimental/SwipeableRow/SwipeableFlatList'>;\n}\ndeclare module 'react-native/Libraries/Experimental/SwipeableRow/SwipeableListView.js' {\n  declare module.exports: $Exports<'react-native/Libraries/Experimental/SwipeableRow/SwipeableListView'>;\n}\ndeclare module 'react-native/Libraries/Experimental/SwipeableRow/SwipeableListViewDataSource.js' {\n  declare module.exports: $Exports<'react-native/Libraries/Experimental/SwipeableRow/SwipeableListViewDataSource'>;\n}\ndeclare module 'react-native/Libraries/Experimental/SwipeableRow/SwipeableQuickActionButton.js' {\n  declare module.exports: $Exports<'react-native/Libraries/Experimental/SwipeableRow/SwipeableQuickActionButton'>;\n}\ndeclare module 'react-native/Libraries/Experimental/SwipeableRow/SwipeableQuickActions.js' {\n  declare module.exports: $Exports<'react-native/Libraries/Experimental/SwipeableRow/SwipeableQuickActions'>;\n}\ndeclare module 'react-native/Libraries/Experimental/SwipeableRow/SwipeableRow.js' {\n  declare module.exports: $Exports<'react-native/Libraries/Experimental/SwipeableRow/SwipeableRow'>;\n}\ndeclare module 'react-native/Libraries/Experimental/WindowedListView.js' {\n  declare module.exports: $Exports<'react-native/Libraries/Experimental/WindowedListView'>;\n}\ndeclare module 'react-native/Libraries/Geolocation/Geolocation.js' {\n  declare module.exports: $Exports<'react-native/Libraries/Geolocation/Geolocation'>;\n}\ndeclare module 'react-native/Libraries/Image/AssetRegistry.js' {\n  declare module.exports: $Exports<'react-native/Libraries/Image/AssetRegistry'>;\n}\ndeclare module 'react-native/Libraries/Image/AssetSourceResolver.js' {\n  declare module.exports: $Exports<'react-native/Libraries/Image/AssetSourceResolver'>;\n}\ndeclare module 'react-native/Libraries/Image/Image.android.js' {\n  declare module.exports: $Exports<'react-native/Libraries/Image/Image.android'>;\n}\ndeclare module 'react-native/Libraries/Image/Image.ios.js' {\n  declare module.exports: $Exports<'react-native/Libraries/Image/Image.ios'>;\n}\ndeclare module 'react-native/Libraries/Image/ImageBackground.js' {\n  declare module.exports: $Exports<'react-native/Libraries/Image/ImageBackground'>;\n}\ndeclare module 'react-native/Libraries/Image/ImageEditor.js' {\n  declare module.exports: $Exports<'react-native/Libraries/Image/ImageEditor'>;\n}\ndeclare module 'react-native/Libraries/Image/ImageResizeMode.js' {\n  declare module.exports: $Exports<'react-native/Libraries/Image/ImageResizeMode'>;\n}\ndeclare module 'react-native/Libraries/Image/ImageSource.js' {\n  declare module.exports: $Exports<'react-native/Libraries/Image/ImageSource'>;\n}\ndeclare module 'react-native/Libraries/Image/ImageSourcePropType.js' {\n  declare module.exports: $Exports<'react-native/Libraries/Image/ImageSourcePropType'>;\n}\ndeclare module 'react-native/Libraries/Image/ImageStore.js' {\n  declare module.exports: $Exports<'react-native/Libraries/Image/ImageStore'>;\n}\ndeclare module 'react-native/Libraries/Image/ImageStylePropTypes.js' {\n  declare module.exports: $Exports<'react-native/Libraries/Image/ImageStylePropTypes'>;\n}\ndeclare module 'react-native/Libraries/Image/nativeImageSource.js' {\n  declare module.exports: $Exports<'react-native/Libraries/Image/nativeImageSource'>;\n}\ndeclare module 'react-native/Libraries/Image/RelativeImageStub.js' {\n  declare module.exports: $Exports<'react-native/Libraries/Image/RelativeImageStub'>;\n}\ndeclare module 'react-native/Libraries/Image/resolveAssetSource.js' {\n  declare module.exports: $Exports<'react-native/Libraries/Image/resolveAssetSource'>;\n}\ndeclare module 'react-native/Libraries/Inspector/BorderBox.js' {\n  declare module.exports: $Exports<'react-native/Libraries/Inspector/BorderBox'>;\n}\ndeclare module 'react-native/Libraries/Inspector/BoxInspector.js' {\n  declare module.exports: $Exports<'react-native/Libraries/Inspector/BoxInspector'>;\n}\ndeclare module 'react-native/Libraries/Inspector/ElementBox.js' {\n  declare module.exports: $Exports<'react-native/Libraries/Inspector/ElementBox'>;\n}\ndeclare module 'react-native/Libraries/Inspector/ElementProperties.js' {\n  declare module.exports: $Exports<'react-native/Libraries/Inspector/ElementProperties'>;\n}\ndeclare module 'react-native/Libraries/Inspector/Inspector.js' {\n  declare module.exports: $Exports<'react-native/Libraries/Inspector/Inspector'>;\n}\ndeclare module 'react-native/Libraries/Inspector/InspectorOverlay.js' {\n  declare module.exports: $Exports<'react-native/Libraries/Inspector/InspectorOverlay'>;\n}\ndeclare module 'react-native/Libraries/Inspector/InspectorPanel.js' {\n  declare module.exports: $Exports<'react-native/Libraries/Inspector/InspectorPanel'>;\n}\ndeclare module 'react-native/Libraries/Inspector/NetworkOverlay.js' {\n  declare module.exports: $Exports<'react-native/Libraries/Inspector/NetworkOverlay'>;\n}\ndeclare module 'react-native/Libraries/Inspector/PerformanceOverlay.js' {\n  declare module.exports: $Exports<'react-native/Libraries/Inspector/PerformanceOverlay'>;\n}\ndeclare module 'react-native/Libraries/Inspector/resolveBoxStyle.js' {\n  declare module.exports: $Exports<'react-native/Libraries/Inspector/resolveBoxStyle'>;\n}\ndeclare module 'react-native/Libraries/Inspector/StyleInspector.js' {\n  declare module.exports: $Exports<'react-native/Libraries/Inspector/StyleInspector'>;\n}\ndeclare module 'react-native/Libraries/Interaction/Batchinator.js' {\n  declare module.exports: $Exports<'react-native/Libraries/Interaction/Batchinator'>;\n}\ndeclare module 'react-native/Libraries/Interaction/BridgeSpyStallHandler.js' {\n  declare module.exports: $Exports<'react-native/Libraries/Interaction/BridgeSpyStallHandler'>;\n}\ndeclare module 'react-native/Libraries/Interaction/FrameRateLogger.js' {\n  declare module.exports: $Exports<'react-native/Libraries/Interaction/FrameRateLogger'>;\n}\ndeclare module 'react-native/Libraries/Interaction/InteractionManager.js' {\n  declare module.exports: $Exports<'react-native/Libraries/Interaction/InteractionManager'>;\n}\ndeclare module 'react-native/Libraries/Interaction/InteractionMixin.js' {\n  declare module.exports: $Exports<'react-native/Libraries/Interaction/InteractionMixin'>;\n}\ndeclare module 'react-native/Libraries/Interaction/InteractionStallDebugger.js' {\n  declare module.exports: $Exports<'react-native/Libraries/Interaction/InteractionStallDebugger'>;\n}\ndeclare module 'react-native/Libraries/Interaction/JSEventLoopWatchdog.js' {\n  declare module.exports: $Exports<'react-native/Libraries/Interaction/JSEventLoopWatchdog'>;\n}\ndeclare module 'react-native/Libraries/Interaction/PanResponder.js' {\n  declare module.exports: $Exports<'react-native/Libraries/Interaction/PanResponder'>;\n}\ndeclare module 'react-native/Libraries/Interaction/ReactPerfStallHandler.js' {\n  declare module.exports: $Exports<'react-native/Libraries/Interaction/ReactPerfStallHandler'>;\n}\ndeclare module 'react-native/Libraries/Interaction/TaskQueue.js' {\n  declare module.exports: $Exports<'react-native/Libraries/Interaction/TaskQueue'>;\n}\ndeclare module 'react-native/Libraries/JSInspector/InspectorAgent.js' {\n  declare module.exports: $Exports<'react-native/Libraries/JSInspector/InspectorAgent'>;\n}\ndeclare module 'react-native/Libraries/JSInspector/JSInspector.js' {\n  declare module.exports: $Exports<'react-native/Libraries/JSInspector/JSInspector'>;\n}\ndeclare module 'react-native/Libraries/JSInspector/NetworkAgent.js' {\n  declare module.exports: $Exports<'react-native/Libraries/JSInspector/NetworkAgent'>;\n}\ndeclare module 'react-native/Libraries/LayoutAnimation/LayoutAnimation.js' {\n  declare module.exports: $Exports<'react-native/Libraries/LayoutAnimation/LayoutAnimation'>;\n}\ndeclare module 'react-native/Libraries/Linking/Linking.js' {\n  declare module.exports: $Exports<'react-native/Libraries/Linking/Linking'>;\n}\ndeclare module 'react-native/Libraries/Lists/__flowtests__/FlatList-flowtest.js' {\n  declare module.exports: $Exports<'react-native/Libraries/Lists/__flowtests__/FlatList-flowtest'>;\n}\ndeclare module 'react-native/Libraries/Lists/__flowtests__/SectionList-flowtest.js' {\n  declare module.exports: $Exports<'react-native/Libraries/Lists/__flowtests__/SectionList-flowtest'>;\n}\ndeclare module 'react-native/Libraries/Lists/FillRateHelper.js' {\n  declare module.exports: $Exports<'react-native/Libraries/Lists/FillRateHelper'>;\n}\ndeclare module 'react-native/Libraries/Lists/FlatList.js' {\n  declare module.exports: $Exports<'react-native/Libraries/Lists/FlatList'>;\n}\ndeclare module 'react-native/Libraries/Lists/ListView/__mocks__/ListViewMock.js' {\n  declare module.exports: $Exports<'react-native/Libraries/Lists/ListView/__mocks__/ListViewMock'>;\n}\ndeclare module 'react-native/Libraries/Lists/ListView/ListView.js' {\n  declare module.exports: $Exports<'react-native/Libraries/Lists/ListView/ListView'>;\n}\ndeclare module 'react-native/Libraries/Lists/ListView/ListViewDataSource.js' {\n  declare module.exports: $Exports<'react-native/Libraries/Lists/ListView/ListViewDataSource'>;\n}\ndeclare module 'react-native/Libraries/Lists/MetroListView.js' {\n  declare module.exports: $Exports<'react-native/Libraries/Lists/MetroListView'>;\n}\ndeclare module 'react-native/Libraries/Lists/SectionList.js' {\n  declare module.exports: $Exports<'react-native/Libraries/Lists/SectionList'>;\n}\ndeclare module 'react-native/Libraries/Lists/ViewabilityHelper.js' {\n  declare module.exports: $Exports<'react-native/Libraries/Lists/ViewabilityHelper'>;\n}\ndeclare module 'react-native/Libraries/Lists/VirtualizedList.js' {\n  declare module.exports: $Exports<'react-native/Libraries/Lists/VirtualizedList'>;\n}\ndeclare module 'react-native/Libraries/Lists/VirtualizedSectionList.js' {\n  declare module.exports: $Exports<'react-native/Libraries/Lists/VirtualizedSectionList'>;\n}\ndeclare module 'react-native/Libraries/Lists/VirtualizeUtils.js' {\n  declare module.exports: $Exports<'react-native/Libraries/Lists/VirtualizeUtils'>;\n}\ndeclare module 'react-native/Libraries/Modal/Modal.js' {\n  declare module.exports: $Exports<'react-native/Libraries/Modal/Modal'>;\n}\ndeclare module 'react-native/Libraries/Network/convertRequestBody.js' {\n  declare module.exports: $Exports<'react-native/Libraries/Network/convertRequestBody'>;\n}\ndeclare module 'react-native/Libraries/Network/fetch.js' {\n  declare module.exports: $Exports<'react-native/Libraries/Network/fetch'>;\n}\ndeclare module 'react-native/Libraries/Network/FormData.js' {\n  declare module.exports: $Exports<'react-native/Libraries/Network/FormData'>;\n}\ndeclare module 'react-native/Libraries/Network/NetInfo.js' {\n  declare module.exports: $Exports<'react-native/Libraries/Network/NetInfo'>;\n}\ndeclare module 'react-native/Libraries/Network/RCTNetworking.android.js' {\n  declare module.exports: $Exports<'react-native/Libraries/Network/RCTNetworking.android'>;\n}\ndeclare module 'react-native/Libraries/Network/RCTNetworking.ios.js' {\n  declare module.exports: $Exports<'react-native/Libraries/Network/RCTNetworking.ios'>;\n}\ndeclare module 'react-native/Libraries/Network/XHRInterceptor.js' {\n  declare module.exports: $Exports<'react-native/Libraries/Network/XHRInterceptor'>;\n}\ndeclare module 'react-native/Libraries/Network/XMLHttpRequest.js' {\n  declare module.exports: $Exports<'react-native/Libraries/Network/XMLHttpRequest'>;\n}\ndeclare module 'react-native/Libraries/Performance/QuickPerformanceLogger.js' {\n  declare module.exports: $Exports<'react-native/Libraries/Performance/QuickPerformanceLogger'>;\n}\ndeclare module 'react-native/Libraries/Performance/SamplingProfiler.js' {\n  declare module.exports: $Exports<'react-native/Libraries/Performance/SamplingProfiler'>;\n}\ndeclare module 'react-native/Libraries/Performance/Systrace.js' {\n  declare module.exports: $Exports<'react-native/Libraries/Performance/Systrace'>;\n}\ndeclare module 'react-native/Libraries/PermissionsAndroid/PermissionsAndroid.js' {\n  declare module.exports: $Exports<'react-native/Libraries/PermissionsAndroid/PermissionsAndroid'>;\n}\ndeclare module 'react-native/Libraries/polyfills/Array.es6.js' {\n  declare module.exports: $Exports<'react-native/Libraries/polyfills/Array.es6'>;\n}\ndeclare module 'react-native/Libraries/polyfills/Array.prototype.es6.js' {\n  declare module.exports: $Exports<'react-native/Libraries/polyfills/Array.prototype.es6'>;\n}\ndeclare module 'react-native/Libraries/polyfills/babelHelpers.js' {\n  declare module.exports: $Exports<'react-native/Libraries/polyfills/babelHelpers'>;\n}\ndeclare module 'react-native/Libraries/polyfills/console.js' {\n  declare module.exports: $Exports<'react-native/Libraries/polyfills/console'>;\n}\ndeclare module 'react-native/Libraries/polyfills/error-guard.js' {\n  declare module.exports: $Exports<'react-native/Libraries/polyfills/error-guard'>;\n}\ndeclare module 'react-native/Libraries/polyfills/Number.es6.js' {\n  declare module.exports: $Exports<'react-native/Libraries/polyfills/Number.es6'>;\n}\ndeclare module 'react-native/Libraries/polyfills/Object.es6.js' {\n  declare module.exports: $Exports<'react-native/Libraries/polyfills/Object.es6'>;\n}\ndeclare module 'react-native/Libraries/polyfills/Object.es7.js' {\n  declare module.exports: $Exports<'react-native/Libraries/polyfills/Object.es7'>;\n}\ndeclare module 'react-native/Libraries/polyfills/String.prototype.es6.js' {\n  declare module.exports: $Exports<'react-native/Libraries/polyfills/String.prototype.es6'>;\n}\ndeclare module 'react-native/Libraries/Promise.js' {\n  declare module.exports: $Exports<'react-native/Libraries/Promise'>;\n}\ndeclare module 'react-native/Libraries/promiseRejectionIsError.js' {\n  declare module.exports: $Exports<'react-native/Libraries/promiseRejectionIsError'>;\n}\ndeclare module 'react-native/Libraries/PushNotificationIOS/PushNotificationIOS.js' {\n  declare module.exports: $Exports<'react-native/Libraries/PushNotificationIOS/PushNotificationIOS'>;\n}\ndeclare module 'react-native/Libraries/RCTTest/SnapshotViewIOS.android.js' {\n  declare module.exports: $Exports<'react-native/Libraries/RCTTest/SnapshotViewIOS.android'>;\n}\ndeclare module 'react-native/Libraries/RCTTest/SnapshotViewIOS.ios.js' {\n  declare module.exports: $Exports<'react-native/Libraries/RCTTest/SnapshotViewIOS.ios'>;\n}\ndeclare module 'react-native/Libraries/react-native/react-native-implementation.js' {\n  declare module.exports: $Exports<'react-native/Libraries/react-native/react-native-implementation'>;\n}\ndeclare module 'react-native/Libraries/react-native/react-native-interface.js' {\n  declare module.exports: $Exports<'react-native/Libraries/react-native/react-native-interface'>;\n}\ndeclare module 'react-native/Libraries/react-native/React.js' {\n  declare module.exports: $Exports<'react-native/Libraries/react-native/React'>;\n}\ndeclare module 'react-native/Libraries/ReactNative/AppContainer.js' {\n  declare module.exports: $Exports<'react-native/Libraries/ReactNative/AppContainer'>;\n}\ndeclare module 'react-native/Libraries/ReactNative/AppRegistry.js' {\n  declare module.exports: $Exports<'react-native/Libraries/ReactNative/AppRegistry'>;\n}\ndeclare module 'react-native/Libraries/ReactNative/FabricUIManager.js' {\n  declare module.exports: $Exports<'react-native/Libraries/ReactNative/FabricUIManager'>;\n}\ndeclare module 'react-native/Libraries/ReactNative/I18nManager.js' {\n  declare module.exports: $Exports<'react-native/Libraries/ReactNative/I18nManager'>;\n}\ndeclare module 'react-native/Libraries/ReactNative/queryLayoutByID.js' {\n  declare module.exports: $Exports<'react-native/Libraries/ReactNative/queryLayoutByID'>;\n}\ndeclare module 'react-native/Libraries/ReactNative/renderApplication.js' {\n  declare module.exports: $Exports<'react-native/Libraries/ReactNative/renderApplication'>;\n}\ndeclare module 'react-native/Libraries/ReactNative/renderFabricSurface.js' {\n  declare module.exports: $Exports<'react-native/Libraries/ReactNative/renderFabricSurface'>;\n}\ndeclare module 'react-native/Libraries/ReactNative/requireFabricComponent.js' {\n  declare module.exports: $Exports<'react-native/Libraries/ReactNative/requireFabricComponent'>;\n}\ndeclare module 'react-native/Libraries/ReactNative/requireNativeComponent.js' {\n  declare module.exports: $Exports<'react-native/Libraries/ReactNative/requireNativeComponent'>;\n}\ndeclare module 'react-native/Libraries/ReactNative/UIManager.js' {\n  declare module.exports: $Exports<'react-native/Libraries/ReactNative/UIManager'>;\n}\ndeclare module 'react-native/Libraries/ReactNative/UIManagerStatTracker.js' {\n  declare module.exports: $Exports<'react-native/Libraries/ReactNative/UIManagerStatTracker'>;\n}\ndeclare module 'react-native/Libraries/ReactNative/verifyPropTypes.js' {\n  declare module.exports: $Exports<'react-native/Libraries/ReactNative/verifyPropTypes'>;\n}\ndeclare module 'react-native/Libraries/ReactNative/YellowBox.js' {\n  declare module.exports: $Exports<'react-native/Libraries/ReactNative/YellowBox'>;\n}\ndeclare module 'react-native/Libraries/Renderer/ReactFabric-dev.js' {\n  declare module.exports: $Exports<'react-native/Libraries/Renderer/ReactFabric-dev'>;\n}\ndeclare module 'react-native/Libraries/Renderer/ReactFabric-prod.js' {\n  declare module.exports: $Exports<'react-native/Libraries/Renderer/ReactFabric-prod'>;\n}\ndeclare module 'react-native/Libraries/Renderer/ReactNativeRenderer-dev.js' {\n  declare module.exports: $Exports<'react-native/Libraries/Renderer/ReactNativeRenderer-dev'>;\n}\ndeclare module 'react-native/Libraries/Renderer/ReactNativeRenderer-prod.js' {\n  declare module.exports: $Exports<'react-native/Libraries/Renderer/ReactNativeRenderer-prod'>;\n}\ndeclare module 'react-native/Libraries/Renderer/shims/createReactNativeComponentClass.js' {\n  declare module.exports: $Exports<'react-native/Libraries/Renderer/shims/createReactNativeComponentClass'>;\n}\ndeclare module 'react-native/Libraries/Renderer/shims/NativeMethodsMixin.js' {\n  declare module.exports: $Exports<'react-native/Libraries/Renderer/shims/NativeMethodsMixin'>;\n}\ndeclare module 'react-native/Libraries/Renderer/shims/ReactDebugTool.js' {\n  declare module.exports: $Exports<'react-native/Libraries/Renderer/shims/ReactDebugTool'>;\n}\ndeclare module 'react-native/Libraries/Renderer/shims/ReactFabric.js' {\n  declare module.exports: $Exports<'react-native/Libraries/Renderer/shims/ReactFabric'>;\n}\ndeclare module 'react-native/Libraries/Renderer/shims/ReactFabricInternals.js' {\n  declare module.exports: $Exports<'react-native/Libraries/Renderer/shims/ReactFabricInternals'>;\n}\ndeclare module 'react-native/Libraries/Renderer/shims/ReactFeatureFlags.js' {\n  declare module.exports: $Exports<'react-native/Libraries/Renderer/shims/ReactFeatureFlags'>;\n}\ndeclare module 'react-native/Libraries/Renderer/shims/ReactNative.js' {\n  declare module.exports: $Exports<'react-native/Libraries/Renderer/shims/ReactNative'>;\n}\ndeclare module 'react-native/Libraries/Renderer/shims/ReactNativeBridgeEventPlugin.js' {\n  declare module.exports: $Exports<'react-native/Libraries/Renderer/shims/ReactNativeBridgeEventPlugin'>;\n}\ndeclare module 'react-native/Libraries/Renderer/shims/ReactNativeComponentTree.js' {\n  declare module.exports: $Exports<'react-native/Libraries/Renderer/shims/ReactNativeComponentTree'>;\n}\ndeclare module 'react-native/Libraries/Renderer/shims/ReactNativePropRegistry.js' {\n  declare module.exports: $Exports<'react-native/Libraries/Renderer/shims/ReactNativePropRegistry'>;\n}\ndeclare module 'react-native/Libraries/Renderer/shims/ReactNativeTypes.js' {\n  declare module.exports: $Exports<'react-native/Libraries/Renderer/shims/ReactNativeTypes'>;\n}\ndeclare module 'react-native/Libraries/Renderer/shims/ReactPerf.js' {\n  declare module.exports: $Exports<'react-native/Libraries/Renderer/shims/ReactPerf'>;\n}\ndeclare module 'react-native/Libraries/Renderer/shims/ReactTypes.js' {\n  declare module.exports: $Exports<'react-native/Libraries/Renderer/shims/ReactTypes'>;\n}\ndeclare module 'react-native/Libraries/Renderer/shims/takeSnapshot.js' {\n  declare module.exports: $Exports<'react-native/Libraries/Renderer/shims/takeSnapshot'>;\n}\ndeclare module 'react-native/Libraries/Renderer/shims/TouchHistoryMath.js' {\n  declare module.exports: $Exports<'react-native/Libraries/Renderer/shims/TouchHistoryMath'>;\n}\ndeclare module 'react-native/Libraries/Sample/Sample.android.js' {\n  declare module.exports: $Exports<'react-native/Libraries/Sample/Sample.android'>;\n}\ndeclare module 'react-native/Libraries/Sample/Sample.ios.js' {\n  declare module.exports: $Exports<'react-native/Libraries/Sample/Sample.ios'>;\n}\ndeclare module 'react-native/Libraries/Settings/Settings.android.js' {\n  declare module.exports: $Exports<'react-native/Libraries/Settings/Settings.android'>;\n}\ndeclare module 'react-native/Libraries/Settings/Settings.ios.js' {\n  declare module.exports: $Exports<'react-native/Libraries/Settings/Settings.ios'>;\n}\ndeclare module 'react-native/Libraries/Share/Share.js' {\n  declare module.exports: $Exports<'react-native/Libraries/Share/Share'>;\n}\ndeclare module 'react-native/Libraries/Storage/AsyncStorage.js' {\n  declare module.exports: $Exports<'react-native/Libraries/Storage/AsyncStorage'>;\n}\ndeclare module 'react-native/Libraries/StyleSheet/ColorPropType.js' {\n  declare module.exports: $Exports<'react-native/Libraries/StyleSheet/ColorPropType'>;\n}\ndeclare module 'react-native/Libraries/StyleSheet/EdgeInsetsPropType.js' {\n  declare module.exports: $Exports<'react-native/Libraries/StyleSheet/EdgeInsetsPropType'>;\n}\ndeclare module 'react-native/Libraries/StyleSheet/flattenStyle.js' {\n  declare module.exports: $Exports<'react-native/Libraries/StyleSheet/flattenStyle'>;\n}\ndeclare module 'react-native/Libraries/StyleSheet/LayoutPropTypes.js' {\n  declare module.exports: $Exports<'react-native/Libraries/StyleSheet/LayoutPropTypes'>;\n}\ndeclare module 'react-native/Libraries/StyleSheet/normalizeColor.js' {\n  declare module.exports: $Exports<'react-native/Libraries/StyleSheet/normalizeColor'>;\n}\ndeclare module 'react-native/Libraries/StyleSheet/PointPropType.js' {\n  declare module.exports: $Exports<'react-native/Libraries/StyleSheet/PointPropType'>;\n}\ndeclare module 'react-native/Libraries/StyleSheet/processColor.js' {\n  declare module.exports: $Exports<'react-native/Libraries/StyleSheet/processColor'>;\n}\ndeclare module 'react-native/Libraries/StyleSheet/processTransform.js' {\n  declare module.exports: $Exports<'react-native/Libraries/StyleSheet/processTransform'>;\n}\ndeclare module 'react-native/Libraries/StyleSheet/setNormalizedColorAlpha.js' {\n  declare module.exports: $Exports<'react-native/Libraries/StyleSheet/setNormalizedColorAlpha'>;\n}\ndeclare module 'react-native/Libraries/StyleSheet/StyleSheet.js' {\n  declare module.exports: $Exports<'react-native/Libraries/StyleSheet/StyleSheet'>;\n}\ndeclare module 'react-native/Libraries/StyleSheet/StyleSheetPropType.js' {\n  declare module.exports: $Exports<'react-native/Libraries/StyleSheet/StyleSheetPropType'>;\n}\ndeclare module 'react-native/Libraries/StyleSheet/StyleSheetTypes.js' {\n  declare module.exports: $Exports<'react-native/Libraries/StyleSheet/StyleSheetTypes'>;\n}\ndeclare module 'react-native/Libraries/StyleSheet/StyleSheetValidation.js' {\n  declare module.exports: $Exports<'react-native/Libraries/StyleSheet/StyleSheetValidation'>;\n}\ndeclare module 'react-native/Libraries/StyleSheet/TransformPropTypes.js' {\n  declare module.exports: $Exports<'react-native/Libraries/StyleSheet/TransformPropTypes'>;\n}\ndeclare module 'react-native/Libraries/Text/Text.js' {\n  declare module.exports: $Exports<'react-native/Libraries/Text/Text'>;\n}\ndeclare module 'react-native/Libraries/Text/TextProps.js' {\n  declare module.exports: $Exports<'react-native/Libraries/Text/TextProps'>;\n}\ndeclare module 'react-native/Libraries/Text/TextPropTypes.js' {\n  declare module.exports: $Exports<'react-native/Libraries/Text/TextPropTypes'>;\n}\ndeclare module 'react-native/Libraries/Text/TextStylePropTypes.js' {\n  declare module.exports: $Exports<'react-native/Libraries/Text/TextStylePropTypes'>;\n}\ndeclare module 'react-native/Libraries/Text/TextUpdateTest.js' {\n  declare module.exports: $Exports<'react-native/Libraries/Text/TextUpdateTest'>;\n}\ndeclare module 'react-native/Libraries/Types/CoreEventTypes.js' {\n  declare module.exports: $Exports<'react-native/Libraries/Types/CoreEventTypes'>;\n}\ndeclare module 'react-native/Libraries/UTFSequence.js' {\n  declare module.exports: $Exports<'react-native/Libraries/UTFSequence'>;\n}\ndeclare module 'react-native/Libraries/Utilities/__mocks__/BackHandler.js' {\n  declare module.exports: $Exports<'react-native/Libraries/Utilities/__mocks__/BackHandler'>;\n}\ndeclare module 'react-native/Libraries/Utilities/__mocks__/PixelRatio.js' {\n  declare module.exports: $Exports<'react-native/Libraries/Utilities/__mocks__/PixelRatio'>;\n}\ndeclare module 'react-native/Libraries/Utilities/BackAndroid.js' {\n  declare module.exports: $Exports<'react-native/Libraries/Utilities/BackAndroid'>;\n}\ndeclare module 'react-native/Libraries/Utilities/BackHandler.android.js' {\n  declare module.exports: $Exports<'react-native/Libraries/Utilities/BackHandler.android'>;\n}\ndeclare module 'react-native/Libraries/Utilities/BackHandler.ios.js' {\n  declare module.exports: $Exports<'react-native/Libraries/Utilities/BackHandler.ios'>;\n}\ndeclare module 'react-native/Libraries/Utilities/binaryToBase64.js' {\n  declare module.exports: $Exports<'react-native/Libraries/Utilities/binaryToBase64'>;\n}\ndeclare module 'react-native/Libraries/Utilities/buildStyleInterpolator.js' {\n  declare module.exports: $Exports<'react-native/Libraries/Utilities/buildStyleInterpolator'>;\n}\ndeclare module 'react-native/Libraries/Utilities/clamp.js' {\n  declare module.exports: $Exports<'react-native/Libraries/Utilities/clamp'>;\n}\ndeclare module 'react-native/Libraries/Utilities/createStrictShapeTypeChecker.js' {\n  declare module.exports: $Exports<'react-native/Libraries/Utilities/createStrictShapeTypeChecker'>;\n}\ndeclare module 'react-native/Libraries/Utilities/deepFreezeAndThrowOnMutationInDev.js' {\n  declare module.exports: $Exports<'react-native/Libraries/Utilities/deepFreezeAndThrowOnMutationInDev'>;\n}\ndeclare module 'react-native/Libraries/Utilities/defineLazyObjectProperty.js' {\n  declare module.exports: $Exports<'react-native/Libraries/Utilities/defineLazyObjectProperty'>;\n}\ndeclare module 'react-native/Libraries/Utilities/deprecatedPropType.js' {\n  declare module.exports: $Exports<'react-native/Libraries/Utilities/deprecatedPropType'>;\n}\ndeclare module 'react-native/Libraries/Utilities/DeviceInfo.js' {\n  declare module.exports: $Exports<'react-native/Libraries/Utilities/DeviceInfo'>;\n}\ndeclare module 'react-native/Libraries/Utilities/differ/deepDiffer.js' {\n  declare module.exports: $Exports<'react-native/Libraries/Utilities/differ/deepDiffer'>;\n}\ndeclare module 'react-native/Libraries/Utilities/differ/insetsDiffer.js' {\n  declare module.exports: $Exports<'react-native/Libraries/Utilities/differ/insetsDiffer'>;\n}\ndeclare module 'react-native/Libraries/Utilities/differ/matricesDiffer.js' {\n  declare module.exports: $Exports<'react-native/Libraries/Utilities/differ/matricesDiffer'>;\n}\ndeclare module 'react-native/Libraries/Utilities/differ/pointsDiffer.js' {\n  declare module.exports: $Exports<'react-native/Libraries/Utilities/differ/pointsDiffer'>;\n}\ndeclare module 'react-native/Libraries/Utilities/differ/sizesDiffer.js' {\n  declare module.exports: $Exports<'react-native/Libraries/Utilities/differ/sizesDiffer'>;\n}\ndeclare module 'react-native/Libraries/Utilities/Dimensions.js' {\n  declare module.exports: $Exports<'react-native/Libraries/Utilities/Dimensions'>;\n}\ndeclare module 'react-native/Libraries/Utilities/dismissKeyboard.js' {\n  declare module.exports: $Exports<'react-native/Libraries/Utilities/dismissKeyboard'>;\n}\ndeclare module 'react-native/Libraries/Utilities/groupByEveryN.js' {\n  declare module.exports: $Exports<'react-native/Libraries/Utilities/groupByEveryN'>;\n}\ndeclare module 'react-native/Libraries/Utilities/HeapCapture.js' {\n  declare module.exports: $Exports<'react-native/Libraries/Utilities/HeapCapture'>;\n}\ndeclare module 'react-native/Libraries/Utilities/HMRClient.js' {\n  declare module.exports: $Exports<'react-native/Libraries/Utilities/HMRClient'>;\n}\ndeclare module 'react-native/Libraries/Utilities/HMRLoadingView.android.js' {\n  declare module.exports: $Exports<'react-native/Libraries/Utilities/HMRLoadingView.android'>;\n}\ndeclare module 'react-native/Libraries/Utilities/HMRLoadingView.ios.js' {\n  declare module.exports: $Exports<'react-native/Libraries/Utilities/HMRLoadingView.ios'>;\n}\ndeclare module 'react-native/Libraries/Utilities/infoLog.js' {\n  declare module.exports: $Exports<'react-native/Libraries/Utilities/infoLog'>;\n}\ndeclare module 'react-native/Libraries/Utilities/JSDevSupportModule.js' {\n  declare module.exports: $Exports<'react-native/Libraries/Utilities/JSDevSupportModule'>;\n}\ndeclare module 'react-native/Libraries/Utilities/logError.js' {\n  declare module.exports: $Exports<'react-native/Libraries/Utilities/logError'>;\n}\ndeclare module 'react-native/Libraries/Utilities/mapWithSeparator.js' {\n  declare module.exports: $Exports<'react-native/Libraries/Utilities/mapWithSeparator'>;\n}\ndeclare module 'react-native/Libraries/Utilities/MatrixMath.js' {\n  declare module.exports: $Exports<'react-native/Libraries/Utilities/MatrixMath'>;\n}\ndeclare module 'react-native/Libraries/Utilities/mergeFast.js' {\n  declare module.exports: $Exports<'react-native/Libraries/Utilities/mergeFast'>;\n}\ndeclare module 'react-native/Libraries/Utilities/mergeIntoFast.js' {\n  declare module.exports: $Exports<'react-native/Libraries/Utilities/mergeIntoFast'>;\n}\ndeclare module 'react-native/Libraries/Utilities/PerformanceLogger.js' {\n  declare module.exports: $Exports<'react-native/Libraries/Utilities/PerformanceLogger'>;\n}\ndeclare module 'react-native/Libraries/Utilities/PixelRatio.js' {\n  declare module.exports: $Exports<'react-native/Libraries/Utilities/PixelRatio'>;\n}\ndeclare module 'react-native/Libraries/Utilities/Platform.android.js' {\n  declare module.exports: $Exports<'react-native/Libraries/Utilities/Platform.android'>;\n}\ndeclare module 'react-native/Libraries/Utilities/Platform.ios.js' {\n  declare module.exports: $Exports<'react-native/Libraries/Utilities/Platform.ios'>;\n}\ndeclare module 'react-native/Libraries/Utilities/PlatformOS.android.js' {\n  declare module.exports: $Exports<'react-native/Libraries/Utilities/PlatformOS.android'>;\n}\ndeclare module 'react-native/Libraries/Utilities/PlatformOS.ios.js' {\n  declare module.exports: $Exports<'react-native/Libraries/Utilities/PlatformOS.ios'>;\n}\ndeclare module 'react-native/Libraries/Utilities/PolyfillFunctions.js' {\n  declare module.exports: $Exports<'react-native/Libraries/Utilities/PolyfillFunctions'>;\n}\ndeclare module 'react-native/Libraries/Utilities/RCTLog.js' {\n  declare module.exports: $Exports<'react-native/Libraries/Utilities/RCTLog'>;\n}\ndeclare module 'react-native/Libraries/Utilities/SceneTracker.js' {\n  declare module.exports: $Exports<'react-native/Libraries/Utilities/SceneTracker'>;\n}\ndeclare module 'react-native/Libraries/Utilities/stringifySafe.js' {\n  declare module.exports: $Exports<'react-native/Libraries/Utilities/stringifySafe'>;\n}\ndeclare module 'react-native/Libraries/Utilities/truncate.js' {\n  declare module.exports: $Exports<'react-native/Libraries/Utilities/truncate'>;\n}\ndeclare module 'react-native/Libraries/vendor/core/_shouldPolyfillES6Collection.js' {\n  declare module.exports: $Exports<'react-native/Libraries/vendor/core/_shouldPolyfillES6Collection'>;\n}\ndeclare module 'react-native/Libraries/vendor/core/ErrorUtils.js' {\n  declare module.exports: $Exports<'react-native/Libraries/vendor/core/ErrorUtils'>;\n}\ndeclare module 'react-native/Libraries/vendor/core/getObjectValues.js' {\n  declare module.exports: $Exports<'react-native/Libraries/vendor/core/getObjectValues'>;\n}\ndeclare module 'react-native/Libraries/vendor/core/guid.js' {\n  declare module.exports: $Exports<'react-native/Libraries/vendor/core/guid'>;\n}\ndeclare module 'react-native/Libraries/vendor/core/isEmpty.js' {\n  declare module.exports: $Exports<'react-native/Libraries/vendor/core/isEmpty'>;\n}\ndeclare module 'react-native/Libraries/vendor/core/Map.js' {\n  declare module.exports: $Exports<'react-native/Libraries/vendor/core/Map'>;\n}\ndeclare module 'react-native/Libraries/vendor/core/merge.js' {\n  declare module.exports: $Exports<'react-native/Libraries/vendor/core/merge'>;\n}\ndeclare module 'react-native/Libraries/vendor/core/mergeHelpers.js' {\n  declare module.exports: $Exports<'react-native/Libraries/vendor/core/mergeHelpers'>;\n}\ndeclare module 'react-native/Libraries/vendor/core/mergeInto.js' {\n  declare module.exports: $Exports<'react-native/Libraries/vendor/core/mergeInto'>;\n}\ndeclare module 'react-native/Libraries/vendor/core/Set.js' {\n  declare module.exports: $Exports<'react-native/Libraries/vendor/core/Set'>;\n}\ndeclare module 'react-native/Libraries/vendor/core/toIterator.js' {\n  declare module.exports: $Exports<'react-native/Libraries/vendor/core/toIterator'>;\n}\ndeclare module 'react-native/Libraries/vendor/document/selection/DocumentSelectionState.js' {\n  declare module.exports: $Exports<'react-native/Libraries/vendor/document/selection/DocumentSelectionState'>;\n}\ndeclare module 'react-native/Libraries/vendor/emitter/EmitterSubscription.js' {\n  declare module.exports: $Exports<'react-native/Libraries/vendor/emitter/EmitterSubscription'>;\n}\ndeclare module 'react-native/Libraries/vendor/emitter/EventEmitter.js' {\n  declare module.exports: $Exports<'react-native/Libraries/vendor/emitter/EventEmitter'>;\n}\ndeclare module 'react-native/Libraries/vendor/emitter/EventEmitterWithHolding.js' {\n  declare module.exports: $Exports<'react-native/Libraries/vendor/emitter/EventEmitterWithHolding'>;\n}\ndeclare module 'react-native/Libraries/vendor/emitter/EventHolder.js' {\n  declare module.exports: $Exports<'react-native/Libraries/vendor/emitter/EventHolder'>;\n}\ndeclare module 'react-native/Libraries/vendor/emitter/EventSubscription.js' {\n  declare module.exports: $Exports<'react-native/Libraries/vendor/emitter/EventSubscription'>;\n}\ndeclare module 'react-native/Libraries/vendor/emitter/EventSubscriptionVendor.js' {\n  declare module.exports: $Exports<'react-native/Libraries/vendor/emitter/EventSubscriptionVendor'>;\n}\ndeclare module 'react-native/Libraries/vendor/emitter/EventValidator.js' {\n  declare module.exports: $Exports<'react-native/Libraries/vendor/emitter/EventValidator'>;\n}\ndeclare module 'react-native/Libraries/vendor/emitter/mixInEventEmitter.js' {\n  declare module.exports: $Exports<'react-native/Libraries/vendor/emitter/mixInEventEmitter'>;\n}\ndeclare module 'react-native/Libraries/Vibration/Vibration.js' {\n  declare module.exports: $Exports<'react-native/Libraries/Vibration/Vibration'>;\n}\ndeclare module 'react-native/Libraries/Vibration/VibrationIOS.android.js' {\n  declare module.exports: $Exports<'react-native/Libraries/Vibration/VibrationIOS.android'>;\n}\ndeclare module 'react-native/Libraries/Vibration/VibrationIOS.ios.js' {\n  declare module.exports: $Exports<'react-native/Libraries/Vibration/VibrationIOS.ios'>;\n}\ndeclare module 'react-native/Libraries/WebSocket/__mocks__/event-target-shim.js' {\n  declare module.exports: $Exports<'react-native/Libraries/WebSocket/__mocks__/event-target-shim'>;\n}\ndeclare module 'react-native/Libraries/WebSocket/WebSocket.js' {\n  declare module.exports: $Exports<'react-native/Libraries/WebSocket/WebSocket'>;\n}\ndeclare module 'react-native/Libraries/WebSocket/WebSocketEvent.js' {\n  declare module.exports: $Exports<'react-native/Libraries/WebSocket/WebSocketEvent'>;\n}\ndeclare module 'react-native/Libraries/WebSocket/WebSocketInterceptor.js' {\n  declare module.exports: $Exports<'react-native/Libraries/WebSocket/WebSocketInterceptor'>;\n}\ndeclare module 'react-native/local-cli/__mocks__/beeper.js' {\n  declare module.exports: $Exports<'react-native/local-cli/__mocks__/beeper'>;\n}\ndeclare module 'react-native/local-cli/__mocks__/fs.js' {\n  declare module.exports: $Exports<'react-native/local-cli/__mocks__/fs'>;\n}\ndeclare module 'react-native/local-cli/bundle/__mocks__/sign.js' {\n  declare module.exports: $Exports<'react-native/local-cli/bundle/__mocks__/sign'>;\n}\ndeclare module 'react-native/local-cli/bundle/assetPathUtils.js' {\n  declare module.exports: $Exports<'react-native/local-cli/bundle/assetPathUtils'>;\n}\ndeclare module 'react-native/local-cli/bundle/buildBundle.js' {\n  declare module.exports: $Exports<'react-native/local-cli/bundle/buildBundle'>;\n}\ndeclare module 'react-native/local-cli/bundle/bundle.js' {\n  declare module.exports: $Exports<'react-native/local-cli/bundle/bundle'>;\n}\ndeclare module 'react-native/local-cli/bundle/bundleCommandLineArgs.js' {\n  declare module.exports: $Exports<'react-native/local-cli/bundle/bundleCommandLineArgs'>;\n}\ndeclare module 'react-native/local-cli/bundle/filterPlatformAssetScales.js' {\n  declare module.exports: $Exports<'react-native/local-cli/bundle/filterPlatformAssetScales'>;\n}\ndeclare module 'react-native/local-cli/bundle/getAssetDestPathAndroid.js' {\n  declare module.exports: $Exports<'react-native/local-cli/bundle/getAssetDestPathAndroid'>;\n}\ndeclare module 'react-native/local-cli/bundle/getAssetDestPathIOS.js' {\n  declare module.exports: $Exports<'react-native/local-cli/bundle/getAssetDestPathIOS'>;\n}\ndeclare module 'react-native/local-cli/bundle/saveAssets.js' {\n  declare module.exports: $Exports<'react-native/local-cli/bundle/saveAssets'>;\n}\ndeclare module 'react-native/local-cli/bundle/types.flow.js' {\n  declare module.exports: $Exports<'react-native/local-cli/bundle/types.flow'>;\n}\ndeclare module 'react-native/local-cli/bundle/unbundle.js' {\n  declare module.exports: $Exports<'react-native/local-cli/bundle/unbundle'>;\n}\ndeclare module 'react-native/local-cli/cli.js' {\n  declare module.exports: $Exports<'react-native/local-cli/cli'>;\n}\ndeclare module 'react-native/local-cli/cliEntry.js' {\n  declare module.exports: $Exports<'react-native/local-cli/cliEntry'>;\n}\ndeclare module 'react-native/local-cli/commands.js' {\n  declare module.exports: $Exports<'react-native/local-cli/commands'>;\n}\ndeclare module 'react-native/local-cli/core/android/findAndroidAppFolder.js' {\n  declare module.exports: $Exports<'react-native/local-cli/core/android/findAndroidAppFolder'>;\n}\ndeclare module 'react-native/local-cli/core/android/findManifest.js' {\n  declare module.exports: $Exports<'react-native/local-cli/core/android/findManifest'>;\n}\ndeclare module 'react-native/local-cli/core/android/findPackageClassName.js' {\n  declare module.exports: $Exports<'react-native/local-cli/core/android/findPackageClassName'>;\n}\ndeclare module 'react-native/local-cli/core/android/index.js' {\n  declare module.exports: $Exports<'react-native/local-cli/core/android/index'>;\n}\ndeclare module 'react-native/local-cli/core/android/readManifest.js' {\n  declare module.exports: $Exports<'react-native/local-cli/core/android/readManifest'>;\n}\ndeclare module 'react-native/local-cli/core/Constants.js' {\n  declare module.exports: $Exports<'react-native/local-cli/core/Constants'>;\n}\ndeclare module 'react-native/local-cli/core/findAssets.js' {\n  declare module.exports: $Exports<'react-native/local-cli/core/findAssets'>;\n}\ndeclare module 'react-native/local-cli/core/findPlugins.js' {\n  declare module.exports: $Exports<'react-native/local-cli/core/findPlugins'>;\n}\ndeclare module 'react-native/local-cli/core/index.js' {\n  declare module.exports: $Exports<'react-native/local-cli/core/index'>;\n}\ndeclare module 'react-native/local-cli/core/ios/findPodfilePath.js' {\n  declare module.exports: $Exports<'react-native/local-cli/core/ios/findPodfilePath'>;\n}\ndeclare module 'react-native/local-cli/core/ios/findPodspecName.js' {\n  declare module.exports: $Exports<'react-native/local-cli/core/ios/findPodspecName'>;\n}\ndeclare module 'react-native/local-cli/core/ios/findProject.js' {\n  declare module.exports: $Exports<'react-native/local-cli/core/ios/findProject'>;\n}\ndeclare module 'react-native/local-cli/core/ios/index.js' {\n  declare module.exports: $Exports<'react-native/local-cli/core/ios/index'>;\n}\ndeclare module 'react-native/local-cli/core/makeCommand.js' {\n  declare module.exports: $Exports<'react-native/local-cli/core/makeCommand'>;\n}\ndeclare module 'react-native/local-cli/core/wrapCommands.js' {\n  declare module.exports: $Exports<'react-native/local-cli/core/wrapCommands'>;\n}\ndeclare module 'react-native/local-cli/dependencies/dependencies.js' {\n  declare module.exports: $Exports<'react-native/local-cli/dependencies/dependencies'>;\n}\ndeclare module 'react-native/local-cli/eject/eject.js' {\n  declare module.exports: $Exports<'react-native/local-cli/eject/eject'>;\n}\ndeclare module 'react-native/local-cli/generator/copyProjectTemplateAndReplace.js' {\n  declare module.exports: $Exports<'react-native/local-cli/generator/copyProjectTemplateAndReplace'>;\n}\ndeclare module 'react-native/local-cli/generator/printRunInstructions.js' {\n  declare module.exports: $Exports<'react-native/local-cli/generator/printRunInstructions'>;\n}\ndeclare module 'react-native/local-cli/generator/promptSync.js' {\n  declare module.exports: $Exports<'react-native/local-cli/generator/promptSync'>;\n}\ndeclare module 'react-native/local-cli/generator/templates.js' {\n  declare module.exports: $Exports<'react-native/local-cli/generator/templates'>;\n}\ndeclare module 'react-native/local-cli/info/info.js' {\n  declare module.exports: $Exports<'react-native/local-cli/info/info'>;\n}\ndeclare module 'react-native/local-cli/init/init.js' {\n  declare module.exports: $Exports<'react-native/local-cli/init/init'>;\n}\ndeclare module 'react-native/local-cli/install/install.js' {\n  declare module.exports: $Exports<'react-native/local-cli/install/install'>;\n}\ndeclare module 'react-native/local-cli/install/uninstall.js' {\n  declare module.exports: $Exports<'react-native/local-cli/install/uninstall'>;\n}\ndeclare module 'react-native/local-cli/library/library.js' {\n  declare module.exports: $Exports<'react-native/local-cli/library/library'>;\n}\ndeclare module 'react-native/local-cli/link/android/copyAssets.js' {\n  declare module.exports: $Exports<'react-native/local-cli/link/android/copyAssets'>;\n}\ndeclare module 'react-native/local-cli/link/android/fs.js' {\n  declare module.exports: $Exports<'react-native/local-cli/link/android/fs'>;\n}\ndeclare module 'react-native/local-cli/link/android/index.js' {\n  declare module.exports: $Exports<'react-native/local-cli/link/android/index'>;\n}\ndeclare module 'react-native/local-cli/link/android/isInstalled.js' {\n  declare module.exports: $Exports<'react-native/local-cli/link/android/isInstalled'>;\n}\ndeclare module 'react-native/local-cli/link/android/patches/applyParams.js' {\n  declare module.exports: $Exports<'react-native/local-cli/link/android/patches/applyParams'>;\n}\ndeclare module 'react-native/local-cli/link/android/patches/applyPatch.js' {\n  declare module.exports: $Exports<'react-native/local-cli/link/android/patches/applyPatch'>;\n}\ndeclare module 'react-native/local-cli/link/android/patches/makeBuildPatch.js' {\n  declare module.exports: $Exports<'react-native/local-cli/link/android/patches/makeBuildPatch'>;\n}\ndeclare module 'react-native/local-cli/link/android/patches/makeImportPatch.js' {\n  declare module.exports: $Exports<'react-native/local-cli/link/android/patches/makeImportPatch'>;\n}\ndeclare module 'react-native/local-cli/link/android/patches/makePackagePatch.js' {\n  declare module.exports: $Exports<'react-native/local-cli/link/android/patches/makePackagePatch'>;\n}\ndeclare module 'react-native/local-cli/link/android/patches/makeSettingsPatch.js' {\n  declare module.exports: $Exports<'react-native/local-cli/link/android/patches/makeSettingsPatch'>;\n}\ndeclare module 'react-native/local-cli/link/android/patches/makeStringsPatch.js' {\n  declare module.exports: $Exports<'react-native/local-cli/link/android/patches/makeStringsPatch'>;\n}\ndeclare module 'react-native/local-cli/link/android/patches/revokePatch.js' {\n  declare module.exports: $Exports<'react-native/local-cli/link/android/patches/revokePatch'>;\n}\ndeclare module 'react-native/local-cli/link/android/registerNativeModule.js' {\n  declare module.exports: $Exports<'react-native/local-cli/link/android/registerNativeModule'>;\n}\ndeclare module 'react-native/local-cli/link/android/unlinkAssets.js' {\n  declare module.exports: $Exports<'react-native/local-cli/link/android/unlinkAssets'>;\n}\ndeclare module 'react-native/local-cli/link/android/unregisterNativeModule.js' {\n  declare module.exports: $Exports<'react-native/local-cli/link/android/unregisterNativeModule'>;\n}\ndeclare module 'react-native/local-cli/link/commandStub.js' {\n  declare module.exports: $Exports<'react-native/local-cli/link/commandStub'>;\n}\ndeclare module 'react-native/local-cli/link/getDependencyConfig.js' {\n  declare module.exports: $Exports<'react-native/local-cli/link/getDependencyConfig'>;\n}\ndeclare module 'react-native/local-cli/link/getProjectDependencies.js' {\n  declare module.exports: $Exports<'react-native/local-cli/link/getProjectDependencies'>;\n}\ndeclare module 'react-native/local-cli/link/groupFilesByType.js' {\n  declare module.exports: $Exports<'react-native/local-cli/link/groupFilesByType'>;\n}\ndeclare module 'react-native/local-cli/link/ios/addFileToProject.js' {\n  declare module.exports: $Exports<'react-native/local-cli/link/ios/addFileToProject'>;\n}\ndeclare module 'react-native/local-cli/link/ios/addProjectToLibraries.js' {\n  declare module.exports: $Exports<'react-native/local-cli/link/ios/addProjectToLibraries'>;\n}\ndeclare module 'react-native/local-cli/link/ios/addSharedLibraries.js' {\n  declare module.exports: $Exports<'react-native/local-cli/link/ios/addSharedLibraries'>;\n}\ndeclare module 'react-native/local-cli/link/ios/addToHeaderSearchPaths.js' {\n  declare module.exports: $Exports<'react-native/local-cli/link/ios/addToHeaderSearchPaths'>;\n}\ndeclare module 'react-native/local-cli/link/ios/common/isInstalled.js' {\n  declare module.exports: $Exports<'react-native/local-cli/link/ios/common/isInstalled'>;\n}\ndeclare module 'react-native/local-cli/link/ios/common/registerNativeModule.js' {\n  declare module.exports: $Exports<'react-native/local-cli/link/ios/common/registerNativeModule'>;\n}\ndeclare module 'react-native/local-cli/link/ios/common/unregisterNativeModule.js' {\n  declare module.exports: $Exports<'react-native/local-cli/link/ios/common/unregisterNativeModule'>;\n}\ndeclare module 'react-native/local-cli/link/ios/copyAssets.js' {\n  declare module.exports: $Exports<'react-native/local-cli/link/ios/copyAssets'>;\n}\ndeclare module 'react-native/local-cli/link/ios/createGroup.js' {\n  declare module.exports: $Exports<'react-native/local-cli/link/ios/createGroup'>;\n}\ndeclare module 'react-native/local-cli/link/ios/createGroupWithMessage.js' {\n  declare module.exports: $Exports<'react-native/local-cli/link/ios/createGroupWithMessage'>;\n}\ndeclare module 'react-native/local-cli/link/ios/getBuildProperty.js' {\n  declare module.exports: $Exports<'react-native/local-cli/link/ios/getBuildProperty'>;\n}\ndeclare module 'react-native/local-cli/link/ios/getGroup.js' {\n  declare module.exports: $Exports<'react-native/local-cli/link/ios/getGroup'>;\n}\ndeclare module 'react-native/local-cli/link/ios/getHeaderSearchPath.js' {\n  declare module.exports: $Exports<'react-native/local-cli/link/ios/getHeaderSearchPath'>;\n}\ndeclare module 'react-native/local-cli/link/ios/getHeadersInFolder.js' {\n  declare module.exports: $Exports<'react-native/local-cli/link/ios/getHeadersInFolder'>;\n}\ndeclare module 'react-native/local-cli/link/ios/getPlist.js' {\n  declare module.exports: $Exports<'react-native/local-cli/link/ios/getPlist'>;\n}\ndeclare module 'react-native/local-cli/link/ios/getPlistPath.js' {\n  declare module.exports: $Exports<'react-native/local-cli/link/ios/getPlistPath'>;\n}\ndeclare module 'react-native/local-cli/link/ios/getProducts.js' {\n  declare module.exports: $Exports<'react-native/local-cli/link/ios/getProducts'>;\n}\ndeclare module 'react-native/local-cli/link/ios/getTargets.js' {\n  declare module.exports: $Exports<'react-native/local-cli/link/ios/getTargets'>;\n}\ndeclare module 'react-native/local-cli/link/ios/hasLibraryImported.js' {\n  declare module.exports: $Exports<'react-native/local-cli/link/ios/hasLibraryImported'>;\n}\ndeclare module 'react-native/local-cli/link/ios/index.js' {\n  declare module.exports: $Exports<'react-native/local-cli/link/ios/index'>;\n}\ndeclare module 'react-native/local-cli/link/ios/isInstalled.js' {\n  declare module.exports: $Exports<'react-native/local-cli/link/ios/isInstalled'>;\n}\ndeclare module 'react-native/local-cli/link/ios/mapHeaderSearchPaths.js' {\n  declare module.exports: $Exports<'react-native/local-cli/link/ios/mapHeaderSearchPaths'>;\n}\ndeclare module 'react-native/local-cli/link/ios/registerNativeModule.js' {\n  declare module.exports: $Exports<'react-native/local-cli/link/ios/registerNativeModule'>;\n}\ndeclare module 'react-native/local-cli/link/ios/removeFromHeaderSearchPaths.js' {\n  declare module.exports: $Exports<'react-native/local-cli/link/ios/removeFromHeaderSearchPaths'>;\n}\ndeclare module 'react-native/local-cli/link/ios/removeFromPbxItemContainerProxySection.js' {\n  declare module.exports: $Exports<'react-native/local-cli/link/ios/removeFromPbxItemContainerProxySection'>;\n}\ndeclare module 'react-native/local-cli/link/ios/removeFromPbxReferenceProxySection.js' {\n  declare module.exports: $Exports<'react-native/local-cli/link/ios/removeFromPbxReferenceProxySection'>;\n}\ndeclare module 'react-native/local-cli/link/ios/removeFromProjectReferences.js' {\n  declare module.exports: $Exports<'react-native/local-cli/link/ios/removeFromProjectReferences'>;\n}\ndeclare module 'react-native/local-cli/link/ios/removeFromStaticLibraries.js' {\n  declare module.exports: $Exports<'react-native/local-cli/link/ios/removeFromStaticLibraries'>;\n}\ndeclare module 'react-native/local-cli/link/ios/removeProductGroup.js' {\n  declare module.exports: $Exports<'react-native/local-cli/link/ios/removeProductGroup'>;\n}\ndeclare module 'react-native/local-cli/link/ios/removeProjectFromLibraries.js' {\n  declare module.exports: $Exports<'react-native/local-cli/link/ios/removeProjectFromLibraries'>;\n}\ndeclare module 'react-native/local-cli/link/ios/removeProjectFromProject.js' {\n  declare module.exports: $Exports<'react-native/local-cli/link/ios/removeProjectFromProject'>;\n}\ndeclare module 'react-native/local-cli/link/ios/removeSharedLibraries.js' {\n  declare module.exports: $Exports<'react-native/local-cli/link/ios/removeSharedLibraries'>;\n}\ndeclare module 'react-native/local-cli/link/ios/unlinkAssets.js' {\n  declare module.exports: $Exports<'react-native/local-cli/link/ios/unlinkAssets'>;\n}\ndeclare module 'react-native/local-cli/link/ios/unregisterNativeModule.js' {\n  declare module.exports: $Exports<'react-native/local-cli/link/ios/unregisterNativeModule'>;\n}\ndeclare module 'react-native/local-cli/link/ios/writePlist.js' {\n  declare module.exports: $Exports<'react-native/local-cli/link/ios/writePlist'>;\n}\ndeclare module 'react-native/local-cli/link/link.js' {\n  declare module.exports: $Exports<'react-native/local-cli/link/link'>;\n}\ndeclare module 'react-native/local-cli/link/pods/addPodEntry.js' {\n  declare module.exports: $Exports<'react-native/local-cli/link/pods/addPodEntry'>;\n}\ndeclare module 'react-native/local-cli/link/pods/findLineToAddPod.js' {\n  declare module.exports: $Exports<'react-native/local-cli/link/pods/findLineToAddPod'>;\n}\ndeclare module 'react-native/local-cli/link/pods/findMarkedLinesInPodfile.js' {\n  declare module.exports: $Exports<'react-native/local-cli/link/pods/findMarkedLinesInPodfile'>;\n}\ndeclare module 'react-native/local-cli/link/pods/findPodTargetLine.js' {\n  declare module.exports: $Exports<'react-native/local-cli/link/pods/findPodTargetLine'>;\n}\ndeclare module 'react-native/local-cli/link/pods/isInstalled.js' {\n  declare module.exports: $Exports<'react-native/local-cli/link/pods/isInstalled'>;\n}\ndeclare module 'react-native/local-cli/link/pods/readPodfile.js' {\n  declare module.exports: $Exports<'react-native/local-cli/link/pods/readPodfile'>;\n}\ndeclare module 'react-native/local-cli/link/pods/registerNativeModule.js' {\n  declare module.exports: $Exports<'react-native/local-cli/link/pods/registerNativeModule'>;\n}\ndeclare module 'react-native/local-cli/link/pods/removePodEntry.js' {\n  declare module.exports: $Exports<'react-native/local-cli/link/pods/removePodEntry'>;\n}\ndeclare module 'react-native/local-cli/link/pods/savePodFile.js' {\n  declare module.exports: $Exports<'react-native/local-cli/link/pods/savePodFile'>;\n}\ndeclare module 'react-native/local-cli/link/pods/unregisterNativeModule.js' {\n  declare module.exports: $Exports<'react-native/local-cli/link/pods/unregisterNativeModule'>;\n}\ndeclare module 'react-native/local-cli/link/pollParams.js' {\n  declare module.exports: $Exports<'react-native/local-cli/link/pollParams'>;\n}\ndeclare module 'react-native/local-cli/link/promiseWaterfall.js' {\n  declare module.exports: $Exports<'react-native/local-cli/link/promiseWaterfall'>;\n}\ndeclare module 'react-native/local-cli/link/promisify.js' {\n  declare module.exports: $Exports<'react-native/local-cli/link/promisify'>;\n}\ndeclare module 'react-native/local-cli/link/unlink.js' {\n  declare module.exports: $Exports<'react-native/local-cli/link/unlink'>;\n}\ndeclare module 'react-native/local-cli/logAndroid/logAndroid.js' {\n  declare module.exports: $Exports<'react-native/local-cli/logAndroid/logAndroid'>;\n}\ndeclare module 'react-native/local-cli/logIOS/logIOS.js' {\n  declare module.exports: $Exports<'react-native/local-cli/logIOS/logIOS'>;\n}\ndeclare module 'react-native/local-cli/runAndroid/adb.js' {\n  declare module.exports: $Exports<'react-native/local-cli/runAndroid/adb'>;\n}\ndeclare module 'react-native/local-cli/runAndroid/runAndroid.js' {\n  declare module.exports: $Exports<'react-native/local-cli/runAndroid/runAndroid'>;\n}\ndeclare module 'react-native/local-cli/runIOS/findMatchingSimulator.js' {\n  declare module.exports: $Exports<'react-native/local-cli/runIOS/findMatchingSimulator'>;\n}\ndeclare module 'react-native/local-cli/runIOS/findXcodeProject.js' {\n  declare module.exports: $Exports<'react-native/local-cli/runIOS/findXcodeProject'>;\n}\ndeclare module 'react-native/local-cli/runIOS/parseIOSDevicesList.js' {\n  declare module.exports: $Exports<'react-native/local-cli/runIOS/parseIOSDevicesList'>;\n}\ndeclare module 'react-native/local-cli/runIOS/runIOS.js' {\n  declare module.exports: $Exports<'react-native/local-cli/runIOS/runIOS'>;\n}\ndeclare module 'react-native/local-cli/server/checkNodeVersion.js' {\n  declare module.exports: $Exports<'react-native/local-cli/server/checkNodeVersion'>;\n}\ndeclare module 'react-native/local-cli/server/middleware/copyToClipBoardMiddleware.js' {\n  declare module.exports: $Exports<'react-native/local-cli/server/middleware/copyToClipBoardMiddleware'>;\n}\ndeclare module 'react-native/local-cli/server/middleware/getDevToolsMiddleware.js' {\n  declare module.exports: $Exports<'react-native/local-cli/server/middleware/getDevToolsMiddleware'>;\n}\ndeclare module 'react-native/local-cli/server/middleware/indexPage.js' {\n  declare module.exports: $Exports<'react-native/local-cli/server/middleware/indexPage'>;\n}\ndeclare module 'react-native/local-cli/server/middleware/loadRawBodyMiddleware.js' {\n  declare module.exports: $Exports<'react-native/local-cli/server/middleware/loadRawBodyMiddleware'>;\n}\ndeclare module 'react-native/local-cli/server/middleware/openStackFrameInEditorMiddleware.js' {\n  declare module.exports: $Exports<'react-native/local-cli/server/middleware/openStackFrameInEditorMiddleware'>;\n}\ndeclare module 'react-native/local-cli/server/middleware/statusPageMiddleware.js' {\n  declare module.exports: $Exports<'react-native/local-cli/server/middleware/statusPageMiddleware'>;\n}\ndeclare module 'react-native/local-cli/server/middleware/systraceProfileMiddleware.js' {\n  declare module.exports: $Exports<'react-native/local-cli/server/middleware/systraceProfileMiddleware'>;\n}\ndeclare module 'react-native/local-cli/server/middleware/unless.js' {\n  declare module.exports: $Exports<'react-native/local-cli/server/middleware/unless'>;\n}\ndeclare module 'react-native/local-cli/server/runServer.js' {\n  declare module.exports: $Exports<'react-native/local-cli/server/runServer'>;\n}\ndeclare module 'react-native/local-cli/server/server.js' {\n  declare module.exports: $Exports<'react-native/local-cli/server/server'>;\n}\ndeclare module 'react-native/local-cli/server/util/attachWebsocketServer.js' {\n  declare module.exports: $Exports<'react-native/local-cli/server/util/attachWebsocketServer'>;\n}\ndeclare module 'react-native/local-cli/server/util/copyToClipBoard.js' {\n  declare module.exports: $Exports<'react-native/local-cli/server/util/copyToClipBoard'>;\n}\ndeclare module 'react-native/local-cli/server/util/debugger-ui/debuggerWorker.js' {\n  declare module.exports: $Exports<'react-native/local-cli/server/util/debugger-ui/debuggerWorker'>;\n}\ndeclare module 'react-native/local-cli/server/util/debugger-ui/DeltaPatcher.js' {\n  declare module.exports: $Exports<'react-native/local-cli/server/util/debugger-ui/DeltaPatcher'>;\n}\ndeclare module 'react-native/local-cli/server/util/debugger-ui/deltaUrlToBlobUrl.js' {\n  declare module.exports: $Exports<'react-native/local-cli/server/util/debugger-ui/deltaUrlToBlobUrl'>;\n}\ndeclare module 'react-native/local-cli/server/util/jsPackagerClient.js' {\n  declare module.exports: $Exports<'react-native/local-cli/server/util/jsPackagerClient'>;\n}\ndeclare module 'react-native/local-cli/server/util/launchChrome.js' {\n  declare module.exports: $Exports<'react-native/local-cli/server/util/launchChrome'>;\n}\ndeclare module 'react-native/local-cli/server/util/launchEditor.js' {\n  declare module.exports: $Exports<'react-native/local-cli/server/util/launchEditor'>;\n}\ndeclare module 'react-native/local-cli/server/util/messageSocket.js' {\n  declare module.exports: $Exports<'react-native/local-cli/server/util/messageSocket'>;\n}\ndeclare module 'react-native/local-cli/server/util/webSocketProxy.js' {\n  declare module.exports: $Exports<'react-native/local-cli/server/util/webSocketProxy'>;\n}\ndeclare module 'react-native/local-cli/templates/HelloNavigation/App.js' {\n  declare module.exports: $Exports<'react-native/local-cli/templates/HelloNavigation/App'>;\n}\ndeclare module 'react-native/local-cli/templates/HelloNavigation/components/KeyboardSpacer.js' {\n  declare module.exports: $Exports<'react-native/local-cli/templates/HelloNavigation/components/KeyboardSpacer'>;\n}\ndeclare module 'react-native/local-cli/templates/HelloNavigation/components/ListItem.js' {\n  declare module.exports: $Exports<'react-native/local-cli/templates/HelloNavigation/components/ListItem'>;\n}\ndeclare module 'react-native/local-cli/templates/HelloNavigation/lib/Backend.js' {\n  declare module.exports: $Exports<'react-native/local-cli/templates/HelloNavigation/lib/Backend'>;\n}\ndeclare module 'react-native/local-cli/templates/HelloNavigation/views/chat/ChatListScreen.js' {\n  declare module.exports: $Exports<'react-native/local-cli/templates/HelloNavigation/views/chat/ChatListScreen'>;\n}\ndeclare module 'react-native/local-cli/templates/HelloNavigation/views/chat/ChatScreen.js' {\n  declare module.exports: $Exports<'react-native/local-cli/templates/HelloNavigation/views/chat/ChatScreen'>;\n}\ndeclare module 'react-native/local-cli/templates/HelloNavigation/views/HomeScreenTabNavigator.js' {\n  declare module.exports: $Exports<'react-native/local-cli/templates/HelloNavigation/views/HomeScreenTabNavigator'>;\n}\ndeclare module 'react-native/local-cli/templates/HelloNavigation/views/welcome/WelcomeScreen.js' {\n  declare module.exports: $Exports<'react-native/local-cli/templates/HelloNavigation/views/welcome/WelcomeScreen'>;\n}\ndeclare module 'react-native/local-cli/templates/HelloNavigation/views/welcome/WelcomeText.android.js' {\n  declare module.exports: $Exports<'react-native/local-cli/templates/HelloNavigation/views/welcome/WelcomeText.android'>;\n}\ndeclare module 'react-native/local-cli/templates/HelloNavigation/views/welcome/WelcomeText.ios.js' {\n  declare module.exports: $Exports<'react-native/local-cli/templates/HelloNavigation/views/welcome/WelcomeText.ios'>;\n}\ndeclare module 'react-native/local-cli/templates/HelloWorld/App.js' {\n  declare module.exports: $Exports<'react-native/local-cli/templates/HelloWorld/App'>;\n}\ndeclare module 'react-native/local-cli/templates/HelloWorld/index.js' {\n  declare module.exports: $Exports<'react-native/local-cli/templates/HelloWorld/index'>;\n}\ndeclare module 'react-native/local-cli/upgrade/upgrade.js' {\n  declare module.exports: $Exports<'react-native/local-cli/upgrade/upgrade'>;\n}\ndeclare module 'react-native/local-cli/util/__mocks__/log.js' {\n  declare module.exports: $Exports<'react-native/local-cli/util/__mocks__/log'>;\n}\ndeclare module 'react-native/local-cli/util/assertRequiredOptions.js' {\n  declare module.exports: $Exports<'react-native/local-cli/util/assertRequiredOptions'>;\n}\ndeclare module 'react-native/local-cli/util/Config.js' {\n  declare module.exports: $Exports<'react-native/local-cli/util/Config'>;\n}\ndeclare module 'react-native/local-cli/util/copyAndReplace.js' {\n  declare module.exports: $Exports<'react-native/local-cli/util/copyAndReplace'>;\n}\ndeclare module 'react-native/local-cli/util/findReactNativeScripts.js' {\n  declare module.exports: $Exports<'react-native/local-cli/util/findReactNativeScripts'>;\n}\ndeclare module 'react-native/local-cli/util/findSymlinkedModules.js' {\n  declare module.exports: $Exports<'react-native/local-cli/util/findSymlinkedModules'>;\n}\ndeclare module 'react-native/local-cli/util/findSymlinksPaths.js' {\n  declare module.exports: $Exports<'react-native/local-cli/util/findSymlinksPaths'>;\n}\ndeclare module 'react-native/local-cli/util/isPackagerRunning.js' {\n  declare module.exports: $Exports<'react-native/local-cli/util/isPackagerRunning'>;\n}\ndeclare module 'react-native/local-cli/util/isValidPackageName.js' {\n  declare module.exports: $Exports<'react-native/local-cli/util/isValidPackageName'>;\n}\ndeclare module 'react-native/local-cli/util/log.js' {\n  declare module.exports: $Exports<'react-native/local-cli/util/log'>;\n}\ndeclare module 'react-native/local-cli/util/PackageManager.js' {\n  declare module.exports: $Exports<'react-native/local-cli/util/PackageManager'>;\n}\ndeclare module 'react-native/local-cli/util/parseCommandLine.js' {\n  declare module.exports: $Exports<'react-native/local-cli/util/parseCommandLine'>;\n}\ndeclare module 'react-native/local-cli/util/walk.js' {\n  declare module.exports: $Exports<'react-native/local-cli/util/walk'>;\n}\ndeclare module 'react-native/local-cli/util/yarn.js' {\n  declare module.exports: $Exports<'react-native/local-cli/util/yarn'>;\n}\ndeclare module 'react-native/local-cli/wrong-react-native.js' {\n  declare module.exports: $Exports<'react-native/local-cli/wrong-react-native'>;\n}\ndeclare module 'react-native/ReactAndroid/src/androidTest/js/Asserts.js' {\n  declare module.exports: $Exports<'react-native/ReactAndroid/src/androidTest/js/Asserts'>;\n}\ndeclare module 'react-native/ReactAndroid/src/androidTest/js/CatalystRootViewTestModule.js' {\n  declare module.exports: $Exports<'react-native/ReactAndroid/src/androidTest/js/CatalystRootViewTestModule'>;\n}\ndeclare module 'react-native/ReactAndroid/src/androidTest/js/DatePickerDialogTestModule.js' {\n  declare module.exports: $Exports<'react-native/ReactAndroid/src/androidTest/js/DatePickerDialogTestModule'>;\n}\ndeclare module 'react-native/ReactAndroid/src/androidTest/js/InitialPropsTestApp.js' {\n  declare module.exports: $Exports<'react-native/ReactAndroid/src/androidTest/js/InitialPropsTestApp'>;\n}\ndeclare module 'react-native/ReactAndroid/src/androidTest/js/JSResponderTestApp.js' {\n  declare module.exports: $Exports<'react-native/ReactAndroid/src/androidTest/js/JSResponderTestApp'>;\n}\ndeclare module 'react-native/ReactAndroid/src/androidTest/js/LayoutEventsTestApp.js' {\n  declare module.exports: $Exports<'react-native/ReactAndroid/src/androidTest/js/LayoutEventsTestApp'>;\n}\ndeclare module 'react-native/ReactAndroid/src/androidTest/js/MeasureLayoutTestModule.js' {\n  declare module.exports: $Exports<'react-native/ReactAndroid/src/androidTest/js/MeasureLayoutTestModule'>;\n}\ndeclare module 'react-native/ReactAndroid/src/androidTest/js/MultitouchHandlingTestAppModule.js' {\n  declare module.exports: $Exports<'react-native/ReactAndroid/src/androidTest/js/MultitouchHandlingTestAppModule'>;\n}\ndeclare module 'react-native/ReactAndroid/src/androidTest/js/NativeIdTestModule.js' {\n  declare module.exports: $Exports<'react-native/ReactAndroid/src/androidTest/js/NativeIdTestModule'>;\n}\ndeclare module 'react-native/ReactAndroid/src/androidTest/js/PickerAndroidTestModule.js' {\n  declare module.exports: $Exports<'react-native/ReactAndroid/src/androidTest/js/PickerAndroidTestModule'>;\n}\ndeclare module 'react-native/ReactAndroid/src/androidTest/js/ProgressBarTestModule.js' {\n  declare module.exports: $Exports<'react-native/ReactAndroid/src/androidTest/js/ProgressBarTestModule'>;\n}\ndeclare module 'react-native/ReactAndroid/src/androidTest/js/ScrollViewTestModule.js' {\n  declare module.exports: $Exports<'react-native/ReactAndroid/src/androidTest/js/ScrollViewTestModule'>;\n}\ndeclare module 'react-native/ReactAndroid/src/androidTest/js/ShareTestModule.js' {\n  declare module.exports: $Exports<'react-native/ReactAndroid/src/androidTest/js/ShareTestModule'>;\n}\ndeclare module 'react-native/ReactAndroid/src/androidTest/js/SubviewsClippingTestModule.js' {\n  declare module.exports: $Exports<'react-native/ReactAndroid/src/androidTest/js/SubviewsClippingTestModule'>;\n}\ndeclare module 'react-native/ReactAndroid/src/androidTest/js/SwipeRefreshLayoutTestModule.js' {\n  declare module.exports: $Exports<'react-native/ReactAndroid/src/androidTest/js/SwipeRefreshLayoutTestModule'>;\n}\ndeclare module 'react-native/ReactAndroid/src/androidTest/js/TestBundle.js' {\n  declare module.exports: $Exports<'react-native/ReactAndroid/src/androidTest/js/TestBundle'>;\n}\ndeclare module 'react-native/ReactAndroid/src/androidTest/js/TestIdTestModule.js' {\n  declare module.exports: $Exports<'react-native/ReactAndroid/src/androidTest/js/TestIdTestModule'>;\n}\ndeclare module 'react-native/ReactAndroid/src/androidTest/js/TestJavaToJSArgumentsModule.js' {\n  declare module.exports: $Exports<'react-native/ReactAndroid/src/androidTest/js/TestJavaToJSArgumentsModule'>;\n}\ndeclare module 'react-native/ReactAndroid/src/androidTest/js/TestJavaToJSReturnValuesModule.js' {\n  declare module.exports: $Exports<'react-native/ReactAndroid/src/androidTest/js/TestJavaToJSReturnValuesModule'>;\n}\ndeclare module 'react-native/ReactAndroid/src/androidTest/js/TestJSLocaleModule.js' {\n  declare module.exports: $Exports<'react-native/ReactAndroid/src/androidTest/js/TestJSLocaleModule'>;\n}\ndeclare module 'react-native/ReactAndroid/src/androidTest/js/TestJSToJavaParametersModule.js' {\n  declare module.exports: $Exports<'react-native/ReactAndroid/src/androidTest/js/TestJSToJavaParametersModule'>;\n}\ndeclare module 'react-native/ReactAndroid/src/androidTest/js/TextInputTestModule.js' {\n  declare module.exports: $Exports<'react-native/ReactAndroid/src/androidTest/js/TextInputTestModule'>;\n}\ndeclare module 'react-native/ReactAndroid/src/androidTest/js/TimePickerDialogTestModule.js' {\n  declare module.exports: $Exports<'react-native/ReactAndroid/src/androidTest/js/TimePickerDialogTestModule'>;\n}\ndeclare module 'react-native/ReactAndroid/src/androidTest/js/TouchBubblingTestAppModule.js' {\n  declare module.exports: $Exports<'react-native/ReactAndroid/src/androidTest/js/TouchBubblingTestAppModule'>;\n}\ndeclare module 'react-native/ReactAndroid/src/androidTest/js/UIManagerTestModule.js' {\n  declare module.exports: $Exports<'react-native/ReactAndroid/src/androidTest/js/UIManagerTestModule'>;\n}\ndeclare module 'react-native/ReactAndroid/src/androidTest/js/ViewRenderingTestModule.js' {\n  declare module.exports: $Exports<'react-native/ReactAndroid/src/androidTest/js/ViewRenderingTestModule'>;\n}\ndeclare module 'react-native/rn-get-polyfills.js' {\n  declare module.exports: $Exports<'react-native/rn-get-polyfills'>;\n}\ndeclare module 'react-native/setupBabel.js' {\n  declare module.exports: $Exports<'react-native/setupBabel'>;\n}\n"
  },
  {
    "path": "flow-typed/npm/react-relay_v1.x.x.js",
    "content": "// flow-typed signature: 809a8a23ed790a6069fbd9e9c47f850b\n// flow-typed version: a80240470a/react-relay_v1.x.x/flow_>=v0.47.x\n\nimport * as React from 'react';\n\ndeclare module \"react-relay\" {\n  declare export type RecordState = \"EXISTENT\" | \"NONEXISTENT\" | \"UNKNOWN\";\n\n  declare export type onCompleted = (\n    response: ?Object,\n    errors: ?Array<PayloadError>\n  ) => void;\n  declare export type onError = (error: Error) => void;\n\n  declare export type CommitOptions = {\n    onCompleted: onCompleted,\n    onError: onError\n  };\n\n  /**\n   * Ideally this would be a union of Field/Fragment/Mutation/Query/Subscription,\n   * but that causes lots of Flow errors.\n   */\n  declare export type ConcreteBatchCallVariable = {\n    jsonPath: string,\n    kind: \"BatchCallVariable\",\n    sourceQueryID: string\n  };\n  declare export type ConcreteCall = {\n    kind: \"Call\",\n    metadata: {\n      type?: ?string\n    },\n    name: string,\n    value: ?ConcreteValue\n  };\n  declare export type ConcreteCallValue = {\n    callValue: mixed,\n    kind: \"CallValue\"\n  };\n  declare export type ConcreteCallVariable = {\n    callVariableName: string,\n    kind: \"CallVariable\"\n  };\n  declare export type ConcreteDirective = {\n    args: Array<ConcreteDirectiveArgument>,\n    kind: \"Directive\",\n    name: string\n  };\n  declare export type ConcreteDirectiveArgument = {\n    name: string,\n    value: ?ConcreteDirectiveValue\n  };\n  declare export type ConcreteDirectiveValue =\n    | ConcreteCallValue\n    | ConcreteCallVariable\n    | Array<ConcreteCallValue | ConcreteCallVariable>;\n  declare export type ConcreteFieldMetadata = {\n    canHaveSubselections?: ?boolean,\n    inferredPrimaryKey?: ?string,\n    inferredRootCallName?: ?string,\n    isAbstract?: boolean,\n    isConnection?: boolean,\n    isConnectionWithoutNodeID?: boolean,\n    isFindable?: boolean,\n    isGenerated?: boolean,\n    isPlural?: boolean,\n    isRequisite?: boolean\n  };\n  declare export type ConcreteFragmentMetadata = {\n    isAbstract?: boolean,\n    pattern?: boolean,\n    plural?: boolean\n  };\n  declare export type ConcreteMutation = {\n    calls: Array<ConcreteCall>,\n    children?: ?Array<?ConcreteSelection>,\n    directives?: ?Array<ConcreteDirective>,\n    kind: \"Mutation\",\n    metadata: {\n      inputType?: ?string\n    },\n    name: string,\n    responseType: string\n  };\n  declare export type ConcreteOperationMetadata = {\n    inputType?: ?string\n  };\n  declare export type ConcreteQuery = {\n    calls?: ?Array<ConcreteCall>,\n    children?: ?Array<?ConcreteSelection>,\n    directives?: ?Array<ConcreteDirective>,\n    fieldName: string,\n    isDeferred?: boolean,\n    kind: \"Query\",\n    metadata: {\n      identifyingArgName?: ?string,\n      identifyingArgType?: ?string,\n      isAbstract?: ?boolean,\n      isPlural?: ?boolean\n    },\n    name: string,\n    type: string\n  };\n  declare export type ConcreteQueryMetadata = {\n    identifyingArgName: ?string,\n    identifyingArgType: ?string,\n    isAbstract: ?boolean,\n    isDeferred: ?boolean,\n    isPlural: ?boolean\n  };\n  declare export type ConcreteSubscription = {\n    calls: Array<ConcreteCall>,\n    children?: ?Array<?ConcreteSelection>,\n    directives?: ?Array<ConcreteDirective>,\n    kind: \"Subscription\",\n    name: string,\n    responseType: string,\n    metadata: {\n      inputType?: ?string\n    }\n  };\n  declare export type ConcreteValue =\n    | ConcreteBatchCallVariable\n    | ConcreteCallValue\n    | ConcreteCallVariable\n    | Array<ConcreteCallValue | ConcreteCallVariable>;\n\n  /**\n   * The output of a graphql-tagged fragment definition.\n   */\n  declare export type ConcreteFragmentDefinition = {\n    kind: \"FragmentDefinition\",\n    argumentDefinitions: Array<ConcreteArgumentDefinition>,\n    node: ConcreteFragment\n  };\n\n  declare export type ConcreteLocalArgumentDefinition = {\n    kind: \"LocalArgument\",\n    name: string,\n    defaultValue: mixed\n  };\n\n  declare export type ConcreteRootArgumentDefinition = {\n    kind: \"RootArgument\",\n    name: string\n  };\n\n  /**\n   * The output of a graphql-tagged operation definition.\n   */\n  declare export type ConcreteOperationDefinition = {\n    kind: \"OperationDefinition\",\n    argumentDefinitions: Array<ConcreteLocalArgumentDefinition>,\n    name: string,\n    operation: \"mutation\" | \"query\" | \"subscription\",\n    node: ConcreteFragment | ConcreteMutation | ConcreteSubscription\n  };\n\n  declare export type ConcreteArgument = ConcreteLiteral | ConcreteVariable;\n  declare export type ConcreteArgumentDefinition =\n    | ConcreteLocalArgument\n    | ConcreteRootArgument;\n  /**\n   * Represents a single ConcreteRoot along with metadata for processing it at\n   * runtime. The persisted `id` (or `text`) can be used to fetch the query,\n   * the `fragment` can be used to read the root data (masking data from child\n   * fragments), and the `query` can be used to normalize server responses.\n   *\n   * NOTE: The use of \"batch\" in the name is intentional, as this wrapper around\n   * the ConcreteRoot will provide a place to store multiple concrete nodes that\n   * are part of the same batch, e.g. in the case of deferred nodes or\n   * for streaming connections that are represented as distinct concrete roots but\n   * are still conceptually tied to one source query.\n   */\n  declare export type ConcreteBatch = {\n    kind: \"Batch\",\n    fragment: ConcreteFragment,\n    id: ?string,\n    metadata: { [key: string]: mixed },\n    name: string,\n    query: ConcreteRoot,\n    text: ?string\n  };\n  declare export type ConcreteCondition = {\n    kind: \"Condition\",\n    passingValue: boolean,\n    condition: string,\n    selections: Array<ConcreteSelection>\n  };\n  declare export type ConcreteField = ConcreteScalarField | ConcreteLinkedField;\n  declare export type ConcreteFragment = {\n    argumentDefinitions: Array<ConcreteArgumentDefinition>,\n    kind: \"Fragment\",\n    metadata: ?{ [key: string]: mixed },\n    name: string,\n    selections: Array<ConcreteSelection>,\n    type: string\n  };\n  declare export type ConcreteFragmentSpread = {\n    args: ?Array<ConcreteArgument>,\n    kind: \"FragmentSpread\",\n    name: string\n  };\n  declare export type ConcreteHandle =\n    | ConcreteScalarHandle\n    | ConcreteLinkedHandle;\n  declare export type ConcreteRootArgument = {\n    kind: \"RootArgument\",\n    name: string,\n    type: ?string\n  };\n  declare export type ConcreteInlineFragment = {\n    kind: \"InlineFragment\",\n    selections: Array<ConcreteSelection>,\n    type: string\n  };\n  declare export type ConcreteLinkedField = {\n    alias: ?string,\n    args: ?Array<ConcreteArgument>,\n    concreteType: ?string,\n    kind: \"LinkedField\",\n    name: string,\n    plural: boolean,\n    selections: Array<ConcreteSelection>,\n    storageKey: ?string\n  };\n  declare export type ConcreteLinkedHandle = {\n    alias: ?string,\n    args: ?Array<ConcreteArgument>,\n    kind: \"LinkedHandle\",\n    name: string,\n    handle: string,\n    key: string,\n    filters: ?Array<string>\n  };\n  declare export type ConcreteLiteral = {\n    kind: \"Literal\",\n    name: string,\n    type: ?string,\n    value: mixed\n  };\n  declare export type ConcreteLocalArgument = {\n    defaultValue: mixed,\n    kind: \"LocalArgument\",\n    name: string,\n    type: string\n  };\n  declare export type ConcreteNode =\n    | ConcreteCondition\n    | ConcreteLinkedField\n    | ConcreteFragment\n    | ConcreteInlineFragment\n    | ConcreteRoot;\n  declare export type ConcreteRoot = {\n    argumentDefinitions: Array<ConcreteLocalArgument>,\n    kind: \"Root\",\n    name: string,\n    operation: \"mutation\" | \"query\" | \"subscription\",\n    selections: Array<ConcreteSelection>\n  };\n  declare export type ConcreteScalarField = {\n    alias: ?string,\n    args: ?Array<ConcreteArgument>,\n    kind: \"ScalarField\",\n    name: string,\n    storageKey: ?string\n  };\n  declare export type ConcreteScalarHandle = {\n    alias: ?string,\n    args: ?Array<ConcreteArgument>,\n    kind: \"ScalarHandle\",\n    name: string,\n    handle: string,\n    key: string,\n    filters: ?Array<string>\n  };\n  declare export type ConcreteSelection =\n    | ConcreteCondition\n    | ConcreteField\n    | ConcreteFragmentSpread\n    | ConcreteHandle\n    | ConcreteInlineFragment;\n  declare export type ConcreteVariable = {\n    kind: \"Variable\",\n    name: string,\n    type: ?string,\n    variableName: string\n  };\n  declare export type ConcreteSelectableNode = ConcreteFragment | ConcreteRoot;\n  declare export type GeneratedNode = ConcreteBatch | ConcreteFragment;\n\n  // The type of a graphql`...` tagged template expression.\n  declare export type GraphQLTaggedNode =\n    | (() => ConcreteFragment | ConcreteBatch)\n    | {\n        modern: () => ConcreteFragment | ConcreteBatch,\n        classic: () => ConcreteFragmentDefinition | ConcreteOperationDefinition\n      };\n\n  declare export function graphql(strings: Array<string>): GraphQLTaggedNode;\n\n  declare export type GeneratedNodeMap = { [key: string]: GraphQLTaggedNode };\n\n  declare export function createFragmentContainer<\n    TBase: React$ComponentType<*>\n  >(\n    Component: TBase,\n    fragmentSpec: GraphQLTaggedNode | GeneratedNodeMap\n  ): TBase;\n\n  declare export function createRefetchContainer<TBase: React$ComponentType<*>>(\n    Component: TBase,\n    fragmentSpec: GraphQLTaggedNode | GeneratedNodeMap,\n    taggedNode: GraphQLTaggedNode\n  ): TBase;\n\n  declare type FragmentVariablesGetter = (\n    prevVars: Variables,\n    totalCount: number\n  ) => Variables;\n\n  declare export type PageInfo = {\n    endCursor: ?string,\n    hasNextPage: boolean,\n    hasPreviousPage: boolean,\n    startCursor: ?string\n  };\n\n  declare export type ConnectionData = {\n    edges?: ?Array<any>,\n    pageInfo?: ?PageInfo\n  };\n\n  declare export type ConnectionConfig = {\n    direction?: \"backward\" | \"forward\",\n    getConnectionFromProps?: (props: Object) => ?ConnectionData,\n    getFragmentVariables?: FragmentVariablesGetter,\n    getVariables: (\n      props: Object,\n      paginationInfo: { count: number, cursor: ?string },\n      fragmentVariables: Variables\n    ) => Variables,\n    query: GraphQLTaggedNode\n  };\n\n  declare export function createPaginationContainer<\n    TBase: React$ComponentType<*>\n  >(\n    Component: TBase,\n    fragmentSpec: GraphQLTaggedNode | GeneratedNodeMap,\n    connectionConfig: ConnectionConfig\n  ): TBase;\n\n  declare type Variable = string | null | boolean | number | Variables | void | Array<Variables>;\n  declare export type Variables = ?{ [string]: Variable };\n  declare export type DataID = string;\n\n  declare type TEnvironment = Environment;\n  declare type TFragment = ConcreteFragment;\n  declare type TGraphQLTaggedNode = GraphQLTaggedNode;\n  declare type TNode = ConcreteSelectableNode;\n  declare export type TOperation = ConcreteBatch;\n  declare type TPayload = RelayResponsePayload;\n\n  declare export type FragmentMap = CFragmentMap<TFragment>;\n  declare export type OperationSelector = COperationSelector<TNode, TOperation>;\n  declare export type RelayContext = CRelayContext<TEnvironment>;\n  declare export type Selector = CSelector<TNode>;\n  declare export type TSnapshot<TRecord> = CSnapshot<TNode, TRecord>;\n  declare export type Snapshot = TSnapshot<Record>;\n  declare export type ProxySnapshot = TSnapshot<RecordProxy>;\n  declare export type UnstableEnvironmentCore = CUnstableEnvironmentCore<\n    TEnvironment,\n    TFragment,\n    TGraphQLTaggedNode,\n    TNode,\n    TOperation\n  >;\n\n  declare export interface IRecordSource<TRecord> {\n    get(dataID: DataID): ?TRecord;\n  }\n\n  /**\n   * A read-only interface for accessing cached graph data.\n   */\n  declare export interface RecordSource extends IRecordSource<Record> {\n    get(dataID: DataID): ?Record;\n\n    getRecordIDs(): Array<DataID>;\n\n    getStatus(dataID: DataID): RecordState;\n\n    has(dataID: DataID): boolean;\n\n    load(\n      dataID: DataID,\n      callback: (error: ?Error, record: ?Record) => void\n    ): void;\n\n    size(): number;\n  }\n\n  /**\n   * A read/write interface for accessing and updating graph data.\n   */\n  declare export interface MutableRecordSource extends RecordSource {\n    clear(): void;\n\n    delete(dataID: DataID): void;\n\n    remove(dataID: DataID): void;\n\n    set(dataID: DataID, record: Record): void;\n  }\n\n  /**\n   * An interface for keeping multiple views of data consistent across an\n   * application.\n   */\n  declare export interface Store {\n    /**\n     * Get a read-only view of the store's internal RecordSource.\n     */\n    getSource(): RecordSource;\n\n    /**\n     * Determine if the selector can be resolved with data in the store (i.e. no\n     * fields are missing).\n     */\n    check(selector: Selector): boolean;\n\n    /**\n     * Read the results of a selector from in-memory records in the store.\n     */\n    lookup(selector: Selector): Snapshot;\n\n    /**\n     * Notify subscribers (see `subscribe`) of any data that was published\n     * (`publish()`) since the last time `notify` was called.\n     */\n    notify(): void;\n\n    /**\n     * Publish new information (e.g. from the network) to the store, updating its\n     * internal record source. Subscribers are not immediately notified - this\n     * occurs when `notify()` is called.\n     */\n    publish(source: RecordSource): void;\n\n    /**\n     * Attempts to load all the records necessary to fulfill the selector into the\n     * target record source.\n     */\n    resolve(\n      target: MutableRecordSource,\n      selector: Selector,\n      callback: AsyncLoadCallback\n    ): void;\n\n    /**\n     * Ensure that all the records necessary to fulfill the given selector are\n     * retained in-memory. The records will not be eligible for garbage collection\n     * until the returned reference is disposed.\n     */\n    retain(selector: Selector): Disposable;\n\n    /**\n     * Subscribe to changes to the results of a selector. The callback is called\n     * when `notify()` is called *and* records have been published that affect the\n     * selector results relative to the last `notify()`.\n     */\n    subscribe(\n      snapshot: Snapshot,\n      callback: (snapshot: Snapshot) => void\n    ): Disposable;\n  }\n\n  /**\n   * An interface for imperatively getting/setting properties of a `Record`. This interface\n   * is designed to allow the appearance of direct Record manipulation while\n   * allowing different implementations that may e.g. create a changeset of\n   * the modifications.\n   */\n  declare export interface RecordProxy {\n    copyFieldsFrom(source: RecordProxy): void;\n\n    getDataID(): DataID;\n\n    getLinkedRecord(name: string, args?: ?Variables): RecordProxy;\n\n    getLinkedRecords(name: string, args?: ?Variables): ?Array<?RecordProxy>;\n\n    getOrCreateLinkedRecord(\n      name: string,\n      typeName: string,\n      args?: ?Variables\n    ): RecordProxy;\n\n    getType(): string;\n\n    getValue(name: string, args?: ?Variables): mixed;\n\n    setLinkedRecord(\n      record: RecordProxy,\n      name: string,\n      args?: ?Variables\n    ): RecordProxy;\n\n    setLinkedRecords(\n      records: Array<?RecordProxy>,\n      name: string,\n      args?: ?Variables\n    ): RecordProxy;\n\n    setValue(value: mixed, name: string, args?: ?Variables): RecordProxy;\n  }\n\n  /**\n   * An interface for imperatively getting/setting properties of a `RecordSource`. This interface\n   * is designed to allow the appearance of direct RecordSource manipulation while\n   * allowing different implementations that may e.g. create a changeset of\n   * the modifications.\n   */\n  declare export interface RecordSourceProxy\n    extends IRecordSource<RecordProxy> {\n    create(dataID: DataID, typeName: string): RecordProxy;\n\n    delete(dataID: DataID): void;\n\n    get(dataID: DataID): ?RecordProxy;\n\n    getRoot(): RecordProxy;\n  }\n\n  /**\n   * Extends the RecordSourceProxy interface with methods for accessing the root\n   * fields of a Selector.\n   */\n  declare export interface RecordSourceSelectorProxy\n    extends IRecordSource<RecordProxy> {\n    create(dataID: DataID, typeName: string): RecordProxy;\n\n    delete(dataID: DataID): void;\n\n    get(dataID: DataID): ?RecordProxy;\n\n    getRoot(): RecordProxy;\n\n    getRootField(fieldName: string): RecordProxy;\n\n    getPluralRootField(fieldName: string): ?Array<?RecordProxy>;\n\n    getResponse(): ?Object;\n  }\n\n  declare export interface IRecordReader<TRecord> {\n    getDataID(record: TRecord): DataID;\n\n    getType(record: TRecord): string;\n\n    getValue(record: TRecord, name: string, args?: ?Variables): mixed;\n\n    getLinkedRecordID(\n      record: TRecord,\n      name: string,\n      args?: ?Variables\n    ): ?DataID;\n\n    getLinkedRecordIDs(\n      record: TRecord,\n      name: string,\n      args?: ?Variables\n    ): ?Array<?DataID>;\n  }\n\n  /**\n   * Settings for how a query response may be cached.\n   *\n   * - `force`: causes a query to be issued unconditionally, irrespective of the\n   *   state of any configured response cache.\n   * - `poll`: causes a query to live update by polling at the specified interval\n   in milliseconds. (This value will be passed to setTimeout.)\n   */\n  declare export type CacheConfig = {\n    force?: ?boolean,\n    poll?: ?number\n  };\n\n  /**\n   * Represents any resource that must be explicitly disposed of. The most common\n   * use-case is as a return value for subscriptions, where calling `dispose()`\n   * would cancel the subscription.\n   */\n  declare export type Disposable = {\n    dispose(): void\n  };\n\n  /**\n   * Arbitrary data e.g. received by a container as props.\n   */\n  declare export type Props = { [key: string]: mixed };\n\n  /*\n   * An individual cached graph object.\n   */\n  declare export type Record = { [key: string]: mixed };\n\n  /**\n   * A collection of records keyed by id.\n   */\n  declare export type RecordMap<T> = { [dataID: DataID]: ?T };\n\n  /**\n   * A selector defines the starting point for a traversal into the graph for the\n   * purposes of targeting a subgraph.\n   */\n  declare export type CSelector<TNode> = {\n    dataID: DataID,\n    node: TNode,\n    variables: Variables\n  };\n\n  /**\n   * A representation of a selector and its results at a particular point in time.\n   */\n  declare export type CSnapshot<TNode, TRecord> = CSelector<TNode> & {\n    data: ?SelectorData,\n    seenRecords: RecordMap<TRecord>\n  };\n\n  /**\n   * The results of a selector given a store/RecordSource.\n   */\n  declare export type SelectorData = { [key: string]: mixed };\n\n  /**\n   * The results of reading the results of a FragmentMap given some input\n   * `Props`.\n   */\n  declare export type FragmentSpecResults = { [key: string]: mixed };\n\n  /**\n   * A utility for resolving and subscribing to the results of a fragment spec\n   * (key -> fragment mapping) given some \"props\" that determine the root ID\n   * and variables to use when reading each fragment. When props are changed via\n   * `setProps()`, the resolver will update its results and subscriptions\n   * accordingly. Internally, the resolver:\n   * - Converts the fragment map & props map into a map of `Selector`s.\n   * - Removes any resolvers for any props that became null.\n   * - Creates resolvers for any props that became non-null.\n   * - Updates resolvers with the latest props.\n   */\n  declare export interface FragmentSpecResolver {\n    /**\n     * Stop watching for changes to the results of the fragments.\n     */\n    dispose(): void;\n\n    /**\n     * Get the current results.\n     */\n    resolve(): FragmentSpecResults;\n\n    /**\n     * Update the resolver with new inputs. Call `resolve()` to get the updated\n     * results.\n     */\n    setProps(props: Props): void;\n\n    /**\n     * Override the variables used to read the results of the fragments. Call\n     * `resolve()` to get the updated results.\n     */\n    setVariables(variables: Variables): void;\n  }\n\n  declare export type CFragmentMap<TFragment> = { [key: string]: TFragment };\n\n  /**\n   * An operation selector describes a specific instance of a GraphQL operation\n   * with variables applied.\n   *\n   * - `root`: a selector intended for processing server results or retaining\n   *   response data in the store.\n   * - `fragment`: a selector intended for use in reading or subscribing to\n   *   the results of the the operation.\n   */\n  declare export type COperationSelector<TNode, TOperation> = {\n    fragment: CSelector<TNode>,\n    node: TOperation,\n    root: CSelector<TNode>,\n    variables: Variables\n  };\n\n  /**\n   * The public API of Relay core. Represents an encapsulated environment with its\n   * own in-memory cache.\n   */\n  declare export interface CEnvironment<\n    TEnvironment,\n    TFragment,\n    TGraphQLTaggedNode,\n    TNode,\n    TOperation,\n    TPayload\n  > {\n    /**\n     * Read the results of a selector from in-memory records in the store.\n     */\n    lookup(selector: CSelector<TNode>): CSnapshot<TNode>;\n\n    /**\n     * Subscribe to changes to the results of a selector. The callback is called\n     * when data has been committed to the store that would cause the results of\n     * the snapshot's selector to change.\n     */\n    subscribe(\n      snapshot: CSnapshot<TNode>,\n      callback: (snapshot: CSnapshot<TNode>) => void\n    ): Disposable;\n\n    /**\n     * Ensure that all the records necessary to fulfill the given selector are\n     * retained in-memory. The records will not be eligible for garbage collection\n     * until the returned reference is disposed.\n     *\n     * Note: This is a no-op in the classic core.\n     */\n    retain(selector: CSelector<TNode>): Disposable;\n\n    /**\n     * Send a query to the server with request/response semantics: the query will\n     * either complete successfully (calling `onNext` and `onCompleted`) or fail\n     * (calling `onError`).\n     *\n     * Note: Most applications should use `streamQuery` in order to\n     * optionally receive updated information over time, should that feature be\n     * supported by the network/server. A good rule of thumb is to use this method\n     * if you would otherwise immediately dispose the `streamQuery()`\n     * after receving the first `onNext` result.\n     */\n    sendQuery(config: {|\n      cacheConfig?: ?CacheConfig,\n      onCompleted?: ?() => void,\n      onError?: ?(error: Error) => void,\n      onNext?: ?(payload: TPayload) => void,\n      operation: COperationSelector<TNode, TOperation>\n    |}): Disposable;\n\n    /**\n     * Send a query to the server with request/subscription semantics: one or more\n     * responses may be returned (via `onNext`) over time followed by either\n     * the request completing (`onCompleted`) or an error (`onError`).\n     *\n     * Networks/servers that support subscriptions may choose to hold the\n     * subscription open indefinitely such that `onCompleted` is not called.\n     */\n    streamQuery(config: {|\n      cacheConfig?: ?CacheConfig,\n      onCompleted?: ?() => void,\n      onError?: ?(error: Error) => void,\n      onNext?: ?(payload: TPayload) => void,\n      operation: COperationSelector<TNode, TOperation>\n    |}): Disposable;\n\n    unstable_internal: CUnstableEnvironmentCore<\n      TEnvironment,\n      TFragment,\n      TGraphQLTaggedNode,\n      TNode,\n      TOperation\n    >;\n  }\n\n  declare export interface CUnstableEnvironmentCore<\n    TEnvironment,\n    TFragment,\n    TGraphQLTaggedNode,\n    TNode,\n    TOperation\n  > {\n    /**\n     * Create an instance of a FragmentSpecResolver.\n     *\n     * TODO: The FragmentSpecResolver *can* be implemented via the other methods\n     * defined here, so this could be moved out of core. It's convenient to have\n     * separate implementations until the experimental core is in OSS.\n     */\n    createFragmentSpecResolver: (\n      context: CRelayContext<TEnvironment>,\n      containerName: string,\n      fragments: CFragmentMap<TFragment>,\n      props: Props,\n      callback: () => void\n    ) => FragmentSpecResolver;\n\n    /**\n     * Creates an instance of an OperationSelector given an operation definition\n     * (see `getOperation`) and the variables to apply. The input variables are\n     * filtered to exclude variables that do not matche defined arguments on the\n     * operation, and default values are populated for null values.\n     */\n    createOperationSelector: (\n      operation: TOperation,\n      variables: Variables\n    ) => COperationSelector<TNode, TOperation>;\n\n    /**\n     * Given a graphql`...` tagged template, extract a fragment definition usable\n     * by this version of Relay core. Throws if the value is not a fragment.\n     */\n    getFragment: (node: TGraphQLTaggedNode) => TFragment;\n\n    /**\n     * Given a graphql`...` tagged template, extract an operation definition\n     * usable by this version of Relay core. Throws if the value is not an\n     * operation.\n     */\n    getOperation: (node: TGraphQLTaggedNode) => TOperation;\n\n    /**\n     * Determine if two selectors are equal (represent the same selection). Note\n     * that this function returns `false` when the two queries/fragments are\n     * different objects, even if they select the same fields.\n     */\n    areEqualSelectors: (a: CSelector<TNode>, b: CSelector<TNode>) => boolean;\n\n    /**\n     * Given the result `item` from a parent that fetched `fragment`, creates a\n     * selector that can be used to read the results of that fragment for that item.\n     *\n     * Example:\n     *\n     * Given two fragments as follows:\n     *\n     * ```\n     * fragment Parent on User {\n   *   id\n   *   ...Child\n   * }\n     * fragment Child on User {\n   *   name\n   * }\n     * ```\n     *\n     * And given some object `parent` that is the results of `Parent` for id \"4\",\n     * the results of `Child` can be accessed by first getting a selector and then\n     * using that selector to `lookup()` the results against the environment:\n     *\n     * ```\n     * const childSelector = getSelector(queryVariables, Child, parent);\n     * const childData = environment.lookup(childSelector).data;\n     * ```\n     */\n    getSelector: (\n      operationVariables: Variables,\n      fragment: TFragment,\n      prop: mixed\n    ) => ?CSelector<TNode>;\n\n    /**\n     * Given the result `items` from a parent that fetched `fragment`, creates a\n     * selector that can be used to read the results of that fragment on those\n     * items. This is similar to `getSelector` but for \"plural\" fragments that\n     * expect an array of results and therefore return an array of selectors.\n     */\n    getSelectorList: (\n      operationVariables: Variables,\n      fragment: TFragment,\n      props: Array<mixed>\n    ) => ?Array<CSelector<TNode>>;\n\n    /**\n     * Given a mapping of keys -> results and a mapping of keys -> fragments,\n     * extracts the selectors for those fragments from the results.\n     *\n     * The canonical use-case for this function are Relay Containers, which\n     * use this function to convert (props, fragments) into selectors so that they\n     * can read the results to pass to the inner component.\n     */\n    getSelectorsFromObject: (\n      operationVariables: Variables,\n      fragments: CFragmentMap<TFragment>,\n      props: Props\n    ) => { [key: string]: ?(CSelector<TNode> | Array<CSelector<TNode>>) };\n\n    /**\n     * Given a mapping of keys -> results and a mapping of keys -> fragments,\n     * extracts a mapping of keys -> id(s) of the results.\n     *\n     * Similar to `getSelectorsFromObject()`, this function can be useful in\n     * determining the \"identity\" of the props passed to a component.\n     */\n    getDataIDsFromObject: (\n      fragments: CFragmentMap<TFragment>,\n      props: Props\n    ) => { [key: string]: ?(DataID | Array<DataID>) };\n\n    /**\n     * Given a mapping of keys -> results and a mapping of keys -> fragments,\n     * extracts the merged variables that would be in scope for those\n     * fragments/results.\n     *\n     * This can be useful in determing what varaibles were used to fetch the data\n     * for a Relay container, for example.\n     */\n    getVariablesFromObject: (\n      operationVariables: Variables,\n      fragments: CFragmentMap<TFragment>,\n      props: Props\n    ) => Variables;\n  }\n\n  /**\n   * The type of the `relay` property set on React context by the React/Relay\n   * integration layer (e.g. QueryRenderer, FragmentContainer, etc).\n   */\n  declare export type CRelayContext<TEnvironment> = {\n    environment: TEnvironment,\n    variables: Variables\n  };\n\n  /**\n   * The public API of Relay core. Represents an encapsulated environment with its\n   * own in-memory cache.\n   */\n  declare export interface Environment\n    extends CEnvironment<\n      TEnvironment,\n      TFragment,\n      TGraphQLTaggedNode,\n      TNode,\n      TOperation,\n      TPayload\n    > {\n    /**\n     * Applies an optimistic mutation to the store without committing it to the\n     * server. The returned Disposable can be used to revert this change at a\n     * later time.\n     */\n    applyMutation(config: {|\n      configs: Array<RelayMutationConfig>,\n      operation: ConcreteOperationDefinition,\n      optimisticResponse: Object,\n      variables: Variables\n    |}): Disposable;\n\n    /**\n     * Applies an optimistic mutation if provided and commits the mutation to the\n     * server. The returned Disposable can be used to bypass the `onCompleted`\n     * and `onError` callbacks when the server response is returned.\n     */\n    sendMutation<ResponseType>(config: {|\n      configs: Array<RelayMutationConfig>,\n      onCompleted?: ?(response: ResponseType) => void,\n      onError?: ?(error: Error) => void,\n      operation: ConcreteOperationDefinition,\n      optimisticOperation?: ?ConcreteOperationDefinition,\n      optimisticResponse?: ?Object,\n      variables: Variables,\n      uploadables?: UploadableMap\n    |}): Disposable;\n  }\n\n  declare export type Observer<T> = {\n    onCompleted?: ?() => void,\n    onError?: ?(error: Error) => void,\n    onNext?: ?(data: T) => void\n  };\n\n  /**\n   * The results of reading data for a fragment. This is similar to a `Selector`,\n   * but references the (fragment) node by name rather than by value.\n   */\n  declare export type FragmentPointer = {\n    __id: DataID,\n    __fragments: { [fragmentName: string]: Variables }\n  };\n\n  /**\n   * A callback for resolving a Selector from a source.\n   */\n  declare export type AsyncLoadCallback = (loadingState: LoadingState) => void;\n  declare export type LoadingState = $Exact<{\n    status: \"aborted\" | \"complete\" | \"error\" | \"missing\",\n    error?: Error\n  }>;\n\n  /**\n   * A map of records affected by an update operation.\n   */\n  declare export type UpdatedRecords = { [dataID: DataID]: boolean };\n\n  /**\n   * A function that updates a store (via a proxy) given the results of a \"handle\"\n   * field payload.\n   */\n  declare export type Handler = {\n    update: (store: RecordSourceProxy, fieldPayload: HandleFieldPayload) => void\n  };\n\n  /**\n   * A payload that is used to initialize or update a \"handle\" field with\n   * information from the server.\n   */\n  declare export type HandleFieldPayload = $Exact<{\n    // The arguments that were fetched.\n    args: Variables,\n    // The __id of the record containing the source/handle field.\n    dataID: DataID,\n    // The (storage) key at which the original server data was written.\n    fieldKey: string,\n    // The name of the handle.\n    handle: string,\n    // The (storage) key at which the handle's data should be written by the\n    // handler.\n    handleKey: string\n  }>;\n\n  /**\n   * A function that receives a proxy over the store and may trigger side-effects\n   * (indirectly) by calling `set*` methods on the store or its record proxies.\n   */\n  declare export type StoreUpdater = (store: RecordSourceProxy) => void;\n\n  /**\n   * Similar to StoreUpdater, but accepts a proxy tied to a specific selector in\n   * order to easily access the root fields of a query/mutation.\n   */\n  declare export type SelectorStoreUpdater = (\n    store: RecordSourceSelectorProxy\n  ) => void;\n\n  declare export type CallValue = ?(\n    | boolean\n    | number\n    | string\n    | { [key: string]: CallValue }\n    | Array<CallValue>);\n\n  declare export type RangeBehaviorsFunction = (connectionArgs: {\n    [argName: string]: CallValue\n  }) =>\n    | \"APPEND\"\n    | \"IGNORE\"\n    | \"PREPEND\"\n    | \"REFETCH\"\n    | \"REMOVE\"\n    | \"NODE_DELETE_HANDLER\"\n    | \"RANGE_ADD_HANDLER\"\n    | \"RANGE_DELETE_HANDLER\"\n    | \"HANDLER_TYPES\"\n    | \"OPTIMISTIC_UPDATE\"\n    | \"SERVER_UPDATE\"\n    | \"POLLER_UPDATE\"\n    | \"UPDATE_TYPES\"\n    | \"RANGE_OPERATIONS\";\n\n  declare export type RangeBehaviorsObject = {\n    [key: string]: \"APPEND\" | \"IGNORE\" | \"PREPEND\" | \"REFETCH\" | \"REMOVE\"\n  };\n\n  declare export type RangeBehaviors =\n    | RangeBehaviorsFunction\n    | RangeBehaviorsObject;\n\n  declare export type RelayConcreteNode = mixed;\n\n  declare export type RelayMutationConfig =\n    | {\n        type: \"FIELDS_CHANGE\",\n        fieldIDs: { [fieldName: string]: DataID | Array<DataID> }\n      }\n    | {\n        type: \"RANGE_ADD\",\n        parentName?: string,\n        parentID?: string,\n        connectionInfo?: Array<{\n          key: string,\n          filters?: Variables,\n          rangeBehavior: string\n        }>,\n        connectionName?: string,\n        edgeName: string,\n        rangeBehaviors?: RangeBehaviors\n      }\n    | {\n        type: \"NODE_DELETE\",\n        parentName?: string,\n        parentID?: string,\n        connectionName?: string,\n        deletedIDFieldName: string\n      }\n    | {\n        type: \"RANGE_DELETE\",\n        parentName?: string,\n        parentID?: string,\n        connectionKeys?: Array<{\n          key: string,\n          filters?: Variables\n        }>,\n        connectionName?: string,\n        deletedIDFieldName: string | Array<string>,\n        pathToConnection: Array<string>\n      }\n    | {\n        type: \"REQUIRED_CHILDREN\",\n        children: Array<RelayConcreteNode>\n      };\n\n  declare export type MutationConfig<T> = {|\n    configs?: Array<RelayMutationConfig>,\n    mutation: GraphQLTaggedNode,\n    variables: Variables,\n    uploadables?: UploadableMap,\n    onCompleted?: ?(response: T, errors: ?Array<PayloadError>) => void,\n    onError?: ?(error: Error) => void,\n    optimisticUpdater?: ?SelectorStoreUpdater,\n    optimisticResponse?: Object,\n    updater?: ?SelectorStoreUpdater\n  |};\n\n  // a.k.a commitRelayModernMutation\n  declare export function commitMutation<T>(\n    environment: Environment,\n    config: MutationConfig<T>\n  ): Disposable;\n\n  declare export type ReadyState = {\n    error: ?Error,\n    props: ?Object,\n    retry: ?() => void\n  };\n\n  /**\n   * Classic environment below here\n   */\n  declare export class RelayQueryFragment {\n    // stub\n  }\n\n  declare export class RelayQueryNode {\n    // stub\n  }\n\n  declare export class RelayQueryRoot {\n    // stub\n  }\n\n  declare export class RelayStoreData {\n    // stub\n  }\n\n  declare export type RelayQuerySet = { [queryName: string]: ?RelayQueryRoot };\n  declare export type ReadyStateChangeCallback = (\n    readyState: ReadyState\n  ) => void;\n  declare export type Abortable = {\n    abort(): void\n  };\n  declare export type StoreReaderData = Object;\n  declare export type StoreReaderOptions = {\n    traverseFragmentReferences?: boolean,\n    traverseGeneratedFields?: boolean\n  };\n  declare export type FragmentResolver = {\n    dispose(): void,\n    resolve(\n      fragment: RelayQueryFragment,\n      dataIDs: DataID | Array<DataID>\n    ): ?(StoreReaderData | Array<?StoreReaderData>)\n  };\n\n  declare export interface RelayEnvironmentInterface {\n    forceFetch(\n      querySet: RelayQuerySet,\n      onReadyStateChange: ReadyStateChangeCallback\n    ): Abortable;\n    getFragmentResolver(\n      fragment: RelayQueryFragment,\n      onNext: () => void\n    ): FragmentResolver;\n    getStoreData(): RelayStoreData;\n    primeCache(\n      querySet: RelayQuerySet,\n      onReadyStateChange: ReadyStateChangeCallback\n    ): Abortable;\n    read(\n      node: RelayQueryNode,\n      dataID: DataID,\n      options?: StoreReaderOptions\n    ): ?StoreReaderData;\n    readQuery(\n      root: RelayQueryRoot,\n      options?: StoreReaderOptions\n    ): Array<?StoreReaderData>;\n  }\n\n  declare export type ClassicEnvironment = RelayEnvironmentInterface;\n\n  declare export class QueryRenderer extends React$Component<{\n    cacheConfig?: ?CacheConfig,\n    environment: Environment | ClassicEnvironment,\n    query: ?GraphQLTaggedNode,\n    render: (readyState: ReadyState) => ?React$Element<*>,\n    variables: Variables\n  }> {}\n\n  // https://github.com/facebook/relay/blob/master/packages/relay-runtime/network/RelayNetworkTypes.js\n  /**\n   * A cache for saving respones to queries (by id) and variables.\n   */\n  declare export interface ResponseCache {\n    get(id: string, variables: Variables): ?QueryPayload;\n    set(id: string, variables: Variables, payload: QueryPayload): void;\n  }\n\n  /**\n   * An interface for fetching the data for one or more (possibly interdependent)\n   * queries.\n   */\n  declare export interface Network {\n    fetch: FetchFunction;\n    request: RequestResponseFunction;\n    requestStream: RequestStreamFunction;\n  }\n\n  declare export type PayloadData = { [key: string]: mixed };\n\n  declare export type PayloadError = {\n    message: string,\n    locations?: Array<{\n      line: number,\n      column: number\n    }>\n  };\n\n  /**\n   * The shape of a GraphQL response as dictated by the\n   * [spec](http://facebook.github.io/graphql/#sec-Response)\n   */\n  declare export type QueryPayload = {|\n    data?: ?PayloadData,\n    errors?: Array<PayloadError>,\n    rerunVariables?: Variables\n  |};\n\n  /**\n   * The shape of data that is returned by the Relay network layer for a given\n   * query.\n   */\n  declare export type RelayResponsePayload = {|\n    fieldPayloads?: ?Array<HandleFieldPayload>,\n    source: MutableRecordSource,\n    errors: ?Array<PayloadError>\n  |};\n\n  declare export type PromiseOrValue<T> = Promise<T> | T | Error;\n\n  /**\n   * A function that executes a GraphQL operation with request/response semantics,\n   * with exactly one raw server response returned\n   */\n  declare export type FetchFunction = (\n    operation: ConcreteBatch,\n    variables: Variables,\n    cacheConfig: ?CacheConfig,\n    uploadables?: UploadableMap\n  ) => PromiseOrValue<QueryPayload>;\n\n  /**\n   * A function that executes a GraphQL operation with request/subscription\n   * semantics, returning one or more raw server responses over time.\n   */\n  declare export type SubscribeFunction = (\n    operation: ConcreteBatch,\n    variables: Variables,\n    cacheConfig: ?CacheConfig,\n    observer: Observer<QueryPayload>\n  ) => Disposable;\n\n  /**\n   * A function that executes a GraphQL operation with request/subscription\n   * semantics, returning one or more responses over time that include the\n   * initial result and optional updates e.g. as the results of the operation\n   * change.\n   */\n  declare export type RequestStreamFunction = (\n    operation: ConcreteBatch,\n    variables: Variables,\n    cacheConfig: ?CacheConfig,\n    observer: Observer<RelayResponsePayload>\n  ) => Disposable;\n\n  /**\n   * A function that executes a GraphQL operation with request/response semantics,\n   * with exactly one response returned.\n   */\n  declare export type RequestResponseFunction = (\n    operation: ConcreteBatch,\n    variables: Variables,\n    cacheConfig?: ?CacheConfig,\n    uploadables?: UploadableMap\n  ) => PromiseOrValue<RelayResponsePayload>;\n\n  declare export type Uploadable = File | Blob;\n  declare export type UploadableMap = { [key: string]: Uploadable };\n\n  declare export type RerunParam = {\n    param: string,\n    import: string,\n    max_runs: number\n  };\n\n  declare export type RelayProp = {\n    environment: Environment\n  };\n\n  declare export type RelayPaginationProp = RelayProp & {\n    hasMore: () => boolean,\n    isLoading: () => boolean,\n    loadMore: (\n      pageSize: number,\n      callback: (error: ?Error) => void,\n      options?: RefetchOptions\n    ) => ?Disposable,\n    refetchConnection: (\n      totalCount: number,\n      callback: (error: ?Error) => void,\n      refetchVariables: ?Variables\n    ) => ?Disposable\n  };\n\n  declare export type RelayRefetchProp = RelayProp & {\n    refetch: (\n      refetchVariables:\n        | Variables\n        | ((fragmentVariables: Variables) => Variables),\n      renderVariables: ?Variables,\n      callback: ?(error: ?Error) => void,\n      options?: RefetchOptions\n    ) => Disposable\n  };\n\n  declare export type RefetchOptions = {\n    force?: boolean,\n    rerunParamExperimental?: RerunParam\n  };\n}\n\ndeclare module \"react-relay/compat\" {\n  declare module.exports: any;\n}\n\ndeclare module \"react-relay/classic\" {\n  declare module.exports: any;\n}\n\ndeclare module 'react-relay/lib/assertFragmentMap' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-relay/lib/buildReactRelayContainer' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-relay/lib/buildRQL' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-relay/lib/callsFromGraphQL' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-relay/lib/callsToGraphQL' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-relay/lib/checkRelayQueryData' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-relay/lib/ConcreteQuery' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-relay/lib/containsRelayQueryRootCall' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-relay/lib/createRelayQuery' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-relay/lib/dedent' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-relay/lib/deepFreeze' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-relay/lib/diffRelayQuery' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-relay/lib/directivesToGraphQL' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-relay/lib/filterExclusiveKeys' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-relay/lib/filterRelayQuery' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-relay/lib/findRelayQueryLeaves' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-relay/lib/flattenRelayQuery' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-relay/lib/flattenSplitRelayQueries' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-relay/lib/ForceRelayClassicContext' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-relay/lib/forEachRootCallArg' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-relay/lib/formatStorageKey' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-relay/lib/fromGraphQL' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-relay/lib/generateClientEdgeID' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-relay/lib/generateClientID' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-relay/lib/generateConcreteFragmentID' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-relay/lib/generateForceIndex' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-relay/lib/generateRQLFieldAlias' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-relay/lib/getRangeBehavior' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-relay/lib/getRelayHandleKey' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-relay/lib/getRelayQueries' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-relay/lib/GraphQLMutatorConstants' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-relay/lib/GraphQLQueryRunner' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-relay/lib/GraphQLRange' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-relay/lib/GraphQLSegment' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-relay/lib/GraphQLStoreChangeEmitter' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-relay/lib/GraphQLStoreQueryResolver' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-relay/lib/GraphQLStoreRangeUtils' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-relay/lib/intersectRelayQuery' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-relay/lib/isClassicRelayContext' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-relay/lib/isClassicRelayEnvironment' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-relay/lib/isCompatibleRelayFragmentType' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-relay/lib/isRelayContainer' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-relay/lib/isRelayContext' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-relay/lib/isRelayEnvironment' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-relay/lib/isRelayModernContext' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-relay/lib/isRelayVariables' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-relay/lib/isScalarAndEqual' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-relay/lib/prettyStringify' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-relay/lib/printRelayOSSQuery' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-relay/lib/printRelayQuery' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-relay/lib/QueryBuilder' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-relay/lib/rangeOperationToMetadataKey' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-relay/lib/ReactRelayClassicExports' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-relay/lib/ReactRelayCompatContainerBuilder' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-relay/lib/ReactRelayCompatPublic' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-relay/lib/ReactRelayContainerProfiler' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-relay/lib/ReactRelayFragmentContainer-flowtest' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-relay/lib/ReactRelayFragmentContainer' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-relay/lib/ReactRelayFragmentMockRenderer' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-relay/lib/ReactRelayPaginationContainer-flowtest' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-relay/lib/ReactRelayPaginationContainer' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-relay/lib/ReactRelayPropTypes' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-relay/lib/ReactRelayPublic' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-relay/lib/ReactRelayQueryRenderer' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-relay/lib/ReactRelayRefetchContainer-flowtest' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-relay/lib/ReactRelayRefetchContainer' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-relay/lib/ReactRelayTypes' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-relay/lib/readRelayQueryData' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-relay/lib/recycleNodesInto' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-relay/lib/RelayCacheProcessor' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-relay/lib/RelayChangeTracker' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-relay/lib/RelayClassicCore' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-relay/lib/RelayClassicRecordState' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-relay/lib/RelayCombinedEnvironmentTypes' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-relay/lib/RelayCompatContainer' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-relay/lib/RelayCompatEnvironment' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-relay/lib/RelayCompatMutations' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-relay/lib/RelayCompatPaginationContainer' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-relay/lib/RelayCompatRefetchContainer' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-relay/lib/RelayCompatTypes' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-relay/lib/RelayConcreteNode' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-relay/lib/RelayConnectionInterface' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-relay/lib/RelayContainer' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-relay/lib/RelayContainerComparators' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-relay/lib/RelayContainerProxy' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-relay/lib/RelayContainerUtils' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-relay/lib/RelayDefaultHandleKey' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-relay/lib/RelayDefaultNetworkLayer' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-relay/lib/RelayEnvironment' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-relay/lib/RelayEnvironmentSerializer' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-relay/lib/RelayEnvironmentTypes' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-relay/lib/RelayError' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-relay/lib/RelayEventStatus' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-relay/lib/RelayFetchMode' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-relay/lib/RelayFragmentPointer' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-relay/lib/RelayFragmentReference' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-relay/lib/RelayFragmentSpecResolver' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-relay/lib/RelayGarbageCollection' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-relay/lib/RelayGarbageCollector' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-relay/lib/RelayGraphQLMutation' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-relay/lib/RelayGraphQLTag' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-relay/lib/RelayInternals' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-relay/lib/RelayInternalTypes' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-relay/lib/RelayMetaRoute' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-relay/lib/RelayMetricsRecorder' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-relay/lib/RelayMockRenderer' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-relay/lib/RelayMutation' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-relay/lib/RelayMutationDebugPrinter' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-relay/lib/RelayMutationQuery' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-relay/lib/RelayMutationQueue' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-relay/lib/RelayMutationRequest' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-relay/lib/RelayMutationTracker' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-relay/lib/RelayMutationTransaction' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-relay/lib/RelayMutationTransactionStatus' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-relay/lib/RelayMutationType' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-relay/lib/RelayNetworkDebug' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-relay/lib/RelayNetworkLayer' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-relay/lib/RelayNodeInterface' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-relay/lib/RelayOperationSelector' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-relay/lib/RelayOptimisticMutationUtils' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-relay/lib/RelayOSSConnectionInterface' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-relay/lib/RelayPendingQueryTracker' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-relay/lib/RelayProfiler' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-relay/lib/RelayPropTypes' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-relay/lib/RelayPublic' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-relay/lib/RelayQL_GENERATED' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-relay/lib/RelayQL' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-relay/lib/RelayQuery' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-relay/lib/RelayQueryCaching' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-relay/lib/RelayQueryConfig' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-relay/lib/RelayQueryPath' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-relay/lib/RelayQueryRequest' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-relay/lib/RelayQueryResultObservable' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-relay/lib/RelayQueryTracker' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-relay/lib/RelayQueryTransform' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-relay/lib/RelayQueryVisitor' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-relay/lib/RelayQueryWriter' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-relay/lib/RelayReadyState' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-relay/lib/RelayReadyStateRenderer' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-relay/lib/RelayRecord' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-relay/lib/RelayRecordStatusMap' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-relay/lib/RelayRecordStore' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-relay/lib/RelayRecordWriter' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-relay/lib/RelayRefQueryDescriptor' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-relay/lib/RelayRenderer' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-relay/lib/RelayRootContainer' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-relay/lib/RelayRoute' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-relay/lib/RelayRouteFragment' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-relay/lib/RelaySelector' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-relay/lib/RelayShallowMock' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-relay/lib/RelayStore' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-relay/lib/RelayStoreConstants' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-relay/lib/RelayStoreData' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-relay/lib/RelayTaskQueue' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-relay/lib/RelayTypes' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-relay/lib/relayUnstableBatchedUpdates' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-relay/lib/relayUnstableBatchedUpdates.native' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-relay/lib/RelayVariable' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-relay/lib/RelayVariables' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-relay/lib/restoreRelayCacheData' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-relay/lib/serializeRelayQueryCall' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-relay/lib/simpleClone' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-relay/lib/splitDeferredRelayQueries' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-relay/lib/stableJSONStringify' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-relay/lib/stableStringify' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-relay/lib/testEditDistance' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-relay/lib/throwFailedPromise' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-relay/lib/toGraphQL' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-relay/lib/transformRelayQueryPayload' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-relay/lib/validateMutationConfig' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-relay/lib/validateRelayReadQuery' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-relay/lib/writeRelayQueryPayload' {\n  declare module.exports: any;\n}\n\ndeclare module 'react-relay/lib/writeRelayUpdatePayload' {\n  declare module.exports: any;\n}\n"
  },
  {
    "path": "flow-typed/npm/regenerator-runtime_vx.x.x.js",
    "content": "// flow-typed signature: 0d8469927dab26c92dbb328e948e2d52\n// flow-typed version: <<STUB>>/regenerator-runtime_v^0.12.0/flow_v0.76.0\n\n/**\n * This is an autogenerated libdef stub for:\n *\n *   'regenerator-runtime'\n *\n * Fill this stub out by replacing all the `any` types.\n *\n * Once filled out, we encourage you to share your work with the\n * community by sending a pull request to:\n * https://github.com/flowtype/flow-typed\n */\n\ndeclare module 'regenerator-runtime' {\n  declare module.exports: any;\n}\n\n/**\n * We include stubs for each file inside this npm package in case you need to\n * require those files directly. Feel free to delete any files that aren't\n * needed.\n */\ndeclare module 'regenerator-runtime/path' {\n  declare module.exports: any;\n}\n\ndeclare module 'regenerator-runtime/runtime-module' {\n  declare module.exports: any;\n}\n\ndeclare module 'regenerator-runtime/runtime' {\n  declare module.exports: any;\n}\n\n// Filename aliases\ndeclare module 'regenerator-runtime/path.js' {\n  declare module.exports: $Exports<'regenerator-runtime/path'>;\n}\ndeclare module 'regenerator-runtime/runtime-module.js' {\n  declare module.exports: $Exports<'regenerator-runtime/runtime-module'>;\n}\ndeclare module 'regenerator-runtime/runtime.js' {\n  declare module.exports: $Exports<'regenerator-runtime/runtime'>;\n}\n"
  },
  {
    "path": "flow-typed/npm/remap-istanbul_vx.x.x.js",
    "content": "// flow-typed signature: 0c39de8d00cd92cd710b4ccf6c1dbeec\n// flow-typed version: <<STUB>>/remap-istanbul_v^0.9.1/flow_v0.76.0\n\n/**\n * This is an autogenerated libdef stub for:\n *\n *   'remap-istanbul'\n *\n * Fill this stub out by replacing all the `any` types.\n *\n * Once filled out, we encourage you to share your work with the\n * community by sending a pull request to:\n * https://github.com/flowtype/flow-typed\n */\n\ndeclare module 'remap-istanbul' {\n  declare module.exports: any;\n}\n\n/**\n * We include stubs for each file inside this npm package in case you need to\n * require those files directly. Feel free to delete any files that aren't\n * needed.\n */\ndeclare module 'remap-istanbul/babel-plugin/amd-define' {\n  declare module.exports: any;\n}\n\ndeclare module 'remap-istanbul/babel-plugin/module-exports' {\n  declare module.exports: any;\n}\n\ndeclare module 'remap-istanbul/bin/remap-istanbul' {\n  declare module.exports: any;\n}\n\ndeclare module 'remap-istanbul/lib/checkThreshold' {\n  declare module.exports: any;\n}\n\ndeclare module 'remap-istanbul/lib/CoverageTransformer' {\n  declare module.exports: any;\n}\n\ndeclare module 'remap-istanbul/lib/getMapping' {\n  declare module.exports: any;\n}\n\ndeclare module 'remap-istanbul/lib/gruntRemapIstanbul' {\n  declare module.exports: any;\n}\n\ndeclare module 'remap-istanbul/lib/gulpRemapIstanbul' {\n  declare module.exports: any;\n}\n\ndeclare module 'remap-istanbul/lib/intern-reporters/JsonCoverage' {\n  declare module.exports: any;\n}\n\ndeclare module 'remap-istanbul/lib/loadCoverage' {\n  declare module.exports: any;\n}\n\ndeclare module 'remap-istanbul/lib/main' {\n  declare module.exports: any;\n}\n\ndeclare module 'remap-istanbul/lib/remap' {\n  declare module.exports: any;\n}\n\ndeclare module 'remap-istanbul/lib/remapBranch' {\n  declare module.exports: any;\n}\n\ndeclare module 'remap-istanbul/lib/remapFunction' {\n  declare module.exports: any;\n}\n\ndeclare module 'remap-istanbul/lib/SparceCoverageCollector' {\n  declare module.exports: any;\n}\n\ndeclare module 'remap-istanbul/lib/writeReport' {\n  declare module.exports: any;\n}\n\ndeclare module 'remap-istanbul/src/checkThreshold' {\n  declare module.exports: any;\n}\n\ndeclare module 'remap-istanbul/src/CoverageTransformer' {\n  declare module.exports: any;\n}\n\ndeclare module 'remap-istanbul/src/getMapping' {\n  declare module.exports: any;\n}\n\ndeclare module 'remap-istanbul/src/gruntRemapIstanbul' {\n  declare module.exports: any;\n}\n\ndeclare module 'remap-istanbul/src/gulpRemapIstanbul' {\n  declare module.exports: any;\n}\n\ndeclare module 'remap-istanbul/src/intern-reporters/JsonCoverage' {\n  declare module.exports: any;\n}\n\ndeclare module 'remap-istanbul/src/loadCoverage' {\n  declare module.exports: any;\n}\n\ndeclare module 'remap-istanbul/src/main' {\n  declare module.exports: any;\n}\n\ndeclare module 'remap-istanbul/src/remap' {\n  declare module.exports: any;\n}\n\ndeclare module 'remap-istanbul/src/remapBranch' {\n  declare module.exports: any;\n}\n\ndeclare module 'remap-istanbul/src/remapFunction' {\n  declare module.exports: any;\n}\n\ndeclare module 'remap-istanbul/src/SparceCoverageCollector' {\n  declare module.exports: any;\n}\n\ndeclare module 'remap-istanbul/src/writeReport' {\n  declare module.exports: any;\n}\n\ndeclare module 'remap-istanbul/tasks/remapIstanbul' {\n  declare module.exports: any;\n}\n\ndeclare module 'remap-istanbul/utils/node' {\n  declare module.exports: any;\n}\n\n// Filename aliases\ndeclare module 'remap-istanbul/babel-plugin/amd-define.js' {\n  declare module.exports: $Exports<'remap-istanbul/babel-plugin/amd-define'>;\n}\ndeclare module 'remap-istanbul/babel-plugin/module-exports.js' {\n  declare module.exports: $Exports<'remap-istanbul/babel-plugin/module-exports'>;\n}\ndeclare module 'remap-istanbul/bin/remap-istanbul.js' {\n  declare module.exports: $Exports<'remap-istanbul/bin/remap-istanbul'>;\n}\ndeclare module 'remap-istanbul/lib/checkThreshold.js' {\n  declare module.exports: $Exports<'remap-istanbul/lib/checkThreshold'>;\n}\ndeclare module 'remap-istanbul/lib/CoverageTransformer.js' {\n  declare module.exports: $Exports<'remap-istanbul/lib/CoverageTransformer'>;\n}\ndeclare module 'remap-istanbul/lib/getMapping.js' {\n  declare module.exports: $Exports<'remap-istanbul/lib/getMapping'>;\n}\ndeclare module 'remap-istanbul/lib/gruntRemapIstanbul.js' {\n  declare module.exports: $Exports<'remap-istanbul/lib/gruntRemapIstanbul'>;\n}\ndeclare module 'remap-istanbul/lib/gulpRemapIstanbul.js' {\n  declare module.exports: $Exports<'remap-istanbul/lib/gulpRemapIstanbul'>;\n}\ndeclare module 'remap-istanbul/lib/intern-reporters/JsonCoverage.js' {\n  declare module.exports: $Exports<'remap-istanbul/lib/intern-reporters/JsonCoverage'>;\n}\ndeclare module 'remap-istanbul/lib/loadCoverage.js' {\n  declare module.exports: $Exports<'remap-istanbul/lib/loadCoverage'>;\n}\ndeclare module 'remap-istanbul/lib/main.js' {\n  declare module.exports: $Exports<'remap-istanbul/lib/main'>;\n}\ndeclare module 'remap-istanbul/lib/remap.js' {\n  declare module.exports: $Exports<'remap-istanbul/lib/remap'>;\n}\ndeclare module 'remap-istanbul/lib/remapBranch.js' {\n  declare module.exports: $Exports<'remap-istanbul/lib/remapBranch'>;\n}\ndeclare module 'remap-istanbul/lib/remapFunction.js' {\n  declare module.exports: $Exports<'remap-istanbul/lib/remapFunction'>;\n}\ndeclare module 'remap-istanbul/lib/SparceCoverageCollector.js' {\n  declare module.exports: $Exports<'remap-istanbul/lib/SparceCoverageCollector'>;\n}\ndeclare module 'remap-istanbul/lib/writeReport.js' {\n  declare module.exports: $Exports<'remap-istanbul/lib/writeReport'>;\n}\ndeclare module 'remap-istanbul/src/checkThreshold.js' {\n  declare module.exports: $Exports<'remap-istanbul/src/checkThreshold'>;\n}\ndeclare module 'remap-istanbul/src/CoverageTransformer.js' {\n  declare module.exports: $Exports<'remap-istanbul/src/CoverageTransformer'>;\n}\ndeclare module 'remap-istanbul/src/getMapping.js' {\n  declare module.exports: $Exports<'remap-istanbul/src/getMapping'>;\n}\ndeclare module 'remap-istanbul/src/gruntRemapIstanbul.js' {\n  declare module.exports: $Exports<'remap-istanbul/src/gruntRemapIstanbul'>;\n}\ndeclare module 'remap-istanbul/src/gulpRemapIstanbul.js' {\n  declare module.exports: $Exports<'remap-istanbul/src/gulpRemapIstanbul'>;\n}\ndeclare module 'remap-istanbul/src/intern-reporters/JsonCoverage.js' {\n  declare module.exports: $Exports<'remap-istanbul/src/intern-reporters/JsonCoverage'>;\n}\ndeclare module 'remap-istanbul/src/loadCoverage.js' {\n  declare module.exports: $Exports<'remap-istanbul/src/loadCoverage'>;\n}\ndeclare module 'remap-istanbul/src/main.js' {\n  declare module.exports: $Exports<'remap-istanbul/src/main'>;\n}\ndeclare module 'remap-istanbul/src/remap.js' {\n  declare module.exports: $Exports<'remap-istanbul/src/remap'>;\n}\ndeclare module 'remap-istanbul/src/remapBranch.js' {\n  declare module.exports: $Exports<'remap-istanbul/src/remapBranch'>;\n}\ndeclare module 'remap-istanbul/src/remapFunction.js' {\n  declare module.exports: $Exports<'remap-istanbul/src/remapFunction'>;\n}\ndeclare module 'remap-istanbul/src/SparceCoverageCollector.js' {\n  declare module.exports: $Exports<'remap-istanbul/src/SparceCoverageCollector'>;\n}\ndeclare module 'remap-istanbul/src/writeReport.js' {\n  declare module.exports: $Exports<'remap-istanbul/src/writeReport'>;\n}\ndeclare module 'remap-istanbul/tasks/remapIstanbul.js' {\n  declare module.exports: $Exports<'remap-istanbul/tasks/remapIstanbul'>;\n}\ndeclare module 'remap-istanbul/utils/node.js' {\n  declare module.exports: $Exports<'remap-istanbul/utils/node'>;\n}\n"
  },
  {
    "path": "flow-typed/npm/repeating_vx.x.x.js",
    "content": "// flow-typed signature: 8c6ca2ba2615a25ac1e943c7cffaca9d\n// flow-typed version: <<STUB>>/repeating_v^2.0.0/flow_v0.38.0\n\n/**\n * This is an autogenerated libdef stub for:\n *\n *   'repeating'\n *\n * Fill this stub out by replacing all the `any` types.\n *\n * Once filled out, we encourage you to share your work with the \n * community by sending a pull request to: \n * https://github.com/flowtype/flow-typed\n */\n\ndeclare module 'repeating' {\n  declare module.exports: any;\n}\n\n/**\n * We include stubs for each file inside this npm package in case you need to\n * require those files directly. Feel free to delete any files that aren't\n * needed.\n */\n\n\n// Filename aliases\ndeclare module 'repeating/index' {\n  declare module.exports: $Exports<'repeating'>;\n}\ndeclare module 'repeating/index.js' {\n  declare module.exports: $Exports<'repeating'>;\n}\n"
  },
  {
    "path": "flow-typed/npm/seedrandom_vx.x.x.js",
    "content": "// flow-typed signature: 9376a5dd476c84a27a9865d751aaf7fa\n// flow-typed version: <<STUB>>/seedrandom_v^2.4.2/flow_v0.76.0\n\n/**\n * This is an autogenerated libdef stub for:\n *\n *   'seedrandom'\n *\n * Fill this stub out by replacing all the `any` types.\n *\n * Once filled out, we encourage you to share your work with the\n * community by sending a pull request to:\n * https://github.com/flowtype/flow-typed\n */\n\ndeclare module 'seedrandom' {\n  declare module.exports: any;\n}\n\n/**\n * We include stubs for each file inside this npm package in case you need to\n * require those files directly. Feel free to delete any files that aren't\n * needed.\n */\ndeclare module 'seedrandom/Gruntfile' {\n  declare module.exports: any;\n}\n\ndeclare module 'seedrandom/lib/alea' {\n  declare module.exports: any;\n}\n\ndeclare module 'seedrandom/lib/alea.min' {\n  declare module.exports: any;\n}\n\ndeclare module 'seedrandom/lib/crypto' {\n  declare module.exports: any;\n}\n\ndeclare module 'seedrandom/lib/tychei' {\n  declare module.exports: any;\n}\n\ndeclare module 'seedrandom/lib/tychei.min' {\n  declare module.exports: any;\n}\n\ndeclare module 'seedrandom/lib/xor128' {\n  declare module.exports: any;\n}\n\ndeclare module 'seedrandom/lib/xor128.min' {\n  declare module.exports: any;\n}\n\ndeclare module 'seedrandom/lib/xor4096' {\n  declare module.exports: any;\n}\n\ndeclare module 'seedrandom/lib/xor4096.min' {\n  declare module.exports: any;\n}\n\ndeclare module 'seedrandom/lib/xorshift7' {\n  declare module.exports: any;\n}\n\ndeclare module 'seedrandom/lib/xorshift7.min' {\n  declare module.exports: any;\n}\n\ndeclare module 'seedrandom/lib/xorwow' {\n  declare module.exports: any;\n}\n\ndeclare module 'seedrandom/lib/xorwow.min' {\n  declare module.exports: any;\n}\n\ndeclare module 'seedrandom/seedrandom' {\n  declare module.exports: any;\n}\n\ndeclare module 'seedrandom/seedrandom.min' {\n  declare module.exports: any;\n}\n\ndeclare module 'seedrandom/test/bitgen' {\n  declare module.exports: any;\n}\n\ndeclare module 'seedrandom/test/browserified' {\n  declare module.exports: any;\n}\n\ndeclare module 'seedrandom/test/cryptotest' {\n  declare module.exports: any;\n}\n\ndeclare module 'seedrandom/test/lib/qunit' {\n  declare module.exports: any;\n}\n\ndeclare module 'seedrandom/test/lib/require' {\n  declare module.exports: any;\n}\n\ndeclare module 'seedrandom/test/nodetest' {\n  declare module.exports: any;\n}\n\ndeclare module 'seedrandom/test/prngtest' {\n  declare module.exports: any;\n}\n\ndeclare module 'seedrandom/test/qunitassert' {\n  declare module.exports: any;\n}\n\n// Filename aliases\ndeclare module 'seedrandom/Gruntfile.js' {\n  declare module.exports: $Exports<'seedrandom/Gruntfile'>;\n}\ndeclare module 'seedrandom/index' {\n  declare module.exports: $Exports<'seedrandom'>;\n}\ndeclare module 'seedrandom/index.js' {\n  declare module.exports: $Exports<'seedrandom'>;\n}\ndeclare module 'seedrandom/lib/alea.js' {\n  declare module.exports: $Exports<'seedrandom/lib/alea'>;\n}\ndeclare module 'seedrandom/lib/alea.min.js' {\n  declare module.exports: $Exports<'seedrandom/lib/alea.min'>;\n}\ndeclare module 'seedrandom/lib/crypto.js' {\n  declare module.exports: $Exports<'seedrandom/lib/crypto'>;\n}\ndeclare module 'seedrandom/lib/tychei.js' {\n  declare module.exports: $Exports<'seedrandom/lib/tychei'>;\n}\ndeclare module 'seedrandom/lib/tychei.min.js' {\n  declare module.exports: $Exports<'seedrandom/lib/tychei.min'>;\n}\ndeclare module 'seedrandom/lib/xor128.js' {\n  declare module.exports: $Exports<'seedrandom/lib/xor128'>;\n}\ndeclare module 'seedrandom/lib/xor128.min.js' {\n  declare module.exports: $Exports<'seedrandom/lib/xor128.min'>;\n}\ndeclare module 'seedrandom/lib/xor4096.js' {\n  declare module.exports: $Exports<'seedrandom/lib/xor4096'>;\n}\ndeclare module 'seedrandom/lib/xor4096.min.js' {\n  declare module.exports: $Exports<'seedrandom/lib/xor4096.min'>;\n}\ndeclare module 'seedrandom/lib/xorshift7.js' {\n  declare module.exports: $Exports<'seedrandom/lib/xorshift7'>;\n}\ndeclare module 'seedrandom/lib/xorshift7.min.js' {\n  declare module.exports: $Exports<'seedrandom/lib/xorshift7.min'>;\n}\ndeclare module 'seedrandom/lib/xorwow.js' {\n  declare module.exports: $Exports<'seedrandom/lib/xorwow'>;\n}\ndeclare module 'seedrandom/lib/xorwow.min.js' {\n  declare module.exports: $Exports<'seedrandom/lib/xorwow.min'>;\n}\ndeclare module 'seedrandom/seedrandom.js' {\n  declare module.exports: $Exports<'seedrandom/seedrandom'>;\n}\ndeclare module 'seedrandom/seedrandom.min.js' {\n  declare module.exports: $Exports<'seedrandom/seedrandom.min'>;\n}\ndeclare module 'seedrandom/test/bitgen.js' {\n  declare module.exports: $Exports<'seedrandom/test/bitgen'>;\n}\ndeclare module 'seedrandom/test/browserified.js' {\n  declare module.exports: $Exports<'seedrandom/test/browserified'>;\n}\ndeclare module 'seedrandom/test/cryptotest.js' {\n  declare module.exports: $Exports<'seedrandom/test/cryptotest'>;\n}\ndeclare module 'seedrandom/test/lib/qunit.js' {\n  declare module.exports: $Exports<'seedrandom/test/lib/qunit'>;\n}\ndeclare module 'seedrandom/test/lib/require.js' {\n  declare module.exports: $Exports<'seedrandom/test/lib/require'>;\n}\ndeclare module 'seedrandom/test/nodetest.js' {\n  declare module.exports: $Exports<'seedrandom/test/nodetest'>;\n}\ndeclare module 'seedrandom/test/prngtest.js' {\n  declare module.exports: $Exports<'seedrandom/test/prngtest'>;\n}\ndeclare module 'seedrandom/test/qunitassert.js' {\n  declare module.exports: $Exports<'seedrandom/test/qunitassert'>;\n}\n"
  },
  {
    "path": "flow-typed/npm/source-map-support_vx.x.x.js",
    "content": "// flow-typed signature: aa22e0c7679ebbb46325d310723b282e\n// flow-typed version: <<STUB>>/source-map-support_v^0.4.6/flow_v0.76.0\n\n/**\n * This is an autogenerated libdef stub for:\n *\n *   'source-map-support'\n *\n * Fill this stub out by replacing all the `any` types.\n *\n * Once filled out, we encourage you to share your work with the\n * community by sending a pull request to:\n * https://github.com/flowtype/flow-typed\n */\n\ndeclare module 'source-map-support' {\n  declare module.exports: any;\n}\n\n/**\n * We include stubs for each file inside this npm package in case you need to\n * require those files directly. Feel free to delete any files that aren't\n * needed.\n */\ndeclare module 'source-map-support/browser-source-map-support' {\n  declare module.exports: any;\n}\n\ndeclare module 'source-map-support/register' {\n  declare module.exports: any;\n}\n\ndeclare module 'source-map-support/source-map-support' {\n  declare module.exports: any;\n}\n\n// Filename aliases\ndeclare module 'source-map-support/browser-source-map-support.js' {\n  declare module.exports: $Exports<'source-map-support/browser-source-map-support'>;\n}\ndeclare module 'source-map-support/register.js' {\n  declare module.exports: $Exports<'source-map-support/register'>;\n}\ndeclare module 'source-map-support/source-map-support.js' {\n  declare module.exports: $Exports<'source-map-support/source-map-support'>;\n}\n"
  },
  {
    "path": "flow-typed/npm/source-map_vx.x.x.js",
    "content": "// flow-typed signature: 36b5a181ae05a516a711d68a54030532\n// flow-typed version: <<STUB>>/source-map_v^0.5.6/flow_v0.76.0\n\n/**\n * This is an autogenerated libdef stub for:\n *\n *   'source-map'\n *\n * Fill this stub out by replacing all the `any` types.\n *\n * Once filled out, we encourage you to share your work with the\n * community by sending a pull request to:\n * https://github.com/flowtype/flow-typed\n */\n\ndeclare module 'source-map' {\n  // Adapted from https://raw.githubusercontent.com/mozilla/source-map/c73baa52dedcbb77af97d90390d9def4d594c75f/source-map.d.ts\n\n  // Type definitions for source-map\n  // Project: https://github.com/mozilla/source-map\n  // Definitions by: Morten Houston Ludvigsen <https://github.com/MortenHoustonLudvigsen>,\n  //                 Ron Buckton <https://github.com/rbuckton>,\n  //                 John Vilk <https://github.com/jvilk>\n  // Definitions: https://github.com/mozilla/source-map\n  declare type SourceMapUrl = string;\n\n  declare interface Position {\n      line: number;\n      column: number;\n  }\n\n  declare interface NullablePosition {\n      line: number | null;\n      column: number | null;\n      lastColumn: number | null;\n  }\n\n  declare interface MappedPosition {\n      source: string;\n      line: number;\n      column: number;\n      name?: string;\n  }\n\n  declare interface NullableMappedPosition {\n      source: string | null;\n      line: number | null;\n      column: number | null;\n      name: string | null;\n  }\n\n  declare interface MappingItem {\n      source: string;\n      generatedLine: number;\n      generatedColumn: number;\n      originalLine: number;\n      originalColumn: number;\n      name: string;\n  }\n\n  declare interface Mapping {\n      generated: Position;\n      original: Position;\n      source: string;\n      name?: string;\n  }\n\n  declare class SourceMapConsumer {\n      constructor (rawSourceMap: string, sourceMapUrl?: SourceMapUrl): void;\n\n      /**\n       * Compute the last column for each generated mapping. The last column is\n       * inclusive.\n       */\n      computeColumnSpans(): void;\n\n      /**\n       * Returns the original source, line, and column information for the generated\n       * source's line and column positions provided. The only argument is an object\n       * with the following properties:\n       *\n       *   - line: The line number in the generated source.\n       *   - column: The column number in the generated source.\n       *   - bias: Either 'SourceMapConsumer.GREATEST_LOWER_BOUND' or\n       *     'SourceMapConsumer.LEAST_UPPER_BOUND'. Specifies whether to return the\n       *     closest element that is smaller than or greater than the one we are\n       *     searching for, respectively, if the exact element cannot be found.\n       *     Defaults to 'SourceMapConsumer.GREATEST_LOWER_BOUND'.\n       *\n       * and an object is returned with the following properties:\n       *\n       *   - source: The original source file, or null.\n       *   - line: The line number in the original source, or null.\n       *   - column: The column number in the original source, or null.\n       *   - name: The original identifier, or null.\n       */\n      originalPositionFor(generatedPosition: Position & { bias?: number }): NullableMappedPosition;\n\n      /**\n       * Returns the generated line and column information for the original source,\n       * line, and column positions provided. The only argument is an object with\n       * the following properties:\n       *\n       *   - source: The filename of the original source.\n       *   - line: The line number in the original source.\n       *   - column: The column number in the original source.\n       *   - bias: Either 'SourceMapConsumer.GREATEST_LOWER_BOUND' or\n       *     'SourceMapConsumer.LEAST_UPPER_BOUND'. Specifies whether to return the\n       *     closest element that is smaller than or greater than the one we are\n       *     searching for, respectively, if the exact element cannot be found.\n       *     Defaults to 'SourceMapConsumer.GREATEST_LOWER_BOUND'.\n       *\n       * and an object is returned with the following properties:\n       *\n       *   - line: The line number in the generated source, or null.\n       *   - column: The column number in the generated source, or null.\n       */\n      generatedPositionFor(originalPosition: MappedPosition & { bias?: number }): NullablePosition;\n\n      /**\n       * Returns all generated line and column information for the original source,\n       * line, and column provided. If no column is provided, returns all mappings\n       * corresponding to a either the line we are searching for or the next\n       * closest line that has any mappings. Otherwise, returns all mappings\n       * corresponding to the given line and either the column we are searching for\n       * or the next closest column that has any offsets.\n       *\n       * The only argument is an object with the following properties:\n       *\n       *   - source: The filename of the original source.\n       *   - line: The line number in the original source.\n       *   - column: Optional. the column number in the original source.\n       *\n       * and an array of objects is returned, each with the following properties:\n       *\n       *   - line: The line number in the generated source, or null.\n       *   - column: The column number in the generated source, or null.\n       */\n      allGeneratedPositionsFor(originalPosition: MappedPosition): NullablePosition[];\n\n      /**\n       * Return true if we have the source content for every source in the source\n       * map, false otherwise.\n       */\n      hasContentsOfAllSources(): boolean;\n\n      /**\n       * Returns the original source content. The only argument is the url of the\n       * original source file. Returns null if no original source content is\n       * available.\n       */\n      sourceContentFor(source: string, returnNullOnMissing?: boolean): string | null;\n\n      /**\n       * Iterate over each mapping between an original source/line/column and a\n       * generated line/column in this source map.\n       *\n       * @param callback\n       *        The function that is called with each mapping.\n       * @param context\n       *        Optional. If specified, this object will be the value of `this` every\n       *        time that `aCallback` is called.\n       * @param order\n       *        Either `SourceMapConsumer.GENERATED_ORDER` or\n       *        `SourceMapConsumer.ORIGINAL_ORDER`. Specifies whether you want to\n       *        iterate over the mappings sorted by the generated file's line/column\n       *        order or the original's source/line/column order, respectively. Defaults to\n       *        `SourceMapConsumer.GENERATED_ORDER`.\n       */\n      eachMapping(callback: (mapping: MappingItem) => void, context?: any, order?: number): void;\n  }\n}\n\n/**\n * We include stubs for each file inside this npm package in case you need to\n * require those files directly. Feel free to delete any files that aren't\n * needed.\n */\ndeclare module 'source-map/dist/source-map.debug' {\n  declare module.exports: any;\n}\n\ndeclare module 'source-map/dist/source-map' {\n  declare module.exports: any;\n}\n\ndeclare module 'source-map/dist/source-map.min' {\n  declare module.exports: any;\n}\n\ndeclare module 'source-map/lib/array-set' {\n  declare module.exports: any;\n}\n\ndeclare module 'source-map/lib/base64-vlq' {\n  declare module.exports: any;\n}\n\ndeclare module 'source-map/lib/base64' {\n  declare module.exports: any;\n}\n\ndeclare module 'source-map/lib/binary-search' {\n  declare module.exports: any;\n}\n\ndeclare module 'source-map/lib/mapping-list' {\n  declare module.exports: any;\n}\n\ndeclare module 'source-map/lib/quick-sort' {\n  declare module.exports: any;\n}\n\ndeclare module 'source-map/lib/source-map-consumer' {\n  declare module.exports: any;\n}\n\ndeclare module 'source-map/lib/source-map-generator' {\n  declare module.exports: any;\n}\n\ndeclare module 'source-map/lib/source-node' {\n  declare module.exports: any;\n}\n\ndeclare module 'source-map/lib/util' {\n  declare module.exports: any;\n}\n\ndeclare module 'source-map/source-map' {\n  declare module.exports: any;\n}\n\n// Filename aliases\ndeclare module 'source-map/dist/source-map.debug.js' {\n  declare module.exports: $Exports<'source-map/dist/source-map.debug'>;\n}\ndeclare module 'source-map/dist/source-map.js' {\n  declare module.exports: $Exports<'source-map/dist/source-map'>;\n}\ndeclare module 'source-map/dist/source-map.min.js' {\n  declare module.exports: $Exports<'source-map/dist/source-map.min'>;\n}\ndeclare module 'source-map/lib/array-set.js' {\n  declare module.exports: $Exports<'source-map/lib/array-set'>;\n}\ndeclare module 'source-map/lib/base64-vlq.js' {\n  declare module.exports: $Exports<'source-map/lib/base64-vlq'>;\n}\ndeclare module 'source-map/lib/base64.js' {\n  declare module.exports: $Exports<'source-map/lib/base64'>;\n}\ndeclare module 'source-map/lib/binary-search.js' {\n  declare module.exports: $Exports<'source-map/lib/binary-search'>;\n}\ndeclare module 'source-map/lib/mapping-list.js' {\n  declare module.exports: $Exports<'source-map/lib/mapping-list'>;\n}\ndeclare module 'source-map/lib/quick-sort.js' {\n  declare module.exports: $Exports<'source-map/lib/quick-sort'>;\n}\ndeclare module 'source-map/lib/source-map-consumer.js' {\n  declare module.exports: $Exports<'source-map/lib/source-map-consumer'>;\n}\ndeclare module 'source-map/lib/source-map-generator.js' {\n  declare module.exports: $Exports<'source-map/lib/source-map-generator'>;\n}\ndeclare module 'source-map/lib/source-node.js' {\n  declare module.exports: $Exports<'source-map/lib/source-node'>;\n}\ndeclare module 'source-map/lib/util.js' {\n  declare module.exports: $Exports<'source-map/lib/util'>;\n}\ndeclare module 'source-map/source-map.js' {\n  declare module.exports: $Exports<'source-map/source-map'>;\n}\n"
  },
  {
    "path": "flow-typed/npm/uglify-js_vx.x.x.js",
    "content": "// flow-typed signature: d5499934167edd7e40dad28c40e8d14f\n// flow-typed version: <<STUB>>/uglify-js_v^2.6.2/flow_v0.38.0\n\n/**\n * This is an autogenerated libdef stub for:\n *\n *   'uglify-js'\n *\n * Fill this stub out by replacing all the `any` types.\n *\n * Once filled out, we encourage you to share your work with the \n * community by sending a pull request to: \n * https://github.com/flowtype/flow-typed\n */\n\ndeclare module 'uglify-js' {\n  declare module.exports: any;\n}\n\n/**\n * We include stubs for each file inside this npm package in case you need to\n * require those files directly. Feel free to delete any files that aren't\n * needed.\n */\ndeclare module 'uglify-js/bin/extract-props' {\n  declare module.exports: any;\n}\n\ndeclare module 'uglify-js/lib/ast' {\n  declare module.exports: any;\n}\n\ndeclare module 'uglify-js/lib/compress' {\n  declare module.exports: any;\n}\n\ndeclare module 'uglify-js/lib/mozilla-ast' {\n  declare module.exports: any;\n}\n\ndeclare module 'uglify-js/lib/output' {\n  declare module.exports: any;\n}\n\ndeclare module 'uglify-js/lib/parse' {\n  declare module.exports: any;\n}\n\ndeclare module 'uglify-js/lib/propmangle' {\n  declare module.exports: any;\n}\n\ndeclare module 'uglify-js/lib/scope' {\n  declare module.exports: any;\n}\n\ndeclare module 'uglify-js/lib/sourcemap' {\n  declare module.exports: any;\n}\n\ndeclare module 'uglify-js/lib/transform' {\n  declare module.exports: any;\n}\n\ndeclare module 'uglify-js/lib/utils' {\n  declare module.exports: any;\n}\n\ndeclare module 'uglify-js/tools/exports' {\n  declare module.exports: any;\n}\n\ndeclare module 'uglify-js/tools/node' {\n  declare module.exports: any;\n}\n\n// Filename aliases\ndeclare module 'uglify-js/bin/extract-props.js' {\n  declare module.exports: $Exports<'uglify-js/bin/extract-props'>;\n}\ndeclare module 'uglify-js/lib/ast.js' {\n  declare module.exports: $Exports<'uglify-js/lib/ast'>;\n}\ndeclare module 'uglify-js/lib/compress.js' {\n  declare module.exports: $Exports<'uglify-js/lib/compress'>;\n}\ndeclare module 'uglify-js/lib/mozilla-ast.js' {\n  declare module.exports: $Exports<'uglify-js/lib/mozilla-ast'>;\n}\ndeclare module 'uglify-js/lib/output.js' {\n  declare module.exports: $Exports<'uglify-js/lib/output'>;\n}\ndeclare module 'uglify-js/lib/parse.js' {\n  declare module.exports: $Exports<'uglify-js/lib/parse'>;\n}\ndeclare module 'uglify-js/lib/propmangle.js' {\n  declare module.exports: $Exports<'uglify-js/lib/propmangle'>;\n}\ndeclare module 'uglify-js/lib/scope.js' {\n  declare module.exports: $Exports<'uglify-js/lib/scope'>;\n}\ndeclare module 'uglify-js/lib/sourcemap.js' {\n  declare module.exports: $Exports<'uglify-js/lib/sourcemap'>;\n}\ndeclare module 'uglify-js/lib/transform.js' {\n  declare module.exports: $Exports<'uglify-js/lib/transform'>;\n}\ndeclare module 'uglify-js/lib/utils.js' {\n  declare module.exports: $Exports<'uglify-js/lib/utils'>;\n}\ndeclare module 'uglify-js/tools/exports.js' {\n  declare module.exports: $Exports<'uglify-js/tools/exports'>;\n}\ndeclare module 'uglify-js/tools/node.js' {\n  declare module.exports: $Exports<'uglify-js/tools/node'>;\n}\n"
  },
  {
    "path": "flow-typed/npm/v8-profiler-node8_vx.x.x.js",
    "content": "// flow-typed signature: 157088d679e8cd26f71af29e6bfa3ccc\n// flow-typed version: <<STUB>>/v8-profiler-node8_v6.0.1/flow_v0.79.1\n\n/**\n * This is an autogenerated libdef stub for:\n *\n *   'v8-profiler-node8'\n *\n * Fill this stub out by replacing all the `any` types.\n *\n * Once filled out, we encourage you to share your work with the\n * community by sending a pull request to:\n * https://github.com/flowtype/flow-typed\n */\n\ndeclare module 'v8-profiler-node8' {\n  declare module.exports: any;\n}\n\n/**\n * We include stubs for each file inside this npm package in case you need to\n * require those files directly. Feel free to delete any files that aren't\n * needed.\n */\ndeclare module 'v8-profiler-node8/tools/annotate-tag' {\n  declare module.exports: any;\n}\n\ndeclare module 'v8-profiler-node8/tools/commit-changes' {\n  declare module.exports: any;\n}\n\ndeclare module 'v8-profiler-node8/tools/exec' {\n  declare module.exports: any;\n}\n\ndeclare module 'v8-profiler-node8/tools/history' {\n  declare module.exports: any;\n}\n\ndeclare module 'v8-profiler-node8/tools/NODE_NEXT' {\n  declare module.exports: any;\n}\n\ndeclare module 'v8-profiler-node8/tools/prepublish-to-npm' {\n  declare module.exports: any;\n}\n\ndeclare module 'v8-profiler-node8/tools/publish-to-npm' {\n  declare module.exports: any;\n}\n\ndeclare module 'v8-profiler-node8/tools/push-to-githab' {\n  declare module.exports: any;\n}\n\ndeclare module 'v8-profiler-node8/tools/release' {\n  declare module.exports: any;\n}\n\ndeclare module 'v8-profiler-node8/tools/update-changelog' {\n  declare module.exports: any;\n}\n\ndeclare module 'v8-profiler-node8/tools/update-npm-version' {\n  declare module.exports: any;\n}\n\ndeclare module 'v8-profiler-node8/v8-profiler' {\n  declare module.exports: any;\n}\n\n// Filename aliases\ndeclare module 'v8-profiler-node8/tools/annotate-tag.js' {\n  declare module.exports: $Exports<'v8-profiler-node8/tools/annotate-tag'>;\n}\ndeclare module 'v8-profiler-node8/tools/commit-changes.js' {\n  declare module.exports: $Exports<'v8-profiler-node8/tools/commit-changes'>;\n}\ndeclare module 'v8-profiler-node8/tools/exec.js' {\n  declare module.exports: $Exports<'v8-profiler-node8/tools/exec'>;\n}\ndeclare module 'v8-profiler-node8/tools/history.js' {\n  declare module.exports: $Exports<'v8-profiler-node8/tools/history'>;\n}\ndeclare module 'v8-profiler-node8/tools/NODE_NEXT.js' {\n  declare module.exports: $Exports<'v8-profiler-node8/tools/NODE_NEXT'>;\n}\ndeclare module 'v8-profiler-node8/tools/prepublish-to-npm.js' {\n  declare module.exports: $Exports<'v8-profiler-node8/tools/prepublish-to-npm'>;\n}\ndeclare module 'v8-profiler-node8/tools/publish-to-npm.js' {\n  declare module.exports: $Exports<'v8-profiler-node8/tools/publish-to-npm'>;\n}\ndeclare module 'v8-profiler-node8/tools/push-to-githab.js' {\n  declare module.exports: $Exports<'v8-profiler-node8/tools/push-to-githab'>;\n}\ndeclare module 'v8-profiler-node8/tools/release.js' {\n  declare module.exports: $Exports<'v8-profiler-node8/tools/release'>;\n}\ndeclare module 'v8-profiler-node8/tools/update-changelog.js' {\n  declare module.exports: $Exports<'v8-profiler-node8/tools/update-changelog'>;\n}\ndeclare module 'v8-profiler-node8/tools/update-npm-version.js' {\n  declare module.exports: $Exports<'v8-profiler-node8/tools/update-npm-version'>;\n}\ndeclare module 'v8-profiler-node8/v8-profiler.js' {\n  declare module.exports: $Exports<'v8-profiler-node8/v8-profiler'>;\n}\n"
  },
  {
    "path": "flow-typed/npm/vscode-debugadapter_vx.x.x.js",
    "content": "// flow-typed signature: b0105a82001632c14dcbf5fe23739b80\n// flow-typed version: <<STUB>>/vscode-debugadapter_v^1.24.0/flow_v0.76.0\n\n/**\n * This is an autogenerated libdef stub for:\n *\n *   'vscode-debugadapter'\n *\n * Fill this stub out by replacing all the `any` types.\n *\n * Once filled out, we encourage you to share your work with the\n * community by sending a pull request to:\n * https://github.com/flowtype/flow-typed\n */\n\ndeclare module 'vscode-debugadapter' {\n  declare module.exports: any;\n}\n\n/**\n * We include stubs for each file inside this npm package in case you need to\n * require those files directly. Feel free to delete any files that aren't\n * needed.\n */\ndeclare module 'vscode-debugadapter/lib/debugSession' {\n  declare module.exports: any;\n}\n\ndeclare module 'vscode-debugadapter/lib/handles' {\n  declare module.exports: any;\n}\n\ndeclare module 'vscode-debugadapter/lib/logger' {\n  declare module.exports: any;\n}\n\ndeclare module 'vscode-debugadapter/lib/loggingDebugSession' {\n  declare module.exports: any;\n}\n\ndeclare module 'vscode-debugadapter/lib/main' {\n  declare module.exports: any;\n}\n\ndeclare module 'vscode-debugadapter/lib/messages' {\n  declare module.exports: any;\n}\n\ndeclare module 'vscode-debugadapter/lib/protocol' {\n  declare module.exports: any;\n}\n\n// Filename aliases\ndeclare module 'vscode-debugadapter/lib/debugSession.js' {\n  declare module.exports: $Exports<'vscode-debugadapter/lib/debugSession'>;\n}\ndeclare module 'vscode-debugadapter/lib/handles.js' {\n  declare module.exports: $Exports<'vscode-debugadapter/lib/handles'>;\n}\ndeclare module 'vscode-debugadapter/lib/logger.js' {\n  declare module.exports: $Exports<'vscode-debugadapter/lib/logger'>;\n}\ndeclare module 'vscode-debugadapter/lib/loggingDebugSession.js' {\n  declare module.exports: $Exports<'vscode-debugadapter/lib/loggingDebugSession'>;\n}\ndeclare module 'vscode-debugadapter/lib/main.js' {\n  declare module.exports: $Exports<'vscode-debugadapter/lib/main'>;\n}\ndeclare module 'vscode-debugadapter/lib/messages.js' {\n  declare module.exports: $Exports<'vscode-debugadapter/lib/messages'>;\n}\ndeclare module 'vscode-debugadapter/lib/protocol.js' {\n  declare module.exports: $Exports<'vscode-debugadapter/lib/protocol'>;\n}\n"
  },
  {
    "path": "flow-typed/npm/vscode-debugprotocol_vx.x.x.js",
    "content": "// flow-typed signature: c3d699d8e0136301c17d450964419f5f\n// flow-typed version: <<STUB>>/vscode-debugprotocol_v^1.24.0/flow_v0.76.0\n\n/**\n * This is an autogenerated libdef stub for:\n *\n *   'vscode-debugprotocol'\n *\n * Fill this stub out by replacing all the `any` types.\n *\n * Once filled out, we encourage you to share your work with the\n * community by sending a pull request to:\n * https://github.com/flowtype/flow-typed\n */\n\ndeclare module 'vscode-debugprotocol' {\n  declare module.exports: any;\n}\n\n/**\n * We include stubs for each file inside this npm package in case you need to\n * require those files directly. Feel free to delete any files that aren't\n * needed.\n */\ndeclare module 'vscode-debugprotocol/lib/debugProtocol' {\n  declare module.exports: any;\n}\n\n// Filename aliases\ndeclare module 'vscode-debugprotocol/lib/debugProtocol.js' {\n  declare module.exports: $Exports<'vscode-debugprotocol/lib/debugProtocol'>;\n}\n"
  },
  {
    "path": "flow-typed/npm/webpack-cli_vx.x.x.js",
    "content": "// flow-typed signature: 9611b8636a77cb4c887f9f1155bda121\n// flow-typed version: <<STUB>>/webpack-cli_v^2.0.10/flow_v0.76.0\n\n/**\n * This is an autogenerated libdef stub for:\n *\n *   'webpack-cli'\n *\n * Fill this stub out by replacing all the `any` types.\n *\n * Once filled out, we encourage you to share your work with the\n * community by sending a pull request to:\n * https://github.com/flowtype/flow-typed\n */\n\ndeclare module 'webpack-cli' {\n  declare module.exports: any;\n}\n\n/**\n * We include stubs for each file inside this npm package in case you need to\n * require those files directly. Feel free to delete any files that aren't\n * needed.\n */\ndeclare module 'webpack-cli/bin/config-yargs' {\n  declare module.exports: any;\n}\n\ndeclare module 'webpack-cli/bin/convert-argv' {\n  declare module.exports: any;\n}\n\ndeclare module 'webpack-cli/bin/errorHelpers' {\n  declare module.exports: any;\n}\n\ndeclare module 'webpack-cli/bin/prepareOptions' {\n  declare module.exports: any;\n}\n\ndeclare module 'webpack-cli/bin/process-options' {\n  declare module.exports: any;\n}\n\ndeclare module 'webpack-cli/bin/webpack' {\n  declare module.exports: any;\n}\n\ndeclare module 'webpack-cli/commitlint.config' {\n  declare module.exports: any;\n}\n\ndeclare module 'webpack-cli/lib/commands/add' {\n  declare module.exports: any;\n}\n\ndeclare module 'webpack-cli/lib/commands/init' {\n  declare module.exports: any;\n}\n\ndeclare module 'webpack-cli/lib/commands/make' {\n  declare module.exports: any;\n}\n\ndeclare module 'webpack-cli/lib/commands/migrate' {\n  declare module.exports: any;\n}\n\ndeclare module 'webpack-cli/lib/commands/remove' {\n  declare module.exports: any;\n}\n\ndeclare module 'webpack-cli/lib/commands/serve' {\n  declare module.exports: any;\n}\n\ndeclare module 'webpack-cli/lib/commands/update' {\n  declare module.exports: any;\n}\n\ndeclare module 'webpack-cli/lib/generate-loader/index' {\n  declare module.exports: any;\n}\n\ndeclare module 'webpack-cli/lib/generate-plugin/index' {\n  declare module.exports: any;\n}\n\ndeclare module 'webpack-cli/lib/generators/add-generator' {\n  declare module.exports: any;\n}\n\ndeclare module 'webpack-cli/lib/generators/init-generator' {\n  declare module.exports: any;\n}\n\ndeclare module 'webpack-cli/lib/generators/loader-generator' {\n  declare module.exports: any;\n}\n\ndeclare module 'webpack-cli/lib/generators/plugin-generator' {\n  declare module.exports: any;\n}\n\ndeclare module 'webpack-cli/lib/generators/remove-generator' {\n  declare module.exports: any;\n}\n\ndeclare module 'webpack-cli/lib/generators/update-generator' {\n  declare module.exports: any;\n}\n\ndeclare module 'webpack-cli/lib/generators/utils/entry' {\n  declare module.exports: any;\n}\n\ndeclare module 'webpack-cli/lib/generators/utils/module' {\n  declare module.exports: any;\n}\n\ndeclare module 'webpack-cli/lib/generators/utils/plugins' {\n  declare module.exports: any;\n}\n\ndeclare module 'webpack-cli/lib/generators/utils/tooltip' {\n  declare module.exports: any;\n}\n\ndeclare module 'webpack-cli/lib/generators/utils/validate' {\n  declare module.exports: any;\n}\n\ndeclare module 'webpack-cli/lib/generators/webpack-generator' {\n  declare module.exports: any;\n}\n\ndeclare module 'webpack-cli/lib/index' {\n  declare module.exports: any;\n}\n\ndeclare module 'webpack-cli/lib/init/index' {\n  declare module.exports: any;\n}\n\ndeclare module 'webpack-cli/lib/init/transformations/context/context' {\n  declare module.exports: any;\n}\n\ndeclare module 'webpack-cli/lib/init/transformations/devServer/devServer' {\n  declare module.exports: any;\n}\n\ndeclare module 'webpack-cli/lib/init/transformations/devtool/devtool' {\n  declare module.exports: any;\n}\n\ndeclare module 'webpack-cli/lib/init/transformations/entry/entry' {\n  declare module.exports: any;\n}\n\ndeclare module 'webpack-cli/lib/init/transformations/externals/externals' {\n  declare module.exports: any;\n}\n\ndeclare module 'webpack-cli/lib/init/transformations/index' {\n  declare module.exports: any;\n}\n\ndeclare module 'webpack-cli/lib/init/transformations/mode/mode' {\n  declare module.exports: any;\n}\n\ndeclare module 'webpack-cli/lib/init/transformations/module/module' {\n  declare module.exports: any;\n}\n\ndeclare module 'webpack-cli/lib/init/transformations/node/node' {\n  declare module.exports: any;\n}\n\ndeclare module 'webpack-cli/lib/init/transformations/other/amd' {\n  declare module.exports: any;\n}\n\ndeclare module 'webpack-cli/lib/init/transformations/other/bail' {\n  declare module.exports: any;\n}\n\ndeclare module 'webpack-cli/lib/init/transformations/other/cache' {\n  declare module.exports: any;\n}\n\ndeclare module 'webpack-cli/lib/init/transformations/other/merge' {\n  declare module.exports: any;\n}\n\ndeclare module 'webpack-cli/lib/init/transformations/other/parallelism' {\n  declare module.exports: any;\n}\n\ndeclare module 'webpack-cli/lib/init/transformations/other/profile' {\n  declare module.exports: any;\n}\n\ndeclare module 'webpack-cli/lib/init/transformations/other/recordsInputPath' {\n  declare module.exports: any;\n}\n\ndeclare module 'webpack-cli/lib/init/transformations/other/recordsOutputPath' {\n  declare module.exports: any;\n}\n\ndeclare module 'webpack-cli/lib/init/transformations/other/recordsPath' {\n  declare module.exports: any;\n}\n\ndeclare module 'webpack-cli/lib/init/transformations/output/output' {\n  declare module.exports: any;\n}\n\ndeclare module 'webpack-cli/lib/init/transformations/performance/performance' {\n  declare module.exports: any;\n}\n\ndeclare module 'webpack-cli/lib/init/transformations/plugins/plugins' {\n  declare module.exports: any;\n}\n\ndeclare module 'webpack-cli/lib/init/transformations/resolve/resolve' {\n  declare module.exports: any;\n}\n\ndeclare module 'webpack-cli/lib/init/transformations/resolveLoader/resolveLoader' {\n  declare module.exports: any;\n}\n\ndeclare module 'webpack-cli/lib/init/transformations/stats/stats' {\n  declare module.exports: any;\n}\n\ndeclare module 'webpack-cli/lib/init/transformations/target/target' {\n  declare module.exports: any;\n}\n\ndeclare module 'webpack-cli/lib/init/transformations/top-scope/top-scope' {\n  declare module.exports: any;\n}\n\ndeclare module 'webpack-cli/lib/init/transformations/watch/watch' {\n  declare module.exports: any;\n}\n\ndeclare module 'webpack-cli/lib/init/transformations/watch/watchOptions' {\n  declare module.exports: any;\n}\n\ndeclare module 'webpack-cli/lib/migrate/bannerPlugin/bannerPlugin' {\n  declare module.exports: any;\n}\n\ndeclare module 'webpack-cli/lib/migrate/extractTextPlugin/extractTextPlugin' {\n  declare module.exports: any;\n}\n\ndeclare module 'webpack-cli/lib/migrate/index' {\n  declare module.exports: any;\n}\n\ndeclare module 'webpack-cli/lib/migrate/loaderOptionsPlugin/loaderOptionsPlugin' {\n  declare module.exports: any;\n}\n\ndeclare module 'webpack-cli/lib/migrate/loaders/loaders' {\n  declare module.exports: any;\n}\n\ndeclare module 'webpack-cli/lib/migrate/outputPath/outputPath' {\n  declare module.exports: any;\n}\n\ndeclare module 'webpack-cli/lib/migrate/removeDeprecatedPlugins/removeDeprecatedPlugins' {\n  declare module.exports: any;\n}\n\ndeclare module 'webpack-cli/lib/migrate/removeJsonLoader/removeJsonLoader' {\n  declare module.exports: any;\n}\n\ndeclare module 'webpack-cli/lib/migrate/resolve/resolve' {\n  declare module.exports: any;\n}\n\ndeclare module 'webpack-cli/lib/migrate/uglifyJsPlugin/uglifyJsPlugin' {\n  declare module.exports: any;\n}\n\ndeclare module 'webpack-cli/lib/utils/ast-utils' {\n  declare module.exports: any;\n}\n\ndeclare module 'webpack-cli/lib/utils/copy-utils' {\n  declare module.exports: any;\n}\n\ndeclare module 'webpack-cli/lib/utils/defineTest' {\n  declare module.exports: any;\n}\n\ndeclare module 'webpack-cli/lib/utils/hashtable' {\n  declare module.exports: any;\n}\n\ndeclare module 'webpack-cli/lib/utils/modify-config-helper' {\n  declare module.exports: any;\n}\n\ndeclare module 'webpack-cli/lib/utils/npm-exists' {\n  declare module.exports: any;\n}\n\ndeclare module 'webpack-cli/lib/utils/npm-packages-exists' {\n  declare module.exports: any;\n}\n\ndeclare module 'webpack-cli/lib/utils/package-manager' {\n  declare module.exports: any;\n}\n\ndeclare module 'webpack-cli/lib/utils/prop-types' {\n  declare module.exports: any;\n}\n\ndeclare module 'webpack-cli/lib/utils/resolve-packages' {\n  declare module.exports: any;\n}\n\ndeclare module 'webpack-cli/lib/utils/run-prettier' {\n  declare module.exports: any;\n}\n\n// Filename aliases\ndeclare module 'webpack-cli/bin/config-yargs.js' {\n  declare module.exports: $Exports<'webpack-cli/bin/config-yargs'>;\n}\ndeclare module 'webpack-cli/bin/convert-argv.js' {\n  declare module.exports: $Exports<'webpack-cli/bin/convert-argv'>;\n}\ndeclare module 'webpack-cli/bin/errorHelpers.js' {\n  declare module.exports: $Exports<'webpack-cli/bin/errorHelpers'>;\n}\ndeclare module 'webpack-cli/bin/prepareOptions.js' {\n  declare module.exports: $Exports<'webpack-cli/bin/prepareOptions'>;\n}\ndeclare module 'webpack-cli/bin/process-options.js' {\n  declare module.exports: $Exports<'webpack-cli/bin/process-options'>;\n}\ndeclare module 'webpack-cli/bin/webpack.js' {\n  declare module.exports: $Exports<'webpack-cli/bin/webpack'>;\n}\ndeclare module 'webpack-cli/commitlint.config.js' {\n  declare module.exports: $Exports<'webpack-cli/commitlint.config'>;\n}\ndeclare module 'webpack-cli/lib/commands/add.js' {\n  declare module.exports: $Exports<'webpack-cli/lib/commands/add'>;\n}\ndeclare module 'webpack-cli/lib/commands/init.js' {\n  declare module.exports: $Exports<'webpack-cli/lib/commands/init'>;\n}\ndeclare module 'webpack-cli/lib/commands/make.js' {\n  declare module.exports: $Exports<'webpack-cli/lib/commands/make'>;\n}\ndeclare module 'webpack-cli/lib/commands/migrate.js' {\n  declare module.exports: $Exports<'webpack-cli/lib/commands/migrate'>;\n}\ndeclare module 'webpack-cli/lib/commands/remove.js' {\n  declare module.exports: $Exports<'webpack-cli/lib/commands/remove'>;\n}\ndeclare module 'webpack-cli/lib/commands/serve.js' {\n  declare module.exports: $Exports<'webpack-cli/lib/commands/serve'>;\n}\ndeclare module 'webpack-cli/lib/commands/update.js' {\n  declare module.exports: $Exports<'webpack-cli/lib/commands/update'>;\n}\ndeclare module 'webpack-cli/lib/generate-loader/index.js' {\n  declare module.exports: $Exports<'webpack-cli/lib/generate-loader/index'>;\n}\ndeclare module 'webpack-cli/lib/generate-plugin/index.js' {\n  declare module.exports: $Exports<'webpack-cli/lib/generate-plugin/index'>;\n}\ndeclare module 'webpack-cli/lib/generators/add-generator.js' {\n  declare module.exports: $Exports<'webpack-cli/lib/generators/add-generator'>;\n}\ndeclare module 'webpack-cli/lib/generators/init-generator.js' {\n  declare module.exports: $Exports<'webpack-cli/lib/generators/init-generator'>;\n}\ndeclare module 'webpack-cli/lib/generators/loader-generator.js' {\n  declare module.exports: $Exports<'webpack-cli/lib/generators/loader-generator'>;\n}\ndeclare module 'webpack-cli/lib/generators/plugin-generator.js' {\n  declare module.exports: $Exports<'webpack-cli/lib/generators/plugin-generator'>;\n}\ndeclare module 'webpack-cli/lib/generators/remove-generator.js' {\n  declare module.exports: $Exports<'webpack-cli/lib/generators/remove-generator'>;\n}\ndeclare module 'webpack-cli/lib/generators/update-generator.js' {\n  declare module.exports: $Exports<'webpack-cli/lib/generators/update-generator'>;\n}\ndeclare module 'webpack-cli/lib/generators/utils/entry.js' {\n  declare module.exports: $Exports<'webpack-cli/lib/generators/utils/entry'>;\n}\ndeclare module 'webpack-cli/lib/generators/utils/module.js' {\n  declare module.exports: $Exports<'webpack-cli/lib/generators/utils/module'>;\n}\ndeclare module 'webpack-cli/lib/generators/utils/plugins.js' {\n  declare module.exports: $Exports<'webpack-cli/lib/generators/utils/plugins'>;\n}\ndeclare module 'webpack-cli/lib/generators/utils/tooltip.js' {\n  declare module.exports: $Exports<'webpack-cli/lib/generators/utils/tooltip'>;\n}\ndeclare module 'webpack-cli/lib/generators/utils/validate.js' {\n  declare module.exports: $Exports<'webpack-cli/lib/generators/utils/validate'>;\n}\ndeclare module 'webpack-cli/lib/generators/webpack-generator.js' {\n  declare module.exports: $Exports<'webpack-cli/lib/generators/webpack-generator'>;\n}\ndeclare module 'webpack-cli/lib/index.js' {\n  declare module.exports: $Exports<'webpack-cli/lib/index'>;\n}\ndeclare module 'webpack-cli/lib/init/index.js' {\n  declare module.exports: $Exports<'webpack-cli/lib/init/index'>;\n}\ndeclare module 'webpack-cli/lib/init/transformations/context/context.js' {\n  declare module.exports: $Exports<'webpack-cli/lib/init/transformations/context/context'>;\n}\ndeclare module 'webpack-cli/lib/init/transformations/devServer/devServer.js' {\n  declare module.exports: $Exports<'webpack-cli/lib/init/transformations/devServer/devServer'>;\n}\ndeclare module 'webpack-cli/lib/init/transformations/devtool/devtool.js' {\n  declare module.exports: $Exports<'webpack-cli/lib/init/transformations/devtool/devtool'>;\n}\ndeclare module 'webpack-cli/lib/init/transformations/entry/entry.js' {\n  declare module.exports: $Exports<'webpack-cli/lib/init/transformations/entry/entry'>;\n}\ndeclare module 'webpack-cli/lib/init/transformations/externals/externals.js' {\n  declare module.exports: $Exports<'webpack-cli/lib/init/transformations/externals/externals'>;\n}\ndeclare module 'webpack-cli/lib/init/transformations/index.js' {\n  declare module.exports: $Exports<'webpack-cli/lib/init/transformations/index'>;\n}\ndeclare module 'webpack-cli/lib/init/transformations/mode/mode.js' {\n  declare module.exports: $Exports<'webpack-cli/lib/init/transformations/mode/mode'>;\n}\ndeclare module 'webpack-cli/lib/init/transformations/module/module.js' {\n  declare module.exports: $Exports<'webpack-cli/lib/init/transformations/module/module'>;\n}\ndeclare module 'webpack-cli/lib/init/transformations/node/node.js' {\n  declare module.exports: $Exports<'webpack-cli/lib/init/transformations/node/node'>;\n}\ndeclare module 'webpack-cli/lib/init/transformations/other/amd.js' {\n  declare module.exports: $Exports<'webpack-cli/lib/init/transformations/other/amd'>;\n}\ndeclare module 'webpack-cli/lib/init/transformations/other/bail.js' {\n  declare module.exports: $Exports<'webpack-cli/lib/init/transformations/other/bail'>;\n}\ndeclare module 'webpack-cli/lib/init/transformations/other/cache.js' {\n  declare module.exports: $Exports<'webpack-cli/lib/init/transformations/other/cache'>;\n}\ndeclare module 'webpack-cli/lib/init/transformations/other/merge.js' {\n  declare module.exports: $Exports<'webpack-cli/lib/init/transformations/other/merge'>;\n}\ndeclare module 'webpack-cli/lib/init/transformations/other/parallelism.js' {\n  declare module.exports: $Exports<'webpack-cli/lib/init/transformations/other/parallelism'>;\n}\ndeclare module 'webpack-cli/lib/init/transformations/other/profile.js' {\n  declare module.exports: $Exports<'webpack-cli/lib/init/transformations/other/profile'>;\n}\ndeclare module 'webpack-cli/lib/init/transformations/other/recordsInputPath.js' {\n  declare module.exports: $Exports<'webpack-cli/lib/init/transformations/other/recordsInputPath'>;\n}\ndeclare module 'webpack-cli/lib/init/transformations/other/recordsOutputPath.js' {\n  declare module.exports: $Exports<'webpack-cli/lib/init/transformations/other/recordsOutputPath'>;\n}\ndeclare module 'webpack-cli/lib/init/transformations/other/recordsPath.js' {\n  declare module.exports: $Exports<'webpack-cli/lib/init/transformations/other/recordsPath'>;\n}\ndeclare module 'webpack-cli/lib/init/transformations/output/output.js' {\n  declare module.exports: $Exports<'webpack-cli/lib/init/transformations/output/output'>;\n}\ndeclare module 'webpack-cli/lib/init/transformations/performance/performance.js' {\n  declare module.exports: $Exports<'webpack-cli/lib/init/transformations/performance/performance'>;\n}\ndeclare module 'webpack-cli/lib/init/transformations/plugins/plugins.js' {\n  declare module.exports: $Exports<'webpack-cli/lib/init/transformations/plugins/plugins'>;\n}\ndeclare module 'webpack-cli/lib/init/transformations/resolve/resolve.js' {\n  declare module.exports: $Exports<'webpack-cli/lib/init/transformations/resolve/resolve'>;\n}\ndeclare module 'webpack-cli/lib/init/transformations/resolveLoader/resolveLoader.js' {\n  declare module.exports: $Exports<'webpack-cli/lib/init/transformations/resolveLoader/resolveLoader'>;\n}\ndeclare module 'webpack-cli/lib/init/transformations/stats/stats.js' {\n  declare module.exports: $Exports<'webpack-cli/lib/init/transformations/stats/stats'>;\n}\ndeclare module 'webpack-cli/lib/init/transformations/target/target.js' {\n  declare module.exports: $Exports<'webpack-cli/lib/init/transformations/target/target'>;\n}\ndeclare module 'webpack-cli/lib/init/transformations/top-scope/top-scope.js' {\n  declare module.exports: $Exports<'webpack-cli/lib/init/transformations/top-scope/top-scope'>;\n}\ndeclare module 'webpack-cli/lib/init/transformations/watch/watch.js' {\n  declare module.exports: $Exports<'webpack-cli/lib/init/transformations/watch/watch'>;\n}\ndeclare module 'webpack-cli/lib/init/transformations/watch/watchOptions.js' {\n  declare module.exports: $Exports<'webpack-cli/lib/init/transformations/watch/watchOptions'>;\n}\ndeclare module 'webpack-cli/lib/migrate/bannerPlugin/bannerPlugin.js' {\n  declare module.exports: $Exports<'webpack-cli/lib/migrate/bannerPlugin/bannerPlugin'>;\n}\ndeclare module 'webpack-cli/lib/migrate/extractTextPlugin/extractTextPlugin.js' {\n  declare module.exports: $Exports<'webpack-cli/lib/migrate/extractTextPlugin/extractTextPlugin'>;\n}\ndeclare module 'webpack-cli/lib/migrate/index.js' {\n  declare module.exports: $Exports<'webpack-cli/lib/migrate/index'>;\n}\ndeclare module 'webpack-cli/lib/migrate/loaderOptionsPlugin/loaderOptionsPlugin.js' {\n  declare module.exports: $Exports<'webpack-cli/lib/migrate/loaderOptionsPlugin/loaderOptionsPlugin'>;\n}\ndeclare module 'webpack-cli/lib/migrate/loaders/loaders.js' {\n  declare module.exports: $Exports<'webpack-cli/lib/migrate/loaders/loaders'>;\n}\ndeclare module 'webpack-cli/lib/migrate/outputPath/outputPath.js' {\n  declare module.exports: $Exports<'webpack-cli/lib/migrate/outputPath/outputPath'>;\n}\ndeclare module 'webpack-cli/lib/migrate/removeDeprecatedPlugins/removeDeprecatedPlugins.js' {\n  declare module.exports: $Exports<'webpack-cli/lib/migrate/removeDeprecatedPlugins/removeDeprecatedPlugins'>;\n}\ndeclare module 'webpack-cli/lib/migrate/removeJsonLoader/removeJsonLoader.js' {\n  declare module.exports: $Exports<'webpack-cli/lib/migrate/removeJsonLoader/removeJsonLoader'>;\n}\ndeclare module 'webpack-cli/lib/migrate/resolve/resolve.js' {\n  declare module.exports: $Exports<'webpack-cli/lib/migrate/resolve/resolve'>;\n}\ndeclare module 'webpack-cli/lib/migrate/uglifyJsPlugin/uglifyJsPlugin.js' {\n  declare module.exports: $Exports<'webpack-cli/lib/migrate/uglifyJsPlugin/uglifyJsPlugin'>;\n}\ndeclare module 'webpack-cli/lib/utils/ast-utils.js' {\n  declare module.exports: $Exports<'webpack-cli/lib/utils/ast-utils'>;\n}\ndeclare module 'webpack-cli/lib/utils/copy-utils.js' {\n  declare module.exports: $Exports<'webpack-cli/lib/utils/copy-utils'>;\n}\ndeclare module 'webpack-cli/lib/utils/defineTest.js' {\n  declare module.exports: $Exports<'webpack-cli/lib/utils/defineTest'>;\n}\ndeclare module 'webpack-cli/lib/utils/hashtable.js' {\n  declare module.exports: $Exports<'webpack-cli/lib/utils/hashtable'>;\n}\ndeclare module 'webpack-cli/lib/utils/modify-config-helper.js' {\n  declare module.exports: $Exports<'webpack-cli/lib/utils/modify-config-helper'>;\n}\ndeclare module 'webpack-cli/lib/utils/npm-exists.js' {\n  declare module.exports: $Exports<'webpack-cli/lib/utils/npm-exists'>;\n}\ndeclare module 'webpack-cli/lib/utils/npm-packages-exists.js' {\n  declare module.exports: $Exports<'webpack-cli/lib/utils/npm-packages-exists'>;\n}\ndeclare module 'webpack-cli/lib/utils/package-manager.js' {\n  declare module.exports: $Exports<'webpack-cli/lib/utils/package-manager'>;\n}\ndeclare module 'webpack-cli/lib/utils/prop-types.js' {\n  declare module.exports: $Exports<'webpack-cli/lib/utils/prop-types'>;\n}\ndeclare module 'webpack-cli/lib/utils/resolve-packages.js' {\n  declare module.exports: $Exports<'webpack-cli/lib/utils/resolve-packages'>;\n}\ndeclare module 'webpack-cli/lib/utils/run-prettier.js' {\n  declare module.exports: $Exports<'webpack-cli/lib/utils/run-prettier'>;\n}\n"
  },
  {
    "path": "flow-typed/npm/webpack_vx.x.x.js",
    "content": "// flow-typed signature: 859c038107b1758754176a79a98c532e\n// flow-typed version: <<STUB>>/webpack_v^4.1.0/flow_v0.76.0\n\n/**\n * This is an autogenerated libdef stub for:\n *\n *   'webpack'\n *\n * Fill this stub out by replacing all the `any` types.\n *\n * Once filled out, we encourage you to share your work with the\n * community by sending a pull request to:\n * https://github.com/flowtype/flow-typed\n */\n\ndeclare module 'webpack' {\n  declare module.exports: any;\n}\n\n/**\n * We include stubs for each file inside this npm package in case you need to\n * require those files directly. Feel free to delete any files that aren't\n * needed.\n */\ndeclare module 'webpack/bin/webpack' {\n  declare module.exports: any;\n}\n\ndeclare module 'webpack/buildin/amd-define' {\n  declare module.exports: any;\n}\n\ndeclare module 'webpack/buildin/amd-options' {\n  declare module.exports: any;\n}\n\ndeclare module 'webpack/buildin/global' {\n  declare module.exports: any;\n}\n\ndeclare module 'webpack/buildin/harmony-module' {\n  declare module.exports: any;\n}\n\ndeclare module 'webpack/buildin/module' {\n  declare module.exports: any;\n}\n\ndeclare module 'webpack/buildin/system' {\n  declare module.exports: any;\n}\n\ndeclare module 'webpack/hot/dev-server' {\n  declare module.exports: any;\n}\n\ndeclare module 'webpack/hot/emitter' {\n  declare module.exports: any;\n}\n\ndeclare module 'webpack/hot/log-apply-result' {\n  declare module.exports: any;\n}\n\ndeclare module 'webpack/hot/log' {\n  declare module.exports: any;\n}\n\ndeclare module 'webpack/hot/only-dev-server' {\n  declare module.exports: any;\n}\n\ndeclare module 'webpack/hot/poll' {\n  declare module.exports: any;\n}\n\ndeclare module 'webpack/hot/signal' {\n  declare module.exports: any;\n}\n\ndeclare module 'webpack/lib/AmdMainTemplatePlugin' {\n  declare module.exports: any;\n}\n\ndeclare module 'webpack/lib/APIPlugin' {\n  declare module.exports: any;\n}\n\ndeclare module 'webpack/lib/AsyncDependenciesBlock' {\n  declare module.exports: any;\n}\n\ndeclare module 'webpack/lib/AsyncDependencyToInitialChunkError' {\n  declare module.exports: any;\n}\n\ndeclare module 'webpack/lib/AutomaticPrefetchPlugin' {\n  declare module.exports: any;\n}\n\ndeclare module 'webpack/lib/BannerPlugin' {\n  declare module.exports: any;\n}\n\ndeclare module 'webpack/lib/BasicEvaluatedExpression' {\n  declare module.exports: any;\n}\n\ndeclare module 'webpack/lib/CachePlugin' {\n  declare module.exports: any;\n}\n\ndeclare module 'webpack/lib/CaseSensitiveModulesWarning' {\n  declare module.exports: any;\n}\n\ndeclare module 'webpack/lib/Chunk' {\n  declare module.exports: any;\n}\n\ndeclare module 'webpack/lib/ChunkGroup' {\n  declare module.exports: any;\n}\n\ndeclare module 'webpack/lib/ChunkRenderError' {\n  declare module.exports: any;\n}\n\ndeclare module 'webpack/lib/ChunkTemplate' {\n  declare module.exports: any;\n}\n\ndeclare module 'webpack/lib/compareLocations' {\n  declare module.exports: any;\n}\n\ndeclare module 'webpack/lib/CompatibilityPlugin' {\n  declare module.exports: any;\n}\n\ndeclare module 'webpack/lib/Compilation' {\n  declare module.exports: any;\n}\n\ndeclare module 'webpack/lib/Compiler' {\n  declare module.exports: any;\n}\n\ndeclare module 'webpack/lib/ConstPlugin' {\n  declare module.exports: any;\n}\n\ndeclare module 'webpack/lib/ContextExclusionPlugin' {\n  declare module.exports: any;\n}\n\ndeclare module 'webpack/lib/ContextModule' {\n  declare module.exports: any;\n}\n\ndeclare module 'webpack/lib/ContextModuleFactory' {\n  declare module.exports: any;\n}\n\ndeclare module 'webpack/lib/ContextReplacementPlugin' {\n  declare module.exports: any;\n}\n\ndeclare module 'webpack/lib/debug/ProfilingPlugin' {\n  declare module.exports: any;\n}\n\ndeclare module 'webpack/lib/DefinePlugin' {\n  declare module.exports: any;\n}\n\ndeclare module 'webpack/lib/DelegatedModule' {\n  declare module.exports: any;\n}\n\ndeclare module 'webpack/lib/DelegatedModuleFactoryPlugin' {\n  declare module.exports: any;\n}\n\ndeclare module 'webpack/lib/DelegatedPlugin' {\n  declare module.exports: any;\n}\n\ndeclare module 'webpack/lib/dependencies/AMDDefineDependency' {\n  declare module.exports: any;\n}\n\ndeclare module 'webpack/lib/dependencies/AMDDefineDependencyParserPlugin' {\n  declare module.exports: any;\n}\n\ndeclare module 'webpack/lib/dependencies/AMDPlugin' {\n  declare module.exports: any;\n}\n\ndeclare module 'webpack/lib/dependencies/AMDRequireArrayDependency' {\n  declare module.exports: any;\n}\n\ndeclare module 'webpack/lib/dependencies/AMDRequireContextDependency' {\n  declare module.exports: any;\n}\n\ndeclare module 'webpack/lib/dependencies/AMDRequireDependenciesBlock' {\n  declare module.exports: any;\n}\n\ndeclare module 'webpack/lib/dependencies/AMDRequireDependenciesBlockParserPlugin' {\n  declare module.exports: any;\n}\n\ndeclare module 'webpack/lib/dependencies/AMDRequireDependency' {\n  declare module.exports: any;\n}\n\ndeclare module 'webpack/lib/dependencies/AMDRequireItemDependency' {\n  declare module.exports: any;\n}\n\ndeclare module 'webpack/lib/dependencies/CommonJsPlugin' {\n  declare module.exports: any;\n}\n\ndeclare module 'webpack/lib/dependencies/CommonJsRequireContextDependency' {\n  declare module.exports: any;\n}\n\ndeclare module 'webpack/lib/dependencies/CommonJsRequireDependency' {\n  declare module.exports: any;\n}\n\ndeclare module 'webpack/lib/dependencies/CommonJsRequireDependencyParserPlugin' {\n  declare module.exports: any;\n}\n\ndeclare module 'webpack/lib/dependencies/ConstDependency' {\n  declare module.exports: any;\n}\n\ndeclare module 'webpack/lib/dependencies/ContextDependency' {\n  declare module.exports: any;\n}\n\ndeclare module 'webpack/lib/dependencies/ContextDependencyHelpers' {\n  declare module.exports: any;\n}\n\ndeclare module 'webpack/lib/dependencies/ContextDependencyTemplateAsId' {\n  declare module.exports: any;\n}\n\ndeclare module 'webpack/lib/dependencies/ContextDependencyTemplateAsRequireCall' {\n  declare module.exports: any;\n}\n\ndeclare module 'webpack/lib/dependencies/ContextElementDependency' {\n  declare module.exports: any;\n}\n\ndeclare module 'webpack/lib/dependencies/CriticalDependencyWarning' {\n  declare module.exports: any;\n}\n\ndeclare module 'webpack/lib/dependencies/DelegatedExportsDependency' {\n  declare module.exports: any;\n}\n\ndeclare module 'webpack/lib/dependencies/DelegatedSourceDependency' {\n  declare module.exports: any;\n}\n\ndeclare module 'webpack/lib/dependencies/DllEntryDependency' {\n  declare module.exports: any;\n}\n\ndeclare module 'webpack/lib/dependencies/getFunctionExpression' {\n  declare module.exports: any;\n}\n\ndeclare module 'webpack/lib/dependencies/HarmonyAcceptDependency' {\n  declare module.exports: any;\n}\n\ndeclare module 'webpack/lib/dependencies/HarmonyAcceptImportDependency' {\n  declare module.exports: any;\n}\n\ndeclare module 'webpack/lib/dependencies/HarmonyCompatibilityDependency' {\n  declare module.exports: any;\n}\n\ndeclare module 'webpack/lib/dependencies/HarmonyDetectionParserPlugin' {\n  declare module.exports: any;\n}\n\ndeclare module 'webpack/lib/dependencies/HarmonyExportDependencyParserPlugin' {\n  declare module.exports: any;\n}\n\ndeclare module 'webpack/lib/dependencies/HarmonyExportExpressionDependency' {\n  declare module.exports: any;\n}\n\ndeclare module 'webpack/lib/dependencies/HarmonyExportHeaderDependency' {\n  declare module.exports: any;\n}\n\ndeclare module 'webpack/lib/dependencies/HarmonyExportImportedSpecifierDependency' {\n  declare module.exports: any;\n}\n\ndeclare module 'webpack/lib/dependencies/HarmonyExportSpecifierDependency' {\n  declare module.exports: any;\n}\n\ndeclare module 'webpack/lib/dependencies/HarmonyImportDependency' {\n  declare module.exports: any;\n}\n\ndeclare module 'webpack/lib/dependencies/HarmonyImportDependencyParserPlugin' {\n  declare module.exports: any;\n}\n\ndeclare module 'webpack/lib/dependencies/HarmonyImportSideEffectDependency' {\n  declare module.exports: any;\n}\n\ndeclare module 'webpack/lib/dependencies/HarmonyImportSpecifierDependency' {\n  declare module.exports: any;\n}\n\ndeclare module 'webpack/lib/dependencies/HarmonyInitDependency' {\n  declare module.exports: any;\n}\n\ndeclare module 'webpack/lib/dependencies/HarmonyModulesPlugin' {\n  declare module.exports: any;\n}\n\ndeclare module 'webpack/lib/dependencies/HarmonyTopLevelThisParserPlugin' {\n  declare module.exports: any;\n}\n\ndeclare module 'webpack/lib/dependencies/ImportContextDependency' {\n  declare module.exports: any;\n}\n\ndeclare module 'webpack/lib/dependencies/ImportDependenciesBlock' {\n  declare module.exports: any;\n}\n\ndeclare module 'webpack/lib/dependencies/ImportDependency' {\n  declare module.exports: any;\n}\n\ndeclare module 'webpack/lib/dependencies/ImportEagerDependency' {\n  declare module.exports: any;\n}\n\ndeclare module 'webpack/lib/dependencies/ImportParserPlugin' {\n  declare module.exports: any;\n}\n\ndeclare module 'webpack/lib/dependencies/ImportPlugin' {\n  declare module.exports: any;\n}\n\ndeclare module 'webpack/lib/dependencies/ImportWeakDependency' {\n  declare module.exports: any;\n}\n\ndeclare module 'webpack/lib/dependencies/JsonExportsDependency' {\n  declare module.exports: any;\n}\n\ndeclare module 'webpack/lib/dependencies/LoaderDependency' {\n  declare module.exports: any;\n}\n\ndeclare module 'webpack/lib/dependencies/LoaderPlugin' {\n  declare module.exports: any;\n}\n\ndeclare module 'webpack/lib/dependencies/LocalModule' {\n  declare module.exports: any;\n}\n\ndeclare module 'webpack/lib/dependencies/LocalModuleDependency' {\n  declare module.exports: any;\n}\n\ndeclare module 'webpack/lib/dependencies/LocalModulesHelpers' {\n  declare module.exports: any;\n}\n\ndeclare module 'webpack/lib/dependencies/ModuleDependency' {\n  declare module.exports: any;\n}\n\ndeclare module 'webpack/lib/dependencies/ModuleDependencyTemplateAsId' {\n  declare module.exports: any;\n}\n\ndeclare module 'webpack/lib/dependencies/ModuleDependencyTemplateAsRequireId' {\n  declare module.exports: any;\n}\n\ndeclare module 'webpack/lib/dependencies/ModuleHotAcceptDependency' {\n  declare module.exports: any;\n}\n\ndeclare module 'webpack/lib/dependencies/ModuleHotDeclineDependency' {\n  declare module.exports: any;\n}\n\ndeclare module 'webpack/lib/dependencies/MultiEntryDependency' {\n  declare module.exports: any;\n}\n\ndeclare module 'webpack/lib/dependencies/NullDependency' {\n  declare module.exports: any;\n}\n\ndeclare module 'webpack/lib/dependencies/PrefetchDependency' {\n  declare module.exports: any;\n}\n\ndeclare module 'webpack/lib/dependencies/RequireContextDependency' {\n  declare module.exports: any;\n}\n\ndeclare module 'webpack/lib/dependencies/RequireContextDependencyParserPlugin' {\n  declare module.exports: any;\n}\n\ndeclare module 'webpack/lib/dependencies/RequireContextPlugin' {\n  declare module.exports: any;\n}\n\ndeclare module 'webpack/lib/dependencies/RequireEnsureDependenciesBlock' {\n  declare module.exports: any;\n}\n\ndeclare module 'webpack/lib/dependencies/RequireEnsureDependenciesBlockParserPlugin' {\n  declare module.exports: any;\n}\n\ndeclare module 'webpack/lib/dependencies/RequireEnsureDependency' {\n  declare module.exports: any;\n}\n\ndeclare module 'webpack/lib/dependencies/RequireEnsureItemDependency' {\n  declare module.exports: any;\n}\n\ndeclare module 'webpack/lib/dependencies/RequireEnsurePlugin' {\n  declare module.exports: any;\n}\n\ndeclare module 'webpack/lib/dependencies/RequireHeaderDependency' {\n  declare module.exports: any;\n}\n\ndeclare module 'webpack/lib/dependencies/RequireIncludeDependency' {\n  declare module.exports: any;\n}\n\ndeclare module 'webpack/lib/dependencies/RequireIncludeDependencyParserPlugin' {\n  declare module.exports: any;\n}\n\ndeclare module 'webpack/lib/dependencies/RequireIncludePlugin' {\n  declare module.exports: any;\n}\n\ndeclare module 'webpack/lib/dependencies/RequireResolveContextDependency' {\n  declare module.exports: any;\n}\n\ndeclare module 'webpack/lib/dependencies/RequireResolveDependency' {\n  declare module.exports: any;\n}\n\ndeclare module 'webpack/lib/dependencies/RequireResolveDependencyParserPlugin' {\n  declare module.exports: any;\n}\n\ndeclare module 'webpack/lib/dependencies/RequireResolveHeaderDependency' {\n  declare module.exports: any;\n}\n\ndeclare module 'webpack/lib/dependencies/SingleEntryDependency' {\n  declare module.exports: any;\n}\n\ndeclare module 'webpack/lib/dependencies/SystemPlugin' {\n  declare module.exports: any;\n}\n\ndeclare module 'webpack/lib/dependencies/UnsupportedDependency' {\n  declare module.exports: any;\n}\n\ndeclare module 'webpack/lib/dependencies/WebAssemblyImportDependency' {\n  declare module.exports: any;\n}\n\ndeclare module 'webpack/lib/dependencies/WebpackMissingModule' {\n  declare module.exports: any;\n}\n\ndeclare module 'webpack/lib/DependenciesBlock' {\n  declare module.exports: any;\n}\n\ndeclare module 'webpack/lib/DependenciesBlockVariable' {\n  declare module.exports: any;\n}\n\ndeclare module 'webpack/lib/Dependency' {\n  declare module.exports: any;\n}\n\ndeclare module 'webpack/lib/DllEntryPlugin' {\n  declare module.exports: any;\n}\n\ndeclare module 'webpack/lib/DllModule' {\n  declare module.exports: any;\n}\n\ndeclare module 'webpack/lib/DllModuleFactory' {\n  declare module.exports: any;\n}\n\ndeclare module 'webpack/lib/DllPlugin' {\n  declare module.exports: any;\n}\n\ndeclare module 'webpack/lib/DllReferencePlugin' {\n  declare module.exports: any;\n}\n\ndeclare module 'webpack/lib/DynamicEntryPlugin' {\n  declare module.exports: any;\n}\n\ndeclare module 'webpack/lib/EntryModuleNotFoundError' {\n  declare module.exports: any;\n}\n\ndeclare module 'webpack/lib/EntryOptionPlugin' {\n  declare module.exports: any;\n}\n\ndeclare module 'webpack/lib/Entrypoint' {\n  declare module.exports: any;\n}\n\ndeclare module 'webpack/lib/EnvironmentPlugin' {\n  declare module.exports: any;\n}\n\ndeclare module 'webpack/lib/ErrorHelpers' {\n  declare module.exports: any;\n}\n\ndeclare module 'webpack/lib/EvalDevToolModulePlugin' {\n  declare module.exports: any;\n}\n\ndeclare module 'webpack/lib/EvalDevToolModuleTemplatePlugin' {\n  declare module.exports: any;\n}\n\ndeclare module 'webpack/lib/EvalSourceMapDevToolModuleTemplatePlugin' {\n  declare module.exports: any;\n}\n\ndeclare module 'webpack/lib/EvalSourceMapDevToolPlugin' {\n  declare module.exports: any;\n}\n\ndeclare module 'webpack/lib/ExportPropertyMainTemplatePlugin' {\n  declare module.exports: any;\n}\n\ndeclare module 'webpack/lib/ExtendedAPIPlugin' {\n  declare module.exports: any;\n}\n\ndeclare module 'webpack/lib/ExternalModule' {\n  declare module.exports: any;\n}\n\ndeclare module 'webpack/lib/ExternalModuleFactoryPlugin' {\n  declare module.exports: any;\n}\n\ndeclare module 'webpack/lib/ExternalsPlugin' {\n  declare module.exports: any;\n}\n\ndeclare module 'webpack/lib/FlagDependencyExportsPlugin' {\n  declare module.exports: any;\n}\n\ndeclare module 'webpack/lib/FlagDependencyUsagePlugin' {\n  declare module.exports: any;\n}\n\ndeclare module 'webpack/lib/FlagInitialModulesAsUsedPlugin' {\n  declare module.exports: any;\n}\n\ndeclare module 'webpack/lib/formatLocation' {\n  declare module.exports: any;\n}\n\ndeclare module 'webpack/lib/FunctionModulePlugin' {\n  declare module.exports: any;\n}\n\ndeclare module 'webpack/lib/FunctionModuleTemplatePlugin' {\n  declare module.exports: any;\n}\n\ndeclare module 'webpack/lib/GraphHelpers' {\n  declare module.exports: any;\n}\n\ndeclare module 'webpack/lib/HashedModuleIdsPlugin' {\n  declare module.exports: any;\n}\n\ndeclare module 'webpack/lib/HotModuleReplacement.runtime' {\n  declare module.exports: any;\n}\n\ndeclare module 'webpack/lib/HotModuleReplacementPlugin' {\n  declare module.exports: any;\n}\n\ndeclare module 'webpack/lib/HotUpdateChunkTemplate' {\n  declare module.exports: any;\n}\n\ndeclare module 'webpack/lib/IgnorePlugin' {\n  declare module.exports: any;\n}\n\ndeclare module 'webpack/lib/JavascriptGenerator' {\n  declare module.exports: any;\n}\n\ndeclare module 'webpack/lib/JavascriptModulesPlugin' {\n  declare module.exports: any;\n}\n\ndeclare module 'webpack/lib/JsonGenerator' {\n  declare module.exports: any;\n}\n\ndeclare module 'webpack/lib/JsonModulesPlugin' {\n  declare module.exports: any;\n}\n\ndeclare module 'webpack/lib/JsonParser' {\n  declare module.exports: any;\n}\n\ndeclare module 'webpack/lib/LibManifestPlugin' {\n  declare module.exports: any;\n}\n\ndeclare module 'webpack/lib/LibraryTemplatePlugin' {\n  declare module.exports: any;\n}\n\ndeclare module 'webpack/lib/LoaderOptionsPlugin' {\n  declare module.exports: any;\n}\n\ndeclare module 'webpack/lib/LoaderTargetPlugin' {\n  declare module.exports: any;\n}\n\ndeclare module 'webpack/lib/MainTemplate' {\n  declare module.exports: any;\n}\n\ndeclare module 'webpack/lib/MemoryOutputFileSystem' {\n  declare module.exports: any;\n}\n\ndeclare module 'webpack/lib/Module' {\n  declare module.exports: any;\n}\n\ndeclare module 'webpack/lib/ModuleBuildError' {\n  declare module.exports: any;\n}\n\ndeclare module 'webpack/lib/ModuleDependencyError' {\n  declare module.exports: any;\n}\n\ndeclare module 'webpack/lib/ModuleDependencyWarning' {\n  declare module.exports: any;\n}\n\ndeclare module 'webpack/lib/ModuleError' {\n  declare module.exports: any;\n}\n\ndeclare module 'webpack/lib/ModuleFilenameHelpers' {\n  declare module.exports: any;\n}\n\ndeclare module 'webpack/lib/ModuleNotFoundError' {\n  declare module.exports: any;\n}\n\ndeclare module 'webpack/lib/ModuleParseError' {\n  declare module.exports: any;\n}\n\ndeclare module 'webpack/lib/ModuleReason' {\n  declare module.exports: any;\n}\n\ndeclare module 'webpack/lib/ModuleTemplate' {\n  declare module.exports: any;\n}\n\ndeclare module 'webpack/lib/ModuleWarning' {\n  declare module.exports: any;\n}\n\ndeclare module 'webpack/lib/MultiCompiler' {\n  declare module.exports: any;\n}\n\ndeclare module 'webpack/lib/MultiEntryPlugin' {\n  declare module.exports: any;\n}\n\ndeclare module 'webpack/lib/MultiModule' {\n  declare module.exports: any;\n}\n\ndeclare module 'webpack/lib/MultiModuleFactory' {\n  declare module.exports: any;\n}\n\ndeclare module 'webpack/lib/MultiStats' {\n  declare module.exports: any;\n}\n\ndeclare module 'webpack/lib/MultiWatching' {\n  declare module.exports: any;\n}\n\ndeclare module 'webpack/lib/NamedChunksPlugin' {\n  declare module.exports: any;\n}\n\ndeclare module 'webpack/lib/NamedModulesPlugin' {\n  declare module.exports: any;\n}\n\ndeclare module 'webpack/lib/node/NodeChunkTemplatePlugin' {\n  declare module.exports: any;\n}\n\ndeclare module 'webpack/lib/node/NodeEnvironmentPlugin' {\n  declare module.exports: any;\n}\n\ndeclare module 'webpack/lib/node/NodeHotUpdateChunkTemplatePlugin' {\n  declare module.exports: any;\n}\n\ndeclare module 'webpack/lib/node/NodeMainTemplate.runtime' {\n  declare module.exports: any;\n}\n\ndeclare module 'webpack/lib/node/NodeMainTemplateAsync.runtime' {\n  declare module.exports: any;\n}\n\ndeclare module 'webpack/lib/node/NodeMainTemplatePlugin' {\n  declare module.exports: any;\n}\n\ndeclare module 'webpack/lib/node/NodeOutputFileSystem' {\n  declare module.exports: any;\n}\n\ndeclare module 'webpack/lib/node/NodeSourcePlugin' {\n  declare module.exports: any;\n}\n\ndeclare module 'webpack/lib/node/NodeTargetPlugin' {\n  declare module.exports: any;\n}\n\ndeclare module 'webpack/lib/node/NodeTemplatePlugin' {\n  declare module.exports: any;\n}\n\ndeclare module 'webpack/lib/node/NodeWatchFileSystem' {\n  declare module.exports: any;\n}\n\ndeclare module 'webpack/lib/node/ReadFileCompileWasmMainTemplatePlugin' {\n  declare module.exports: any;\n}\n\ndeclare module 'webpack/lib/node/ReadFileCompileWasmTemplatePlugin' {\n  declare module.exports: any;\n}\n\ndeclare module 'webpack/lib/NodeStuffPlugin' {\n  declare module.exports: any;\n}\n\ndeclare module 'webpack/lib/NoEmitOnErrorsPlugin' {\n  declare module.exports: any;\n}\n\ndeclare module 'webpack/lib/NoModeWarning' {\n  declare module.exports: any;\n}\n\ndeclare module 'webpack/lib/NormalModule' {\n  declare module.exports: any;\n}\n\ndeclare module 'webpack/lib/NormalModuleFactory' {\n  declare module.exports: any;\n}\n\ndeclare module 'webpack/lib/NormalModuleReplacementPlugin' {\n  declare module.exports: any;\n}\n\ndeclare module 'webpack/lib/NullFactory' {\n  declare module.exports: any;\n}\n\ndeclare module 'webpack/lib/optimize/AggressiveMergingPlugin' {\n  declare module.exports: any;\n}\n\ndeclare module 'webpack/lib/optimize/AggressiveSplittingPlugin' {\n  declare module.exports: any;\n}\n\ndeclare module 'webpack/lib/optimize/ChunkModuleIdRangePlugin' {\n  declare module.exports: any;\n}\n\ndeclare module 'webpack/lib/optimize/ConcatenatedModule' {\n  declare module.exports: any;\n}\n\ndeclare module 'webpack/lib/optimize/EnsureChunkConditionsPlugin' {\n  declare module.exports: any;\n}\n\ndeclare module 'webpack/lib/optimize/FlagIncludedChunksPlugin' {\n  declare module.exports: any;\n}\n\ndeclare module 'webpack/lib/optimize/LimitChunkCountPlugin' {\n  declare module.exports: any;\n}\n\ndeclare module 'webpack/lib/optimize/MergeDuplicateChunksPlugin' {\n  declare module.exports: any;\n}\n\ndeclare module 'webpack/lib/optimize/MinChunkSizePlugin' {\n  declare module.exports: any;\n}\n\ndeclare module 'webpack/lib/optimize/ModuleConcatenationPlugin' {\n  declare module.exports: any;\n}\n\ndeclare module 'webpack/lib/optimize/OccurrenceOrderPlugin' {\n  declare module.exports: any;\n}\n\ndeclare module 'webpack/lib/optimize/RemoveEmptyChunksPlugin' {\n  declare module.exports: any;\n}\n\ndeclare module 'webpack/lib/optimize/RemoveParentModulesPlugin' {\n  declare module.exports: any;\n}\n\ndeclare module 'webpack/lib/optimize/RuntimeChunkPlugin' {\n  declare module.exports: any;\n}\n\ndeclare module 'webpack/lib/optimize/SideEffectsFlagPlugin' {\n  declare module.exports: any;\n}\n\ndeclare module 'webpack/lib/optimize/SplitChunksPlugin' {\n  declare module.exports: any;\n}\n\ndeclare module 'webpack/lib/OptionsApply' {\n  declare module.exports: any;\n}\n\ndeclare module 'webpack/lib/OptionsDefaulter' {\n  declare module.exports: any;\n}\n\ndeclare module 'webpack/lib/Parser' {\n  declare module.exports: any;\n}\n\ndeclare module 'webpack/lib/ParserHelpers' {\n  declare module.exports: any;\n}\n\ndeclare module 'webpack/lib/performance/AssetsOverSizeLimitWarning' {\n  declare module.exports: any;\n}\n\ndeclare module 'webpack/lib/performance/EntrypointsOverSizeLimitWarning' {\n  declare module.exports: any;\n}\n\ndeclare module 'webpack/lib/performance/NoAsyncChunksWarning' {\n  declare module.exports: any;\n}\n\ndeclare module 'webpack/lib/performance/SizeLimitsPlugin' {\n  declare module.exports: any;\n}\n\ndeclare module 'webpack/lib/PrefetchPlugin' {\n  declare module.exports: any;\n}\n\ndeclare module 'webpack/lib/prepareOptions' {\n  declare module.exports: any;\n}\n\ndeclare module 'webpack/lib/ProgressPlugin' {\n  declare module.exports: any;\n}\n\ndeclare module 'webpack/lib/ProvidePlugin' {\n  declare module.exports: any;\n}\n\ndeclare module 'webpack/lib/RawModule' {\n  declare module.exports: any;\n}\n\ndeclare module 'webpack/lib/RecordIdsPlugin' {\n  declare module.exports: any;\n}\n\ndeclare module 'webpack/lib/RemovedPluginError' {\n  declare module.exports: any;\n}\n\ndeclare module 'webpack/lib/RequestShortener' {\n  declare module.exports: any;\n}\n\ndeclare module 'webpack/lib/RequireJsStuffPlugin' {\n  declare module.exports: any;\n}\n\ndeclare module 'webpack/lib/ResolverFactory' {\n  declare module.exports: any;\n}\n\ndeclare module 'webpack/lib/RuleSet' {\n  declare module.exports: any;\n}\n\ndeclare module 'webpack/lib/RuntimeTemplate' {\n  declare module.exports: any;\n}\n\ndeclare module 'webpack/lib/SetVarMainTemplatePlugin' {\n  declare module.exports: any;\n}\n\ndeclare module 'webpack/lib/SingleEntryPlugin' {\n  declare module.exports: any;\n}\n\ndeclare module 'webpack/lib/SizeFormatHelpers' {\n  declare module.exports: any;\n}\n\ndeclare module 'webpack/lib/SourceMapDevToolModuleOptionsPlugin' {\n  declare module.exports: any;\n}\n\ndeclare module 'webpack/lib/SourceMapDevToolPlugin' {\n  declare module.exports: any;\n}\n\ndeclare module 'webpack/lib/Stats' {\n  declare module.exports: any;\n}\n\ndeclare module 'webpack/lib/Template' {\n  declare module.exports: any;\n}\n\ndeclare module 'webpack/lib/TemplatedPathPlugin' {\n  declare module.exports: any;\n}\n\ndeclare module 'webpack/lib/UmdMainTemplatePlugin' {\n  declare module.exports: any;\n}\n\ndeclare module 'webpack/lib/UnsupportedFeatureWarning' {\n  declare module.exports: any;\n}\n\ndeclare module 'webpack/lib/UseStrictPlugin' {\n  declare module.exports: any;\n}\n\ndeclare module 'webpack/lib/util/cachedMerge' {\n  declare module.exports: any;\n}\n\ndeclare module 'webpack/lib/util/createHash' {\n  declare module.exports: any;\n}\n\ndeclare module 'webpack/lib/util/identifier' {\n  declare module.exports: any;\n}\n\ndeclare module 'webpack/lib/util/objectToMap' {\n  declare module.exports: any;\n}\n\ndeclare module 'webpack/lib/util/Queue' {\n  declare module.exports: any;\n}\n\ndeclare module 'webpack/lib/util/Semaphore' {\n  declare module.exports: any;\n}\n\ndeclare module 'webpack/lib/util/SetHelpers' {\n  declare module.exports: any;\n}\n\ndeclare module 'webpack/lib/util/SortableSet' {\n  declare module.exports: any;\n}\n\ndeclare module 'webpack/lib/util/StackedSetMap' {\n  declare module.exports: any;\n}\n\ndeclare module 'webpack/lib/util/TrackingSet' {\n  declare module.exports: any;\n}\n\ndeclare module 'webpack/lib/validateSchema' {\n  declare module.exports: any;\n}\n\ndeclare module 'webpack/lib/WarnCaseSensitiveModulesPlugin' {\n  declare module.exports: any;\n}\n\ndeclare module 'webpack/lib/WarnNoModeSetPlugin' {\n  declare module.exports: any;\n}\n\ndeclare module 'webpack/lib/wasm/WasmModuleTemplatePlugin' {\n  declare module.exports: any;\n}\n\ndeclare module 'webpack/lib/WatchIgnorePlugin' {\n  declare module.exports: any;\n}\n\ndeclare module 'webpack/lib/Watching' {\n  declare module.exports: any;\n}\n\ndeclare module 'webpack/lib/web/FetchCompileWasmMainTemplatePlugin' {\n  declare module.exports: any;\n}\n\ndeclare module 'webpack/lib/web/FetchCompileWasmTemplatePlugin' {\n  declare module.exports: any;\n}\n\ndeclare module 'webpack/lib/web/JsonpChunkTemplatePlugin' {\n  declare module.exports: any;\n}\n\ndeclare module 'webpack/lib/web/JsonpExportMainTemplatePlugin' {\n  declare module.exports: any;\n}\n\ndeclare module 'webpack/lib/web/JsonpHotUpdateChunkTemplatePlugin' {\n  declare module.exports: any;\n}\n\ndeclare module 'webpack/lib/web/JsonpMainTemplate.runtime' {\n  declare module.exports: any;\n}\n\ndeclare module 'webpack/lib/web/JsonpMainTemplatePlugin' {\n  declare module.exports: any;\n}\n\ndeclare module 'webpack/lib/web/JsonpTemplatePlugin' {\n  declare module.exports: any;\n}\n\ndeclare module 'webpack/lib/web/WebEnvironmentPlugin' {\n  declare module.exports: any;\n}\n\ndeclare module 'webpack/lib/WebAssemblyGenerator' {\n  declare module.exports: any;\n}\n\ndeclare module 'webpack/lib/WebAssemblyModulesPlugin' {\n  declare module.exports: any;\n}\n\ndeclare module 'webpack/lib/WebAssemblyParser' {\n  declare module.exports: any;\n}\n\ndeclare module 'webpack/lib/webpack' {\n  declare module.exports: any;\n}\n\ndeclare module 'webpack/lib/webpack.web' {\n  declare module.exports: any;\n}\n\ndeclare module 'webpack/lib/WebpackError' {\n  declare module.exports: any;\n}\n\ndeclare module 'webpack/lib/WebpackOptionsApply' {\n  declare module.exports: any;\n}\n\ndeclare module 'webpack/lib/WebpackOptionsDefaulter' {\n  declare module.exports: any;\n}\n\ndeclare module 'webpack/lib/WebpackOptionsValidationError' {\n  declare module.exports: any;\n}\n\ndeclare module 'webpack/lib/webworker/WebWorkerChunkTemplatePlugin' {\n  declare module.exports: any;\n}\n\ndeclare module 'webpack/lib/webworker/WebWorkerHotUpdateChunkTemplatePlugin' {\n  declare module.exports: any;\n}\n\ndeclare module 'webpack/lib/webworker/WebWorkerMainTemplate.runtime' {\n  declare module.exports: any;\n}\n\ndeclare module 'webpack/lib/webworker/WebWorkerMainTemplatePlugin' {\n  declare module.exports: any;\n}\n\ndeclare module 'webpack/lib/webworker/WebWorkerTemplatePlugin' {\n  declare module.exports: any;\n}\n\ndeclare module 'webpack/schemas/ajv.absolutePath' {\n  declare module.exports: any;\n}\n\ndeclare module 'webpack/web_modules/node-libs-browser' {\n  declare module.exports: any;\n}\n\n// Filename aliases\ndeclare module 'webpack/bin/webpack.js' {\n  declare module.exports: $Exports<'webpack/bin/webpack'>;\n}\ndeclare module 'webpack/buildin/amd-define.js' {\n  declare module.exports: $Exports<'webpack/buildin/amd-define'>;\n}\ndeclare module 'webpack/buildin/amd-options.js' {\n  declare module.exports: $Exports<'webpack/buildin/amd-options'>;\n}\ndeclare module 'webpack/buildin/global.js' {\n  declare module.exports: $Exports<'webpack/buildin/global'>;\n}\ndeclare module 'webpack/buildin/harmony-module.js' {\n  declare module.exports: $Exports<'webpack/buildin/harmony-module'>;\n}\ndeclare module 'webpack/buildin/module.js' {\n  declare module.exports: $Exports<'webpack/buildin/module'>;\n}\ndeclare module 'webpack/buildin/system.js' {\n  declare module.exports: $Exports<'webpack/buildin/system'>;\n}\ndeclare module 'webpack/hot/dev-server.js' {\n  declare module.exports: $Exports<'webpack/hot/dev-server'>;\n}\ndeclare module 'webpack/hot/emitter.js' {\n  declare module.exports: $Exports<'webpack/hot/emitter'>;\n}\ndeclare module 'webpack/hot/log-apply-result.js' {\n  declare module.exports: $Exports<'webpack/hot/log-apply-result'>;\n}\ndeclare module 'webpack/hot/log.js' {\n  declare module.exports: $Exports<'webpack/hot/log'>;\n}\ndeclare module 'webpack/hot/only-dev-server.js' {\n  declare module.exports: $Exports<'webpack/hot/only-dev-server'>;\n}\ndeclare module 'webpack/hot/poll.js' {\n  declare module.exports: $Exports<'webpack/hot/poll'>;\n}\ndeclare module 'webpack/hot/signal.js' {\n  declare module.exports: $Exports<'webpack/hot/signal'>;\n}\ndeclare module 'webpack/lib/AmdMainTemplatePlugin.js' {\n  declare module.exports: $Exports<'webpack/lib/AmdMainTemplatePlugin'>;\n}\ndeclare module 'webpack/lib/APIPlugin.js' {\n  declare module.exports: $Exports<'webpack/lib/APIPlugin'>;\n}\ndeclare module 'webpack/lib/AsyncDependenciesBlock.js' {\n  declare module.exports: $Exports<'webpack/lib/AsyncDependenciesBlock'>;\n}\ndeclare module 'webpack/lib/AsyncDependencyToInitialChunkError.js' {\n  declare module.exports: $Exports<'webpack/lib/AsyncDependencyToInitialChunkError'>;\n}\ndeclare module 'webpack/lib/AutomaticPrefetchPlugin.js' {\n  declare module.exports: $Exports<'webpack/lib/AutomaticPrefetchPlugin'>;\n}\ndeclare module 'webpack/lib/BannerPlugin.js' {\n  declare module.exports: $Exports<'webpack/lib/BannerPlugin'>;\n}\ndeclare module 'webpack/lib/BasicEvaluatedExpression.js' {\n  declare module.exports: $Exports<'webpack/lib/BasicEvaluatedExpression'>;\n}\ndeclare module 'webpack/lib/CachePlugin.js' {\n  declare module.exports: $Exports<'webpack/lib/CachePlugin'>;\n}\ndeclare module 'webpack/lib/CaseSensitiveModulesWarning.js' {\n  declare module.exports: $Exports<'webpack/lib/CaseSensitiveModulesWarning'>;\n}\ndeclare module 'webpack/lib/Chunk.js' {\n  declare module.exports: $Exports<'webpack/lib/Chunk'>;\n}\ndeclare module 'webpack/lib/ChunkGroup.js' {\n  declare module.exports: $Exports<'webpack/lib/ChunkGroup'>;\n}\ndeclare module 'webpack/lib/ChunkRenderError.js' {\n  declare module.exports: $Exports<'webpack/lib/ChunkRenderError'>;\n}\ndeclare module 'webpack/lib/ChunkTemplate.js' {\n  declare module.exports: $Exports<'webpack/lib/ChunkTemplate'>;\n}\ndeclare module 'webpack/lib/compareLocations.js' {\n  declare module.exports: $Exports<'webpack/lib/compareLocations'>;\n}\ndeclare module 'webpack/lib/CompatibilityPlugin.js' {\n  declare module.exports: $Exports<'webpack/lib/CompatibilityPlugin'>;\n}\ndeclare module 'webpack/lib/Compilation.js' {\n  declare module.exports: $Exports<'webpack/lib/Compilation'>;\n}\ndeclare module 'webpack/lib/Compiler.js' {\n  declare module.exports: $Exports<'webpack/lib/Compiler'>;\n}\ndeclare module 'webpack/lib/ConstPlugin.js' {\n  declare module.exports: $Exports<'webpack/lib/ConstPlugin'>;\n}\ndeclare module 'webpack/lib/ContextExclusionPlugin.js' {\n  declare module.exports: $Exports<'webpack/lib/ContextExclusionPlugin'>;\n}\ndeclare module 'webpack/lib/ContextModule.js' {\n  declare module.exports: $Exports<'webpack/lib/ContextModule'>;\n}\ndeclare module 'webpack/lib/ContextModuleFactory.js' {\n  declare module.exports: $Exports<'webpack/lib/ContextModuleFactory'>;\n}\ndeclare module 'webpack/lib/ContextReplacementPlugin.js' {\n  declare module.exports: $Exports<'webpack/lib/ContextReplacementPlugin'>;\n}\ndeclare module 'webpack/lib/debug/ProfilingPlugin.js' {\n  declare module.exports: $Exports<'webpack/lib/debug/ProfilingPlugin'>;\n}\ndeclare module 'webpack/lib/DefinePlugin.js' {\n  declare module.exports: $Exports<'webpack/lib/DefinePlugin'>;\n}\ndeclare module 'webpack/lib/DelegatedModule.js' {\n  declare module.exports: $Exports<'webpack/lib/DelegatedModule'>;\n}\ndeclare module 'webpack/lib/DelegatedModuleFactoryPlugin.js' {\n  declare module.exports: $Exports<'webpack/lib/DelegatedModuleFactoryPlugin'>;\n}\ndeclare module 'webpack/lib/DelegatedPlugin.js' {\n  declare module.exports: $Exports<'webpack/lib/DelegatedPlugin'>;\n}\ndeclare module 'webpack/lib/dependencies/AMDDefineDependency.js' {\n  declare module.exports: $Exports<'webpack/lib/dependencies/AMDDefineDependency'>;\n}\ndeclare module 'webpack/lib/dependencies/AMDDefineDependencyParserPlugin.js' {\n  declare module.exports: $Exports<'webpack/lib/dependencies/AMDDefineDependencyParserPlugin'>;\n}\ndeclare module 'webpack/lib/dependencies/AMDPlugin.js' {\n  declare module.exports: $Exports<'webpack/lib/dependencies/AMDPlugin'>;\n}\ndeclare module 'webpack/lib/dependencies/AMDRequireArrayDependency.js' {\n  declare module.exports: $Exports<'webpack/lib/dependencies/AMDRequireArrayDependency'>;\n}\ndeclare module 'webpack/lib/dependencies/AMDRequireContextDependency.js' {\n  declare module.exports: $Exports<'webpack/lib/dependencies/AMDRequireContextDependency'>;\n}\ndeclare module 'webpack/lib/dependencies/AMDRequireDependenciesBlock.js' {\n  declare module.exports: $Exports<'webpack/lib/dependencies/AMDRequireDependenciesBlock'>;\n}\ndeclare module 'webpack/lib/dependencies/AMDRequireDependenciesBlockParserPlugin.js' {\n  declare module.exports: $Exports<'webpack/lib/dependencies/AMDRequireDependenciesBlockParserPlugin'>;\n}\ndeclare module 'webpack/lib/dependencies/AMDRequireDependency.js' {\n  declare module.exports: $Exports<'webpack/lib/dependencies/AMDRequireDependency'>;\n}\ndeclare module 'webpack/lib/dependencies/AMDRequireItemDependency.js' {\n  declare module.exports: $Exports<'webpack/lib/dependencies/AMDRequireItemDependency'>;\n}\ndeclare module 'webpack/lib/dependencies/CommonJsPlugin.js' {\n  declare module.exports: $Exports<'webpack/lib/dependencies/CommonJsPlugin'>;\n}\ndeclare module 'webpack/lib/dependencies/CommonJsRequireContextDependency.js' {\n  declare module.exports: $Exports<'webpack/lib/dependencies/CommonJsRequireContextDependency'>;\n}\ndeclare module 'webpack/lib/dependencies/CommonJsRequireDependency.js' {\n  declare module.exports: $Exports<'webpack/lib/dependencies/CommonJsRequireDependency'>;\n}\ndeclare module 'webpack/lib/dependencies/CommonJsRequireDependencyParserPlugin.js' {\n  declare module.exports: $Exports<'webpack/lib/dependencies/CommonJsRequireDependencyParserPlugin'>;\n}\ndeclare module 'webpack/lib/dependencies/ConstDependency.js' {\n  declare module.exports: $Exports<'webpack/lib/dependencies/ConstDependency'>;\n}\ndeclare module 'webpack/lib/dependencies/ContextDependency.js' {\n  declare module.exports: $Exports<'webpack/lib/dependencies/ContextDependency'>;\n}\ndeclare module 'webpack/lib/dependencies/ContextDependencyHelpers.js' {\n  declare module.exports: $Exports<'webpack/lib/dependencies/ContextDependencyHelpers'>;\n}\ndeclare module 'webpack/lib/dependencies/ContextDependencyTemplateAsId.js' {\n  declare module.exports: $Exports<'webpack/lib/dependencies/ContextDependencyTemplateAsId'>;\n}\ndeclare module 'webpack/lib/dependencies/ContextDependencyTemplateAsRequireCall.js' {\n  declare module.exports: $Exports<'webpack/lib/dependencies/ContextDependencyTemplateAsRequireCall'>;\n}\ndeclare module 'webpack/lib/dependencies/ContextElementDependency.js' {\n  declare module.exports: $Exports<'webpack/lib/dependencies/ContextElementDependency'>;\n}\ndeclare module 'webpack/lib/dependencies/CriticalDependencyWarning.js' {\n  declare module.exports: $Exports<'webpack/lib/dependencies/CriticalDependencyWarning'>;\n}\ndeclare module 'webpack/lib/dependencies/DelegatedExportsDependency.js' {\n  declare module.exports: $Exports<'webpack/lib/dependencies/DelegatedExportsDependency'>;\n}\ndeclare module 'webpack/lib/dependencies/DelegatedSourceDependency.js' {\n  declare module.exports: $Exports<'webpack/lib/dependencies/DelegatedSourceDependency'>;\n}\ndeclare module 'webpack/lib/dependencies/DllEntryDependency.js' {\n  declare module.exports: $Exports<'webpack/lib/dependencies/DllEntryDependency'>;\n}\ndeclare module 'webpack/lib/dependencies/getFunctionExpression.js' {\n  declare module.exports: $Exports<'webpack/lib/dependencies/getFunctionExpression'>;\n}\ndeclare module 'webpack/lib/dependencies/HarmonyAcceptDependency.js' {\n  declare module.exports: $Exports<'webpack/lib/dependencies/HarmonyAcceptDependency'>;\n}\ndeclare module 'webpack/lib/dependencies/HarmonyAcceptImportDependency.js' {\n  declare module.exports: $Exports<'webpack/lib/dependencies/HarmonyAcceptImportDependency'>;\n}\ndeclare module 'webpack/lib/dependencies/HarmonyCompatibilityDependency.js' {\n  declare module.exports: $Exports<'webpack/lib/dependencies/HarmonyCompatibilityDependency'>;\n}\ndeclare module 'webpack/lib/dependencies/HarmonyDetectionParserPlugin.js' {\n  declare module.exports: $Exports<'webpack/lib/dependencies/HarmonyDetectionParserPlugin'>;\n}\ndeclare module 'webpack/lib/dependencies/HarmonyExportDependencyParserPlugin.js' {\n  declare module.exports: $Exports<'webpack/lib/dependencies/HarmonyExportDependencyParserPlugin'>;\n}\ndeclare module 'webpack/lib/dependencies/HarmonyExportExpressionDependency.js' {\n  declare module.exports: $Exports<'webpack/lib/dependencies/HarmonyExportExpressionDependency'>;\n}\ndeclare module 'webpack/lib/dependencies/HarmonyExportHeaderDependency.js' {\n  declare module.exports: $Exports<'webpack/lib/dependencies/HarmonyExportHeaderDependency'>;\n}\ndeclare module 'webpack/lib/dependencies/HarmonyExportImportedSpecifierDependency.js' {\n  declare module.exports: $Exports<'webpack/lib/dependencies/HarmonyExportImportedSpecifierDependency'>;\n}\ndeclare module 'webpack/lib/dependencies/HarmonyExportSpecifierDependency.js' {\n  declare module.exports: $Exports<'webpack/lib/dependencies/HarmonyExportSpecifierDependency'>;\n}\ndeclare module 'webpack/lib/dependencies/HarmonyImportDependency.js' {\n  declare module.exports: $Exports<'webpack/lib/dependencies/HarmonyImportDependency'>;\n}\ndeclare module 'webpack/lib/dependencies/HarmonyImportDependencyParserPlugin.js' {\n  declare module.exports: $Exports<'webpack/lib/dependencies/HarmonyImportDependencyParserPlugin'>;\n}\ndeclare module 'webpack/lib/dependencies/HarmonyImportSideEffectDependency.js' {\n  declare module.exports: $Exports<'webpack/lib/dependencies/HarmonyImportSideEffectDependency'>;\n}\ndeclare module 'webpack/lib/dependencies/HarmonyImportSpecifierDependency.js' {\n  declare module.exports: $Exports<'webpack/lib/dependencies/HarmonyImportSpecifierDependency'>;\n}\ndeclare module 'webpack/lib/dependencies/HarmonyInitDependency.js' {\n  declare module.exports: $Exports<'webpack/lib/dependencies/HarmonyInitDependency'>;\n}\ndeclare module 'webpack/lib/dependencies/HarmonyModulesPlugin.js' {\n  declare module.exports: $Exports<'webpack/lib/dependencies/HarmonyModulesPlugin'>;\n}\ndeclare module 'webpack/lib/dependencies/HarmonyTopLevelThisParserPlugin.js' {\n  declare module.exports: $Exports<'webpack/lib/dependencies/HarmonyTopLevelThisParserPlugin'>;\n}\ndeclare module 'webpack/lib/dependencies/ImportContextDependency.js' {\n  declare module.exports: $Exports<'webpack/lib/dependencies/ImportContextDependency'>;\n}\ndeclare module 'webpack/lib/dependencies/ImportDependenciesBlock.js' {\n  declare module.exports: $Exports<'webpack/lib/dependencies/ImportDependenciesBlock'>;\n}\ndeclare module 'webpack/lib/dependencies/ImportDependency.js' {\n  declare module.exports: $Exports<'webpack/lib/dependencies/ImportDependency'>;\n}\ndeclare module 'webpack/lib/dependencies/ImportEagerDependency.js' {\n  declare module.exports: $Exports<'webpack/lib/dependencies/ImportEagerDependency'>;\n}\ndeclare module 'webpack/lib/dependencies/ImportParserPlugin.js' {\n  declare module.exports: $Exports<'webpack/lib/dependencies/ImportParserPlugin'>;\n}\ndeclare module 'webpack/lib/dependencies/ImportPlugin.js' {\n  declare module.exports: $Exports<'webpack/lib/dependencies/ImportPlugin'>;\n}\ndeclare module 'webpack/lib/dependencies/ImportWeakDependency.js' {\n  declare module.exports: $Exports<'webpack/lib/dependencies/ImportWeakDependency'>;\n}\ndeclare module 'webpack/lib/dependencies/JsonExportsDependency.js' {\n  declare module.exports: $Exports<'webpack/lib/dependencies/JsonExportsDependency'>;\n}\ndeclare module 'webpack/lib/dependencies/LoaderDependency.js' {\n  declare module.exports: $Exports<'webpack/lib/dependencies/LoaderDependency'>;\n}\ndeclare module 'webpack/lib/dependencies/LoaderPlugin.js' {\n  declare module.exports: $Exports<'webpack/lib/dependencies/LoaderPlugin'>;\n}\ndeclare module 'webpack/lib/dependencies/LocalModule.js' {\n  declare module.exports: $Exports<'webpack/lib/dependencies/LocalModule'>;\n}\ndeclare module 'webpack/lib/dependencies/LocalModuleDependency.js' {\n  declare module.exports: $Exports<'webpack/lib/dependencies/LocalModuleDependency'>;\n}\ndeclare module 'webpack/lib/dependencies/LocalModulesHelpers.js' {\n  declare module.exports: $Exports<'webpack/lib/dependencies/LocalModulesHelpers'>;\n}\ndeclare module 'webpack/lib/dependencies/ModuleDependency.js' {\n  declare module.exports: $Exports<'webpack/lib/dependencies/ModuleDependency'>;\n}\ndeclare module 'webpack/lib/dependencies/ModuleDependencyTemplateAsId.js' {\n  declare module.exports: $Exports<'webpack/lib/dependencies/ModuleDependencyTemplateAsId'>;\n}\ndeclare module 'webpack/lib/dependencies/ModuleDependencyTemplateAsRequireId.js' {\n  declare module.exports: $Exports<'webpack/lib/dependencies/ModuleDependencyTemplateAsRequireId'>;\n}\ndeclare module 'webpack/lib/dependencies/ModuleHotAcceptDependency.js' {\n  declare module.exports: $Exports<'webpack/lib/dependencies/ModuleHotAcceptDependency'>;\n}\ndeclare module 'webpack/lib/dependencies/ModuleHotDeclineDependency.js' {\n  declare module.exports: $Exports<'webpack/lib/dependencies/ModuleHotDeclineDependency'>;\n}\ndeclare module 'webpack/lib/dependencies/MultiEntryDependency.js' {\n  declare module.exports: $Exports<'webpack/lib/dependencies/MultiEntryDependency'>;\n}\ndeclare module 'webpack/lib/dependencies/NullDependency.js' {\n  declare module.exports: $Exports<'webpack/lib/dependencies/NullDependency'>;\n}\ndeclare module 'webpack/lib/dependencies/PrefetchDependency.js' {\n  declare module.exports: $Exports<'webpack/lib/dependencies/PrefetchDependency'>;\n}\ndeclare module 'webpack/lib/dependencies/RequireContextDependency.js' {\n  declare module.exports: $Exports<'webpack/lib/dependencies/RequireContextDependency'>;\n}\ndeclare module 'webpack/lib/dependencies/RequireContextDependencyParserPlugin.js' {\n  declare module.exports: $Exports<'webpack/lib/dependencies/RequireContextDependencyParserPlugin'>;\n}\ndeclare module 'webpack/lib/dependencies/RequireContextPlugin.js' {\n  declare module.exports: $Exports<'webpack/lib/dependencies/RequireContextPlugin'>;\n}\ndeclare module 'webpack/lib/dependencies/RequireEnsureDependenciesBlock.js' {\n  declare module.exports: $Exports<'webpack/lib/dependencies/RequireEnsureDependenciesBlock'>;\n}\ndeclare module 'webpack/lib/dependencies/RequireEnsureDependenciesBlockParserPlugin.js' {\n  declare module.exports: $Exports<'webpack/lib/dependencies/RequireEnsureDependenciesBlockParserPlugin'>;\n}\ndeclare module 'webpack/lib/dependencies/RequireEnsureDependency.js' {\n  declare module.exports: $Exports<'webpack/lib/dependencies/RequireEnsureDependency'>;\n}\ndeclare module 'webpack/lib/dependencies/RequireEnsureItemDependency.js' {\n  declare module.exports: $Exports<'webpack/lib/dependencies/RequireEnsureItemDependency'>;\n}\ndeclare module 'webpack/lib/dependencies/RequireEnsurePlugin.js' {\n  declare module.exports: $Exports<'webpack/lib/dependencies/RequireEnsurePlugin'>;\n}\ndeclare module 'webpack/lib/dependencies/RequireHeaderDependency.js' {\n  declare module.exports: $Exports<'webpack/lib/dependencies/RequireHeaderDependency'>;\n}\ndeclare module 'webpack/lib/dependencies/RequireIncludeDependency.js' {\n  declare module.exports: $Exports<'webpack/lib/dependencies/RequireIncludeDependency'>;\n}\ndeclare module 'webpack/lib/dependencies/RequireIncludeDependencyParserPlugin.js' {\n  declare module.exports: $Exports<'webpack/lib/dependencies/RequireIncludeDependencyParserPlugin'>;\n}\ndeclare module 'webpack/lib/dependencies/RequireIncludePlugin.js' {\n  declare module.exports: $Exports<'webpack/lib/dependencies/RequireIncludePlugin'>;\n}\ndeclare module 'webpack/lib/dependencies/RequireResolveContextDependency.js' {\n  declare module.exports: $Exports<'webpack/lib/dependencies/RequireResolveContextDependency'>;\n}\ndeclare module 'webpack/lib/dependencies/RequireResolveDependency.js' {\n  declare module.exports: $Exports<'webpack/lib/dependencies/RequireResolveDependency'>;\n}\ndeclare module 'webpack/lib/dependencies/RequireResolveDependencyParserPlugin.js' {\n  declare module.exports: $Exports<'webpack/lib/dependencies/RequireResolveDependencyParserPlugin'>;\n}\ndeclare module 'webpack/lib/dependencies/RequireResolveHeaderDependency.js' {\n  declare module.exports: $Exports<'webpack/lib/dependencies/RequireResolveHeaderDependency'>;\n}\ndeclare module 'webpack/lib/dependencies/SingleEntryDependency.js' {\n  declare module.exports: $Exports<'webpack/lib/dependencies/SingleEntryDependency'>;\n}\ndeclare module 'webpack/lib/dependencies/SystemPlugin.js' {\n  declare module.exports: $Exports<'webpack/lib/dependencies/SystemPlugin'>;\n}\ndeclare module 'webpack/lib/dependencies/UnsupportedDependency.js' {\n  declare module.exports: $Exports<'webpack/lib/dependencies/UnsupportedDependency'>;\n}\ndeclare module 'webpack/lib/dependencies/WebAssemblyImportDependency.js' {\n  declare module.exports: $Exports<'webpack/lib/dependencies/WebAssemblyImportDependency'>;\n}\ndeclare module 'webpack/lib/dependencies/WebpackMissingModule.js' {\n  declare module.exports: $Exports<'webpack/lib/dependencies/WebpackMissingModule'>;\n}\ndeclare module 'webpack/lib/DependenciesBlock.js' {\n  declare module.exports: $Exports<'webpack/lib/DependenciesBlock'>;\n}\ndeclare module 'webpack/lib/DependenciesBlockVariable.js' {\n  declare module.exports: $Exports<'webpack/lib/DependenciesBlockVariable'>;\n}\ndeclare module 'webpack/lib/Dependency.js' {\n  declare module.exports: $Exports<'webpack/lib/Dependency'>;\n}\ndeclare module 'webpack/lib/DllEntryPlugin.js' {\n  declare module.exports: $Exports<'webpack/lib/DllEntryPlugin'>;\n}\ndeclare module 'webpack/lib/DllModule.js' {\n  declare module.exports: $Exports<'webpack/lib/DllModule'>;\n}\ndeclare module 'webpack/lib/DllModuleFactory.js' {\n  declare module.exports: $Exports<'webpack/lib/DllModuleFactory'>;\n}\ndeclare module 'webpack/lib/DllPlugin.js' {\n  declare module.exports: $Exports<'webpack/lib/DllPlugin'>;\n}\ndeclare module 'webpack/lib/DllReferencePlugin.js' {\n  declare module.exports: $Exports<'webpack/lib/DllReferencePlugin'>;\n}\ndeclare module 'webpack/lib/DynamicEntryPlugin.js' {\n  declare module.exports: $Exports<'webpack/lib/DynamicEntryPlugin'>;\n}\ndeclare module 'webpack/lib/EntryModuleNotFoundError.js' {\n  declare module.exports: $Exports<'webpack/lib/EntryModuleNotFoundError'>;\n}\ndeclare module 'webpack/lib/EntryOptionPlugin.js' {\n  declare module.exports: $Exports<'webpack/lib/EntryOptionPlugin'>;\n}\ndeclare module 'webpack/lib/Entrypoint.js' {\n  declare module.exports: $Exports<'webpack/lib/Entrypoint'>;\n}\ndeclare module 'webpack/lib/EnvironmentPlugin.js' {\n  declare module.exports: $Exports<'webpack/lib/EnvironmentPlugin'>;\n}\ndeclare module 'webpack/lib/ErrorHelpers.js' {\n  declare module.exports: $Exports<'webpack/lib/ErrorHelpers'>;\n}\ndeclare module 'webpack/lib/EvalDevToolModulePlugin.js' {\n  declare module.exports: $Exports<'webpack/lib/EvalDevToolModulePlugin'>;\n}\ndeclare module 'webpack/lib/EvalDevToolModuleTemplatePlugin.js' {\n  declare module.exports: $Exports<'webpack/lib/EvalDevToolModuleTemplatePlugin'>;\n}\ndeclare module 'webpack/lib/EvalSourceMapDevToolModuleTemplatePlugin.js' {\n  declare module.exports: $Exports<'webpack/lib/EvalSourceMapDevToolModuleTemplatePlugin'>;\n}\ndeclare module 'webpack/lib/EvalSourceMapDevToolPlugin.js' {\n  declare module.exports: $Exports<'webpack/lib/EvalSourceMapDevToolPlugin'>;\n}\ndeclare module 'webpack/lib/ExportPropertyMainTemplatePlugin.js' {\n  declare module.exports: $Exports<'webpack/lib/ExportPropertyMainTemplatePlugin'>;\n}\ndeclare module 'webpack/lib/ExtendedAPIPlugin.js' {\n  declare module.exports: $Exports<'webpack/lib/ExtendedAPIPlugin'>;\n}\ndeclare module 'webpack/lib/ExternalModule.js' {\n  declare module.exports: $Exports<'webpack/lib/ExternalModule'>;\n}\ndeclare module 'webpack/lib/ExternalModuleFactoryPlugin.js' {\n  declare module.exports: $Exports<'webpack/lib/ExternalModuleFactoryPlugin'>;\n}\ndeclare module 'webpack/lib/ExternalsPlugin.js' {\n  declare module.exports: $Exports<'webpack/lib/ExternalsPlugin'>;\n}\ndeclare module 'webpack/lib/FlagDependencyExportsPlugin.js' {\n  declare module.exports: $Exports<'webpack/lib/FlagDependencyExportsPlugin'>;\n}\ndeclare module 'webpack/lib/FlagDependencyUsagePlugin.js' {\n  declare module.exports: $Exports<'webpack/lib/FlagDependencyUsagePlugin'>;\n}\ndeclare module 'webpack/lib/FlagInitialModulesAsUsedPlugin.js' {\n  declare module.exports: $Exports<'webpack/lib/FlagInitialModulesAsUsedPlugin'>;\n}\ndeclare module 'webpack/lib/formatLocation.js' {\n  declare module.exports: $Exports<'webpack/lib/formatLocation'>;\n}\ndeclare module 'webpack/lib/FunctionModulePlugin.js' {\n  declare module.exports: $Exports<'webpack/lib/FunctionModulePlugin'>;\n}\ndeclare module 'webpack/lib/FunctionModuleTemplatePlugin.js' {\n  declare module.exports: $Exports<'webpack/lib/FunctionModuleTemplatePlugin'>;\n}\ndeclare module 'webpack/lib/GraphHelpers.js' {\n  declare module.exports: $Exports<'webpack/lib/GraphHelpers'>;\n}\ndeclare module 'webpack/lib/HashedModuleIdsPlugin.js' {\n  declare module.exports: $Exports<'webpack/lib/HashedModuleIdsPlugin'>;\n}\ndeclare module 'webpack/lib/HotModuleReplacement.runtime.js' {\n  declare module.exports: $Exports<'webpack/lib/HotModuleReplacement.runtime'>;\n}\ndeclare module 'webpack/lib/HotModuleReplacementPlugin.js' {\n  declare module.exports: $Exports<'webpack/lib/HotModuleReplacementPlugin'>;\n}\ndeclare module 'webpack/lib/HotUpdateChunkTemplate.js' {\n  declare module.exports: $Exports<'webpack/lib/HotUpdateChunkTemplate'>;\n}\ndeclare module 'webpack/lib/IgnorePlugin.js' {\n  declare module.exports: $Exports<'webpack/lib/IgnorePlugin'>;\n}\ndeclare module 'webpack/lib/JavascriptGenerator.js' {\n  declare module.exports: $Exports<'webpack/lib/JavascriptGenerator'>;\n}\ndeclare module 'webpack/lib/JavascriptModulesPlugin.js' {\n  declare module.exports: $Exports<'webpack/lib/JavascriptModulesPlugin'>;\n}\ndeclare module 'webpack/lib/JsonGenerator.js' {\n  declare module.exports: $Exports<'webpack/lib/JsonGenerator'>;\n}\ndeclare module 'webpack/lib/JsonModulesPlugin.js' {\n  declare module.exports: $Exports<'webpack/lib/JsonModulesPlugin'>;\n}\ndeclare module 'webpack/lib/JsonParser.js' {\n  declare module.exports: $Exports<'webpack/lib/JsonParser'>;\n}\ndeclare module 'webpack/lib/LibManifestPlugin.js' {\n  declare module.exports: $Exports<'webpack/lib/LibManifestPlugin'>;\n}\ndeclare module 'webpack/lib/LibraryTemplatePlugin.js' {\n  declare module.exports: $Exports<'webpack/lib/LibraryTemplatePlugin'>;\n}\ndeclare module 'webpack/lib/LoaderOptionsPlugin.js' {\n  declare module.exports: $Exports<'webpack/lib/LoaderOptionsPlugin'>;\n}\ndeclare module 'webpack/lib/LoaderTargetPlugin.js' {\n  declare module.exports: $Exports<'webpack/lib/LoaderTargetPlugin'>;\n}\ndeclare module 'webpack/lib/MainTemplate.js' {\n  declare module.exports: $Exports<'webpack/lib/MainTemplate'>;\n}\ndeclare module 'webpack/lib/MemoryOutputFileSystem.js' {\n  declare module.exports: $Exports<'webpack/lib/MemoryOutputFileSystem'>;\n}\ndeclare module 'webpack/lib/Module.js' {\n  declare module.exports: $Exports<'webpack/lib/Module'>;\n}\ndeclare module 'webpack/lib/ModuleBuildError.js' {\n  declare module.exports: $Exports<'webpack/lib/ModuleBuildError'>;\n}\ndeclare module 'webpack/lib/ModuleDependencyError.js' {\n  declare module.exports: $Exports<'webpack/lib/ModuleDependencyError'>;\n}\ndeclare module 'webpack/lib/ModuleDependencyWarning.js' {\n  declare module.exports: $Exports<'webpack/lib/ModuleDependencyWarning'>;\n}\ndeclare module 'webpack/lib/ModuleError.js' {\n  declare module.exports: $Exports<'webpack/lib/ModuleError'>;\n}\ndeclare module 'webpack/lib/ModuleFilenameHelpers.js' {\n  declare module.exports: $Exports<'webpack/lib/ModuleFilenameHelpers'>;\n}\ndeclare module 'webpack/lib/ModuleNotFoundError.js' {\n  declare module.exports: $Exports<'webpack/lib/ModuleNotFoundError'>;\n}\ndeclare module 'webpack/lib/ModuleParseError.js' {\n  declare module.exports: $Exports<'webpack/lib/ModuleParseError'>;\n}\ndeclare module 'webpack/lib/ModuleReason.js' {\n  declare module.exports: $Exports<'webpack/lib/ModuleReason'>;\n}\ndeclare module 'webpack/lib/ModuleTemplate.js' {\n  declare module.exports: $Exports<'webpack/lib/ModuleTemplate'>;\n}\ndeclare module 'webpack/lib/ModuleWarning.js' {\n  declare module.exports: $Exports<'webpack/lib/ModuleWarning'>;\n}\ndeclare module 'webpack/lib/MultiCompiler.js' {\n  declare module.exports: $Exports<'webpack/lib/MultiCompiler'>;\n}\ndeclare module 'webpack/lib/MultiEntryPlugin.js' {\n  declare module.exports: $Exports<'webpack/lib/MultiEntryPlugin'>;\n}\ndeclare module 'webpack/lib/MultiModule.js' {\n  declare module.exports: $Exports<'webpack/lib/MultiModule'>;\n}\ndeclare module 'webpack/lib/MultiModuleFactory.js' {\n  declare module.exports: $Exports<'webpack/lib/MultiModuleFactory'>;\n}\ndeclare module 'webpack/lib/MultiStats.js' {\n  declare module.exports: $Exports<'webpack/lib/MultiStats'>;\n}\ndeclare module 'webpack/lib/MultiWatching.js' {\n  declare module.exports: $Exports<'webpack/lib/MultiWatching'>;\n}\ndeclare module 'webpack/lib/NamedChunksPlugin.js' {\n  declare module.exports: $Exports<'webpack/lib/NamedChunksPlugin'>;\n}\ndeclare module 'webpack/lib/NamedModulesPlugin.js' {\n  declare module.exports: $Exports<'webpack/lib/NamedModulesPlugin'>;\n}\ndeclare module 'webpack/lib/node/NodeChunkTemplatePlugin.js' {\n  declare module.exports: $Exports<'webpack/lib/node/NodeChunkTemplatePlugin'>;\n}\ndeclare module 'webpack/lib/node/NodeEnvironmentPlugin.js' {\n  declare module.exports: $Exports<'webpack/lib/node/NodeEnvironmentPlugin'>;\n}\ndeclare module 'webpack/lib/node/NodeHotUpdateChunkTemplatePlugin.js' {\n  declare module.exports: $Exports<'webpack/lib/node/NodeHotUpdateChunkTemplatePlugin'>;\n}\ndeclare module 'webpack/lib/node/NodeMainTemplate.runtime.js' {\n  declare module.exports: $Exports<'webpack/lib/node/NodeMainTemplate.runtime'>;\n}\ndeclare module 'webpack/lib/node/NodeMainTemplateAsync.runtime.js' {\n  declare module.exports: $Exports<'webpack/lib/node/NodeMainTemplateAsync.runtime'>;\n}\ndeclare module 'webpack/lib/node/NodeMainTemplatePlugin.js' {\n  declare module.exports: $Exports<'webpack/lib/node/NodeMainTemplatePlugin'>;\n}\ndeclare module 'webpack/lib/node/NodeOutputFileSystem.js' {\n  declare module.exports: $Exports<'webpack/lib/node/NodeOutputFileSystem'>;\n}\ndeclare module 'webpack/lib/node/NodeSourcePlugin.js' {\n  declare module.exports: $Exports<'webpack/lib/node/NodeSourcePlugin'>;\n}\ndeclare module 'webpack/lib/node/NodeTargetPlugin.js' {\n  declare module.exports: $Exports<'webpack/lib/node/NodeTargetPlugin'>;\n}\ndeclare module 'webpack/lib/node/NodeTemplatePlugin.js' {\n  declare module.exports: $Exports<'webpack/lib/node/NodeTemplatePlugin'>;\n}\ndeclare module 'webpack/lib/node/NodeWatchFileSystem.js' {\n  declare module.exports: $Exports<'webpack/lib/node/NodeWatchFileSystem'>;\n}\ndeclare module 'webpack/lib/node/ReadFileCompileWasmMainTemplatePlugin.js' {\n  declare module.exports: $Exports<'webpack/lib/node/ReadFileCompileWasmMainTemplatePlugin'>;\n}\ndeclare module 'webpack/lib/node/ReadFileCompileWasmTemplatePlugin.js' {\n  declare module.exports: $Exports<'webpack/lib/node/ReadFileCompileWasmTemplatePlugin'>;\n}\ndeclare module 'webpack/lib/NodeStuffPlugin.js' {\n  declare module.exports: $Exports<'webpack/lib/NodeStuffPlugin'>;\n}\ndeclare module 'webpack/lib/NoEmitOnErrorsPlugin.js' {\n  declare module.exports: $Exports<'webpack/lib/NoEmitOnErrorsPlugin'>;\n}\ndeclare module 'webpack/lib/NoModeWarning.js' {\n  declare module.exports: $Exports<'webpack/lib/NoModeWarning'>;\n}\ndeclare module 'webpack/lib/NormalModule.js' {\n  declare module.exports: $Exports<'webpack/lib/NormalModule'>;\n}\ndeclare module 'webpack/lib/NormalModuleFactory.js' {\n  declare module.exports: $Exports<'webpack/lib/NormalModuleFactory'>;\n}\ndeclare module 'webpack/lib/NormalModuleReplacementPlugin.js' {\n  declare module.exports: $Exports<'webpack/lib/NormalModuleReplacementPlugin'>;\n}\ndeclare module 'webpack/lib/NullFactory.js' {\n  declare module.exports: $Exports<'webpack/lib/NullFactory'>;\n}\ndeclare module 'webpack/lib/optimize/AggressiveMergingPlugin.js' {\n  declare module.exports: $Exports<'webpack/lib/optimize/AggressiveMergingPlugin'>;\n}\ndeclare module 'webpack/lib/optimize/AggressiveSplittingPlugin.js' {\n  declare module.exports: $Exports<'webpack/lib/optimize/AggressiveSplittingPlugin'>;\n}\ndeclare module 'webpack/lib/optimize/ChunkModuleIdRangePlugin.js' {\n  declare module.exports: $Exports<'webpack/lib/optimize/ChunkModuleIdRangePlugin'>;\n}\ndeclare module 'webpack/lib/optimize/ConcatenatedModule.js' {\n  declare module.exports: $Exports<'webpack/lib/optimize/ConcatenatedModule'>;\n}\ndeclare module 'webpack/lib/optimize/EnsureChunkConditionsPlugin.js' {\n  declare module.exports: $Exports<'webpack/lib/optimize/EnsureChunkConditionsPlugin'>;\n}\ndeclare module 'webpack/lib/optimize/FlagIncludedChunksPlugin.js' {\n  declare module.exports: $Exports<'webpack/lib/optimize/FlagIncludedChunksPlugin'>;\n}\ndeclare module 'webpack/lib/optimize/LimitChunkCountPlugin.js' {\n  declare module.exports: $Exports<'webpack/lib/optimize/LimitChunkCountPlugin'>;\n}\ndeclare module 'webpack/lib/optimize/MergeDuplicateChunksPlugin.js' {\n  declare module.exports: $Exports<'webpack/lib/optimize/MergeDuplicateChunksPlugin'>;\n}\ndeclare module 'webpack/lib/optimize/MinChunkSizePlugin.js' {\n  declare module.exports: $Exports<'webpack/lib/optimize/MinChunkSizePlugin'>;\n}\ndeclare module 'webpack/lib/optimize/ModuleConcatenationPlugin.js' {\n  declare module.exports: $Exports<'webpack/lib/optimize/ModuleConcatenationPlugin'>;\n}\ndeclare module 'webpack/lib/optimize/OccurrenceOrderPlugin.js' {\n  declare module.exports: $Exports<'webpack/lib/optimize/OccurrenceOrderPlugin'>;\n}\ndeclare module 'webpack/lib/optimize/RemoveEmptyChunksPlugin.js' {\n  declare module.exports: $Exports<'webpack/lib/optimize/RemoveEmptyChunksPlugin'>;\n}\ndeclare module 'webpack/lib/optimize/RemoveParentModulesPlugin.js' {\n  declare module.exports: $Exports<'webpack/lib/optimize/RemoveParentModulesPlugin'>;\n}\ndeclare module 'webpack/lib/optimize/RuntimeChunkPlugin.js' {\n  declare module.exports: $Exports<'webpack/lib/optimize/RuntimeChunkPlugin'>;\n}\ndeclare module 'webpack/lib/optimize/SideEffectsFlagPlugin.js' {\n  declare module.exports: $Exports<'webpack/lib/optimize/SideEffectsFlagPlugin'>;\n}\ndeclare module 'webpack/lib/optimize/SplitChunksPlugin.js' {\n  declare module.exports: $Exports<'webpack/lib/optimize/SplitChunksPlugin'>;\n}\ndeclare module 'webpack/lib/OptionsApply.js' {\n  declare module.exports: $Exports<'webpack/lib/OptionsApply'>;\n}\ndeclare module 'webpack/lib/OptionsDefaulter.js' {\n  declare module.exports: $Exports<'webpack/lib/OptionsDefaulter'>;\n}\ndeclare module 'webpack/lib/Parser.js' {\n  declare module.exports: $Exports<'webpack/lib/Parser'>;\n}\ndeclare module 'webpack/lib/ParserHelpers.js' {\n  declare module.exports: $Exports<'webpack/lib/ParserHelpers'>;\n}\ndeclare module 'webpack/lib/performance/AssetsOverSizeLimitWarning.js' {\n  declare module.exports: $Exports<'webpack/lib/performance/AssetsOverSizeLimitWarning'>;\n}\ndeclare module 'webpack/lib/performance/EntrypointsOverSizeLimitWarning.js' {\n  declare module.exports: $Exports<'webpack/lib/performance/EntrypointsOverSizeLimitWarning'>;\n}\ndeclare module 'webpack/lib/performance/NoAsyncChunksWarning.js' {\n  declare module.exports: $Exports<'webpack/lib/performance/NoAsyncChunksWarning'>;\n}\ndeclare module 'webpack/lib/performance/SizeLimitsPlugin.js' {\n  declare module.exports: $Exports<'webpack/lib/performance/SizeLimitsPlugin'>;\n}\ndeclare module 'webpack/lib/PrefetchPlugin.js' {\n  declare module.exports: $Exports<'webpack/lib/PrefetchPlugin'>;\n}\ndeclare module 'webpack/lib/prepareOptions.js' {\n  declare module.exports: $Exports<'webpack/lib/prepareOptions'>;\n}\ndeclare module 'webpack/lib/ProgressPlugin.js' {\n  declare module.exports: $Exports<'webpack/lib/ProgressPlugin'>;\n}\ndeclare module 'webpack/lib/ProvidePlugin.js' {\n  declare module.exports: $Exports<'webpack/lib/ProvidePlugin'>;\n}\ndeclare module 'webpack/lib/RawModule.js' {\n  declare module.exports: $Exports<'webpack/lib/RawModule'>;\n}\ndeclare module 'webpack/lib/RecordIdsPlugin.js' {\n  declare module.exports: $Exports<'webpack/lib/RecordIdsPlugin'>;\n}\ndeclare module 'webpack/lib/RemovedPluginError.js' {\n  declare module.exports: $Exports<'webpack/lib/RemovedPluginError'>;\n}\ndeclare module 'webpack/lib/RequestShortener.js' {\n  declare module.exports: $Exports<'webpack/lib/RequestShortener'>;\n}\ndeclare module 'webpack/lib/RequireJsStuffPlugin.js' {\n  declare module.exports: $Exports<'webpack/lib/RequireJsStuffPlugin'>;\n}\ndeclare module 'webpack/lib/ResolverFactory.js' {\n  declare module.exports: $Exports<'webpack/lib/ResolverFactory'>;\n}\ndeclare module 'webpack/lib/RuleSet.js' {\n  declare module.exports: $Exports<'webpack/lib/RuleSet'>;\n}\ndeclare module 'webpack/lib/RuntimeTemplate.js' {\n  declare module.exports: $Exports<'webpack/lib/RuntimeTemplate'>;\n}\ndeclare module 'webpack/lib/SetVarMainTemplatePlugin.js' {\n  declare module.exports: $Exports<'webpack/lib/SetVarMainTemplatePlugin'>;\n}\ndeclare module 'webpack/lib/SingleEntryPlugin.js' {\n  declare module.exports: $Exports<'webpack/lib/SingleEntryPlugin'>;\n}\ndeclare module 'webpack/lib/SizeFormatHelpers.js' {\n  declare module.exports: $Exports<'webpack/lib/SizeFormatHelpers'>;\n}\ndeclare module 'webpack/lib/SourceMapDevToolModuleOptionsPlugin.js' {\n  declare module.exports: $Exports<'webpack/lib/SourceMapDevToolModuleOptionsPlugin'>;\n}\ndeclare module 'webpack/lib/SourceMapDevToolPlugin.js' {\n  declare module.exports: $Exports<'webpack/lib/SourceMapDevToolPlugin'>;\n}\ndeclare module 'webpack/lib/Stats.js' {\n  declare module.exports: $Exports<'webpack/lib/Stats'>;\n}\ndeclare module 'webpack/lib/Template.js' {\n  declare module.exports: $Exports<'webpack/lib/Template'>;\n}\ndeclare module 'webpack/lib/TemplatedPathPlugin.js' {\n  declare module.exports: $Exports<'webpack/lib/TemplatedPathPlugin'>;\n}\ndeclare module 'webpack/lib/UmdMainTemplatePlugin.js' {\n  declare module.exports: $Exports<'webpack/lib/UmdMainTemplatePlugin'>;\n}\ndeclare module 'webpack/lib/UnsupportedFeatureWarning.js' {\n  declare module.exports: $Exports<'webpack/lib/UnsupportedFeatureWarning'>;\n}\ndeclare module 'webpack/lib/UseStrictPlugin.js' {\n  declare module.exports: $Exports<'webpack/lib/UseStrictPlugin'>;\n}\ndeclare module 'webpack/lib/util/cachedMerge.js' {\n  declare module.exports: $Exports<'webpack/lib/util/cachedMerge'>;\n}\ndeclare module 'webpack/lib/util/createHash.js' {\n  declare module.exports: $Exports<'webpack/lib/util/createHash'>;\n}\ndeclare module 'webpack/lib/util/identifier.js' {\n  declare module.exports: $Exports<'webpack/lib/util/identifier'>;\n}\ndeclare module 'webpack/lib/util/objectToMap.js' {\n  declare module.exports: $Exports<'webpack/lib/util/objectToMap'>;\n}\ndeclare module 'webpack/lib/util/Queue.js' {\n  declare module.exports: $Exports<'webpack/lib/util/Queue'>;\n}\ndeclare module 'webpack/lib/util/Semaphore.js' {\n  declare module.exports: $Exports<'webpack/lib/util/Semaphore'>;\n}\ndeclare module 'webpack/lib/util/SetHelpers.js' {\n  declare module.exports: $Exports<'webpack/lib/util/SetHelpers'>;\n}\ndeclare module 'webpack/lib/util/SortableSet.js' {\n  declare module.exports: $Exports<'webpack/lib/util/SortableSet'>;\n}\ndeclare module 'webpack/lib/util/StackedSetMap.js' {\n  declare module.exports: $Exports<'webpack/lib/util/StackedSetMap'>;\n}\ndeclare module 'webpack/lib/util/TrackingSet.js' {\n  declare module.exports: $Exports<'webpack/lib/util/TrackingSet'>;\n}\ndeclare module 'webpack/lib/validateSchema.js' {\n  declare module.exports: $Exports<'webpack/lib/validateSchema'>;\n}\ndeclare module 'webpack/lib/WarnCaseSensitiveModulesPlugin.js' {\n  declare module.exports: $Exports<'webpack/lib/WarnCaseSensitiveModulesPlugin'>;\n}\ndeclare module 'webpack/lib/WarnNoModeSetPlugin.js' {\n  declare module.exports: $Exports<'webpack/lib/WarnNoModeSetPlugin'>;\n}\ndeclare module 'webpack/lib/wasm/WasmModuleTemplatePlugin.js' {\n  declare module.exports: $Exports<'webpack/lib/wasm/WasmModuleTemplatePlugin'>;\n}\ndeclare module 'webpack/lib/WatchIgnorePlugin.js' {\n  declare module.exports: $Exports<'webpack/lib/WatchIgnorePlugin'>;\n}\ndeclare module 'webpack/lib/Watching.js' {\n  declare module.exports: $Exports<'webpack/lib/Watching'>;\n}\ndeclare module 'webpack/lib/web/FetchCompileWasmMainTemplatePlugin.js' {\n  declare module.exports: $Exports<'webpack/lib/web/FetchCompileWasmMainTemplatePlugin'>;\n}\ndeclare module 'webpack/lib/web/FetchCompileWasmTemplatePlugin.js' {\n  declare module.exports: $Exports<'webpack/lib/web/FetchCompileWasmTemplatePlugin'>;\n}\ndeclare module 'webpack/lib/web/JsonpChunkTemplatePlugin.js' {\n  declare module.exports: $Exports<'webpack/lib/web/JsonpChunkTemplatePlugin'>;\n}\ndeclare module 'webpack/lib/web/JsonpExportMainTemplatePlugin.js' {\n  declare module.exports: $Exports<'webpack/lib/web/JsonpExportMainTemplatePlugin'>;\n}\ndeclare module 'webpack/lib/web/JsonpHotUpdateChunkTemplatePlugin.js' {\n  declare module.exports: $Exports<'webpack/lib/web/JsonpHotUpdateChunkTemplatePlugin'>;\n}\ndeclare module 'webpack/lib/web/JsonpMainTemplate.runtime.js' {\n  declare module.exports: $Exports<'webpack/lib/web/JsonpMainTemplate.runtime'>;\n}\ndeclare module 'webpack/lib/web/JsonpMainTemplatePlugin.js' {\n  declare module.exports: $Exports<'webpack/lib/web/JsonpMainTemplatePlugin'>;\n}\ndeclare module 'webpack/lib/web/JsonpTemplatePlugin.js' {\n  declare module.exports: $Exports<'webpack/lib/web/JsonpTemplatePlugin'>;\n}\ndeclare module 'webpack/lib/web/WebEnvironmentPlugin.js' {\n  declare module.exports: $Exports<'webpack/lib/web/WebEnvironmentPlugin'>;\n}\ndeclare module 'webpack/lib/WebAssemblyGenerator.js' {\n  declare module.exports: $Exports<'webpack/lib/WebAssemblyGenerator'>;\n}\ndeclare module 'webpack/lib/WebAssemblyModulesPlugin.js' {\n  declare module.exports: $Exports<'webpack/lib/WebAssemblyModulesPlugin'>;\n}\ndeclare module 'webpack/lib/WebAssemblyParser.js' {\n  declare module.exports: $Exports<'webpack/lib/WebAssemblyParser'>;\n}\ndeclare module 'webpack/lib/webpack.js' {\n  declare module.exports: $Exports<'webpack/lib/webpack'>;\n}\ndeclare module 'webpack/lib/webpack.web.js' {\n  declare module.exports: $Exports<'webpack/lib/webpack.web'>;\n}\ndeclare module 'webpack/lib/WebpackError.js' {\n  declare module.exports: $Exports<'webpack/lib/WebpackError'>;\n}\ndeclare module 'webpack/lib/WebpackOptionsApply.js' {\n  declare module.exports: $Exports<'webpack/lib/WebpackOptionsApply'>;\n}\ndeclare module 'webpack/lib/WebpackOptionsDefaulter.js' {\n  declare module.exports: $Exports<'webpack/lib/WebpackOptionsDefaulter'>;\n}\ndeclare module 'webpack/lib/WebpackOptionsValidationError.js' {\n  declare module.exports: $Exports<'webpack/lib/WebpackOptionsValidationError'>;\n}\ndeclare module 'webpack/lib/webworker/WebWorkerChunkTemplatePlugin.js' {\n  declare module.exports: $Exports<'webpack/lib/webworker/WebWorkerChunkTemplatePlugin'>;\n}\ndeclare module 'webpack/lib/webworker/WebWorkerHotUpdateChunkTemplatePlugin.js' {\n  declare module.exports: $Exports<'webpack/lib/webworker/WebWorkerHotUpdateChunkTemplatePlugin'>;\n}\ndeclare module 'webpack/lib/webworker/WebWorkerMainTemplate.runtime.js' {\n  declare module.exports: $Exports<'webpack/lib/webworker/WebWorkerMainTemplate.runtime'>;\n}\ndeclare module 'webpack/lib/webworker/WebWorkerMainTemplatePlugin.js' {\n  declare module.exports: $Exports<'webpack/lib/webworker/WebWorkerMainTemplatePlugin'>;\n}\ndeclare module 'webpack/lib/webworker/WebWorkerTemplatePlugin.js' {\n  declare module.exports: $Exports<'webpack/lib/webworker/WebWorkerTemplatePlugin'>;\n}\ndeclare module 'webpack/schemas/ajv.absolutePath.js' {\n  declare module.exports: $Exports<'webpack/schemas/ajv.absolutePath'>;\n}\ndeclare module 'webpack/web_modules/node-libs-browser.js' {\n  declare module.exports: $Exports<'webpack/web_modules/node-libs-browser'>;\n}\n"
  },
  {
    "path": "fuzzer/.eslintrc",
    "content": "{\n  \"env\": {\n    \"node\": true\n  },\n  \"rules\": {\n    \"flow-header/flow-header\": \"off\"\n  }\n}\n"
  },
  {
    "path": "fuzzer/.gitignore",
    "content": "node_modules\n.DS_Store\nyarn-error.log\novernight.sqlite\n"
  },
  {
    "path": "fuzzer/package.json",
    "content": "{\n  \"private\": true,\n  \"name\": \"prepack-fuzzer\",\n  \"version\": \"0.0.0-unversioned\",\n  \"license\": \"UNLICENSED\",\n  \"scripts\": {\n    \"sample\": \"node src/sample.js\",\n    \"test\": \"node src/test.js\",\n    \"overnight\": \"node src/overnight.js\"\n  },\n  \"dependencies\": {\n    \"@babel/generator\": \"^7.0.0-beta.55\",\n    \"@babel/types\": \"^7.0.0-beta.55\",\n    \"chalk\": \"^2.4.1\",\n    \"immutable\": \"^3.8.2\",\n    \"pretty-ms\": \"^3.2.0\",\n    \"sqlite3\": \"^4.0.2\",\n    \"testcheck\": \"npm:@calebmer/testcheck@1.0.0-rc.5\"\n  }\n}\n"
  },
  {
    "path": "fuzzer/src/execute.js",
    "content": "/**\n * Copyright (c) 2017-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\nconst vm = require(\"vm\");\nconst { prepackSources } = require(\"../../lib/prepack-node.js\");\n\nfunction executeNormal(code) {\n  const context = createVmContext();\n  vm.runInContext(code, context);\n  const inspect = context.module.exports;\n  try {\n    const value = inspect();\n    return { error: false, value };\n  } catch (error) {\n    return { error: true, value: error };\n  }\n}\n\nfunction executePrepack(code) {\n  let prepackedCode;\n  try {\n    prepackedCode = prepackSources([{ fileContents: code, filePath: \"test.js\" }], prepackOptions).code;\n  } catch (error) {\n    return { error: true, value: error };\n  }\n  const context = createVmContext();\n  vm.runInContext(prepackedCode, context);\n  const inspect = context.module.exports;\n  try {\n    const value = inspect();\n    return { error: false, value };\n  } catch (error) {\n    return { error: true, value: error };\n  }\n}\n\nfunction createVmContext() {\n  const sandbox = {\n    module: { exports: {} },\n  };\n  sandbox.global = sandbox;\n  return vm.createContext(sandbox);\n}\n\nconst prepackOptions = {\n  errorHandler: diag => {\n    if (diag.severity === \"Information\") return \"Recover\";\n    if (diag.errorCode === \"PP0025\") return \"Recover\";\n    if (diag.severity !== \"Warning\") return \"Fail\";\n    return \"Recover\";\n  },\n  compatibility: \"fb-www\",\n  internalDebug: true,\n  serialize: true,\n  uniqueSuffix: \"\",\n  maxStackDepth: 100,\n  instantRender: false,\n  reactEnabled: true,\n  reactOutput: \"create-element\",\n  reactVerbose: true,\n  reactOptimizeNestedFunctions: false,\n  inlineExpressions: true,\n  invariantLevel: 3,\n  abstractValueImpliesMax: 1000,\n};\n\nmodule.exports = {\n  executeNormal,\n  executePrepack,\n};\n"
  },
  {
    "path": "fuzzer/src/gen.js",
    "content": "/**\n * Copyright (c) 2017-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\nconst t = require(\"@babel/types\");\nconst Immutable = require(\"immutable\");\nconst { gen } = require(\"testcheck\");\n\nconst ScopeRecord = Immutable.Record({\n  variables: Immutable.List(),\n  functions: Immutable.List(),\n});\n\nconst StateRecord = Immutable.Record({\n  declarations: Immutable.List(),\n  scopes: Immutable.List([ScopeRecord()]),\n  nextVariableId: 1,\n  nextFunctionId: 1,\n  nextArgumentId: 1,\n});\n\nconst genString = gen.array(gen.asciiChar, { maxSize: 20 }).then(chars => chars.join(\"\"));\n\nconst genValueLiteral = gen.oneOfWeighted([\n  // null / undefined\n  [1, gen.oneOf([gen.return(t.nullLiteral()), gen.return(t.identifier(\"undefined\"))])],\n\n  // number\n  [1, gen.number.then(n => gen.return(t.numericLiteral(n)))],\n\n  // string\n  [1, genString.then(s => gen.return(t.stringLiteral(s)))],\n\n  // boolean\n  [7, gen.oneOf([gen.return(t.booleanLiteral(true)), gen.return(t.booleanLiteral(false))])],\n]);\n\nfunction createGenComputation() {\n  const _getStateSymbol = Symbol(\"getState\");\n\n  function* getState() {\n    return yield _getStateSymbol;\n  }\n\n  function* putState(nextState) {\n    yield nextState;\n  }\n\n  function* replaceState(f) {\n    yield f(yield _getStateSymbol);\n  }\n\n  function* newVariable() {\n    let state = yield* getState();\n    const name = `x${state.nextVariableId}`;\n    state = state.update(\"nextVariableId\", x => x + 1).updateIn([\"scopes\", -1, \"variables\"], vs => vs.push({ name }));\n    yield* putState(state);\n    return name;\n  }\n\n  function* newFunction(arity) {\n    let state = yield* getState();\n    const name = `f${state.nextFunctionId}`;\n    state = state\n      .update(\"nextFunctionId\", x => x + 1)\n      .updateIn([\"scopes\", -1, \"functions\"], fs => fs.push({ name, arity }));\n    yield* putState(state);\n    return name;\n  }\n\n  function* newArgument() {\n    let state = yield* getState();\n    const name = `a${state.nextArgumentId}`;\n    state = state.update(\"nextArgumentId\", x => x + 1).updateIn([\"scopes\", -1, \"variables\"], vs => vs.push({ name }));\n    yield* putState(state);\n    return name;\n  }\n\n  const genScalarComputation = gen.oneOfWeighted([\n    [\n      1,\n      genValueLiteral.then(expression => {\n        const result = {\n          statements: Immutable.List(),\n          expression,\n        };\n        return {\n          args: 0,\n          *computation() {\n            return result;\n          },\n        };\n      }),\n    ],\n\n    // Reuse variable\n    [\n      2,\n      gen.posInt.then(n => ({\n        args: 0,\n        *computation() {\n          const state = yield* getState();\n          const variables = Immutable.List().concat(...state.scopes.map(scope => scope.variables));\n          if (variables.isEmpty()) {\n            // If we have no variables to reuse then return something else.\n            return {\n              statements: Immutable.List(),\n              expression: t.numericLiteral(n),\n            };\n          } else {\n            const variable = variables.get(n % variables.size);\n            return {\n              statements: Immutable.List(),\n              expression: t.identifier(variable.name),\n            };\n          }\n        },\n      })),\n    ],\n\n    // Argument\n    [\n      4,\n      gen.return({\n        args: 1,\n        *computation() {\n          const expression = t.identifier(yield* newArgument());\n          return {\n            statements: Immutable.List(),\n            expression,\n          };\n        },\n      }),\n    ],\n\n    // // Intentional failure. Uncomment this to test if everything is working.\n    // [\n    //   1,\n    //   gen.return({\n    //     args: 0,\n    //     *computation() {\n    //       const expression = t.conditionalExpression(\n    //         t.memberExpression(\n    //           t.identifier('global'),\n    //           t.identifier('__optimize')\n    //         ),\n    //         t.booleanLiteral(true),\n    //         t.booleanLiteral(false)\n    //       );\n    //       return {statements: Immutable.List(), expression};\n    //     },\n    //   }),\n    // ],\n  ]);\n\n  function* conditional(computation) {\n    yield* replaceState(state => state.update(\"scopes\", scopes => scopes.push(ScopeRecord())));\n    const result = yield* computation();\n    yield* replaceState(state => state.update(\"scopes\", scope => scope.pop()));\n    return result;\n  }\n\n  const genNestedComputation = genComputation =>\n    gen.oneOfWeighted([\n      // condition ? consequent : alternate\n      [\n        5,\n        gen([genComputation, genComputation, genComputation]).then(([c, tr, fa]) => ({\n          args: c.args + tr.args + fa.args,\n          *computation() {\n            const condition = yield* c.computation();\n            let statements = condition.statements;\n\n            // Conditionally generate consequent and alternate.\n            const consequent = yield* conditional(tr.computation);\n            const alternate = yield* conditional(fa.computation);\n\n            // If our consequent and/or alternate have statements then we need\n            // to hoist these statements to an if-statement.\n            const conditionReuse =\n              (!consequent.statements.isEmpty() || !alternate.statements.isEmpty()) &&\n              t.identifier(yield* newVariable());\n\n            if (conditionReuse) {\n              statements = statements.push(\n                t.variableDeclaration(\"var\", [t.variableDeclarator(conditionReuse, condition.expression)])\n              );\n              if (consequent.statements.isEmpty() && !alternate.statements.isEmpty()) {\n                statements = statements.push(\n                  t.ifStatement(\n                    t.unaryExpression(\"!\", conditionReuse),\n                    t.blockStatement(alternate.statements.toArray())\n                  )\n                );\n              } else {\n                statements = statements.push(\n                  t.ifStatement(\n                    conditionReuse,\n                    t.blockStatement(consequent.statements.toArray()),\n                    alternate.statements.size === 0 ? undefined : t.blockStatement(alternate.statements.toArray())\n                  )\n                );\n              }\n            }\n            return {\n              statements,\n              expression: t.conditionalExpression(\n                conditionReuse || condition.expression,\n                consequent.expression,\n                alternate.expression\n              ),\n            };\n          },\n        })),\n      ],\n\n      // if (condition) { consequent } else { alternate }\n      [\n        10,\n        gen([\n          genComputation,\n          genComputation,\n          genComputation,\n          gen.oneOfWeighted([[1, gen.return(true)], [5, gen.return(false)]]),\n          gen.oneOfWeighted([[1, gen.return(true)], [5, gen.return(false)]]),\n        ]).then(([c, tr, fa, returnConsequent, returnAlternate]) => ({\n          args: c.args + tr.args + fa.args,\n          *computation() {\n            const condition = yield* c.computation();\n            const consequent = yield* conditional(tr.computation);\n            const alternate = yield* conditional(fa.computation);\n            const variable = yield* newVariable();\n\n            let { statements } = condition;\n            let consequentStatements = consequent.statements;\n            let alternateStatements = alternate.statements;\n\n            statements = statements.push(t.variableDeclaration(\"var\", [t.variableDeclarator(t.identifier(variable))]));\n\n            if (returnConsequent) {\n              consequentStatements = consequentStatements.push(t.returnStatement(consequent.expression));\n            } else {\n              consequentStatements = consequentStatements.push(\n                t.expressionStatement(t.assignmentExpression(\"=\", t.identifier(variable), consequent.expression))\n              );\n            }\n            if (returnAlternate) {\n              alternateStatements = alternateStatements.push(t.returnStatement(alternate.expression));\n            } else {\n              alternateStatements = alternateStatements.push(\n                t.expressionStatement(t.assignmentExpression(\"=\", t.identifier(variable), alternate.expression))\n              );\n            }\n            statements = statements.push(\n              t.ifStatement(\n                condition.expression,\n                t.blockStatement(consequentStatements.toArray()),\n                t.blockStatement(alternateStatements.toArray())\n              )\n            );\n\n            return {\n              statements,\n              expression: t.identifier(variable),\n            };\n          },\n        })),\n      ],\n\n      // var id = init;\n      [\n        20,\n        genComputation.then(({ args, computation }) => ({\n          args,\n          *computation() {\n            const { statements, expression } = yield* computation();\n            const variable = yield* newVariable();\n            return {\n              statements: statements.push(\n                t.variableDeclaration(\"var\", [t.variableDeclarator(t.identifier(variable), expression)])\n              ),\n              expression: t.identifier(variable),\n            };\n          },\n        })),\n      ],\n\n      // function f(...args) { body }\n      [\n        15,\n        genComputation\n          .then(({ args, computation }) => ({\n            computation,\n            argComputations: Array(args).fill(genComputation),\n          }))\n          .then(({ computation, argComputations }) => ({\n            args: argComputations.reduce((acc, c) => acc + c.args, 0),\n            *computation() {\n              // Generate our computation in a new state with new scopes. Then\n              // restore the old state.\n              const prevState = yield* getState();\n              const prevNextVariableId = prevState.get(\"nextVariableId\");\n              const prevNextArgumentId = prevState.get(\"nextArgumentId\");\n              const prevScopes = prevState.get(\"scopes\");\n              yield* replaceState(state =>\n                state\n                  .set(\"nextVariableId\", 1)\n                  .set(\"nextArgumentId\", 1)\n                  .set(\"scopes\", Immutable.List([ScopeRecord()]))\n              );\n              const fn = yield* computation();\n              yield* replaceState(state =>\n                state\n                  .set(\"nextVariableId\", prevNextVariableId)\n                  .set(\"nextArgumentId\", prevNextArgumentId)\n                  .set(\"scopes\", prevScopes)\n              );\n\n              // Create the function declaration.\n              const functionStatements = fn.statements.push(t.returnStatement(fn.expression));\n              const functionName = yield* newFunction(argComputations.length);\n              const functionDeclaration = t.functionDeclaration(\n                t.identifier(functionName),\n                argComputations.map((_, i) => t.identifier(`a${i + 1}`)),\n                t.blockStatement(functionStatements.toArray())\n              );\n              yield* replaceState(state =>\n                state.update(\"declarations\", declarations => declarations.push(functionDeclaration))\n              );\n\n              // Compute the arguments.\n              let statements = Immutable.List();\n              const args = [];\n              for (const { computation: argComputation } of argComputations) {\n                const arg = yield* argComputation();\n                statements = statements.concat(arg.statements);\n                args.push(arg.expression);\n              }\n\n              return {\n                statements,\n                expression: t.callExpression(t.identifier(functionName), args),\n              };\n            },\n          })),\n      ],\n\n      // ignored; computation\n      [\n        1,\n        gen([genComputation, genComputation]).then(\n          ([{ args: ignoredArgs, computation: ignoredComputation }, { args, computation }]) => ({\n            args: ignoredArgs + args,\n            *computation() {\n              const { statements: ignoredStatements, expression: ignoredExpression } = yield* ignoredComputation();\n              const { statements, expression } = yield* computation();\n              return {\n                statements: ignoredStatements.push(t.expressionStatement(ignoredExpression)).concat(statements),\n                expression,\n              };\n            },\n          })\n        ),\n      ],\n    ]);\n\n  // Wrap for at least one level of nesting.\n  const genComputation = genNestedComputation(gen.nested(genNestedComputation, genScalarComputation));\n\n  // Runer for the state monad we use for computations. We want to use some\n  // state in our computations. This is why we use a monad.\n  return genComputation.then(({ args, computation }) => {\n    const generator = computation();\n    let state = StateRecord();\n    let step = generator.next();\n    while (!step.done) {\n      if (step.value === _getStateSymbol) {\n        step = generator.next(state);\n      } else {\n        state = step.value;\n        step = generator.next();\n      }\n    }\n    return gen.return({\n      args,\n      computation: step.value,\n      declarations: state.declarations,\n    });\n  });\n}\n\nconst genProgramStatements = createGenComputation()\n  .then(({ args, computation, declarations }) => ({\n    args: gen.array(genValueLiteral, { size: args }),\n    computation: gen.return(computation),\n    declarations: gen.return(declarations),\n  }))\n  .then(({ args, computation: { statements: mainStatements, expression: mainExpression }, declarations }) => {\n    mainStatements = mainStatements.push(t.returnStatement(mainExpression));\n    const statements = [];\n    statements.push(t.expressionStatement(t.stringLiteral(\"use strict\")));\n    declarations.forEach(declaration => {\n      statements.push(declaration);\n    });\n    statements.push(\n      t.functionDeclaration(\n        t.identifier(\"main\"),\n        args.map((arg, i) => t.identifier(`a${i + 1}`)),\n        t.blockStatement(mainStatements.toArray())\n      )\n    );\n    statements.push(\n      t.ifStatement(\n        t.memberExpression(t.identifier(\"global\"), t.identifier(\"__optimize\")),\n        t.expressionStatement(t.callExpression(t.identifier(\"__optimize\"), [t.identifier(\"main\")]))\n      )\n    );\n    statements.push(\n      t.expressionStatement(\n        t.assignmentExpression(\n          \"=\",\n          t.memberExpression(t.identifier(\"module\"), t.identifier(\"exports\")),\n          t.functionExpression(\n            t.identifier(\"inspect\"),\n            [],\n            t.blockStatement([t.returnStatement(t.callExpression(t.identifier(\"main\"), args))])\n          )\n        )\n      )\n    );\n    return gen.return(statements);\n  });\n\nconst genProgram = genProgramStatements.then(statements => gen.return(t.program(statements)));\n\nconst genPrgramWrappedInIife = genProgramStatements.then(statements =>\n  gen.return(\n    t.program([\n      t.expressionStatement(t.callExpression(t.functionExpression(null, [], t.blockStatement(statements)), [])),\n    ])\n  )\n);\n\nmodule.exports = {\n  genProgram,\n  genPrgramWrappedInIife,\n};\n"
  },
  {
    "path": "fuzzer/src/overnight.js",
    "content": "/**\n * Copyright (c) 2017-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\nconst path = require(\"path\");\nconst cluster = require(\"cluster\");\nconst os = require(\"os\");\nconst chalk = require(\"chalk\");\nconst sqlite3 = require(\"sqlite3\");\n\nconst db = new sqlite3.Database(path.resolve(__dirname, \"..\", \"overnight.sqlite\"));\n\nif (cluster.isMaster) {\n  console.log(`Master ${chalk.cyan(process.pid)} started`);\n\n  db.run(\n    `create table fuzz_error (\n      seed text,\n      code text,\n      expected_error bool,\n      expected text,\n      actual_error bool,\n      actual text\n    )`,\n    error => {\n      if (error) throw error;\n      db.close();\n      masterMain();\n    }\n  );\n\n  function masterMain() {\n    const aliveWorkers = new Map();\n\n    // Fork workers.\n    const cpus = os.cpus().length;\n    for (let i = 0; i < cpus; i++) {\n      forkWorker();\n    }\n\n    // Restart workers when they die.\n    cluster.on(\"exit\", (worker, code, signal) => {\n      const pid = chalk.cyan(worker.process.pid);\n      const error = chalk.red(signal || code);\n      console.log(`Worker ${pid} died (${error}). Restarting...`);\n      forkWorker();\n    });\n\n    // Creates a new worker\n    function forkWorker() {\n      const worker = cluster.fork();\n      markWorkerAlive(worker);\n\n      worker.on(\"message\", message => {\n        if (worker.isDead()) return;\n        if (message === \"ping\") markWorkerAlive(worker);\n      });\n    }\n\n    // Marks a worker as alive. We kill workers after 10 minutes of inactivity\n    // since the worker might be stuck in an infinite loop. Or might be trying\n    // to shrink a really large test case.\n    function markWorkerAlive(worker) {\n      // Clear the old timeout\n      if (aliveWorkers.has(worker)) {\n        clearTimeout(aliveWorkers.get(worker));\n      }\n      // Create a new timeout\n      const timeoutId = setTimeout(() => {\n        const pid = chalk.cyan(worker.process.pid);\n        console.log(`Haven’t heard from worker ${pid} in 10 minutes. Killing...`);\n        // Hard kill since we suspect the process is in an infinite loop so the\n        // process can’t receive an IPC message.\n        process.kill(worker.process.pid, \"SIGKILL\");\n        aliveWorkers.delete(worker);\n      }, 1000 * 60 * 10);\n      aliveWorkers.set(worker, timeoutId);\n    }\n  }\n} else {\n  console.log(`Worker ${chalk.cyan(process.pid)} started`);\n\n  // Make the reporter a noop.\n  require(\"./report\").reportTestFinish = () => {};\n\n  const { check } = require(\"testcheck\");\n  const { executeNormal, executePrepack } = require(\"./execute\");\n  const { prepackWorks } = require(\"./property\");\n\n  const insert = db.prepare(`insert into fuzz_error values (?, ?, ?, ?, ?, ?)`);\n\n  loop();\n\n  function loop() {\n    process.send(\"ping\");\n    const test = check(prepackWorks, { numTests: Infinity, maxSize: 200 });\n    process.send(\"ping\");\n    console.log(`Worker ${chalk.cyan(process.pid)} found a failing test case`);\n\n    // Add all the failing test cases to the database.\n    test.shrunk.smallest.forEach((code, i) => {\n      const expected = executeNormal(code);\n      const actual = executePrepack(code);\n      insert.run(\n        test.seed.toString(),\n        code,\n        expected.error,\n        expected.error ? expected.value.stack : JSON.stringify(expected.value),\n        actual.error,\n        actual.error ? actual.value.stack : JSON.stringify(actual.value),\n        error => {\n          if (error) throw error;\n          loop();\n        }\n      );\n    });\n  }\n}\n"
  },
  {
    "path": "fuzzer/src/property.js",
    "content": "/**\n * Copyright (c) 2017-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\nconst generate = require(\"@babel/generator\").default;\nconst { gen, property } = require(\"testcheck\");\nconst { executeNormal, executePrepack } = require(\"./execute\");\nconst { genPrgramWrappedInIife } = require(\"./gen\");\nconst { ReportStatus, reportTestFinish } = require(\"./report\");\n\n/**\n * Tests if the output of a Prepacked program is the same as the output of the\n * un-Prepacked program.\n */\nconst prepackWorks = property(genPrgramWrappedInIife.then(program => gen.return(generate(program).code)), code => {\n  const start = Date.now();\n  try {\n    const expected = executeNormal(code);\n    const actual = executePrepack(code);\n    const ok = expected.error ? actual.error : expected.value === actual.value;\n    const end = Date.now();\n    const time = end - start;\n    reportTestFinish(time, ok ? ReportStatus.pass : ReportStatus.fail);\n    return ok;\n  } catch (error) {\n    const end = Date.now();\n    const time = end - start;\n\n    if (error.message.includes(\"timed out\")) {\n      // Ignore programs which time out.\n      reportTestFinish(time, ReportStatus.skip);\n      return true;\n    } else {\n      reportTestFinish(time, ReportStatus.fail);\n      return false;\n    }\n  }\n});\n\nmodule.exports = {\n  prepackWorks,\n};\n"
  },
  {
    "path": "fuzzer/src/report.js",
    "content": "/**\n * Copyright (c) 2017-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\nconst chalk = require(\"chalk\");\nconst prettyMs = require(\"pretty-ms\");\n\nconst ReportStatus = {\n  pass: \"pass\",\n  fail: \"fail\",\n  skip: \"timeout\",\n};\n\nconst statusIcon = {\n  pass: chalk.green(\"✔\"),\n  fail: chalk.red(\"✘\"),\n  skip: chalk.yellow(\"!\"),\n};\n\nconst statusVerb = {\n  pass: \"passed\",\n  fail: \"failed\",\n  skip: \"skipped\",\n};\n\nconst divider = chalk.dim(\"┈\".repeat(process.stdout.columns));\n\nfunction reportTestFinish(time, status) {\n  const icon = statusIcon[status];\n  const verb = statusVerb[status];\n  console.log(`${icon} Test ${verb} in ${prettyMs(time)}`);\n}\n\nmodule.exports = {\n  ReportStatus,\n  passIcon: statusIcon.pass,\n  failIcon: statusIcon.fail,\n  divider,\n  reportTestFinish,\n};\n"
  },
  {
    "path": "fuzzer/src/sample.js",
    "content": "/**\n * Copyright (c) 2017-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\nconst generate = require(\"@babel/generator\").default;\nconst { sample } = require(\"testcheck\");\nconst { genProgram } = require(\"./gen\");\nconst { divider } = require(\"./report\");\n\nError.stackTraceLimit = Infinity;\n\nconst genCode = genProgram.then(program => generate(program).code);\nconst samples = sample(genCode);\n\nconsole.log(divider);\nsamples.forEach(e => {\n  console.log(e);\n  console.log(divider);\n});\n"
  },
  {
    "path": "fuzzer/src/test.js",
    "content": "/**\n * Copyright (c) 2017-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\nconst util = require(\"util\");\nconst chalk = require(\"chalk\");\nconst { check } = require(\"testcheck\");\nconst { executeNormal, executePrepack } = require(\"./execute\");\nconst { prepackWorks } = require(\"./property\");\nconst { passIcon, failIcon, divider } = require(\"./report\");\n\nconsole.log(divider);\nconst test = check(prepackWorks, { numTests: 1000, maxSize: 200 });\nconsole.log(divider);\n\nconst { seed, numTests } = test;\nconst plural = numTests === 1 ? \"\" : \"s\";\n\nif (test.result === true) {\n  // Yay! No failures.\n  console.log(`${passIcon} Passed after running ${numTests} test${plural} ` + `with seed ${seed}`);\n} else {\n  // Uh, oh. A failure!\n  console.error(`${failIcon} Failed after running ${numTests} test${plural} ` + `with seed ${seed}`);\n  if (test.result !== false) {\n    console.error(chalk.red(test.result.stack));\n  }\n\n  // Log the shrunk failure case and the args which caused it to fail.\n  test.shrunk.smallest.forEach((code, i) => {\n    console.error(divider);\n    console.error(code);\n    console.error(divider);\n    const expected = executeNormal(code);\n    const actual = executePrepack(code);\n    console.error(`${chalk.dim(\"Expected:\")} ${inspect(expected.value)}`);\n    console.error(`  ${chalk.dim(\"Actual:\")} ${inspect(actual.value)}`);\n  });\n  console.error(divider);\n}\n\nfunction inspect(value) {\n  return util.inspect(value, { colors: true });\n}\n"
  },
  {
    "path": "package.json",
    "content": "{\n  \"name\": \"prepack\",\n  \"version\": \"0.2.55-alpha.0\",\n  \"description\": \"Execute a JS bundle, serialize global state and side effects to a snapshot that can be quickly restored.\",\n  \"homepage\": \"https://github.com/facebook/prepack\",\n  \"repository\": {\n    \"type\": \"git\",\n    \"url\": \"git://github.com/facebook/prepack.git\"\n  },\n  \"bugs\": {\n    \"url\": \"https://github.com/facebook/prepack/issues\"\n  },\n  \"files\": [\n    \"LICENSE\",\n    \"PATENTS\",\n    \"/bin/\",\n    \"/lib/\"\n  ],\n  \"bin\": {\n    \"prepack\": \"bin/prepack.js\",\n    \"prepack-repl\": \"bin/prepack-repl.js\"\n  },\n  \"main\": \"lib/prepack-node.js\",\n  \"browser\": \"lib/prepack-standalone.js\",\n  \"scripts\": {\n    \"build\": \"yarn build-prepack && yarn build-bundle\",\n    \"build-scripts\": \"babel scripts --out-dir lib --source-maps\",\n    \"build-bundle\": \"webpack-cli --silent\",\n    \"build-prepack\": \"babel src --out-dir lib --source-maps\",\n    \"watch\": \"babel src scripts --out-dir lib --watch --source-maps --verbose\",\n    \"lint\": \"eslint src scripts\",\n    \"flow\": \"flow\",\n    \"flow-ci\": \"flow version; flow check\",\n    \"test-serializer\": \"babel-node --stack_trace_limit=200 --stack_size=10000 scripts/test-runner.js\",\n    \"test-serializer-single\": \"yarn test-serializer --debugNames --verbose --fast --filter\",\n    \"test-serializer-with-coverage\": \"./node_modules/.bin/istanbul cover ./lib/test-error-handler.js --dir coverage.error && node --stack_trace_limit=200 --stack_size=10000 ./node_modules/istanbul/lib/cli.js cover ./lib/test-runner.js && ./node_modules/.bin/remap-istanbul -i coverage.error/coverage.json -i coverage/coverage.json -o coverage-sourcemapped -t html\",\n    \"test-sourcemaps\": \"babel-node scripts/generate-sourcemaps-test.js && bash < scripts/test-sourcemaps.sh\",\n    \"test-test262\": \"babel-node scripts/test262-runner.js\",\n    \"test-test262-nightly\": \"NIGHTLY_BUILD=true babel-node scripts/test262-runner.js\",\n    \"test-test262-new\": \"babel-node scripts/test262.js\",\n    \"test-internal\": \"babel-node --stack_size=10000 --stack_trace_limit=200 --max_old_space_size=32768 scripts/test-internal.js\",\n    \"test-internal-react\": \"babel-node --stack_size=10000 --stack_trace_limit=200 --max_old_space_size=32768 scripts/test-internal-react.js\",\n    \"test-error-handler\": \"babel-node scripts/test-error-handler.js\",\n    \"test-error-handler-with-coverage\": \"./node_modules/.bin/istanbul cover ./lib/test-error-handler.js --dir coverage.error && ./node_modules/.bin/remap-istanbul -i coverage.error/coverage.json -o coverage-sourcemapped.error -t html\",\n    \"test-std-in\": \"bash < scripts/test-std-in.sh\",\n    \"test-react\": \"jest\",\n    \"test-react-fast\": \"SKIP_REACT_JSX_TESTS=true jest\",\n    \"test\": \"yarn test-serializer && yarn test-sourcemaps && yarn test-error-handler && yarn test-std-in && yarn test-test262 && yarn test-internal && yarn test-internal-react && yarn test-react\",\n    \"test-coverage-most\": \"./node_modules/.bin/istanbul --stack_size=10000 --max_old_space_size=16384 cover ./lib/multi-runner.js --dir coverage.most && ./node_modules/.bin/remap-istanbul -i coverage.most/coverage.json -o coverage-sourcemapped -t html\",\n    \"test-all-coverage\": \"./node_modules/.bin/istanbul --stack_size=10000 --max_old_space_size=16384 cover ./lib/multi-runner.js --dir coverage.most && ./node_modules/.bin/istanbul --stack_size=10000 --max_old_space_size=16384 cover ./lib/test262-runner.js --timeout 50 --singleThreaded && ./node_modules/.bin/remap-istanbul -i coverage/coverage.json -i coverage.most/coverage.json -o coverage-sourcemapped -t html\",\n    \"repl\": \"node lib/repl-cli.js\",\n    \"precheck\": \"yarn prepack-cli --check\",\n    \"prepack-cli\": \"node --stack_size=10000 --stack_trace_limit=200 --max_old_space_size=16384 lib/prepack-cli.js --compatibility jsc-600-1-4-17 --mathRandomSeed 0\",\n    \"validate\": \"yarn install --frozen-lockfile && yarn build && yarn build-scripts && yarn lint && yarn depcheck && yarn flow && yarn test\",\n    \"prepublishOnly\": \"yarn build\",\n    \"depcheck\": \"babel-node scripts/detect_bad_deps.js\",\n    \"prettier\": \"node ./scripts/prettier.js write-changed\",\n    \"prettier-all\": \"node ./scripts/prettier.js write\",\n    \"prettier-ci\": \"node ./scripts/prettier.js\",\n    \"debug-fb-www\": \"node --stack_trace_limit=200 --stack_size=10000 --max_old_space_size=16384 ./scripts/debug-fb-www.js\",\n    \"fuzz\": \"cd fuzzer && yarn && yarn test\",\n    \"fuzz-sample\": \"cd fuzzer && yarn && yarn sample\",\n    \"fuzz-overnight\": \"cd fuzzer && yarn && yarn overnight\"\n  },\n  \"dependencies\": {\n    \"@babel/core\": \"^7.0.0\",\n    \"@babel/generator\": \"^7.0.0\",\n    \"@babel/node\": \"^7.0.0\",\n    \"@babel/parser\": \"^7.0.0\",\n    \"@babel/preset-flow\": \"^7.0.0\",\n    \"@babel/template\": \"^7.0.0\",\n    \"@babel/traverse\": \"^7.0.0\",\n    \"@babel/types\": \"^7.0.0\",\n    \"fbjs\": \"^0.8.16\",\n    \"node-zip\": \"^1.1.1\",\n    \"queue-fifo\": \"^0.2.3\",\n    \"seedrandom\": \"^2.4.2\",\n    \"source-map\": \"^0.5.6\",\n    \"vscode-debugadapter\": \"^1.24.0\",\n    \"vscode-debugprotocol\": \"^1.24.0\",\n    \"zip-dir\": \"^1.0.2\"\n  },\n  \"devDependencies\": {\n    \"@babel/cli\": \"^7.0.0\",\n    \"@babel/plugin-proposal-class-properties\": \"^7.0.0\",\n    \"@babel/plugin-proposal-export-default-from\": \"^7.0.0\",\n    \"@babel/plugin-proposal-object-rest-spread\": \"^7.0.0\",\n    \"@babel/plugin-syntax-flow\": \"^7.0.0\",\n    \"@babel/plugin-transform-flow-strip-types\": \"^7.0.0\",\n    \"@babel/plugin-transform-modules-commonjs\": \"^7.0.0\",\n    \"@babel/plugin-transform-react-display-name\": \"^7.0.0\",\n    \"@babel/plugin-transform-react-jsx\": \"^7.0.0\",\n    \"@babel/preset-env\": \"^7.0.0\",\n    \"@babel/preset-flow\": \"^7.0.0\",\n    \"@babel/preset-react\": \"^7.0.0\",\n    \"@babel/register\": \"^7.0.0\",\n    \"babel-core\": \"7.0.0-bridge.0\",\n    \"babel-eslint\": \"^8.2.6\",\n    \"babel-jest\": \"^23.4.0\",\n    \"babel-loader\": \"^8.0.0-beta\",\n    \"babel-plugin-jest-hoist\": \"^23.2.0\",\n    \"chalk\": \"^1.1.3\",\n    \"eslint\": \"^4.18.2\",\n    \"eslint-plugin-babel\": \"^3.3.0\",\n    \"eslint-plugin-flow-header\": \"^0.1.1\",\n    \"eslint-plugin-flowtype\": \"^2.40.0\",\n    \"eslint-plugin-header\": \"^1.0.0\",\n    \"eslint-plugin-prettier\": \"^2.1.2\",\n    \"flow-typed\": \"^2.3.0\",\n    \"graceful-fs\": \"^4.1.11\",\n    \"invariant\": \"^2.2.0\",\n    \"istanbul\": \"^0.4.5\",\n    \"jest\": \"^23.4.1\",\n    \"js-beautify\": \"^1.7.5\",\n    \"js-yaml\": \"^3.6.1\",\n    \"jsdom\": \"^9.2.1\",\n    \"madge\": \"^1.6.0\",\n    \"minimist\": \"^1.2.0\",\n    \"prettier\": \"1.17.0\",\n    \"prop-types\": \"^15.6.0\",\n    \"react\": \"16.3.1\",\n    \"react-dom\": \"16.3.1\",\n    \"react-native\": \"^0.55.4\",\n    \"react-relay\": \"^1.4.1\",\n    \"react-test-renderer\": \"16.3.1\",\n    \"regenerator-runtime\": \"^0.12.0\",\n    \"remap-istanbul\": \"^0.9.1\",\n    \"source-map-support\": \"^0.4.6\",\n    \"test262-integrator\": \"^1.2.0\",\n    \"webpack\": \"^4.16.0\",\n    \"webpack-cli\": \"^3.0.8\"\n  },\n  \"optionalDependencies\": {\n    \"v8-profiler-node8\": \"^6.0.1\"\n  },\n  \"engines\": {\n    \"node\": \">=6.1.0\"\n  },\n  \"keywords\": [\n    \"prepack\"\n  ],\n  \"license\": \"BSD-3-Clause\",\n  \"author\": \"Facebook\",\n  \"jest\": {\n    \"preset\": \"react-native\",\n    \"roots\": [\n      \"<rootDir>/node_modules/react-native/\",\n      \"<rootDir>/lib/\",\n      \"<rootDir>/test/react/\",\n      \"<rootDir>/fb-www/\"\n    ],\n    \"testEnvironment\": \"jsdom\",\n    \"testMatch\": [\n      \"**/test/react/*-test.js\",\n      \"**/fb-www/**/*-test.js\"\n    ],\n    \"transformIgnorePatterns\": [\n      \"/node_modules/(?!react-native).+\\\\.js$\"\n    ]\n  }\n}\n"
  },
  {
    "path": "scripts/.eslintrc",
    "content": "{\n  \"rules\": {\n    \"no-restricted-imports\": \"off\"\n  }\n}\n"
  },
  {
    "path": "scripts/debug-fb-www.js",
    "content": "/**\n * Copyright (c) 2017-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n/* @flow */\n\n// NOTE:\n// put the input fb-www file in ${root}/fb-www/input.js\n// the compiled file will be saved to ${root}/fb-www/output.js\n\nlet prepackSources = require(\"../lib/prepack-node.js\").prepackSources;\nlet path = require(\"path\");\nlet { readFile, writeFile, existsSync } = require(\"fs\");\nlet { promisify } = require(\"util\");\nlet readFileAsync = promisify(readFile);\nlet writeFileAsync = promisify(writeFile);\nlet chalk = require(\"chalk\");\nlet { Linter } = require(\"eslint\");\nlet lintConfig = require(\"./lint-config\");\n\nlet errorsCaptured = [];\n\nfunction printError(error) {\n  let msg = `${error.errorCode}: ${error.message}`;\n  if (error.location) {\n    let loc_start = error.location.start;\n    let loc_end = error.location.end;\n    msg += ` at ${loc_start.line}:${loc_start.column} to ${loc_end.line}:${loc_end.column}`;\n  }\n  switch (error.severity) {\n    case \"Information\":\n      console.log(`Info: ${msg}`);\n      return \"Recover\";\n    case \"Warning\":\n      console.warn(`Warn: ${msg}`);\n      return \"Recover\";\n    case \"RecoverableError\":\n    case \"FatalError\":\n      console.error(`Error: ${msg}`);\n      return \"Fail\";\n    default:\n      console.log(msg);\n  }\n}\n\nlet prepackOptions = {\n  errorHandler: diag => {\n    if (diag.severity === \"Information\") {\n      console.log(diag.message);\n      return \"Recover\";\n    }\n    errorsCaptured.push(diag);\n    if (diag.severity !== \"Warning\") {\n      if (diag.errorCode === \"PP0025\") {\n        // recover from `unable to evaluate \"key\" and \"ref\" on a ReactElement\n        return \"Recover\";\n      }\n      if (diag.errorCode === \"PP0021\") {\n        // recover from \"Possible throw inside try/catch is not yet supported\"\n        return \"Recover\";\n      }\n      return \"Fail\";\n    }\n    return \"Recover\";\n  },\n  compatibility: \"fb-www\",\n  internalDebug: true,\n  serialize: true,\n  uniqueSuffix: \"\",\n  maxStackDepth: 200,\n  instantRender: false,\n  reactEnabled: true,\n  reactOutput: \"jsx\",\n  reactVerbose: true,\n  reactFailOnUnsupportedSideEffects: true,\n  reactOptimizeNestedFunctions: true,\n  arrayNestedOptimizedFunctionsEnabled: true,\n  inlineExpressions: true,\n  invariantLevel: 0,\n  abstractValueImpliesMax: 1000,\n  stripFlow: true,\n};\nlet inputPath = path.resolve(\"fb-www/input.js\");\nlet outputPath = path.resolve(\"fb-www/output.js\");\nlet componentsListPath = path.resolve(\"fb-www/components.txt\");\nlet components = new Map();\nlet startTime = Date.now();\nlet uniqueEvaluatedComponents = 0;\n\nfunction compileSource(source) {\n  let serialized;\n  try {\n    serialized = prepackSources([{ filePath: inputPath, fileContents: source, sourceMapContents: \"\" }], prepackOptions);\n  } catch (e) {\n    console.log(`\\n${chalk.inverse(`=== Diagnostics Log ===`)}\\n`);\n    errorsCaptured.forEach(error => printError(error));\n    throw e;\n  }\n  return {\n    stats: serialized.reactStatistics,\n    code: serialized.code,\n  };\n}\n\nasync function readComponentsList() {\n  if (existsSync(componentsListPath)) {\n    let componentsList = await readFileAsync(componentsListPath, \"utf8\");\n    let componentNames = componentsList.split(\"\\n\");\n\n    for (let componentName of componentNames) {\n      components.set(componentName, \"missing\");\n    }\n  }\n}\n\nfunction lintCompiledSource(source) {\n  let linter = new Linter();\n  let errors = linter.verify(source, lintConfig);\n  if (errors.length > 0) {\n    console.log(`\\n${chalk.inverse(`=== Validation Failed ===`)}\\n`);\n    for (let error of errors) {\n      console.log(`${chalk.red(error.message)} ${chalk.gray(`(${error.line}:${error.column})`)}`);\n    }\n    process.exit(1);\n  }\n}\n\nasync function compileFile() {\n  let source = await readFileAsync(inputPath, \"utf8\");\n  let { stats, code } = await compileSource(source);\n  await writeFileAsync(outputPath, code);\n  lintCompiledSource(code);\n  // $FlowFixMe: no idea what this is about\n  return stats;\n}\n\nfunction printReactEvaluationGraph(evaluatedRootNode, depth) {\n  if (Array.isArray(evaluatedRootNode)) {\n    for (let child of evaluatedRootNode) {\n      printReactEvaluationGraph(child, depth);\n    }\n  } else {\n    let status = evaluatedRootNode.status.toLowerCase();\n    let message = evaluatedRootNode.message !== \"\" ? `: ${evaluatedRootNode.message}` : \"\";\n    let name = evaluatedRootNode.name;\n    let line;\n    if (status === \"inlined\") {\n      line = `${chalk.gray(`-`)} ${chalk.green(name)} ${chalk.gray(`(${status + message})`)}`;\n    } else if (status === \"unknown_type\" || status === \"bail-out\" || status === \"fatal\") {\n      line = `${chalk.gray(`-`)} ${chalk.red(name)} ${chalk.gray(`(${status + message})`)}`;\n    } else {\n      line = `${chalk.gray(`-`)} ${chalk.yellow(name)} ${chalk.gray(`(${status + message})`)}`;\n    }\n    if (components.has(name)) {\n      let currentStatus = components.get(name);\n\n      if (currentStatus === \"missing\") {\n        uniqueEvaluatedComponents++;\n        currentStatus = [currentStatus];\n        components.set(name, currentStatus);\n      } else if (Array.isArray(currentStatus)) {\n        currentStatus.push(status);\n      }\n    }\n    console.log(line.padStart(line.length + depth));\n    printReactEvaluationGraph(evaluatedRootNode.children, depth + 2);\n  }\n}\n\nreadComponentsList()\n  .then(compileFile)\n  .then(result => {\n    console.log(`\\n${chalk.inverse(`=== Compilation Complete ===`)}\\n`);\n    console.log(chalk.bold(`Evaluated Tree:`));\n    printReactEvaluationGraph(result.evaluatedRootNodes, 0);\n\n    if (components.size > 0) {\n      console.log(`\\n${chalk.inverse(`=== Status ===`)}\\n`);\n      for (let [componentName, status] of components) {\n        if (status === \"missing\") {\n          console.log(`${chalk.red(`✖`)} ${componentName}`);\n        } else {\n          console.log(`${chalk.green(`✔`)} ${componentName}`);\n        }\n      }\n    }\n\n    console.log(`\\n${chalk.inverse(`=== Summary ===`)}\\n`);\n    if (components.size > 0) {\n      console.log(`${chalk.gray(`Optimized Components`)}: ${uniqueEvaluatedComponents}/${components.size}`);\n    }\n    console.log(`${chalk.gray(`Optimized Nodes`)}: ${result.componentsEvaluated}`);\n    console.log(`${chalk.gray(`Inlined Nodes`)}: ${result.inlinedComponents}`);\n    console.log(`${chalk.gray(`Optimized Trees`)}: ${result.optimizedTrees}`);\n    console.log(`${chalk.gray(`Optimized Nested Closures`)}: ${result.optimizedNestedClosures}`);\n\n    let timeTaken = Math.floor((Date.now() - startTime) / 1000);\n    console.log(`${chalk.gray(`Compile time`)}: ${timeTaken}s\\n`);\n    // warning about ref and keys\n    console.log(`Warning: the build assumes that ref and key aren't being spread.`);\n  })\n  .catch(e => {\n    console.log(`\\n${chalk.inverse(`=== Compilation Failed ===`)}\\n`);\n    if (e.__isReconcilerFatalError) {\n      console.error(e.message + \"\\n\");\n      printReactEvaluationGraph(e.evaluatedNode, 0);\n    } else {\n      console.error(e.nativeStack || e.stack);\n    }\n    process.exit(1);\n  });\n"
  },
  {
    "path": "scripts/detect_bad_deps.js",
    "content": "/**\n * Copyright (c) 2017-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n/* @flow */\n\nimport madge from \"madge\";\nimport { exec } from \"child_process\";\n\nconst MAX_CYCLE_LEN = 56; // NEVER EVER increase this value\n\nconst cmd = \"flow check --profile --merge-timeout 0\";\nexec(cmd, function(error, stdout, stderr) {\n  error;\n  stdout;\n  /*\n  pattern format:\n  ...\n  cycle detected among the following files:\n      file1\n      file2\n      ...\n      filen\n  ... more flow output after unindented line\n  */\n  let inCycle = false;\n  let cycles = 0;\n  let cycle_len = 0,\n    max_cycle_len = 0;\n  let found_ecma = false,\n    found_realm = false;\n  let lines = stderr.split(\"\\n\");\n  for (let line of lines) {\n    if (inCycle && !line.startsWith(\"\\t\")) {\n      if (found_ecma && found_realm) {\n        console.error(\"Invalid Dependencies: ecma262/ is in a circular dependency with realm.js\");\n        console.error(\"Run the following command to see the cycle: \" + cmd);\n        process.exit(1);\n      }\n      max_cycle_len = Math.max(cycle_len, max_cycle_len);\n      cycle_len = 0;\n      found_ecma = found_realm = false;\n      inCycle = false;\n    }\n    if (!inCycle && line === \"cycle detected among the following nodes:\") {\n      inCycle = true;\n      cycles++;\n    } else if (inCycle) {\n      cycle_len++;\n      found_ecma = found_ecma || line.includes(\"/ecma262/\");\n      found_realm = found_realm || line.includes(\"/realm.js\");\n    }\n  }\n  if (inCycle || cycles === 0 || !(max_cycle_len > 0)) {\n    console.error(\"Error while processing Flow stderr, couldn't find cycle information:\");\n    for (let line of lines) console.error(line);\n    process.exit(1);\n  }\n  console.log(\"Biggest cycle: \" + max_cycle_len + \" (out of \" + cycles + \" cycles reported by Flow)\");\n  if (max_cycle_len > MAX_CYCLE_LEN) {\n    console.error(\"Error: You increased cycle length from the previous high of \" + MAX_CYCLE_LEN);\n    console.error(\"This is never OK.\");\n    console.error(\"Run the following command to see the cycle: \" + cmd);\n    process.exit(1);\n  }\n});\n\n// NB: This doesn't prevent cycles using \"import type\" because those are\n// erased in the lib folder but madge doesn't work with flow type imports.\n\nmadge(\"./lib/\").then(res => {\n  let deps = res.obj();\n  let idx_deps = res.depends(\"intrinsics/index\");\n  if (idx_deps.length !== 1 || idx_deps[0] !== \"construct_realm\") {\n    console.error(\"Invalid Dependency: Intrinsics index depends on \" + idx_deps[0]);\n    process.exit(1);\n  }\n\n  for (let dep in deps) {\n    // Nothing in intrinsics/ecma262 depends on anything but intrinsics/index except Error and global.\n    if (\n      dep.startsWith(\"intrinsics/ecma262\") &&\n      dep !== \"intrinsics/ecma262/Error\" &&\n      dep !== \"intrinsics/ecma262/global\"\n    ) {\n      let ext_deps = res\n        .depends(dep)\n        .filter(depend => depend !== \"intrinsics/index\" && !depend.startsWith(\"intrinsics/ecma262\"));\n      if (ext_deps.length > 0) {\n        console.error(\"Invalid Dependency: \" + dep + \" depends on \" + ext_deps);\n        process.exit(1);\n      }\n    }\n  }\n});\n"
  },
  {
    "path": "scripts/generate-sourcemaps-test.js",
    "content": "/**\n * Copyright (c) 2017-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n/* @flow */\n\nimport type { CompilerDiagnostic, ErrorHandlerResult } from \"../lib/errors.js\";\nimport { prepackFileSync } from \"../lib/prepack-node.js\";\nimport invariant from \"../lib/invariant.js\";\n\nlet chalk = require(\"chalk\");\nlet path = require(\"path\");\nlet fs = require(\"fs\");\n\nfunction search(dir, relative) {\n  let tests = [];\n\n  for (let name of fs.readdirSync(dir)) {\n    let loc = path.join(dir, name);\n    let stat = fs.statSync(loc);\n\n    if (stat.isFile()) {\n      tests.push({\n        file: fs.readFileSync(loc, \"utf8\"),\n        path: path.join(relative, name),\n        name: name,\n      });\n    } else if (stat.isDirectory()) {\n      tests = tests.concat(search(loc, path.join(relative, name)));\n    }\n  }\n\n  return tests;\n}\n\nlet tests = search(`${__dirname}/../test/source-maps`, \"test/source-maps\");\n\nfunction errorHandler(diagnostic: CompilerDiagnostic): ErrorHandlerResult {\n  let loc = diagnostic.location;\n  if (loc) console.log(`${loc.start.line}:${loc.start.column + 1} ${diagnostic.errorCode} ${diagnostic.message}`);\n  else console.log(`unknown location: ${diagnostic.errorCode} ${diagnostic.message}`);\n  return \"Fail\";\n}\n\nfunction generateTest(name: string, test_path: string, code: string): boolean {\n  console.log(chalk.inverse(name));\n  let newCode1, newMap1, newCode2, newMap2;\n  try {\n    let s = prepackFileSync([test_path], {\n      internalDebug: true,\n      errorHandler: errorHandler,\n      sourceMaps: true,\n      serialize: true,\n    });\n    if (!s) {\n      process.exit(1);\n      invariant(false);\n    }\n    newCode1 = s.code;\n    fs.writeFileSync(name + \".new1.js\", newCode1);\n    newMap1 = s.map;\n    fs.writeFileSync(name + \".new1.js.map\", JSON.stringify(newMap1));\n    s = prepackFileSync([name + \".new1.js\"], {\n      compatibility: \"node-source-maps\",\n      inputSourceMapFilenames: [name + \".new1.js.map\"],\n      internalDebug: true,\n      errorHandler: errorHandler,\n      sourceMaps: true,\n      serialize: true,\n    });\n    if (!s) {\n      process.exit(1);\n      invariant(false);\n    }\n    newCode2 = s.code + \"\\nthis.f();\\n\\n//# sourceMappingURL=\" + name + \".new2.js.map\\n\";\n    fs.writeFileSync(name + \".new2.js\", newCode2);\n    newMap2 = s.map;\n    fs.writeFileSync(name + \".new2.js.map\", JSON.stringify(newMap2));\n    return true;\n  } catch (err) {\n    console.log(err);\n  }\n  console.log(chalk.underline(\"original code\"));\n  console.log(code);\n  console.log(chalk.underline(\"generated code 1\"));\n  console.log(newCode1);\n  console.log(chalk.underline(\"newMap 1\"));\n  console.log(newMap1);\n  console.log(chalk.underline(\"generated code 2\"));\n  console.log(newCode2);\n  console.log(chalk.underline(\"newMap 2\"));\n  console.log(newMap2);\n\n  return false;\n}\n\nfunction run() {\n  let failed = 0;\n  let passed = 0;\n  let total = 0;\n\n  for (let test of tests) {\n    // filter hidden files\n    if (path.basename(test.name)[0] === \".\") continue;\n    if (test.name.endsWith(\"~\")) continue;\n\n    total++;\n    if (generateTest(test.name, test.path, test.file)) passed++;\n    else failed++;\n  }\n\n  console.log(\"Generated:\", `${passed}/${total}`, (Math.floor((passed / total) * 100) || 0) + \"%\");\n  return failed === 0;\n}\n\nif (!run()) process.exit(1);\n"
  },
  {
    "path": "scripts/instrumentor.js",
    "content": "/**\n * Copyright (c) 2017-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n/* @flow */\n\nimport * as t from \"@babel/types\";\nimport generate from \"@babel/generator\";\nimport traverseFast from \"../lib/utils/traverse-fast.js\";\nimport { parse } from \"@babel/parser\";\nlet fs = require(\"fs\");\nimport type { BabelNodeSourceLocation, BabelNodeBlockStatement } from \"@babel/types\";\n\nfunction createLogStatement(loc: BabelNodeSourceLocation) {\n  return t.expressionStatement(\n    t.callExpression(t.memberExpression(t.identifier(\"console\"), t.identifier(\"log\")), [\n      t.stringLiteral(`[instrumentation] #${loc.start.line}`),\n    ])\n  );\n}\n\nfunction instrument(inputFilename: string, outputFilename: string) {\n  let code = fs.readFileSync(inputFilename, \"utf8\");\n  let ast = parse(code, { inputFilename, sourceType: \"script\" });\n  traverseFast(ast, function(node) {\n    if (node.type === \"BlockStatement\") {\n      if (node.loc) ((node: any): BabelNodeBlockStatement).body.unshift(createLogStatement(node.loc));\n    }\n    return false;\n  });\n  code = generate(ast, {}, \"\").code;\n  if (!outputFilename) outputFilename = inputFilename + \"-instrumented.js\";\n  fs.writeFileSync(outputFilename, code);\n  console.log(`Instrumented source code written to ${outputFilename}.`);\n}\n\nlet args = Array.from(process.argv);\nargs.splice(0, 2);\nlet inputFilename;\nlet outputFilename;\nwhile (args.length) {\n  let arg = args[0];\n  args.shift();\n  if (arg === \"--out\") {\n    arg = args[0];\n    args.shift();\n    outputFilename = arg;\n  } else if (arg === \"--help\") {\n    console.log(\"Usage: instrumentor.js [ --out output.js ] [ -- | input.js ]\");\n  } else if (!arg.startsWith(\"--\")) {\n    inputFilename = arg;\n  } else {\n    console.error(`Unknown option: ${arg}`);\n    process.exit(1);\n  }\n}\n\nif (!inputFilename) {\n  console.error(\"Missing input file.\");\n  process.exit(1);\n} else if (!outputFilename) {\n  console.error(\"Missing output file.\");\n  process.exit(1);\n} else {\n  instrument(inputFilename, outputFilename);\n}\n"
  },
  {
    "path": "scripts/lint-config.js",
    "content": "/**\n * Copyright (c) 2017-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n/* @flow */\n\n// The irony :P\n/* eslint-disable no-undef */\nmodule.exports = {\n  env: {\n    commonjs: true,\n    browser: true,\n  },\n  rules: {\n    \"no-undef\": \"error\",\n    \"no-use-before-define\": [\"error\", { variables: false, functions: false }],\n  },\n  parserOptions: {\n    ecmaVersion: 2018,\n    ecmaFeatures: {\n      jsx: true,\n    },\n  },\n  globals: {\n    // FB\n    Env: true,\n    Bootloader: true,\n    JSResource: true,\n    babelHelpers: true,\n    regeneratorRuntime: true,\n    asset: true,\n    cx: true,\n    cssVar: true,\n    csx: true,\n    errorDesc: true,\n    errorHelpCenterID: true,\n    errorSummary: true,\n    gkx: true,\n    glyph: true,\n    ifRequired: true,\n    ix: true,\n    fbglyph: true,\n    fbt: true,\n    requireWeak: true,\n    xuiglyph: true,\n    DebuggerInternal: true,\n    define: true,\n    // React\n    React: true,\n    __REACT_DEVTOOLS_GLOBAL_HOOK__: true,\n    // Normal\n    Exception: true,\n    Error: true,\n    setImmediate: true,\n    clearImmediate: true,\n    DataView: true,\n    ArrayBuffer: true,\n    Uint8Array: true,\n    Float32Array: true,\n    Int32Array: true,\n    // ES 6\n    Promise: true,\n    Map: true,\n    Set: true,\n    Proxy: true,\n    Symbol: true,\n    WeakMap: true,\n    WeakSet: true,\n    Reflect: true,\n    // Vendor specific\n    MSApp: true,\n    ActiveXObject: true,\n    // CommonJS / Node\n    process: true,\n    // Prepack\n    __optimize: true,\n    __optimizeReactComponentTree: true,\n    __abstract: true,\n    __makeFinal: true,\n  },\n};\n"
  },
  {
    "path": "scripts/multi-runner.js",
    "content": "/**\n * Copyright (c) 2017-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n/* @flow */\n// This file just runs the 3 test runners in one file for coverage\nrequire(\"./test-runner.js\");\n\nrequire(\"./generate-sourcemaps-test.js\");\n\nrequire(\"./test-error-handler.js\");\n"
  },
  {
    "path": "scripts/prettier.js",
    "content": "/**\n * Copyright (c) 2017-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n/* @flow */\n\n// Mostly taken from a script in React\n// https://github.com/facebook/react/blob/master/scripts/prettier/index.js\n\nconst chalk = require(\"chalk\");\nconst fs = require(\"fs\");\nconst glob = require(\"glob\");\nconst prettier = require(\"prettier\");\nconst execFileSync = require(\"child_process\").execFileSync;\n\nconst mode = process.argv[2] || \"check\";\nconst prettierConfigPath = require.resolve(\"../.prettierrc\");\nconst shouldWrite = mode === \"write\" || mode === \"write-changed\";\nconst onlyChanged = mode === \"check-changed\" || mode === \"write-changed\";\n\nconst config = {\n  default: {\n    patterns: [\"src/**/*.js\"],\n  },\n  scripts: {\n    patterns: [\"scripts/**/*.js\"],\n  },\n  jest: {\n    patterns: [\"test/**/*.js\"],\n    ignore: [\"test/**/syntaxError.js\", \"test/test262/**/*.js\"],\n  },\n};\n\nfunction exec(command, args, options = {}) {\n  console.log(\"> \" + [command].concat(args).join(\" \"));\n  return execFileSync(command, args, options).toString();\n}\n\nconst mergeBase = exec(\"git\", [\"merge-base\", \"HEAD\", \"master\"]).trim();\nconst changedFiles = new Set(\n  exec(\"git\", [\"diff\", \"-z\", \"--name-only\", \"--diff-filter=ACMRTUB\", mergeBase]).match(/[^\\0]+/g)\n);\n\nObject.keys(config).forEach(key => {\n  const patterns = config[key].patterns;\n  const ignore = config[key].ignore;\n\n  const globPattern = patterns.length > 1 ? `{${patterns.join(\",\")}}` : `${patterns.join(\",\")}`;\n  const files = glob.sync(globPattern, { ignore }).filter(f => !onlyChanged || changedFiles.has(f));\n\n  if (!files.length) {\n    return;\n  }\n\n  let didWarn = false;\n  let didError = false;\n\n  files.forEach(file => {\n    const options = prettier.resolveConfig.sync(file, {\n      config: prettierConfigPath,\n    });\n    try {\n      const input = fs.readFileSync(file, \"utf8\");\n      if (shouldWrite) {\n        const output = prettier.format(input, options);\n        if (output !== input) {\n          fs.writeFileSync(file, output, \"utf8\");\n        }\n      } else {\n        if (!prettier.check(input, options)) {\n          if (!didWarn) {\n            console.log(\n              \"\\n\" +\n                chalk.red(`  This project uses prettier to format all JavaScript code.\\n`) +\n                chalk.dim(`  Please run `) +\n                chalk.reset(\"yarn prettier-all\") +\n                chalk.dim(` and add changes to files listed below to your commit:`) +\n                `\\n`\n            );\n            didWarn = true;\n          }\n          console.log(`  ${file}`);\n        }\n      }\n    } catch (error) {\n      didError = true;\n      console.log(\"\\n\\n\" + error.message);\n      console.log(file);\n    }\n  });\n\n  if (didWarn || didError) {\n    console.log();\n    process.exit(1);\n  }\n});\n"
  },
  {
    "path": "scripts/publish-gh-pages.sh",
    "content": "#!/bin/bash\n\nset -e\n\n# Configurations\nORIGIN_URI=$(git config remote.origin.url)\n\nSRC_BRANCH=\"master\"\nSRC_DIR=\"website\"\nDEST_BRANCH=\"gh-pages\"\nDEST_DIR=\".\"\n\nTMP_DIR=\"$PWD/tmp_website_build\" # careful, the script will rm -rf this directory\n                                 # make sure it's an absolute path\nSRC_CLONE_DIR=\"$TMP_DIR/master\"\nDEST_CLONE_DIR=\"$TMP_DIR/gh-pages\"\n\nSCRIPT_NAME=`basename \"$0\"`\nCOMMIT_MESSAGE=\"Website published using $SCRIPT_NAME\"\n\nBUILD_COMMAND=\"yarn install && yarn build && mv prepack.min.js $SRC_DIR/js/\"\n\n# Utils\nRED='\\033[0;31m'\nGREEN='\\033[0;32m'\nNO_COLOR='\\033[0m'\nprint_green() { echo -e \"${GREEN}$1${NO_COLOR}\"; }\nprint_red() { echo -e \"${RED}$1${NO_COLOR}\"; }\nprint_ok() { print_green \"[ OK ]\\n\"; }\nprint_error() { print_red \"[ ERROR ]\\n\"; }\npushd_quiet() { pushd $1 > /dev/null; }\npopd_quiet() { popd $1 > /dev/null; }\nremove_tmp_dir() {\n  if [ -d $TMP_DIR ]; then\n    rm -rf $TMP_DIR\n  fi\n}\n\necho ---------------------------------------------------------------------------\necho \"This script will erase the content of the destination branch and replace \\\nit with the content of the source branch.\"\necho ---------------------------------------------------------------------------\necho \"Origin URI: $ORIGIN_URI\"\necho \"Source branch: $SRC_BRANCH\"\necho \"Source directory: $SRC_DIR\"\necho \"Destination branch: $DEST_BRANCH\"\necho \"Destination directory: $DEST_DIR\"\necho \"Build command: $BUILD_COMMAND (will be run in source branch before\" \\\n     \"moving its content)\"\necho ---------------------------------------------------------------------------\n\nread -p \"Proceed? [y/n] \" -n 1 -r\necho\nif [[ ! $REPLY =~ ^[Yy]$ ]]; then\n  print_error\n  echo \"Operation aborted by user\"\n  exit 1\nfi\n\n# Clean build directory to fetch a fresh copy of the branches everytime the\n# script is run. Stateless scripts are easier to debug.\nremove_tmp_dir\n\nprint_green \"Cloning source branch from remote...\"\ngit clone --single-branch -b $SRC_BRANCH $ORIGIN_URI $SRC_CLONE_DIR\nprint_ok\n\nprint_green \"Cloning destination branch from remote...\"\ngit clone --single-branch -b $DEST_BRANCH $ORIGIN_URI $DEST_CLONE_DIR\nprint_ok\n\nprint_green \"Running build command on source branch...\"\npushd_quiet $SRC_CLONE_DIR\neval $BUILD_COMMAND\npopd_quiet\nprint_ok\n\nprint_green \"Cleaning destination branch...\"\npushd_quiet $DEST_CLONE_DIR/$DEST_DIR\ngit rm -r *\npopd_quiet\nprint_ok\n\nprint_green \"Copying from source branch/directory to destination branch/directory...\"\ncp -a $SRC_CLONE_DIR/$SRC_DIR/* $DEST_CLONE_DIR/$DEST_DIR\nprint_ok\n\nprint_green \"Creating commit...\"\npushd_quiet $DEST_CLONE_DIR\ngit add $DEST_DIR\ngit commit -m \"$COMMIT_MESSAGE\" || (\n  print_error &&\n  echo \"=> git-commit returned non zero code.\"\n  echo \"=> This could be because source branch/directory and destination\" \\\n       \"branch/directory already have identical content.\" &&\n  echo \"=> Make sure you pushed your changes to $ORIGIN_URI and run this script\" \\\n       \"again\" &&\n  exit 1\n)\npopd_quiet\nprint_ok\n\nread -p \"Push changes to origin/$DEST_BRANCH? [y/n] \" -n 1 -r\necho\nif [[ $REPLY =~ ^[Yy]$ ]]; then\n  print_green \"Pushing changes to origin/$DEST_BRANCH...\"\n  pushd_quiet $DEST_CLONE_DIR\n  git push\n  popd_quiet\n  print_ok\nelse\n  echo \"Operation aborted. Changes have not been pushed to origin/$DEST_BRANCH.\"\n  print_error\nfi\n\nprint_green \"Cleanup! Removing temporary files...\"\nremove_tmp_dir\nprint_ok\n"
  },
  {
    "path": "scripts/test-error-handler.js",
    "content": "/**\n * Copyright (c) 2017-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n/* @flow */\n\nimport { type CompilerDiagnostic, type ErrorHandlerResult, FatalError } from \"../lib/errors.js\";\nimport { prepackFileSync } from \"../lib/prepack-node.js\";\nimport invariant from \"../lib/invariant.js\";\n\nlet chalk = require(\"chalk\");\nlet path = require(\"path\");\nlet fs = require(\"fs\");\n\nfunction search(dir, relative) {\n  let tests = [];\n\n  if (fs.existsSync(dir)) {\n    for (let name of fs.readdirSync(dir)) {\n      let loc = path.join(dir, name);\n      let stat = fs.statSync(loc);\n\n      if (stat.isFile()) {\n        tests.push({\n          file: fs.readFileSync(loc, \"utf8\"),\n          name: path.join(relative, name),\n        });\n      } else if (stat.isDirectory()) {\n        tests = tests.concat(search(loc, path.join(relative, name)));\n      }\n    }\n  }\n\n  return tests;\n}\n\nlet tests = search(`${__dirname}/../test/error-handler`, \"test/error-handler\");\n\nfunction errorHandler(\n  retval: ErrorHandlerResult,\n  errors: Array<CompilerDiagnostic>,\n  error: CompilerDiagnostic\n): ErrorHandlerResult {\n  errors.push(error);\n  return retval;\n}\n\nfunction runTest(name: string, code: string): boolean {\n  console.log(chalk.inverse(name));\n\n  let recover = code.includes(\"// recover-from-errors\");\n  let compatibility = code.includes(\"// jsc\") ? \"jsc-600-1-4-17\" : undefined;\n\n  let expectedErrors = code.match(/\\/\\/\\s*expected errors:\\s*(.*)/);\n  invariant(expectedErrors);\n  invariant(expectedErrors.length > 1);\n  expectedErrors = expectedErrors[1];\n  expectedErrors = eval(expectedErrors); // eslint-disable-line no-eval\n  invariant(expectedErrors.constructor === Array);\n\n  let errors = [];\n  try {\n    let options = {\n      internalDebug: false,\n      mathRandomSeed: \"0\",\n      errorHandler: errorHandler.bind(null, recover ? \"Recover\" : \"Fail\", errors),\n      serialize: true,\n      instantRender: false,\n      compatibility,\n    };\n\n    if (code.includes(\"// instant render\")) options.instantRender = true;\n    prepackFileSync([name], options);\n    if (!recover) {\n      console.error(chalk.red(\"Serialization succeeded though it should have failed\"));\n      return false;\n    }\n  } catch (e) {\n    if (!(e instanceof FatalError)) {\n      console.error(chalk.red(`Unexpected error: ${e.message}`));\n      return false;\n    }\n  }\n  if (errors.length !== expectedErrors.length) {\n    console.error(chalk.red(`Expected ${expectedErrors.length} errors, but found ${errors.length}`));\n    return false;\n  }\n\n  for (let i = 0; i < expectedErrors.length; ++i) {\n    for (let prop in expectedErrors[i]) {\n      let expected = expectedErrors[i][prop];\n      let actual = (errors[i]: any)[prop];\n      if (prop === \"location\") {\n        if (actual) delete actual.filename;\n        actual = JSON.stringify(actual);\n        expected = JSON.stringify(expected);\n      }\n      if (expected !== actual) {\n        console.error(chalk.red(`Error ${i + 1}: Expected ${expected} errors, but found ${actual}`));\n        return false;\n      }\n    }\n  }\n\n  return true;\n}\n\nfunction run() {\n  let failed = 0;\n  let passed = 0;\n  let total = 0;\n\n  for (let test of tests) {\n    // filter hidden files\n    if (path.basename(test.name)[0] === \".\") continue;\n    if (test.name.endsWith(\"~\")) continue;\n\n    total++;\n    if (runTest(test.name, test.file)) passed++;\n    else failed++;\n  }\n\n  console.log(\"Passed:\", `${passed}/${total}`, (Math.floor((passed / total) * 100) || 0) + \"%\");\n  return failed === 0;\n}\n\nif (!run()) process.exit(1);\n"
  },
  {
    "path": "scripts/test-internal-react.js",
    "content": "/**\n * Copyright (c) 2017-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n/* @flow */\n\nlet chalk = require(\"chalk\");\nlet execSync = require(\"child_process\").execSync;\nlet mkdirp = require(\"mkdirp\");\nlet path = require(\"path\");\nlet fs = require(\"fs\");\n\nfunction search(dir, relative) {\n  let tests = [];\n\n  if (fs.existsSync(dir)) {\n    for (let name of fs.readdirSync(dir)) {\n      let loc = path.join(dir, name);\n      let stat = fs.statSync(loc);\n\n      if (stat.isFile()) {\n        tests.push({\n          name: path.join(relative, name),\n          // $FlowFixMe\n          config: require(loc),\n        });\n      } else if (stat.isDirectory()) {\n        tests = tests.concat(search(loc, path.join(relative, name)));\n      }\n    }\n  }\n\n  return tests;\n}\n\nlet tests = search(`${__dirname}/../facebook/test-react`, \"facebook/test-react\");\n\nfunction runTest(name: string, config: any) {\n  // Verify the original test passes without Prepack\n  console.log(chalk.inverse(name));\n  const { testName, testBundle } = config;\n  console.log(\"-----------------------------\");\n  console.log(\"Running tests before Prepack:\");\n  console.log(chalk.bold(`js1 jest ${testName}`));\n  console.log(\"-----------------------------\");\n  execSync(`${__dirname}/../../js/scripts/jest/jest ${testName}`, { stdio: \"inherit\" });\n  console.log(\"\\n\\n\\n\");\n\n  // Verify we can Prepack the bundle\n  console.log(\"-----------------------------\");\n  console.log(\"Prepacking:\");\n  console.log(chalk.bold(path.resolve(testBundle)));\n  console.log(\"-----------------------------\");\n  const sourceCode = fs.readFileSync(testBundle, \"utf8\");\n  mkdirp.sync(`${__dirname}/../fb-www`);\n\n  fs.writeFileSync(`${__dirname}/../fb-www/input.js`, sourceCode, \"utf8\");\n  execSync(\n    `${__dirname}/../../third-party/node/bin/node --max_old_space_size=16384 --heap-growing-percent=50 scripts/debug-fb-www.js `,\n    { stdio: \"inherit\" }\n  );\n  console.log(\"\\n\\n\\n\");\n\n  console.log(\"-----------------------------\");\n  console.log(\"Running tests after Prepack:\");\n  console.log(chalk.bold(`js1 jest ${testName}`));\n  console.log(\"-----------------------------\");\n  const outputCode = fs.readFileSync(`${__dirname}/../fb-www/output.js`, \"utf8\");\n  try {\n    fs.writeFileSync(\n      testBundle,\n      `\n      (function() {\n        const React = require('react');\n        ${outputCode}\n      }).call(global);\n    `,\n      \"utf8\"\n    );\n    // Verify the test passes on the output\n    execSync(`${__dirname}/../../js/scripts/jest/jest ${testName}`, { stdio: \"inherit\" });\n    console.log(\"\\n\\n\\n\");\n    console.log(\"Success!\");\n  } finally {\n    // Revert the change.\n    fs.writeFileSync(testBundle, sourceCode, \"utf8\");\n  }\n}\n\nfunction run() {\n  let failed = 0;\n  let passed = 0;\n  let total = 0;\n\n  for (let test of tests) {\n    if (!test.name.endsWith(\".js\")) continue;\n\n    total++;\n    try {\n      runTest(test.name, test.config);\n      passed++;\n    } catch (err) {\n      console.error(err.stack || err);\n      failed++;\n    }\n  }\n\n  console.log(\"Passed:\", `${passed}/${total}`, (Math.floor((passed / total) * 100) || 0) + \"%\");\n  return failed === 0;\n}\n\nif (!run()) process.exit(1);\n"
  },
  {
    "path": "scripts/test-internal.js",
    "content": "/**\n * Copyright (c) 2017-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n/* @flow */\n\nimport { CompilerDiagnostic, type ErrorHandlerResult, FatalError } from \"../lib/errors.js\";\nimport type { BabelNodeSourceLocation } from \"@babel/types\";\nimport { prepackSources } from \"../lib/prepack-standalone.js\";\n\nlet chalk = require(\"chalk\");\nlet path = require(\"path\");\nlet fs = require(\"fs\");\n\nfunction search(dir, relative) {\n  let tests = [];\n\n  if (fs.existsSync(dir)) {\n    for (let name of fs.readdirSync(dir)) {\n      let loc = path.join(dir, name);\n      let stat = fs.statSync(loc);\n\n      if (stat.isFile()) {\n        tests.push({\n          file: fs.readFileSync(loc, \"utf8\"),\n          name: path.join(relative, name),\n        });\n      } else if (stat.isDirectory()) {\n        tests = tests.concat(search(loc, path.join(relative, name)));\n      }\n    }\n  }\n\n  return tests;\n}\n\nlet tests = search(`${__dirname}/../facebook/test`, \"facebook/test\");\n\nlet errors: Map<BabelNodeSourceLocation, CompilerDiagnostic>;\nlet errorList: Array<CompilerDiagnostic>;\nfunction errorHandler(diagnostic: CompilerDiagnostic): ErrorHandlerResult {\n  if (diagnostic.location) errors.set(diagnostic.location, diagnostic);\n  else errorList.push(diagnostic);\n  return \"Recover\";\n}\n\nfunction runTest(name: string, code: string): boolean {\n  console.log(chalk.inverse(name));\n  try {\n    errors = new Map();\n    errorList = [];\n    let modelName = name + \".model\";\n    let sourceMapName = name + \".map\";\n    let modulesName = name + \".modules\";\n    let sourceCode = fs.readFileSync(name, \"utf8\");\n    let modelCode = fs.existsSync(modelName) ? fs.readFileSync(modelName, \"utf8\") : undefined;\n    let sourceMap = fs.existsSync(sourceMapName) ? fs.readFileSync(sourceMapName, \"utf8\") : undefined;\n    let modulesString = fs.existsSync(modulesName) ? JSON.parse(fs.readFileSync(modulesName, \"utf8\")) : undefined;\n    let sources = [];\n    if (modelCode) {\n      sources.push({ filePath: modelName, fileContents: modelCode });\n    }\n    sources.push({ filePath: name, fileContents: sourceCode, sourceMapContents: sourceMap });\n\n    let options = {\n      internalDebug: true,\n      compatibility: \"jsc-600-1-4-17\",\n      mathRandomSeed: \"0\",\n      errorHandler,\n      serialize: true,\n      modulesToInitialize: modulesString || (modelCode ? undefined : \"ALL\"),\n      sourceMaps: !!sourceMap,\n    };\n    let serialized = prepackSources(sources, options);\n    let new_map = serialized.map; // force source maps to get computed\n    if (!new_map) console.error(chalk.red(\"No source map\"));\n    if (!serialized) {\n      console.error(chalk.red(\"Error during serialization\"));\n      return false;\n    } else {\n      return true;\n    }\n  } catch (e) {\n    if (!(e instanceof FatalError)) console.error(e);\n    return false;\n  } finally {\n    for (let [loc, error] of errors) {\n      console.error(\n        `${error.severity}: ${loc.source || \"\"} ${loc.start.line}:${loc.start.column + 1} ${error.errorCode} ${\n          error.message\n        }`\n      );\n    }\n    for (let error of errorList) {\n      console.error(`${error.severity}: ${error.errorCode} ${error.message}`);\n    }\n  }\n}\n\nfunction run() {\n  let failed = 0;\n  let passed = 0;\n  let total = 0;\n\n  for (let test of tests) {\n    if (!test.name.endsWith(\".js\")) continue;\n\n    total++;\n    if (runTest(test.name, test.file)) passed++;\n    else failed++;\n  }\n\n  console.log(\"Passed:\", `${passed}/${total}`, (Math.floor((passed / total) * 100) || 0) + \"%\");\n  return failed === 0;\n}\n\nif (!run()) process.exit(1);\n"
  },
  {
    "path": "scripts/test-runner.js",
    "content": "/**\n * Copyright (c) 2017-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n/* @flow */\n\nimport invariant from \"../lib/invariant.js\";\nlet FatalError = require(\"../lib/errors.js\").FatalError;\nlet prepackSources = require(\"../lib/prepack-node.js\").prepackSources;\nimport type { PrepackOptions } from \"../lib/prepack-options\";\nimport type { ErrorHandler, Severity, CompilerDiagnostic } from \"../lib/errors.js\";\n\nfunction serialRun(promises: Array<() => Promise<void>>, i: number) {\n  if (promises[i] instanceof Function) {\n    return promises[i]().then(function() {\n      return serialRun(promises, i + 1);\n    });\n  } else {\n    return Promise.resolve();\n  }\n}\n\nfunction SerialPromises(promises: Array<() => Promise<void>>) {\n  return serialRun(promises, 0);\n}\n\nlet Serializer = require(\"../lib/serializer/index.js\").default;\nlet SourceFileCollection = require(\"../lib/types.js\").SourceFileCollection;\nlet SerializerStatistics = require(\"../lib/serializer/statistics.js\").SerializerStatistics;\nlet construct_realm = require(\"../lib/construct_realm.js\").default;\nlet initializeGlobals = require(\"../lib/globals.js\").default;\nlet chalk = require(\"chalk\");\nlet path = require(\"path\");\nlet fs = require(\"fs\");\nlet vm = require(\"vm\");\nlet os = require(\"os\");\nlet minimist = require(\"minimist\");\nlet babel = require(\"@babel/core\");\nlet child_process = require(\"child_process\");\nconst EOL = os.EOL;\nlet execSpec;\nlet JSONTokenizer = require(\"../lib/utils/JSONTokenizer.js\").default;\nlet { Linter } = require(\"eslint\");\nlet lintConfig = require(\"./lint-config\");\nlet TextPrinter = require(\"../lib/utils/TextPrinter.js\").TextPrinter;\n\nfunction transformWithBabel(code, plugins, presets) {\n  return babel.transform(code, {\n    plugins: plugins,\n    presets: presets,\n    configFile: false,\n  }).code;\n}\n\nfunction lintCompiledSource(source) {\n  let linter = new Linter();\n  let errors = linter.verify(source, lintConfig);\n  if (errors.length > 0) {\n    console.log(\"\\nTest output failed lint due to:\\n\");\n    for (let error of errors) {\n      console.log(`${chalk.red(error.message)} ${chalk.gray(`(${error.line}:${error.column})`)}`);\n    }\n    console.log();\n    throw new Error(\"Test failed lint\");\n  }\n}\n\nfunction search(dir, relative) {\n  let tests = [];\n\n  for (let name of fs.readdirSync(dir)) {\n    let loc = path.join(dir, name);\n    let stat = fs.statSync(loc);\n\n    if (stat.isFile()) {\n      tests.push({\n        file: fs.readFileSync(loc, \"utf8\"),\n        name: path.join(relative, name),\n      });\n    } else if (stat.isDirectory()) {\n      tests = tests.concat(search(loc, path.join(relative, name)));\n    }\n  }\n\n  return tests;\n}\n\nconst LAZY_OBJECTS_RUNTIME_NAME = \"LazyObjectsRuntime\";\nlet tests = search(`${__dirname}/../test/serializer`, \"test/serializer\");\n\n// run JS subprocess\n// externalSpec defines how to invoke external REPL and how to print.\n//  - cmd - cmd to execute, script is piped into this.\n//  - printName - name of function which can be used to print to stdout.\nfunction execExternal(externalSpec, code) {\n  // essentially the code from execInContext run through babel\n  let script = `\n  var global = this;\n  var self = this;\n  var _logOutput = \"\";\n  function write(prefix, values) {\n    _logOutput += \"\\\\n\" + prefix + values.join(\"\");\n  }\n  var cachePrint = ${externalSpec.printName};\n  global.console = {}\n  global.console.log = function log() {\n      for (var _len = arguments.length, s = Array(_len), _key = 0; _key < _len; _key++) {\n        s[_key] = arguments[_key];\n      }\n      write(\"\", s);\n    };\n    global.console.warn = function warn() {\n      for (var _len2 = arguments.length, s = Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {\n        s[_key2] = arguments[_key2];\n      }\n      write(\"WARN:\", s);\n    };\n    global.console.error = function error() {\n      for (var _len3 = arguments.length, s = Array(_len3), _key3 = 0; _key3 < _len3; _key3++) {\n        s[_key3] = arguments[_key3];\n      }\n      write(\"ERROR:\", s);\n    };\n  try {\n    ${code}\n    let inspectResult = inspect();\n    if (inspectResult && typeof inspectResult.then === 'function') {\n      return inspectResult.then(function (resultOutput) {\n        cachePrint(resultOutput + _logOutput);\n      });\n    } else {\n      cachePrint(inspectResult + _logOutput);\n    }\n  } catch (e) {\n    cachePrint(e);\n  }`;\n\n  let child = child_process.spawnSync(externalSpec.cmd, { input: script });\n\n  let output = String(child.stdout);\n\n  return Promise.resolve(String(output.trim()));\n}\n\nfunction augmentCodeWithLazyObjectSupport(code, lazyRuntimeName) {\n  const mockLazyObjectsSupport = `\n    /* Lazy objects mock support begin */\n    var ${lazyRuntimeName} = {\n      _lazyObjectIds: new Map(),\n      _callback: null,\n      setLazyObjectInitializer: function(callback) {\n        this._callback = callback;\n      },\n      createLazyObject: function(id) {\n        var obj = {};\n        this._lazyObjectIds.set(obj, id);\n        return obj;\n      },\n      hydrateObject: function(obj) {\n        const AlreadyHydratedLazyId = -1;\n        const lazyId = this._lazyObjectIds.get(obj);\n        if (lazyId === AlreadyHydratedLazyId) {\n          return;\n        }\n        this._callback(obj, lazyId);\n        this._lazyObjectIds.set(obj, AlreadyHydratedLazyId);\n      }\n    };\n\n    var __hydrationHook = {\n      get: function(target, prop) {\n        ${LAZY_OBJECTS_RUNTIME_NAME}.hydrateObject(target);\n        return Reflect.get(target, prop);\n      },\n      set: function(target, property, value, receiver) {\n        ${LAZY_OBJECTS_RUNTIME_NAME}.hydrateObject(target);\n        return Reflect.set(target, property, value, receiver);\n      },\n      has: function(target, prop) {\n        ${LAZY_OBJECTS_RUNTIME_NAME}.hydrateObject(target);\n        return Reflect.has(target, prop);\n      },\n      getOwnPropertyDescriptor: function(target, prop) {\n        ${LAZY_OBJECTS_RUNTIME_NAME}.hydrateObject(target);\n        return Reflect.getOwnPropertyDescriptor(target, prop);\n      },\n      ownKeys: function(target) {\n        ${LAZY_OBJECTS_RUNTIME_NAME}.hydrateObject(target);\n        return Reflect.ownKeys(target);\n      },\n      defineProperty: function(target, property, descriptor) {\n        ${LAZY_OBJECTS_RUNTIME_NAME}.hydrateObject(target);\n        return Reflect.defineProperty(target, property, descriptor);\n      },\n      isExtensible: function(target) {\n        ${LAZY_OBJECTS_RUNTIME_NAME}.hydrateObject(target);\n        return Reflect.isExtensible(target);\n      },\n      preventExtensions: function(target) {\n        ${LAZY_OBJECTS_RUNTIME_NAME}.hydrateObject(target);\n        return Reflect.preventExtensions(target);\n      },\n      deleteProperty: function(target, prop) {\n        ${LAZY_OBJECTS_RUNTIME_NAME}.hydrateObject(target);\n        return Reflect.deleteProperty(target, prop);\n      },\n      getPrototypeOf: function(target) {\n        ${LAZY_OBJECTS_RUNTIME_NAME}.hydrateObject(target);\n        return Reflect.getPrototypeOf(target);\n      },\n      setPrototypeOf: function(target, prototype) {\n        ${LAZY_OBJECTS_RUNTIME_NAME}.hydrateObject(target);\n        return Reflect.setPrototypeOf(target, prototype);\n      },\n      apply: function(target, thisArg, argumentsList) {\n        ${LAZY_OBJECTS_RUNTIME_NAME}.hydrateObject(target);\n        return Reflect.apply(target, thisArg, argumentsList);\n      },\n      construct: function(target, argumentsList, newTarget) {\n        ${LAZY_OBJECTS_RUNTIME_NAME}.hydrateObject(target);\n        return Reflect.construct(target, argumentsList, newTarget);\n      }\n    };\n    /* Lazy objects mock support end */\n  `;\n  function wrapLazyObjectWithProxyHook(lazyCode) {\n    const lazyObjectCreationRegex = new RegExp(`(${lazyRuntimeName}\\.createLazyObject\\\\(\\\\d+\\\\))`, \"g\");\n    return lazyCode.replace(lazyObjectCreationRegex, \"new Proxy($1, __hydrationHook)\");\n  }\n  code = wrapLazyObjectWithProxyHook(code);\n  return `${mockLazyObjectsSupport}\n    ${code}; // keep newline here as code may end with comment`;\n}\n\n// run code in a seperate context\nfunction execInContext(code) {\n  let result = \"\";\n  let logOutput = \"\";\n\n  function write(prefix, values) {\n    logOutput += \"\\n\" + prefix + values.join(\"\");\n  }\n\n  try {\n    new vm.Script(\n      `var global = this;\n      var self = this;\n      ${code}\n      report(inspect());`,\n      { cachedDataProduced: false }\n    ).runInNewContext({\n      setTimeout: setTimeout,\n      setInterval: setInterval,\n      clearTimeout: clearTimeout,\n      clearInterval: clearInterval,\n      report: function(s) {\n        result = s;\n      },\n      console: {\n        log(...s) {\n          write(\"\", s);\n        },\n        warn(...s) {\n          write(\"WARN:\", s);\n        },\n        error(...s) {\n          write(\"ERROR:\", s);\n        },\n      },\n    });\n  } catch (e) {\n    return Promise.reject(e);\n  }\n  if (result && typeof result.then === \"function\") {\n    return result.then(function(resultOutput) {\n      return (resultOutput + logOutput).trim();\n    });\n  } else {\n    return Promise.resolve((result + logOutput).trim());\n  }\n}\n\nfunction parseFunctionOrderings(code: string): Array<number> {\n  const orders = [];\n  const functionOrderPattern = /Function ordering: (\\d+)/g;\n  let match;\n  while ((match = functionOrderPattern.exec(code)) != null) {\n    invariant(match !== null);\n    orders.push(+match[1]);\n  }\n  return orders;\n}\n\nfunction verifyFunctionOrderings(code: string): boolean {\n  const orders = parseFunctionOrderings(code);\n  for (let i = 1; i < orders.length; ++i) {\n    invariant(orders[i] !== orders[i - 1]);\n    if (orders[i] < orders[i - 1]) {\n      console.error(chalk.red(`Funtion ordering is not preserved: function ${orders[i - 1]} is before ${orders[i]}`));\n      return false;\n    }\n  }\n  return true;\n}\n\nfunction unescapeUniqueSuffix(code: string, uniqueSuffix?: string) {\n  return uniqueSuffix != null ? code.replace(new RegExp(uniqueSuffix, \"g\"), \"\") : code;\n}\n\nfunction getErrorHandlerWithWarningCapture(\n  diagnosticOutput: Map<Severity, Set<string>>,\n  verbose: boolean\n): ErrorHandler {\n  return (diagnostic: CompilerDiagnostic, suppressDiagnostics: boolean) => {\n    let msg = \"\";\n    if (!suppressDiagnostics) {\n      msg = `${diagnostic.errorCode}: ${diagnostic.message}`;\n      if (verbose && diagnostic.location) {\n        let loc_start = diagnostic.location.start;\n        let loc_end = diagnostic.location.end;\n        msg += ` at ${loc_start.line}:${loc_start.column} to ${loc_end.line}:${loc_end.column}`;\n      }\n      let errorCodeSet = diagnosticOutput.get(diagnostic.severity);\n      if (!errorCodeSet) diagnosticOutput.set(diagnostic.severity, (errorCodeSet = new Set()));\n      errorCodeSet.add(diagnostic.errorCode);\n    }\n    try {\n      if (verbose && !suppressDiagnostics) console.log(`${diagnostic.severity}: ${msg}`);\n      return \"Recover\";\n    } finally {\n      if (verbose && !suppressDiagnostics) console.log(diagnostic.callStack);\n    }\n  };\n}\n\nfunction runTest(name, code, options: PrepackOptions, args) {\n  if (!args.fast && args.filter === \"\") console.log(chalk.inverse(name) + \" \" + JSON.stringify(options));\n  let compatibility = code.includes(\"// jsc\") ? \"jsc-600-1-4-17\" : undefined;\n  let modulesToInitializeMarker = \"// initialize more modules:\";\n  let modulesToInitializeLoc = code.indexOf(modulesToInitializeMarker);\n  let modulesToInitialize;\n  if (modulesToInitializeLoc > 0)\n    modulesToInitialize = new Set(\n      code\n        .substring(\n          modulesToInitializeLoc + modulesToInitializeMarker.length,\n          code.indexOf(\"\\n\", modulesToInitializeLoc)\n        )\n        .trim()\n        .split(\",\")\n    );\n  else if (code.includes(\"// initialize more modules\")) modulesToInitialize = \"ALL\";\n  if (args.verbose || code.includes(\"// inline expressions\")) options.inlineExpressions = true;\n  options.invariantLevel = code.includes(\"// omit invariants\") || args.verbose ? 0 : 99;\n  if (code.includes(\"// emit concrete model\")) options.emitConcreteModel = true;\n  if (code.includes(\"// exceeds stack limit\")) options.maxStackDepth = 10;\n  if (code.includes(\"// instant render\")) options.instantRender = true;\n  if (code.includes(\"// react\")) {\n    options.reactEnabled = true;\n    options.reactOutput = \"jsx\";\n  }\n  let compileJSXWithBabel = code.includes(\"// babel:jsx\");\n  let functionCloneCountMatch = code.match(/\\/\\/ serialized function clone count: (\\d+)/);\n  options = ((Object.assign({}, options, {\n    compatibility,\n    debugNames: args.debugNames,\n    debugScopes: args.debugScopes,\n    errorHandler: diag => \"Fail\",\n    internalDebug: true,\n    serialize: true,\n    uniqueSuffix: \"\",\n    arrayNestedOptimizedFunctionsEnabled: false,\n    removeModuleFactoryFunctions: false,\n    modulesToInitialize,\n  }): any): PrepackOptions); // Since PrepackOptions is an exact type I have to cast\n  if (code.includes(\"// arrayNestedOptimizedFunctionsEnabled\")) {\n    options.arrayNestedOptimizedFunctionsEnabled = true;\n  }\n  if (code.includes(\"// removeModuleFactoryFunctions\")) {\n    options.removeModuleFactoryFunctions = true;\n  }\n  if (code.includes(\"// throws introspection error\")) {\n    try {\n      let realmOptions = {\n        serialize: true,\n        compatibility,\n        uniqueSuffix: \"\",\n        errorHandler: diag => \"Fail\",\n        maxStackDepth: options.maxStackDepth,\n      };\n      let realm = construct_realm(realmOptions, undefined, new SerializerStatistics());\n      initializeGlobals(realm);\n      let serializerOptions = {\n        modulesToInitialize,\n        internalDebug: true,\n        lazyObjectsRuntime: options.lazyObjectsRuntime,\n      };\n      let serializer = new Serializer(realm, serializerOptions);\n      let sourceFileCollection = new SourceFileCollection([{ filePath: name, fileContents: code }]);\n      let serialized = serializer.init(sourceFileCollection, false);\n      if (!serialized) {\n        console.error(chalk.red(\"Error during serialization\"));\n      } else {\n        console.error(chalk.red(\"Test should have caused introspection error!\"));\n      }\n    } catch (err) {\n      if (err instanceof FatalError) return Promise.resolve(true);\n      console.error(\"Test should have caused introspection error, but instead caused a different internal error!\");\n      console.error(err);\n      console.error(err.stack);\n    }\n    return Promise.resolve(false);\n  } else if (code.includes(\"// cannot serialize\")) {\n    try {\n      prepackSources([{ filePath: name, fileContents: code, sourceMapContents: \"\" }], options);\n    } catch (err) {\n      if (err instanceof FatalError) {\n        return Promise.resolve(true);\n      }\n      console.error(err);\n      console.error(err.stack);\n    }\n    console.error(chalk.red(\"Test should have caused error during serialization!\"));\n    return Promise.resolve(false);\n  } else if (code.includes(\"// no effect\")) {\n    try {\n      let serialized = prepackSources([{ filePath: name, fileContents: code, sourceMapContents: \"\" }], options);\n      if (!serialized) {\n        console.error(chalk.red(\"Error during serialization!\"));\n        return Promise.resolve(false);\n      }\n      if (!serialized.code.trim()) {\n        return Promise.resolve(true);\n      }\n      console.error(chalk.red(\"Generated code should be empty but isn't!\"));\n      console.error(chalk.underline(\"original code\"));\n      console.error(code);\n      console.error(chalk.underline(`generated code`));\n      console.error(serialized.code);\n    } catch (err) {\n      console.error(err);\n      console.error(err.stack);\n    }\n    return Promise.resolve(false);\n  } else {\n    let codeIterations = [];\n    let irIterations = [];\n    let markersToFind = [];\n    for (let [positive, marker] of [[true, \"// does contain:\"], [false, \"// does not contain:\"]]) {\n      for (let i = code.indexOf(marker); i >= 0; i = code.indexOf(marker, i + 1)) {\n        let value = code.substring(i + marker.length, code.indexOf(\"\\n\", i));\n        markersToFind.push({ positive, value });\n      }\n    }\n    let copiesToFind = new Map();\n    const copyMarker = \"// Copies of \";\n    let searchStart = code.indexOf(copyMarker);\n    while (searchStart !== -1) {\n      let searchEnd = code.indexOf(\":\", searchStart);\n      let value = code.substring(searchStart + copyMarker.length, searchEnd);\n      let newline = code.indexOf(\"\\n\", searchStart);\n      let count = parseInt(code.substring(searchEnd + 1, newline), 10);\n      copiesToFind.set(new RegExp(value.replace(/[[\\]]/g, \"\\\\$&\"), \"gi\"), count);\n      searchStart = code.indexOf(copyMarker, newline);\n    }\n    let addedCode = \"\";\n    let injectAtRuntime = \"// add at runtime:\";\n    if (code.includes(injectAtRuntime)) {\n      let i = code.indexOf(injectAtRuntime);\n      addedCode = code.substring(i + injectAtRuntime.length, code.indexOf(\"\\n\", i));\n    }\n    if (args.es5) {\n      code = transformWithBabel(code, [], [[\"@babel/env\", { forceAllTransforms: true, modules: false }]]);\n    }\n    let unique = 27277;\n    let oldUniqueSuffix = \"\";\n    let expectedCode = code;\n    let actualStack;\n    if (compileJSXWithBabel) {\n      expectedCode = transformWithBabel(expectedCode, [\"@babel/plugin-transform-react-jsx\"]);\n    }\n    // For some tests (e.g. nested optimized function definition) there is no way to pass lint due to undefined global\n    // __optimize\n    let runLint = !code.includes(\"// skip lint\");\n\n    return execInContext(\n      `${addedCode}\\n(function () {${expectedCode} // keep newline here as code may end with comment\n  }).call(this);`\n    )\n      .catch(e => \"\" + e)\n      .then(function(expected) {\n        let i = 0;\n        const singleIterationOnly = addedCode || copiesToFind.size > 0 || args.fast;\n        let max = singleIterationOnly ? 1 : 4;\n        let oldCode = code;\n        let anyDelayedValues = false;\n\n        let actual;\n        return SerialPromises(\n          new Array(singleIterationOnly ? 1 : max).fill(0).map(function() {\n            let newUniqueSuffix = `_unique${unique++}`;\n            if (!singleIterationOnly) options.uniqueSuffix = newUniqueSuffix;\n\n            let expectedDiagnostics = new Map();\n            // Expected diagnostics comment: \"// expected [FatalError | RecoverableError | Warning | Information]: PP0001, PP0002, ...\"\n            let diagnosticOutput = new Map();\n            for (let severity of [\"FatalError\", \"RecoverableError\", \"Warning\", \"Information\"]) {\n              let diagnosticExpectedComment = `// expected ${severity}:`;\n              if (code.includes(diagnosticExpectedComment)) {\n                let idx = code.indexOf(diagnosticExpectedComment);\n                let errorCodeString = code\n                  .substring(idx + diagnosticExpectedComment.length, code.indexOf(\"\\n\", idx))\n                  .trim();\n                if (errorCodeString !== \"\") {\n                  let errorCodeSet = new Set();\n                  expectedDiagnostics.set(severity, errorCodeSet);\n                  errorCodeString.split(\",\").forEach(errorCode => errorCodeSet.add(errorCode.trim()));\n                }\n              }\n              if (expectedDiagnostics.size > 0)\n                options.errorHandler = getErrorHandlerWithWarningCapture(diagnosticOutput, args.verbose);\n            }\n\n            let ir = \"\";\n            if (args.ir)\n              options.onExecute = (realm, optimizedFunctions) => {\n                new TextPrinter(line => {\n                  ir += line + \"\\n\";\n                }).print(realm, optimizedFunctions);\n              };\n\n            let serialized = prepackSources([{ filePath: name, fileContents: code, sourceMapContents: \"\" }], options);\n            if (serialized.statistics && serialized.statistics.delayedValues > 0) anyDelayedValues = true;\n            if (!serialized) {\n              console.error(chalk.red(\"Error during serialization!\"));\n              return () => Promise.reject();\n            }\n\n            function setEquals(set1, set2) {\n              if (!set1 || !set2 || set1.size !== set2.size) return false;\n              for (let x of set1) if (!set2.has(x)) return false;\n              return true;\n            }\n            let diagnosticIssue = false;\n            if (diagnosticOutput.size > 0 || expectedDiagnostics.size > 0) {\n              if (diagnosticOutput.size !== expectedDiagnostics.size) {\n                diagnosticIssue = true;\n                let diagnosticOutputKeys = [...diagnosticOutput.keys()];\n                let expectedOutputKeys = [...expectedDiagnostics.keys()];\n                console.error(\n                  chalk.red(\n                    `Expected [${expectedOutputKeys.toString()}] but found [${diagnosticOutputKeys.toString()}]`\n                  )\n                );\n              }\n              for (let [severity, diagnostics] of diagnosticOutput) {\n                let expectedErrorCodes = expectedDiagnostics.get(severity);\n                if (!setEquals(expectedErrorCodes, diagnostics)) {\n                  diagnosticIssue = true;\n                  console.error(\n                    chalk.red(\n                      `Output Diagnostics Severity:${severity} ${[\n                        ...diagnostics,\n                      ].toString()} don't match expected diagnostics ${\n                        expectedErrorCodes ? [...expectedErrorCodes].toString() : \"None\"\n                      }`\n                    )\n                  );\n                }\n              }\n            }\n\n            let newCode = serialized.code;\n            if (compileJSXWithBabel) {\n              newCode = transformWithBabel(newCode, [\"@babel/plugin-transform-react-jsx\"]);\n            }\n            let markersIssue = false;\n            for (let { positive, value } of markersToFind) {\n              let found = newCode.includes(value);\n              if (found !== positive) {\n                console.error(\n                  chalk.red(`Output ${positive ? \"does not contain required\" : \"contains forbidden\"} string: ${value}`)\n                );\n                markersIssue = true;\n                console.error(newCode);\n              }\n            }\n            let matchesIssue = false;\n            for (let [pattern, count] of copiesToFind) {\n              let matches = serialized.code.match(pattern);\n              if ((!matches && count > 0) || (matches && matches.length !== count)) {\n                matchesIssue = true;\n                console.error(\n                  chalk.red(\n                    `Wrong number of occurrances of ${pattern.toString()} got ${\n                      matches ? matches.length : 0\n                    } instead of ${count}`\n                  )\n                );\n                console.error(newCode);\n              }\n            }\n            if (markersIssue || matchesIssue || diagnosticIssue) return () => Promise.reject({ type: \"MARKER\" });\n            let codeToRun = addedCode + newCode;\n            if (!execSpec && options.lazyObjectsRuntime !== undefined) {\n              codeToRun = augmentCodeWithLazyObjectSupport(codeToRun, args.lazyObjectsRuntime);\n            }\n            if (args.verbose) {\n              if (args.ir) console.log(`=== ir\\n${ir}\\n`);\n              console.log(`=== generated code\\n${codeToRun}\\n`);\n            }\n            irIterations.push(unescapeUniqueSuffix(ir, options.uniqueSuffix));\n            codeIterations.push(unescapeUniqueSuffix(codeToRun, options.uniqueSuffix));\n            if (args.es5) {\n              codeToRun = transformWithBabel(\n                codeToRun,\n                [],\n                [[\"@babel/env\", { forceAllTransforms: true, modules: false }]]\n              );\n            }\n            // lint output\n            if (runLint) lintCompiledSource(codeToRun);\n            let actualPromise;\n            if (execSpec) {\n              actualPromise = execExternal(execSpec, codeToRun);\n            } else {\n              actualPromise = execInContext(codeToRun);\n            }\n            return () =>\n              actualPromise\n                .catch(function(execError) {\n                  // execInContext/execExternal failed\n                  // always compare strings.\n                  actual = \"\" + execError;\n                  actualStack = execError && execError.stack;\n                  return Promise.resolve(\"\" + execError);\n                })\n                .then(function(_actual) {\n                  actual = _actual;\n                  if (expected !== actual) {\n                    console.error(chalk.red(\"Output mismatch!\"));\n                    return Promise.reject({ type: \"BREAK\" });\n                  }\n                  if (!verifyFunctionOrderings(codeToRun)) {\n                    return Promise.reject({ type: \"BREAK\" });\n                  }\n                  // Test the number of clone functions generated with the inital prepack call\n                  if (i === 0 && functionCloneCountMatch) {\n                    let functionCount = parseInt(functionCloneCountMatch[1], 10);\n                    if (serialized.statistics && functionCount !== serialized.statistics.functionClones) {\n                      console.error(\n                        chalk.red(\n                          `Code generation serialized an unexpected number of clone functions. Expected: ${functionCount}, Got: ${\n                            serialized.statistics.functionClones\n                          }`\n                        )\n                      );\n                      return Promise.reject({ type: \"BREAK\" });\n                    }\n                  }\n                  if (singleIterationOnly) return Promise.reject({ type: \"RETURN\", value: true });\n                  if (\n                    unescapeUniqueSuffix(oldCode, oldUniqueSuffix) === unescapeUniqueSuffix(newCode, newUniqueSuffix)\n                  ) {\n                    // The generated code reached a fixed point!\n                    return Promise.reject({ type: \"RETURN\", value: true });\n                  }\n                  oldCode = newCode;\n                  oldUniqueSuffix = newUniqueSuffix;\n                  i++;\n                });\n          })\n        ).catch(function(err) {\n          const { type, value } = err;\n          if (type === \"BREAK\") {\n            if (i === max) {\n              if (anyDelayedValues) {\n                // TODO #835: Make delayed initializations logic more sophisticated in order to still reach a fixed point.\n                return Promise.resolve(true);\n              }\n              console.error(chalk.red(`Code generation did not reach fixed point after ${max} iterations!`));\n            }\n\n            console.error(chalk.underline(\"original code\"));\n            console.error(code);\n            console.error(chalk.underline(\"output of inspect() on original code\"));\n            console.error(expected);\n            for (let ii = 0; ii < codeIterations.length; ii++) {\n              if (args.ir) {\n                console.error(chalk.underline(`ir in iteration ${ii}`));\n                console.error(irIterations[ii]);\n              }\n              console.error(chalk.underline(`generated code in iteration ${ii}`));\n              console.error(codeIterations[ii]);\n            }\n            console.error(chalk.underline(\"output of inspect() on last generated code iteration\"));\n            console.error(actual);\n            if (actualStack) console.error(actualStack);\n            return Promise.resolve(false);\n          } else if (type === \"RETURN\") {\n            return value;\n          } else if (type === \"MARKER\") {\n            return undefined;\n          } else {\n            console.error(err);\n            console.error(err.stack);\n          }\n        });\n      })\n      .catch(function(err) {\n        console.log(name);\n        console.error(err);\n        console.error(err.stack);\n      });\n  }\n}\n\nfunction prepareReplExternalSepc(procPath) {\n  if (!fs.existsSync(procPath)) {\n    throw new ArgsParseError(`runtime ${procPath} does not exist`);\n  }\n  // find out how to print\n  let script = `\n    if (typeof (console) !== 'undefined' && console.log !== undefined) {\n      console.log('console.log')\n    }\n    else if (typeof('print') !== 'undefined') {\n      print('print')\n    }`;\n  let out = child_process.spawnSync(procPath, { input: script });\n  let output = String(out.stdout);\n  if (output.trim() === \"\") {\n    throw new ArgsParseError(`could not figure out how to print in inferior repl ${procPath}`);\n  }\n  return { printName: output.trim(), cmd: procPath.trim() };\n}\n\nfunction runWithCpuProfiler(args) {\n  let profiler;\n  try {\n    profiler = require(\"v8-profiler-node8\");\n  } catch (e) {\n    // Profiler optional dependency failed\n    console.error(\"v8-profiler-node8 doesn't work correctly on Windows, see issue #1695\");\n    throw e;\n  }\n  profiler.setSamplingInterval(100); // default is 1000us\n  profiler.startProfiling(\"\");\n  let result = run(args);\n  let data = profiler.stopProfiling(\"\");\n  let start = Date.now();\n  let stream = fs.createWriteStream(args.cpuprofilePath);\n  let getNextToken = JSONTokenizer(data);\n  let write = () => {\n    for (let token = getNextToken(); token !== undefined; token = getNextToken()) {\n      if (!stream.write(token)) {\n        stream.once(\"drain\", write);\n        return;\n      }\n    }\n    stream.end();\n    console.log(`Wrote ${args.cpuprofilePath} in ${Date.now() - start}ms`);\n  };\n  write();\n  return result;\n}\n\nfunction run(args) {\n  let failed = 0;\n  let passed = 0;\n  let total = 0;\n  if (args.outOfProcessRuntime !== \"\") {\n    execSpec = prepareReplExternalSepc(args.outOfProcessRuntime);\n  }\n\n  let failedTests = [];\n\n  return SerialPromises(\n    // filter hidden files\n    tests\n      .filter(test => {\n        return (\n          path.basename(test.name)[0] !== \".\" &&\n          !test.name.endsWith(\"~\") &&\n          !test.file.includes(\"// skip this test for now\") &&\n          !(args.es5 && test.file.includes(\"// es6\")) &&\n          //only run specific tests if desired\n          test.name.includes(args.filter)\n        );\n      })\n      .map(function(test) {\n        const isAdditionalFunctionTest = test.file.includes(\"__optimize\");\n        const isPureFunctionTest = test.name.includes(\"pure-functions\");\n        const isCaptureTest = test.name.includes(\"Closure\") || test.name.includes(\"Capture\");\n        // Skip lazy objects mode for certain known incompatible tests, react compiler and additional-functions tests.\n        const skipLazyObjects =\n          test.file.includes(\"// skip lazy objects\") ||\n          isAdditionalFunctionTest ||\n          isPureFunctionTest ||\n          test.name.includes(\"react\");\n\n        let flagPermutations = [\n          [false, false, undefined],\n          [true, true, undefined],\n          [false, false, args.lazyObjectsRuntime],\n        ];\n        if (isAdditionalFunctionTest || isCaptureTest) {\n          flagPermutations.push([false, false, undefined]);\n          flagPermutations.push([false, true, undefined]);\n        }\n        if (args.fast) flagPermutations = [[false, false, undefined]];\n        return () =>\n          SerialPromises(\n            flagPermutations\n              .filter(function([delayInitializations, inlineExpressions, lazyObjectsRuntime]) {\n                return !(skipLazyObjects || args.noLazySupport) || !lazyObjectsRuntime;\n              })\n              .map(function([delayInitializations, inlineExpressions, lazyObjectsRuntime]) {\n                total++;\n                let options = {\n                  delayInitializations,\n                  inlineExpressions,\n                  lazyObjectsRuntime,\n                };\n                return () =>\n                  runTest(test.name, test.file, options, args).then(testResult => {\n                    if (testResult) {\n                      passed++;\n                    } else {\n                      failed++;\n                      failedTests.push(test);\n                    }\n                  });\n              })\n          );\n      })\n  ).then(function() {\n    failedTests.sort((x, y) => y.file.length - x.file.length);\n    if (failedTests.length > 0) {\n      console.log(\"Summary of failed tests:\");\n      for (let ft of failedTests) {\n        console.log(`  ${ft.name} (${ft.file.length} bytes)`);\n      }\n    }\n    console.log(\"Passed:\", `${passed}/${total}`, (Math.floor((passed / total) * 100) || 0) + \"%\");\n    return failed === 0;\n  });\n}\n\n// Object to store all command line arguments\nclass ProgramArgs {\n  debugNames: boolean;\n  debugScopes: boolean;\n  verbose: boolean;\n  filter: string;\n  outOfProcessRuntime: string;\n  es5: boolean;\n  lazyObjectsRuntime: string;\n  noLazySupport: boolean;\n  fast: boolean;\n  cpuprofilePath: string;\n  ir: boolean;\n  constructor(\n    debugNames: boolean,\n    debugScopes: boolean,\n    verbose: boolean,\n    filter: string,\n    outOfProcessRuntime: string,\n    es5: boolean,\n    lazyObjectsRuntime: string,\n    noLazySupport: boolean,\n    fast: boolean,\n    cpuProfilePath: string,\n    ir: boolean\n  ) {\n    this.debugNames = debugNames;\n    this.debugScopes = debugScopes;\n    this.verbose = verbose;\n    this.filter = filter; //lets user choose specific test files, runs all tests if omitted\n    this.outOfProcessRuntime = outOfProcessRuntime;\n    this.es5 = es5;\n    this.lazyObjectsRuntime = lazyObjectsRuntime;\n    this.noLazySupport = noLazySupport;\n    this.fast = fast;\n    this.cpuprofilePath = cpuProfilePath;\n    this.ir = ir;\n  }\n}\n\n// Execution of tests begins here\nfunction main(): void {\n  let args = {};\n  try {\n    args = argsParse();\n  } catch (e) {\n    if (e instanceof ArgsParseError) {\n      console.error(\"Illegal argument: %s.\\n%s\", e.message, usage());\n    }\n    process.exit(1);\n  }\n  if (args.fast && args.filter === \"\") (console: any).error = function() {};\n  (args && args.cpuprofilePath ? runWithCpuProfiler : run)(args)\n    .then(function(result) {\n      if (!result) {\n        process.exit(1);\n      } else {\n        process.exit(0);\n      }\n    })\n    .catch(function(e) {\n      console.error(e);\n      process.exit(1);\n    });\n}\n\n// Helper function to provide correct usage information to the user\nfunction usage(): string {\n  return (\n    `Usage: ${process.argv[0]} ${process.argv[1]} ` +\n    EOL +\n    `[--debugNames] [--debugScopes] [--es5] [--fast] [--noLazySupport] [--verbose] [--ir] [--filter <string>] [--outOfProcessRuntime <path>] `\n  );\n}\n\n// NOTE: inheriting from Error does not seem to pass through an instanceof\n// check\nclass ArgsParseError {\n  message: string;\n  constructor(message: string) {\n    this.message = message;\n  }\n}\n\n// Parses through the command line arguments and throws errors if usage is incorrect\nfunction argsParse(): ProgramArgs {\n  let parsedArgs = minimist(process.argv.slice(2), {\n    string: [\"filter\", \"outOfProcessRuntime\", \"cpuprofilePath\"],\n    boolean: [\"debugNames\", \"debugScopes\", \"verbose\", \"es5\", \"fast\"],\n    default: {\n      debugNames: false,\n      debugScopes: false,\n      verbose: false,\n      es5: false, // if true test marked as es6 only are not run\n      filter: \"\",\n      outOfProcessRuntime: \"\", // if set, assumed to be a JS runtime and is used\n      // to run tests. If not a separate node context used.\n      lazyObjectsRuntime: LAZY_OBJECTS_RUNTIME_NAME,\n      noLazySupport: false,\n      ir: false,\n      fast: false,\n      cpuprofilePath: \"\",\n    },\n  });\n  if (typeof parsedArgs.debugNames !== \"boolean\") {\n    throw new ArgsParseError(\"debugNames must be a boolean (either --debugNames or not)\");\n  }\n  if (typeof parsedArgs.debugScopes !== \"boolean\") {\n    throw new ArgsParseError(\"debugScopes must be a boolean (either --debugScopes or not)\");\n  }\n  if (typeof parsedArgs.verbose !== \"boolean\") {\n    throw new ArgsParseError(\"verbose must be a boolean (either --verbose or not)\");\n  }\n  if (typeof parsedArgs.es5 !== \"boolean\") {\n    throw new ArgsParseError(\"es5 must be a boolean (either --es5 or not)\");\n  }\n  if (typeof parsedArgs.fast !== \"boolean\") {\n    throw new ArgsParseError(\"fast must be a boolean (either --fast or not)\");\n  }\n  if (typeof parsedArgs.filter !== \"string\") {\n    throw new ArgsParseError(\n      \"filter must be a string (relative path from serialize directory) (--filter abstract/Residual.js)\"\n    );\n  }\n  if (typeof parsedArgs.outOfProcessRuntime !== \"string\") {\n    throw new ArgsParseError(\"outOfProcessRuntime must be path pointing to an javascript runtime\");\n  }\n  if (typeof parsedArgs.lazyObjectsRuntime !== \"string\") {\n    throw new ArgsParseError(\"lazyObjectsRuntime must be a string\");\n  }\n  if (typeof parsedArgs.noLazySupport !== \"boolean\") {\n    throw new ArgsParseError(\"noLazySupport must be a boolean (either --noLazySupport or not)\");\n  }\n  if (typeof parsedArgs.cpuprofilePath !== \"string\") {\n    throw new ArgsParseError(\"cpuprofilePath must be a string\");\n  }\n  if (typeof parsedArgs.ir !== \"boolean\") {\n    throw new ArgsParseError(\"ir must be a string\");\n  }\n  let programArgs = new ProgramArgs(\n    parsedArgs.debugNames,\n    parsedArgs.debugScopes,\n    parsedArgs.verbose,\n    parsedArgs.filter,\n    parsedArgs.outOfProcessRuntime,\n    parsedArgs.es5,\n    parsedArgs.lazyObjectsRuntime,\n    parsedArgs.noLazySupport,\n    parsedArgs.fast,\n    parsedArgs.cpuprofilePath,\n    parsedArgs.ir\n  );\n  return programArgs;\n}\n\nmain();\n"
  },
  {
    "path": "scripts/test-sourcemaps.sh",
    "content": "node Stacktrace.js.new2.js 2>&1 >/dev/null | grep \"Stacktrace.js:2\" > /dev/null\nX=$?\nrm Stacktrace.js.new1.js\nrm Stacktrace.js.new1.js.map\nrm Stacktrace.js.new2.js\nrm Stacktrace.js.new2.js.map\nexit $X\n"
  },
  {
    "path": "scripts/test-std-in.sh",
    "content": "# Prepacks a correct stdin input. Checks if the output execution is correct.\ncat ./test/std-in/StdIn.js | node ./bin/prepack.js --out StdIn-test.js > /dev/null\nnode ./StdIn-test.js | grep \"Hello world from std-in\" > /dev/null\nif [[ $? -ne 0 ]]; then\n    echo \"Stdin test failed: cat ./test/std-in/StdIn.js | node ./bin/prepack.js --out StdIn-test.js returned an error\"\n    exit 1\nfi\nrm ./StdIn-test.js\n\n# Prepacks an empty stdin input. Checks if it exits with signal 0.\necho \"\" | node ./bin/prepack.js 1>/dev/null 2>&1\nif [[ $? -ne 0 ]]; then\n     echo \"Stdin test failed: echo \"\" | node ./bin/prepack.js --out StdIn-test.js didn't exit with signal 0\"\n    exit 1\nfi\n\n# Prepacks an empty stdin input. Checks if the correct error message is printed.\n(echo \"\" | node ./bin/prepack.js 2>&1 1>/dev/null ) | grep \"Prepack returned empty code.\" > /dev/null\n# grep returns 0, even though prepack returned 1\nif [[ $? -ne 0 ]]; then\n     echo \"Stdin test failed: echo \"\" | node ./bin/prepack.js --out StdIn-test.js didn't exit with the expected signal 1.\"\n    exit 1\nfi\n\n# Prepacks a stdin with a syntax error. Checks if it exits with signal 1.\necho \"{}()\" | node ./bin/prepack.js 1>/dev/null 2>&1 \nif [[ $? -ne 1 ]]; then\n    echo \"Stdin test failed:echo \\\"{}()\\\" | node ./bin/prepack.js --out StdInError-test.js didn't exit with the expected signal 1.\"\n    # If the test failed, rerun and show the output\n    echo \"{}()\" | node ./bin/prepack.js\n    exit 1\nfi\n\n# Prepacks a stdin with a syntax error. Checks if the correct error message is printed.\n(echo \"{}()\" | node ./bin/prepack.js 2>&1 1>/dev/null ) | grep \"In stdin(1:4) FatalError PP1004\" > /dev/null\n# grep returns 0, even though prepack returned 1\nif [[ $? -ne 0 ]]; then\n    echo \"Stdin test failed: echo \\\"{}()\\\" | node ./bin/prepack.js didn't return the expected error message.\"\n    # If the test failed, rerun and show the output\n    echo \"{}()\" | node ./bin/prepack.js\n    exit 1\nfi\n\n# Prepacks a stdin with an informational message that should get turned into an error. Checks if the correct error message is printed.\n(echo \"global.r = Math.random();\" | node ./bin/prepack.js --mathRandomSeed 0 --diagnosticAsError PP8000 2>&1 1>/dev/null ) | grep \"In stdin(1:12) RecoverableError PP8000\" > /dev/null\n# grep returns 0, even though prepack returned 1\nif [[ $? -ne 0 ]]; then\n    echo \"Stdin test failed: echo \\\"global.r = Math.random();\\\" | node ./bin/prepack.js --mathRandomSeed 0 --diagnosticAsError PP8000 didn't return the expected error message.\"\n    # If the test failed, rerun and show the output\n    echo \"global.r = Math.random();\" | node ./bin/prepack.js --mathRandomSeed 0 --diagnosticAsError PP8000\n    exit 1\nfi\n\n# Prepacks a stdin with an informational message that should get suppressed. Checks that the error code does not appear in output.\n(echo \"global.r = Math.random();\" | node ./bin/prepack.js --mathRandomSeed 0 --noDiagnostic PP8000 2>&1 1>/dev/null ) | grep \"In stdin(1:12) RecoverableError PP8000\" > /dev/null\n# grep returns 0, even though prepack returned 1\nif [[ $? -eq 0 ]]; then\n    echo \"Stdin test failed: echo \\\"global.r = Math.random();\\\" | node ./bin/prepack.js --mathRandomSeed 0 --noDiagnostic PP8000 didn't return the expected error message.\"\n    # If the test failed, rerun and show the output\n    echo \"global.r = Math.random();\" | node ./bin/prepack.js --mathRandomSeed 0 --noDiagnostic PP8000\n    exit 1\nfi\n\n# Prepacks a stdin with a warning message that should get turned into an error. Checks if the correct error message is printed.\n(echo \"let x; function f() { x = 1; } function g() { x = 2; } __optimize(f); __optimize(g);\" | node ./bin/prepack.js --warnAsError 2>&1 1>/dev/null ) | grep \"In stdin(1:27) RecoverableError PP1007\" > /dev/null\n# grep returns 0, even though prepack returned 1\nif [[ $? -ne 0 ]]; then\n    echo \"Stdin test failed: echo \\\"let x; function f() { x = 1; } function g() { x = 2; } __optimize(f); __optimize(g);\\\" | node ./bin/prepack.js --warnAsError didn't return the expected error message.\"\n    # If the test failed, rerun and show the output\n    echo \"let x; function f() { x = 1; } function g() { x = 2; } __optimize(f); __optimize(g);\" | node ./bin/prepack.js --warnAsError\n    exit 1\nfi\n\n# Prepacks a stdin with a warning message that should get turned into an error. Checks if the correct error message is printed.\n(echo \"let x; function f() { x = 1; } function g() { x = 2; } __optimize(f); __optimize(g);\" | node ./bin/prepack.js --diagnosticAsError PP1007 2>&1 1>/dev/null ) | grep \"In stdin(1:27) RecoverableError PP1007\" > /dev/null\n# grep returns 0, even though prepack returned 1\nif [[ $? -ne 0 ]]; then\n    echo \"Stdin test failed: echo \\\"let x; function f() { x = 1; } function g() { x = 2; } __optimize(f); __optimize(g);\\\" | node ./bin/prepack.js --diagnosticAsError PP1007 didn't return the expected error message.\"\n    # If the test failed, rerun and show the output\n    echo \"let x; function f() { x = 1; } function g() { x = 2; } __optimize(f); __optimize(g);\" | node ./bin/prepack.js --diagnosticAsError PP1007\n    exit 1\nfi\n"
  },
  {
    "path": "scripts/test262-filters.yml",
    "content": "features:\n  - async-iteration\n  - tail-call-optimization\n  - generators\n  - default-parameters\n  - Function.prototype.toString\n  - SharedArrayBuffer\n  - atomics\n  - cross-realm\n  - u180e\n  - Symbol.isConcatSpreadable\n  - class-fields\n  - destructuring-binding\n  - BigInt\nesid:\n  - pending\nes5id:\n  - 7.8.5_A1.4_T2\n  - 7.8.5_A2.4_T2\n  - 7.8.5_A2.1_T2\n  - 7.8.5_A1.1_T2\n  - 15.1.2.2_A8\n  - 15.1.2.3_A6\n  - 7.4_A5\n  - 7.4_A6\n  - 15.10.2.12_A3_T1\n  - 15.10.2.12_A4_T1\n  - 15.10.2.12_A5_T1\n  - 15.10.2.12_A6_T1\nes6id:\n  - 22.1.3.1_3\nflags:\n  - module\n  - async\npaths:\n  - language/directive-prologue/\n  - harness\n  - intl402\n  - built-ins/Function/prototype/toString/\n  - built-ins/SharedArrayBuffer/\n  - built-ins/Atomics/\n  - annexB/\n  - language/statements/with/\n  - detached-buffer-after-toindex-byteoffset.js\n  - built-ins/ArrayIteratorPrototype/next/detach-typedarray-in-progress.js\n  - built-ins/RegExp/S15.10.2.12_A1_T1.js\n  - built-ins/RegExp/S15.10.2.12_A2_T1.js\n  - built-ins/RegExp/prototype/Symbol.search/lastindex-no-restore.js\n  - built-ins/RegExp/prototype/exec/failure-lastindex-no-access.js\n  - built-ins/RegExp/prototype/exec/success-lastindex-no-access.js\n  - built-ins/RegExp/prototype/Symbol.match/builtin-success-u-return-val-groups.js\n  - built-ins/decodeURI\n  - built-ins/encodeURI\n  - built-ins/decodeURIComponent\n  - built-ins/encodeURIComponent\n  - built-ins/Array/S15.4.5.2_A1_T1.js\n  - built-ins/Array/S15.4.5.2_A1_T1.js\n  - built-ins/Array/S15.4_A1\n  - built-ins/Array/length/S15.4.5.2_A3\nnegative:\n  phase:\n    - early\n"
  },
  {
    "path": "scripts/test262-runner.js",
    "content": "/**\n * Copyright (c) 2017-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n/* @flow */\n/* eslint-disable no-extend-native */\n\nimport { AbruptCompletion, ThrowCompletion } from \"../lib/completions.js\";\nimport { ObjectValue, StringValue } from \"../lib/values/index.js\";\nimport { Realm, ExecutionContext } from \"../lib/realm.js\";\nimport construct_realm from \"../lib/construct_realm.js\";\nimport initializeGlobals from \"../lib/globals.js\";\nimport { DetachArrayBuffer } from \"../lib/methods/arraybuffer.js\";\nimport { To } from \"../lib/singletons.js\";\nimport { Get } from \"../lib/methods/get.js\";\nimport invariant from \"../lib/invariant.js\";\nimport { prepackSources } from \"../lib/prepack-node.js\";\n\nimport yaml from \"js-yaml\";\nimport chalk from \"chalk\";\nimport path from \"path\";\n// need to use graceful-fs for single-process code because it opens too many\n// files\nimport fs from \"graceful-fs\";\nimport cluster from \"cluster\";\nimport os from \"os\";\nimport tty from \"tty\";\nimport minimist from \"minimist\";\nimport process from \"process\";\nimport vm from \"vm\";\nimport * as babelTypes from \"@babel/types\";\nimport traverse from \"@babel/traverse\";\nimport generate from \"@babel/generator\";\n\nconst EOL = os.EOL;\nconst cpus = os.cpus();\nconst numCPUs = cpus ? cpus.length : 1;\nrequire(\"source-map-support\").install();\n\ntype HarnessMap = { [key: string]: string };\ntype TestRecord = { test: TestFileInfo, result: TestResult[] };\ntype GroupsMap = { [key: string]: TestRecord[] };\n\ntype TestRunOptions = {|\n  +timeout: number,\n  +serializer: boolean | \"abstract-scalar\",\n|};\n\n// A TestTask is a task for a worker process to execute, which contains a\n// single test to run\nclass TestTask {\n  static sentinel: string = \"TestTask\";\n  type: string;\n  file: TestFileInfo;\n\n  constructor(file: TestFileInfo) {\n    this.type = TestTask.sentinel;\n    this.file = file;\n  }\n\n  // eslint-disable-next-line flowtype/no-weak-types\n  static fromObject(obj: Object): TestTask {\n    // attempt to coerce the object into a test task\n    if (\"file\" in obj && typeof obj.file === \"object\") {\n      return new TestTask(TestFileInfo.fromObject(obj.file));\n    } else {\n      throw new Error(`Cannot be converted to a TestTask: ${JSON.stringify(obj)}`);\n    }\n  }\n}\n\n/**\n * Information about a test file to be run.\n *\n */\nclass TestFileInfo {\n  // Location of the test on the filesystem, call fs.readFile on this\n  location: string;\n  isES6: boolean;\n  groupName: string;\n\n  constructor(location: string, isES6: boolean) {\n    this.location = location;\n    this.isES6 = isES6;\n    this.groupName = path.dirname(location);\n  }\n\n  // eslint-disable-next-line flowtype/no-weak-types\n  static fromObject(obj: Object): TestFileInfo {\n    // attempt to coerce the object into a TestFileInfo\n    if (\"location\" in obj && typeof obj.location === \"string\" && \"isES6\" in obj && typeof obj.isES6 === \"boolean\") {\n      return new TestFileInfo(obj.location, obj.isES6);\n    } else {\n      throw new Error(`Cannot be converted to a TestFileInfo: ${JSON.stringify(obj)}`);\n    }\n  }\n}\n\n// A Message sent by a worker to the master to say that it has finished its\n// current task successfully\nclass DoneMessage {\n  static sentinel: string = \"DoneMessage\";\n  type: string;\n  test: TestFileInfo;\n  testResults: TestResult[];\n\n  constructor(test: TestFileInfo, testResult: TestResult[] = []) {\n    this.type = DoneMessage.sentinel;\n    this.test = test;\n    this.testResults = testResult;\n  }\n\n  // eslint-disable-next-line flowtype/no-weak-types\n  static fromObject(obj: Object): DoneMessage {\n    if (!(\"type\" in obj && typeof obj.type === \"string\" && obj.type === DoneMessage.sentinel)) {\n      throw new Error(`Cannot be converted to a DoneMessage: ${JSON.stringify(obj)}`);\n    }\n    if (!(\"test\" in obj && typeof obj.test === \"object\")) {\n      throw new Error(\"A DoneMessage must have a test\");\n    }\n    let msg = new DoneMessage(obj.test);\n    if (\"testResults\" in obj && typeof obj.testResults === \"object\" && Array.isArray(obj.testResults)) {\n      msg.testResults = obj.testResults;\n    }\n    return msg;\n  }\n}\n\nclass ErrorMessage {\n  static sentinel: string = \"ErrorMessage\";\n  type: string;\n  err: Error;\n\n  constructor(err: Error) {\n    this.type = ErrorMessage.sentinel;\n    this.err = err;\n  }\n\n  // eslint-disable-next-line flowtype/no-weak-types\n  static fromObject(obj: Object): ErrorMessage {\n    if (!(\"type\" in obj && typeof obj.type === \"string\" && obj.type === ErrorMessage.sentinel)) {\n      throw new Error(`Cannot be converted to an ErrorMessage: ${JSON.stringify(obj)}`);\n    }\n    if (!(\"err\" in obj && typeof obj.err === \"object\")) {\n      throw new Error(`Cannot be converted to an ErrorMessage: ${JSON.stringify(obj)}`);\n    }\n    return new ErrorMessage(obj.err);\n  }\n}\n\n/**\n * TestResult contains information about a test that ran.\n */\nclass TestResult {\n  passed: boolean;\n  strict: boolean;\n  err: ?Error;\n\n  constructor(passed: boolean, strict: boolean, err: ?Error = null) {\n    this.passed = passed;\n    this.strict = strict;\n    this.err = err;\n  }\n}\n\n// A Message sent by the master to workers to say that there is nothing more\n// to do\nclass QuitMessage {\n  static sentinel: string = \"QuitMessage\";\n  type: string;\n\n  constructor() {\n    this.type = QuitMessage.sentinel;\n  }\n\n  static fromObject(obj): QuitMessage {\n    return new QuitMessage();\n  }\n}\n\nclass BannerData {\n  info: string;\n  es5id: string;\n  es6id: string;\n  description: string;\n  flags: string[];\n  features: string[];\n  includes: string[];\n  // eslint-disable-next-line flowtype/no-weak-types\n  negative: Object;\n\n  constructor() {\n    this.info = \"\";\n    this.es5id = \"\";\n    this.es6id = \"\";\n    this.description = \"\";\n    this.flags = [];\n    this.features = [];\n    this.includes = [];\n    this.negative = {};\n  }\n\n  // eslint-disable-next-line flowtype/no-weak-types\n  static fromObject(obj: Object): BannerData {\n    let bd = new BannerData();\n    if (\"info\" in obj && typeof obj.info === \"string\") {\n      bd.info = obj.info;\n    }\n    if (\"es5id\" in obj && typeof obj.es5id === \"string\") {\n      bd.es5id = obj.es5id;\n    }\n    if (\"es6id\" in obj && typeof obj.es6id === \"string\") {\n      bd.es6id = obj.es6id;\n    }\n    if (\"description\" in obj && typeof obj.description === \"string\") {\n      bd.description = obj.description;\n    }\n    if (\"flags\" in obj && typeof obj.flags === \"object\" && Array.isArray(obj.flags)) {\n      bd.flags = obj.flags;\n    }\n    if (\"features\" in obj && typeof obj.features === \"object\" && Array.isArray(obj.features)) {\n      bd.features = obj.features;\n    }\n    if (\"includes\" in obj && typeof obj.includes === \"object\" && Array.isArray(obj.includes)) {\n      bd.includes = obj.includes;\n    }\n    if (\"negative\" in obj && typeof obj.negative === \"object\") {\n      bd.negative = obj.negative;\n    }\n    return bd;\n  }\n}\n\nclass MasterProgramArgs {\n  verbose: boolean;\n  timeout: number;\n  bailAfter: number;\n  cpuScale: number;\n  statusFile: string;\n  filterString: string;\n  singleThreaded: boolean;\n  relativeTestPath: string;\n  serializer: boolean | \"abstract-scalar\";\n  expectedES5: number;\n  expectedES6: number;\n  expectedTimeouts: number;\n\n  constructor(\n    verbose: boolean,\n    timeout: number,\n    bailAfter: number,\n    cpuScale: number,\n    statusFile: string,\n    filterString: string,\n    singleThreaded: boolean,\n    relativeTestPath: string,\n    serializer: boolean | \"abstract-scalar\",\n    expectedES5: number,\n    expectedES6: number,\n    expectedTimeouts: number\n  ) {\n    this.verbose = verbose;\n    this.timeout = timeout;\n    this.bailAfter = bailAfter;\n    this.cpuScale = cpuScale;\n    this.statusFile = statusFile;\n    this.filterString = filterString;\n    this.singleThreaded = singleThreaded;\n    this.relativeTestPath = relativeTestPath;\n    this.serializer = serializer;\n    this.expectedES5 = expectedES5;\n    this.expectedES6 = expectedES6;\n    this.expectedTimeouts = expectedTimeouts;\n  }\n}\n\nclass WorkerProgramArgs {\n  relativeTestPath: string;\n  timeout: number;\n  serializer: boolean | \"abstract-scalar\";\n\n  constructor(relativeTestPath: string, timeout: number, serializer: boolean | \"abstract-scalar\") {\n    this.timeout = timeout;\n    this.serializer = serializer;\n    this.relativeTestPath = relativeTestPath;\n  }\n}\n\n// NOTE: inheriting from Error does not seem to pass through an instanceof\n// check\nclass ArgsParseError {\n  message: string;\n\n  constructor(message: string) {\n    this.message = message;\n  }\n}\n\nif (!(\"toJSON\" in Error.prototype)) {\n  // $FlowFixMe this needs to become defined for Error to be serialized\n  Object.defineProperty(Error.prototype, \"toJSON\", {\n    // eslint-disable-line\n    value: function() {\n      let alt = {};\n      Object.getOwnPropertyNames(this).forEach(function(key) {\n        alt[key] = this[key];\n      }, this);\n      return alt;\n    },\n    configurable: true,\n    writable: true,\n  });\n}\n\nmain();\n\nfunction main(): number {\n  try {\n    if (cluster.isMaster) {\n      let args = masterArgsParse();\n      masterRun(args);\n    } else if (cluster.isWorker) {\n      let args = workerArgsParse();\n      workerRun(args);\n    } else {\n      throw new Error(\"Not a master or a worker\");\n    }\n  } catch (e) {\n    if (e instanceof ArgsParseError) {\n      console.error(\"Illegal argument: %s.\\n%s\", e.message, usage());\n    } else {\n      console.error(e);\n    }\n    process.exit(1);\n  }\n  return 0;\n}\n\nfunction usage(): string {\n  return (\n    `Usage: ${process.argv[0]} ${process.argv[1]} ` +\n    EOL +\n    `[--verbose] [--timeout <number>] [--bailAfter <number>] ` +\n    EOL +\n    `[--cpuScale <number>] [--statusFile <string>] [--singleThreaded] [--relativeTestPath <string>]` +\n    EOL +\n    `[--expectedCounts <es5pass,es6pass,timeouts>]`\n  );\n}\n\nfunction masterArgsParse(): MasterProgramArgs {\n  let parsedArgs = minimist(process.argv.slice(2), {\n    string: [\"statusFile\", \"relativeTestPath\"],\n    boolean: [\"verbose\", \"singleThreaded\"],\n    default: {\n      verbose: process.stdout instanceof tty.WriteStream ? false : true,\n      statusFile: \"\",\n      timeout: 10,\n      cpuScale: 1,\n      bailAfter: Infinity,\n      singleThreaded: false,\n      relativeTestPath: \"/../test/test262\",\n      serializer: false,\n      expectedCounts: \"11943,5641,2\",\n    },\n  });\n  let filterString = parsedArgs._[0];\n  if (typeof parsedArgs.verbose !== \"boolean\") {\n    throw new ArgsParseError(\"verbose must be a boolean (either --verbose or not)\");\n  }\n  let verbose = parsedArgs.verbose;\n  if (typeof parsedArgs.timeout !== \"number\") {\n    throw new ArgsParseError(\"timeout must be a number (in seconds) (--timeout 10)\");\n  }\n  let timeout = parsedArgs.timeout;\n  if (typeof parsedArgs.bailAfter !== \"number\") {\n    throw new ArgsParseError(\"bailAfter must be a number (--bailAfter 10)\");\n  }\n  let bailAfter = parsedArgs.bailAfter;\n  if (typeof parsedArgs.cpuScale !== \"number\") {\n    throw new ArgsParseError(\"cpuScale must be a number (--cpuScale 0.5)\");\n  }\n  let cpuScale = parsedArgs.cpuScale;\n  if (typeof parsedArgs.statusFile !== \"string\") {\n    throw new ArgsParseError(\"statusFile must be a string (--statusFile file.txt)\");\n  }\n  let statusFile = parsedArgs.statusFile;\n  if (typeof parsedArgs.singleThreaded !== \"boolean\") {\n    throw new ArgsParseError(\"singleThreaded must be a boolean (either --singleThreaded or not)\");\n  }\n  let singleThreaded = parsedArgs.singleThreaded;\n  if (typeof parsedArgs.relativeTestPath !== \"string\") {\n    throw new ArgsParseError(\"relativeTestPath must be a string (--relativeTestPath /../test/test262)\");\n  }\n  let relativeTestPath = parsedArgs.relativeTestPath;\n  if (!(typeof parsedArgs.serializer === \"boolean\" || parsedArgs.serializer === \"abstract-scalar\")) {\n    throw new ArgsParseError(\n      \"serializer must be a boolean or must be the string 'abstract-scalar' (--serializer or --serializer abstract-scalar)\"\n    );\n  }\n  let serializer = parsedArgs.serializer;\n  if (typeof parsedArgs.expectedCounts !== \"string\") {\n    throw new ArgsParseError(\"expectedCounts must be a string (--expectedCounts 11944,5566,2\");\n  }\n  let expectedCounts = parsedArgs.expectedCounts.split(\",\").map(x => Number(x));\n  let programArgs = new MasterProgramArgs(\n    verbose,\n    timeout,\n    bailAfter,\n    cpuScale,\n    statusFile,\n    filterString,\n    singleThreaded,\n    relativeTestPath,\n    serializer,\n    expectedCounts[0],\n    expectedCounts[1],\n    expectedCounts[2]\n  );\n  if (programArgs.filterString) {\n    // if filterstring is provided, assume that verbosity is desired\n    programArgs.verbose = true;\n  }\n  return programArgs;\n}\n\nfunction workerArgsParse(): WorkerProgramArgs {\n  let parsedArgs = minimist(process.argv.slice(2), {\n    default: {\n      relativeTestPath: \"/../test/test262\",\n      timeout: 10,\n      serializer: false,\n    },\n  });\n  if (typeof parsedArgs.relativeTestPath !== \"string\") {\n    throw new ArgsParseError(\"relativeTestPath must be a string (--relativeTestPath /../test/test262)\");\n  }\n  if (typeof parsedArgs.timeout !== \"number\") {\n    throw new ArgsParseError(\"timeout must be a number (in seconds) (--timeout 10)\");\n  }\n  if (!(typeof parsedArgs.serializer === \"boolean\" || parsedArgs.serializer === \"abstract-scalar\")) {\n    throw new ArgsParseError(\n      \"serializer must be a boolean or must be the string 'abstract-scalar' (--serializer or --serializer abstract-scalar)\"\n    );\n  }\n  return new WorkerProgramArgs(parsedArgs.relativeTestPath, parsedArgs.timeout, parsedArgs.serializer);\n}\n\nfunction masterRun(args: MasterProgramArgs) {\n  let testPath = `${__dirname}` + args.relativeTestPath + \"/test\";\n  let tests = getFilesSync(testPath);\n  // remove tests that don't need to be run\n  if (args.filterString) tests = tests.filter(test => test.location.includes(args.filterString));\n  const originalTestLength = tests.length;\n  tests = tests.filter(test => testFilterByMetadata(test));\n  let groups: GroupsMap = {};\n\n  // Now that all the tasks are ready, start up workers to begin processing\n  // if single threaded, use that route instead\n  if (args.singleThreaded) {\n    masterRunSingleProcess(args, groups, tests, originalTestLength - tests.length);\n  } else {\n    masterRunMultiProcess(args, groups, tests, originalTestLength - tests.length);\n  }\n}\n\nfunction masterRunSingleProcess(\n  args: MasterProgramArgs,\n  groups: GroupsMap,\n  tests: TestFileInfo[],\n  numFiltered: number\n): void {\n  console.log(`Running ${tests.length} tests as a single process`);\n  // print out every 5 percent (more granularity than multi-process because multi-process\n  // runs a lot faster)\n  const granularity = Math.floor(tests.length / 20);\n  let harnesses = getHarnesses(args.relativeTestPath);\n  let numLeft = tests.length;\n  for (let t of tests) {\n    let options: TestRunOptions = {\n      timeout: args.timeout,\n      serializer: args.serializer,\n    };\n    handleTest(t, harnesses, options, (err, results) => {\n      if (err) {\n        if (args.verbose) {\n          console.error(err);\n        }\n      } else {\n        let ok = handleTestResults(groups, t, results);\n        if (!ok) {\n          // handleTestResults returns false if a failure threshold was exceeded\n          throw new Error(\"Too many test failures\");\n        }\n        let progress = getProgressBar(numLeft, tests.length, granularity);\n        if (progress) {\n          console.log(progress);\n        }\n      }\n      numLeft--;\n      if (numLeft === 0) {\n        // all done\n        process.exit(handleFinished(args, groups, numFiltered));\n      }\n    });\n  }\n}\n\nfunction masterRunMultiProcess(\n  args: MasterProgramArgs,\n  groups: GroupsMap,\n  tests: TestFileInfo[],\n  numFiltered: number\n): void {\n  if (!cluster.on) {\n    // stop flow errors on \"cluster.on\"\n    throw new Error(\"cluster is malformed\");\n  }\n  const granularity = Math.floor(tests.length / 10);\n  const originalTestLength = tests.length;\n  // Fork workers.\n  const numWorkers = Math.max(1, Math.floor(numCPUs * args.cpuScale));\n  console.log(`Master starting up, forking ${numWorkers} workers`);\n  for (let i = 0; i < numWorkers; i++) {\n    cluster.fork();\n  }\n\n  let exitCount = 0;\n  cluster.on(\"exit\", (worker, code, signal) => {\n    if (code !== 0) {\n      console.log(`Worker ${worker.process.pid} died with ${signal || code}. Restarting...`);\n      cluster.fork();\n    } else {\n      exitCount++;\n      if (exitCount === numWorkers) {\n        process.exit(handleFinished(args, groups, numFiltered));\n      }\n    }\n  });\n\n  const giveTask = worker => {\n    // grab another test to run and give it to the child process\n    if (tests.length === 0) {\n      worker.send(new QuitMessage());\n    } else {\n      worker.send(new TestTask(tests.pop()));\n    }\n  };\n\n  cluster.on(\"message\", (worker, message, handle) => {\n    switch (message.type) {\n      case ErrorMessage.sentinel:\n        let errMsg = ErrorMessage.fromObject(message);\n        // just skip the error, thus skipping that test\n        if (args.verbose) {\n          console.error(`An error occurred in worker #${worker.process.pid}:`);\n          console.error(errMsg.err);\n        }\n        giveTask(worker);\n        break;\n      case DoneMessage.sentinel:\n        let done = DoneMessage.fromObject(message);\n        let ok = handleTestResults(groups, done.test, done.testResults);\n        if (!ok) {\n          // bail\n          killWorkers(cluster.workers);\n          handleFinished(args, groups, numFiltered);\n          process.exit(1);\n        }\n        giveTask(worker);\n        let progress = getProgressBar(tests.length, originalTestLength, granularity);\n        if (progress) {\n          console.log(progress);\n        }\n        break;\n      default:\n        throw new Error(`Master got an unexpected message: ${JSON.stringify(message)}`);\n    }\n  });\n\n  cluster.on(\"online\", worker => {\n    giveTask(worker);\n  });\n}\n\nfunction handleFinished(args: MasterProgramArgs, groups: GroupsMap, earlierNumSkipped: number): number {\n  let numPassed = 0;\n  let numPassedES5 = 0;\n  let numPassedES6 = 0;\n  let numFailed = 0;\n  let numFailedES5 = 0;\n  let numFailedES6 = 0;\n  let numSkipped = earlierNumSkipped;\n  let numTimeouts = 0;\n  let failed_groups = [];\n  for (let group in groups) {\n    // count some totals\n    let group_passed = 0;\n    let group_failed = 0;\n    let group_es5_passed = 0;\n    let group_es5_failed = 0;\n    let group_es6_passed = 0;\n    let group_es6_failed = 0;\n    let groupName = path.relative(path.join(__dirname, \"..\", \"..\", \"test\"), group);\n    let msg = \"\";\n    let errmsg = \"\";\n    msg += `${groupName}: `;\n    for (let t of groups[group]) {\n      let testName = path.relative(group, t.test.location);\n      let all_passed = true;\n      let was_skipped = true;\n      for (let testResult of t.result) {\n        was_skipped = false;\n        if (!testResult.passed) {\n          all_passed = false;\n          if (args.verbose) {\n            errmsg +=\n              create_test_message(testName, testResult.passed, testResult.err, t.test.isES6, testResult.strict) + EOL;\n          }\n          if (testResult.err && testResult.err.message === \"Timed out\") {\n            numTimeouts++;\n          }\n        }\n      }\n      if (was_skipped) {\n        numSkipped++;\n      } else if (all_passed) {\n        group_passed++;\n        if (t.test.isES6) {\n          group_es6_passed++;\n        } else {\n          group_es5_passed++;\n        }\n      } else {\n        group_failed++;\n        if (t.test.isES6) {\n          group_es6_failed++;\n        } else {\n          group_es5_failed++;\n        }\n      }\n    }\n    msg +=\n      `Passed: ${group_passed} / ${group_passed + group_failed} ` +\n      `(${toPercentage(group_passed, group_passed + group_failed)}%) ` +\n      chalk.yellow(\"(es5)\") +\n      `: ${group_es5_passed} / ` +\n      `${group_es5_passed + group_es5_failed} ` +\n      `(${toPercentage(group_es5_passed, group_es5_passed + group_es5_failed)}%) ` +\n      chalk.yellow(\"(es6)\") +\n      `: ${group_es6_passed} / ` +\n      `${group_es6_passed + group_es6_failed} ` +\n      `(${toPercentage(group_es6_passed, group_es6_passed + group_es6_failed)}%)`;\n    if (args.verbose) {\n      console.log(msg);\n      if (errmsg) {\n        console.error(errmsg);\n      }\n    }\n    if (group_es5_failed + group_es6_failed > 0) {\n      failed_groups.push(msg);\n    }\n\n    numPassed += group_passed;\n    numPassedES5 += group_es5_passed;\n    numPassedES6 += group_es6_passed;\n    numFailed += group_failed;\n    numFailedES5 += group_es5_failed;\n    numFailedES6 += group_es6_failed;\n  }\n  let status =\n    `=== RESULTS ===` +\n    EOL +\n    `Passes: ${numPassed} / ${numPassed + numFailed} ` +\n    `(${toPercentage(numPassed, numPassed + numFailed)}%)` +\n    EOL +\n    `ES5 passes: ${numPassedES5} / ${numPassedES5 + numFailedES5} ` +\n    `(${toPercentage(numPassedES5, numPassedES5 + numFailedES5)}%) ` +\n    EOL +\n    `ES6 passes: ${numPassedES6} / ${numPassedES6 + numFailedES6} ` +\n    `(${toPercentage(numPassedES6, numPassedES6 + numFailedES6)}%)` +\n    EOL +\n    `Skipped: ${numSkipped}` +\n    EOL +\n    `Timeouts: ${numTimeouts}` +\n    EOL;\n  console.log(status);\n  if (failed_groups.length !== 0) {\n    console.log(\"Groups with failures:\");\n    for (let groupMessage of failed_groups) {\n      console.log(groupMessage);\n    }\n  }\n  if (args.statusFile) {\n    fs.writeFileSync(args.statusFile, status);\n  }\n\n  // exit status\n  if (\n    !args.filterString &&\n    (numPassedES5 < args.expectedES5 || numPassedES6 < args.expectedES6 || numTimeouts > args.expectedTimeouts)\n  ) {\n    console.error(chalk.red(\"Overall failure. Expected more tests to pass!\"));\n    process.exit(1);\n    invariant(false);\n  } else {\n    // use 0 to avoid the npm error messages\n    return 0;\n  }\n}\n\nfunction getProgressBar(currentTestLength: number, originalTestLength: number, granularity: number): string {\n  if (currentTestLength % granularity === 0 && currentTestLength !== 0) {\n    // print out a percent of tests completed to keep the user informed\n    return `Running... ${toPercentage(originalTestLength - currentTestLength, originalTestLength)}%`;\n  } else {\n    return \"\";\n  }\n}\n\n// Returns false if test processing should stop.\nfunction handleTestResults(groups: GroupsMap, test: TestFileInfo, testResults: TestResult[]): boolean {\n  // test results are in, add it to its corresponding group\n  if (!(test.groupName in groups)) {\n    groups[test.groupName] = [];\n  }\n  groups[test.groupName].push({ test: test, result: testResults });\n  return true;\n}\n\n// $FlowFixMe cluster.Worker is marked as not exported by the node API by flow.\nfunction killWorkers(workers: { [index: string]: cluster.Worker }): void {\n  for (let workerID in workers) {\n    workers[workerID].kill();\n  }\n}\n\nfunction toPercentage(x: number, total: number): number {\n  if (total === 0) {\n    return 100;\n  }\n  return Math.floor((x / total) * 100);\n}\n\nfunction create_test_message(name: string, success: boolean, err: ?Error, isES6: boolean, isStrict: boolean): string {\n  const checkmark = chalk.green(\"\\u2713\");\n  const xmark = chalk.red(\"\\u2717\");\n  let msg = \"\\t\";\n  msg += (success ? checkmark : xmark) + \" \";\n  msg += `${isES6 ? chalk.yellow(\"(es6) \") : \"\"}${isStrict ? \"(strict)\" : \"(nostrict)\"}: ${name}`;\n  if (!success) {\n    invariant(err, \"Error must be non null if success is false\");\n    if (err.message) {\n      // split the message by newline, add tabs, and join\n      let parts = err.message.split(EOL);\n      for (let line of parts) {\n        msg += EOL + `\\t\\t${line}`;\n      }\n      msg += EOL;\n    } else if (err.stack) {\n      msg += JSON.stringify(err.stack);\n    }\n  }\n  return msg;\n}\n\nfunction getHarnesses(relativeTestPath: string): HarnessMap {\n  let harnessPath = `${__dirname}` + relativeTestPath + \"/harness\";\n  let harnessesList = getFilesSync(harnessPath);\n  // convert to a mapping from harness name to file contents\n  let harnesses: HarnessMap = {};\n  for (let harness of harnessesList) {\n    // sync is fine, it's an initialization stage and there's not that many\n    // harnesses\n    harnesses[path.basename(harness.location)] = fs.readFileSync(harness.location).toString();\n  }\n  return harnesses;\n}\n\nfunction workerRun(args: WorkerProgramArgs) {\n  // NOTE: all harnesses (including contents of harness files) need to be\n  // used on workers. It needs to either be read from the fs once and\n  // distributed via IPC or once from each process. This is the\n  // \"once from each process\" approach.\n  // get all the harnesses\n  let harnesses = getHarnesses(args.relativeTestPath);\n  // we're a worker, run a portion of the tests\n  process.on(\"message\", message => {\n    switch (message.type) {\n      case TestTask.sentinel:\n        // begin executing this TestTask\n        let task = TestTask.fromObject(message);\n        let options: TestRunOptions = {\n          timeout: args.timeout,\n          serializer: args.serializer,\n        };\n        handleTest(task.file, harnesses, options, (err, results) => {\n          handleTestResultsMultiProcess(err, task.file, results);\n        });\n        break;\n      case QuitMessage.sentinel:\n        process.exit(0);\n        break;\n      default:\n        throw new Error(\n          `Worker #${process.pid} got an unexpected message:\n          ${JSON.stringify(message)}`\n        );\n    }\n  });\n}\n\nfunction handleTestResultsMultiProcess(err: ?Error, test: TestFileInfo, testResults: TestResult[]): void {\n  if (err) {\n    process.send(new ErrorMessage(err));\n  } else {\n    let msg = new DoneMessage(test);\n    for (let t of testResults) {\n      msg.testResults.push(t);\n    }\n    try {\n      process.send(msg);\n    } catch (jsonCircularSerializationErr) {\n      // JSON circular serialization, ThrowCompletion is too deep to be\n      // serialized!\n      // Solution, truncate the \"err\" field if this happens\n      for (let t of msg.testResults) {\n        if (t.err) {\n          t.err = new Error(t.err.message);\n        }\n      }\n      // now try again\n      process.send(msg);\n    }\n  }\n}\n\nfunction handleTest(\n  test: TestFileInfo,\n  harnesses: HarnessMap,\n  options: TestRunOptions,\n  cb: (err: ?Error, testResults: TestResult[]) => void\n): void {\n  prepareTest(test, testFilterByContents, (err, banners, testFileContents) => {\n    if (err != null) {\n      cb(err, []);\n      return;\n    }\n    if (!banners) {\n      // skip this test\n      cb(null, []);\n    } else {\n      invariant(testFileContents, \"testFileContents should not be null if banners are not None\");\n      // filter out by flags, features, and includes\n      let keepThisTest =\n        filterFeatures(banners) &&\n        filterNegative(banners) &&\n        filterFlags(banners) &&\n        filterIncludes(banners) &&\n        filterDescription(banners) &&\n        filterCircleCI(banners) &&\n        filterSneakyGenerators(banners, testFileContents) &&\n        (!options.serializer || filterReallyBigArrays(test, testFileContents));\n      let testResults = [];\n      if (keepThisTest) {\n        // now run the test\n        testResults = runTestWithStrictness(test, testFileContents, banners, harnesses, options);\n      }\n      cb(null, testResults);\n    }\n  });\n}\n\n/**\n * FIXME: this code is unsound in the presence of ENOENT (file not found)\n * This function returns nested arrays of all the file names. It can be\n * flattened at the call site, but the type hint is incorrect.\n * DON'T USE THIS FUNCTION until it is fixed to behave exactly like getFilesSync\n */\n/*\nfunction getFiles(\n  filepath: string,\n): Promise<TestFileInfo[]> {\n  return new Promise((resolve, reject) => {\n    fs.stat(filepath, (err, stat) => {\n      if (err !== null) {\n        reject(err);\n      } else {\n        if (stat.isFile()) {\n          // return an array of size 1\n          resolve([new TestFileInfo(filepath)]);\n        } else if (stat.isDirectory()) {\n          // recurse on its children\n          fs.readdir(filepath, (err, files) => {\n            if (err !== null) {\n              reject(err);\n            } else {\n              // FIXME flattening bug\n              // tmp is Promise<TestFileInfo[]>[] (array of promises of arrays)\n              // want to flatten that into Promise<TestFileInfo[]> where each\n              // promise is added to a single array\n              let tmp = files.map(f => getFiles(path.join(filepath, f)));\n              resolve(Promise.all(tmp));\n            }\n          });\n        }\n      }\n    });\n  });\n}\n*/\n\n/**\n * getFilesSync returns a TestFileInfo for each file that is underneath the\n * directory ${filepath}. If ${filepath} is just a file, then it returns an\n * array of size 1.\n * This function synchronously fetches from the filesystem, as such it should\n * only be used in initialization code that only runs once.\n */\nfunction getFilesSync(filepath: string): TestFileInfo[] {\n  let stat = fs.statSync(filepath);\n  if (stat.isFile()) {\n    return [new TestFileInfo(filepath, false)];\n  } else if (stat.isDirectory()) {\n    let subFiles = fs.readdirSync(filepath);\n    return flatten(\n      subFiles.map(f => {\n        return getFilesSync(path.join(filepath, f));\n      })\n    );\n  } else {\n    throw new Error(\"That type of file is not supported\");\n  }\n}\n\nfunction flatten<T>(arr: Array<Array<T>>): Array<T> {\n  return arr.reduce((a, b) => {\n    return a.concat(b);\n  }, []);\n}\n\n/**\n * prepareTest opens the file corresponding to ${test} and calls ${cb} on the\n * results, expect the ones for which ${filterFn} returns false.\n * The value passed to ${cb} will be an error if the file could not be read,\n * or the banner data for the test if successful.\n * NOTE: if the test file contents match the filter function given, ${cb} will\n * not be called for that test.\n */\nfunction prepareTest(\n  test: TestFileInfo,\n  filterFn: (test: TestFileInfo, fileContents: string) => boolean,\n  cb: (err: ?Error, res: ?BannerData, testFileContents: ?string) => void\n): void {\n  fs.readFile(test.location, (err, contents) => {\n    if (err != null) {\n      cb(err, null, null);\n    } else {\n      let contentsStr = contents.toString();\n      // check if this test should be filtered\n      if (!filterFn(test, contentsStr)) {\n        // skip this test\n        cb(null, null, null);\n      } else {\n        try {\n          let banners = getBanners(test, contentsStr);\n          cb(null, banners, contentsStr);\n        } catch (bannerParseErr) {\n          cb(bannerParseErr, null, null);\n        }\n      }\n    }\n  });\n}\n\nfunction createRealm(timeout: number): { realm: Realm, $: ObjectValue } {\n  // Create a new realm.\n  let realm = construct_realm({\n    strictlyMonotonicDateNow: true,\n    errorHandler: () => \"Fail\",\n    timeout: timeout * 1000,\n  });\n  initializeGlobals(realm);\n  let executionContext = new ExecutionContext();\n  executionContext.realm = realm;\n  realm.pushContext(executionContext);\n\n  // Create the Host-Defined functions.\n  let $ = new ObjectValue(realm);\n\n  $.defineNativeMethod(\"createRealm\", 0, context => {\n    return createRealm(timeout).$;\n  });\n\n  $.defineNativeMethod(\"detachArrayBuffer\", 1, (context, [buffer]) => {\n    return DetachArrayBuffer(realm, buffer);\n  });\n\n  $.defineNativeMethod(\"evalScript\", 1, (context, [sourceText]) => {\n    // TODO: eval\n    return realm.intrinsics.undefined;\n  });\n\n  $.defineNativeProperty(\"global\", realm.$GlobalObject);\n\n  let glob = ((realm.$GlobalObject: any): ObjectValue);\n  glob.defineNativeProperty(\"$262\", $);\n  glob.defineNativeMethod(\"print\", 1, (context, [arg]) => {\n    return realm.intrinsics.undefined;\n  });\n\n  return { realm, $ };\n}\n\n/**\n * runTest executes the test given by ${test} whose contents are\n * ${testFileContents}.\n * It returns None if the test should is skipped, otherwise it returns a\n * TestResult.\n */\nfunction runTest(\n  test: TestFileInfo,\n  testFileContents: string,\n  data: BannerData,\n  // eslint-disable-next-line flowtype/no-weak-types\n  harnesses: Object,\n  strict: boolean,\n  options: TestRunOptions\n): ?TestResult {\n  if (options.serializer) {\n    return executeTestUsingSerializer(test, testFileContents, data, harnesses, strict, options);\n  }\n\n  let { realm } = createRealm(options.timeout);\n\n  // Run the test.\n  try {\n    try {\n      // execute the harnesss first\n      for (let name of [\"sta.js\", \"assert.js\"].concat(data.includes || [])) {\n        let harness = harnesses[name];\n        let completion = realm.$GlobalEnv.execute(harness, name);\n        if (completion instanceof ThrowCompletion) throw completion;\n      }\n\n      let completion = realm.$GlobalEnv.execute(\n        (strict ? '\"use strict\";' + EOL : \"\") + testFileContents,\n        test.location\n      );\n      if (completion instanceof ThrowCompletion) throw completion;\n      if (completion instanceof AbruptCompletion)\n        return new TestResult(false, strict, new Error(\"Unexpected abrupt completion\"));\n    } catch (err) {\n      if (err.message === \"Timed out\") return new TestResult(false, strict, err);\n      if (!data.negative || data.negative !== err.name) {\n        throw err;\n      }\n    }\n\n    if (data.negative.type) {\n      throw new Error(\"Was supposed to error with type \" + data.negative.type + \" but passed\");\n    }\n\n    // succeeded\n    return new TestResult(true, strict);\n  } catch (err) {\n    // Skip syntax errors.\n    if (err.value && err.value.$Prototype && err.value.$Prototype.intrinsicName === \"SyntaxError.prototype\") {\n      return null;\n    }\n\n    let stack = err.stack;\n    if (data.negative.type) {\n      let type = data.negative.type;\n      if (\n        err &&\n        err instanceof ThrowCompletion &&\n        err.value instanceof ObjectValue &&\n        (Get(realm, err.value, \"name\"): any).value === type\n      ) {\n        // Expected an error and got one.\n        return new TestResult(true, strict);\n      } else {\n        // Expected an error, but got something else.\n        if (err && err instanceof ThrowCompletion) {\n          return new TestResult(false, strict, err);\n        } else {\n          return new TestResult(false, strict, new Error(`Expected an error, but got something else: ${err.message}`));\n        }\n      }\n    } else {\n      // Not expecting an error, but got one.\n      try {\n        if (err && err instanceof ThrowCompletion) {\n          let interpreterStack: void | string;\n\n          if (err.value instanceof ObjectValue) {\n            if (err.value.$HasProperty(\"stack\")) {\n              interpreterStack = To.ToStringPartial(realm, Get(realm, err.value, \"stack\"));\n            } else {\n              interpreterStack = To.ToStringPartial(realm, Get(realm, err.value, \"message\"));\n            }\n            // filter out if the error stack is due to async\n            if (interpreterStack.includes(\"async \")) {\n              return null;\n            }\n          } else if (err.value instanceof StringValue) {\n            interpreterStack = err.value.value;\n            if (interpreterStack === \"only plain identifiers are supported in parameter lists\") {\n              return null;\n            }\n          }\n\n          // Many strict-only tests involving eval check if certain SyntaxErrors are thrown.\n          // Some of those would require changes to Babel to support properly, and some we should handle ourselves in Prepack some day.\n          // But for now, ignore.\n          if (testFileContents.includes(\"eval(\") && strict) {\n            return null;\n          }\n\n          if (interpreterStack) {\n            stack = `Interpreter: ${interpreterStack}${EOL}Native: ${err.nativeStack}`;\n          }\n        }\n      } catch (_err) {\n        stack = _err.stack;\n      }\n\n      return new TestResult(false, strict, new Error(`Got an error, but was not expecting one:${EOL}${stack}`));\n    }\n  }\n}\n\nfunction executeTestUsingSerializer(\n  test: TestFileInfo,\n  testFileContents: string,\n  data: BannerData,\n  // eslint-disable-next-line flowtype/no-weak-types\n  harnesses: Object,\n  strict: boolean,\n  options: TestRunOptions\n) {\n  let { timeout } = options;\n  let sources = [];\n\n  // Add the test262 intrinsics.\n  sources.push({\n    filePath: \"test262.js\",\n    fileContents: `\\\nvar $ = {\n  evalScript: () => {}, // noop for now\n  global,\n};\nvar $262 = $;\nvar print = () => {}; // noop for now\n  `,\n  });\n\n  // Add the harness files.\n  for (let name of [\"sta.js\", \"assert.js\"].concat(data.includes || [])) {\n    let harness = harnesses[name];\n    sources.push({ filePath: name, fileContents: harness });\n  }\n\n  // Add the test file.\n  sources.push({ filePath: test.location, fileContents: (strict ? '\"use strict\";' + EOL : \"\") + testFileContents });\n\n  let result;\n  try {\n    result = prepackSources(sources, {\n      serialize: true,\n      timeout: timeout * 1000,\n      errorHandler: diag => {\n        if (diag.severity === \"Information\") return \"Recover\";\n        if (diag.severity !== \"Warning\") return \"Fail\";\n        return \"Recover\";\n      },\n      onParse: ast => {\n        // Transform all statements which come from our test source file. Do not transform statements from our\n        // harness files.\n        if (options.serializer === \"abstract-scalar\") {\n          ast.program.body.forEach(node => {\n            if ((node.loc: any).filename === test.location) {\n              transformScalarsToAbstractValues(node);\n            }\n          });\n        }\n      },\n    });\n  } catch (error) {\n    if (error.message === \"Timed out\") return new TestResult(false, strict, error);\n    if (error.message.includes(\"Syntax error\")) return null;\n    // Uncomment the following JS code to do analysis on what kinds of Prepack errors we get.\n    //\n    // ```js\n    // console.error(\n    //   `${error.name.replace(/\\n/g, \"\\\\n\")}: ${error.message.replace(/\\n/g, \"\\\\n\")} (${error.stack\n    //     .match(/at .+$/gm)\n    //     .slice(0, 3)\n    //     .join(\", \")})`\n    // );\n    // ```\n    //\n    // Analysis bash command:\n    //\n    // ```bash\n    // yarn test-test262 --serializer 2> result.err\n    // cat result.err | sort | uniq -c | sort -nr\n    // ```\n    return new TestResult(false, strict, new Error(`Prepack error:\\n${error.stack}`));\n  }\n\n  const context = vm.createContext({\n    // TODO(#2292): Workaround since Prepack serializes code that expects a global `TypedArray` class which does not\n    // exist per the ECMAScript specification.\n    TypedArray: Object.getPrototypeOf(Int8Array),\n  });\n\n  try {\n    vm.runInContext(result.code, context, { timeout: timeout * 1000 });\n  } catch (error) {\n    if (error.message === \"Timed out\") return new TestResult(false, strict, error);\n    if (data.negative && data.negative.type === error.name) {\n      return new TestResult(true, strict);\n    } else {\n      return new TestResult(false, strict, new Error(`Runtime error:\\n${error.stack}`));\n    }\n  }\n  if (data.negative.type) {\n    return new TestResult(false, strict, new Error(`Expected \\`${data.negative.type}\\` error.`));\n  } else {\n    return new TestResult(true, strict);\n  }\n}\n\nconst TransformScalarsToAbstractValuesVisitor = (() => {\n  const t = babelTypes;\n\n  function createAbstractCall(type, actual, { allowDuplicateNames, disablePlaceholders } = {}) {\n    const args = [type, actual];\n    if (allowDuplicateNames) {\n      args.push(\n        t.objectExpression([\n          t.objectProperty(t.identifier(\"allowDuplicateNames\"), t.booleanLiteral(!!allowDuplicateNames)),\n          t.objectProperty(t.identifier(\"disablePlaceholders\"), t.booleanLiteral(!!disablePlaceholders)),\n        ])\n      );\n    }\n    return t.callExpression(t.identifier(\"__abstract\"), args);\n  }\n\n  const defaultOptions = {\n    allowDuplicateNames: true,\n    disablePlaceholders: true,\n  };\n\n  const symbolOptions = {\n    // Intentionally false since two symbol calls will be referentially not equal, but Prepack will share\n    // a variable.\n    allowDuplicateNames: false,\n    disablePlaceholders: true,\n  };\n\n  return {\n    noScope: true,\n\n    BooleanLiteral(p) {\n      p.node = p.container[p.key] = createAbstractCall(\n        t.stringLiteral(\"boolean\"),\n        t.stringLiteral(p.node.value.toString()),\n        defaultOptions\n      );\n    },\n    StringLiteral(p) {\n      // `eval()` does not support abstract arguments and we don't care to fix that.\n      if (\n        p.parent.type === \"CallExpression\" &&\n        p.parent.callee.type === \"Identifier\" &&\n        p.parent.callee.name === \"eval\"\n      ) {\n        return;\n      }\n      p.node = p.container[p.key] = createAbstractCall(\n        t.stringLiteral(\"string\"),\n        t.stringLiteral(JSON.stringify(p.node.value)),\n        defaultOptions\n      );\n    },\n    CallExpression(p) {\n      if (p.node.callee.type === \"Identifier\" && p.node.callee.name === \"Symbol\") {\n        p.node = p.container[p.key] = createAbstractCall(\n          t.stringLiteral(\"symbol\"),\n          t.stringLiteral(generate(p.node).code),\n          symbolOptions\n        );\n      }\n    },\n    NumericLiteral(p) {\n      p.node = p.container[p.key] = createAbstractCall(\n        t.stringLiteral(Number.isInteger(p.node.value) ? \"integral\" : \"number\"),\n        t.stringLiteral(p.node.extra.raw),\n        defaultOptions\n      );\n    },\n  };\n})();\n\nfunction transformScalarsToAbstractValues(ast) {\n  traverse(ast, TransformScalarsToAbstractValuesVisitor);\n  traverse.cache.clear();\n}\n\n/**\n * Returns true if ${test} should be run, false otherwise\n */\nfunction testFilterByMetadata(test: TestFileInfo): boolean {\n  // filter hidden files\n  if (path.basename(test.location)[0] === \".\") return false;\n\n  // emacs!\n  if (test.location.includes(\"~\")) return false;\n\n  // SIMD isn't in JS yet\n  if (test.location.includes(\"Simd\")) return false;\n\n  // temporarily disable intl402 tests (ES5)\n  if (test.location.includes(\"intl402\") && !test.location.includes(\"/Date/prototype/to\")) {\n    return false;\n  }\n\n  // temporarily disable tests which use realm.\n  if (test.location.includes(\"realm\")) return false;\n\n  // temporarily disable tests which use with. (??)\n  if (test.location.includes(\"/with/\")) return false;\n\n  // disable tests which use Atomics\n  if (test.location.includes(\"/Atomics/\")) return false;\n\n  // disable tests which use generators\n  if (test.location.includes(\"/generators/\")) return false;\n  if (test.location.includes(\"/yield/\")) return false;\n\n  // disable tests which use modules\n  if (test.location.includes(\"/module-code/\")) return false;\n\n  // disable browser specific tests\n  if (test.location.includes(\"/annexB/\")) return false;\n\n  // disable tail-call optimization tests\n  if (test.location.includes(\"tco\")) return false;\n\n  // disable nasty unicode tests.\n  if (test.location.includes(\"U180\") || test.location.includes(\"u180\") || test.location.includes(\"mongolian\"))\n    return false;\n\n  // disable function toString tests.\n  if (test.location.includes(\"Function/prototype/toString\")) return false;\n\n  // disable tests that check for detached-buffer-after-toindex\n  if (test.location.includes(\"detached-buffer-after-toindex\")) return false;\n\n  // disable tests to check for detatched-buffer during iteration\n  if (test.location.includes(\"detach-typedarray-in-progress.js\")) return false;\n\n  // disable broken RegExp tests\n  if (test.location.includes(\"RegExp/S15.10.2.12_A1_T1.js\")) return false;\n  if (test.location.includes(\"RegExp/S15.10.2.12_A2_T1.js\")) return false;\n  if (test.location.includes(\"RegExp/prototype/Symbol.search/lastindex-no-restore\")) return false;\n  if (test.location.includes(\"RegExp/prototype/exec/failure-lastindex-no-access.js\")) return false;\n  if (test.location.includes(\"RegExp/prototype/exec/success-lastindex-no-access.js\")) return false;\n\n  // disable RegExp tests that use extended unicode\n  if (test.location.includes(\"Symbol.match/builtin-success-u-return-val-groups\")) return false;\n\n  // disable SharedArrayBuffer tests\n  if (test.location.includes(\"sharedarraybuffer\") || test.location.includes(\"SharedArrayBuffer\")) return false;\n\n  return true;\n}\n\nfunction testFilterByContents(test: TestFileInfo, testFileContents: string): boolean {\n  // ES6 tests (can only be verified by contents, not by metadata)\n  let is_es6 = testFileContents.includes(EOL + \"es6id: \");\n  test.isES6 = is_es6;\n\n  // Ignore phase: early tests because those are errors that babel should catch\n  // not issues related to Prepack\n  let phase_early = testFileContents.indexOf(\"  phase: early\");\n  let end_of_comment = testFileContents.indexOf(\"---*/\");\n  if (phase_early > 0 && phase_early < end_of_comment) return false;\n\n  let esid_pending = testFileContents.indexOf(\"esid: pending\");\n  if (esid_pending > 0 && esid_pending < end_of_comment) return false;\n\n  // disable tests that require parser to throw SyntaxError in strict Mode\n  if (test.location.includes(\"/directive-prologue/\") && testFileContents.includes(\"assert.throws(SyntaxError,\"))\n    return false;\n\n  // disable SharedArrayBuffer tests\n  if (testFileContents.includes(\"SharedArrayBuffer\")) return false;\n\n  return true;\n}\n\nfunction filterFlags(data: BannerData): boolean {\n  return !data.flags.includes(\"async\");\n}\n\nfunction filterFeatures(data: BannerData): boolean {\n  let features = data.features;\n  if (features.includes(\"default-parameters\")) return false;\n  if (features.includes(\"generators\")) return false;\n  if (features.includes(\"generator\")) return false;\n  if (features.includes(\"BigInt\")) return false;\n  if (features.includes(\"class-fields\")) return false;\n  if (features.includes(\"async-iteration\")) return false;\n  if (features.includes(\"Function.prototype.toString\")) return false;\n  if (features.includes(\"SharedArrayBuffer\")) return false;\n  if (features.includes(\"cross-realm\")) return false;\n  if (features.includes(\"atomics\")) return false;\n  if (features.includes(\"u180e\")) return false;\n  if (features.includes(\"Symbol.isConcatSpreadable\")) return false;\n  if (features.includes(\"IsHTMLDDA\")) return false;\n  if (features.includes(\"regexp-unicode-property-escapes\")) return false;\n  if (features.includes(\"character-class-escape-non-whitespace\")) return false;\n  if (features.includes(\"regexp-named-groups\")) return false;\n  if (features.includes(\"regexp-lookbehind\")) return false;\n  if (features.includes(\"regexp-dotall\")) return false;\n  if (features.includes(\"optional-catch-binding\")) return false;\n  if (features.includes(\"Symbol.asyncIterator\")) return false;\n  if (features.includes(\"Promise.prototype.finally\")) return false;\n  return true;\n}\n\nfunction filterNegative(data: BannerData): boolean {\n  let negative = data.negative;\n  if (negative.phase === \"parse\") return false;\n  return true;\n}\n\nfunction filterIncludes(data: BannerData): boolean {\n  // disable tail call optimization tests.\n  return !data.includes.includes(\"tco-helper.js\");\n}\n\nfunction filterDescription(data: BannerData): boolean {\n  // For now, \"Complex tests\" is used in the description of some\n  // encode/decodeURI tests to indicate that they are long running.\n  // Filter these\n  return (\n    !data.description.includes(\"Complex tests\") &&\n    !data.description.includes(\"iterating\") &&\n    !data.description.includes(\"iterable\")\n  );\n}\n\nfunction filterCircleCI(data: BannerData): boolean {\n  let skipTests = [\n    \"7.8.5_A1.4_T2\",\n    \"7.8.5_A2.4_T2\",\n    \"7.8.5_A2.1_T2\",\n    \"7.8.5_A1.1_T2\",\n    \"15.1.2.2_A8\",\n    \"15.1.2.3_A6\",\n    \"7.4_A5\",\n    \"7.4_A6\",\n    \"15.10.2.12_A3_T1\",\n    \"15.10.2.12_A4_T1\",\n    \"15.10.2.12_A5_T1\",\n    \"15.10.2.12_A6_T1\",\n  ];\n  let skipTests6 = [\"22.1.3.1_3\"];\n\n  return !!process.env.NIGHTLY_BUILD || (skipTests.indexOf(data.es5id) < 0 && skipTests6.indexOf(data.es6id) < 0);\n}\n\nfunction filterSneakyGenerators(data: BannerData, testFileContents: string) {\n  // There are some sneaky tests that use generators but are not labeled with\n  // the \"generators\" or \"generator\" feature tag. Here we use a simple heuristic\n  // to filter out tests with sneaky generators.\n  if (data.features.includes(\"destructuring-binding\")) {\n    return !testFileContents.includes(\"function*\") && !testFileContents.includes(\"*method\");\n  }\n  return true;\n}\n\nfunction filterReallyBigArrays(test: TestFileInfo, testFileContents: string) {\n  // In tests where we serialize our values disable large array serialization. Serializing arrays with gaps\n  // is inefficient. Consider: https://prepack.io/repl#G4QwTgBCELwQ2gXQNwCgTwAyNhAjGhnptrgakA\n  return !(\n    ((test.location.includes(\"Array\") || test.location.includes(\"Object\")) &&\n      testFileContents.includes(\"4294967294\")) ||\n    (test.location.includes(\"Array\") && testFileContents.includes(\"Math.pow(2, 32)\")) ||\n    // Sneaky...\n    test.location.includes(\"Array/S15.4_A1.1_T10.js\")\n  );\n}\n\n/**\n * Run a given ${test} whose file contents are ${testFileContents} and return\n * a list of results, one for each strictness level (strict or not).\n * If the list's length is less than 2, than the missing tests were skipped.\n */\nfunction runTestWithStrictness(\n  test: TestFileInfo,\n  testFileContents: string,\n  data: BannerData,\n  // eslint-disable-next-line flowtype/no-weak-types\n  harnesses: Object,\n  options: TestRunOptions\n): Array<TestResult> {\n  let fn = (strict: boolean) => {\n    return runTest(test, testFileContents, data, harnesses, strict, options);\n  };\n  if (data.flags.includes(\"onlyStrict\")) {\n    if (testFileContents.includes(\"assert.throws(SyntaxError\")) return [];\n    let result = fn(true);\n    return result ? [result] : [];\n  } else if (data.flags.includes(\"noStrict\") || test.location.includes(\"global/global-object.js\")) {\n    if (testFileContents.includes('\"use strict\";') && testFileContents.includes(\"assert.throws(SyntaxError\")) return [];\n    let result = fn(false);\n    return result ? [result] : [];\n  } else {\n    // run both strict and non-strict\n    let strictResult = fn(true);\n    let unStrictResult = fn(false);\n    let finalResult = [];\n    if (strictResult) {\n      finalResult.push(strictResult);\n    }\n    if (unStrictResult) {\n      finalResult.push(unStrictResult);\n    }\n    return finalResult;\n  }\n}\n\n/**\n * Parses the banners, and returns the banners as arbitrary object data if they\n * were found, or returns an error if the banner it couldn't be parsed.\n */\nfunction getBanners(test: TestFileInfo, fileContents: string): ?BannerData {\n  let banners = fileContents.match(/---[\\s\\S]+---/);\n  let data = {};\n  if (banners) {\n    let bannerText = banners[0] || \"\";\n    if (bannerText.includes(\"StrictMode\")) {\n      if (bannerText.includes(\"'arguments'\")) return null;\n      if (bannerText.includes(\"'caller'\")) return null;\n    } else if (bannerText.includes('properties \"caller\" or \"arguments\"')) {\n      return null;\n    } else if (bannerText.includes(\"function caller\")) {\n      return null;\n    } else if (bannerText.includes(\"attribute of 'caller' property\")) {\n      return null;\n    } else if (bannerText.includes(\"attribute of 'arguments'\")) {\n      return null;\n    } else if (bannerText.includes(\"poisoned\")) return null;\n    try {\n      data = yaml.safeLoad(banners[0].slice(3, -3));\n    } catch (e) {\n      // Some versions of test262 have comments inside of yaml banners.\n      // parsing these will usually fail.\n      return null;\n    }\n  }\n  return BannerData.fromObject(data);\n}\n"
  },
  {
    "path": "scripts/test262.js",
    "content": "/**\n * Copyright (c) 2017-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n/* @flow */\nimport path from \"path\";\nimport fs from \"fs\";\nimport yaml from \"js-yaml\";\nimport Integrator from \"test262-integrator\";\n\nimport tty from \"tty\";\nimport minimist from \"minimist\";\n\nimport initializeGlobals from \"../lib/globals.js\";\nimport { AbruptCompletion, ThrowCompletion } from \"../lib/completions.js\";\nimport { DetachArrayBuffer } from \"../lib/methods/arraybuffer.js\";\nimport construct_realm from \"../lib/construct_realm.js\";\nimport { ObjectValue, StringValue } from \"../lib/values/index.js\";\nimport { Realm, ExecutionContext } from \"../lib/realm.js\";\nimport { To } from \"../lib/singletons.js\";\nimport { Get } from \"../lib/methods/get.js\";\n\nconst filters = yaml.safeLoad(fs.readFileSync(path.join(__dirname, \"./test262-filters.yml\"), \"utf8\"));\n\nclass TestAttrs {\n  description: string;\n  esid: ?string;\n  es5id: ?string;\n  es6id: ?string;\n  features: ?(string[]);\n  includes: ?(string[]);\n  info: ?string;\n  flags: TestFlags;\n  negative: TestAttrsNegative;\n  skip: boolean;\n}\n\nclass TestAttrsNegative {\n  phase: string;\n  type: string;\n}\n\nclass TestFlags {\n  generated: boolean;\n  onlyStrict: boolean;\n  noStrict: boolean;\n  async: boolean;\n}\n\nclass TestObject {\n  file: string;\n  contents: string;\n  copyright: string;\n  scenario: string; // \"default\", \"strict mode\", ...\n  attrs: TestAttrs;\n}\n\nclass Result {\n  pass: boolean;\n  error: ?Error;\n  skip: ?boolean;\n  constructor(pass, error, skip): void {\n    this.pass = pass;\n    this.error = error;\n    this.skip = skip;\n  }\n}\n\nclass TestResult extends TestObject {\n  result: Result;\n}\n\nfunction execute(timeout: number, test: TestObject): Result {\n  let { contents, attrs, file, scenario } = test;\n  let { realm } = createRealm(timeout);\n\n  let strict = scenario === \"strict mode\";\n\n  // Run the test.\n  try {\n    try {\n      let completion = realm.$GlobalEnv.execute(contents, file);\n      if (completion instanceof ThrowCompletion) throw completion;\n      if (completion instanceof AbruptCompletion) {\n        return new Result(false, new Error(\"Unexpected abrupt completion\"));\n      }\n    } catch (err) {\n      if (err.message === \"Timed out\") return new Result(false, err);\n      if (!attrs.negative) {\n        throw err;\n      }\n    }\n\n    if (attrs.negative && attrs.negative.type) {\n      throw new Error(\"Was supposed to error with type \" + attrs.negative.type + \" but passed\");\n    }\n\n    // succeeded\n    return new Result(true);\n  } catch (err) {\n    if (err.value && err.value.$Prototype && err.value.$Prototype.intrinsicName === \"SyntaxError.prototype\") {\n      // Skip test\n      return new Result(false, null, true);\n    }\n\n    let stack = err.stack;\n    if (attrs.negative && attrs.negative.type) {\n      let type = attrs.negative.type;\n      if (err && err instanceof ThrowCompletion && (Get(realm, err.value, \"name\"): any).value === type) {\n        // Expected an error and got one.\n        return new Result(true);\n      } else {\n        // Expected an error, but got something else.\n        if (err && err instanceof ThrowCompletion) {\n          return new Result(false, err);\n        } else {\n          let err2 = new Error(`Expected an error, but got something else: ${err.message}`);\n          return new Result(false, err2);\n        }\n      }\n    } else {\n      // Not expecting an error, but got one.\n      try {\n        if (err && err instanceof ThrowCompletion) {\n          let interpreterStack: void | string;\n\n          if (err.value instanceof ObjectValue) {\n            if (err.value.$HasProperty(\"stack\")) {\n              interpreterStack = To.ToStringPartial(realm, Get(realm, err.value, \"stack\"));\n            } else {\n              interpreterStack = To.ToStringPartial(realm, Get(realm, err.value, \"message\"));\n            }\n            // filter out if the error stack is due to async\n            if (interpreterStack.includes(\"async \")) {\n              // Skip test\n              return new Result(false, null, true);\n            }\n          } else if (err.value instanceof StringValue) {\n            interpreterStack = err.value.value;\n            if (interpreterStack === \"only plain identifiers are supported in parameter lists\") {\n              // Skip test\n              return new Result(false, null, true);\n            }\n          }\n\n          // Many strict-only tests involving eval check if certain SyntaxErrors are thrown.\n          // Some of those would require changes to Babel to support properly, and some we should handle ourselves in Prepack some day.\n          // But for now, ignore.\n          if (contents.includes(\"eval(\") && strict) {\n            // Skip test\n            return new Result(false, null, true);\n          }\n\n          if (interpreterStack) {\n            stack = `Interpreter: ${interpreterStack}\\nNative: ${err.nativeStack}`;\n          }\n        }\n      } catch (_err) {\n        stack = _err.stack;\n      }\n\n      return new Result(false, new Error(`Got an error, but was not expecting one:\\n${stack}`));\n    }\n  }\n}\n\nfunction createRealm(timeout: number): { realm: Realm, $: ObjectValue } {\n  // Create a new realm.\n  let realm = construct_realm({\n    strictlyMonotonicDateNow: true,\n    timeout: timeout * 1000,\n  });\n  initializeGlobals(realm);\n  let executionContext = new ExecutionContext();\n  executionContext.realm = realm;\n  realm.pushContext(executionContext);\n\n  // Create the Host-Defined functions.\n  let $ = new ObjectValue(realm);\n\n  $.defineNativeMethod(\"createRealm\", 0, context => {\n    return createRealm(timeout).$;\n  });\n\n  $.defineNativeMethod(\"detachArrayBuffer\", 1, (context, [buffer]) => {\n    return DetachArrayBuffer(realm, buffer);\n  });\n\n  $.defineNativeMethod(\"evalScript\", 1, (context, [sourceText]) => {\n    // TODO: eval\n    return realm.intrinsics.undefined;\n  });\n\n  $.defineNativeProperty(\"global\", realm.$GlobalObject);\n\n  $.defineNativeMethod(\"destroy\", 0, () => realm.intrinsics.undefined);\n\n  let glob = ((realm.$GlobalObject: any): ObjectValue);\n  glob.defineNativeProperty(\"$262\", $);\n  glob.defineNativeMethod(\"print\", 1, (context, [arg]) => {\n    return realm.intrinsics.undefined;\n  });\n\n  return { realm, $ };\n}\n\nclass ReportResults {\n  skipped: number;\n  passed: number;\n  total: number;\n  name: string;\n\n  constructor(name: string) {\n    this.skipped = 0;\n    this.passed = 0;\n    this.total = 0;\n    this.name = name;\n  }\n\n  report(pass: boolean, skip: boolean): void {\n    if (skip) {\n      this.skipped += 1;\n    } else if (pass) {\n      this.passed += 1;\n    }\n\n    this.total += 1;\n  }\n\n  percentage(x: number, total: number): string {\n    if (total === 0) {\n      return \"100%\";\n    }\n    return ((x / total) * 100).toFixed(2) + \"%\";\n  }\n\n  info(title: string, x: number, y: number, force: boolean): string {\n    if (!force && x === 0) {\n      return \"\";\n    }\n\n    return `${title} ${x}/${y} (${this.percentage(x, y)})`;\n  }\n\n  formatResult(): string {\n    const subtotal = this.total - this.skipped;\n    const failed = subtotal - this.passed;\n    return [\n      `${this.name}: `,\n      this.info(\"Ran\", subtotal, this.total, true),\n      this.info(\", Passed\", this.passed, subtotal, false),\n      this.info(\", Failed\", failed, subtotal, false),\n      this.info(\", Skipped\", this.skipped, this.total, false),\n    ].join(\"\");\n  }\n\n  static safeTypeReturn(map: Map<string, ReportResults>, key: string): ReportResults {\n    const result = map.get(key);\n    if (result instanceof ReportResults) {\n      return result;\n    }\n    throw new Error(\"Wrong type set in a list of ReportResults\");\n  }\n}\n\nfunction processResults(verbose: boolean, statusFile: string, results: TestResult[]): void {\n  let status = \"\\n\";\n  const foldersMap = new Map();\n  const featuresMap = new Map();\n  const allResults = new ReportResults(\"\\nTotal\");\n\n  console.log(\"\\n\");\n\n  results.forEach(({ file, scenario, attrs: { features }, result: { pass, skip, error } = {} }) => {\n    // Limits the report result in a max depth of 5 folders.\n    // This fits most cases for built-ins prototype methods as e.g.\n    // test/built-ins/Array/prototype/sort\n    const folder = path\n      .dirname(file)\n      .split(path.sep)\n      .slice(1, 5)\n      .join(path.sep);\n    let folderResults: ReportResults;\n\n    if (!foldersMap.has(folder)) {\n      folderResults = new ReportResults(folder);\n      foldersMap.set(folder, folderResults);\n    } else {\n      folderResults = ReportResults.safeTypeReturn(foldersMap, folder);\n    }\n\n    if (folderResults) {\n      folderResults.report(!!pass, !!skip);\n    }\n    allResults.report(!!pass, !!skip);\n\n    if (features) {\n      for (let feature of features) {\n        let featureResults: ReportResults;\n\n        if (!featuresMap.has(feature)) {\n          featureResults = new ReportResults(feature);\n          featuresMap.set(feature, featureResults);\n        } else {\n          featureResults = ReportResults.safeTypeReturn(featuresMap, feature);\n        }\n\n        if (featureResults) {\n          featureResults.report(!!pass, !!skip);\n        }\n      }\n    }\n\n    if (verbose && !skip && !pass) {\n      let message = \"\";\n      if (error && error.message) {\n        message = error.message;\n      }\n      status += `Failed: ${file} (${scenario})\\n${message}\\n\\n`;\n    }\n  });\n\n  foldersMap.forEach(folderResults => {\n    status += folderResults.formatResult();\n    status += \"\\n\";\n  });\n\n  status += \"\\nFeatures:\\n\\n\";\n\n  featuresMap.forEach(featureResults => {\n    status += featureResults.formatResult();\n    status += \"\\n\";\n  });\n\n  status += allResults.formatResult();\n\n  console.log(status);\n\n  if (statusFile) {\n    fs.writeFileSync(statusFile, status);\n  }\n}\n\nclass MasterProgramArgs {\n  verbose: boolean;\n  timeout: number;\n  statusFile: string;\n  paths: string[];\n  testDir: string;\n\n  constructor(verbose: boolean, timeout: number, statusFile: string, paths: string[], testDir: string) {\n    this.verbose = verbose;\n    this.timeout = timeout;\n    this.statusFile = statusFile;\n    this.paths = paths;\n    this.testDir = testDir;\n  }\n}\n\nfunction masterArgsParse(): MasterProgramArgs {\n  let { _: _paths, verbose, timeout, statusFile, testDir } = minimist(process.argv.slice(2), {\n    string: [\"statusFile\", \"testDir\"],\n    boolean: [\"verbose\"],\n    default: {\n      testDir: [\"..\", \"test\", \"test262\"].join(path.sep),\n      verbose: process.stdout instanceof tty.WriteStream ? false : true,\n      statusFile: \"\",\n      timeout: 10,\n    },\n  });\n\n  // Test paths can be provided as \"built-ins/Array\", \"language/statements/class\", etc.\n  let paths = _paths.map(p => path.join(\"test\", p));\n  if (typeof verbose !== \"boolean\") {\n    throw new Error(\"verbose must be a boolean (either --verbose or not)\");\n  }\n  if (typeof timeout !== \"number\") {\n    throw new Error(\"timeout must be a number (in seconds) (--timeout 10)\");\n  }\n  if (typeof statusFile !== \"string\") {\n    throw new Error(\"statusFile must be a string (--statusFile file.txt)\");\n  }\n  if (typeof testDir !== \"string\") {\n    throw new Error(\"testDir must be a string (--testDir ../test/test262)\");\n  }\n\n  return new MasterProgramArgs(verbose, timeout, statusFile, paths, testDir);\n}\n\nfunction usage(message: string): void {\n  console.error(\n    [\n      `Illegal argument: ${message}`,\n      `Usage: ${process.argv[0]} ${process.argv[1]}`,\n      \"[--verbose] (defaults to false)\",\n      \"[--timeout <number>] (defaults to 10)\",\n      \"[--statusFile <string>]\",\n      \"[--testDir <string>] (defaults to ../test/test262)\",\n    ].join(\"\\n\")\n  );\n}\n\nfunction main(): void {\n  try {\n    let { testDir, verbose, paths, statusFile, timeout } = masterArgsParse();\n\n    // Execution\n    Integrator({\n      filters,\n      execute: execute.bind(null, timeout),\n      testDir: path.join(__dirname, testDir),\n      verbose,\n      paths: paths.length ? paths : null,\n    })\n      .then(processResults.bind(null, verbose, statusFile), err => {\n        console.error(`Error running the tests: ${err}`);\n        process.exit(1);\n      })\n      .then(() => process.exit(0));\n  } catch (e) {\n    usage(e.message);\n    process.exit(2);\n  }\n}\n\nmain();\n"
  },
  {
    "path": "src/benchmarker.js",
    "content": "/**\n * Copyright (c) 2017-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n/* @flow strict-local */\n\nimport type { Compatibility } from \"./options.js\";\nimport { SourceFileCollection } from \"./types.js\";\nimport Serializer from \"./serializer/index.js\";\nimport construct_realm from \"./construct_realm.js\";\nimport initializeGlobals from \"./globals.js\";\nimport invariant from \"./invariant.js\";\n\nlet chalk = require(\"chalk\");\nlet jsdom = require(\"jsdom\");\nlet zlib = require(\"zlib\");\nlet fs = require(\"fs\");\nlet vm = require(\"vm\");\n\ntype Sandbox = {\n  setTimeout: (func: () => mixed, timeout?: number, ...args?: Array<mixed>) => TimeoutID,\n  setInterval: (func: () => mixed, timeout?: number, ...args?: Array<mixed>) => IntervalID,\n  console: {\n    error: (msg: string | {}) => void,\n    log: (msg: string | {}) => void,\n  },\n  window?: {},\n  document?: {},\n  navigator?: {},\n  location?: {},\n};\n\nfunction getTime() {\n  let stamp = process.hrtime();\n  return (stamp[0] * 1e9 + stamp[1]) / 1e6;\n}\n\nfunction exec(_code: string, compatibility: Compatibility) {\n  let code = _code;\n  let sandbox: Sandbox = {\n    setTimeout: setTimeout,\n    setInterval: setInterval,\n    console: {\n      error() {},\n      log(s) {\n        console.log(s);\n      },\n    },\n  };\n\n  let beforeCode = \"var global = this; \";\n  let afterCode = `// At the end of the script, Node tries to clone the 'this' Object (global) which involves executing all getters on it.\n// To avoid executing any more code (which could affect timing), we just set all globals to undefined (hoping that doesn't take too long).\nObject.getOwnPropertyNames(global).forEach(function(name){ if (name !== \"Object\" && name !== \"global\") global[name] = undefined; });`;\n\n  if (compatibility === \"browser\") {\n    beforeCode += \"var window = this; var self = this; \";\n    let window = jsdom.jsdom({}).defaultView;\n    sandbox.window = window;\n    sandbox.document = window.document;\n    sandbox.navigator = window.navigator;\n    sandbox.location = window.location;\n  }\n  if (compatibility === \"jsc-600-1-4-17\") {\n    beforeCode +=\n      \"delete global.clearInterval; delete global.clearImmediate; delete global.clearTimeout; delete global.setImmediate; delete Object.assign;\";\n  }\n\n  code = `${beforeCode} ${code}; // keep newline here as code may end with comment\n${afterCode}`;\n\n  let start = getTime();\n  let script = new vm.Script(code, { cachedDataProduced: false });\n  let executedStart = getTime();\n  script.runInNewContext(sandbox);\n  let executedEnd = getTime();\n\n  return {\n    raw: code.length,\n    gzip: zlib.gzipSync(code).length,\n    executed: executedEnd - executedStart,\n    compiled: executedStart - start,\n    total: executedEnd - start,\n  };\n}\n\nfunction line(type, code, compatibility: Compatibility, moreOut = {}, compareStats = undefined) {\n  let stats = exec(code, compatibility);\n\n  function wrapTime(key) {\n    return wrap(key, ms => `${ms.toFixed(2)}ms`, \"faster\", \"slower\");\n  }\n\n  function wrapSize(key) {\n    return wrap(\n      key,\n      function(b) {\n        let kilobytes = Math.round(b / 1000);\n        if (kilobytes > 1000) {\n          return `${(kilobytes / 1000).toFixed(2)}MB`;\n        } else {\n          return `${kilobytes}KB`;\n        }\n      },\n      \"smaller\",\n      \"bigger\"\n    );\n  }\n\n  function wrap(key, format, positive, negative) {\n    if (compareStats) {\n      let before = compareStats[key];\n      let after = stats[key];\n      let factor;\n\n      if (after < before) {\n        factor = chalk.green(`${(before / after).toFixed(2)}x ${positive}`);\n      } else {\n        factor = chalk.red(`${(after / before).toFixed(2)}x ${negative}`);\n      }\n\n      return `${format(after)} ${factor}`;\n    } else {\n      return format(stats[key]);\n    }\n  }\n\n  let out = {\n    \"VM Total Time\": wrapTime(\"total\"),\n    \"VM Compile Time\": wrapTime(\"compiled\"),\n    \"VM Execution Time\": wrapTime(\"executed\"),\n    \"Raw Code Size\": wrapSize(\"raw\"),\n    \"Gzip Code Size\": wrapSize(\"gzip\"),\n    ...moreOut,\n  };\n\n  console.log(chalk.bold(type));\n\n  for (let key in out) {\n    console.log(`  ${chalk.bold(key)} ${out[key]}`);\n  }\n\n  return stats;\n}\n\nfunction dump(\n  name: string,\n  raw: string,\n  min: string = raw,\n  compatibility?: \"browser\" | \"jsc-600-1-4-17\" = \"browser\",\n  outputFilename?: string\n) {\n  console.log(chalk.inverse(name));\n  let beforeStats = line(\"Before\", min, compatibility);\n\n  let start = Date.now();\n  let realm = construct_realm({ serialize: true, compatibility });\n  initializeGlobals(realm);\n  let serializer = new Serializer(realm);\n  let sourceFileCollection = new SourceFileCollection([{ filePath: name, fileContents: raw }]);\n  let serialized = serializer.init(sourceFileCollection);\n  if (!serialized) {\n    process.exit(1);\n    invariant(false);\n  }\n  let code = serialized.code;\n  let total = Date.now() - start;\n\n  const isValidOutputFilename = outputFilename !== undefined && outputFilename !== \"\";\n  if (code.length >= 1000 || isValidOutputFilename) {\n    let filename = outputFilename !== undefined ? outputFilename : name + \"-processed.js\";\n    console.log(`Prepacked source code written to ${filename}.`);\n    fs.writeFileSync(filename, code);\n  }\n\n  line(\n    \"After\",\n    code,\n    compatibility,\n    {\n      \"Prepack Compile Time\": `${total}ms`,\n    },\n    beforeStats\n  );\n\n  if (code.length <= 1000 && !isValidOutputFilename) {\n    console.log(\"+++++++++++++++++ Prepacked source code\");\n    console.log(code);\n    console.log(\"=================\");\n  }\n}\n\nlet args = Array.from(process.argv);\nargs.splice(0, 2);\nlet inputFilename;\nlet outputFilename;\nlet compatibility;\nwhile (args.length) {\n  let arg = args[0];\n  args.shift();\n  if (arg === \"--out\") {\n    arg = args[0];\n    args.shift();\n    outputFilename = arg;\n  } else if (arg === \"--compatibility\") {\n    arg = args[0];\n    args.shift();\n    if (arg !== \"jsc-600-1-4-17\") {\n      console.error(`Unsupported compatibility: ${arg}`);\n      process.exit(1);\n    } else {\n      compatibility = arg;\n    }\n  } else if (arg === \"--help\") {\n    console.log(\"Usage: benchmarker.js [ --out output.js ] [ --compatibility jsc ] [ -- | input.js ]\");\n  } else if (!arg.startsWith(\"--\")) {\n    inputFilename = arg;\n  } else {\n    console.error(`Unknown option: ${arg}`);\n    process.exit(1);\n  }\n}\n\nif (inputFilename === undefined) {\n  console.error(\"Missing input file.\");\n  process.exit(1);\n} else {\n  let input = fs.readFileSync(inputFilename, \"utf8\");\n  dump(inputFilename, input, input, compatibility, outputFilename);\n}\n\n//dump(\"helloWorld\", \"function hello() { return 'hello'; } function world() { return 'world'; } s = hello() + ' ' + world();\");\n\n//dump(\"regex\", \"regex = /Facebook/i;\");\n\n//dump(\"test\", \"try { new WeakSet().delete.call(0, {}); } catch (e) {console.log(e);}\");\n//dump(\"test\", \"e = 'abcdef'.substr(1,2); \");\n//dump(\"test\", \"var s = 'Promise'; e = s[0];\");\n//dump(\"test\", \"foo = function() { return [,0]; };\");\n\n//dump(\"simple\", \"var foo = 5 * 5; var bar = [2, 3, 'yes']; var foo2 = null; var bar2 = undefined;\");\n//dump(\"simple2\", \"function Foo() {} Foo.prototype.wow = function () {};\");\n\n//dump(\"Date.now\", \"Date.now\");\n//dump(\"Date.now\", \"this.foo = Date.now();\");\n//dump(\"object recursion\", \"var obj = { yes: 'no' }; obj.bar = obj; var foo = [obj]; obj.foobar = foo;\");\n//dump(\"intrinsic union\", \"var assign = Object.assign || function () {}; var obj = assign({ foo: 1 }, { bar: 2 });\");\n\n/*dump(\n  \"fbsdk\",\n  fs.readFileSync(__dirname + \"/../assets/fbsdk.js\", \"utf8\")\n);*/\n\n/*dump(\n  \"react\",\n  fs.readFileSync(__dirname + \"/../assets/react.js\", \"utf8\"),\n  fs.readFileSync(__dirname + \"/../assets/react.min.js\", \"utf8\")\n);*/\n\n/*dump(\n  \"immutable\",\n  fs.readFileSync(__dirname + \"/../assets/immutable.js\", \"utf8\"),\n  fs.readFileSync(__dirname + \"/../assets/immutable.min.js\", \"utf8\")\n);*/\n\n/*dump(\n  \"react-native-bundle\",\n  fs.readFileSync(__dirname + \"/../../examples/react-native-bundle/bundle.js\", \"utf8\")\n);*/\n\n/*dump(\n  \"lodash\",\n  fs.readFileSync(require.resolve(\"lodash/lodash.js\"), \"utf8\"),\n  fs.readFileSync(require.resolve(\"lodash/lodash.min.js\"), \"utf8\")\n);*/\n\n/*dump(\n  \"underscore\",\n  fs.readFileSync(require.resolve(\"underscore\"), \"utf8\"),\n  fs.readFileSync(require.resolve(\"underscore/underscore-min\"), \"utf8\")\n);\n*/\n\n/*dump(\n  \"ember\",\n  fs.readFileSync(\"ember.prod.js\", \"utf8\")\n);\n\ndump(\n  \"jquery\",\n  fs.readFileSync(require.resolve(\"jquery/dist/jquery.js\"), \"utf8\"),\n  fs.readFileSync(require.resolve(\"jquery/dist/jquery.min.js\"), \"utf8\")\n);\n\ndump(\n  \"scrollin\",\n  fs.readFileSync(\"scrollin.js\", \"utf8\")\n);\n*/\n"
  },
  {
    "path": "src/completions.js",
    "content": "/**\n * Copyright (c) 2017-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n/* @flow */\n\nimport type { BabelNodeSourceLocation } from \"@babel/types\";\nimport invariant from \"./invariant.js\";\nimport type { Effects } from \"./realm.js\";\nimport { PathConditions } from \"./types.js\";\nimport { AbstractValue, EmptyValue, Value } from \"./values/index.js\";\n\nexport class Completion {\n  constructor(value: Value, location: ?BabelNodeSourceLocation, target?: ?string) {\n    this.value = value;\n    this.target = target;\n    this.location = location;\n    invariant(this.constructor !== Completion, \"Completion is an abstract base class\");\n  }\n\n  value: Value;\n  target: ?string;\n  location: ?BabelNodeSourceLocation;\n\n  containsSelectedCompletion(selector: Completion => boolean): boolean {\n    return selector(this);\n  }\n\n  shallowClone(): Completion {\n    invariant(false, \"abstract base method\");\n  }\n\n  toDisplayString(): string {\n    return \"[\" + this.constructor.name + \" value \" + (this.value ? this.value.toDisplayString() : \"undefined\") + \"]\";\n  }\n\n  static makeAllNormalCompletionsResultInUndefined(completion: Completion): void {\n    let undefinedVal = completion.value.$Realm.intrinsics.undefined;\n    if (completion instanceof SimpleNormalCompletion) completion.value = undefinedVal;\n    else if (completion instanceof JoinedNormalAndAbruptCompletions) {\n      if (completion.composedWith !== undefined)\n        Completion.makeAllNormalCompletionsResultInUndefined(completion.composedWith);\n      Completion.makeAllNormalCompletionsResultInUndefined(completion.consequent);\n      Completion.makeAllNormalCompletionsResultInUndefined(completion.alternate);\n    }\n  }\n\n  static makeSelectedCompletionsInfeasible(selector: Completion => boolean, completion: Completion): void {\n    let bottomValue = completion.value.$Realm.intrinsics.__bottomValue;\n    if (selector(completion)) completion.value = bottomValue;\n    else if (completion instanceof JoinedNormalAndAbruptCompletions || completion instanceof JoinedAbruptCompletions) {\n      if (completion instanceof JoinedNormalAndAbruptCompletions && completion.composedWith !== undefined)\n        Completion.makeSelectedCompletionsInfeasible(selector, completion.composedWith);\n      Completion.makeSelectedCompletionsInfeasible(selector, completion.consequent);\n      Completion.makeSelectedCompletionsInfeasible(selector, completion.alternate);\n    }\n  }\n\n  static makeSelectedCompletionsInfeasibleInCopy(selector: Completion => boolean, completion: Completion): Completion {\n    let bottomValue = completion.value.$Realm.intrinsics.__bottomValue;\n    let clone = completion.shallowClone();\n    if (selector(clone)) clone.value = bottomValue;\n    else if (clone instanceof JoinedNormalAndAbruptCompletions || clone instanceof JoinedAbruptCompletions) {\n      clone.consequent = (Completion.makeSelectedCompletionsInfeasibleInCopy(selector, clone.consequent): any);\n      clone.alternate = (Completion.makeSelectedCompletionsInfeasibleInCopy(selector, clone.alternate): any);\n      if (clone.consequent.value === bottomValue) {\n        return clone.alternate;\n      }\n      if (clone.alternate.value === bottomValue) {\n        return clone.consequent;\n      }\n    }\n    return clone;\n  }\n\n  static normalizeSelectedCompletions(selector: Completion => boolean, completion: Completion): Completion {\n    if (selector(completion)) return new SimpleNormalCompletion(completion.value);\n    let normalizedComposedWith;\n    if (completion instanceof JoinedNormalAndAbruptCompletions) {\n      invariant(completion.savedEffects === undefined); // caller should not used a still saved completion for this\n      if (completion.composedWith !== undefined)\n        normalizedComposedWith = Completion.normalizeSelectedCompletions(selector, completion.composedWith);\n    }\n    if (completion instanceof JoinedNormalAndAbruptCompletions || completion instanceof JoinedAbruptCompletions) {\n      let nc = Completion.normalizeSelectedCompletions(selector, completion.consequent);\n      let na = Completion.normalizeSelectedCompletions(selector, completion.alternate);\n      if (normalizedComposedWith === undefined) {\n        if (nc === completion.consequent && na === completion.alternate) return completion;\n        if (nc instanceof AbruptCompletion && na instanceof AbruptCompletion) return completion;\n        if (nc instanceof SimpleNormalCompletion && na instanceof SimpleNormalCompletion)\n          return new SimpleNormalCompletion(\n            AbstractValue.createFromConditionalOp(completion.value.$Realm, completion.joinCondition, nc.value, na.value)\n          );\n        invariant(nc instanceof AbruptCompletion || nc instanceof NormalCompletion);\n        invariant(na instanceof AbruptCompletion || na instanceof NormalCompletion);\n        return new JoinedNormalAndAbruptCompletions(completion.joinCondition, nc, na);\n      }\n      invariant(nc instanceof AbruptCompletion || nc instanceof NormalCompletion);\n      invariant(na instanceof AbruptCompletion || na instanceof NormalCompletion);\n      let result = new JoinedNormalAndAbruptCompletions(completion.joinCondition, nc, na);\n      if (normalizedComposedWith instanceof JoinedNormalAndAbruptCompletions)\n        result.composedWith = normalizedComposedWith;\n      return result;\n    }\n    return completion;\n  }\n}\n\n// Normal completions are returned just like spec completions\nexport class NormalCompletion extends Completion {\n  constructor(value: Value, location: ?BabelNodeSourceLocation, target?: ?string) {\n    super(value, location, target);\n    invariant(this.constructor !== NormalCompletion, \"NormalCompletion is an abstract base class\");\n  }\n}\n\n// SimpleNormalCompletions are returned just like spec completions.\n// They chiefly exist for use in joined completions.\nexport class SimpleNormalCompletion extends NormalCompletion {\n  shallowClone(): SimpleNormalCompletion {\n    return new SimpleNormalCompletion(this.value, this.location, this.target);\n  }\n}\n\n// Abrupt completions are thrown as exeptions, to make it a easier\n// to quickly get to the matching high level construct.\nexport class AbruptCompletion extends Completion {\n  constructor(value: Value, location: ?BabelNodeSourceLocation, target?: ?string) {\n    super(value, location, target);\n    invariant(this.constructor !== AbruptCompletion, \"AbruptCompletion is an abstract base class\");\n  }\n}\n\nexport class ThrowCompletion extends AbruptCompletion {\n  constructor(value: Value, location: ?BabelNodeSourceLocation, nativeStack?: ?string, emitWarning?: boolean = true) {\n    super(value, location);\n    this.nativeStack = nativeStack || new Error().stack;\n  }\n\n  nativeStack: string;\n\n  shallowClone(): ThrowCompletion {\n    return new ThrowCompletion(this.value, this.location, this.nativeStack, false);\n  }\n}\n\nexport class ContinueCompletion extends AbruptCompletion {\n  constructor(value: Value, location: ?BabelNodeSourceLocation, target: ?string) {\n    super(value, location, target || null);\n  }\n\n  shallowClone(): ContinueCompletion {\n    return new ContinueCompletion(this.value, this.location, this.target);\n  }\n}\n\nexport class BreakCompletion extends AbruptCompletion {\n  constructor(value: Value, location: ?BabelNodeSourceLocation, target: ?string) {\n    super(value, location, target || null);\n  }\n\n  shallowClone(): BreakCompletion {\n    return new BreakCompletion(this.value, this.location, this.target);\n  }\n}\n\nexport class ReturnCompletion extends AbruptCompletion {\n  constructor(value: Value, location: ?BabelNodeSourceLocation) {\n    super(value, location);\n    if (value instanceof EmptyValue) {\n      this.value = value.$Realm.intrinsics.undefined;\n    }\n  }\n\n  shallowClone(): ReturnCompletion {\n    return new ReturnCompletion(this.value, this.location);\n  }\n}\n\nexport class JoinedAbruptCompletions extends AbruptCompletion {\n  constructor(joinCondition: AbstractValue, consequent: AbruptCompletion, alternate: AbruptCompletion) {\n    super(joinCondition.$Realm.intrinsics.empty, consequent.location);\n    this.joinCondition = joinCondition;\n    this.consequent = consequent;\n    this.alternate = alternate;\n  }\n\n  joinCondition: AbstractValue;\n  consequent: AbruptCompletion;\n  alternate: AbruptCompletion;\n\n  containsSelectedCompletion(selector: Completion => boolean): boolean {\n    if (selector(this.consequent)) return true;\n    if (selector(this.alternate)) return true;\n    if (this.consequent instanceof JoinedAbruptCompletions) {\n      if (this.consequent.containsSelectedCompletion(selector)) return true;\n    }\n    if (this.alternate instanceof JoinedAbruptCompletions) {\n      if (this.alternate.containsSelectedCompletion(selector)) return true;\n    }\n    return false;\n  }\n\n  shallowClone(): JoinedAbruptCompletions {\n    return new JoinedAbruptCompletions(this.joinCondition, this.consequent, this.alternate);\n  }\n\n  toDisplayString(): string {\n    let superString = super.toDisplayString().slice(0, -1);\n    return (\n      superString + \" c: [\" + this.consequent.toDisplayString() + \"] a: [\" + this.alternate.toDisplayString() + \"]]\"\n    );\n  }\n}\n\n// This should never be thrown, therefore it is treated as a NormalCompletion even though it is also Abrupt.\nexport class JoinedNormalAndAbruptCompletions extends NormalCompletion {\n  constructor(\n    joinCondition: AbstractValue,\n    consequent: AbruptCompletion | NormalCompletion,\n    alternate: AbruptCompletion | NormalCompletion\n  ) {\n    super(consequent instanceof NormalCompletion ? consequent.value : alternate.value, consequent.location);\n    this.joinCondition = joinCondition;\n    this.consequent = consequent;\n    this.alternate = alternate;\n    this.pathConditionsAtCreation = joinCondition.$Realm.pathConditions;\n  }\n\n  joinCondition: AbstractValue;\n  consequent: AbruptCompletion | NormalCompletion;\n  alternate: AbruptCompletion | NormalCompletion;\n  // A completion that precedes this one and that has one or more normal paths, as well as some abrupt paths\n  composedWith: void | JoinedNormalAndAbruptCompletions;\n  pathConditionsAtCreation: PathConditions;\n  savedEffects: void | Effects;\n\n  containsSelectedCompletion(selector: Completion => boolean): boolean {\n    if (this.composedWith !== undefined && this.composedWith.containsSelectedCompletion(selector)) return true;\n    if (selector(this.consequent)) return true;\n    if (selector(this.alternate)) return true;\n    if (\n      this.consequent instanceof JoinedAbruptCompletions ||\n      this.consequent instanceof JoinedNormalAndAbruptCompletions\n    ) {\n      if (this.consequent.containsSelectedCompletion(selector)) return true;\n    }\n    if (\n      this.alternate instanceof JoinedAbruptCompletions ||\n      this.alternate instanceof JoinedNormalAndAbruptCompletions\n    ) {\n      if (this.alternate.containsSelectedCompletion(selector)) return true;\n    }\n    return false;\n  }\n\n  shallowClone(): JoinedNormalAndAbruptCompletions {\n    let clone = new JoinedNormalAndAbruptCompletions(this.joinCondition, this.consequent, this.alternate);\n    clone.composedWith = this.composedWith;\n    clone.pathConditionsAtCreation = this.pathConditionsAtCreation;\n    return clone;\n  }\n\n  toDisplayString(): string {\n    let superString = super.toDisplayString().slice(0, -1);\n    return (\n      superString + \" c: [\" + this.consequent.toDisplayString() + \"] a: [\" + this.alternate.toDisplayString() + \"]]\"\n    );\n  }\n}\n"
  },
  {
    "path": "src/construct_realm.js",
    "content": "/**\n * Copyright (c) 2017-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n/* @flow strict-local */\n\nimport { Realm } from \"./realm.js\";\nimport initializeSingletons from \"./initialize-singletons.js\";\nimport { initialize as initializeIntrinsics } from \"./intrinsics/index.js\";\nimport initializeGlobal from \"./intrinsics/ecma262/global.js\";\nimport type { RealmOptions } from \"./options.js\";\nimport { RealmStatistics } from \"./statistics.js\";\nimport * as evaluators from \"./evaluators/index.js\";\nimport { Environment, DebugReproManager } from \"./singletons.js\";\nimport { ObjectValue } from \"./values/index.js\";\nimport { DebugServer } from \"./debugger/server/Debugger.js\";\nimport simplifyAndRefineAbstractValue from \"./utils/simplifier.js\";\nimport invariant from \"./invariant.js\";\nimport type { DebuggerConfigArguments, DebugReproArguments } from \"./types\";\n\nexport default function(\n  opts: RealmOptions = {},\n  debuggerConfigArgs: void | DebuggerConfigArguments,\n  statistics: void | RealmStatistics = undefined,\n  debugReproArgs: void | DebugReproArguments\n): Realm {\n  initializeSingletons();\n  let r = new Realm(opts, statistics || new RealmStatistics());\n  // Presence of debugChannel indicates we wish to use debugger.\n  if (debuggerConfigArgs) {\n    let debugChannel = debuggerConfigArgs.debugChannel;\n    if (debugChannel) {\n      invariant(debugChannel.debuggerIsAttached(), \"Debugger intends to be used but is not attached.\");\n      r.debuggerInstance = new DebugServer(debugChannel, r, debuggerConfigArgs);\n    }\n  }\n\n  if (debugReproArgs !== undefined) r.debugReproManager = DebugReproManager.construct(debugReproArgs);\n\n  let i = r.intrinsics;\n  initializeIntrinsics(i, r);\n  // TODO: Find a way to let different environments initialize their own global\n  // object for special magic host objects such as the window object in the DOM.\n  r.$GlobalObject = new ObjectValue(r, i.ObjectPrototype, \"global\");\n  initializeGlobal(r);\n  for (let name in evaluators) r.evaluators[name] = evaluators[name];\n  r.simplifyAndRefineAbstractValue = simplifyAndRefineAbstractValue.bind(null, r, false);\n  r.simplifyAndRefineAbstractCondition = simplifyAndRefineAbstractValue.bind(null, r, true);\n  r.$GlobalEnv = Environment.NewGlobalEnvironment(r, r.$GlobalObject, r.$GlobalObject);\n  return r;\n}\n"
  },
  {
    "path": "src/debugger/adapter/DebugAdapter.js",
    "content": "/**\n * Copyright (c) 2017-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n/* @flow strict-local */\n\nimport { DebugSession, InitializedEvent, OutputEvent, TerminatedEvent, StoppedEvent } from \"vscode-debugadapter\";\nimport * as DebugProtocol from \"vscode-debugprotocol\";\nimport { AdapterChannel } from \"./channel/AdapterChannel.js\";\nimport invariant from \"./../common/invariant.js\";\nimport { DebugMessage } from \"./../common/channel/DebugMessage.js\";\nimport type {\n  Breakpoint,\n  DebuggerResponse,\n  LaunchRequestArguments,\n  PrepackLaunchArguments,\n} from \"./../common/types.js\";\nimport { DebuggerConstants } from \"./../common/DebuggerConstants.js\";\nimport { DebuggerError } from \"./../common/DebuggerError.js\";\n\n/* An implementation of an debugger adapter adhering to the VSCode Debug protocol\n * The adapter is responsible for communication between the UI and Prepack\n*/\nclass PrepackDebugSession extends DebugSession {\n  /**\n   * Creates a new debug adapter that is used for one debug session.\n   * We configure the default implementation of a debug adapter here.\n   */\n  constructor() {\n    super();\n    this.setDebuggerLinesStartAt1(true);\n    this.setDebuggerColumnsStartAt1(true);\n  }\n  _clientID: void | string;\n  _adapterChannel: void | AdapterChannel;\n\n  _generateDebugFilePath(direction: \"in\" | \"out\") {\n    let time = Date.now();\n    let filePath = \"/tmp/\";\n    if (direction === \"in\") {\n      filePath += `prepack-debug-engine2adapter-${time}.txt`;\n    } else {\n      filePath += `prepack-debug-adapter2engine-${time}.txt`;\n    }\n    return filePath;\n  }\n\n  _registerMessageCallbacks() {\n    this._ensureAdapterChannelCreated(\"registerMessageCallbacks\");\n    invariant(this._adapterChannel !== undefined, \"Adapter Channel used before it was created, in debugger.\");\n    // Create local copy to ensure external functions don't modify the adapterChannel, satisfy flow.\n    let localCopyAdapterChannel = this._adapterChannel;\n    localCopyAdapterChannel.registerChannelEvent(DebugMessage.STOPPED_RESPONSE, (response: DebuggerResponse) => {\n      let result = response.result;\n      invariant(result.kind === \"stopped\");\n      let message = `${result.reason}: ${result.filePath} ${result.line}:${result.column}`;\n      // Append message if there exists one (for Prepack errors)\n      if (result.message !== undefined) {\n        message += `. ${result.message}`;\n      }\n      this.sendEvent(new StoppedEvent(message, DebuggerConstants.PREPACK_THREAD_ID));\n    });\n    localCopyAdapterChannel.registerChannelEvent(DebugMessage.STEPINTO_RESPONSE, (response: DebuggerResponse) => {\n      let result = response.result;\n      invariant(result.kind === \"stepInto\");\n      this.sendEvent(\n        new StoppedEvent(\n          \"Stepped into \" + `${result.filePath} ${result.line}:${result.column}`,\n          DebuggerConstants.PREPACK_THREAD_ID\n        )\n      );\n    });\n  }\n\n  /**\n   * The 'initialize' request is the first request called by the UI\n   * to interrogate the features the debug adapter provides.\n   */\n  // Override\n  initializeRequest(response: DebugProtocol.InitializeResponse, args: DebugProtocol.InitializeRequestArguments): void {\n    this._clientID = args.clientID;\n    response.body = response.body || {};\n    response.body.supportsConfigurationDoneRequest = true;\n    // Respond back to the UI with the configurations. Will add more configurations gradually as needed.\n    // Adapter can respond immediately here because no message is sent to Prepack\n    this.sendResponse(response);\n  }\n\n  // Override\n  configurationDoneRequest(\n    response: DebugProtocol.ConfigurationDoneResponse,\n    args: DebugProtocol.ConfigurationDoneArguments\n  ): void {\n    // initial handshake with UI is complete\n    if (this._clientID !== DebuggerConstants.CLI_CLIENTID) {\n      this._ensureAdapterChannelCreated(\"configurationDoneRequest\");\n      invariant(this._adapterChannel !== undefined, \"Adapter Channel used before it was created, in debugger.\");\n      // for all ui except the CLI, autosend the first run request\n      this._adapterChannel.run(DebuggerConstants.DEFAULT_REQUEST_ID, (runResponse: DebuggerResponse) => {});\n    }\n    this.sendResponse(response);\n  }\n\n  // Override\n  launchRequest(response: DebugProtocol.LaunchResponse, args: LaunchRequestArguments): void {\n    let inFilePath = this._generateDebugFilePath(\"in\");\n    let outFilePath = this._generateDebugFilePath(\"out\");\n    // Set up the communication channel to the debugger.\n    let adapterChannel = new AdapterChannel(inFilePath, outFilePath);\n    this._adapterChannel = adapterChannel;\n    this._registerMessageCallbacks();\n    let launchArgs: PrepackLaunchArguments = {\n      kind: \"launch\",\n      sourceFiles: args.sourceFiles,\n      prepackRuntime: args.prepackRuntime,\n      prepackArguments: args.prepackArguments,\n      debugInFilePath: inFilePath,\n      debugOutFilePath: outFilePath,\n      outputCallback: (data: Buffer) => {\n        let outputEvent = new OutputEvent(data.toString(), \"stdout\");\n        this.sendEvent(outputEvent);\n      },\n      exitCallback: () => {\n        this.sendEvent(new TerminatedEvent());\n        process.exit();\n      },\n    };\n\n    adapterChannel.launch(response.request_seq, launchArgs, (dbgResponse: DebuggerResponse) => {\n      this.sendResponse(response);\n    });\n\n    // Important: InitializedEvent indicates to the protocol that further requests (e.g. breakpoints, execution control)\n    // are ready to be received. Prepack debugger is not ready to receive these requests until the Adapter Channel\n    // has been created and Prepack has been launched. Thus, the InitializedEvent is sent after Prepack launch and\n    // the creation of the Adapter Channel.\n    this.sendEvent(new InitializedEvent());\n  }\n\n  /**\n   * Request Prepack to continue running when it is stopped\n   */\n  // Override\n  continueRequest(response: DebugProtocol.ContinueResponse, args: DebugProtocol.ContinueArguments): void {\n    // send a Run request to Prepack and try to send the next request\n    this._ensureAdapterChannelCreated(\"continueRequest\");\n    invariant(this._adapterChannel !== undefined, \"Adapter Channel used before it was created, in debugger.\");\n    this._adapterChannel.run(response.request_seq, (dbgResponse: DebuggerResponse) => {\n      this.sendResponse(response);\n    });\n  }\n\n  // Override\n  setBreakPointsRequest(\n    response: DebugProtocol.SetBreakpointsResponse,\n    args: DebugProtocol.SetBreakpointsArguments\n  ): void {\n    if (args.source.path === undefined || args.breakpoints === undefined) return;\n    let filePath = args.source.path;\n    let breakpointInfos = [];\n    for (const breakpoint of args.breakpoints) {\n      let line = breakpoint.line;\n      let column = 0;\n      if (breakpoint.column !== undefined) {\n        column = breakpoint.column;\n      }\n      let breakpointInfo: Breakpoint = {\n        kind: \"breakpoint\",\n        requestID: response.request_seq,\n        filePath: filePath,\n        line: line,\n        column: column,\n      };\n      breakpointInfos.push(breakpointInfo);\n    }\n\n    this._ensureAdapterChannelCreated(\"setBreakPointsRequest\");\n    invariant(this._adapterChannel !== undefined, \"Adapter Channel used before it was created, in debugger.\");\n    this._adapterChannel.setBreakpoints(response.request_seq, breakpointInfos, (dbgResponse: DebuggerResponse) => {\n      let result = dbgResponse.result;\n      invariant(result.kind === \"breakpoint-add\");\n      let breakpoints: Array<DebugProtocol.Breakpoint> = [];\n      for (const breakpointInfo of result.breakpoints) {\n        let source: DebugProtocol.Source = {\n          path: breakpointInfo.filePath,\n        };\n        let breakpoint: DebugProtocol.Breakpoint = {\n          verified: true,\n          source: source,\n          line: breakpointInfo.line,\n          column: breakpointInfo.column,\n        };\n        breakpoints.push(breakpoint);\n      }\n      response.body = {\n        breakpoints: breakpoints,\n      };\n      this.sendResponse(response);\n    });\n  }\n\n  // Override\n  stackTraceRequest(response: DebugProtocol.StackTraceResponse, args: DebugProtocol.StackTraceArguments): void {\n    this._ensureAdapterChannelCreated(\"stackTraceRequest\");\n    invariant(this._adapterChannel !== undefined);\n    this._adapterChannel.getStackFrames(response.request_seq, (dbgResponse: DebuggerResponse) => {\n      let result = dbgResponse.result;\n      invariant(result.kind === \"stackframe\");\n      let frameInfos = result.stackframes;\n      let frames: Array<DebugProtocol.StackFrame> = [];\n      for (const frameInfo of frameInfos) {\n        let source: DebugProtocol.Source = {\n          path: frameInfo.fileName,\n        };\n        let frame: DebugProtocol.StackFrame = {\n          id: frameInfo.id,\n          name: frameInfo.functionName,\n          source: source,\n          line: frameInfo.line,\n          column: frameInfo.column,\n        };\n        frames.push(frame);\n      }\n      response.body = {\n        stackFrames: frames,\n      };\n      this.sendResponse(response);\n    });\n  }\n\n  // Override\n  threadsRequest(response: DebugProtocol.ThreadsResponse): void {\n    // There will only be 1 thread, so respond immediately\n    let thread: DebugProtocol.Thread = {\n      id: DebuggerConstants.PREPACK_THREAD_ID,\n      name: \"main\",\n    };\n    response.body = {\n      threads: [thread],\n    };\n    this.sendResponse(response);\n  }\n\n  // Override\n  scopesRequest(response: DebugProtocol.ScopesResponse, args: DebugProtocol.ScopesArguments): void {\n    this._ensureAdapterChannelCreated(\"scopesRequest\");\n    invariant(this._adapterChannel !== undefined, \"Adapter Channel used before it was created, in debugger.\");\n    this._adapterChannel.getScopes(response.request_seq, args.frameId, (dbgResponse: DebuggerResponse) => {\n      let result = dbgResponse.result;\n      invariant(result.kind === \"scopes\");\n      let scopeInfos = result.scopes;\n      let scopes: Array<DebugProtocol.Scope> = [];\n      for (const scopeInfo of scopeInfos) {\n        let scope: DebugProtocol.Scope = {\n          name: scopeInfo.name,\n          variablesReference: scopeInfo.variablesReference,\n          expensive: scopeInfo.expensive,\n        };\n        scopes.push(scope);\n      }\n      response.body = {\n        scopes: scopes,\n      };\n      this.sendResponse(response);\n    });\n  }\n\n  // Override\n  variablesRequest(response: DebugProtocol.VariablesResponse, args: DebugProtocol.VariablesArguments): void {\n    this._ensureAdapterChannelCreated(\"variablesRequest\");\n    invariant(this._adapterChannel !== undefined, \"Adapter Channel used before it was created, in debugger.\");\n    this._adapterChannel.getVariables(\n      response.request_seq,\n      args.variablesReference,\n      (dbgResponse: DebuggerResponse) => {\n        let result = dbgResponse.result;\n        invariant(result.kind === \"variables\");\n        let variableInfos = result.variables;\n        let variables: Array<DebugProtocol.Variable> = [];\n        for (const varInfo of variableInfos) {\n          let variable: DebugProtocol.Variable = {\n            name: varInfo.name,\n            value: varInfo.value,\n            variablesReference: varInfo.variablesReference,\n          };\n          variables.push(variable);\n        }\n        response.body = {\n          variables: variables,\n        };\n        this.sendResponse(response);\n      }\n    );\n  }\n\n  // Override\n  stepInRequest(response: DebugProtocol.StepInResponse, args: DebugProtocol.StepInArguments): void {\n    this._ensureAdapterChannelCreated(\"stepInRequest\");\n    invariant(this._adapterChannel !== undefined, \"Adapter Channel used before it was created, in debugger.\");\n    this._adapterChannel.stepInto(response.request_seq, (dbgResponse: DebuggerResponse) => {\n      this.sendResponse(response);\n    });\n  }\n\n  // Override\n  nextRequest(response: DebugProtocol.NextResponse, args: DebugProtocol.NextArguments): void {\n    this._ensureAdapterChannelCreated(\"nextRequest\");\n    invariant(this._adapterChannel !== undefined, \"Adapter Channel used before it was created, in debugger.\");\n    this._adapterChannel.stepOver(response.request_seq, (dbgResponse: DebuggerResponse) => {\n      this.sendResponse(response);\n    });\n  }\n\n  // Override\n  stepOutRequest(response: DebugProtocol.StepOutResponse, args: DebugProtocol.StepOutArguments): void {\n    this._ensureAdapterChannelCreated(\"stepOutRequest\");\n    invariant(this._adapterChannel !== undefined, \"Adapter Channel used before it was created, in debugger.\");\n    this._adapterChannel.stepOut(response.request_seq, (dbgResponse: DebuggerResponse) => {\n      this.sendResponse(response);\n    });\n  }\n\n  // Override\n  evaluateRequest(response: DebugProtocol.EvaluateResponse, args: DebugProtocol.EvaluateArguments): void {\n    this._ensureAdapterChannelCreated(\"evaluateRequest\");\n    invariant(this._adapterChannel !== undefined, \"Adapter Channel used before it was created, in debugger.\");\n    this._adapterChannel.evaluate(\n      response.request_seq,\n      args.frameId,\n      args.expression,\n      (dbgResponse: DebuggerResponse) => {\n        let evalResult = dbgResponse.result;\n        invariant(evalResult.kind === \"evaluate\");\n        response.body = {\n          result: evalResult.displayValue,\n          type: evalResult.type,\n          variablesReference: evalResult.variablesReference,\n        };\n        this.sendResponse(response);\n      }\n    );\n  }\n\n  _ensureAdapterChannelCreated(callingRequest: string) {\n    // All responses that involve the Adapter Channel should only be invoked\n    // after the channel has been created. If this ordering is perturbed,\n    // there was likely a change in the protocol implementation by Nuclide.\n    if (this._adapterChannel === undefined) {\n      throw new DebuggerError(\n        \"Startup Error\",\n        `Adapter Channel in Debugger is being used before it has been created. Caused by ${callingRequest}.`\n      );\n    }\n  }\n}\n\nDebugSession.run(PrepackDebugSession);\n"
  },
  {
    "path": "src/debugger/adapter/channel/AdapterChannel.js",
    "content": "/**\n * Copyright (c) 2017-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n/* @flow */\nimport { FileIOWrapper } from \"./../../common/channel/FileIOWrapper.js\";\nimport { MessageMarshaller } from \"./../../common/channel/MessageMarshaller.js\";\nimport Queue from \"queue-fifo\";\nimport EventEmitter from \"events\";\nimport invariant from \"./../../common/invariant.js\";\nimport { DebugMessage } from \"./../../common/channel/DebugMessage.js\";\nimport child_process from \"child_process\";\nimport type { Breakpoint, DebuggerResponse, PrepackLaunchArguments } from \"./../../common/types.js\";\n\n//Channel used by the debug adapter to communicate with Prepack\nexport class AdapterChannel {\n  constructor(inFilePath: string, outFilePath: string) {\n    this._ioWrapper = new FileIOWrapper(true, inFilePath, outFilePath);\n    this._marshaller = new MessageMarshaller();\n    this._queue = new Queue();\n    this._pendingRequestCallbacks = new Map();\n    this._eventEmitter = new EventEmitter();\n  }\n  _ioWrapper: FileIOWrapper;\n  _marshaller: MessageMarshaller;\n  _queue: Queue;\n  _pendingRequestCallbacks: Map<number, (DebuggerResponse) => void>;\n  _prepackWaiting: boolean;\n  _eventEmitter: EventEmitter;\n  _prepackProcess: child_process.ChildProcess;\n\n  // Error handler for errors in files from the adapter channel\n  _handleFileReadError(err: ?ErrnoError): void {\n    console.error(err);\n    process.exit(1);\n  }\n\n  _processPrepackMessage(message: string): void {\n    let dbgResponse = this._marshaller.unmarshallResponse(message);\n    if (dbgResponse.result.kind === \"breakpoint-add\") {\n      this._eventEmitter.emit(DebugMessage.BREAKPOINT_ADD_ACKNOWLEDGE, dbgResponse.id, dbgResponse);\n    } else if (dbgResponse.result.kind === \"stopped\") {\n      this._eventEmitter.emit(DebugMessage.STOPPED_RESPONSE, dbgResponse);\n    } else if (dbgResponse.result.kind === \"stepInto\") {\n      this._eventEmitter.emit(DebugMessage.STEPINTO_RESPONSE, dbgResponse);\n    }\n    this._prepackWaiting = true;\n    this._processRequestCallback(dbgResponse);\n    this.trySendNextRequest();\n  }\n\n  // Check to see if the next request to Prepack can be sent and send it if so\n  trySendNextRequest(): boolean {\n    // check to see if Prepack is ready to accept another request\n    if (!this._prepackWaiting) return false;\n    // check that there is a message to send\n    if (this._queue.isEmpty()) return false;\n    let request = this._queue.dequeue();\n    this.listenOnFile(this._processPrepackMessage.bind(this));\n    this.writeOut(request);\n    this._prepackWaiting = false;\n    return true;\n  }\n\n  _addRequestCallback(requestID: number, callback: DebuggerResponse => void): void {\n    invariant(!this._pendingRequestCallbacks.has(requestID), \"Request ID already exists in pending requests\");\n    this._pendingRequestCallbacks.set(requestID, callback);\n  }\n\n  _processRequestCallback(response: DebuggerResponse): void {\n    let callback = this._pendingRequestCallbacks.get(response.id);\n    invariant(callback !== undefined, \"Request ID does not exist in pending requests: \" + response.id);\n    callback(response);\n    this._pendingRequestCallbacks.delete(response.id);\n  }\n\n  registerChannelEvent(event: string, listener: (response: DebuggerResponse) => void): void {\n    this._eventEmitter.addListener(event, listener);\n  }\n\n  launch(requestID: number, args: PrepackLaunchArguments, callback: DebuggerResponse => void): void {\n    this.sendDebuggerStart(requestID);\n    this.listenOnFile(this._processPrepackMessage.bind(this));\n    let prepackCommand = args.sourceFiles.concat(args.prepackArguments);\n    // Note: here the input file for the adapter is the output file for Prepack, and vice versa.\n    prepackCommand = prepackCommand.concat([\n      \"--debugInFilePath\",\n      args.debugOutFilePath,\n      \"--debugOutFilePath\",\n      args.debugInFilePath,\n    ]);\n\n    let runtime = \"prepack\";\n    if (args.prepackRuntime.length > 0) {\n      // user specified a Prepack path\n      runtime = \"node\";\n      // Increase node's memory allowance so Prepack can handle large inputs\n      prepackCommand = [\"--max_old_space_size=8192\", \"--stack_size=10000\"]\n        .concat([args.prepackRuntime])\n        .concat(prepackCommand);\n    }\n    this._prepackProcess = child_process.spawn(runtime, prepackCommand);\n\n    process.on(\"exit\", () => {\n      this._prepackProcess.kill();\n      this.clean();\n      process.exit();\n    });\n\n    process.on(\"SIGINT\", () => {\n      this._prepackProcess.kill();\n      process.exit();\n    });\n\n    this._prepackProcess.stdout.on(\"data\", args.outputCallback);\n\n    this._prepackProcess.on(\"exit\", args.exitCallback);\n    this._addRequestCallback(requestID, callback);\n  }\n\n  run(requestID: number, callback: DebuggerResponse => void): void {\n    this._queue.enqueue(this._marshaller.marshallContinueRequest(requestID));\n    this.trySendNextRequest();\n    this._addRequestCallback(requestID, callback);\n  }\n\n  setBreakpoints(requestID: number, breakpoints: Array<Breakpoint>, callback: DebuggerResponse => void): void {\n    this._queue.enqueue(this._marshaller.marshallSetBreakpointsRequest(requestID, breakpoints));\n    this.trySendNextRequest();\n    this._addRequestCallback(requestID, callback);\n  }\n\n  getStackFrames(requestID: number, callback: DebuggerResponse => void): void {\n    this._queue.enqueue(this._marshaller.marshallStackFramesRequest(requestID));\n    this.trySendNextRequest();\n    this._addRequestCallback(requestID, callback);\n  }\n\n  getScopes(requestID: number, frameId: number, callback: DebuggerResponse => void): void {\n    this._queue.enqueue(this._marshaller.marshallScopesRequest(requestID, frameId));\n    this.trySendNextRequest();\n    this._addRequestCallback(requestID, callback);\n  }\n\n  getVariables(requestID: number, variablesReference: number, callback: DebuggerResponse => void): void {\n    this._queue.enqueue(this._marshaller.marshallVariablesRequest(requestID, variablesReference));\n    this.trySendNextRequest();\n    this._addRequestCallback(requestID, callback);\n  }\n\n  stepInto(requestID: number, callback: DebuggerResponse => void): void {\n    this._queue.enqueue(this._marshaller.marshallStepIntoRequest(requestID));\n    this.trySendNextRequest();\n    this._addRequestCallback(requestID, callback);\n  }\n\n  stepOver(requestID: number, callback: DebuggerResponse => void): void {\n    this._queue.enqueue(this._marshaller.marshallStepOverRequest(requestID));\n    this.trySendNextRequest();\n    this._addRequestCallback(requestID, callback);\n  }\n\n  stepOut(requestID: number, callback: DebuggerResponse => void): void {\n    this._queue.enqueue(this._marshaller.marshallStepOutRequest(requestID));\n    this.trySendNextRequest();\n    this._addRequestCallback(requestID, callback);\n  }\n\n  evaluate(requestID: number, frameId: void | number, expression: string, callback: DebuggerResponse => void): void {\n    this._queue.enqueue(this._marshaller.marshallEvaluateRequest(requestID, frameId, expression));\n    this.trySendNextRequest();\n    this._addRequestCallback(requestID, callback);\n  }\n\n  writeOut(contents: string): void {\n    this._ioWrapper.writeOutSync(contents);\n  }\n\n  sendDebuggerStart(requestID: number): void {\n    this.writeOut(this._marshaller.marshallDebuggerStart(requestID));\n  }\n\n  listenOnFile(messageProcessor: (message: string) => void): void {\n    this._ioWrapper.readIn(this._handleFileReadError.bind(this), messageProcessor);\n  }\n\n  clean(): void {\n    this._ioWrapper.clearInFile();\n    this._ioWrapper.clearOutFile();\n  }\n}\n"
  },
  {
    "path": "src/debugger/common/DebuggerConstants.js",
    "content": "/**\n * Copyright (c) 2017-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n/* @flow strict */\n\nexport class DebuggerConstants {\n  // request ID used between the debug adapter and Prepack when there is no\n  // corresponding command from the UI. Currently, this is only used on starting\n  // up Prepack\n  static DEFAULT_REQUEST_ID: number = 0;\n\n  // some requests/responses require a thread ID according to vscode protocol\n  // since Prepack only has 1 thread, we use this constant where a thread ID\n  // is required\n  static PREPACK_THREAD_ID: number = 1;\n\n  // clientID used in initialize requests by the CLI\n  static CLI_CLIENTID: string = \"Prepack-Debugger-CLI\";\n}\n"
  },
  {
    "path": "src/debugger/common/DebuggerError.js",
    "content": "/**\n * Copyright (c) 2017-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n/* @flow strict */\n\n// More error types will be added as needed\nexport type DebuggerErrorType = \"Invalid command\" | \"Invalid response\" | \"Startup Error\" | \"Invalid input\";\n\nexport class DebuggerError extends Error {\n  constructor(errorType: DebuggerErrorType, message: string) {\n    super(`${errorType}: ${message}`);\n    this.errorType = errorType;\n    this.message = message;\n  }\n  errorType: DebuggerErrorType;\n  message: string;\n}\n"
  },
  {
    "path": "src/debugger/common/channel/DebugMessage.js",
    "content": "/**\n * Copyright (c) 2017-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n/* @flow strict */\n\n//A collection of messages used between Prepack and the debug adapter\nexport class DebugMessage {\n  /* Messages from adapter to Prepack */\n  // Tell Prepack a debugger is present\n  static DEBUGGER_ATTACHED: string = \"DebuggerAttached\";\n  // Command Prepack to keep running\n  static PREPACK_RUN_COMMAND: string = \"PrepackRun\";\n  // Command to set a breakpoint\n  static BREAKPOINT_ADD_COMMAND: string = \"Breakpoint-add-command\";\n  // Command to remove a breakpoint\n  static BREAKPOINT_REMOVE_COMMAND: string = \"Breakpoint-remove-command\";\n  // Command to enable a breakpoint\n  static BREAKPOINT_ENABLE_COMMAND: string = \"Breakpoint-enable-command\";\n  // Command to disable a breakpoint\n  static BREAKPOINT_DISABLE_COMMAND: string = \"Breakpoint-disable-command\";\n  // Command to fetch stack frames\n  static STACKFRAMES_COMMAND: string = \"Stackframes-command\";\n  // Command to fetch scopes\n  static SCOPES_COMMAND: string = \"Scopes-command\";\n  // Command to fetch variables\n  static VARIABLES_COMMAND: string = \"Variables-command\";\n  // Command to step into a function\n  static STEPINTO_COMMAND: string = \"StepInto-command\";\n  // Command to step over a function\n  static STEPOVER_COMMAND: string = \"StepOver-command\";\n  // Command to step out of an executing function\n  static STEPOUT_COMMAND: string = \"StepOut-command\";\n  // Command to evaluate an expression\n  static EVALUATE_COMMAND: string = \"Evaluate-command\";\n\n  /* Messages from Prepack to adapter with requested information */\n  // Respond to the adapter that Prepack is ready\n  static PREPACK_READY_RESPONSE: string = \"PrepackReady\";\n  // Respond to the adapter that Prepack is finished\n  static PREPACK_FINISH_RESPONSE: string = \"PrepackFinish\";\n  // Respond to the adapter that Prepack has stopped\n  static STOPPED_RESPONSE: string = \"Stopped-response\";\n  // Respond to the adapter with the request stackframes\n  static STACKFRAMES_RESPONSE: string = \"Stackframes-response\";\n  // Respond to the adapter with the requested scopes\n  static SCOPES_RESPONSE: string = \"Scopes-response\";\n  // Respond to the adapter with the requested variables\n  static VARIABLES_RESPONSE: string = \"Variables-response\";\n  // Respond to the adapter with the stepped in location\n  static STEPINTO_RESPONSE: string = \"StepInto-response\";\n  // Respond to the adapter with the evaluation results\n  static EVALUATE_RESPONSE: string = \"Evaluate-response\";\n\n  /* Messages from Prepack to adapter to acknowledge having received the request */\n  // Acknowledgement for setting a breakpoint\n  static BREAKPOINT_ADD_ACKNOWLEDGE: string = \"Breakpoint-add-acknowledge\";\n  // Acknowledgement for removing a breakpoint\n  static BREAKPOINT_REMOVE_ACKNOWLEDGE: string = \"Breakpoint-remove-acknowledge\";\n  // Acknowledgement for enabling a breakpoint\n  static BREAKPOINT_ENABLE_ACKNOWLEDGE: string = \"Breakpoint-enable-acknowledge\";\n  // Acknoledgement for disabling a breakpoint\n  static BREAKPOINT_DISABLE_ACKNOWLEDGE: string = \"Breakpoint-disable-acknowledge\";\n}\n"
  },
  {
    "path": "src/debugger/common/channel/FileIOWrapper.js",
    "content": "/**\n * Copyright (c) 2017-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n/* @flow strict */\n\nimport fs from \"fs\";\nimport { MessagePackager } from \"./MessagePackager.js\";\nimport invariant from \"../invariant.js\";\n\nexport class FileIOWrapper {\n  constructor(isAdapter: boolean, inFilePath: string, outFilePath: string) {\n    this._inFilePath = inFilePath;\n    this._outFilePath = outFilePath;\n    if (!fs.existsSync(this._inFilePath)) fs.openSync(this._inFilePath, \"w\");\n    if (!fs.existsSync(this._outFilePath)) fs.openSync(this._outFilePath, \"w\");\n    this._packager = new MessagePackager(isAdapter);\n    this._isAdapter = isAdapter;\n  }\n  _inFilePath: string;\n  _outFilePath: string;\n  _packager: MessagePackager;\n  _isAdapter: boolean;\n\n  // Read in a message from the input asynchronously\n  readIn(errorHandler: (err: ?ErrnoError) => void, messageProcessor: (message: string) => void): void {\n    fs.readFile(this._inFilePath, { encoding: \"utf8\" }, (err: ?ErrnoError, contents: string) => {\n      if (err) {\n        errorHandler(err);\n        return;\n      }\n      let message = this._packager.unpackage(contents);\n      if (message === null) {\n        this.readIn(errorHandler, messageProcessor);\n        return;\n      }\n      //clear the file\n      fs.writeFileSync(this._inFilePath, \"\");\n      //process the message\n      messageProcessor(message);\n    });\n  }\n\n  // Read in a message from the input synchronously\n  readInSync(): string {\n    let message: null | string = null;\n    while (true) {\n      let contents = fs.readFileSync(this._inFilePath, \"utf8\");\n      message = this._packager.unpackage(contents);\n      if (message === null) continue;\n      break;\n    }\n    // loop should not break when message is still null\n    invariant(message !== null);\n    //clear the file\n    fs.writeFileSync(this._inFilePath, \"\");\n    return message;\n  }\n\n  // Read in a message from the input synchronously only once\n  readInSyncOnce(): null | string {\n    let contents = fs.readFileSync(this._inFilePath, \"utf8\");\n    let message = this._packager.unpackage(contents);\n    return message;\n  }\n\n  // Write out a message to the output synchronously\n  writeOutSync(contents: string): void {\n    fs.writeFileSync(this._outFilePath, this._packager.package(contents));\n  }\n\n  clearInFile(): void {\n    fs.writeFileSync(this._inFilePath, \"\");\n  }\n\n  clearOutFile(): void {\n    fs.writeFileSync(this._outFilePath, \"\");\n  }\n}\n"
  },
  {
    "path": "src/debugger/common/channel/MessageMarshaller.js",
    "content": "/**\n * Copyright (c) 2017-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n/* @flow strict-local */\nimport { DebugMessage } from \"./DebugMessage.js\";\nimport type {\n  Breakpoint,\n  BreakpointsArguments,\n  ScopesArguments,\n  Stackframe,\n  DebuggerResponse,\n  StackframeResult,\n  BreakpointsAddResult,\n  StoppedResult,\n  ReadyResult,\n  Scope,\n  ScopesResult,\n  Variable,\n  VariablesArguments,\n  VariablesResult,\n  DebuggerRequest,\n  DebuggerRequestArguments,\n  RunArguments,\n  StackframeArguments,\n  StepIntoArguments,\n  StepOverArguments,\n  StepOutArguments,\n  StoppedReason,\n  EvaluateArguments,\n  EvaluateResult,\n} from \"./../types.js\";\nimport invariant from \"./../invariant.js\";\nimport { DebuggerError } from \"./../DebuggerError.js\";\n\nexport class MessageMarshaller {\n  constructor() {\n    this._lastRunRequestID = 0;\n  }\n  _lastRunRequestID: number;\n\n  marshallBreakpointAcknowledge(requestID: number, messageType: string, breakpoints: Array<Breakpoint>): string {\n    return `${requestID} ${messageType} ${JSON.stringify(breakpoints)}`;\n  }\n\n  marshallStoppedResponse(\n    reason: StoppedReason,\n    filePath: string,\n    line: number,\n    column: number,\n    message?: string\n  ): string {\n    let result: StoppedResult = {\n      kind: \"stopped\",\n      reason: reason,\n      filePath: filePath,\n      line: line,\n      column: column,\n      message: message,\n    };\n    return `${this._lastRunRequestID} ${DebugMessage.STOPPED_RESPONSE} ${JSON.stringify(result)}`;\n  }\n\n  marshallDebuggerStart(requestID: number): string {\n    return `${requestID} ${DebugMessage.DEBUGGER_ATTACHED}`;\n  }\n\n  marshallContinueRequest(requestID: number): string {\n    return `${requestID} ${DebugMessage.PREPACK_RUN_COMMAND}`;\n  }\n\n  marshallSetBreakpointsRequest(requestID: number, breakpoints: Array<Breakpoint>): string {\n    return `${requestID} ${DebugMessage.BREAKPOINT_ADD_COMMAND} ${JSON.stringify(breakpoints)}`;\n  }\n\n  marshallStackFramesRequest(requestID: number): string {\n    return `${requestID} ${DebugMessage.STACKFRAMES_COMMAND}`;\n  }\n\n  marshallStackFramesResponse(requestID: number, stackframes: Array<Stackframe>): string {\n    return `${requestID} ${DebugMessage.STACKFRAMES_RESPONSE} ${JSON.stringify(stackframes)}`;\n  }\n\n  marshallScopesRequest(requestID: number, frameId: number): string {\n    return `${requestID} ${DebugMessage.SCOPES_COMMAND} ${frameId}`;\n  }\n\n  marshallScopesResponse(requestID: number, scopes: Array<Scope>): string {\n    return `${requestID} ${DebugMessage.SCOPES_RESPONSE} ${JSON.stringify(scopes)}`;\n  }\n\n  marshallVariablesRequest(requestID: number, variablesReference: number): string {\n    return `${requestID} ${DebugMessage.VARIABLES_COMMAND} ${variablesReference}`;\n  }\n\n  marshallVariablesResponse(requestID: number, variables: Array<Variable>): string {\n    return `${requestID} ${DebugMessage.VARIABLES_RESPONSE} ${JSON.stringify(variables)}`;\n  }\n\n  marshallStepIntoRequest(requestID: number): string {\n    return `${requestID} ${DebugMessage.STEPINTO_COMMAND}`;\n  }\n\n  marshallStepOverRequest(requestID: number): string {\n    return `${requestID} ${DebugMessage.STEPOVER_COMMAND}`;\n  }\n\n  marshallStepOutRequest(requestID: number): string {\n    return `${requestID} ${DebugMessage.STEPOUT_COMMAND}`;\n  }\n\n  marshallEvaluateRequest(requestID: number, frameId: void | number, expression: string): string {\n    let evalArgs: EvaluateArguments = {\n      kind: \"evaluate\",\n      expression: expression,\n    };\n    if (frameId !== undefined) {\n      evalArgs.frameId = frameId;\n    }\n    return `${requestID} ${DebugMessage.EVALUATE_COMMAND} ${JSON.stringify(evalArgs)}`;\n  }\n\n  marshallEvaluateResponse(requestID: number, evalResult: EvaluateResult): string {\n    return `${requestID} ${DebugMessage.EVALUATE_RESPONSE} ${JSON.stringify(evalResult)}`;\n  }\n\n  unmarshallRequest(message: string): DebuggerRequest {\n    let parts = message.split(\" \");\n    // each request must have a length and a command\n    invariant(parts.length >= 2, \"Request is not well formed\");\n    // unique ID for each request\n    let requestID = parseInt(parts[0], 10);\n    invariant(!isNaN(requestID), \"Request ID must be a number\");\n    let command = parts[1];\n    let args: DebuggerRequestArguments;\n    switch (command) {\n      case DebugMessage.PREPACK_RUN_COMMAND:\n        this._lastRunRequestID = requestID;\n        let runArgs: RunArguments = {\n          kind: \"run\",\n        };\n        args = runArgs;\n        break;\n      case DebugMessage.BREAKPOINT_ADD_COMMAND:\n        args = this._unmarshallBreakpointsArguments(requestID, parts.slice(2).join(\" \"));\n        break;\n      case DebugMessage.STACKFRAMES_COMMAND:\n        let stackFrameArgs: StackframeArguments = {\n          kind: \"stackframe\",\n        };\n        args = stackFrameArgs;\n        break;\n      case DebugMessage.SCOPES_COMMAND:\n        args = this._unmarshallScopesArguments(requestID, parts[2]);\n        break;\n      case DebugMessage.VARIABLES_COMMAND:\n        args = this._unmarshallVariablesArguments(requestID, parts[2]);\n        break;\n      case DebugMessage.STEPINTO_COMMAND:\n        this._lastRunRequestID = requestID;\n        let stepIntoArgs: StepIntoArguments = {\n          kind: \"stepInto\",\n        };\n        args = stepIntoArgs;\n        break;\n      case DebugMessage.STEPOVER_COMMAND:\n        this._lastRunRequestID = requestID;\n        let stepOverArgs: StepOverArguments = {\n          kind: \"stepOver\",\n        };\n        args = stepOverArgs;\n        break;\n      case DebugMessage.STEPOUT_COMMAND:\n        this._lastRunRequestID = requestID;\n        let stepOutArgs: StepOutArguments = {\n          kind: \"stepOut\",\n        };\n        args = stepOutArgs;\n        break;\n      case DebugMessage.EVALUATE_COMMAND:\n        args = this._unmarshallEvaluateArguments(requestID, parts.slice(2).join(\" \"));\n        break;\n      default:\n        throw new DebuggerError(\"Invalid command\", \"Invalid command from adapter: \" + command);\n    }\n    invariant(args !== undefined);\n    let result: DebuggerRequest = {\n      id: requestID,\n      command: command,\n      arguments: args,\n    };\n    return result;\n  }\n\n  _unmarshallBreakpointsArguments(requestID: number, responseString: string): BreakpointsArguments {\n    let breakpoints = JSON.parse(responseString);\n    for (const breakpoint of breakpoints) {\n      invariant(breakpoint.hasOwnProperty(\"filePath\"), \"breakpoint missing filePath property\");\n      invariant(breakpoint.hasOwnProperty(\"line\"), \"breakpoint missing line property\");\n      invariant(breakpoint.hasOwnProperty(\"column\"), \"breakpoint missing column property\");\n      invariant(!isNaN(breakpoint.line));\n      invariant(!isNaN(breakpoint.column));\n    }\n    let result: BreakpointsArguments = {\n      kind: \"breakpoint\",\n      breakpoints: breakpoints,\n    };\n    return result;\n  }\n\n  _unmarshallScopesArguments(requestID: number, responseString: string): ScopesArguments {\n    let frameId = parseInt(responseString, 10);\n    invariant(!isNaN(frameId));\n    let result: ScopesArguments = {\n      kind: \"scopes\",\n      frameId: frameId,\n    };\n    return result;\n  }\n\n  _unmarshallVariablesArguments(requestID: number, responseString: string): VariablesArguments {\n    let varRef = parseInt(responseString, 10);\n    invariant(!isNaN(varRef));\n    let result: VariablesArguments = {\n      kind: \"variables\",\n      variablesReference: varRef,\n    };\n    return result;\n  }\n\n  _unmarshallEvaluateArguments(requestID: number, responseString: string): EvaluateArguments {\n    let evalArgs = JSON.parse(responseString);\n    invariant(evalArgs.hasOwnProperty(\"kind\"), \"Evaluate arguments missing kind field\");\n    invariant(evalArgs.hasOwnProperty(\"expression\"), \"Evaluate arguments missing expression field\");\n    if (evalArgs.hasOwnProperty(\"frameId\")) invariant(!isNaN(evalArgs.frameId));\n    return evalArgs;\n  }\n\n  unmarshallResponse(message: string): DebuggerResponse {\n    try {\n      let parts = message.split(\" \");\n      let requestID = parseInt(parts[0], 10);\n      invariant(!isNaN(requestID));\n      let messageType = parts[1];\n      let dbgResult;\n      let resultString = parts.slice(2).join(\" \");\n      if (messageType === DebugMessage.PREPACK_READY_RESPONSE) {\n        dbgResult = this._unmarshallReadyResult();\n      } else if (messageType === DebugMessage.BREAKPOINT_ADD_ACKNOWLEDGE) {\n        dbgResult = this._unmarshallBreakpointsAddResult(resultString);\n      } else if (messageType === DebugMessage.STOPPED_RESPONSE) {\n        dbgResult = this._unmarshallStoppedResult(resultString);\n      } else if (messageType === DebugMessage.STACKFRAMES_RESPONSE) {\n        dbgResult = this._unmarshallStackframesResult(resultString);\n      } else if (messageType === DebugMessage.SCOPES_RESPONSE) {\n        dbgResult = this._unmarshallScopesResult(resultString);\n      } else if (messageType === DebugMessage.VARIABLES_RESPONSE) {\n        dbgResult = this._unmarshallVariablesResult(resultString);\n      } else if (messageType === DebugMessage.EVALUATE_RESPONSE) {\n        dbgResult = this._unmarshallEvaluateResult(resultString);\n      } else {\n        invariant(false, \"Unexpected response type\");\n      }\n\n      let dbgResponse: DebuggerResponse = {\n        id: requestID,\n        result: dbgResult,\n      };\n      return dbgResponse;\n    } catch (e) {\n      throw new DebuggerError(\"Invalid command\", e.message);\n    }\n  }\n\n  _unmarshallStackframesResult(resultString: string): StackframeResult {\n    let frames = JSON.parse(resultString);\n    invariant(Array.isArray(frames), \"Stack frames is not an array\");\n    for (const frame of frames) {\n      invariant(frame.hasOwnProperty(\"id\"), \"Stack frame is missing id\");\n      invariant(frame.hasOwnProperty(\"fileName\"), \"Stack frame is missing filename\");\n      invariant(frame.hasOwnProperty(\"line\"), \"Stack frame is missing line number\");\n      invariant(frame.hasOwnProperty(\"column\"), \"Stack frame is missing column number\");\n      invariant(frame.hasOwnProperty(\"functionName\"), \"Stack frame is missing function name\");\n    }\n    let result: StackframeResult = {\n      kind: \"stackframe\",\n      stackframes: frames,\n    };\n    return result;\n  }\n\n  _unmarshallScopesResult(resultString: string): ScopesResult {\n    let scopes = JSON.parse(resultString);\n    invariant(Array.isArray(scopes), \"Scopes is not an array\");\n    for (const scope of scopes) {\n      invariant(scope.hasOwnProperty(\"name\"), \"Scope is missing name\");\n      invariant(scope.hasOwnProperty(\"variablesReference\"), \"Scope is missing variablesReference\");\n      invariant(scope.hasOwnProperty(\"expensive\"), \"Scope is missing expensive\");\n    }\n    let result: ScopesResult = {\n      kind: \"scopes\",\n      scopes: scopes,\n    };\n    return result;\n  }\n\n  _unmarshallVariablesResult(resultString: string): VariablesResult {\n    let variables = JSON.parse(resultString);\n    invariant(Array.isArray(variables), \"Variables is not an array\");\n    for (const variable of variables) {\n      invariant(variable.hasOwnProperty(\"name\"));\n      invariant(variable.hasOwnProperty(\"value\"));\n      invariant(variable.hasOwnProperty(\"variablesReference\"));\n    }\n    let result: VariablesResult = {\n      kind: \"variables\",\n      variables: variables,\n    };\n    return result;\n  }\n\n  _unmarshallEvaluateResult(resultString: string): EvaluateResult {\n    let evalResult = JSON.parse(resultString);\n    invariant(evalResult.hasOwnProperty(\"kind\"), \"eval result missing kind property\");\n    invariant(evalResult.kind === \"evaluate\", \"eval result is the wrong kind\");\n    invariant(evalResult.hasOwnProperty(\"displayValue\", \"eval result missing display value property\"));\n    invariant(evalResult.hasOwnProperty(\"type\", \"eval result missing type property\"));\n    invariant(evalResult.hasOwnProperty(\"variablesReference\", \"eval result missing variablesReference property\"));\n    return evalResult;\n  }\n\n  _unmarshallBreakpointsAddResult(resultString: string): BreakpointsAddResult {\n    let breakpoints = JSON.parse(resultString);\n    invariant(Array.isArray(breakpoints));\n    for (const breakpoint of breakpoints) {\n      invariant(breakpoint.hasOwnProperty(\"filePath\"), \"breakpoint missing filePath property\");\n      invariant(breakpoint.hasOwnProperty(\"line\"), \"breakpoint missing line property\");\n      invariant(breakpoint.hasOwnProperty(\"column\"), \"breakpoint missing column property\");\n      invariant(!isNaN(breakpoint.line));\n      invariant(!isNaN(breakpoint.column));\n    }\n\n    let result: BreakpointsAddResult = {\n      kind: \"breakpoint-add\",\n      breakpoints: breakpoints,\n    };\n    return result;\n  }\n\n  _unmarshallStoppedResult(resultString: string): StoppedResult {\n    let result = JSON.parse(resultString);\n    invariant(result.kind === \"stopped\");\n    invariant(result.hasOwnProperty(\"reason\"));\n    invariant(result.hasOwnProperty(\"filePath\"));\n    invariant(result.hasOwnProperty(\"line\"));\n    invariant(!isNaN(result.line));\n    invariant(result.hasOwnProperty(\"column\"));\n    invariant(!isNaN(result.column));\n    return result;\n  }\n\n  _unmarshallReadyResult(): ReadyResult {\n    let result: ReadyResult = {\n      kind: \"ready\",\n    };\n    return result;\n  }\n}\n"
  },
  {
    "path": "src/debugger/common/channel/MessagePackager.js",
    "content": "/**\n * Copyright (c) 2017-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n/* @flow strict */\n\nimport invariant from \"../invariant.js\";\n\nconst LENGTH_SEPARATOR = \"--\";\n\n// Package a message sent or unpackage a message received\nexport class MessagePackager {\n  constructor(isAdapter: boolean) {\n    this._isAdapter = isAdapter;\n  }\n  _isAdapter: boolean;\n\n  // package a message to be sent\n  package(contents: string): string {\n    // format: <length>--<contents>\n    return contents.length + LENGTH_SEPARATOR + contents;\n  }\n\n  // unpackage a message received, verify it, and return it\n  // returns null if no message or the message is only partially read\n  // errors if the message violates the format\n  unpackage(contents: string): null | string {\n    // format: <length>--<contents>\n    let separatorIndex = contents.indexOf(LENGTH_SEPARATOR);\n    // if the separator is not written in yet --> partial read\n    if (separatorIndex === -1) {\n      return null;\n    }\n    let messageLength = parseInt(contents.slice(0, separatorIndex), 10);\n    // if the part before the separator is not a valid length, it is a\n    // violation of protocol\n    invariant(!isNaN(messageLength));\n    let startIndex = separatorIndex + LENGTH_SEPARATOR.length;\n    let endIndex = startIndex + messageLength;\n    // there should only be one message in the contents at a time\n    invariant(contents.length <= startIndex + messageLength);\n    // if we didn't read the whole message yet --> partial read\n    if (contents.length < endIndex) {\n      return null;\n    }\n    let message = contents.slice(startIndex, endIndex);\n    return message;\n  }\n}\n"
  },
  {
    "path": "src/debugger/common/invariant.js",
    "content": "/**\n * Copyright (c) 2017-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n/* @flow strict */\n\nexport default function invariant(condition: boolean, format: string): void {\n  if (condition) return;\n\n  let error = new Error(format);\n  error.name = \"Invariant Violation\";\n  throw error;\n}\n"
  },
  {
    "path": "src/debugger/common/types.js",
    "content": "/**\n * Copyright (c) 2017-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n/* @flow strict */\n\nimport * as DebugProtocol from \"vscode-debugprotocol\";\n\nexport type DebuggerRequest = {\n  id: number,\n  command: string,\n  arguments: DebuggerRequestArguments,\n};\n\nexport type DebuggerRequestArguments =\n  | BreakpointsArguments\n  | RunArguments\n  | StackframeArguments\n  | ScopesArguments\n  | VariablesArguments\n  | StepIntoArguments\n  | StepOverArguments\n  | StepOutArguments\n  | EvaluateArguments;\n\nexport type PrepackLaunchArguments = {\n  kind: \"launch\",\n  prepackRuntime: string,\n  prepackArguments: Array<string>,\n  sourceFiles: Array<string>,\n  debugInFilePath: string,\n  debugOutFilePath: string,\n  outputCallback: Buffer => void,\n  exitCallback: () => void,\n};\n\nexport type Breakpoint = {\n  filePath: string,\n  line: number,\n  column: number,\n};\n\nexport type BreakpointsArguments = {\n  kind: \"breakpoint\",\n  breakpoints: Array<Breakpoint>,\n};\n\nexport type RunArguments = {\n  kind: \"run\",\n};\n\nexport type StackframeArguments = {\n  kind: \"stackframe\",\n};\n\nexport type Stackframe = {\n  id: number,\n  fileName: string,\n  line: number,\n  column: number,\n  functionName: string,\n};\n\nexport type ScopesArguments = {\n  kind: \"scopes\",\n  frameId: number,\n};\n\nexport type VariablesArguments = {\n  kind: \"variables\",\n  variablesReference: number,\n};\n\nexport type StepIntoArguments = {\n  kind: \"stepInto\",\n};\n\nexport type StepOverArguments = {\n  kind: \"stepOver\",\n};\n\nexport type StepOutArguments = {\n  kind: \"stepOut\",\n};\n\nexport type EvaluateArguments = {\n  kind: \"evaluate\",\n  frameId?: number,\n  expression: string,\n};\n\nexport type DebuggerResponse = {\n  id: number,\n  result: DebuggerResponseResult,\n};\n\nexport type DebuggerResponseResult =\n  | ReadyResult\n  | StackframeResult\n  | BreakpointsAddResult\n  | StoppedResult\n  | ScopesResult\n  | VariablesResult\n  | EvaluateResult;\n\nexport type ReadyResult = {\n  kind: \"ready\",\n};\n\nexport type StackframeResult = {\n  kind: \"stackframe\",\n  stackframes: Array<Stackframe>,\n};\n\nexport type BreakpointsAddResult = {\n  kind: \"breakpoint-add\",\n  breakpoints: Array<Breakpoint>,\n};\n\nexport type StoppedResult = {\n  kind: \"stopped\",\n  reason: StoppedReason,\n  filePath: string,\n  line: number,\n  column: number,\n  message?: string,\n};\nexport type Scope = {\n  name: string,\n  variablesReference: number,\n  expensive: boolean,\n};\n\nexport type ScopesResult = {\n  kind: \"scopes\",\n  scopes: Array<Scope>,\n};\n\nexport type Variable = {\n  name: string,\n  value: string,\n  variablesReference: number,\n};\n\nexport type VariablesResult = {\n  kind: \"variables\",\n  variables: Array<Variable>,\n};\n\nexport type EvaluateResult = {\n  kind: \"evaluate\",\n  displayValue: string,\n  type: string,\n  variablesReference: number,\n};\n\nexport type LaunchRequestArguments = {\n  ...DebugProtocol.LaunchRequestArguments,\n  noDebug?: boolean,\n  sourceFiles: Array<string>,\n  prepackRuntime: string,\n  prepackArguments: Array<string>,\n};\n\nexport type SteppingType = \"Step Into\" | \"Step Over\" | \"Step Out\";\nexport type StoppedReason = \"Entry\" | \"Breakpoint\" | \"Diagnostic\" | SteppingType;\n\nexport type SourceData = {\n  filePath: string,\n  line: number,\n  column: number,\n  stackSize: number,\n};\n"
  },
  {
    "path": "src/debugger/mock-ui/DataHandler.js",
    "content": "/**\n * Copyright (c) 2017-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n/* @flow strict */\n\n//separator for messages according to the protocol\nconst TWO_CRLF = \"\\r\\n\\r\\n\";\n\nexport class DataHandler {\n  constructor() {\n    this._rawData = new Buffer(0);\n    this._contentLength = -1;\n  }\n  _rawData: Buffer;\n  _contentLength: number;\n\n  handleData(data: Buffer, messageProcessor: (message: string) => void): void {\n    this._rawData = Buffer.concat([this._rawData, data]);\n    // the following code parses a message according to the protocol.\n    while (this._rawData.length > 0) {\n      // if we know what length we are expecting\n      if (this._contentLength >= 0) {\n        // we have enough data to check for the expected message\n        if (this._rawData.byteLength >= this._contentLength) {\n          // first get the expected message\n          let message = this._rawData.toString(\"utf8\", 0, this._contentLength);\n          // reduce the buffer by the message we got\n          this._rawData = this._rawData.slice(this._contentLength);\n          // reset the content length to ensure it is extracted for the next message\n          this._contentLength = -1;\n          // process the message\n          messageProcessor(message);\n          continue; // there may be more complete messages to process\n        }\n      } else {\n        // if we don't know the length to expect, we need to extract it first\n        let idx = this._rawData.indexOf(TWO_CRLF);\n        if (idx !== -1) {\n          let header = this._rawData.toString(\"utf8\", 0, idx);\n          let lines = header.split(\"\\r\\n\");\n          for (let i = 0; i < lines.length; i++) {\n            let pair = lines[i].split(/: +/);\n            if (pair[0] === \"Content-Length\") {\n              this._contentLength = parseInt(pair[1], 10);\n              // reset the contentlength if it is invalid\n              if (isNaN(this._contentLength)) this._contentLength = -1;\n            }\n          }\n          this._rawData = this._rawData.slice(idx + TWO_CRLF.length);\n          continue;\n        }\n        // if we don't find the length we fall through and break\n      }\n      break;\n    }\n  }\n}\n"
  },
  {
    "path": "src/debugger/mock-ui/UISession.js",
    "content": "/**\n * Copyright (c) 2017-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n/* @flow */\n\nimport readline from \"readline\";\nimport child_process from \"child_process\";\nimport * as DebugProtocol from \"vscode-debugprotocol\";\nimport { DataHandler } from \"./DataHandler.js\";\nimport { DebuggerConstants } from \"./../common/DebuggerConstants\";\nimport type { LaunchRequestArguments } from \"./../common/types.js\";\n\nexport type DebuggerCLIArguments = {\n  adapterPath: string,\n  prepackRuntime: string,\n  sourceFiles: Array<string>,\n  prepackArguments: Array<string>,\n};\n\n//separator for messages according to the protocol\nconst TWO_CRLF = \"\\r\\n\\r\\n\";\n\n/* Represents one debugging session in the CLI.\n * Read in user input from the command line, parses the input into commands,\n * sends the commands to the adapter and process any responses\n*/\nexport class UISession {\n  constructor(proc: Process, args: DebuggerCLIArguments) {\n    this._proc = proc;\n    this._adapterPath = args.adapterPath;\n    this._prepackRuntime = args.prepackRuntime;\n    this._sourceFiles = args.sourceFiles;\n    this._prepackArguments = args.prepackArguments;\n    this._sequenceNum = 1;\n    this._invalidCount = 0;\n    this._dataHandler = new DataHandler();\n    this._prepackWaiting = false;\n    this._prepackLaunched = false;\n  }\n  // the parent (i.e. ui) process\n  _proc: Process;\n  //path to the debug adapter\n  _adapterPath: string;\n  // the child (i.e. adapter) process\n  _adapterProcess: child_process.ChildProcess;\n  // id number for each message sent\n  _sequenceNum: number;\n  // interface to read in input from the CLI client\n  _reader: readline.Interface;\n  // number of invalid commands\n  _invalidCount: number;\n  // Prepack runtime command (e.g. lib/prepack-cli.js)\n  _prepackRuntime: string;\n  // Array of input source files to Prepack\n  _sourceFiles: Array<string>;\n  // arguments to start Prepack with\n  _prepackArguments: Array<string>;\n  // handler for any received messages\n  _dataHandler: DataHandler;\n  // flag whether Prepack is waiting for a command\n  _prepackWaiting: boolean;\n  // flag whether Prepack has been launched\n  _prepackLaunched: boolean;\n\n  _startAdapter() {\n    let adapterArgs = [this._adapterPath];\n    this._adapterProcess = child_process.spawn(\"node\", adapterArgs);\n    this._proc.on(\"exit\", () => {\n      this.shutdown();\n    });\n    this._proc.on(\"SIGINT\", () => {\n      this.shutdown();\n    });\n    this._adapterProcess.stdout.on(\"data\", (data: Buffer) => {\n      //handle the received data\n      this._dataHandler.handleData(data, this._processMessage.bind(this));\n    });\n    this._adapterProcess.stderr.on(\"data\", (data: Buffer) => {\n      console.error(data.toString());\n      this.shutdown();\n    });\n  }\n\n  // called from data handler to process a received message\n  _processMessage(message: string): void {\n    try {\n      let msg = JSON.parse(message);\n      if (msg.type === \"event\") {\n        this._processEvent(msg);\n      } else if (msg.type === \"response\") {\n        this._processResponse(msg);\n      }\n    } catch (e) {\n      console.error(e);\n      console.error(\"Invalid message: \" + message.slice(0, 1000));\n    }\n    //ask the user for the next command\n    if (this._prepackLaunched && this._prepackWaiting) {\n      this._reader.question(\"(dbg) \", (input: string) => {\n        this._dispatch(input);\n      });\n    }\n  }\n\n  _processEvent(event: DebugProtocol.Event) {\n    if (event.event === \"initialized\") {\n      // the adapter is ready to accept any persisted debug information\n      // (e.g. persisted breakpoints from previous sessions). the CLI\n      // does not have any persisted info, so we can send configDone immediately\n      let configDoneArgs: DebugProtocol.ConfigurationDoneArguments = {};\n      this._sendConfigDoneRequest(configDoneArgs);\n    } else if (event.event === \"output\") {\n      this._uiOutput(\"Prepack output:\\n\" + event.body.output);\n    } else if (event.event === \"terminated\") {\n      this._uiOutput(\"Prepack exited! Shutting down...\");\n      this.shutdown();\n    } else if (event.event === \"stopped\") {\n      this._prepackWaiting = true;\n      if (event.body) {\n        this._uiOutput(event.body.reason);\n      }\n    }\n  }\n\n  _processResponse(response: DebugProtocol.Response) {\n    if (response.command === \"initialize\") {\n      this._processInitializeResponse(((response: any): DebugProtocol.InitializeResponse));\n    } else if (response.command === \"launch\") {\n      this._processLaunchResponse(((response: any): DebugProtocol.LaunchResponse));\n    } else if (response.command === \"threads\") {\n      this._processThreadsResponse(((response: any): DebugProtocol.ThreadsResponse));\n    } else if (response.command === \"stackTrace\") {\n      //flow doesn't have type refinement for interfaces, so must do a cast here\n      this._processStackTraceResponse(((response: any): DebugProtocol.StackTraceResponse));\n    } else if (response.command === \"scopes\") {\n      this._processScopesResponse(((response: any): DebugProtocol.ScopesResponse));\n    } else if (response.command === \"variables\") {\n      this._processVariablesResponse(((response: any): DebugProtocol.VariablesResponse));\n    } else if (response.command === \"evaluate\") {\n      this._processEvaluateResponse(((response: any): DebugProtocol.EvaluateResponse));\n    }\n  }\n\n  _processScopesResponse(response: DebugProtocol.ScopesResponse) {\n    let scopes = response.body.scopes;\n    for (const scope of scopes) {\n      this._uiOutput(`${scope.name} ${scope.variablesReference}`);\n    }\n  }\n\n  _processInitializeResponse(response: DebugProtocol.InitializeResponse) {\n    let launchArgs: LaunchRequestArguments = {\n      prepackRuntime: this._prepackRuntime,\n      sourceFiles: this._sourceFiles,\n      prepackArguments: this._prepackArguments,\n    };\n    this._sendLaunchRequest(launchArgs);\n  }\n\n  _processLaunchResponse(response: DebugProtocol.LaunchResponse) {\n    this._uiOutput(\"Prepack is ready\");\n    this._prepackLaunched = true;\n    this._prepackWaiting = true;\n    // start reading requests from the user\n    this._reader.question(\"(dbg) \", (input: string) => {\n      this._dispatch(input);\n    });\n  }\n\n  _processStackTraceResponse(response: DebugProtocol.StackTraceResponse) {\n    let frames = response.body.stackFrames;\n    for (const frame of frames) {\n      if (frame.source && frame.source.path) {\n        this._uiOutput(`${frame.id}: ${frame.name} ${frame.source.path} ${frame.line}:${frame.column}`);\n      } else {\n        this._uiOutput(`${frame.id}: ${frame.name} unknown source`);\n      }\n    }\n  }\n\n  _processThreadsResponse(response: DebugProtocol.ThreadsResponse) {\n    for (const thread of response.body.threads) {\n      this._uiOutput(`${thread.id}: ${thread.name}`);\n    }\n  }\n\n  _processVariablesResponse(response: DebugProtocol.VariablesResponse) {\n    for (const variable of response.body.variables) {\n      if (variable.variablesReference === 0) {\n        // 0 means there are not more nested variables to return\n        this._uiOutput(`${variable.name}: ${variable.value}`);\n      } else {\n        this._uiOutput(`${variable.name}: ${variable.value} ${variable.variablesReference}`);\n      }\n    }\n  }\n\n  _processEvaluateResponse(response: DebugProtocol.EvaluateResponse) {\n    let evalInfo = response.body;\n    this._uiOutput(\"Type: \" + (evalInfo.type || \"unknown\"));\n    this._uiOutput(evalInfo.result);\n    this._uiOutput(\"Variables Reference: \" + evalInfo.variablesReference);\n  }\n\n  // execute a command if it is valid\n  // returns whether the command was valid\n  _executeCommand(input: string): boolean {\n    let parts = input.split(\" \");\n    let command = parts[0];\n\n    // for testing purposes, init and configDone are made into user commands\n    // they can be done from the adapter without user input\n\n    switch (command) {\n      case \"run\":\n        // format: run\n        if (parts.length !== 1) return false;\n        let continueArgs: DebugProtocol.ContinueArguments = {\n          // Prepack will only have 1 thread, this argument will be ignored\n          threadId: DebuggerConstants.PREPACK_THREAD_ID,\n        };\n        this._sendContinueRequest(continueArgs);\n        break;\n      case \"breakpoint\":\n        // format: breakpoint add <filePath> <line> ?<column>\n        if (parts.length !== 4 && parts.length !== 5) return false;\n        if (parts[1] === \"add\") {\n          let filePath = parts[2];\n          let line = parseInt(parts[3], 10);\n          if (isNaN(line)) return false;\n          let column = 0;\n          if (parts.length === 5) {\n            column = parseInt(parts[4], 10);\n            if (isNaN(column)) return false;\n          }\n          this._sendBreakpointRequest(filePath, line, column);\n        }\n        break;\n      case \"stackframes\":\n        // format: stackFrames\n        let stackFrameArgs: DebugProtocol.StackTraceArguments = {\n          // Prepack will only have 1 thread, this argument will be ignored\n          threadId: DebuggerConstants.PREPACK_THREAD_ID,\n        };\n        this._sendStackFramesRequest(stackFrameArgs);\n        break;\n      case \"threads\":\n        if (parts.length !== 1) return false;\n        this._sendThreadsRequest();\n        break;\n      case \"scopes\":\n        if (parts.length !== 2) return false;\n        let frameId = parseInt(parts[1], 10);\n        if (isNaN(frameId)) return false;\n        let scopesArgs: DebugProtocol.ScopesArguments = {\n          frameId: frameId,\n        };\n        this._sendScopesRequest(scopesArgs);\n        break;\n      case \"variables\":\n        if (parts.length !== 2) return false;\n        let varRef = parseInt(parts[1], 10);\n        if (isNaN(varRef)) return false;\n        let variableArgs: DebugProtocol.VariablesArguments = {\n          variablesReference: varRef,\n        };\n        this._sendVariablesRequest(variableArgs);\n        break;\n      case \"stepInto\":\n        if (parts.length !== 1) return false;\n        let stepIntoArgs: DebugProtocol.StepInArguments = {\n          threadId: DebuggerConstants.PREPACK_THREAD_ID,\n        };\n        this._sendStepIntoRequest(stepIntoArgs);\n        break;\n      case \"stepOver\":\n        if (parts.length !== 1) return false;\n        let stepOverArgs: DebugProtocol.NextArguments = {\n          threadId: DebuggerConstants.PREPACK_THREAD_ID,\n        };\n        this._sendStepOverRequest(stepOverArgs);\n        break;\n      case \"stepOut\":\n        if (parts.length !== 1) return false;\n        let stepOutArgs: DebugProtocol.StepOutArguments = {\n          threadId: DebuggerConstants.PREPACK_THREAD_ID,\n        };\n        this._sendStepOutRequest(stepOutArgs);\n        break;\n      case \"eval\":\n        if (parts.length < 2) return false;\n        let evalFrameId = parseInt(parts[1], 10);\n        if (isNaN(evalFrameId)) {\n          let expression = parts.slice(1).join(\" \");\n          let evaluateArgs: DebugProtocol.EvaluateArguments = {\n            expression: expression,\n          };\n          this._sendEvaluateRequest(evaluateArgs);\n        } else {\n          let expression = parts.slice(2).join(\" \");\n          let evaluateArgs: DebugProtocol.EvaluateArguments = {\n            expression: expression,\n            frameId: evalFrameId,\n          };\n          this._sendEvaluateRequest(evaluateArgs);\n        }\n        break;\n      default:\n        // invalid command\n        return false;\n    }\n    return true;\n  }\n\n  // parses the user input into a command and executes it\n  _dispatch(input: string) {\n    if (input === \"exit\") {\n      this.shutdown();\n    }\n    let success = this._executeCommand(input);\n    if (!success) {\n      // input was invalid\n      this._invalidCount++;\n      //prevent stack overflow from recursion\n      if (this._invalidCount >= 10) {\n        console.error(\"Too many invalid commands, shutting down...\");\n        this.shutdown();\n      }\n      console.error(\"Invalid command: \" + input);\n      this._reader.question(\"(dbg) \", (line: string) => {\n        this._dispatch(line);\n      });\n    }\n    //reset the invalid command counter\n    this._invalidCount = 0;\n  }\n\n  // tell the adapter about some configuration details\n  _sendInitializeRequest(args: DebugProtocol.InitializeRequestArguments) {\n    let message = {\n      type: \"request\",\n      seq: this._sequenceNum,\n      command: \"initialize\",\n      arguments: args,\n    };\n    let json = JSON.stringify(message);\n    this._packageAndSend(json);\n  }\n\n  // tell the adapter to start Prepack\n  _sendLaunchRequest(args: DebugProtocol.LaunchRequestArguments) {\n    let message = {\n      type: \"request\",\n      seq: this._sequenceNum,\n      command: \"launch\",\n      arguments: args,\n    };\n    let json = JSON.stringify(message);\n    this._packageAndSend(json);\n  }\n\n  // tell the adapter that configuration is done so it can expect other commands\n  _sendConfigDoneRequest(args: DebugProtocol.ConfigurationDoneArguments) {\n    let message = {\n      type: \"request\",\n      seq: this._sequenceNum,\n      command: \"configurationDone\",\n      arguments: args,\n    };\n    let json = JSON.stringify(message);\n    this._packageAndSend(json);\n  }\n\n  // tell the adapter to continue running Prepack\n  _sendContinueRequest(args: DebugProtocol.ContinueArguments) {\n    let message = {\n      type: \"request\",\n      seq: this._sequenceNum,\n      command: \"continue\",\n      arguments: args,\n    };\n    let json = JSON.stringify(message);\n    this._packageAndSend(json);\n    this._prepackWaiting = false;\n  }\n\n  _sendBreakpointRequest(filePath: string, line: number, column: number = 0) {\n    let source: DebugProtocol.Source = {\n      path: filePath,\n    };\n    let breakpoint: DebugProtocol.SourceBreakpoint = {\n      line: line,\n      column: column,\n    };\n    let args: DebugProtocol.SetBreakpointsArguments = {\n      source: source,\n      breakpoints: [breakpoint],\n    };\n    let message = {\n      type: \"request\",\n      seq: this._sequenceNum,\n      command: \"setBreakpoints\",\n      arguments: args,\n    };\n    let json = JSON.stringify(message);\n    this._packageAndSend(json);\n  }\n\n  _sendStackFramesRequest(args: DebugProtocol.StackTraceArguments) {\n    let message = {\n      type: \"request\",\n      seq: this._sequenceNum,\n      command: \"stackTrace\",\n      arguments: args,\n    };\n    let json = JSON.stringify(message);\n    this._packageAndSend(json);\n  }\n\n  _sendThreadsRequest() {\n    let message = {\n      type: \"request\",\n      seq: this._sequenceNum,\n      command: \"threads\",\n    };\n    let json = JSON.stringify(message);\n    this._packageAndSend(json);\n  }\n\n  _sendScopesRequest(args: DebugProtocol.ScopesArguments) {\n    let message = {\n      type: \"request\",\n      seq: this._sequenceNum,\n      command: \"scopes\",\n      arguments: args,\n    };\n    let json = JSON.stringify(message);\n    this._packageAndSend(json);\n  }\n\n  _sendVariablesRequest(args: DebugProtocol.VariablesArguments) {\n    let message = {\n      type: \"request\",\n      seq: this._sequenceNum,\n      command: \"variables\",\n      arguments: args,\n    };\n    let json = JSON.stringify(message);\n    this._packageAndSend(json);\n  }\n\n  _sendStepIntoRequest(args: DebugProtocol.StepInArguments) {\n    let message = {\n      type: \"request\",\n      seq: this._sequenceNum,\n      command: \"stepIn\",\n      arguments: args,\n    };\n    let json = JSON.stringify(message);\n    this._packageAndSend(json);\n  }\n\n  _sendStepOverRequest(args: DebugProtocol.NextArguments) {\n    let message = {\n      type: \"request\",\n      seq: this._sequenceNum,\n      command: \"next\",\n      arguments: args,\n    };\n    let json = JSON.stringify(message);\n    this._packageAndSend(json);\n  }\n\n  _sendStepOutRequest(args: DebugProtocol.StepOutArguments) {\n    let message = {\n      type: \"request\",\n      seq: this._sequenceNum,\n      command: \"stepOut\",\n      arguments: args,\n    };\n    let json = JSON.stringify(message);\n    this._packageAndSend(json);\n  }\n\n  _sendEvaluateRequest(args: DebugProtocol.EvaluateArguments) {\n    let message = {\n      type: \"request\",\n      seq: this._sequenceNum,\n      command: \"evaluate\",\n      arguments: args,\n    };\n    let json = JSON.stringify(message);\n    this._packageAndSend(json);\n  }\n\n  // write out a message to the adapter on stdout\n  _packageAndSend(message: string) {\n    // format: Content-Length: <length> separator <message>\n    this._adapterProcess.stdin.write(\n      \"Content-Length: \" + Buffer.byteLength(message, \"utf8\") + TWO_CRLF + message,\n      \"utf8\"\n    );\n    this._sequenceNum++;\n  }\n\n  _uiOutput(message: string) {\n    console.log(message);\n  }\n\n  serve() {\n    this._uiOutput(\"Debugger is starting up Prepack...\");\n    // Set up the adapter connection\n    this._startAdapter();\n\n    // send an initialize request to the adapter to fetch some configuration details\n    let initArgs: DebugProtocol.InitializeRequestArguments = {\n      // a unique name for each UI (e.g Nuclide, VSCode, CLI)\n      clientID: DebuggerConstants.CLI_CLIENTID,\n      // a unique name for each adapter\n      adapterID: \"Prepack-Debugger-Adapter\",\n      supportsVariableType: true,\n      supportsVariablePaging: false,\n      supportsRunInTerminalRequest: false,\n      pathFormat: \"path\",\n    };\n    this._sendInitializeRequest(initArgs);\n\n    this._reader = readline.createInterface({ input: this._proc.stdin, output: this._proc.stdout });\n  }\n\n  shutdown() {\n    this._reader.close();\n    this._adapterProcess.kill();\n    this._proc.exit(0);\n  }\n}\n"
  },
  {
    "path": "src/debugger/mock-ui/debugger-cli.js",
    "content": "/**\n * Copyright (c) 2017-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n/* @flow strict-local */\n\nimport { UISession } from \"./UISession.js\";\nimport type { DebuggerCLIArguments } from \"./UISession.js\";\n/* The entry point to start up the debugger CLI\n * Reads in command line arguments and starts up a UISession\n*/\n\nfunction run(process, console) {\n  let args = readCLIArguments(process, console);\n  let session = new UISession(process, args);\n  try {\n    session.serve();\n  } catch (e) {\n    console.error(e);\n    session.shutdown();\n  }\n}\n\nfunction readCLIArguments(process, console): DebuggerCLIArguments {\n  let adapterPath = \"\";\n  let prepackRuntime = \"\";\n  let prepackArguments = [];\n  let sourceFiles = [];\n\n  let args = Array.from(process.argv);\n  args.splice(0, 2);\n  //read in the arguments\n  while (args.length > 0) {\n    let arg = args.shift();\n    if (!arg.startsWith(\"--\")) {\n      console.error(\"Invalid argument: \" + arg);\n      process.exit(1);\n    }\n    arg = arg.slice(2); // Slice off the -- prefix\n    if (arg === \"adapterPath\") {\n      adapterPath = args.shift();\n    } else if (arg === \"prepackRuntime\") {\n      prepackRuntime = args.shift();\n    } else if (arg === \"prepackArguments\") {\n      prepackArguments = args.shift().split(\" \");\n    } else if (arg === \"sourceFiles\") {\n      // Support multiple source files.\n      // Assumes everything between --sourceFile and the next --[flag] is a source file.\n      while (!arg.startsWith(\"--\")) {\n        sourceFiles.push(args.shift());\n        if (args.length === 0) break;\n        arg = args[0];\n      }\n    } else if (arg === \"diagnosticSeverity\") {\n      arg = args.shift();\n      if (arg !== \"FatalError\" && arg !== \"RecoverableError\" && arg !== \"Warning\" && arg !== \"Information\") {\n        console.error(\"Invalid debugger diagnostic severity level\");\n      }\n      prepackArguments = prepackArguments.concat([\"--debugDiagnosticSeverity\", `${arg}`]);\n    } else {\n      console.error(\"Unknown argument: \" + arg);\n      process.exit(1);\n    }\n  }\n\n  if (adapterPath.length === 0) {\n    console.error(\"No path to the debug adapter provided!\");\n    process.exit(1);\n  }\n  if (prepackRuntime.length === 0) {\n    console.error(\"No Prepack runtime given to start Prepack\");\n    process.exit(1);\n  }\n  if (sourceFiles.length === 0) {\n    console.error(\"No source code input file provided\");\n  }\n  let result: DebuggerCLIArguments = {\n    adapterPath: adapterPath,\n    prepackRuntime: prepackRuntime,\n    prepackArguments: prepackArguments,\n    sourceFiles: sourceFiles,\n  };\n  return result;\n}\nrun(process, console);\n"
  },
  {
    "path": "src/debugger/server/Breakpoint.js",
    "content": "/**\n * Copyright (c) 2017-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n/* @flow strict */\n\nexport class Breakpoint {\n  constructor(filePath: string, line: number, column: number = 0, temporary: boolean = false, enabled: boolean = true) {\n    this.filePath = filePath;\n    this.line = line;\n    this.temporary = temporary;\n    this.enabled = enabled;\n    this.column = column;\n  }\n  filePath: string;\n  line: number;\n  column: number;\n\n  //real breakpoint set by client or temporary one set by debugger\n  temporary: boolean;\n  enabled: boolean;\n}\n"
  },
  {
    "path": "src/debugger/server/BreakpointManager.js",
    "content": "/**\n * Copyright (c) 2017-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n/* @flow strict-local */\n\nimport { PerFileBreakpointMap } from \"./PerFileBreakpointMap.js\";\nimport { Breakpoint } from \"./Breakpoint.js\";\nimport type { Breakpoint as BreakpointType } from \"./../common/types.js\";\nimport { BabelNode } from \"@babel/types\";\n\n// Storing BreakpointStores for all source files\nexport class BreakpointManager {\n  constructor() {\n    this._breakpointMaps = new Map();\n  }\n  _breakpointMaps: Map<string, PerFileBreakpointMap>;\n\n  getStoppableBreakpoint(ast: BabelNode): void | Breakpoint {\n    if (ast.loc && ast.loc.source !== null) {\n      let location = ast.loc;\n      let filePath = location.source;\n      if (filePath === null) return;\n      let lineNum = location.start.line;\n      let colNum = location.start.column;\n      // Check whether there is a breakpoint we need to stop on here\n      let breakpoint = this._findStoppableBreakpoint(filePath, lineNum, colNum);\n      if (breakpoint === null) return;\n      return breakpoint;\n    }\n  }\n\n  // Try to find a breakpoint at the given location and check if we should stop on it\n  _findStoppableBreakpoint(filePath: string, lineNum: number, colNum: number): null | Breakpoint {\n    let breakpoint = this.getBreakpoint(filePath, lineNum, colNum);\n    if (breakpoint && breakpoint.enabled) {\n      return breakpoint;\n    }\n    return null;\n  }\n\n  addBreakpointMulti(breakpoints: Array<BreakpointType>): void {\n    this._doBreakpointsAction(breakpoints, this._addBreakpoint.bind(this));\n  }\n\n  _addBreakpoint(bp: BreakpointType): void {\n    let breakpointMap = this._breakpointMaps.get(bp.filePath);\n    if (!breakpointMap) {\n      breakpointMap = new PerFileBreakpointMap(bp.filePath);\n      this._breakpointMaps.set(bp.filePath, breakpointMap);\n    }\n    // Nuclide doesn't support column debugging, so set every breakpoint\n    // to column 0 for consistency.\n    breakpointMap.addBreakpoint(bp.line, 0);\n  }\n\n  getBreakpoint(filePath: string, lineNum: number, columnNum: number = 0): void | Breakpoint {\n    let breakpointMap = this._breakpointMaps.get(filePath);\n    if (breakpointMap) return breakpointMap.getBreakpoint(lineNum, columnNum);\n    return undefined;\n  }\n\n  removeBreakpointMulti(breakpoints: Array<BreakpointType>): void {\n    this._doBreakpointsAction(breakpoints, this._removeBreakpoint.bind(this));\n  }\n\n  _removeBreakpoint(bp: BreakpointType): void {\n    let breakpointMap = this._breakpointMaps.get(bp.filePath);\n    if (breakpointMap) breakpointMap.removeBreakpoint(bp.line, bp.column);\n  }\n\n  enableBreakpointMulti(breakpoints: Array<BreakpointType>): void {\n    this._doBreakpointsAction(breakpoints, this._enableBreakpoint.bind(this));\n  }\n\n  _enableBreakpoint(bp: BreakpointType): void {\n    let breakpointMap = this._breakpointMaps.get(bp.filePath);\n    if (breakpointMap) breakpointMap.enableBreakpoint(bp.line, bp.column);\n  }\n\n  disableBreakpointMulti(breakpoints: Array<BreakpointType>): void {\n    this._doBreakpointsAction(breakpoints, this._disableBreakpoint.bind(this));\n  }\n\n  _disableBreakpoint(bp: BreakpointType): void {\n    let breakpointMap = this._breakpointMaps.get(bp.filePath);\n    if (breakpointMap) breakpointMap.disableBreakpoint(bp.line, bp.column);\n  }\n\n  _doBreakpointsAction(breakpoints: Array<BreakpointType>, action: BreakpointType => void): void {\n    for (let bp of breakpoints) {\n      action(bp);\n    }\n  }\n}\n"
  },
  {
    "path": "src/debugger/server/Debugger.js",
    "content": "/**\n * Copyright (c) 2017-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n/* @flow strict-local */\n\nimport { BreakpointManager } from \"./BreakpointManager.js\";\nimport { BabelNode } from \"@babel/types\";\nimport type { BabelNodeSourceLocation } from \"@babel/types\";\nimport invariant from \"../common/invariant.js\";\nimport type { DebugChannel } from \"./channel/DebugChannel.js\";\nimport { DebugMessage } from \"./../common/channel/DebugMessage.js\";\nimport { DebuggerError } from \"./../common/DebuggerError.js\";\nimport type {\n  DebuggerRequest,\n  StackframeArguments,\n  ScopesArguments,\n  Stackframe,\n  Scope,\n  VariablesArguments,\n  EvaluateArguments,\n  SourceData,\n} from \"./../common/types.js\";\nimport type { Realm } from \"./../../realm.js\";\nimport { ExecutionContext } from \"./../../realm.js\";\nimport { VariableManager } from \"./VariableManager.js\";\nimport { SteppingManager } from \"./SteppingManager.js\";\nimport type { StoppableObject } from \"./StopEventManager.js\";\nimport { StopEventManager } from \"./StopEventManager.js\";\nimport {\n  EnvironmentRecord,\n  GlobalEnvironmentRecord,\n  FunctionEnvironmentRecord,\n  DeclarativeEnvironmentRecord,\n  ObjectEnvironmentRecord,\n} from \"./../../environment.js\";\nimport { CompilerDiagnostic } from \"../../errors.js\";\nimport type { Severity } from \"../../errors.js\";\nimport { SourceMapManager } from \"../../utils/SourceMapManager.js\";\nimport type { DebuggerConfigArguments } from \"../../types\";\n\nexport class DebugServer {\n  constructor(channel: DebugChannel, realm: Realm, configArgs: DebuggerConfigArguments) {\n    this._channel = channel;\n    this._realm = realm;\n    this._breakpointManager = new BreakpointManager();\n    this._variableManager = new VariableManager(realm);\n    this._stepManager = new SteppingManager(this._realm, /* default discard old steppers */ false);\n    this._stopEventManager = new StopEventManager();\n    this._diagnosticSeverity = configArgs.diagnosticSeverity || \"FatalError\";\n    this._sourceMapManager = new SourceMapManager(configArgs.buckRoot, configArgs.sourcemaps);\n    this.waitForRun(undefined);\n  }\n  // the collection of breakpoints\n  _breakpointManager: BreakpointManager;\n  // the channel to communicate with the adapter\n  _channel: DebugChannel;\n  _realm: Realm;\n  _variableManager: VariableManager;\n  _stepManager: SteppingManager;\n  _stopEventManager: StopEventManager;\n  _lastExecuted: SourceData;\n  // Severity at which debugger will break when CompilerDiagnostics are generated. Default is Fatal.\n  _diagnosticSeverity: Severity;\n  _sourceMapManager: SourceMapManager;\n\n  /* Block until adapter says to run\n  /* ast: the current ast node we are stopped on\n  /* reason: the reason the debuggee is stopping\n  */\n  waitForRun(loc: void | BabelNodeSourceLocation): void {\n    let keepRunning = false;\n    let request;\n    while (!keepRunning) {\n      request = this._channel.readIn();\n      keepRunning = this.processDebuggerCommand(request, loc);\n    }\n  }\n\n  // Checking if the debugger needs to take any action on reaching this ast node\n  checkForActions(ast: BabelNode): void {\n    if (this._checkAndUpdateLastExecuted(ast)) {\n      let stoppables: Array<StoppableObject> = this._stepManager.getAndDeleteCompletedSteppers(ast);\n      let breakpoint = this._breakpointManager.getStoppableBreakpoint(ast);\n      if (breakpoint) stoppables.push(breakpoint);\n      let reason = this._stopEventManager.getDebuggeeStopReason(ast, stoppables);\n      if (reason) {\n        let location = ast.loc;\n        invariant(location && location.source !== null);\n        let absolutePath = this._sourceMapManager.relativeToAbsolute(location.source);\n        this._channel.sendStoppedResponse(reason, absolutePath, location.start.line, location.start.column);\n        this.waitForRun(location);\n      }\n    }\n  }\n\n  // Process a command from a debugger. Returns whether Prepack should unblock\n  // if it is blocked\n  processDebuggerCommand(request: DebuggerRequest, loc: void | BabelNodeSourceLocation): boolean {\n    let requestID = request.id;\n    let command = request.command;\n    let args = request.arguments;\n    // Convert incoming location sources to relative paths in order to match internal representation of filenames.\n    if (args.kind === \"breakpoint\") {\n      for (let bp of args.breakpoints) {\n        bp.filePath = this._sourceMapManager.absoluteToRelative(bp.filePath);\n      }\n    }\n\n    switch (command) {\n      case DebugMessage.BREAKPOINT_ADD_COMMAND:\n        invariant(args.kind === \"breakpoint\");\n        this._breakpointManager.addBreakpointMulti(args.breakpoints);\n        this._channel.sendBreakpointsAcknowledge(DebugMessage.BREAKPOINT_ADD_ACKNOWLEDGE, requestID, args);\n        break;\n      case DebugMessage.BREAKPOINT_REMOVE_COMMAND:\n        invariant(args.kind === \"breakpoint\");\n        this._breakpointManager.removeBreakpointMulti(args.breakpoints);\n        this._channel.sendBreakpointsAcknowledge(DebugMessage.BREAKPOINT_REMOVE_ACKNOWLEDGE, requestID, args);\n        break;\n      case DebugMessage.BREAKPOINT_ENABLE_COMMAND:\n        invariant(args.kind === \"breakpoint\");\n        this._breakpointManager.enableBreakpointMulti(args.breakpoints);\n        this._channel.sendBreakpointsAcknowledge(DebugMessage.BREAKPOINT_ENABLE_ACKNOWLEDGE, requestID, args);\n        break;\n      case DebugMessage.BREAKPOINT_DISABLE_COMMAND:\n        invariant(args.kind === \"breakpoint\");\n        this._breakpointManager.disableBreakpointMulti(args.breakpoints);\n        this._channel.sendBreakpointsAcknowledge(DebugMessage.BREAKPOINT_DISABLE_ACKNOWLEDGE, requestID, args);\n        break;\n      case DebugMessage.PREPACK_RUN_COMMAND:\n        invariant(args.kind === \"run\");\n        this._onDebuggeeResume();\n        return true;\n      case DebugMessage.STACKFRAMES_COMMAND:\n        invariant(args.kind === \"stackframe\");\n        this.processStackframesCommand(requestID, args, loc);\n        break;\n      case DebugMessage.SCOPES_COMMAND:\n        invariant(args.kind === \"scopes\");\n        this.processScopesCommand(requestID, args);\n        break;\n      case DebugMessage.VARIABLES_COMMAND:\n        invariant(args.kind === \"variables\");\n        this.processVariablesCommand(requestID, args);\n        break;\n      case DebugMessage.STEPINTO_COMMAND:\n        invariant(loc !== undefined);\n        this._stepManager.processStepCommand(\"in\", loc);\n        this._onDebuggeeResume();\n        return true;\n      case DebugMessage.STEPOVER_COMMAND:\n        invariant(loc !== undefined);\n        this._stepManager.processStepCommand(\"over\", loc);\n        this._onDebuggeeResume();\n        return true;\n      case DebugMessage.STEPOUT_COMMAND:\n        invariant(loc !== undefined);\n        this._stepManager.processStepCommand(\"out\", loc);\n        this._onDebuggeeResume();\n        return true;\n      case DebugMessage.EVALUATE_COMMAND:\n        invariant(args.kind === \"evaluate\");\n        this.processEvaluateCommand(requestID, args);\n        break;\n      default:\n        throw new DebuggerError(\"Invalid command\", \"Invalid command from adapter: \" + command);\n    }\n    return false;\n  }\n\n  processStackframesCommand(\n    requestID: number,\n    args: StackframeArguments,\n    astLoc: void | BabelNodeSourceLocation\n  ): void {\n    let frameInfos: Array<Stackframe> = [];\n    let loc = this._getFrameLocation(astLoc ? astLoc : null);\n    let fileName = loc.fileName;\n    let line = loc.line;\n    let column = loc.column;\n\n    // the UI displays the current frame as index 0, so we iterate backwards\n    // from the current frame\n    for (let i = this._realm.contextStack.length - 1; i >= 0; i--) {\n      let frame = this._realm.contextStack[i];\n      let functionName = \"(anonymous function)\";\n      if (frame.function && frame.function.__originalName !== undefined) {\n        functionName = frame.function.__originalName;\n      }\n\n      let frameInfo: Stackframe = {\n        id: this._realm.contextStack.length - 1 - i,\n        functionName: functionName,\n        fileName: this._sourceMapManager.relativeToAbsolute(fileName), // Outward facing paths must be absolute.\n        line: line,\n        column: column,\n      };\n      frameInfos.push(frameInfo);\n      loc = this._getFrameLocation(frame.loc);\n      fileName = loc.fileName;\n      line = loc.line;\n      column = loc.column;\n    }\n    this._channel.sendStackframeResponse(requestID, frameInfos);\n  }\n\n  _getFrameLocation(loc: void | null | BabelNodeSourceLocation): { fileName: string, line: number, column: number } {\n    let fileName = \"unknown\";\n    let line = 0;\n    let column = 0;\n    if (loc && loc.source !== null) {\n      fileName = loc.source;\n      line = loc.start.line;\n      column = loc.start.column;\n    }\n    return {\n      fileName: fileName,\n      line: line,\n      column: column,\n    };\n  }\n\n  processScopesCommand(requestID: number, args: ScopesArguments): void {\n    // first check that frameId is in the valid range\n    if (args.frameId < 0 || args.frameId >= this._realm.contextStack.length) {\n      throw new DebuggerError(\"Invalid command\", \"Invalid frame id for scopes request: \" + args.frameId);\n    }\n    // here the frameId is in reverse order of the contextStack, ie frameId 0\n    // refers to last element of contextStack\n    let stackIndex = this._realm.contextStack.length - 1 - args.frameId;\n    let context = this._realm.contextStack[stackIndex];\n    invariant(context instanceof ExecutionContext);\n    let scopes = [];\n    let lexicalEnv = context.lexicalEnvironment;\n    while (lexicalEnv) {\n      let scope: Scope = {\n        name: this._getScopeName(lexicalEnv.environmentRecord),\n        // key used by UI to retrieve variables in this scope\n        variablesReference: this._variableManager.getReferenceForValue(lexicalEnv),\n        // the variables are easy to retrieve\n        expensive: false,\n      };\n      scopes.push(scope);\n      lexicalEnv = lexicalEnv.parent;\n    }\n    this._channel.sendScopesResponse(requestID, scopes);\n  }\n\n  _getScopeName(envRec: EnvironmentRecord): string {\n    if (envRec instanceof GlobalEnvironmentRecord) {\n      return \"Global\";\n    } else if (envRec instanceof DeclarativeEnvironmentRecord) {\n      if (envRec instanceof FunctionEnvironmentRecord) {\n        let name = envRec.$FunctionObject.__originalName;\n        if (name === undefined) name = \"anonymous function\";\n        return \"Local: \" + name;\n      } else {\n        return \"Block\";\n      }\n    } else if (envRec instanceof ObjectEnvironmentRecord) {\n      return \"With\";\n    } else {\n      invariant(false, \"Invalid type of environment record\");\n    }\n  }\n\n  processVariablesCommand(requestID: number, args: VariablesArguments): void {\n    let variables = this._variableManager.getVariablesByReference(args.variablesReference);\n    this._channel.sendVariablesResponse(requestID, variables);\n  }\n\n  processEvaluateCommand(requestID: number, args: EvaluateArguments): void {\n    let evalResult = this._variableManager.evaluate(args.frameId, args.expression);\n    this._channel.sendEvaluateResponse(requestID, evalResult);\n  }\n\n  // actions that need to happen before Prepack can resume\n  _onDebuggeeResume(): void {\n    // resets the variable manager\n    this._variableManager.clean();\n  }\n\n  /*\n    Returns whether there are more nodes in the ast.\n  */\n  _checkAndUpdateLastExecuted(ast: BabelNode): boolean {\n    if (ast.loc && ast.loc.source !== null) {\n      let filePath = ast.loc.source;\n      let line = ast.loc.start.line;\n      let column = ast.loc.start.column;\n      let stackSize = this._realm.contextStack.length;\n      // Check if the current location is same as the last one.\n      // Does not check columns since column debugging is not supported.\n      // Column support is unnecessary because these nodes will have been sourcemap-translated.\n      // Ignoring columns prevents:\n      //     - Lines with multiple AST nodes from triggering the same breakpoint more than once.\n      //     - Step-out from completing in the same line that it was set in.\n      if (\n        this._lastExecuted &&\n        filePath === this._lastExecuted.filePath &&\n        line === this._lastExecuted.line &&\n        stackSize === this._lastExecuted.stackSize\n      ) {\n        return false;\n      }\n      this._lastExecuted = {\n        filePath: filePath,\n        line: line,\n        column: column,\n        stackSize: this._realm.contextStack.length,\n      };\n      return true;\n    }\n    return false;\n  }\n\n  //  Displays Prepack error message, then waits for user to run the program to continue (similar to a breakpoint).\n  handlePrepackError(diagnostic: CompilerDiagnostic): void {\n    invariant(diagnostic.location && diagnostic.location.source !== null);\n    // The following constructs the message and stop-instruction that is sent to the UI to actually stop the execution.\n    let location = diagnostic.location;\n    let absoluteSource = \"\";\n    if (location.source !== null) absoluteSource = this._sourceMapManager.relativeToAbsolute(location.source);\n    let message = `${diagnostic.severity} ${diagnostic.errorCode}: ${diagnostic.message}`;\n    console.log(message);\n    this._channel.sendStoppedResponse(\n      \"Diagnostic\",\n      absoluteSource,\n      location.start.line,\n      location.start.column,\n      message\n    );\n\n    // The AST Node's location is needed to satisfy the subsequent stackTrace request.\n    this.waitForRun(location);\n  }\n  // Return whether the debugger should stop on a CompilerDiagnostic of a given severity.\n  shouldStopForSeverity(severity: Severity): boolean {\n    switch (this._diagnosticSeverity) {\n      case \"Information\":\n        return true;\n      case \"Warning\":\n        return severity !== \"Information\";\n      case \"RecoverableError\":\n        return severity === \"RecoverableError\" || severity === \"FatalError\";\n      case \"FatalError\":\n        return severity === \"FatalError\";\n      default:\n        invariant(false, \"Unexpected severity type\");\n    }\n  }\n\n  shutdown(): void {\n    // clean the channel pipes\n    this._channel.shutdown();\n  }\n}\n"
  },
  {
    "path": "src/debugger/server/PerFileBreakpointMap.js",
    "content": "/**\n * Copyright (c) 2017-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n/* @flow strict */\n\nimport { Breakpoint } from \"./Breakpoint.js\";\n\n// Storage for all the breakpoints in one source file\n// Each source file will be associated with one PerFileBreakpointMap\nexport class PerFileBreakpointMap {\n  constructor(filePath: string) {\n    this._filePath = filePath;\n    this._breakpoints = new Map();\n  }\n  _filePath: string;\n\n  //map of line:column to Breakpoint objects\n  _breakpoints: Map<string, Breakpoint>;\n\n  addBreakpoint(line: number, column: number = 0, temporary?: boolean, enabled?: boolean): void {\n    let breakpoint = new Breakpoint(this._filePath, line, column, temporary, enabled);\n    let key = this._getKey(line, column);\n    this._breakpoints.set(key, breakpoint);\n  }\n\n  getBreakpoint(line: number, column: number = 0): void | Breakpoint {\n    //check for a column breakpoint first, then line breakpoint\n    if (column !== 0) {\n      let key = this._getKey(line, column);\n      if (this._breakpoints.has(key)) {\n        return this._breakpoints.get(key);\n      } else {\n        key = this._getKey(line, 0);\n        if (this._breakpoints.has(key)) {\n          return this._breakpoints.get(key);\n        }\n      }\n    } else {\n      let key = this._getKey(line, 0);\n      if (this._breakpoints.has(key)) {\n        return this._breakpoints.get(key);\n      }\n    }\n\n    return undefined;\n  }\n\n  removeBreakpoint(line: number, column: number = 0): void {\n    let key = this._getKey(line, column);\n    if (this._breakpoints.has(key)) {\n      this._breakpoints.delete(key);\n    }\n  }\n\n  enableBreakpoint(line: number, column: number = 0): void {\n    let key = this._getKey(line, column);\n    let breakpoint = this._breakpoints.get(key);\n    if (breakpoint) breakpoint.enabled = true;\n  }\n\n  disableBreakpoint(line: number, column: number = 0): void {\n    let key = this._getKey(line, column);\n    let breakpoint = this._breakpoints.get(key);\n    if (breakpoint) breakpoint.enabled = false;\n  }\n\n  _getKey(line: number, column: number): string {\n    return `${line}:${column}`;\n  }\n}\n"
  },
  {
    "path": "src/debugger/server/ReferenceMap.js",
    "content": "/**\n * Copyright (c) 2017-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n/* @flow strict */\n\n// A map with an incrementing counter as the keys\n// Used to store references to variable collections since DebugProtocol\n// specifies fetching variable collections via unique IDs\nexport class ReferenceMap<T> {\n  constructor() {\n    this._counter = 0;\n    this._mapping = new Map();\n  }\n  _counter: number;\n  _mapping: Map<number, T>;\n\n  add(value: T): number {\n    this._counter++;\n    this._mapping.set(this._counter, value);\n    return this._counter;\n  }\n\n  get(reference: number): void | T {\n    return this._mapping.get(reference);\n  }\n\n  clean(): void {\n    this._counter = 0;\n    this._mapping = new Map();\n  }\n}\n"
  },
  {
    "path": "src/debugger/server/Stepper.js",
    "content": "/**\n * Copyright (c) 2017-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n/* @flow strict-local */\nimport type { SourceData } from \"./../common/types.js\";\nimport { BabelNode } from \"@babel/types\";\nimport invariant from \"./../common/invariant.js\";\n\nexport class Stepper {\n  constructor(filePath: string, line: number, column: number, stackSize: number) {\n    this._stepStartData = {\n      filePath: filePath,\n      line: line,\n      column: column,\n      stackSize: stackSize,\n    };\n  }\n  _stepStartData: SourceData;\n\n  isComplete(ast: BabelNode, currentStackSize: number): boolean {\n    invariant(false, \"Abstract method, please override\");\n  }\n\n  // NOTE: Only checks if a node has changed within the same callstack.\n  // The same node in two different excutions contexts (e.g. recursive call)\n  // will not be detected. Check the stackSize (via realm) in those cases.\n  isAstLocationChanged(ast: BabelNode): boolean {\n    let loc = ast.loc;\n    if (!loc) return false;\n    let filePath = loc.source;\n    let line = loc.start.line;\n    let column = loc.start.column;\n    if (filePath === null) return false;\n    if (this._stepStartData) {\n      if (\n        filePath === this._stepStartData.filePath &&\n        line === this._stepStartData.line &&\n        column === this._stepStartData.column\n      ) {\n        return false;\n      }\n    } else {\n      return false;\n    }\n    return true;\n  }\n}\n\nexport class StepIntoStepper extends Stepper {\n  constructor(filePath: string, line: number, column: number, startStackSize: number) {\n    super(filePath, line, column, startStackSize);\n  }\n\n  // Override\n  isComplete(ast: BabelNode, currentStackSize: number): boolean {\n    // If stacksize has changed, the position has changed, regardless if\n    // the AST node is the same (e.g. a recursive call).\n    return this.isAstLocationChanged(ast) || currentStackSize !== this._stepStartData.stackSize;\n  }\n}\n\nexport class StepOverStepper extends Stepper {\n  constructor(filePath: string, line: number, column: number, stackSize: number) {\n    super(filePath, line, column, stackSize);\n  }\n\n  isComplete(ast: BabelNode, currentStackSize: number): boolean {\n    return (\n      // If current stack length < starting stack length, the program either\n      // hit an exception so this stepper is no longer relevant. Or, the program\n      // has stepped out of a function call, back up to the calling function.\n      currentStackSize < this._stepStartData.stackSize ||\n      // If current stack length === starting stack length, the program returned\n      // to the same stack depth. As long as the ast node has changed,\n      // the step over is complete.\n      (currentStackSize === this._stepStartData.stackSize && this.isAstLocationChanged(ast))\n    );\n  }\n}\n\nexport class StepOutStepper extends Stepper {\n  constructor(filePath: string, line: number, column: number, stackSize: number) {\n    super(filePath, line, column, stackSize);\n  }\n\n  isComplete(ast: BabelNode, currentStackSize: number): boolean {\n    // It is not sufficient to simply check if the AST location has changed,\n    // since it is possible in recursive calls to return to the same\n    // AST node, but in a *different* call stack.\n\n    // To step out of a function, we must finish executing it.\n    // When a function completes, its execution context will be\n    // popped off the stack.\n    return currentStackSize < this._stepStartData.stackSize;\n  }\n}\n"
  },
  {
    "path": "src/debugger/server/SteppingManager.js",
    "content": "/**\n * Copyright (c) 2017-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n/* @flow strict-local */\n\nimport { BabelNodeSourceLocation } from \"@babel/types\";\nimport invariant from \"./../common/invariant.js\";\nimport { Stepper, StepIntoStepper, StepOverStepper, StepOutStepper } from \"./Stepper.js\";\nimport type { Realm } from \"./../../realm.js\";\nimport type { StoppableObject } from \"./StopEventManager.js\";\n\nexport class SteppingManager {\n  constructor(realm: Realm, keepOldSteppers?: boolean) {\n    this._realm = realm;\n    this._steppers = [];\n    this._keepOldSteppers = false;\n    if (keepOldSteppers === true) this._keepOldSteppers = true;\n  }\n  _realm: Realm;\n  _keepOldSteppers: boolean;\n  _steppers: Array<Stepper>;\n\n  processStepCommand(kind: \"in\" | \"over\" | \"out\", currentNodeLocation: BabelNodeSourceLocation): void {\n    if (kind === \"in\") {\n      this._processStepIn(currentNodeLocation);\n    } else if (kind === \"over\") {\n      this._processStepOver(currentNodeLocation);\n    } else if (kind === \"out\") {\n      this._processStepOut(currentNodeLocation);\n    } else {\n      invariant(false, `Invalid step type: ${kind}`);\n    }\n  }\n\n  _processStepIn(loc: BabelNodeSourceLocation): void {\n    invariant(loc && loc.source !== null);\n    if (!this._keepOldSteppers) {\n      this._steppers = [];\n    }\n    this._steppers.push(\n      new StepIntoStepper(loc.source, loc.start.line, loc.start.column, this._realm.contextStack.length)\n    );\n  }\n\n  _processStepOver(loc: BabelNodeSourceLocation): void {\n    invariant(loc && loc.source !== null);\n    if (!this._keepOldSteppers) {\n      this._steppers = [];\n    }\n    this._steppers.push(\n      new StepOverStepper(loc.source, loc.start.line, loc.start.column, this._realm.contextStack.length)\n    );\n  }\n\n  _processStepOut(loc: BabelNodeSourceLocation): void {\n    invariant(loc && loc.source !== null);\n    if (!this._keepOldSteppers) {\n      this._steppers = [];\n    }\n    this._steppers.push(\n      new StepOutStepper(loc.source, loc.start.line, loc.start.column, this._realm.contextStack.length)\n    );\n  }\n\n  getAndDeleteCompletedSteppers(ast: BabelNode): Array<StoppableObject> {\n    invariant(ast.loc && ast.loc.source);\n    let i = 0;\n    let completedSteppers: Array<StoppableObject> = [];\n    while (i < this._steppers.length) {\n      let stepper = this._steppers[i];\n      if (stepper.isComplete(ast, this._realm.contextStack.length)) {\n        completedSteppers.push(stepper);\n        this._steppers.splice(i, 1);\n      } else {\n        i++;\n      }\n    }\n    return completedSteppers;\n  }\n}\n"
  },
  {
    "path": "src/debugger/server/StopEventManager.js",
    "content": "/**\n * Copyright (c) 2017-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n/* @flow strict-local */\n\nimport invariant from \"./../common/invariant.js\";\nimport { Breakpoint } from \"./Breakpoint.js\";\nimport { Stepper, StepIntoStepper, StepOverStepper, StepOutStepper } from \"./Stepper.js\";\nimport { BabelNode } from \"@babel/types\";\nimport type { StoppedReason } from \"./../common/types.js\";\n\nexport type StoppableObject = Breakpoint | Stepper;\n\n// Manage whether the debuggee should stop\n// All stopping related logic is centralized here\n\nexport class StopEventManager {\n  // stoppables is a list of objects the debuggee should be stopped on\n  // (e.g. breakpoint, completed steppers). The debuggee should stop if there\n  // is at least one element in the list. Currently the reason of the first element\n  // is chosen as the reason sent to the UI\n  getDebuggeeStopReason(ast: BabelNode, stoppables: Array<StoppableObject>): void | StoppedReason {\n    if (stoppables.length === 0) return;\n    let stoppable = stoppables[0];\n    let stoppedReason;\n    if (stoppable instanceof Breakpoint) {\n      stoppedReason = \"Breakpoint\";\n    } else if (stoppable instanceof StepIntoStepper) {\n      stoppedReason = \"Step Into\";\n    } else if (stoppable instanceof StepOverStepper) {\n      stoppedReason = \"Step Over\";\n    } else if (stoppable instanceof StepOutStepper) {\n      stoppedReason = \"Step Out\";\n    } else {\n      invariant(false, \"Invalid stoppable object\");\n    }\n    return stoppedReason;\n  }\n}\n"
  },
  {
    "path": "src/debugger/server/VariableManager.js",
    "content": "/**\n * Copyright (c) 2017-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n/* @flow strict-local */\n\nimport type { Variable, EvaluateResult } from \"./../common/types.js\";\nimport { ReferenceMap } from \"./ReferenceMap.js\";\nimport {\n  LexicalEnvironment,\n  EnvironmentRecord,\n  DeclarativeEnvironmentRecord,\n  ObjectEnvironmentRecord,\n  GlobalEnvironmentRecord,\n} from \"./../../environment.js\";\nimport {\n  Value,\n  ConcreteValue,\n  PrimitiveValue,\n  ObjectValue,\n  AbstractObjectValue,\n  AbstractValue,\n  StringValue,\n} from \"./../../values/index.js\";\nimport invariant from \"./../common/invariant.js\";\nimport type { Realm } from \"./../../realm.js\";\nimport { IsDataDescriptor } from \"./../../methods/is.js\";\nimport { DebuggerError } from \"./../common/DebuggerError.js\";\nimport { Functions } from \"./../../singletons.js\";\n\ntype VariableContainer = LexicalEnvironment | ObjectValue | AbstractValue;\n\n// This class manages the handling of variable requests in the debugger\n// The DebugProtocol specifies collections of variables are to be fetched using a\n// unique reference ID called a variablesReference. This class can generate new\n// variablesReferences to pass to the UI and then perform lookups for those\n// variablesReferences when they are requested.\nexport class VariableManager {\n  constructor(realm: Realm) {\n    this._containerCache = new Map();\n    this._referenceMap = new ReferenceMap();\n    this._realm = realm;\n  }\n  // cache for created references\n  _containerCache: Map<VariableContainer, number>;\n  // map for looking up references\n  _referenceMap: ReferenceMap<VariableContainer>;\n  _realm: Realm;\n\n  // Given a container, either returns a cached reference for that container if\n  // it exists or return a new reference\n  getReferenceForValue(value: VariableContainer): number {\n    let cachedRef = this._containerCache.get(value);\n    if (cachedRef !== undefined) {\n      return cachedRef;\n    }\n\n    let varRef = this._referenceMap.add(value);\n    this._containerCache.set(value, varRef);\n    return varRef;\n  }\n\n  // The entry point for retrieving a collection of variables by a reference\n  getVariablesByReference(reference: number): Array<Variable> {\n    let container = this._referenceMap.get(reference);\n    if (!container) return [];\n    if (container instanceof LexicalEnvironment) {\n      return this._getVariablesFromEnvRecord(container.environmentRecord);\n    } else if (container instanceof ObjectValue) {\n      return this._getVariablesFromObject(container);\n    } else if (container instanceof AbstractValue) {\n      return this._getAbstractValueContent(container);\n    } else {\n      invariant(false, \"Invalid variable container\");\n    }\n  }\n\n  _getVariablesFromObject(object: ObjectValue): Array<Variable> {\n    let variables = [];\n    let names = object.properties.keys();\n    for (let name of names) {\n      let binding = object.properties.get(name);\n      invariant(binding !== undefined);\n      if (binding.descriptor) {\n        if (IsDataDescriptor(this._realm, binding.descriptor)) {\n          let value = binding.descriptor.value;\n          if (value instanceof Value) {\n            let variable = this._getVariableFromValue(name, value);\n            variables.push(variable);\n          }\n        }\n      }\n    }\n    return variables;\n  }\n\n  _getAbstractValueContent(value: AbstractValue): Array<Variable> {\n    let kindVar: Variable = {\n      name: \"kind\",\n      value: value.kind || \"undefined\",\n      variablesReference: 0,\n    };\n    let contents: Array<Variable> = [kindVar];\n    let argCount = 1;\n    for (let arg of value.args) {\n      contents.push(this._getVariableFromValue(\"arg-\" + argCount, arg));\n      argCount++;\n    }\n    return contents;\n  }\n\n  _getVariablesFromEnvRecord(envRecord: EnvironmentRecord): Array<Variable> {\n    if (envRecord instanceof DeclarativeEnvironmentRecord) {\n      return this._getVariablesFromDeclarativeEnv(envRecord);\n    } else if (envRecord instanceof ObjectEnvironmentRecord) {\n      if (envRecord.object instanceof ObjectValue) {\n        return this._getVariablesFromObject(envRecord.object);\n      } else if (envRecord.object instanceof AbstractObjectValue) {\n        // TODO: call _getVariablesFromAbstractObject when it is implemented\n        return [];\n      } else {\n        invariant(false, \"Invalid type of object environment record\");\n      }\n    } else if (envRecord instanceof GlobalEnvironmentRecord) {\n      let declVars = this._getVariablesFromEnvRecord(envRecord.$DeclarativeRecord);\n      let objVars = this._getVariablesFromEnvRecord(envRecord.$ObjectRecord);\n      return declVars.concat(objVars);\n    } else {\n      invariant(false, \"Invalid type of environment record\");\n    }\n  }\n\n  _getVariablesFromDeclarativeEnv(env: DeclarativeEnvironmentRecord): Array<Variable> {\n    let variables = [];\n    let bindings = env.bindings;\n    for (let name in bindings) {\n      let binding = bindings[name];\n      if (binding.value) {\n        let variable = this._getVariableFromValue(name, binding.value);\n        variables.push(variable);\n      }\n    }\n    return variables;\n  }\n\n  _getVariableFromValue(name: string, value: Value): Variable {\n    if (value instanceof ConcreteValue) {\n      return this._getVariableFromConcreteValue(name, value);\n    } else if (value instanceof AbstractValue) {\n      return this._getVariableFromAbstractValue(name, value);\n    } else {\n      invariant(false, \"Value is neither concrete nor abstract\");\n    }\n  }\n\n  _getVariableFromAbstractValue(name: string, value: AbstractValue): Variable {\n    let variable: Variable = {\n      name: name,\n      value: this._getAbstractValueDisplay(value),\n      variablesReference: this.getReferenceForValue(value),\n    };\n    return variable;\n  }\n\n  _getAbstractValueDisplay(value: AbstractValue): string {\n    if (value.intrinsicName !== undefined && !value.intrinsicName.startsWith(\"_\")) {\n      return value.intrinsicName;\n    }\n    return \"Abstract \" + value.types.getType().name;\n  }\n\n  _getVariableFromConcreteValue(name: string, value: ConcreteValue): Variable {\n    if (value instanceof PrimitiveValue) {\n      let variable: Variable = {\n        name: name,\n        value: value.toDisplayString(),\n        variablesReference: 0,\n      };\n      return variable;\n    } else if (value instanceof ObjectValue) {\n      let variable: Variable = {\n        name: name,\n        value: value.getKind(),\n        variablesReference: this.getReferenceForValue(value),\n      };\n      return variable;\n    } else {\n      invariant(false, \"Concrete value must be primitive or object\");\n    }\n  }\n\n  evaluate(frameId: void | number, expression: string): EvaluateResult {\n    let evalRealm = this._realm;\n    let isDirect = false;\n    let isStrict = false;\n    if (frameId !== undefined) {\n      if (frameId < 0 || frameId >= this._realm.contextStack.length) {\n        throw new DebuggerError(\"Invalid command\", \"Invalid value for frame ID\");\n      }\n      // frameId's are in reverse order of context stack\n      let stackIndex = this._realm.contextStack.length - 1 - frameId;\n      let context = this._realm.contextStack[stackIndex];\n      isDirect = true;\n      isStrict = true;\n      evalRealm = context.realm;\n    }\n\n    let evalString = new StringValue(this._realm, expression);\n    try {\n      let value = Functions.PerformEval(this._realm, evalString, evalRealm, isStrict, isDirect);\n      let varInfo = this._getVariableFromValue(expression, value);\n      let result: EvaluateResult = {\n        kind: \"evaluate\",\n        displayValue: varInfo.value,\n        type: value.getType().name,\n        variablesReference: varInfo.variablesReference,\n      };\n      return result;\n    } catch (e) {\n      let result: EvaluateResult = {\n        kind: \"evaluate\",\n        displayValue: `Failed to evaluate: ${expression}`,\n        type: \"unknown\",\n        variablesReference: 0,\n      };\n      return result;\n    }\n  }\n\n  clean() {\n    this._containerCache = new Map();\n    this._referenceMap.clean();\n  }\n}\n"
  },
  {
    "path": "src/debugger/server/channel/DebugChannel.js",
    "content": "/**\n * Copyright (c) 2017-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n/* @flow strict-local */\nimport invariant from \"./../../common/invariant.js\";\nimport { FileIOWrapper } from \"./../../common/channel/FileIOWrapper.js\";\nimport { DebugMessage } from \"./../../common/channel/DebugMessage.js\";\nimport { MessageMarshaller } from \"./../../common/channel/MessageMarshaller.js\";\nimport type {\n  DebuggerRequest,\n  BreakpointsArguments,\n  Stackframe,\n  Scope,\n  Variable,\n  StoppedReason,\n  EvaluateResult,\n} from \"./../../common/types.js\";\n\n//Channel used by the DebugServer in Prepack to communicate with the debug adapter\nexport class DebugChannel {\n  constructor(ioWrapper: FileIOWrapper) {\n    this._requestReceived = false;\n    this._ioWrapper = ioWrapper;\n    this._marshaller = new MessageMarshaller();\n  }\n\n  _requestReceived: boolean;\n  _ioWrapper: FileIOWrapper;\n  _marshaller: MessageMarshaller;\n\n  /*\n  /* Only called in the beginning to check if a debugger is attached\n  */\n  debuggerIsAttached(): boolean {\n    let message = this._ioWrapper.readInSyncOnce();\n    if (message === null) return false;\n    let parts = message.split(\" \");\n    let requestID = parseInt(parts[0], 10);\n    invariant(!isNaN(requestID), \"Request ID must be a number\");\n    let command = parts[1];\n    if (command === DebugMessage.DEBUGGER_ATTACHED) {\n      this._requestReceived = true;\n      this._ioWrapper.clearInFile();\n      this.writeOut(`${requestID} ${DebugMessage.PREPACK_READY_RESPONSE}`);\n      return true;\n    }\n    return false;\n  }\n\n  /* Reads in a request from the debug adapter\n  /* The caller is responsible for sending a response with the appropriate\n  /* contents at the right time.\n  */\n  readIn(): DebuggerRequest {\n    let message = this._ioWrapper.readInSync();\n    this._requestReceived = true;\n    return this._marshaller.unmarshallRequest(message);\n  }\n\n  // Write out a response to the debug adapter\n  writeOut(contents: string): void {\n    //Prepack only writes back to the debug adapter in response to a request\n    invariant(this._requestReceived, \"Prepack writing message without being requested: \" + contents);\n    this._ioWrapper.writeOutSync(contents);\n    this._requestReceived = false;\n  }\n\n  sendBreakpointsAcknowledge(messageType: string, requestID: number, args: BreakpointsArguments): void {\n    this.writeOut(this._marshaller.marshallBreakpointAcknowledge(requestID, messageType, args.breakpoints));\n  }\n\n  sendStoppedResponse(reason: StoppedReason, filePath: string, line: number, column: number, message?: string): void {\n    this.writeOut(this._marshaller.marshallStoppedResponse(reason, filePath, line, column, message));\n  }\n\n  sendStackframeResponse(requestID: number, stackframes: Array<Stackframe>): void {\n    this.writeOut(this._marshaller.marshallStackFramesResponse(requestID, stackframes));\n  }\n\n  sendScopesResponse(requestID: number, scopes: Array<Scope>): void {\n    this.writeOut(this._marshaller.marshallScopesResponse(requestID, scopes));\n  }\n\n  sendVariablesResponse(requestID: number, variables: Array<Variable>): void {\n    this.writeOut(this._marshaller.marshallVariablesResponse(requestID, variables));\n  }\n\n  sendEvaluateResponse(requestID: number, evalResult: EvaluateResult): void {\n    this.writeOut(this._marshaller.marshallEvaluateResponse(requestID, evalResult));\n  }\n\n  shutdown(): void {\n    this._ioWrapper.clearInFile();\n    this._ioWrapper.clearOutFile();\n  }\n}\n"
  },
  {
    "path": "src/descriptors.js",
    "content": "/**\n * Copyright (c) 2017-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n/* @flow */\n\nimport invariant from \"./invariant.js\";\nimport type { AbstractValue, UndefinedValue, Value } from \"./values/index.js\";\nimport { CompilerDiagnostic, FatalError } from \"./errors.js\";\nimport type { CallableObjectValue } from \"./types.js\";\nimport type { Realm } from \"./realm.js\";\n\nexport class Descriptor {\n  constructor() {\n    invariant(this.constructor !== Descriptor, \"Descriptor is an abstract base class\");\n  }\n  throwIfNotConcrete(realm: Realm): PropertyDescriptor {\n    let error = new CompilerDiagnostic(\n      \"only known descriptors supported\",\n      realm.currentLocation,\n      \"PP0042\",\n      \"FatalError\"\n    );\n    realm.handleError(error);\n    throw new FatalError();\n  }\n  mightHaveBeenDeleted(): boolean {\n    invariant(false, \"should have been overridden by subclass\");\n  }\n}\n\nexport type DescriptorInitializer = {|\n  writable?: boolean,\n  enumerable?: boolean,\n  configurable?: boolean,\n\n  value?: Value,\n\n  get?: UndefinedValue | CallableObjectValue | AbstractValue,\n  set?: UndefinedValue | CallableObjectValue | AbstractValue,\n|};\n\n// Normal descriptors are returned just like spec descriptors\nexport class PropertyDescriptor extends Descriptor {\n  writable: void | boolean;\n  enumerable: void | boolean;\n  configurable: void | boolean;\n\n  // If value instanceof EmptyValue, then this descriptor indicates that the\n  // corresponding property has been deleted.\n  value: void | Value;\n\n  get: void | UndefinedValue | CallableObjectValue | AbstractValue;\n  set: void | UndefinedValue | CallableObjectValue | AbstractValue;\n\n  constructor(desc: DescriptorInitializer | PropertyDescriptor) {\n    super();\n    this.writable = desc.writable;\n    this.enumerable = desc.enumerable;\n    this.configurable = desc.configurable;\n    this.value = desc.value;\n    this.get = desc.get;\n    this.set = desc.set;\n  }\n\n  throwIfNotConcrete(realm: Realm): PropertyDescriptor {\n    return this;\n  }\n  mightHaveBeenDeleted(): boolean {\n    if (this.value === undefined) return false;\n    return this.value.mightHaveBeenDeleted();\n  }\n}\n\n// Only internal properties (those starting with $ / where internalSlot of owning property binding is true) will ever have array values.\nexport class InternalSlotDescriptor extends Descriptor {\n  value: void | Value | Array<any>;\n\n  constructor(value?: void | Value | Array<any>) {\n    super();\n    this.value = Array.isArray(value) ? value.slice(0) : value;\n  }\n\n  mightHaveBeenDeleted(): boolean {\n    return false;\n  }\n}\n\n// Only used if the result of a join of two descriptors is not a data descriptor with identical attribute values.\n// When present, any update to the property must produce effects that are the join of updating both descriptors,\n// using joinCondition as the condition of the join.\nexport class AbstractJoinedDescriptor extends Descriptor {\n  joinCondition: AbstractValue;\n  // An undefined descriptor means it might be empty in this branch.\n  descriptor1: void | Descriptor;\n  descriptor2: void | Descriptor;\n\n  constructor(joinCondition: AbstractValue, descriptor1?: Descriptor, descriptor2?: Descriptor) {\n    super();\n    this.joinCondition = joinCondition;\n    this.descriptor1 = descriptor1;\n    this.descriptor2 = descriptor2;\n  }\n  mightHaveBeenDeleted(): boolean {\n    if (!this.descriptor1 || this.descriptor1.mightHaveBeenDeleted()) {\n      return true;\n    }\n    if (!this.descriptor2 || this.descriptor2.mightHaveBeenDeleted()) {\n      return true;\n    }\n    return false;\n  }\n}\n\nexport function cloneDescriptor(d: void | PropertyDescriptor): void | PropertyDescriptor {\n  if (d === undefined) return undefined;\n  return new PropertyDescriptor(d);\n}\n\n// does not check if the contents of value properties are the same\nexport function equalDescriptors(d1: PropertyDescriptor, d2: PropertyDescriptor): boolean {\n  if (d1.writable !== d2.writable) return false;\n  if (d1.enumerable !== d2.enumerable) return false;\n  if (d1.configurable !== d2.configurable) return false;\n  if (d1.value !== undefined) {\n    if (d2.value === undefined) return false;\n  }\n  if (d1.get !== d2.get) return false;\n  if (d1.set !== d2.set) return false;\n  return true;\n}\n"
  },
  {
    "path": "src/domains/TypesDomain.js",
    "content": "/**\n * Copyright (c) 2017-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n/* @flow strict-local */\n\nimport invariant from \"../invariant.js\";\nimport type { BabelBinaryOperator, BabelLogicalOperator, BabelUnaryOperator } from \"@babel/types\";\nimport {\n  AbstractValue,\n  BooleanValue,\n  ConcreteValue,\n  EmptyValue,\n  FunctionValue,\n  NumberValue,\n  IntegralValue,\n  ObjectValue,\n  PrimitiveValue,\n  StringValue,\n  UndefinedValue,\n  Value,\n} from \"../values/index.js\";\n\n/* An abstract domain for the type of value a variable might have.  */\n\nexport default class TypesDomain {\n  constructor(type: void | typeof Value) {\n    invariant(type !== ConcreteValue, \"Concrete values must be specific\");\n    this._type = type === Value ? undefined : type;\n  }\n\n  static topVal: TypesDomain;\n  static bottomVal: TypesDomain;\n\n  _type: void | typeof Value;\n\n  isBottom(): boolean {\n    return this._type instanceof EmptyValue;\n  }\n\n  isTop(): boolean {\n    return this._type === undefined;\n  }\n\n  getType(): typeof Value {\n    return this._type || Value;\n  }\n\n  // return the type of the result in the case where there is no exception\n  static binaryOp(op: BabelBinaryOperator, left: TypesDomain, right: TypesDomain): TypesDomain {\n    if (left.isBottom() || right.isBottom()) return TypesDomain.bottomVal;\n    let lType = left._type;\n    let rType = right._type;\n    let resultType = Value;\n    switch (op) {\n      case \"+\":\n        if (lType === undefined || rType === undefined) return TypesDomain.topVal;\n        if (Value.isTypeCompatibleWith(lType, StringValue) || Value.isTypeCompatibleWith(rType, StringValue)) {\n          resultType = StringValue;\n          break;\n        }\n      // eslint-disable-line no-fallthrough\n      case \"-\":\n        if (lType === undefined || rType === undefined) return TypesDomain.topVal;\n        if (lType === IntegralValue && rType === IntegralValue) resultType = IntegralValue;\n        else if (Value.isTypeCompatibleWith(lType, NumberValue) && Value.isTypeCompatibleWith(rType, NumberValue))\n          resultType = NumberValue;\n        break;\n      case \"<\":\n      case \">\":\n      case \">=\":\n      case \"<=\":\n      case \"!=\":\n      case \"==\":\n      case \"!==\":\n      case \"===\":\n      case \"in\":\n      case \"instanceof\":\n        resultType = BooleanValue;\n        break;\n      case \">>>\":\n      case \"<<\":\n      case \">>\":\n      case \"&\":\n      case \"|\":\n      case \"^\":\n        resultType = IntegralValue;\n        break;\n      case \"**\":\n      case \"%\":\n      case \"/\":\n      case \"*\":\n        resultType = NumberValue;\n        break;\n      default:\n        invariant(false);\n    }\n    return new TypesDomain(resultType);\n  }\n\n  static joinValues(v1: void | Value, v2: void | Value): TypesDomain {\n    if (v1 === undefined && v2 === undefined) return new TypesDomain(UndefinedValue);\n    if (v1 === undefined || v2 === undefined) return TypesDomain.topVal;\n    if (v1 instanceof AbstractValue) return v1.types.joinWith(v2.getType());\n    if (v2 instanceof AbstractValue) return v2.types.joinWith(v1.getType());\n    return new TypesDomain(v1.getType()).joinWith(v2.getType());\n  }\n\n  joinWith(t: typeof Value): TypesDomain {\n    if (this.isBottom()) return t === EmptyValue ? TypesDomain.bottomVal : new TypesDomain(t);\n    let type = this.getType();\n    if (type === t || t instanceof EmptyValue) return this;\n    if (Value.isTypeCompatibleWith(type, NumberValue) && Value.isTypeCompatibleWith(t, NumberValue)) {\n      return new TypesDomain(NumberValue);\n    }\n    if (Value.isTypeCompatibleWith(type, FunctionValue) && Value.isTypeCompatibleWith(t, FunctionValue)) {\n      return new TypesDomain(FunctionValue);\n    }\n    if (Value.isTypeCompatibleWith(type, ObjectValue) && Value.isTypeCompatibleWith(t, ObjectValue)) {\n      return new TypesDomain(ObjectValue);\n    }\n    if (Value.isTypeCompatibleWith(type, PrimitiveValue) && Value.isTypeCompatibleWith(t, PrimitiveValue)) {\n      return new TypesDomain(PrimitiveValue);\n    }\n    return TypesDomain.topVal;\n  }\n\n  static logicalOp(op: BabelLogicalOperator, left: TypesDomain, right: TypesDomain): TypesDomain {\n    return left.joinWith(right.getType());\n  }\n\n  // return the type of the result in the case where there is no exception\n  // note that the type of the operand has no influence on the type of the non exceptional result\n  static unaryOp(op: BabelUnaryOperator, operand: TypesDomain): TypesDomain {\n    if (operand.isBottom()) return TypesDomain.bottomVal;\n    const type = operand._type;\n    let resultType = Value;\n    switch (op) {\n      case \"-\":\n      case \"+\":\n        resultType = type === IntegralValue ? IntegralValue : NumberValue;\n        break;\n      case \"~\":\n        resultType = IntegralValue;\n        break;\n      case \"!\":\n      case \"delete\":\n        resultType = BooleanValue;\n        break;\n      case \"typeof\":\n        resultType = StringValue;\n        break;\n      case \"void\":\n        resultType = UndefinedValue;\n        break;\n      default:\n        invariant(false);\n    }\n    return new TypesDomain(resultType);\n  }\n}\n"
  },
  {
    "path": "src/domains/ValuesDomain.js",
    "content": "/**\n * Copyright (c) 2017-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n/* @flow strict-local */\n\nimport type { BabelBinaryOperator, BabelLogicalOperator, BabelUnaryOperator } from \"@babel/types\";\nimport { AbruptCompletion } from \"../completions.js\";\nimport { FatalError } from \"../errors.js\";\nimport invariant from \"../invariant.js\";\nimport {\n  AbstractEqualityComparison,\n  AbstractRelationalComparison,\n  Add,\n  HasProperty,\n  InstanceofOperator,\n  StrictEqualityComparison,\n} from \"../methods/index.js\";\nimport type { Realm } from \"../realm.js\";\nimport { To } from \"../singletons.js\";\nimport {\n  AbstractValue,\n  BooleanValue,\n  ConcreteValue,\n  EmptyValue,\n  NumberValue,\n  IntegralValue,\n  ObjectValue,\n  StringValue,\n  UndefinedValue,\n  Value,\n} from \"../values/index.js\";\nimport { Utils } from \"../singletons.js\";\n\n/* An abstract domain that collects together a set of concrete values\n   that might be the value of a variable at runtime.\n   Initially, every variable has the value undefined.\n   A property that has been weakly deleted will have more than\n   one value, one of which will by the EmptyValue.  */\n\nexport default class ValuesDomain {\n  constructor(_values: void | Set<ConcreteValue> | ConcreteValue) {\n    let values = _values;\n    if (values instanceof ConcreteValue) {\n      let valueSet = new Set();\n      valueSet.add(values);\n      values = valueSet;\n    }\n    this._elements = values;\n  }\n\n  static topVal: ValuesDomain;\n  static bottomVal: ValuesDomain;\n\n  _elements: void | Set<ConcreteValue>;\n\n  contains(x: ValuesDomain): boolean {\n    let elems = this._elements;\n    let xelems = x._elements;\n    if (elems === xelems) return true;\n    if (elems === undefined) return true;\n    if (xelems === undefined) return false;\n    if (elems.size < xelems.size) return false;\n    for (let e of xelems) {\n      if (!elems.has(e)) return false;\n    }\n    return true;\n  }\n\n  containsValue(x: Value): boolean {\n    let elems = this._elements;\n    if (elems === undefined) return true; // Top contains everything\n    if (x instanceof AbstractValue) return this.contains(x.values);\n    invariant(x instanceof ConcreteValue);\n    return elems.has(x);\n  }\n\n  isBottom(): boolean {\n    return this._elements !== undefined && this._elements.size === 0;\n  }\n\n  isTop(): boolean {\n    return this._elements === undefined;\n  }\n\n  getElements(): Set<ConcreteValue> {\n    invariant(this._elements !== undefined);\n    return this._elements;\n  }\n\n  // return a set of values that may be result of performing the given operation on each pair in the\n  // Cartesian product of the value sets of the operands.\n  static binaryOp(realm: Realm, op: BabelBinaryOperator, left: ValuesDomain, right: ValuesDomain): ValuesDomain {\n    if (left.isBottom() || right.isBottom()) return ValuesDomain.bottomVal;\n    let leftElements = left._elements;\n    let rightElements = right._elements;\n    // Return top if left and/or right are top or if the size of the value set would get to be quite large.\n    // Note: the larger the set of values, the less we know and therefore the less we get value from computing\n    // all of these values. TODO #1000: probably the upper bound can be quite a bit smaller.\n    if (!leftElements || !rightElements || leftElements.size > 100 || rightElements.size > 100)\n      return ValuesDomain.topVal;\n    let resultSet: Set<ConcreteValue> = new Set();\n    let savedHandler = realm.errorHandler;\n    let savedIsReadOnly = realm.isReadOnly;\n    realm.isReadOnly = true;\n    try {\n      realm.errorHandler = () => {\n        throw new FatalError();\n      };\n      for (let leftElem of leftElements) {\n        for (let rightElem of rightElements) {\n          let result = ValuesDomain.computeBinary(realm, op, leftElem, rightElem);\n          if (result instanceof ConcreteValue) {\n            resultSet.add(result);\n          } else {\n            invariant(result instanceof AbstractValue);\n            if (result.values.isTop()) {\n              return ValuesDomain.topVal;\n            }\n            for (let subResult of result.values.getElements()) {\n              resultSet.add(subResult);\n            }\n          }\n        }\n      }\n    } catch (e) {\n      if (e instanceof AbruptCompletion) return ValuesDomain.topVal;\n    } finally {\n      realm.errorHandler = savedHandler;\n      realm.isReadOnly = savedIsReadOnly;\n    }\n    return new ValuesDomain(resultSet);\n  }\n\n  // Note that calling this can result in user code running, which can side-effect the heap.\n  // If that is not the desired behavior, mark the realm as read-only for the duration of the call.\n  static computeBinary(realm: Realm, op: BabelBinaryOperator, lval: ConcreteValue, rval: ConcreteValue): Value {\n    if (op === \"+\") {\n      // ECMA262 12.8.3 The Addition Operator\n      let lprim = To.ToPrimitiveOrAbstract(realm, lval);\n      let rprim = To.ToPrimitiveOrAbstract(realm, rval);\n\n      if (lprim instanceof AbstractValue || rprim instanceof AbstractValue) {\n        return AbstractValue.createFromBinaryOp(realm, op, lprim, rprim);\n      }\n\n      if (lprim instanceof StringValue || rprim instanceof StringValue) {\n        let lstr = To.ToString(realm, lprim);\n        let rstr = To.ToString(realm, rprim);\n        return new StringValue(realm, lstr + rstr);\n      }\n\n      let lnum = To.ToNumber(realm, lprim);\n      let rnum = To.ToNumber(realm, rprim);\n      return Add(realm, lnum, rnum);\n    } else if (op === \"<\" || op === \">\" || op === \">=\" || op === \"<=\") {\n      // ECMA262 12.10.3\n      if (op === \"<\") {\n        let r = AbstractRelationalComparison(realm, lval, rval, true, op);\n        if (r instanceof UndefinedValue) {\n          return realm.intrinsics.false;\n        } else {\n          return r;\n        }\n      } else if (op === \"<=\") {\n        let r = AbstractRelationalComparison(realm, rval, lval, false, op);\n        if (r instanceof UndefinedValue || (r instanceof BooleanValue && r.value)) {\n          return realm.intrinsics.false;\n        } else if (r instanceof AbstractValue) {\n          return r;\n        } else {\n          return realm.intrinsics.true;\n        }\n      } else if (op === \">\") {\n        let r = AbstractRelationalComparison(realm, rval, lval, false, op);\n        if (r instanceof UndefinedValue) {\n          return realm.intrinsics.false;\n        } else {\n          return r;\n        }\n      } else if (op === \">=\") {\n        let r = AbstractRelationalComparison(realm, lval, rval, true, op);\n        if (r instanceof UndefinedValue || (r instanceof BooleanValue && r.value)) {\n          return realm.intrinsics.false;\n        } else if (r instanceof AbstractValue) {\n          return r;\n        } else {\n          return realm.intrinsics.true;\n        }\n      }\n    } else if (op === \">>>\") {\n      // ECMA262 12.9.5.1\n      let lnum = To.ToUint32(realm, lval);\n      let rnum = To.ToUint32(realm, rval);\n\n      return IntegralValue.createFromNumberValue(realm, lnum >>> rnum);\n    } else if (op === \"<<\" || op === \">>\") {\n      let lnum = To.ToInt32(realm, lval);\n      let rnum = To.ToUint32(realm, rval);\n\n      if (op === \"<<\") {\n        // ECMA262 12.9.3.1\n        return IntegralValue.createFromNumberValue(realm, lnum << rnum);\n      } else if (op === \">>\") {\n        // ECMA262 12.9.4.1\n        return IntegralValue.createFromNumberValue(realm, lnum >> rnum);\n      }\n    } else if (op === \"**\") {\n      // ECMA262 12.6.3\n\n      // 5. Let base be ? ToNumber(leftValue).\n      let base = To.ToNumberOrAbstract(realm, lval);\n\n      // 6. Let exponent be ? ToNumber(rightValue).\n      let exponent = To.ToNumberOrAbstract(realm, rval);\n\n      if (base instanceof AbstractValue || exponent instanceof AbstractValue) {\n        const baseVal = base instanceof AbstractValue ? base : new NumberValue(realm, base);\n        const exponentVal = exponent instanceof AbstractValue ? exponent : new NumberValue(realm, exponent);\n        return AbstractValue.createFromBinaryOp(realm, op, baseVal, exponentVal);\n      }\n\n      // 7. Return the result of Applying the ** operator with base and exponent as specified in 12.7.3.4.\n      return new NumberValue(realm, Math.pow(base, exponent));\n    } else if (op === \"%\" || op === \"/\" || op === \"*\" || op === \"-\") {\n      // ECMA262 12.7.3\n      let lnum = To.ToNumberOrAbstract(realm, lval);\n      let rnum = To.ToNumberOrAbstract(realm, rval);\n      if (lnum instanceof AbstractValue || rnum instanceof AbstractValue) {\n        const lnumVal = lnum instanceof AbstractValue ? lnum : new NumberValue(realm, lnum);\n        const rnumVal = rnum instanceof AbstractValue ? rnum : new NumberValue(realm, rnum);\n        return AbstractValue.createFromBinaryOp(realm, op, lnumVal, rnumVal);\n      }\n\n      if (isNaN(rnum)) return realm.intrinsics.NaN;\n      if (isNaN(lnum)) return realm.intrinsics.NaN;\n\n      if (op === \"-\") {\n        return Add(realm, lnum, rnum, true);\n      } else if (op === \"%\") {\n        // The sign of the result equals the sign of the dividend.\n        // If the dividend is an infinity, or the divisor is a zero, or both, the result is NaN.\n        // If the dividend is finite and the divisor is an infinity, the result equals the dividend.\n        // If the dividend is a zero and the divisor is nonzero and finite, the result is the same as the dividend.\n        return new NumberValue(realm, lnum % rnum);\n      } else if (op === \"/\") {\n        // The sign of the result is positive if both operands have the same sign, negative if the operands have different signs.\n        // Division of an infinity by an infinity results in NaN.\n        // Division of an infinity by a zero results in an infinity. The sign is determined by the rule already stated above.\n        // Division of an infinity by a nonzero finite value results in a signed infinity. The sign is determined by the rule already stated above.\n        // Division of a finite value by an infinity results in zero. The sign is determined by the rule already stated above.\n        // Division of a zero by a zero results in NaN; division of zero by any other finite value results in zero, with the sign determined by the rule already stated above.\n        // Division of a nonzero finite value by a zero results in a signed infinity. The sign is determined by the rule already stated above.\n        return new NumberValue(realm, lnum / rnum);\n      } else if (op === \"*\") {\n        // The sign of the result is positive if both operands have the same sign, negative if the operands have different signs.\n        // Multiplication of an infinity by a zero results in NaN.\n        // Multiplication of an infinity by an infinity results in an infinity. The sign is determined by the rule already stated above.\n        // Multiplication of an infinity by a finite nonzero value results in a signed infinity. The sign is determined by the rule already stated above.\n        return new NumberValue(realm, lnum * rnum);\n      }\n    } else if (op === \"!==\") {\n      return new BooleanValue(realm, !StrictEqualityComparison(realm, lval, rval));\n    } else if (op === \"===\") {\n      return new BooleanValue(realm, StrictEqualityComparison(realm, lval, rval));\n    } else if (op === \"!=\" || op === \"==\") {\n      return AbstractEqualityComparison(realm, lval, rval, op);\n    } else if (op === \"&\" || op === \"|\" || op === \"^\") {\n      // ECMA262 12.12.3\n\n      // 5. Let lnum be ? ToInt32(lval).\n      let lnum: number = To.ToInt32(realm, lval);\n\n      // 6. Let rnum be ? ToInt32(rval).\n      let rnum: number = To.ToInt32(realm, rval);\n\n      // 7. Return the result of applying the bitwise operator @ to lnum and rnum. The result is a signed 32 bit integer.\n      if (op === \"&\") {\n        return IntegralValue.createFromNumberValue(realm, lnum & rnum);\n      } else if (op === \"|\") {\n        return IntegralValue.createFromNumberValue(realm, lnum | rnum);\n      } else if (op === \"^\") {\n        return IntegralValue.createFromNumberValue(realm, lnum ^ rnum);\n      }\n    } else if (op === \"in\") {\n      // ECMA262 12.10.3\n\n      // 5. If Type(rval) is not Object, throw a TypeError exception.\n      if (!(rval instanceof ObjectValue)) {\n        throw new FatalError();\n      }\n\n      // 6. Return ? HasProperty(rval, ToPropertyKey(lval)).\n      return new BooleanValue(realm, HasProperty(realm, rval, To.ToPropertyKey(realm, lval)));\n    } else if (op === \"instanceof\") {\n      // ECMA262 12.10.3\n\n      // 5. Return ? InstanceofOperator(lval, rval).;\n      return new BooleanValue(realm, InstanceofOperator(realm, lval, rval));\n    }\n\n    invariant(false, \"unimplemented \" + op);\n  }\n\n  static logicalOp(realm: Realm, op: BabelLogicalOperator, left: ValuesDomain, right: ValuesDomain): ValuesDomain {\n    let leftElements = left._elements;\n    let rightElements = right._elements;\n    // Return top if left and/or right are top or if the size of the value set would get to be quite large.\n    // Note: the larger the set of values, the less we know and therefore the less we get value from computing\n    // all of these values. TODO #1000: probably the upper bound can be quite a bit smaller.\n    if (!leftElements || !rightElements || leftElements.size > 100 || rightElements.size > 100)\n      return ValuesDomain.topVal;\n    let resultSet = new Set();\n    let savedHandler = realm.errorHandler;\n    let savedIsReadOnly = realm.isReadOnly;\n    realm.isReadOnly = true;\n    try {\n      realm.errorHandler = () => {\n        throw new FatalError();\n      };\n      for (let leftElem of leftElements) {\n        for (let rightElem of rightElements) {\n          let result = ValuesDomain.computeLogical(realm, op, leftElem, rightElem);\n          resultSet.add(result);\n        }\n      }\n    } catch (e) {\n      if (e instanceof AbruptCompletion) return ValuesDomain.topVal;\n    } finally {\n      realm.errorHandler = savedHandler;\n      realm.isReadOnly = savedIsReadOnly;\n    }\n    return new ValuesDomain(resultSet);\n  }\n\n  // Note that calling this can result in user code running, which can side-effect the heap.\n  // If that is not the desired behavior, mark the realm as read-only for the duration of the call.\n  static computeLogical(\n    realm: Realm,\n    op: BabelLogicalOperator,\n    lval: ConcreteValue,\n    rval: ConcreteValue\n  ): ConcreteValue {\n    let lbool = To.ToBoolean(realm, lval);\n\n    if (op === \"&&\") {\n      // ECMA262 12.13.3\n      if (lbool === false) return lval;\n    } else if (op === \"||\") {\n      // ECMA262 12.13.3\n      if (lbool === true) return lval;\n    }\n    return rval;\n  }\n\n  // Note that calling this can result in user code running, which can side-effect the heap.\n  // If that is not the desired behavior, mark the realm as read-only for the duration of the call.\n  static computeUnary(realm: Realm, op: BabelUnaryOperator, value: ConcreteValue): Value {\n    if (op === \"+\") {\n      // ECMA262 12.5.6.1\n      // 1. Let expr be the result of evaluating UnaryExpression.\n      // 2. Return ? ToNumber(? GetValue(expr)).\n      return IntegralValue.createFromNumberValue(realm, To.ToNumber(realm, value));\n    } else if (op === \"-\") {\n      // ECMA262 12.5.7.1\n      // 1. Let expr be the result of evaluating UnaryExpression.\n      // 2. Let oldValue be ? ToNumber(? GetValue(expr)).\n      let oldValue = To.ToNumber(realm, value);\n\n      // 3. If oldValue is NaN, return NaN.\n      if (isNaN(oldValue)) {\n        return realm.intrinsics.NaN;\n      }\n\n      // 4. Return the result of negating oldValue; that is, compute a Number with the same magnitude but opposite sign.\n      return IntegralValue.createFromNumberValue(realm, -oldValue);\n    } else if (op === \"~\") {\n      // ECMA262 12.5.8\n      // 1. Let expr be the result of evaluating UnaryExpression.\n      // 2. Let oldValue be ? ToInt32(? GetValue(expr)).\n      let oldValue = To.ToInt32(realm, value);\n\n      // 3. Return the result of applying bitwise complement to oldValue. The result is a signed 32-bit integer.\n      return IntegralValue.createFromNumberValue(realm, ~oldValue);\n    } else if (op === \"!\") {\n      // ECMA262 12.6.9\n      // 1. Let expr be the result of evaluating UnaryExpression.\n      // 2. Let oldValue be ToBoolean(? GetValue(expr)).\n      let oldValue = To.ToBoolean(realm, value);\n\n      // 3. If oldValue is true, return false.\n      if (oldValue === true) return realm.intrinsics.false;\n\n      // 4. Return true.\n      return realm.intrinsics.true;\n    } else if (op === \"void\") {\n      // 1. Let expr be the result of evaluating UnaryExpression.\n      // 2. Perform ? GetValue(expr).\n      // 3. Return undefined.\n      return realm.intrinsics.undefined;\n    } else if (op === \"typeof\") {\n      // ECMA262 12.6.5\n      // 1. Let val be the result of evaluating UnaryExpression.\n      // 2. If Type(val) is Reference, then\n      // 3. Let val be ? GetValue(val).\n      let val = value;\n      // 4. Return a String according to Table 35.\n      let typeString = Utils.typeToString(val.getType());\n      invariant(typeString !== undefined);\n      return new StringValue(realm, typeString);\n    } else {\n      invariant(false, `${op} is a state update, not a pure operation, so we don't support it`);\n    }\n  }\n\n  static unaryOp(realm: Realm, op: BabelUnaryOperator, operandValues: ValuesDomain): ValuesDomain {\n    if (operandValues.isBottom()) return ValuesDomain.bottomVal;\n    let operandElements = operandValues._elements;\n    if (operandElements === undefined) return ValuesDomain.topVal;\n    let resultSet = new Set();\n    let savedHandler = realm.errorHandler;\n    let savedIsReadOnly = realm.isReadOnly;\n    realm.isReadOnly = true;\n    try {\n      realm.errorHandler = () => {\n        throw new FatalError();\n      };\n      for (let operandElem of operandElements) {\n        let result = ValuesDomain.computeUnary(realm, op, operandElem);\n        if (result instanceof ConcreteValue) {\n          resultSet.add(result);\n        } else {\n          invariant(result instanceof AbstractValue);\n          if (result.values.isTop()) {\n            return ValuesDomain.topVal;\n          }\n          for (let subResult of result.values.getElements()) {\n            resultSet.add(subResult);\n          }\n        }\n      }\n    } catch (e) {\n      if (e instanceof AbruptCompletion) return ValuesDomain.topVal;\n    } finally {\n      realm.errorHandler = savedHandler;\n      realm.isReadOnly = savedIsReadOnly;\n    }\n    return new ValuesDomain(resultSet);\n  }\n\n  includesValueNotOfType(type: typeof Value): boolean {\n    invariant(!this.isTop());\n    for (let cval of this.getElements()) {\n      if (!(cval instanceof type)) return true;\n    }\n    return false;\n  }\n\n  includesValueOfType(type: typeof Value): boolean {\n    invariant(!this.isTop());\n    for (let cval of this.getElements()) {\n      if (cval instanceof type) return true;\n    }\n    return false;\n  }\n\n  mightBeFalse(): boolean {\n    invariant(!this.isTop());\n    for (let cval of this.getElements()) {\n      if (cval.mightBeFalse()) return true;\n    }\n    return false;\n  }\n\n  mightNotBeFalse(): boolean {\n    invariant(!this.isTop());\n    for (let cval of this.getElements()) {\n      if (cval.mightNotBeFalse()) return true;\n    }\n    return false;\n  }\n\n  static joinValues(\n    realm: Realm,\n    v1: Value = realm.intrinsics.undefined,\n    v2: Value = realm.intrinsics.undefined\n  ): ValuesDomain {\n    if (v1 instanceof AbstractValue) return v1.values.joinWith(v2);\n    if (v2 instanceof AbstractValue) return v2.values.joinWith(v1);\n    let union = new Set();\n    invariant(v1 instanceof ConcreteValue);\n    union.add(v1);\n    invariant(v2 instanceof ConcreteValue);\n    union.add(v2);\n    return new ValuesDomain(union);\n  }\n\n  joinWith(y: Value): ValuesDomain {\n    if (this.isTop()) return this;\n    let union = new Set(this.getElements());\n    if (y instanceof AbstractValue) {\n      if (y.values.isTop()) return y.values;\n      y.values.getElements().forEach(v => union.add(v));\n    } else {\n      invariant(y instanceof ConcreteValue);\n      union.add(y);\n    }\n    if (union.size === 0) return ValuesDomain.bottomVal;\n    return new ValuesDomain(union);\n  }\n\n  static meetValues(\n    realm: Realm,\n    v1: Value = realm.intrinsics.undefined,\n    v2: Value = realm.intrinsics.undefined\n  ): ValuesDomain {\n    if (v1 instanceof AbstractValue) return v1.values.meetWith(v2);\n    if (v2 instanceof AbstractValue) return v2.values.meetWith(v1);\n    let intersection = new Set();\n    invariant(v1 instanceof ConcreteValue);\n    invariant(v2 instanceof ConcreteValue);\n    if (v1 === v2) intersection.add(v1);\n    if (intersection.size === 0) return ValuesDomain.bottomVal;\n    return new ValuesDomain(intersection);\n  }\n\n  meetWith(y: Value): ValuesDomain {\n    let intersection = new Set();\n    let elements = this._elements;\n    if (y instanceof AbstractValue) {\n      if (y.values.isTop()) return this;\n      y.values.getElements().forEach(v => {\n        if (elements === undefined || elements.has(v)) intersection.add(v);\n      });\n    } else {\n      invariant(y instanceof ConcreteValue);\n      if (elements === undefined || elements.has(y)) intersection.add(y);\n    }\n    if (intersection.size === 0) return ValuesDomain.bottomVal;\n    return new ValuesDomain(intersection);\n  }\n\n  promoteEmptyToUndefined(): ValuesDomain {\n    if (this.isTop() || this.isBottom()) return this;\n    let newSet = new Set();\n    for (let cval of this.getElements()) {\n      if (cval instanceof EmptyValue) newSet.add(cval.$Realm.intrinsics.undefined);\n      else newSet.add(cval);\n    }\n    return new ValuesDomain(newSet);\n  }\n}\n"
  },
  {
    "path": "src/domains/index.js",
    "content": "/**\n * Copyright (c) 2017-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n/* @flow strict-local */\n\nexport { default as TypesDomain } from \"./TypesDomain.js\";\nexport { default as ValuesDomain } from \"./ValuesDomain.js\";\n"
  },
  {
    "path": "src/environment.js",
    "content": "/**\n * Copyright (c) 2017-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n/* @flow */\n\nimport type {\n  BabelNode,\n  BabelNodeComment,\n  BabelNodeFile,\n  BabelNodeLVal,\n  BabelNodePosition,\n  BabelNodeSourceLocation,\n} from \"@babel/types\";\nimport type { Realm } from \"./realm.js\";\nimport type { SourceFile, SourceType } from \"./types.js\";\nimport * as t from \"@babel/types\";\n\nimport { AbruptCompletion, Completion, ThrowCompletion } from \"./completions.js\";\nimport { CompilerDiagnostic, FatalError } from \"./errors.js\";\nimport { ExecutionContext } from \"./realm.js\";\nimport {\n  AbstractValue,\n  NullValue,\n  SymbolValue,\n  BooleanValue,\n  FunctionValue,\n  NumberValue,\n  IntegralValue,\n  ObjectValue,\n  AbstractObjectValue,\n  StringValue,\n  UndefinedValue,\n  Value,\n} from \"./values/index.js\";\nimport parse from \"./utils/parse.js\";\nimport invariant from \"./invariant.js\";\nimport traverseFast from \"./utils/traverse-fast.js\";\nimport { HasProperty, Get, IsExtensible, HasOwnProperty, IsDataDescriptor } from \"./methods/index.js\";\nimport { Environment, Leak, Properties, To } from \"./singletons.js\";\nimport { TypesDomain, ValuesDomain } from \"./domains/index.js\";\nimport PrimitiveValue from \"./values/PrimitiveValue.js\";\nimport { createOperationDescriptor } from \"./utils/generator.js\";\n\nimport { SourceMapConsumer, type NullableMappedPosition } from \"source-map\";\nimport { PropertyDescriptor } from \"./descriptors.js\";\n\nfunction deriveGetBinding(realm: Realm, binding: Binding) {\n  let types = TypesDomain.topVal;\n  let values = ValuesDomain.topVal;\n  invariant(realm.generator !== undefined);\n  return realm.generator.deriveAbstract(types, values, [], createOperationDescriptor(\"GET_BINDING\", { binding }));\n}\n\nexport function materializeBinding(realm: Realm, binding: Binding): void {\n  let realmGenerator = realm.generator;\n  invariant(realmGenerator !== undefined);\n  let value = binding.value;\n  if (value !== undefined && value !== realm.intrinsics.undefined) realmGenerator.emitBindingAssignment(binding, value);\n}\nexport function leakBinding(binding: Binding): void {\n  let realm = binding.environment.realm;\n  if (!binding.hasLeaked) {\n    if (binding.mutable) {\n      realm.recordModifiedBinding(binding).hasLeaked = true;\n    } else {\n      binding.hasLeaked = true;\n    }\n    materializeBinding(realm, binding);\n  }\n\n  // Havoc the binding\n  if (binding.mutable === true) {\n    // For mutable, i.e. non-const bindings, the actual value is no longer directly available.\n    // Thus, we reset the value to realm.intrinsics.__leakedValue to prevent any use of the last known value.\n    binding.value = realm.intrinsics.__leakedValue;\n  }\n}\n\n// ECMA262 8.1.1\nexport class EnvironmentRecord {\n  realm: Realm;\n  isReadOnly: boolean;\n  $NewTarget: void | ObjectValue;\n  id: number;\n  creatingOptimizedFunction: FunctionValue | void;\n  lexicalEnvironment: LexicalEnvironment | void;\n\n  static nextId: number = 0;\n\n  constructor(realm: Realm) {\n    invariant(realm, \"expected realm\");\n    this.realm = realm;\n    this.isReadOnly = false;\n    this.id = EnvironmentRecord.nextId++;\n    this.creatingOptimizedFunction = realm.currentOptimizedFunction;\n  }\n\n  HasBinding(N: string): boolean {\n    invariant(false, \"abstract method; please override\");\n  }\n\n  CreateMutableBinding(N: string, D: boolean, isGlobal?: boolean): Value {\n    invariant(false, \"abstract method; please override\");\n  }\n\n  CreateImmutableBinding(N: string, S: boolean, isGlobal?: boolean, skipRecord?: boolean): Value {\n    invariant(false, \"abstract method; please override\");\n  }\n\n  InitializeBinding(N: string, V: Value, skipRecord?: boolean): Value {\n    invariant(false, \"abstract method; please override\");\n  }\n\n  SetMutableBinding(N: string, V: Value, S: boolean): Value {\n    invariant(false, \"abstract method; please override\");\n  }\n\n  GetBindingValue(N: string, S: boolean): Value {\n    invariant(false, \"abstract method; please override\");\n  }\n\n  DeleteBinding(N: string): boolean {\n    invariant(false, \"abstract method; please override\");\n  }\n\n  HasThisBinding(): boolean {\n    invariant(false, \"abstract method; please override\");\n  }\n\n  GetThisBinding(): NullValue | ObjectValue | AbstractObjectValue | UndefinedValue {\n    invariant(false, \"abstract method; please override\");\n  }\n\n  HasSuperBinding(): boolean {\n    invariant(false, \"abstract method; please override\");\n  }\n\n  WithBaseObject(): Value {\n    invariant(false, \"abstract method; please override\");\n  }\n\n  BindThisValue(\n    V: NullValue | ObjectValue | AbstractObjectValue | UndefinedValue\n  ): NullValue | ObjectValue | AbstractObjectValue | UndefinedValue {\n    invariant(false, \"abstract method; please override\");\n  }\n}\n\nexport type Binding = {\n  value?: Value,\n  initialized?: boolean,\n  mutable?: boolean,\n  deletable?: boolean,\n  strict?: boolean,\n  // back-references to the environment containing the binding and the key\n  // used to access this binding\n  environment: EnvironmentRecord,\n  name: string,\n  isGlobal: boolean,\n  mightHaveBeenCaptured: boolean,\n  // bindings that are assigned to inside loops with abstract termination conditions need temporal locations\n  phiNode?: AbstractValue,\n  hasLeaked: boolean,\n};\n\n// ECMA262 8.1.1.1\nexport class DeclarativeEnvironmentRecord extends EnvironmentRecord {\n  constructor(realm: Realm) {\n    super(realm);\n    this.bindings = (Object.create(null): any);\n    this.frozen = false;\n  }\n\n  bindings: { [name: string]: Binding };\n  // Frozen Records cannot have bindings created or deleted but can have bindings updated\n  frozen: boolean;\n\n  // ECMA262 8.1.1.1.1\n  HasBinding(N: string): boolean {\n    // 1. Let envRec be the declarative Environment Record for which the method was invoked.\n    let envRec = this;\n\n    // 2. If envRec has a binding for the name that is the value of N, return true.\n    if (envRec.bindings[N]) return true;\n\n    // 3. Return false.\n    return false;\n  }\n\n  // ECMA262 8.1.1.1.2\n  CreateMutableBinding(N: string, D: boolean, isGlobal: boolean = false): Value {\n    invariant(!this.frozen);\n    let realm = this.realm;\n\n    // 1. Let envRec be the declarative Environment Record for which the method was invoked.\n    let envRec = this;\n\n    // 2. Assert: envRec does not already have a binding for N.\n    invariant(!envRec.bindings[N], `shouldn't have the binding ${N}`);\n\n    // 3. Create a mutable binding in envRec for N and record that it is uninitialized. If D is true, record that the newly created binding may be deleted by a subsequent DeleteBinding call.\n    this.bindings[N] = realm.recordModifiedBinding({\n      initialized: false,\n      mutable: true,\n      deletable: D,\n      environment: envRec,\n      name: N,\n      isGlobal: isGlobal,\n      mightHaveBeenCaptured: false,\n      hasLeaked: false,\n    });\n\n    // 4. Return NormalCompletion(empty).\n    return realm.intrinsics.undefined;\n  }\n\n  // ECMA262 8.1.1.1.3\n  CreateImmutableBinding(N: string, S: boolean, isGlobal: boolean = false, skipRecord: boolean = false): Value {\n    invariant(!this.frozen);\n    let realm = this.realm;\n\n    // 1. Let envRec be the declarative Environment Record for which the method was invoked.\n    let envRec = this;\n\n    // 2. Assert: envRec does not already have a binding for N.\n    invariant(!envRec.bindings[N], `shouldn't have the binding ${N}`);\n\n    // 3. Create an immutable binding in envRec for N and record that it is uninitialized. If S is true, record that the newly created binding is a strict binding.\n    let binding = {\n      initialized: false,\n      strict: S,\n      deletable: false,\n      environment: envRec,\n      name: N,\n      isGlobal: isGlobal,\n      mightHaveBeenCaptured: false,\n      hasLeaked: false,\n    };\n    this.bindings[N] = skipRecord ? binding : realm.recordModifiedBinding(binding);\n\n    // 4. Return NormalCompletion(empty).\n    return realm.intrinsics.undefined;\n  }\n\n  // ECMA262 8.1.1.1.4\n  InitializeBinding(N: string, V: Value, skipRecord: boolean = false): Value {\n    // 1. Let envRec be the declarative Environment Record for which the method was invoked.\n    let envRec = this;\n\n    let binding = envRec.bindings[N];\n\n    // 2. Assert: envRec must have an uninitialized binding for N.\n    invariant(binding && binding.initialized !== true, `shouldn't have the binding ${N}`);\n\n    // 3. Set the bound value for N in envRec to V.\n    if (!skipRecord) this.realm.recordModifiedBinding(binding, V).value = V;\n    else binding.value = V;\n\n    // 4. Record that the binding for N in envRec has been initialized.\n    binding.initialized = true;\n\n    // 5. Return NormalCompletion(empty).\n    return this.realm.intrinsics.empty;\n  }\n\n  // ECMA262 8.1.1.1.5\n  SetMutableBinding(N: string, V: Value, _S: boolean): Value {\n    let S = _S;\n    // We can mutate frozen bindings because of captured bindings.\n    let realm = this.realm;\n\n    // 1. Let envRec be the declarative Environment Record for which the method was invoked.\n    let envRec = this;\n\n    let binding = envRec.bindings[N];\n\n    // 2. If envRec does not have a binding for N, then\n    if (!binding) {\n      // a. If S is true, throw a ReferenceError exception.\n      if (S) {\n        throw realm.createErrorThrowCompletion(realm.intrinsics.ReferenceError, `${N} not found`);\n      }\n\n      // b. Perform envRec.CreateMutableBinding(N, true).\n      envRec.CreateMutableBinding(N, true);\n\n      // c. Perform envRec.InitializeBinding(N, V).\n      envRec.InitializeBinding(N, V);\n\n      // d. Return NormalCompletion(empty).\n      return this.realm.intrinsics.empty;\n    }\n\n    // 3. If the binding for N in envRec is a strict binding, let S be true.\n    if (binding.strict === true) S = true;\n\n    // 4. If the binding for N in envRec has not yet been initialized, throw a ReferenceError exception.\n    if (binding.initialized !== true) {\n      throw realm.createErrorThrowCompletion(realm.intrinsics.ReferenceError, `${N} has not yet been initialized`);\n    } else if (binding.mutable) {\n      // 5. Else if the binding for N in envRec is a mutable binding, change its bound value to V.\n      if (binding.hasLeaked) {\n        Leak.value(realm, V);\n        invariant(realm.generator);\n        realm.generator.emitBindingAssignment(binding, V);\n      } else {\n        realm.recordModifiedBinding(binding, V).value = V;\n      }\n    } else {\n      // 6. Else,\n      // a. Assert: This is an attempt to change the value of an immutable binding.\n\n      // b. If S is true, throw a TypeError exception.\n      if (S) {\n        throw realm.createErrorThrowCompletion(realm.intrinsics.TypeError, \"attempt to change immutable binding\");\n      }\n    }\n\n    // 7. Return NormalCompletion(empty).\n    return this.realm.intrinsics.empty;\n  }\n\n  // ECMA262 8.1.1.1.6\n  GetBindingValue(N: string, S: boolean): Value {\n    let realm = this.realm;\n\n    // 1. Let envRec be the declarative Environment Record for which the method was invoked.\n    let envRec = this;\n\n    let binding = envRec.bindings[N];\n\n    // 2. Assert: envRec has a binding for N.\n    invariant(binding, \"expected binding\");\n\n    // 3. If the binding for N in envRec is an uninitialized binding, throw a ReferenceError exception.\n    if (!binding.initialized) {\n      throw realm.createErrorThrowCompletion(realm.intrinsics.ReferenceError);\n    }\n\n    // 4. Return the value currently bound to N in envRec.\n    if (binding.hasLeaked && binding.mutable) {\n      return deriveGetBinding(realm, binding);\n    }\n    invariant(binding.value);\n    return binding.value;\n  }\n\n  // ECMA262 8.1.1.1.7\n  DeleteBinding(N: string): boolean {\n    invariant(!this.frozen);\n    // 1. Let envRec be the declarative Environment Record for which the method was invoked.\n    let envRec = this;\n\n    // 2. Assert: envRec has a binding for the name that is the value of N.\n    invariant(envRec.bindings[N], \"expected binding to exist\");\n\n    // 3. If the binding for N in envRec cannot be deleted, return false.\n    if (!envRec.bindings[N].deletable) return false;\n\n    // 4. Remove the binding for N from envRec.\n    this.realm.recordModifiedBinding(envRec.bindings[N]).value = undefined;\n    delete envRec.bindings[N];\n\n    // 5. Return true.\n    return true;\n  }\n\n  // ECMA262 8.1.1.1.8\n  HasThisBinding(): boolean {\n    // 1. Return false.\n    return false;\n  }\n\n  // ECMA262 8.1.1.1.9\n  HasSuperBinding(): boolean {\n    // 1. Return false.\n    return false;\n  }\n\n  // ECMA262 8.1.1.1.10\n  WithBaseObject(): Value {\n    // 1. Return undefined.\n    return this.realm.intrinsics.undefined;\n  }\n}\n\n// ECMA262 8.1.1.2\nexport class ObjectEnvironmentRecord extends EnvironmentRecord {\n  object: ObjectValue | AbstractObjectValue;\n  withEnvironment: boolean;\n\n  constructor(realm: Realm, obj: ObjectValue | AbstractObjectValue) {\n    super(realm);\n    this.object = obj;\n  }\n\n  // ECMA262 8.1.1.2.1\n  HasBinding(N: string): boolean {\n    let realm = this.realm;\n\n    // 1. Let envRec be the object Environment Record for which the method was invoked.\n    let envRec = this;\n\n    // 2. Let bindings be the binding object for envRec.\n    let bindings = this.object;\n\n    // 3. Let foundBinding be ? HasProperty(bindings, N).\n    let foundBinding = HasProperty(realm, bindings, N);\n\n    // 4. If foundBinding is false, return false.\n    if (!foundBinding) return false;\n\n    // 5. If the withEnvironment flag of envRec is false, return true.\n    if (!envRec.withEnvironment) return true;\n\n    // 6. Let unscopables be ? Get(bindings, @@unscopables).\n    let unscopables = Get(realm, bindings, realm.intrinsics.SymbolUnscopables);\n\n    // 7. If Type(unscopables) is Object, then\n    if (unscopables instanceof ObjectValue || unscopables instanceof AbstractObjectValue) {\n      // a. Let blocked be ToBoolean(? Get(unscopables, N)).\n      let blocked = To.ToBooleanPartial(realm, Get(realm, unscopables, N));\n\n      // b. If blocked is true, return false.\n      if (blocked) return false;\n    }\n    unscopables.throwIfNotConcrete();\n\n    // 8. Return true.\n    return true;\n  }\n\n  // ECMA262 8.1.1.2.2\n  CreateMutableBinding(N: string, D: boolean): Value {\n    let realm = this.realm;\n\n    // 1. Let envRec be the object Environment Record for which the method was invoked.\n    let envRec = this;\n\n    // 2. Let bindings be the binding object for envRec.\n    let bindings = envRec.object;\n\n    // 3. If D is true, let configValue be true; otherwise let configValue be false.\n    let configValue = D ? true : false;\n\n    // 4. Return ? DefinePropertyOrThrow(bindings, N, PropertyDescriptor{[[Value]]: undefined, [[Writable]]: true, [[Enumerable]]: true, [[Configurable]]: configValue}).\n    return new BooleanValue(\n      realm,\n      Properties.DefinePropertyOrThrow(\n        realm,\n        bindings,\n        N,\n        new PropertyDescriptor({\n          value: realm.intrinsics.undefined,\n          writable: true,\n          enumerable: true,\n          configurable: configValue,\n        })\n      )\n    );\n  }\n\n  // ECMA262 8.1.1.2.3\n  CreateImmutableBinding(N: string, S: boolean): Value {\n    // The concrete Environment Record method CreateImmutableBinding is never used within this specification in association with object Environment Records.\n    invariant(false);\n  }\n\n  // ECMA262 8.1.1.2.4\n  InitializeBinding(N: string, V: Value): Value {\n    // 1. Let envRec be the object Environment Record for which the method was invoked.\n    let envRec = this;\n\n    // 2. Assert: envRec must have an uninitialized binding for N.\n    // 3. Record that the binding for N in envRec has been initialized.\n\n    // 4. Return ? envRec.SetMutableBinding(N, V, false).\n    return envRec.SetMutableBinding(N, V, false);\n  }\n\n  // ECMA262 8.1.1.2.5\n  SetMutableBinding(N: string, V: Value, S: boolean): Value {\n    let realm = this.realm;\n\n    // 1. Let envRec be the object Environment Record for which the method was invoked.\n    let envRec = this;\n\n    // 2. Let bindings be the binding object for envRec.\n    let bindings = envRec.object;\n\n    // 3. Return ? Set(bindings, N, V, S).\n    return new BooleanValue(realm, Properties.Set(realm, bindings, N, V, S));\n  }\n\n  // ECMA262 8.1.1.2.6\n  GetBindingValue(N: string, S: boolean): Value {\n    let realm = this.realm;\n\n    // 1. Let envRec be the object Environment Record for which the method was invoked.\n    let envRec = this;\n\n    // 2. Let bindings be the binding object for envRec.\n    let bindings = envRec.object;\n\n    // 3. Let value be ? HasProperty(bindings, N).\n    let value = HasProperty(realm, bindings, N);\n\n    // 4. If value is false, then\n    if (!value) {\n      // a. If S is false, return the value undefined; otherwise throw a ReferenceError exception.\n      if (!S) {\n        return realm.intrinsics.undefined;\n      } else {\n        throw realm.createErrorThrowCompletion(realm.intrinsics.ReferenceError);\n      }\n    }\n\n    // 5. Return ? Get(bindings, N).\n    return Get(realm, bindings, N);\n  }\n\n  // ECMA262 8.1.1.2.7\n  DeleteBinding(N: string): boolean {\n    // 1. Let envRec be the object Environment Record for which the method was invoked.\n    let envRec = this;\n\n    // 2. Let bindings be the binding object for envRec.\n    let bindings = envRec.object;\n\n    // 3. Return ? bindings.[[Delete]](N).\n    return bindings.$Delete(N);\n  }\n\n  // ECMA262 8.1.1.2.8\n  HasThisBinding(): boolean {\n    // 1. Return false.\n    return false;\n  }\n\n  // ECMA262 8.1.1.2.9\n  HasSuperBinding(): boolean {\n    // 1. Return false.\n    return false;\n  }\n\n  // ECMA262 8.1.1.2.10\n  WithBaseObject(): Value {\n    // 1. Let envRec be the object Environment Record for which the method was invoked.\n    let envRec = this;\n\n    // 2. If the withEnvironment flag of envRec is true, return the binding object for envRec.\n    if (envRec.withEnvironment) return envRec.object;\n\n    // 3. Otherwise, return undefined.\n    return this.realm.intrinsics.undefined;\n  }\n}\n\n// ECMA262 8.1.1.3\nexport class FunctionEnvironmentRecord extends DeclarativeEnvironmentRecord {\n  $ThisBindingStatus: \"lexical\" | \"initialized\" | \"uninitialized\";\n  $ThisValue: UndefinedValue | NullValue | ObjectValue | AbstractObjectValue;\n  $HomeObject: void | ObjectValue;\n  $FunctionObject: FunctionValue;\n\n  // ECMA262 8.1.1.3.1\n  BindThisValue(\n    V: NullValue | ObjectValue | AbstractObjectValue | UndefinedValue\n  ): NullValue | ObjectValue | AbstractObjectValue | UndefinedValue {\n    let realm = this.realm;\n\n    // 1. Let envRec be the function Environment Record for which the method was invoked.\n    let envRec = this;\n\n    // 2. Assert: envRec.[[ThisBindingStatus]] is not \"lexical\".\n    invariant(envRec.$ThisBindingStatus !== \"lexical\", \"this binding status shouldn't be lexical\");\n\n    // 3. If envRec.[[ThisBindingStatus]] is \"initialized\", throw a ReferenceError exception.\n    if (envRec.$ThisBindingStatus === \"initialized\") {\n      throw realm.createErrorThrowCompletion(realm.intrinsics.ReferenceError);\n    }\n\n    // 4. Set envRec.[[ThisValue]] to V.\n    envRec.$ThisValue = V;\n\n    // 5. Set envRec.[[ThisBindingStatus]] to \"initialized\".\n    envRec.$ThisBindingStatus = \"initialized\";\n\n    // 6. Return V.\n    return V;\n  }\n\n  // ECMA262 8.1.1.3.2\n  HasThisBinding(): boolean {\n    // 1. Let envRec be the function Environment Record for which the method was invoked.\n    let envRec = this;\n\n    // 2. If envRec.[[ThisBindingStatus]] is \"lexical\", return false; otherwise, return true.\n    return envRec.$ThisBindingStatus === \"lexical\" ? false : true;\n  }\n\n  // ECMA262 8.1.1.3.3\n  HasSuperBinding(): boolean {\n    // 1. Let envRec be the function Environment Record for which the method was invoked.\n    let envRec = this;\n\n    // 2. If envRec.[[ThisBindingStatus]] is \"lexical\", return false.\n    if (envRec.$ThisBindingStatus === \"lexical\") return false;\n\n    // 3. If envRec.[[HomeObject]] has the value undefined, return false; otherwise, return true.\n    if (envRec.$HomeObject === undefined) {\n      return false;\n    } else {\n      return true;\n    }\n  }\n\n  // ECMA262 8.1.1.3.4\n  GetThisBinding(): NullValue | ObjectValue | AbstractObjectValue | UndefinedValue {\n    let realm = this.realm;\n\n    // 1. Let envRec be the function Environment Record for which the method was invoked.\n    let envRec = this;\n\n    // 2. Assert: envRec.[[ThisBindingStatus]] is not \"lexical\".\n    invariant(envRec.$ThisBindingStatus !== \"lexical\", \"this binding status shouldn't be lexical\");\n\n    // 3. If envRec.[[ThisBindingStatus]] is \"uninitialized\", throw a ReferenceError exception.\n    if (envRec.$ThisBindingStatus === \"uninitialized\") {\n      throw realm.createErrorThrowCompletion(realm.intrinsics.ReferenceError);\n    }\n\n    // 4. Return envRec.[[ThisValue]].\n    return envRec.$ThisValue;\n  }\n\n  // ECMA262 8.1.1.3.5\n  GetSuperBase(): ObjectValue | AbstractObjectValue | NullValue | UndefinedValue {\n    // 1. Let envRec be the function Environment Record for which the method was invoked.\n    let envRec = this;\n\n    // 2. Let home be the value of envRec.[[HomeObject]].\n    let home = envRec.$HomeObject;\n\n    // 3. If home has the value undefined, return undefined.\n    if (home === undefined) return this.realm.intrinsics.undefined;\n\n    // 4. Assert: Type(home) is Object.\n    invariant(home instanceof ObjectValue, \"expected object value\");\n\n    // 5. Return ? home.[[GetPrototypeOf]]().\n    return home.$GetPrototypeOf();\n  }\n}\n\n// ECMA262 8.1.1.4\nexport class GlobalEnvironmentRecord extends EnvironmentRecord {\n  $DeclarativeRecord: EnvironmentRecord;\n  $ObjectRecord: ObjectEnvironmentRecord;\n  $VarNames: Array<string>;\n  $GlobalThisValue: ObjectValue;\n\n  // ECMA262 8.1.1.4.1\n  HasBinding(N: string): boolean {\n    // 1. Let envRec be the global Environment Record for which the method was invoked.\n    let envRec = this;\n\n    // 2. Let DclRec be envRec.[[DeclarativeRecord]].\n    let DclRec = envRec.$DeclarativeRecord;\n\n    // 3. If DclRec.HasBinding(N) is true, return true.\n    if (DclRec.HasBinding(N)) return true;\n\n    // 4. Let ObjRec be envRec.[[ObjectRecord]].\n    let ObjRec = envRec.$ObjectRecord;\n\n    // 5. Return ? ObjRec.HasBinding(N).\n    return ObjRec.HasBinding(N);\n  }\n\n  // ECMA262 8.1.1.4.2\n  CreateMutableBinding(N: string, D: boolean): Value {\n    let realm = this.realm;\n\n    // 1. Let envRec be the global Environment Record for which the method was invoked.\n    let envRec = this;\n\n    // 2. Let DclRec be envRec.[[DeclarativeRecord]].\n    let DclRec = envRec.$DeclarativeRecord;\n\n    // 3. If DclRec.HasBinding(N) is true, throw a TypeError exception.\n    if (DclRec.HasBinding(N)) {\n      throw realm.createErrorThrowCompletion(realm.intrinsics.TypeError);\n    }\n\n    // 4. Return DclRec.CreateMutableBinding(N, D).\n    return DclRec.CreateMutableBinding(N, D, true);\n  }\n\n  // ECMA262 8.1.1.4.3\n  CreateImmutableBinding(N: string, S: boolean): Value {\n    let realm = this.realm;\n\n    // 1. Let envRec be the global Environment Record for which the method was invoked.\n    let envRec = this;\n\n    // 2. Let DclRec be envRec.[[DeclarativeRecord]].\n    let DclRec = envRec.$DeclarativeRecord;\n\n    // 3. If DclRec.HasBinding(N) is true, throw a TypeError exception.\n    if (DclRec.HasBinding(N)) {\n      throw realm.createErrorThrowCompletion(realm.intrinsics.TypeError);\n    }\n\n    // 4. Return DclRec.CreateImmutableBinding(N, S).\n    return DclRec.CreateImmutableBinding(N, S, true);\n  }\n\n  // ECMA262 8.1.1.4.4\n  InitializeBinding(N: string, V: Value): Value {\n    // 1. Let envRec be the global Environment Record for which the method was invoked.\n    let envRec = this;\n\n    // 2. Let DclRec be envRec.[[DeclarativeRecord]].\n    let DclRec = envRec.$DeclarativeRecord;\n\n    // 3. If DclRec.HasBinding(N) is true, then\n    if (DclRec.HasBinding(N)) {\n      // a. Return DclRec.InitializeBinding(N, V).\n      return DclRec.InitializeBinding(N, V);\n    }\n\n    // 4. Assert: If the binding exists, it must be in the object Environment Record.\n\n    // 5. Let ObjRec be envRec.[[ObjectRecord]].\n    let ObjRec = envRec.$ObjectRecord;\n\n    // 6. Return ? ObjRec.InitializeBinding(N, V).\n    return ObjRec.InitializeBinding(N, V);\n  }\n\n  // ECMA262 8.1.1.4.5\n  SetMutableBinding(N: string, V: Value, S: boolean): Value {\n    // 1. Let envRec be the global Environment Record for which the method was invoked.\n    let envRec = this;\n\n    // 2. Let DclRec be envRec.[[DeclarativeRecord]].\n    let DclRec = envRec.$DeclarativeRecord;\n\n    // 3. If DclRec.HasBinding(N) is true, then\n    if (DclRec.HasBinding(N)) {\n      // a. Return DclRec.SetMutableBinding(N, V, S).\n      return DclRec.SetMutableBinding(N, V, S);\n    }\n\n    // 4. Let ObjRec be envRec.[[ObjectRecord]].\n    let ObjRec = envRec.$ObjectRecord;\n\n    // 5. Return ? ObjRec.SetMutableBinding(N, V, S).\n    return ObjRec.SetMutableBinding(N, V, S);\n  }\n\n  // ECMA262 8.1.1.4.6\n  GetBindingValue(N: string, S: boolean): Value {\n    // 1. Let envRec be the global Environment Record for which the method was invoked.\n    let envRec = this;\n\n    // 2. Let DclRec be envRec.[[DeclarativeRecord]].\n    let DclRec = envRec.$DeclarativeRecord;\n\n    // 3. If DclRec.HasBinding(N) is true, then\n    if (DclRec.HasBinding(N)) {\n      // a. Return DclRec.GetBindingValue(N, S).\n      return DclRec.GetBindingValue(N, S);\n    }\n\n    // 4. Let ObjRec be envRec.[[ObjectRecord]].\n    let ObjRec = envRec.$ObjectRecord;\n\n    // 5. Return ? ObjRec.GetBindingValue(N, S).\n    return ObjRec.GetBindingValue(N, S);\n  }\n\n  // ECMA262 8.1.1.4.7\n  DeleteBinding(N: string): boolean {\n    let realm = this.realm;\n\n    // 1. Let envRec be the global Environment Record for which the method was invoked.\n    let envRec = this;\n\n    // 2. Let DclRec be envRec.[[DeclarativeRecord]].\n    let DclRec = envRec.$DeclarativeRecord;\n\n    // 3. If DclRec.HasBinding(N) is true, then\n    if (DclRec.HasBinding(N)) {\n      // a. Return DclRec.DeleteBinding(N).\n      return DclRec.DeleteBinding(N);\n    }\n\n    // 4. Let ObjRec be envRec.[[ObjectRecord]].\n    let ObjRec = envRec.$ObjectRecord;\n\n    // 5. Let globalObject be the binding object for ObjRec.\n    let globalObject = ObjRec.object;\n\n    // 6. Let existingProp be ? HasOwnProperty(globalObject, N).\n    let existingProp = HasOwnProperty(realm, globalObject, N);\n\n    // 7. If existingProp is true, then\n    if (existingProp) {\n      // a. Let status be ? ObjRec.DeleteBinding(N).\n      let status = ObjRec.DeleteBinding(N);\n\n      // b. If status is true, then\n      if (status) {\n        // i. Let varNames be envRec.[[VarNames]].\n        let varNames = envRec.$VarNames;\n\n        // ii. If N is an element of varNames, remove that element from the varNames.\n        if (varNames.indexOf(N) >= 0) {\n          varNames.splice(varNames.indexOf(N), 1);\n        }\n      }\n\n      // c. Return status.\n      return status;\n    }\n\n    // 8. Return true.\n    return true;\n  }\n\n  // ECMA262 8.1.1.4.8\n  HasThisBinding(): boolean {\n    // 1. Return true.\n    return true;\n  }\n\n  // ECMA262 8.1.1.4.9\n  HasSuperBinding(): boolean {\n    // 1. Return true.\n    return true;\n  }\n\n  // ECMA262 8.1.1.4.10\n  WithBaseObject(): Value {\n    // 1. Return undefined.\n    return this.realm.intrinsics.undefined;\n  }\n\n  // ECMA262 8.1.1.4.11\n  GetThisBinding(): NullValue | ObjectValue | AbstractObjectValue | UndefinedValue {\n    // 1. Let envRec be the global Environment Record for which the method was invoked.\n    let envRec = this;\n\n    invariant(envRec.$GlobalThisValue);\n    // 2. Return envRec.[[GlobalThisValue]].\n    return envRec.$GlobalThisValue;\n  }\n\n  // ECMA262 8.1.1.4.12\n  HasVarDeclaration(N: string): boolean {\n    // 1. Let envRec be the global Environment Record for which the method was invoked.\n    let envRec = this;\n\n    // 2. Let varDeclaredNames be envRec.[[VarNames]].\n    let varDeclaredNames = envRec.$VarNames;\n\n    // 3. If varDeclaredNames contains the value of N, return true.\n    if (varDeclaredNames.indexOf(N) >= 0) return true;\n\n    // 4. Return false.\n    return false;\n  }\n\n  // ECMA262 8.1.1.4.13\n  HasLexicalDeclaration(N: string): boolean {\n    // 1. Let envRec be the global Environment Record for which the method was invoked.\n    let envRec = this;\n\n    // 2. Let DclRec be envRec.[[DeclarativeRecord]].\n    let DclRec = envRec.$DeclarativeRecord;\n\n    // 3. Return DclRec.HasBinding(N).\n    return DclRec.HasBinding(N);\n  }\n\n  // ECMA262 8.1.1.4.14\n  HasRestrictedGlobalProperty(N: string): boolean {\n    // 1. Let envRec be the global Environment Record for which the method was invoked.\n    let envRec = this;\n\n    // 2. Let ObjRec be envRec.[[ObjectRecord]].\n    let ObjRec = envRec.$ObjectRecord;\n\n    // 3. Let globalObject be the binding object for ObjRec.\n    let globalObject = ObjRec.object;\n\n    // 4. Let existingProp be ? globalObject.[[GetOwnProperty]](N).\n    let existingProp = globalObject.$GetOwnProperty(N);\n\n    // 5. If existingProp is undefined, return false.\n    if (!existingProp) return false;\n    Properties.ThrowIfMightHaveBeenDeleted(existingProp);\n    existingProp = existingProp.throwIfNotConcrete(globalObject.$Realm);\n\n    // 6. If existingProp.[[Configurable]] is true, return false.\n    if (existingProp.configurable) return false;\n\n    // 7. Return true.\n    return true;\n  }\n\n  // ECMA262 8.1.1.4.15\n  CanDeclareGlobalVar(N: string): boolean {\n    let realm = this.realm;\n\n    // 1. Let envRec be the global Environment Record for which the method was invoked.\n    let envRec = this;\n\n    // 2. Let ObjRec be envRec.[[ObjectRecord]].\n    let ObjRec = envRec.$ObjectRecord;\n\n    // 3. Let globalObject be the binding object for ObjRec.\n    let globalObject = ObjRec.object;\n\n    // 4. Let hasProperty be ? HasOwnProperty(globalObject, N).\n    let hasProperty = HasOwnProperty(realm, globalObject, N);\n\n    // 5. If hasProperty is true, return true.\n    if (hasProperty) return true;\n\n    // 6. Return ? IsExtensible(globalObject).\n    return IsExtensible(realm, globalObject);\n  }\n\n  // ECMA262 8.1.1.4.16\n  CanDeclareGlobalFunction(N: string): boolean {\n    let realm = this.realm;\n\n    // 1. Let envRec be the global Environment Record for which the method was invoked.\n    let envRec = this;\n\n    // 2. Let ObjRec be envRec.[[ObjectRecord]].\n    let ObjRec = envRec.$ObjectRecord;\n\n    // 3. Let globalObject be the binding object for ObjRec.\n    let globalObject = ObjRec.object;\n\n    // 4. Let existingProp be ? globalObject.[[GetOwnProperty]](N).\n    let existingProp = globalObject.$GetOwnProperty(N);\n\n    // 5. If existingProp is undefined, return ? IsExtensible(globalObject).\n    if (!existingProp) return IsExtensible(realm, globalObject);\n    Properties.ThrowIfMightHaveBeenDeleted(existingProp);\n    existingProp = existingProp.throwIfNotConcrete(globalObject.$Realm);\n\n    // 6. If existingProp.[[Configurable]] is true, return true.\n    if (existingProp.configurable) return true;\n\n    // 7. If IsDataDescriptor(existingProp) is true and existingProp has attribute values {[[Writable]]: true, [[Enumerable]]: true}, return true.\n    if (IsDataDescriptor(realm, existingProp) && existingProp.writable && existingProp.enumerable) {\n      return true;\n    }\n\n    // 8. Return false.\n    return false;\n  }\n\n  // ECMA262 8.1.1.4.17\n  CreateGlobalVarBinding(N: string, D: boolean) {\n    let realm = this.realm;\n\n    // 1. Let envRec be the global Environment Record for which the method was invoked.\n    let envRec = this;\n\n    // 2. Let ObjRec be envRec.[[ObjectRecord]].\n    let ObjRec = envRec.$ObjectRecord;\n\n    // 3. Let globalObject be the binding object for ObjRec.\n    let globalObject = ObjRec.object;\n\n    // 4. Let hasProperty be ? HasOwnProperty(globalObject, N).\n    let hasProperty = HasOwnProperty(realm, globalObject, N);\n\n    // 5. Let extensible be ? IsExtensible(globalObject).\n    let extensible = IsExtensible(realm, globalObject);\n\n    // 6. If hasProperty is false and extensible is true, then\n    if (!hasProperty && extensible) {\n      // a. Perform ? ObjRec.CreateMutableBinding(N, D).\n      ObjRec.CreateMutableBinding(N, D);\n\n      // b. Perform ? ObjRec.InitializeBinding(N, undefined).\n      ObjRec.InitializeBinding(N, this.realm.intrinsics.undefined);\n    }\n\n    // 7. Let varDeclaredNames be envRec.[[VarNames]].\n    let varDeclaredNames = envRec.$VarNames;\n\n    // 8. If varDeclaredNames does not contain the value of N, then\n    if (varDeclaredNames.indexOf(N) < 0) {\n      // a. Append N to varDeclaredNames.\n      varDeclaredNames.push(N);\n    }\n\n    // 9. Return NormalCompletion(empty).\n  }\n\n  // ECMA262 8.1.1.4.18\n  CreateGlobalFunctionBinding(N: string, V: Value, D: boolean): void {\n    // 1. Let envRec be the global Environment Record for which the method was invoked.\n    let envRec = this;\n\n    // 2. Let ObjRec be envRec.[[ObjectRecord]].\n    let ObjRec = envRec.$ObjectRecord;\n\n    // 3. Let globalObject be the binding object for ObjRec.\n    let globalObject = ObjRec.object;\n\n    // 4. Let existingProp be ? globalObject.[[GetOwnProperty]](N).\n    let existingProp = globalObject.$GetOwnProperty(N);\n    if (existingProp) {\n      existingProp = existingProp.throwIfNotConcrete(globalObject.$Realm);\n    }\n\n    // 5. If existingProp is undefined or existingProp.[[Configurable]] is true, then\n    let desc;\n    if (!existingProp || existingProp.configurable) {\n      // a. Let desc be the PropertyDescriptor{[[Value]]: V, [[Writable]]: true, [[Enumerable]]: true, [[Configurable]]: D}.\n      desc = new PropertyDescriptor({ value: V, writable: true, enumerable: true, configurable: D });\n    } else {\n      // 6. Else,\n      Properties.ThrowIfMightHaveBeenDeleted(existingProp);\n      // a. Let desc be the PropertyDescriptor{[[Value]]: V }.\n      desc = new PropertyDescriptor({ value: V });\n    }\n\n    // 7. Perform ? DefinePropertyOrThrow(globalObject, N, desc).\n    Properties.DefinePropertyOrThrow(this.realm, globalObject, N, desc);\n\n    // 8. Record that the binding for N in ObjRec has been initialized.\n\n    // 9. Perform ? Set(globalObject, N, V, false).\n    Properties.Set(this.realm, globalObject, N, V, false);\n\n    // 10. Let varDeclaredNames be envRec.[[VarNames]].\n    let varDeclaredNames = envRec.$VarNames;\n\n    // 11. If varDeclaredNames does not contain the value of N, then\n    if (varDeclaredNames.indexOf(N) < 0) {\n      // a. Append N to varDeclaredNames.\n      varDeclaredNames.push(N);\n    }\n\n    // 12. Return NormalCompletion(empty).\n  }\n}\n\n// ECMA262 8.1\nlet uid = 0;\nexport class LexicalEnvironment {\n  constructor(realm: Realm) {\n    invariant(realm, \"expected realm\");\n    this.realm = realm;\n    this.destroyed = false;\n    this._uid = uid++;\n  }\n\n  // For debugging it is convenient to have an ID for each of these.\n  _uid: number;\n  destroyed: boolean;\n  environmentRecord: EnvironmentRecord;\n  parent: null | LexicalEnvironment;\n  realm: Realm;\n\n  destroy(): void {\n    this.destroyed = true;\n    // Once the containing environment is destroyed, we can no longer add or remove entries from the environmentRecord\n    // (but we can update existing values).\n    if (this.environmentRecord instanceof DeclarativeEnvironmentRecord) {\n      this.environmentRecord.frozen = true;\n    }\n  }\n\n  assignToGlobal(globalAst: BabelNodeLVal, rvalue: Value): void {\n    let globalValue = this.evaluate(globalAst, false);\n    Properties.PutValue(this.realm, globalValue, rvalue);\n  }\n\n  evaluateCompletionDeref(ast: BabelNode, strictCode: boolean, metadata?: any): AbruptCompletion | Value {\n    let result = this.evaluateCompletion(ast, strictCode, metadata);\n    if (result instanceof Reference) result = Environment.GetValue(this.realm, result);\n    return result;\n  }\n\n  evaluateCompletion(ast: BabelNode, strictCode: boolean, metadata?: any): AbruptCompletion | Value | Reference {\n    try {\n      return this.evaluate(ast, strictCode, metadata);\n    } catch (err) {\n      if (err instanceof AbruptCompletion) return err;\n      if (err instanceof Error)\n        // rethrowing Error should preserve stack trace\n        throw err;\n      // let's wrap into a proper Error to create stack trace\n      throw new FatalError(err);\n    }\n  }\n\n  evaluateAbstractCompletion(ast: BabelNode, strictCode: boolean, metadata?: any): Completion | Value | Reference {\n    try {\n      return this.evaluateAbstract(ast, strictCode, metadata);\n    } catch (err) {\n      if (err instanceof Completion) return err;\n      if (err instanceof Error)\n        // rethrowing Error should preserve stack trace\n        throw err;\n      // let's wrap into a proper Error to create stack trace\n      if (err instanceof Object) throw new FatalError(err.constructor.name + \": \" + err);\n      throw new FatalError(err);\n    }\n  }\n\n  concatenateAndParse(\n    sources: Array<SourceFile>,\n    sourceType: SourceType = \"script\"\n  ): [BabelNodeFile, { [string]: string }] {\n    let asts = [];\n    let code = {};\n    let directives = [];\n    for (let source of sources) {\n      try {\n        let node = this.realm.statistics.parsing.measure(() =>\n          parse(this.realm, source.fileContents, source.filePath, sourceType)\n        );\n\n        let sourceMapContents = source.sourceMapContents;\n        if (sourceMapContents && sourceMapContents.length > 0) {\n          this.realm.statistics.fixupSourceLocations.measure(() => this.fixupSourceLocations(node, sourceMapContents));\n        }\n\n        this.realm.statistics.fixupFilenames.measure(() => this.fixupFilenames(node));\n\n        asts = asts.concat(node.program.body);\n        code[source.filePath] = source.fileContents;\n        directives = directives.concat(node.program.directives);\n      } catch (e) {\n        if (e instanceof ThrowCompletion) {\n          let error = e.value;\n          if (error instanceof ObjectValue) {\n            let message = error._SafeGetDataPropertyValue(\"message\");\n            if (message instanceof StringValue) {\n              message.value = `Syntax error: ${message.value}`;\n              e.location.source = source.filePath;\n              // the position was not located properly on the\n              // syntax errors happen on one given position, so start position = end position\n              e.location.start = { line: e.location.line, column: e.location.column };\n              e.location.end = { line: e.location.line, column: e.location.column };\n              let diagnostic = new CompilerDiagnostic(message.value, e.location, \"PP1004\", \"FatalError\");\n              this.realm.handleError(diagnostic);\n              throw new FatalError(message.value);\n            }\n          }\n        }\n        throw e;\n      }\n    }\n    return [t.file(t.program(asts, directives)), code];\n  }\n\n  executeSources(\n    sources: Array<SourceFile>,\n    sourceType: SourceType = \"script\",\n    onParse: void | (BabelNodeFile => void) = undefined\n  ): [AbruptCompletion | Value, { [string]: string }] {\n    let context = new ExecutionContext();\n    context.lexicalEnvironment = this;\n    context.variableEnvironment = this;\n    context.realm = this.realm;\n    this.realm.pushContext(context);\n    let res, code;\n    try {\n      let ast;\n      [ast, code] = this.concatenateAndParse(sources, sourceType);\n      if (onParse) onParse(ast);\n      res = this.realm.statistics.evaluation.measure(() => this.evaluateCompletion(ast, false));\n    } finally {\n      this.realm.popContext(context);\n      this.realm.onDestroyScope(context.lexicalEnvironment);\n      if (!this.destroyed) this.realm.onDestroyScope(this);\n      invariant(\n        this.realm.activeLexicalEnvironments.size === 0,\n        `expected 0 active lexical environments, got ${this.realm.activeLexicalEnvironments.size}`\n      );\n    }\n    if (res instanceof AbruptCompletion) return [res, code];\n\n    return [Environment.GetValue(this.realm, res), code];\n  }\n\n  execute(\n    code: string,\n    filename: string,\n    map: string = \"\",\n    sourceType: SourceType = \"script\",\n    onParse: void | (BabelNodeFile => void) = undefined\n  ): AbruptCompletion | Value {\n    let context = new ExecutionContext();\n    context.lexicalEnvironment = this;\n    context.variableEnvironment = this;\n    context.realm = this.realm;\n\n    this.realm.pushContext(context);\n\n    let ast, res;\n    try {\n      try {\n        ast = parse(this.realm, code, filename, sourceType);\n      } catch (e) {\n        if (e instanceof ThrowCompletion) return e;\n        throw e;\n      }\n      if (onParse) onParse(ast);\n      if (map.length > 0) this.fixupSourceLocations(ast, map);\n      this.fixupFilenames(ast);\n      res = this.evaluateCompletion(ast, false);\n    } finally {\n      this.realm.popContext(context);\n      // Avoid destroying \"this\" scope as execute may be called many times.\n      if (context.lexicalEnvironment !== this) this.realm.onDestroyScope(context.lexicalEnvironment);\n      invariant(\n        this.realm.activeLexicalEnvironments.size === 1,\n        `expected 1 active lexical environment, got ${this.realm.activeLexicalEnvironments.size}`\n      );\n    }\n    if (res instanceof AbruptCompletion) return res;\n\n    return Environment.GetValue(this.realm, res);\n  }\n\n  fixupSourceLocations(ast: BabelNode, map: string): void {\n    invariant(ast.loc);\n    const source = ast.loc.source;\n    invariant(source !== undefined);\n    const positionInfos = new Map();\n\n    const smc = new SourceMapConsumer(map);\n    traverseFast(ast, node => {\n      fixupLocation(node.loc);\n      fixupComments(node.leadingComments);\n      fixupComments(node.innerComments);\n      fixupComments(node.trailingComments);\n      return false;\n    });\n\n    type PositionInfo = {\n      originalPosition: NullableMappedPosition,\n      newLine: number,\n      newColumn: number,\n      rewritten: boolean,\n    };\n    function getPositionInfo(position: BabelNodePosition): PositionInfo {\n      let info = positionInfos.get(position);\n      if (info === undefined)\n        positionInfos.set(\n          position,\n          (info = {\n            originalPosition: smc.originalPositionFor(position),\n            newLine: position.line,\n            newColumn: position.column,\n            rewritten: false,\n          })\n        );\n      return info;\n    }\n    function fixupPosition(pos: BabelNodePosition, posInfo: PositionInfo, otherInfo: PositionInfo): void {\n      if (posInfo.rewritten) return;\n      let posOriginalPosition = posInfo.originalPosition;\n      if (posOriginalPosition.source == null) {\n        invariant(otherInfo.originalPosition.source != null);\n\n        let deltaLine = posInfo.newLine - otherInfo.newLine;\n        pos.line = Math.max(1, otherInfo.originalPosition.line + deltaLine);\n\n        let deltaColumn = posInfo.newColumn - otherInfo.newColumn;\n        pos.column = Math.max(0, otherInfo.originalPosition.column + deltaColumn);\n      } else {\n        invariant(typeof posOriginalPosition.line === \"number\");\n        pos.line = posOriginalPosition.line;\n        invariant(typeof posOriginalPosition.column === \"number\");\n        pos.column = posOriginalPosition.column;\n      }\n      posInfo.rewritten = true;\n    }\n    function fixupLocation(loc: ?BabelNodeSourceLocation): void {\n      if (loc == null) return;\n      // Bail out when location already got fixed up or doesn't have source\n      if (loc.source === undefined || loc.source !== source) return;\n\n      let locStart = loc.start;\n      let locEnd = loc.end;\n      let startInfo = getPositionInfo(locStart);\n      let endInfo = getPositionInfo(locEnd);\n      let startOriginalPosition = startInfo.originalPosition;\n      let endOriginalPosition = endInfo.originalPosition;\n\n      // Sanity checks on the positions supplied directly by the Babel parser\n      invariant(startInfo.newLine <= endInfo.newLine);\n      invariant(startInfo.newLine !== endInfo.newLine || startInfo.newColumn <= endInfo.newColumn);\n\n      let originalSource = startOriginalPosition.source || endOriginalPosition.source;\n      if (originalSource) {\n        fixupPosition(locStart, startInfo, endInfo);\n        fixupPosition(locEnd, endInfo, startInfo);\n\n        // NOTE: Babel only persists the start position of most nodes in source maps\n        // (only block statements also get their end positions persisted).\n        // Thus, end positions tend to be mostly wrong (in fact often so wrong\n        // that they point before the start position).\n        // The best way to deal with that is to never print end positions in user-facing\n        // messages, or use them for any reason.\n\n        invariant(loc.source !== originalSource);\n        loc.source = originalSource;\n      }\n    }\n    function fixupComments(comments: ?Array<BabelNodeComment>) {\n      if (!comments) return;\n      for (let c of comments) fixupLocation(c.loc);\n    }\n  }\n\n  fixupFilenames(ast: BabelNode): void {\n    traverseFast(ast, node => {\n      let loc = node.loc;\n      if (loc && loc.source) (loc: any).filename = loc.source;\n      else node.loc = null;\n      fixupComments(node.leadingComments);\n      fixupComments(node.innerComments);\n      fixupComments(node.trailingComments);\n      return false;\n    });\n\n    function fixupComments(comments: ?Array<BabelNodeComment>): void {\n      if (!comments) return;\n      for (let c of comments) {\n        let loc = c.loc;\n        if (loc && loc.source) (loc: any).filename = loc.source;\n        else (c: any).loc = null;\n      }\n    }\n  }\n\n  evaluate(ast: BabelNode, strictCode: boolean, metadata?: any): Value | Reference {\n    if (this.realm.debuggerInstance) {\n      this.realm.debuggerInstance.checkForActions(ast);\n    }\n    if (this.realm.debugReproManager) {\n      if (ast.loc !== undefined && ast.loc !== null && ast.loc.source) {\n        this.realm.debugReproManager.addSourceFile(ast.loc.source);\n      }\n    }\n\n    let res = this.evaluateAbstract(ast, strictCode, metadata);\n    invariant(res instanceof Value || res instanceof Reference, ast.type);\n    return res;\n  }\n\n  evaluateAbstract(ast: BabelNode, strictCode: boolean, metadata?: any): Value | Reference {\n    this.realm.currentLocation = ast.loc;\n    this.realm.testTimeout();\n\n    let evaluator = this.realm.evaluators[(ast.type: string)];\n    if (evaluator) {\n      this.realm.statistics.evaluatedNodes++;\n      let result = evaluator(ast, strictCode, this, this.realm, metadata);\n      return result;\n    }\n\n    throw new TypeError(`Unsupported node type ${ast.type}`);\n  }\n\n  evaluateDeref(ast: BabelNode, strictCode: boolean, metadata?: any): Value {\n    let result = this.evaluate(ast, strictCode, metadata);\n    if (result instanceof Reference) result = Environment.GetValue(this.realm, result);\n    return result;\n  }\n}\n\n// ECMA262 6.2.3\n// A Reference is a resolved name or property binding. A Reference consists of three components, the base value,\n// the referenced name and the Boolean valued strict reference flag. The base value is either undefined, an Object,\n// a Boolean, a String, a Symbol, a Number, or an Environment Record. A base value of undefined indicates that the\n// Reference could not be resolved to a binding. The referenced name is a String or Symbol value.\nexport type BaseValue =\n  | void\n  | ObjectValue\n  | BooleanValue\n  | StringValue\n  | SymbolValue\n  | NumberValue\n  | IntegralValue\n  | EnvironmentRecord;\nexport type ReferenceName = string | SymbolValue;\n\nexport function isValidBaseValue(val: Value) {\n  return val instanceof AbstractValue || val instanceof ObjectValue || mightBecomeAnObject(val);\n}\n\nexport function mightBecomeAnObject(base: Value): boolean {\n  let type = base.getType();\n  // The top Value type might be able to become an object. We let it\n  // pass and error later if it can't.\n  return (\n    type === Value ||\n    type === PrimitiveValue ||\n    type === BooleanValue ||\n    type === StringValue ||\n    type === SymbolValue ||\n    type === NumberValue ||\n    type === IntegralValue\n  );\n}\n\nexport class Reference {\n  base: BaseValue | AbstractValue;\n  referencedName: ReferenceName | AbstractValue;\n  strict: boolean;\n  thisValue: void | Value;\n\n  constructor(\n    base: BaseValue | AbstractValue,\n    refName: ReferenceName | AbstractValue,\n    strict: boolean,\n    thisValue?: void | Value\n  ) {\n    invariant(\n      base instanceof AbstractObjectValue ||\n        base === undefined ||\n        base instanceof ObjectValue ||\n        base instanceof EnvironmentRecord ||\n        mightBecomeAnObject(base)\n    );\n    this.base = base;\n    this.referencedName = refName;\n    invariant(\n      !(refName instanceof AbstractValue) ||\n        !(refName.mightNotBeString() && refName.mightNotBeNumber() && !refName.isSimpleObject()) ||\n        refName.$Realm.isInPureScope()\n    );\n    this.strict = strict;\n    this.thisValue = thisValue;\n    invariant(thisValue === undefined || !(base instanceof EnvironmentRecord));\n  }\n}\n"
  },
  {
    "path": "src/errors.js",
    "content": "/**\n * Copyright (c) 2017-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n/* @flow strict */\n\nimport type { BabelNodeSourceLocation } from \"@babel/types\";\n\n// Information: Just an informative message with no semantic implications whatsoever.\n// Warning: Prepack will produce code that matches the behavior of the original code, but the original code might have an error.\n// RecoverableError: Prepack might produce code that deviates in behavior from the original code, if the original code is not well behaved.\n// FatalError: Prepack is unable to produce code that could possibly match the behavior of the original code.\nexport type Severity = \"FatalError\" | \"RecoverableError\" | \"Warning\" | \"Information\";\nexport type ErrorHandlerResult = \"Fail\" | \"Recover\";\nexport type ErrorCode = \"PP0001\";\n\n// This is the error format used to report errors to the caller-supplied\n// error-handler\nexport class CompilerDiagnostic extends Error {\n  constructor(\n    message: string,\n    location: ?BabelNodeSourceLocation,\n    errorCode: string,\n    severity: Severity,\n    sourceFilePaths?: { sourceMaps: Array<string>, sourceFiles: Array<{ absolute: string, relative: string }> }\n  ) {\n    super(message);\n\n    this.location = location;\n    this.severity = severity;\n    this.errorCode = errorCode;\n    this.sourceFilePaths = sourceFilePaths;\n  }\n\n  callStack: void | string;\n  location: ?BabelNodeSourceLocation;\n  severity: Severity;\n  errorCode: string;\n  // For repro bundles, we need to pass the names of all sourcefiles/sourcemaps touched by Prepack back to the CLI.\n  sourceFilePaths: void | { sourceMaps: Array<string>, sourceFiles: Array<{ absolute: string, relative: string }> };\n}\n\n// This error is thrown to exit Prepack when an ErrorHandler returns 'FatalError'\n// This should just be a class but Babel classes doesn't work with\n// built-in super classes.\nexport class FatalError extends Error {\n  constructor(message?: string) {\n    super(message === undefined ? \"A fatal error occurred while prepacking.\" : message);\n  }\n}\n\n// This error is thrown when exploring a path whose entry conditon implies that an earlier path conditon must be false.\n// Such paths are infeasible (dead) and must be elided from the evaluation.\nexport class InfeasiblePathError extends Error {\n  constructor() {\n    super(\"Infeasible path explored\");\n  }\n}\n\n// This error is thrown when a false invariant is encountered. This error should never be swallowed.\nexport class InvariantError extends Error {\n  constructor(message: string) {\n    super(message);\n  }\n}\n\nexport type ErrorHandler = (error: CompilerDiagnostic, suppressDiagnostics: boolean) => ErrorHandlerResult;\n\n// When a side-effect occurs when evaluating a pure nested optimized function, we stop execution of that function\n// and catch the error to properly handle the according logic (either bail-out or report the error).\n// Ideally this should extend FatalError, but that will mean re-working every call-site that catches FatalError\n// and make it treat NestedOptimizedFunctionSideEffect errors differently, which isn't ideal so maybe a better\n// FatalError catching/handling process is needed throughout the codebase at some point.\nexport class NestedOptimizedFunctionSideEffect extends Error {}\n"
  },
  {
    "path": "src/evaluators/ArrayExpression.js",
    "content": "/**\n * Copyright (c) 2017-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n/* @flow strict-local */\n\nimport type { Realm } from \"../realm.js\";\nimport type { LexicalEnvironment } from \"../environment.js\";\nimport { StringValue, NumberValue, Value } from \"../values/index.js\";\nimport { GetIterator } from \"../methods/index.js\";\nimport invariant from \"../invariant.js\";\nimport { IteratorStep, IteratorValue } from \"../methods/iterator.js\";\nimport { Create, Environment, Properties } from \"../singletons.js\";\nimport type { BabelNodeArrayExpression } from \"@babel/types\";\n\n// ECMA262 2.2.5.3\nexport default function(\n  ast: BabelNodeArrayExpression,\n  strictCode: boolean,\n  env: LexicalEnvironment,\n  realm: Realm\n): Value {\n  // 1. Let array be ArrayCreate(0).\n  let array = Create.ArrayCreate(realm, 0);\n\n  // 2. Let len be the result of performing ArrayAccumulation for ElementList with arguments array and 0.\n  let elements = ast.elements || [];\n  let len = elements.length;\n  let nextIndex = 0;\n  for (let i = 0; i < len; i++) {\n    let elem = elements[i];\n    if (!elem) {\n      nextIndex++;\n      continue;\n    }\n\n    // ECMA262 12.2.5.2\n    if (elem.type === \"SpreadElement\") {\n      // 1. Let spreadRef be the result of evaluating AssignmentExpression.\n      let spreadRef = env.evaluate(elem.argument, strictCode);\n\n      // 2. Let spreadObj be ? GetValue(spreadRef).\n      let spreadObj = Environment.GetValue(realm, spreadRef);\n\n      // 3. Let iterator be ? GetIterator(spreadObj).\n      let iterator = GetIterator(realm, spreadObj);\n\n      // 4. Repeat\n      while (true) {\n        // a. Let next be ? IteratorStep(iterator).\n        let next = IteratorStep(realm, iterator);\n\n        // b. If next is false, return nextIndex.\n        if (next === false) break;\n\n        // c. Let nextValue be ? IteratorValue(next).\n        let nextValue = IteratorValue(realm, next);\n\n        // d. Let status be CreateDataProperty(array, ToString(ToUint32(nextIndex)), nextValue).\n        let status = Create.CreateDataProperty(realm, array, new StringValue(realm, nextIndex++ + \"\"), nextValue);\n\n        // e. Assert: status is true.\n        invariant(status === true);\n\n        // f. Let nextIndex be nextIndex + 1.\n      }\n    } else {\n      // Redundant steps.\n      // 1. Let postIndex be the result of performing ArrayAccumulation for ElementList with arguments array and nextIndex.\n      // 2. ReturnIfAbrupt(postIndex).\n      // 3. Let padding be the ElisionWidth of Elision; if Elision is not present, use the numeric value zero.\n\n      // 4. Let initResult be the result of evaluating AssignmentExpression.\n      let initResult = env.evaluate(elem, strictCode);\n\n      // 5. Let initValue be ? GetValue(initResult).\n      let initValue = Environment.GetValue(realm, initResult);\n\n      // 6. Let created be CreateDataProperty(array, ToString(ToUint32(postIndex+padding)), initValue).\n      let created = Create.CreateDataProperty(realm, array, new StringValue(realm, nextIndex++ + \"\"), initValue);\n\n      // 7. Assert: created is true.\n      invariant(created === true, \"expected data property creation\");\n    }\n  }\n\n  // Not necessary since we propagate completions with exceptions.\n  // 3. ReturnIfAbrupt(len).\n\n  // 4. Perform Set(array, \"length\", ToUint32(len), false).\n  Properties.Set(realm, array, \"length\", new NumberValue(realm, nextIndex), false);\n\n  // 5. NOTE: The above Set cannot fail because of the nature of the object returned by ArrayCreate.\n\n  // 6. Return array.\n  return array;\n}\n"
  },
  {
    "path": "src/evaluators/ArrowFunctionExpression.js",
    "content": "/**\n * Copyright (c) 2017-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n/* @flow strict-local */\n\nimport type { Realm } from \"../realm.js\";\nimport type { LexicalEnvironment } from \"../environment.js\";\nimport type { Value } from \"../values/index.js\";\nimport { Functions } from \"../singletons.js\";\nimport IsStrict from \"../utils/strict.js\";\nimport * as t from \"@babel/types\";\nimport type { BabelNodeArrowFunctionExpression } from \"@babel/types\";\n\n// ECMA262 14.2.16\nexport default function(\n  ast: BabelNodeArrowFunctionExpression,\n  strictCode: boolean,\n  env: LexicalEnvironment,\n  realm: Realm\n): Value {\n  let ConciseBody = ast.body;\n  if (ConciseBody.type !== \"BlockStatement\") {\n    ConciseBody = t.blockStatement([t.returnStatement(ConciseBody)]);\n    // Use original array function's location for the new concise body.\n    ConciseBody.loc = ast.body.loc;\n  }\n\n  // 1. If the function code for this ArrowFunction is strict mode code, let strict be true. Otherwise let strict be false.\n  let strict = strictCode || IsStrict(ast.body);\n\n  // 2. Let scope be the LexicalEnvironment of the running execution context.\n  let scope = env;\n\n  // 3. Let parameters be CoveredFormalsList of ArrowParameters.\n  let parameters = ast.params;\n\n  // 4. Let closure be FunctionCreate(Arrow, parameters, ConciseBody, scope, strict).\n  let closure = Functions.FunctionCreate(realm, \"arrow\", parameters, ConciseBody, scope, strict);\n  closure.loc = ast.loc;\n\n  // 5. Return closure.\n  return closure;\n}\n"
  },
  {
    "path": "src/evaluators/AssignmentExpression.js",
    "content": "/**\n * Copyright (c) 2017-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n/* @flow */\n\nimport type { Realm } from \"../realm.js\";\nimport type { LexicalEnvironment } from \"../environment.js\";\nimport { Value, ObjectValue } from \"../values/index.js\";\nimport { Reference } from \"../environment.js\";\nimport {\n  DestructuringAssignmentEvaluation,\n  HasOwnProperty,\n  IsAnonymousFunctionDefinition,\n  IsIdentifierRef,\n} from \"../methods/index.js\";\nimport { Environment, Functions, Properties } from \"../singletons.js\";\nimport invariant from \"../invariant.js\";\nimport type { BabelNodeAssignmentExpression, BabelBinaryOperator } from \"@babel/types\";\nimport { computeBinary } from \"./BinaryExpression.js\";\n\n// ECMA262 12.15 Assignment Operators\nexport default function(\n  ast: BabelNodeAssignmentExpression,\n  strictCode: boolean,\n  env: LexicalEnvironment,\n  realm: Realm\n): Value {\n  if (!ast.hasOwnProperty(\"operator\") || ast.operator === null) throw Error(\"Unexpected AST form\");\n\n  let LeftHandSideExpression = ast.left;\n  let AssignmentExpression = ast.right;\n  let AssignmentOperator = ast.operator;\n\n  // AssignmentExpression : LeftHandSideExpression = AssignmentExpression\n  if (AssignmentOperator === \"=\") {\n    // 1. If LeftHandSideExpression is neither an ObjectLiteral nor an ArrayLiteral, then\n    //\n    // The spec assumes we haven't yet distinguished between literals and\n    // patterns, but our parser does that work for us. That means we check for\n    // \"*Pattern\" instead of \"*Literal\" like the spec text suggests.\n    if (LeftHandSideExpression.type !== \"ObjectPattern\" && LeftHandSideExpression.type !== \"ArrayPattern\") {\n      // a. Let lref be the result of evaluating LeftHandSideExpression.\n      let lref = env.evaluate(LeftHandSideExpression, strictCode);\n      // b. ReturnIfAbrupt(lref). -- Not neccessary\n      // c. Let rref be the result of evaluating AssignmentExpression.\n      let rref = env.evaluate(AssignmentExpression, strictCode);\n      // d. Let rval be ? GetValue(rref).\n      let rval = Environment.GetValue(realm, rref);\n      // e. If IsAnonymousFunctionDefinition(AssignmentExpression) and IsIdentifierRef of LeftHandSideExpression are both true, then\n      if (\n        IsAnonymousFunctionDefinition(realm, AssignmentExpression) &&\n        IsIdentifierRef(realm, LeftHandSideExpression)\n      ) {\n        invariant(rval instanceof ObjectValue);\n        // i. Let hasNameProperty be ? HasOwnProperty(rval, \"name\").\n        let hasNameProperty = HasOwnProperty(realm, rval, \"name\");\n        // ii. If hasNameProperty is false, perform SetFunctionName(rval, GetReferencedName(lref)).\n        if (!hasNameProperty) {\n          invariant(lref instanceof Reference);\n          Functions.SetFunctionName(realm, rval, Environment.GetReferencedName(realm, lref));\n        }\n      }\n      // f. Perform ? PutValue(lref, rval).\n      Properties.PutValue(realm, lref, rval);\n      // g. Return rval.\n      return rval;\n    }\n\n    // 2. Let assignmentPattern be the parse of the source text corresponding to LeftHandSideExpression using AssignmentPattern[?Yield] as the goal symbol.\n    let assignmentPattern = LeftHandSideExpression;\n\n    // 3. Let rref be the result of evaluating AssignmentExpression.\n    let rref = env.evaluate(AssignmentExpression, strictCode);\n\n    // 4. Let rval be ? GetValue(rref).\n    let rval = Environment.GetValue(realm, rref);\n\n    // 5. Let status be the result of performing DestructuringAssignmentEvaluation of assignmentPattern using rval as the argument.\n    DestructuringAssignmentEvaluation(realm, assignmentPattern, rval, strictCode, env);\n\n    // 6. ReturnIfAbrupt(status).\n\n    // 7. Return rval.\n    return rval;\n  }\n\n  // AssignmentExpression : LeftHandSideExpression AssignmentOperator AssignmentExpression\n\n  // 1. Let lref be the result of evaluating LeftHandSideExpression.\n  let lref = env.evaluate(LeftHandSideExpression, strictCode);\n  // 2. Let lval be ? GetValue(lref).\n  let lval = Environment.GetValue(realm, lref);\n  // 3. Let rref be the result of evaluating AssignmentExpression.\n  let rref = env.evaluate(AssignmentExpression, strictCode);\n  // 4. Let rval be ? GetValue(rref).\n  let rval = Environment.GetValue(realm, rref);\n  // 5. Let op be the @ where AssignmentOperator is @=.\n  let op = ((AssignmentOperator.slice(0, -1): any): BabelBinaryOperator);\n  // 6. Let r be the result of applying op to lval and rval as if evaluating the expression lval op rval.\n  let r = Environment.GetValue(realm, computeBinary(realm, op, lval, rval, ast.left.loc, ast.right.loc));\n  // 7. Perform ? PutValue(lref, r).\n  Properties.PutValue(realm, lref, r);\n  // 8. Return r.\n  return r;\n}\n"
  },
  {
    "path": "src/evaluators/AwaitExpression.js",
    "content": "/**\n * Copyright (c) 2017-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n/* @flow strict-local */\n\nimport type { Realm } from \"../realm.js\";\nimport type { LexicalEnvironment } from \"../environment.js\";\nimport { FatalError } from \"../errors.js\";\nimport type { Value } from \"../values/index.js\";\nimport type { BabelNodeAwaitExpression } from \"@babel/types\";\n\nexport default function(\n  ast: BabelNodeAwaitExpression,\n  strictCode: boolean,\n  env: LexicalEnvironment,\n  realm: Realm\n): Value {\n  throw new FatalError(\"TODO #712: AwaitExpression\");\n}\n"
  },
  {
    "path": "src/evaluators/BinaryExpression.js",
    "content": "/**\n * Copyright (c) 2017-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n/* @flow strict-local */\n\nimport { SimpleNormalCompletion } from \"../completions.js\";\nimport type { Realm } from \"../realm.js\";\nimport { TypesDomain, ValuesDomain } from \"../domains/index.js\";\nimport type { LexicalEnvironment } from \"../environment.js\";\nimport { CompilerDiagnostic, FatalError } from \"../errors.js\";\nimport {\n  AbstractObjectValue,\n  AbstractValue,\n  BooleanValue,\n  ConcreteValue,\n  NullValue,\n  NumberValue,\n  IntegralValue,\n  ObjectValue,\n  PrimitiveValue,\n  StringValue,\n  SymbolValue,\n  UndefinedValue,\n  Value,\n} from \"../values/index.js\";\nimport { Environment, Leak, To } from \"../singletons.js\";\nimport type { BabelBinaryOperator, BabelNodeBinaryExpression, BabelNodeSourceLocation } from \"@babel/types\";\nimport { createOperationDescriptor } from \"../utils/generator.js\";\nimport invariant from \"../invariant.js\";\n\nexport default function(\n  ast: BabelNodeBinaryExpression,\n  strictCode: boolean,\n  env: LexicalEnvironment,\n  realm: Realm\n): Value {\n  // evaluate left\n  let lref = env.evaluate(ast.left, strictCode);\n  let lval = Environment.GetValue(realm, lref);\n\n  // evaluate right\n  let rref = env.evaluate(ast.right, strictCode);\n  let rval = Environment.GetValue(realm, rref);\n\n  return computeBinary(realm, ast.operator, lval, rval, ast.left.loc, ast.right.loc, ast.loc);\n}\n\nlet unknownValueOfOrToString = \"might be an object with an unknown valueOf or toString or Symbol.toPrimitive method\";\n\n// Returns result type if binary operation is pure (terminates, does not throw exception, does not read or write heap), otherwise undefined.\nexport function getPureBinaryOperationResultType(\n  realm: Realm,\n  op: BabelBinaryOperator,\n  lval: Value,\n  rval: Value,\n  lloc: ?BabelNodeSourceLocation,\n  rloc: ?BabelNodeSourceLocation\n): typeof Value {\n  function reportErrorIfNotPure(purityTest: (Realm, Value) => boolean, typeIfPure: typeof Value): typeof Value {\n    let leftPure = purityTest(realm, lval);\n    let rightPure = purityTest(realm, rval);\n    if (leftPure && rightPure) return typeIfPure;\n    let loc = !leftPure ? lloc : rloc;\n    let error = new CompilerDiagnostic(unknownValueOfOrToString, loc, \"PP0002\", \"RecoverableError\");\n    if (realm.handleError(error) === \"Recover\") {\n      // Assume that an unknown value is actually a primitive or otherwise a well behaved object.\n      return typeIfPure;\n    }\n    throw new FatalError();\n  }\n  if (op === \"+\") {\n    let ltype = To.GetToPrimitivePureResultType(realm, lval);\n    let rtype = To.GetToPrimitivePureResultType(realm, rval);\n    if (ltype === StringValue || rtype === StringValue) {\n      // If either type is a string, the other one will be called with ToString, so that has to be pure.\n      if (!To.IsToStringPure(realm, rval)) {\n        rtype = undefined;\n      }\n      if (!To.IsToStringPure(realm, lval)) {\n        ltype = undefined;\n      }\n    } else {\n      // Otherwise, they will be called with ToNumber, so that has to be pure.\n      if (!To.IsToNumberPure(realm, rval)) {\n        rtype = undefined;\n      }\n      if (!To.IsToNumberPure(realm, lval)) {\n        ltype = undefined;\n      }\n    }\n    if (ltype === undefined || rtype === undefined) {\n      if (lval.getType() === SymbolValue || rval.getType() === SymbolValue) {\n        // Symbols never implicitly coerce to primitives.\n        throw realm.createErrorThrowCompletion(realm.intrinsics.TypeError);\n      }\n      let loc = ltype === undefined ? lloc : rloc;\n      let error = new CompilerDiagnostic(unknownValueOfOrToString, loc, \"PP0002\", \"RecoverableError\");\n      if (realm.handleError(error) === \"Recover\") {\n        // Assume that the unknown value is actually a primitive or otherwise a well behaved object.\n        ltype = lval.getType();\n        rtype = rval.getType();\n        if (ltype === StringValue || rtype === StringValue) return StringValue;\n        if (ltype === IntegralValue && rtype === IntegralValue) return IntegralValue;\n        if ((ltype === NumberValue || ltype === IntegralValue) && (rtype === NumberValue || rtype === IntegralValue))\n          return NumberValue;\n\n        return Value;\n      }\n      throw new FatalError();\n    }\n    if (ltype === StringValue || rtype === StringValue) return StringValue;\n    return NumberValue;\n  } else if (op === \"<\" || op === \">\" || op === \">=\" || op === \"<=\") {\n    return reportErrorIfNotPure(To.IsToPrimitivePure.bind(To), BooleanValue);\n  } else if (op === \"!=\" || op === \"==\") {\n    let ltype = lval.getType();\n    let rtype = rval.getType();\n    if (ltype === NullValue || ltype === UndefinedValue || rtype === NullValue || rtype === UndefinedValue)\n      return BooleanValue;\n    return reportErrorIfNotPure(To.IsToPrimitivePure.bind(To), BooleanValue);\n  } else if (op === \"===\" || op === \"!==\") {\n    return BooleanValue;\n  } else if (\n    op === \">>>\" ||\n    op === \"<<\" ||\n    op === \">>\" ||\n    op === \"&\" ||\n    op === \"|\" ||\n    op === \"^\" ||\n    op === \"**\" ||\n    op === \"%\" ||\n    op === \"/\" ||\n    op === \"*\" ||\n    op === \"-\"\n  ) {\n    if (lval.getType() === SymbolValue || rval.getType() === SymbolValue) {\n      throw realm.createErrorThrowCompletion(realm.intrinsics.TypeError);\n    }\n    return reportErrorIfNotPure(To.IsToNumberPure.bind(To), NumberValue);\n  } else if (op === \"in\" || op === \"instanceof\") {\n    if (rval.mightNotBeObject()) {\n      let error = new CompilerDiagnostic(\n        `might not be an object, hence the ${op} operator might throw a TypeError`,\n        rloc,\n        \"PP0003\",\n        \"RecoverableError\"\n      );\n      if (realm.handleError(error) === \"Recover\") {\n        // Assume that the object is actually a well behaved object.\n        return BooleanValue;\n      }\n      throw new FatalError();\n    }\n    if (!rval.mightNotBeObject()) {\n      // Simple object won't throw here, aren't proxy objects or typed arrays and do not have @@hasInstance properties.\n      if (rval.isSimpleObject()) return BooleanValue;\n    }\n    let error = new CompilerDiagnostic(\n      `might be an object that behaves badly for the ${op} operator`,\n      rloc,\n      \"PP0004\",\n      \"RecoverableError\"\n    );\n    if (realm.handleError(error) === \"Recover\") {\n      // Assume that the object is actually a well behaved object.\n      return BooleanValue;\n    }\n    throw new FatalError();\n  }\n  invariant(false, \"unimplemented \" + op);\n}\n\nexport function computeBinary(\n  realm: Realm,\n  op: BabelBinaryOperator,\n  lval: Value,\n  rval: Value,\n  lloc: ?BabelNodeSourceLocation,\n  rloc: ?BabelNodeSourceLocation,\n  loc?: ?BabelNodeSourceLocation\n): Value {\n  // partial evaluation shortcut for a particular pattern\n  if (realm.useAbstractInterpretation && (op === \"==\" || op === \"===\" || op === \"!=\" || op === \"!==\")) {\n    if (\n      (!lval.mightNotBeObject() && (rval instanceof NullValue || rval instanceof UndefinedValue)) ||\n      ((lval instanceof NullValue || lval instanceof UndefinedValue) && !rval.mightNotBeObject())\n    ) {\n      return new BooleanValue(realm, op[0] !== \"=\");\n    }\n  }\n\n  let resultType;\n  const compute = () => {\n    let lvalIsAbstract = lval instanceof AbstractValue;\n    let rvalIsAbstract = rval instanceof AbstractValue;\n    if (lvalIsAbstract || rvalIsAbstract) {\n      // If the left-hand side of an instanceof operation is a primitive,\n      // and the right-hand side is a simple object (it does not have [Symbol.hasInstance]),\n      // then the result should always compute to `false`.\n      if (\n        op === \"instanceof\" &&\n        Value.isTypeCompatibleWith(lval.getType(), PrimitiveValue) &&\n        rval instanceof AbstractObjectValue &&\n        rval.isSimpleObject()\n      ) {\n        return realm.intrinsics.false;\n      }\n\n      try {\n        // generate error if binary operation might throw or have side effects\n        resultType = getPureBinaryOperationResultType(realm, op, lval, rval, lloc, rloc);\n        let result = AbstractValue.createFromBinaryOp(realm, op, lval, rval, loc);\n\n        if ((op === \"in\" || op === \"instanceof\") && result instanceof AbstractValue && rvalIsAbstract)\n          // This operation is a conditional atemporal\n          // See #2327\n          result = AbstractValue.convertToTemporalIfArgsAreTemporal(\n            realm,\n            result,\n            [rval] /* throwing does not depend upon lval */\n          );\n        return result;\n      } catch (x) {\n        if (x instanceof FatalError) {\n          // There is no need to revert any effects, because the above operation is pure.\n          // If this failed and one of the arguments was conditional, try each value\n          // and join the effects based on the condition.\n          if (lval instanceof AbstractValue && lval.kind === \"conditional\") {\n            let [condition, consequentL, alternateL] = lval.args;\n            invariant(condition instanceof AbstractValue);\n            return realm.evaluateWithAbstractConditional(\n              condition,\n              () =>\n                realm.evaluateForEffects(\n                  () => computeBinary(realm, op, consequentL, rval, lloc, rloc, loc),\n                  undefined,\n                  \"ConditionalBinaryExpression/1\"\n                ),\n              () =>\n                realm.evaluateForEffects(\n                  () => computeBinary(realm, op, alternateL, rval, lloc, rloc, loc),\n                  undefined,\n                  \"ConditionalBinaryExpression/2\"\n                )\n            );\n          }\n          if (rval instanceof AbstractValue && rval.kind === \"conditional\") {\n            let [condition, consequentR, alternateR] = rval.args;\n            invariant(condition instanceof AbstractValue);\n            return realm.evaluateWithAbstractConditional(\n              condition,\n              () =>\n                realm.evaluateForEffects(\n                  () => computeBinary(realm, op, lval, consequentR, lloc, rloc, loc),\n                  undefined,\n                  \"ConditionalBinaryExpression/3\"\n                ),\n              () =>\n                realm.evaluateForEffects(\n                  () => computeBinary(realm, op, lval, alternateR, lloc, rloc, loc),\n                  undefined,\n                  \"ConditionalBinaryExpression/4\"\n                )\n            );\n          }\n        }\n        throw x;\n      }\n    } else {\n      // ECMA262 12.10.3\n\n      // 5. If Type(rval) is not Object, throw a TypeError exception.\n      if (op === \"in\" && !(rval instanceof ObjectValue)) {\n        throw realm.createErrorThrowCompletion(realm.intrinsics.TypeError);\n      }\n      invariant(lval instanceof ConcreteValue);\n      invariant(rval instanceof ConcreteValue);\n      const result = ValuesDomain.computeBinary(realm, op, lval, rval);\n      resultType = result.getType();\n      return result;\n    }\n  };\n\n  if (realm.isInPureScope()) {\n    // If we're in pure mode we can recover even if this operation might not be pure.\n    // To do that, we'll temporarily override the error handler.\n    const previousErrorHandler = realm.errorHandler;\n    let isPure = true;\n    realm.errorHandler = diagnostic => {\n      isPure = false;\n      return \"Recover\";\n    };\n    let effects;\n    try {\n      effects = realm.evaluateForEffects(compute, undefined, \"computeBinary\");\n    } catch (x) {\n      if (x instanceof FatalError) {\n        isPure = false;\n      } else {\n        throw x;\n      }\n    } finally {\n      realm.errorHandler = previousErrorHandler;\n    }\n\n    if (isPure && effects) {\n      realm.applyEffects(effects);\n      if (effects.result instanceof SimpleNormalCompletion) return effects.result.value;\n    }\n\n    // If this ended up reporting an error, it might not be pure, so we'll leave it in\n    // as a temporal operation with a known return type.\n    // Some of these values may trigger side-effectful user code such as valueOf.\n    // To be safe, we have to leak them.\n    Leak.value(realm, lval, loc);\n    if (op !== \"in\") {\n      // The \"in\" operator have side-effects on its right val other than throw.\n      Leak.value(realm, rval, loc);\n    }\n    return realm.evaluateWithPossibleThrowCompletion(\n      () =>\n        AbstractValue.createTemporalFromBuildFunction(\n          realm,\n          resultType,\n          [lval, rval],\n          createOperationDescriptor(\"BINARY_EXPRESSION\", { binaryOperator: op }),\n          { isPure: true }\n        ),\n      TypesDomain.topVal,\n      ValuesDomain.topVal\n    );\n  }\n  return compute();\n}\n"
  },
  {
    "path": "src/evaluators/BlockStatement.js",
    "content": "/**\n * Copyright (c) 2017-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n/* @flow strict-local */\n\nimport type { BabelNodeBlockStatement } from \"@babel/types\";\nimport type { Realm } from \"../realm.js\";\nimport type { LexicalEnvironment } from \"../environment.js\";\n\nimport { StringValue, Value } from \"../values/index.js\";\nimport { Environment, Functions } from \"../singletons.js\";\n\n// ECMA262 13.2.13\nexport default function(\n  ast: BabelNodeBlockStatement,\n  strictCode: boolean,\n  env: LexicalEnvironment,\n  realm: Realm\n): Value {\n  // 1. Let oldEnv be the running execution context's LexicalEnvironment.\n  let oldEnv = realm.getRunningContext().lexicalEnvironment;\n\n  // 2. Let blockEnv be NewDeclarativeEnvironment(oldEnv).\n  let blockEnv = Environment.NewDeclarativeEnvironment(realm, oldEnv);\n\n  // 3. Perform BlockDeclarationInstantiation(StatementList, blockEnv).\n  Environment.BlockDeclarationInstantiation(realm, strictCode, ast.body, blockEnv);\n\n  // 4. Set the running execution context's LexicalEnvironment to blockEnv.\n  realm.getRunningContext().lexicalEnvironment = blockEnv;\n\n  try {\n    // 5. Let blockValue be the result of evaluating StatementList.\n    let blockValue: void | Value;\n\n    if (ast.directives) {\n      for (let directive of ast.directives) {\n        blockValue = new StringValue(realm, directive.value.value);\n      }\n    }\n\n    return Functions.EvaluateStatements(ast.body, blockValue, strictCode, blockEnv, realm);\n  } finally {\n    // 6. Set the running execution context's LexicalEnvironment to oldEnv.\n    realm.getRunningContext().lexicalEnvironment = oldEnv;\n    realm.onDestroyScope(blockEnv);\n  }\n}\n"
  },
  {
    "path": "src/evaluators/BooleanLiteral.js",
    "content": "/**\n * Copyright (c) 2017-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n/* @flow strict-local */\n\nimport type { Realm } from \"../realm.js\";\nimport type { LexicalEnvironment } from \"../environment.js\";\nimport type { Value } from \"../values/index.js\";\nimport { BooleanValue } from \"../values/index.js\";\nimport type { BabelNodeBooleanLiteral } from \"@babel/types\";\n\nexport default function(\n  ast: BabelNodeBooleanLiteral,\n  strictCode: boolean,\n  env: LexicalEnvironment,\n  realm: Realm\n): Value {\n  return new BooleanValue(realm, ast.value);\n}\n"
  },
  {
    "path": "src/evaluators/BreakStatement.js",
    "content": "/**\n * Copyright (c) 2017-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n/* @flow strict-local */\n\nimport type { Realm } from \"../realm.js\";\nimport type { LexicalEnvironment } from \"../environment.js\";\nimport type { Value } from \"../values/index.js\";\nimport { BreakCompletion } from \"../completions.js\";\nimport type { BabelNodeBreakStatement } from \"@babel/types\";\n\nexport default function(\n  ast: BabelNodeBreakStatement,\n  strictCode: boolean,\n  env: LexicalEnvironment,\n  realm: Realm\n): Value {\n  throw new BreakCompletion(realm.intrinsics.empty, ast.loc, ast.label && ast.label.name);\n}\n"
  },
  {
    "path": "src/evaluators/CallExpression.js",
    "content": "/**\n * Copyright (c) 2017-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n/* @flow */\n\nimport { CompilerDiagnostic, FatalError } from \"../errors.js\";\nimport type { Realm } from \"../realm.js\";\nimport { type LexicalEnvironment, type BaseValue, isValidBaseValue } from \"../environment.js\";\nimport { EnvironmentRecord } from \"../environment.js\";\nimport { TypesDomain, ValuesDomain } from \"../domains/index.js\";\nimport {\n  AbstractValue,\n  AbstractObjectValue,\n  BooleanValue,\n  ConcreteValue,\n  FunctionValue,\n  IntegralValue,\n  NativeFunctionValue,\n  NumberValue,\n  ObjectValue,\n  StringValue,\n  SymbolValue,\n  Value,\n} from \"../values/index.js\";\nimport { Reference } from \"../environment.js\";\nimport { Environment, Functions, Leak } from \"../singletons.js\";\nimport {\n  ArgumentListEvaluation,\n  EvaluateDirectCall,\n  GetThisValue,\n  IsInTailPosition,\n  SameValue,\n} from \"../methods/index.js\";\nimport type { BabelNodeCallExpression } from \"@babel/types\";\nimport invariant from \"../invariant.js\";\nimport SuperCall from \"./SuperCall.js\";\nimport { createOperationDescriptor } from \"../utils/generator.js\";\n\nexport default function(\n  ast: BabelNodeCallExpression,\n  strictCode: boolean,\n  env: LexicalEnvironment,\n  realm: Realm\n): Value {\n  if (ast.callee.type === \"Super\") {\n    return SuperCall(ast.arguments, strictCode, env, realm);\n  }\n\n  // ECMA262 12.3.4.1\n\n  // 1. Let ref be the result of evaluating MemberExpression.\n  let ref = env.evaluate(ast.callee, strictCode);\n\n  let previousLoc = realm.setNextExecutionContextLocation(ast.loc);\n  try {\n    return evaluateReference(ref, ast, strictCode, env, realm);\n  } finally {\n    realm.setNextExecutionContextLocation(previousLoc);\n  }\n}\n\nfunction getPrimitivePrototypeFromType(realm: Realm, value: AbstractValue): void | ObjectValue {\n  switch (value.getType()) {\n    case IntegralValue:\n    case NumberValue:\n      return realm.intrinsics.NumberPrototype;\n    case StringValue:\n      return realm.intrinsics.StringPrototype;\n    case BooleanValue:\n      return realm.intrinsics.BooleanPrototype;\n    case SymbolValue:\n      return realm.intrinsics.SymbolPrototype;\n    default:\n      return undefined;\n  }\n}\n\nfunction evaluateReference(\n  ref: Reference | Value,\n  ast: BabelNodeCallExpression,\n  strictCode: boolean,\n  env: LexicalEnvironment,\n  realm: Realm\n): Value {\n  if (\n    ref instanceof Reference &&\n    ref.base instanceof AbstractValue &&\n    // TODO: what about ref.base conditionals that mightBeObjects?\n    ref.base.mightNotBeObject() &&\n    realm.isInPureScope()\n  ) {\n    let base = ref.base;\n    if (base.kind === \"conditional\") {\n      let [condValue, consequentVal, alternateVal] = base.args;\n      invariant(condValue instanceof AbstractValue);\n      return evaluateConditionalReferenceBase(ref, condValue, consequentVal, alternateVal, ast, strictCode, env, realm);\n    } else if (base.kind === \"||\") {\n      let [leftValue, rightValue] = base.args;\n      invariant(leftValue instanceof AbstractValue);\n      return evaluateConditionalReferenceBase(ref, leftValue, leftValue, rightValue, ast, strictCode, env, realm);\n    } else if (base.kind === \"&&\") {\n      let [leftValue, rightValue] = base.args;\n      invariant(leftValue instanceof AbstractValue);\n      return evaluateConditionalReferenceBase(ref, leftValue, rightValue, leftValue, ast, strictCode, env, realm);\n    }\n    let referencedName = ref.referencedName;\n\n    // When dealing with a PrimitiveValue, like StringValue, NumberValue, IntegralValue etc\n    // if we are referencing a prototype method, then it's safe to access, even\n    // on an abstract value as the value is immutable and can't have a property\n    // that matches the prototype method (unless the prototype was modified).\n    // We assume the global prototype of built-ins has not been altered since\n    // global code has finished. See #1233 for more context in regards to unmodified\n    // global prototypes.\n    let prototypeIfPrimitive = getPrimitivePrototypeFromType(realm, base);\n    if (prototypeIfPrimitive !== undefined && typeof referencedName === \"string\") {\n      let possibleMethodValue = prototypeIfPrimitive._SafeGetDataPropertyValue(referencedName);\n\n      if (possibleMethodValue instanceof FunctionValue) {\n        return EvaluateCall(ref, possibleMethodValue, ast, strictCode, env, realm);\n      }\n    }\n    // avoid explicitly converting ref.base to an object because that will create a generator entry\n    // leading to two object allocations rather than one.\n    return realm.evaluateWithPossibleThrowCompletion(\n      () => generateRuntimeCall(ref, base, ast, strictCode, env, realm),\n      TypesDomain.topVal,\n      ValuesDomain.topVal\n    );\n  }\n  // 2. Let func be ? GetValue(ref).\n  let func = Environment.GetValue(realm, ref);\n\n  return EvaluateCall(ref, func, ast, strictCode, env, realm);\n}\n\nfunction evaluateConditionalReferenceBase(\n  ref: Reference,\n  condValue: AbstractValue,\n  consequentVal: Value,\n  alternateVal: Value,\n  ast: BabelNodeCallExpression,\n  strictCode: boolean,\n  env: LexicalEnvironment,\n  realm: Realm\n): Value {\n  return realm.evaluateWithAbstractConditional(\n    condValue,\n    () => {\n      return realm.evaluateForEffects(\n        () => {\n          if (isValidBaseValue(consequentVal)) {\n            let consequentRef = new Reference(\n              ((consequentVal: any): BaseValue),\n              ref.referencedName,\n              ref.strict,\n              ref.thisValue\n            );\n            return evaluateReference(consequentRef, ast, strictCode, env, realm);\n          }\n          return consequentVal;\n        },\n        null,\n        \"evaluateConditionalReferenceBase consequent\"\n      );\n    },\n    () => {\n      return realm.evaluateForEffects(\n        () => {\n          if (isValidBaseValue(alternateVal)) {\n            let alternateRef = new Reference(\n              ((alternateVal: any): BaseValue),\n              ref.referencedName,\n              ref.strict,\n              ref.thisValue\n            );\n            return evaluateReference(alternateRef, ast, strictCode, env, realm);\n          }\n          return alternateVal;\n        },\n        null,\n        \"evaluateConditionalReferenceBase alternate\"\n      );\n    }\n  );\n}\n\nfunction callBothFunctionsAndJoinTheirEffects(\n  condValue: AbstractValue,\n  consequentVal: Value,\n  alternateVal: Value,\n  ast: BabelNodeCallExpression,\n  strictCode: boolean,\n  env: LexicalEnvironment,\n  realm: Realm\n): Value {\n  return realm.evaluateWithAbstractConditional(\n    condValue,\n    () => {\n      return realm.evaluateForEffects(\n        () => EvaluateCall(consequentVal, consequentVal, ast, strictCode, env, realm),\n        null,\n        \"callBothFunctionsAndJoinTheirEffects consequent\"\n      );\n    },\n    () => {\n      return realm.evaluateForEffects(\n        () => EvaluateCall(alternateVal, alternateVal, ast, strictCode, env, realm),\n        null,\n        \"callBothFunctionsAndJoinTheirEffects alternate\"\n      );\n    }\n  );\n}\n\nfunction generateRuntimeCall(\n  ref: Value | Reference,\n  func: Value,\n  ast: BabelNodeCallExpression,\n  strictCode: boolean,\n  env: LexicalEnvironment,\n  realm: Realm\n) {\n  let args = [func];\n  let [thisArg, propName] = ref instanceof Reference ? [ref.base, ref.referencedName] : [];\n  if (thisArg instanceof Value) args = [thisArg];\n  if (propName !== undefined && typeof propName !== \"string\") args.push(propName);\n  args = args.concat(ArgumentListEvaluation(realm, strictCode, env, ast.arguments));\n  for (let arg of args) {\n    if (arg !== func) {\n      // Since we don't know which function we are calling, we assume that any unfrozen object\n      // passed as an argument has leaked to the environment as is any other object that is known to be reachable from this object.\n      // NB: Note that this is still optimistic, particularly if the environment exposes the same object\n      // to Prepack via alternative means, thus creating aliasing that is not tracked by Prepack.\n      Leak.value(realm, arg, ast.loc);\n    }\n  }\n  let resultType = (func instanceof AbstractObjectValue ? func.functionResultType : undefined) || Value;\n  return AbstractValue.createTemporalFromBuildFunction(\n    realm,\n    resultType,\n    args,\n    createOperationDescriptor(\"CALL_BAILOUT\", { propRef: propName, thisArg })\n  );\n}\n\nfunction tryToEvaluateCallOrLeaveAsAbstract(\n  ref: Value | Reference,\n  func: Value,\n  ast: BabelNodeCallExpression,\n  strictCode: boolean,\n  env: LexicalEnvironment,\n  realm: Realm,\n  thisValue: Value,\n  tailCall: boolean\n): Value {\n  invariant(!realm.instantRender.enabled);\n  let effects;\n  let savedSuppressDiagnostics = realm.suppressDiagnostics;\n  try {\n    realm.suppressDiagnostics = !(func instanceof NativeFunctionValue) || func.name !== \"__optimize\";\n    effects = realm.evaluateForEffects(\n      () => EvaluateDirectCall(realm, strictCode, env, ref, func, thisValue, ast.arguments, tailCall),\n      undefined,\n      \"tryToEvaluateCallOrLeaveAsAbstract\"\n    );\n  } catch (error) {\n    if (error instanceof FatalError) {\n      if (func instanceof NativeFunctionValue && func.name === \"__fatal\") throw error;\n      realm.suppressDiagnostics = savedSuppressDiagnostics;\n      Leak.value(realm, func, ast.loc);\n      return realm.evaluateWithPossibleThrowCompletion(\n        () => generateRuntimeCall(ref, func, ast, strictCode, env, realm),\n        TypesDomain.topVal,\n        ValuesDomain.topVal\n      );\n    } else {\n      throw error;\n    }\n  } finally {\n    realm.suppressDiagnostics = savedSuppressDiagnostics;\n  }\n  realm.applyEffects(effects);\n  return realm.returnOrThrowCompletion(effects.result);\n}\n\nfunction EvaluateCall(\n  ref: Value | Reference,\n  func: Value,\n  ast: BabelNodeCallExpression,\n  strictCode: boolean,\n  env: LexicalEnvironment,\n  realm: Realm\n): Value {\n  if (func instanceof AbstractValue) {\n    let loc = ast.callee.type === \"MemberExpression\" ? ast.callee.property.loc : ast.callee.loc;\n    if (func.kind === \"conditional\") {\n      let [condValue, consequentVal, alternateVal] = func.args;\n      invariant(condValue instanceof AbstractValue);\n      // If neither values are functions than do not try and call both functions with a conditional\n      if (\n        Value.isTypeCompatibleWith(consequentVal.getType(), FunctionValue) ||\n        Value.isTypeCompatibleWith(alternateVal.getType(), FunctionValue)\n      ) {\n        return callBothFunctionsAndJoinTheirEffects(\n          condValue,\n          consequentVal,\n          alternateVal,\n          ast,\n          strictCode,\n          env,\n          realm\n        );\n      }\n    } else if (func.kind === \"||\") {\n      let [leftValue, rightValue] = func.args;\n      invariant(leftValue instanceof AbstractValue);\n      // If neither values are functions than do not try and call both functions with a conditional\n      if (\n        Value.isTypeCompatibleWith(leftValue.getType(), FunctionValue) ||\n        Value.isTypeCompatibleWith(rightValue.getType(), FunctionValue)\n      ) {\n        return callBothFunctionsAndJoinTheirEffects(leftValue, leftValue, rightValue, ast, strictCode, env, realm);\n      }\n    } else if (func.kind === \"&&\") {\n      let [leftValue, rightValue] = func.args;\n      invariant(leftValue instanceof AbstractValue);\n      // If neither values are functions than do not try and call both functions with a conditional\n      if (\n        Value.isTypeCompatibleWith(leftValue.getType(), FunctionValue) ||\n        Value.isTypeCompatibleWith(rightValue.getType(), FunctionValue)\n      ) {\n        return callBothFunctionsAndJoinTheirEffects(leftValue, rightValue, leftValue, ast, strictCode, env, realm);\n      }\n    }\n    if (!Value.isTypeCompatibleWith(func.getType(), FunctionValue)) {\n      if (!realm.isInPureScope()) {\n        // If this is not a function, this call might throw which can change the state of the program.\n        // If this is called from a pure function we handle it using evaluateWithPossiblyAbruptCompletion.\n        let error = new CompilerDiagnostic(\"might not be a function\", loc, \"PP0005\", \"RecoverableError\");\n        if (realm.handleError(error) === \"Fail\") throw new FatalError();\n      }\n    } else {\n      // Assume that it is a safe function. TODO #705: really?\n    }\n    if (realm.isInPureScope()) {\n      // In pure functions we allow abstract functions to throw, which this might.\n      return realm.evaluateWithPossibleThrowCompletion(\n        () => generateRuntimeCall(ref, func, ast, strictCode, env, realm),\n        TypesDomain.topVal,\n        ValuesDomain.topVal\n      );\n    }\n    return generateRuntimeCall(ref, func, ast, strictCode, env, realm);\n  }\n  invariant(func instanceof ConcreteValue);\n\n  // 3. If Type(ref) is Reference and IsPropertyReference(ref) is false and GetReferencedName(ref) is \"eval\", then\n  if (\n    ref instanceof Reference &&\n    !Environment.IsPropertyReference(realm, ref) &&\n    Environment.GetReferencedName(realm, ref) === \"eval\"\n  ) {\n    // a. If SameValue(func, %eval%) is true, then\n    if (SameValue(realm, func, realm.intrinsics.eval)) {\n      // i. Let argList be ? ArgumentListEvaluation(Arguments).\n      let argList = ArgumentListEvaluation(realm, strictCode, env, ast.arguments);\n      // ii. If argList has no elements, return undefined.\n      if (argList.length === 0) return realm.intrinsics.undefined;\n      // iii. Let evalText be the first element of argList.\n      let evalText = argList[0];\n      // iv. If the source code matching this CallExpression is strict code, let strictCaller be true. Otherwise let strictCaller be false.\n      let strictCaller = strictCode;\n      // v. Let evalRealm be the current Realm Record.\n      let evalRealm = realm;\n      // vi. Return ? PerformEval(evalText, evalRealm, strictCaller, true).\n      if (evalText instanceof AbstractValue) {\n        let loc = ast.arguments[0].loc;\n        let error = new CompilerDiagnostic(\"eval argument must be a known value\", loc, \"PP0006\", \"RecoverableError\");\n        if (realm.handleError(error) === \"Fail\") throw new FatalError();\n        // Assume that it is a safe eval with no visible heap changes or abrupt control flow.\n        return generateRuntimeCall(ref, func, ast, strictCode, env, realm);\n      }\n      return Functions.PerformEval(realm, evalText, evalRealm, strictCaller, true);\n    }\n  }\n\n  let thisValue;\n\n  // 4. If Type(ref) is Reference, then\n  if (ref instanceof Reference) {\n    // a. If IsPropertyReference(ref) is true, then\n    if (Environment.IsPropertyReference(realm, ref)) {\n      // i. Let thisValue be GetThisValue(ref).\n      thisValue = GetThisValue(realm, ref);\n    } else {\n      // b. Else, the base of ref is an Environment Record\n      // i. Let refEnv be GetBase(ref).\n      let refEnv = Environment.GetBase(realm, ref);\n      invariant(refEnv instanceof EnvironmentRecord);\n\n      // ii. Let thisValue be refEnv.WithBaseObject().\n      thisValue = refEnv.WithBaseObject();\n    }\n  } else {\n    // 5. Else Type(ref) is not Reference,\n    // a. Let thisValue be undefined.\n    thisValue = realm.intrinsics.undefined;\n  }\n\n  // 6. Let thisCall be this CallExpression.\n  let thisCall = ast;\n\n  // 7. Let tailCall be IsInTailPosition(thisCall). (See 14.6.1)\n  let tailCall = IsInTailPosition(realm, thisCall);\n\n  // 8. Return ? EvaluateDirectCall(func, thisValue, Arguments, tailCall).\n  if (realm.isInPureScope() && !realm.instantRender.enabled) {\n    return tryToEvaluateCallOrLeaveAsAbstract(ref, func, ast, strictCode, env, realm, thisValue, tailCall);\n  } else {\n    return EvaluateDirectCall(realm, strictCode, env, ref, func, thisValue, ast.arguments, tailCall);\n  }\n}\n"
  },
  {
    "path": "src/evaluators/CatchClause.js",
    "content": "/**\n * Copyright (c) 2017-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n/* @flow */\n\nimport type { Realm } from \"../realm.js\";\nimport type { LexicalEnvironment } from \"../environment.js\";\nimport { Value } from \"../values/index.js\";\nimport { ThrowCompletion } from \"../completions.js\";\nimport invariant from \"../invariant.js\";\nimport { Environment } from \"../singletons.js\";\nimport type { BabelNodeCatchClause } from \"@babel/types\";\n\n// ECAM262 13.15.7\nexport default function(\n  ast: BabelNodeCatchClause,\n  strictCode: boolean,\n  env: LexicalEnvironment,\n  realm: Realm,\n  thrownValue: any\n): Value {\n  invariant(thrownValue instanceof ThrowCompletion, \"Metadata isn't a throw completion\");\n\n  // 1. Let oldEnv be the running execution context's LexicalEnvironment.\n  let oldEnv = realm.getRunningContext().lexicalEnvironment;\n\n  // 2. Let catchEnv be NewDeclarativeEnvironment(oldEnv).\n  let catchEnv = Environment.NewDeclarativeEnvironment(realm, oldEnv);\n\n  // 3. Let catchEnvRec be catchEnv's EnvironmentRecord.\n  let catchEnvRec = catchEnv.environmentRecord;\n\n  // 4. For each element argName of the BoundNames of CatchParameter, do\n  for (let argName of Environment.BoundNames(realm, ast.param)) {\n    // a. Perform ! catchEnvRec.CreateMutableBinding(argName, false).\n    catchEnvRec.CreateMutableBinding(argName, false);\n  }\n\n  // 5. Set the running execution context's LexicalEnvironment to catchEnv.\n  realm.getRunningContext().lexicalEnvironment = catchEnv;\n\n  try {\n    // 6. Let status be the result of performing BindingInitialization for CatchParameter passing thrownValue and catchEnv as arguments.\n    Environment.BindingInitialization(realm, ast.param, thrownValue.value, strictCode, catchEnv);\n\n    // 7. If status is an abrupt completion, then\n    // a. Set the running execution context's LexicalEnvironment to oldEnv.\n    // b. Return Completion(status).\n\n    // 8. Let B be the result of evaluating Block.\n    let B = catchEnv.evaluate(ast.body, strictCode);\n    invariant(B instanceof Value);\n\n    // 10. Return Completion(B).\n    return B;\n  } finally {\n    // 9. Set the running execution context's LexicalEnvironment to oldEnv.\n    realm.getRunningContext().lexicalEnvironment = oldEnv;\n    realm.onDestroyScope(catchEnv);\n  }\n}\n"
  },
  {
    "path": "src/evaluators/ClassDeclaration.js",
    "content": "/**\n * Copyright (c) 2017-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n/* @flow */\n\nimport type { Realm } from \"../realm.js\";\nimport type { LexicalEnvironment } from \"../environment.js\";\nimport { AbstractValue, Value, type ECMAScriptSourceFunctionValue } from \"../values/index.js\";\nimport { CompilerDiagnostic, FatalError } from \"../errors.js\";\nimport { NullValue, EmptyValue, ObjectValue, ECMAScriptFunctionValue } from \"../values/index.js\";\nimport type {\n  BabelNodeClassDeclaration,\n  BabelNodeClassExpression,\n  BabelNodeClassMethod,\n  BabelNodeExpression,\n} from \"@babel/types\";\nimport parse from \"../utils/parse.js\";\nimport {\n  HasOwnProperty,\n  IsConstructor,\n  Get,\n  MakeConstructor,\n  MakeClassConstructor,\n  ConstructorMethod,\n  IsStatic,\n  NonConstructorMethodDefinitions,\n} from \"../methods/index.js\";\nimport { Create, Environment, Functions, Properties } from \"../singletons.js\";\nimport invariant from \"../invariant.js\";\n\nfunction EvaluateClassHeritage(\n  realm: Realm,\n  ClassHeritage: BabelNodeExpression,\n  strictCode: boolean\n): ObjectValue | null {\n  let ref = realm.getRunningContext().lexicalEnvironment.evaluate(ClassHeritage, strictCode);\n  let val = Environment.GetValue(realm, ref);\n  if (val instanceof AbstractValue) {\n    let error = new CompilerDiagnostic(\"unknown super class\", ClassHeritage.loc, \"PP0009\", \"RecoverableError\");\n    if (realm.handleError(error) === \"Fail\") throw new FatalError();\n  }\n  if (!(val instanceof ObjectValue)) {\n    return null;\n  }\n  return val;\n}\n\n// ECMA262 14.5.14\nexport function ClassDefinitionEvaluation(\n  realm: Realm,\n  ast: BabelNodeClassDeclaration | BabelNodeClassExpression,\n  className: string | void,\n  strictCode: boolean,\n  env: LexicalEnvironment\n): ECMAScriptSourceFunctionValue {\n  // 1. Let lex be the LexicalEnvironment of the running execution context.\n  let lex = env;\n\n  // 2. Let classScope be NewDeclarativeEnvironment(lex).\n  let classScope = Environment.NewDeclarativeEnvironment(realm, lex);\n  let F;\n\n  try {\n    // 3. Let classScopeEnvRec be classScope’s EnvironmentRecord.\n    let classScopeEnvRec = classScope.environmentRecord;\n\n    // 4. If className is not undefined, then\n    if (className !== undefined) {\n      // a. Perform classScopeEnvRec.CreateImmutableBinding(className, true).\n      classScopeEnvRec.CreateImmutableBinding(className, true);\n    }\n\n    let protoParent;\n    let constructorParent;\n    // 5. If ClassHeritage opt is not present, then\n    let ClassHeritage = ast.superClass;\n    if (!ClassHeritage) {\n      // a. Let protoParent be the intrinsic object %ObjectPrototype%.\n      protoParent = realm.intrinsics.ObjectPrototype;\n\n      // b. Let constructorParent be the intrinsic object %FunctionPrototype%.\n      constructorParent = realm.intrinsics.FunctionPrototype;\n    } else {\n      // 6. Else\n      // a. Set the running execution context’s LexicalEnvironment to classScope.\n      realm.getRunningContext().lexicalEnvironment = classScope;\n      let superclass = null;\n      try {\n        // b. Let superclass be the result of evaluating ClassHeritage.\n        superclass = EvaluateClassHeritage(realm, ClassHeritage, strictCode);\n      } finally {\n        // c. Set the running execution context’s LexicalEnvironment to lex.\n        realm.getRunningContext().lexicalEnvironment = lex;\n      }\n\n      // d. ReturnIfAbrupt(superclass).\n\n      // e. If superclass is null, then\n      if (superclass === null) {\n        // i. Let protoParent be null.\n        protoParent = realm.intrinsics.null;\n\n        // ii. Let constructorParent be the intrinsic object %FunctionPrototype%.\n        constructorParent = realm.intrinsics.FunctionPrototype;\n      } else if (!IsConstructor(realm, superclass)) {\n        // f. Else if IsConstructor(superclass) is false, throw a TypeError exception.\n        throw realm.createErrorThrowCompletion(realm.intrinsics.TypeError, \"superclass must be a constructor\");\n      } else {\n        // g. Else\n        // i. If superclass has a [[FunctionKind]] internal slot whose value is \"generator\", throw a TypeError exception.\n        if (superclass instanceof ECMAScriptFunctionValue && superclass.$FunctionKind === \"generator\") {\n          throw realm.createErrorThrowCompletion(realm.intrinsics.TypeError, \"superclass cannot be a generator\");\n        }\n\n        // ii. Let protoParent be Get(superclass, \"prototype\").\n        protoParent = Get(realm, superclass, \"prototype\");\n\n        // iii. ReturnIfAbrupt(protoParent).\n\n        // iv. If Type(protoParent) is neither Object nor Null, throw a TypeError exception.\n        if (!(protoParent instanceof ObjectValue || protoParent instanceof NullValue)) {\n          if (protoParent instanceof AbstractValue) {\n            let error = new CompilerDiagnostic(\n              \"unknown super class prototype\",\n              ClassHeritage.loc,\n              \"PP0010\",\n              \"RecoverableError\"\n            );\n            if (realm.handleError(error) === \"Fail\") throw new FatalError();\n            protoParent = realm.intrinsics.ObjectPrototype;\n          } else {\n            throw realm.createErrorThrowCompletion(\n              realm.intrinsics.TypeError,\n              \"protoParent must be an instance of Object or Null\"\n            );\n          }\n        }\n\n        // v. Let constructorParent be superclass.\n        constructorParent = superclass;\n      }\n    }\n\n    // 7. Let proto be ObjectCreate(protoParent).\n    let proto = Create.ObjectCreate(realm, protoParent);\n\n    // Provide a hint that this prototype is that of a class\n    proto.$IsClassPrototype = true;\n\n    let constructor;\n    let emptyConstructor = false;\n    let ClassBody: Array<BabelNodeClassMethod> = [];\n    for (let elem of ast.body.body) {\n      if (elem.type === \"ClassMethod\") {\n        ClassBody.push(elem);\n      }\n    }\n    // 8. If ClassBody opt is not present, let constructor be empty.\n    if (ClassBody.length === 0) {\n      emptyConstructor = true;\n      constructor = realm.intrinsics.empty;\n    } else {\n      // 9. Else, let constructor be ConstructorMethod of ClassBody.\n      constructor = ConstructorMethod(realm, ClassBody);\n    }\n\n    // 10. If constructor is empty, then,\n    if (constructor instanceof EmptyValue) {\n      emptyConstructor = true;\n      let constructorFile;\n      // a. If ClassHeritage opt is present, then\n      if (ast.superClass) {\n        // i. Let constructor be the result of parsing the source text\n        //     constructor(... args){ super (...args);}\n        // using the syntactic grammar with the goal symbol MethodDefinition.\n        constructorFile = parse(realm, \"class NeedClassForParsing { constructor(... args){ super (...args);} }\", \"\");\n      } else {\n        // b. Else,\n        // i. Let constructor be the result of parsing the source text\n        //     constructor( ){ }\n        // using the syntactic grammar with the goal symbol MethodDefinition.\n        constructorFile = parse(realm, \"class NeedClassForParsing { constructor( ){ } }\", \"\");\n      }\n\n      let {\n        program: {\n          body: [classDeclaration],\n        },\n      } = constructorFile;\n      invariant(classDeclaration.type === \"ClassDeclaration\");\n      let { body } = ((classDeclaration: any): BabelNodeClassDeclaration);\n      invariant(body.body[0].type === \"ClassMethod\");\n      constructor = ((body.body[0]: any): BabelNodeClassMethod);\n    }\n\n    // 11. Set the running execution context’s LexicalEnvironment to classScope.\n    realm.getRunningContext().lexicalEnvironment = classScope;\n\n    try {\n      // 12. Let constructorInfo be the result of performing DefineMethod for constructor with arguments proto and constructorParent as the optional functionPrototype argument.\n      let constructorInfo = Functions.DefineMethod(realm, constructor, proto, env, strictCode, constructorParent);\n\n      // 13. Assert: constructorInfo is not an abrupt completion.\n\n      // 14. Let F be constructorInfo.[[closure]]\n      F = constructorInfo.$Closure;\n\n      // Assign the empty constructor boolean\n      F.$HasEmptyConstructor = emptyConstructor;\n\n      // 15. If ClassHeritage opt is present, set F’s [[ConstructorKind]] internal slot to \"derived\".\n      if (ast.superClass) {\n        F.$ConstructorKind = \"derived\";\n      }\n\n      // 16. Perform MakeConstructor(F, false, proto).\n      MakeConstructor(realm, F, false, proto);\n\n      // 17. Perform MakeClassConstructor(F).\n      MakeClassConstructor(realm, F);\n\n      // 18. Perform CreateMethodProperty(proto, \"constructor\", F).\n      Create.CreateMethodProperty(realm, proto, \"constructor\", F);\n\n      let methods;\n      // 19. If ClassBody opt is not present, let methods be a new empty List.\n      if (ClassBody.length === 0) {\n        methods = [];\n      } else {\n        // 20. Else, let methods be NonConstructorMethodDefinitions of ClassBody.\n        methods = NonConstructorMethodDefinitions(realm, ClassBody);\n      }\n\n      // 21. For each ClassElement m in order from methods\n      for (let m of methods) {\n        // a. If IsStatic of m is false, then\n        if (!IsStatic(m)) {\n          // Let status be the result of performing PropertyDefinitionEvaluation for m with arguments proto and false.\n          Properties.PropertyDefinitionEvaluation(realm, m, proto, (env: any), strictCode, false);\n        } else {\n          // Else,\n          // Let status be the result of performing PropertyDefinitionEvaluation for m with arguments F and false.\n          Properties.PropertyDefinitionEvaluation(realm, m, F, (env: any), strictCode, false);\n        }\n        // c. If status is an abrupt completion, then\n        // i. Set the running execution context's LexicalEnvironment to lex.\n        // ii. Return Completion(status).\n      }\n    } finally {\n      // 22. Set the running execution context’s LexicalEnvironment to lex.\n      realm.getRunningContext().lexicalEnvironment = lex;\n    }\n\n    // 23. If className is not undefined, then\n    if (className !== undefined) {\n      // Perform classScopeEnvRec.InitializeBinding(className, F).\n      classScopeEnvRec.InitializeBinding(className, F);\n    }\n  } finally {\n    realm.onDestroyScope(classScope);\n  }\n  // Return F.\n  return F;\n}\n\n// ECMA2 14.5.15\nfunction BindingClassDeclarationEvaluation(\n  realm: Realm,\n  ast: BabelNodeClassDeclaration,\n  strictCode: boolean,\n  env: LexicalEnvironment\n) {\n  // ClassDeclaration : class BindingIdentifier ClassTail\n  if (ast.id) {\n    // 1. Let className be StringValue of BindingIdentifier.\n    let className = ast.id.name;\n\n    // 2. Let value be the result of ClassDefinitionEvaluation of ClassTail with argument className.\n    let value = ClassDefinitionEvaluation(realm, ast, className, strictCode, env);\n\n    // 3. ReturnIfAbrupt(value).\n\n    // 4. Let hasNameProperty be HasOwnProperty(value, \"name\").\n    let hasNameProperty = HasOwnProperty(realm, value, \"name\");\n\n    // 5. ReturnIfAbrupt(hasNameProperty).\n\n    // 6. If hasNameProperty is false, then perform SetFunctionName(value, className).\n    if (hasNameProperty === false) {\n      Functions.SetFunctionName(realm, value, className);\n    }\n\n    // 7. Let env be the running execution context’s LexicalEnvironment.\n\n    // 8. Let status be InitializeBoundName(className, value, env).\n    Environment.InitializeBoundName(realm, className, value, env);\n\n    // 9. ReturnIfAbrupt(status).\n\n    // 10. Return value.\n    return value;\n  } else {\n    // ClassDeclaration : class ClassTail\n    // 1. Return the result of ClassDefinitionEvaluation of ClassTail with argument undefined.\n    return ClassDefinitionEvaluation(realm, ast, undefined, strictCode, env);\n  }\n}\n\n// ECMA262 14.5.16\nexport default function(\n  ast: BabelNodeClassDeclaration,\n  strictCode: boolean,\n  env: LexicalEnvironment,\n  realm: Realm\n): Value {\n  // 1. Let status be the result of BindingClassDeclarationEvaluation of this ClassDeclaration.\n  BindingClassDeclarationEvaluation(realm, ast, strictCode, env);\n\n  // 2. ReturnIfAbrupt(status).\n\n  // 3. Return NormalCompletion(empty).\n  return realm.intrinsics.empty;\n}\n"
  },
  {
    "path": "src/evaluators/ClassExpression.js",
    "content": "/**\n * Copyright (c) 2017-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n/* @flow strict-local */\n\nimport type { Realm } from \"../realm.js\";\nimport type { LexicalEnvironment } from \"../environment.js\";\nimport type { Value } from \"../values/index.js\";\nimport type { BabelNodeClassExpression } from \"@babel/types\";\nimport { HasOwnProperty } from \"../methods/index.js\";\nimport { ClassDefinitionEvaluation } from \"./ClassDeclaration\";\nimport { Functions } from \"../singletons.js\";\n\n// ECMA262 14.5.16\nexport default function(\n  ast: BabelNodeClassExpression,\n  strictCode: boolean,\n  env: LexicalEnvironment,\n  realm: Realm\n): Value {\n  // 1. If BindingIdentifieropt is not present, let className be undefined.\n  let className;\n  // 2. Else, let className be StringValue of BindingIdentifier.\n  if (ast.id != null) {\n    className = ast.id.name;\n  }\n  // 3. Let value be the result of ClassDefinitionEvaluation of ClassTail with argument className.\n  let value = ClassDefinitionEvaluation(realm, ast, className, strictCode, env);\n\n  // 4. ReturnIfAbrupt(value).\n\n  // 5. If className is not undefined, then\n  if (className !== undefined) {\n    // a. Let hasNameProperty be HasOwnProperty(value, \"name\").\n    let hasNameProperty = HasOwnProperty(realm, value, \"name\");\n\n    // b. ReturnIfAbrupt(hasNameProperty).\n\n    // c. If hasNameProperty is false, then\n    if (!hasNameProperty) {\n      // i. Perform SetFunctionName(value, className).\n      Functions.SetFunctionName(realm, value, className);\n    }\n  }\n\n  // 6. Return NormalCompletion(value).\n  return value;\n}\n"
  },
  {
    "path": "src/evaluators/ConditionalExpression.js",
    "content": "/**\n * Copyright (c) 2017-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n/* @flow strict-local */\n\nimport type { LexicalEnvironment } from \"../environment.js\";\nimport { AbstractValue, ConcreteValue, Value } from \"../values/index.js\";\nimport type { Reference } from \"../environment.js\";\nimport { construct_empty_effects } from \"../realm.js\";\nimport { Environment, To } from \"../singletons.js\";\nimport type { BabelNodeConditionalExpression } from \"@babel/types\";\nimport invariant from \"../invariant.js\";\nimport type { Realm } from \"../realm.js\";\n\nexport default function(\n  ast: BabelNodeConditionalExpression,\n  strictCode: boolean,\n  env: LexicalEnvironment,\n  realm: Realm\n): Value | Reference {\n  let exprRef = env.evaluate(ast.test, strictCode);\n  let exprValue = Environment.GetConditionValue(realm, exprRef);\n\n  if (exprValue instanceof ConcreteValue) {\n    if (To.ToBoolean(realm, exprValue)) {\n      return env.evaluate(ast.consequent, strictCode);\n    } else {\n      return env.evaluate(ast.alternate, strictCode);\n    }\n  }\n  invariant(exprValue instanceof AbstractValue);\n\n  const consequent = ast.consequent;\n  const alternate = ast.alternate;\n  if (!exprValue.mightNotBeTrue()) return env.evaluate(consequent, strictCode);\n  if (!exprValue.mightNotBeFalse()) return env.evaluate(alternate, strictCode);\n  return realm.evaluateWithAbstractConditional(\n    exprValue,\n    () => realm.evaluateNodeForEffects(consequent, strictCode, env),\n    () => (alternate ? realm.evaluateNodeForEffects(alternate, strictCode, env) : construct_empty_effects(realm))\n  );\n}\n"
  },
  {
    "path": "src/evaluators/ContinueStatement.js",
    "content": "/**\n * Copyright (c) 2017-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n/* @flow strict-local */\n\nimport type { Realm } from \"../realm.js\";\nimport type { LexicalEnvironment } from \"../environment.js\";\nimport type { Value } from \"../values/index.js\";\nimport { ContinueCompletion } from \"../completions.js\";\nimport type { BabelNodeContinueStatement } from \"@babel/types\";\n\nexport default function(\n  ast: BabelNodeContinueStatement,\n  strictCode: boolean,\n  env: LexicalEnvironment,\n  realm: Realm\n): Value {\n  throw new ContinueCompletion(realm.intrinsics.empty, ast.loc, ast.label && ast.label.name);\n}\n"
  },
  {
    "path": "src/evaluators/Directive.js",
    "content": "/**\n * Copyright (c) 2017-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n/* @flow strict-local */\n\nimport type { Realm } from \"../realm.js\";\nimport type { LexicalEnvironment } from \"../environment.js\";\nimport { Value } from \"../values/index.js\";\nimport type { BabelNodeDirective } from \"@babel/types\";\nimport invariant from \"../invariant.js\";\n\nexport default function(ast: BabelNodeDirective, strictCode: boolean, env: LexicalEnvironment, realm: Realm): Value {\n  let r = env.evaluate(ast.value, strictCode);\n  invariant(r instanceof Value);\n  return r;\n}\n"
  },
  {
    "path": "src/evaluators/DirectiveLiteral.js",
    "content": "/**\n * Copyright (c) 2017-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n/* @flow strict-local */\n\nexport { default } from \"./StringLiteral\";\n"
  },
  {
    "path": "src/evaluators/DoExpression.js",
    "content": "/**\n * Copyright (c) 2017-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n/* @flow strict-local */\n\nexport { default } from \"./BlockStatement.js\";\n"
  },
  {
    "path": "src/evaluators/DoWhileStatement.js",
    "content": "/**\n * Copyright (c) 2017-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n/* @flow */\n\nimport type { Realm } from \"../realm.js\";\nimport type { LexicalEnvironment } from \"../environment.js\";\nimport { FatalError } from \"../errors.js\";\nimport { Value } from \"../values/index.js\";\nimport { EmptyValue } from \"../values/index.js\";\nimport { UpdateEmpty } from \"../methods/index.js\";\nimport { LoopContinues, InternalGetResultValue } from \"./ForOfStatement.js\";\nimport { AbruptCompletion, BreakCompletion, SimpleNormalCompletion } from \"../completions.js\";\nimport { Environment, To } from \"../singletons.js\";\nimport invariant from \"../invariant.js\";\nimport type { BabelNodeDoWhileStatement } from \"@babel/types\";\n\nexport default function(\n  ast: BabelNodeDoWhileStatement,\n  strictCode: boolean,\n  env: LexicalEnvironment,\n  realm: Realm,\n  labelSet: ?Array<string>\n): Value {\n  let { body, test } = ast;\n\n  // 1. Let V be undefined.\n  let V = realm.intrinsics.undefined;\n\n  // 2. Repeat\n  let resultOrDiagnostic = realm.evaluateWithUndoForDiagnostic(() => {\n    while (true) {\n      // a. Let stmt be the result of evaluating Statement.\n      let stmt = env.evaluateCompletion(body, strictCode);\n      //todo: check if stmt is JoinedNormalAndAbruptCompletions and defer to fixpoint computation below\n      invariant(stmt instanceof Value || stmt instanceof AbruptCompletion);\n\n      // b. If LoopContinues(stmt, labelSet) is false, return Completion(UpdateEmpty(stmt, V)).\n      if (LoopContinues(realm, stmt, labelSet) === false) {\n        invariant(stmt instanceof AbruptCompletion);\n        // ECMA262 13.1.7\n        if (stmt instanceof BreakCompletion) {\n          if (!stmt.target) return (UpdateEmpty(realm, stmt, V): any).value;\n        }\n        throw UpdateEmpty(realm, stmt, V);\n      }\n\n      // c. If stmt.[[Value]] is not empty, let V be stmt.[[Value]].\n      let resultValue = InternalGetResultValue(realm, stmt);\n      if (!(resultValue instanceof EmptyValue)) V = resultValue;\n\n      // d. Let exprRef be the result of evaluating Expression.\n      let exprRef = env.evaluate(test, strictCode);\n\n      // e. Let exprValue be ? GetValue(exprRef).\n      let exprValue = Environment.GetConditionValue(realm, exprRef);\n\n      // f. If ToBoolean(exprValue) is false, return NormalCompletion(V).\n      if (To.ToBooleanPartial(realm, exprValue) === false) return V;\n    }\n    invariant(false);\n  });\n  if (resultOrDiagnostic instanceof Value) return resultOrDiagnostic;\n\n  // If we get here then unrolling the loop did not work, possibly because the value of the loop condition is not known,\n  // so instead try to compute a fixpoint for it\n  let iteration = () => {\n    let bodyResult = env.evaluateCompletion(body, strictCode);\n    if (bodyResult instanceof Value) bodyResult = new SimpleNormalCompletion(bodyResult);\n    let exprRef = env.evaluate(test, strictCode);\n    let testResult = Environment.GetConditionValue(realm, exprRef);\n    return [testResult, bodyResult];\n  };\n  let result = realm.evaluateForFixpointEffects(iteration);\n  if (result !== undefined) {\n    let [outsideEffects, insideEffects, cond] = result;\n    let rval = outsideEffects.result;\n    let bodyGenerator = insideEffects.generator;\n    realm.applyEffects(outsideEffects);\n    let generator = realm.generator;\n    invariant(generator !== undefined);\n    generator.emitDoWhileStatement(cond, bodyGenerator);\n    invariant(rval instanceof SimpleNormalCompletion, \"todo: handle loops that throw exceptions or return\");\n    return rval.value;\n  }\n\n  // If we get here the fixpoint computation failed as well. Report the diagnostic from the unrolling and throw.\n  realm.handleError(resultOrDiagnostic);\n  throw new FatalError();\n}\n"
  },
  {
    "path": "src/evaluators/EmptyStatement.js",
    "content": "/**\n * Copyright (c) 2017-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n/* @flow strict-local */\n\nimport type { Realm } from \"../realm.js\";\nimport type { LexicalEnvironment } from \"../environment.js\";\nimport type { Value } from \"../values/index.js\";\nimport type { BabelNodeEmptyStatement } from \"@babel/types\";\n\nexport default function(\n  ast: BabelNodeEmptyStatement,\n  strictCode: boolean,\n  env: LexicalEnvironment,\n  realm: Realm\n): Value {\n  return realm.intrinsics.empty;\n}\n"
  },
  {
    "path": "src/evaluators/ExpressionStatement.js",
    "content": "/**\n * Copyright (c) 2017-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n/* @flow strict-local */\n\nimport type { Realm } from \"../realm.js\";\nimport type { LexicalEnvironment } from \"../environment.js\";\nimport type { Value } from \"../values/index.js\";\nimport { Environment } from \"../singletons.js\";\nimport type { BabelNodeExpressionStatement } from \"@babel/types\";\n\nexport default function(\n  ast: BabelNodeExpressionStatement,\n  strictCode: boolean,\n  env: LexicalEnvironment,\n  realm: Realm\n): Value {\n  // ECMA262 13.5.1\n  // 1. Let exprRef be the result of evaluating Expression.\n  let exprRef = env.evaluate(ast.expression, strictCode);\n\n  // 2. Return ? GetValue(exprRef).\n  return Environment.GetValue(realm, exprRef);\n}\n"
  },
  {
    "path": "src/evaluators/File.js",
    "content": "/**\n * Copyright (c) 2017-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n/* @flow strict-local */\n\nimport type { Realm } from \"../realm.js\";\nimport type { LexicalEnvironment } from \"../environment.js\";\nimport { Value } from \"../values/index.js\";\nimport type { BabelNodeFile } from \"@babel/types\";\nimport invariant from \"../invariant.js\";\n\nexport default function(ast: BabelNodeFile, strictCode: boolean, env: LexicalEnvironment, realm: Realm): Value {\n  let r = env.evaluate(ast.program, strictCode);\n  invariant(r instanceof Value);\n  return r;\n}\n"
  },
  {
    "path": "src/evaluators/ForInStatement.js",
    "content": "/**\n * Copyright (c) 2017-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n/* @flow */\n\nimport type { Realm } from \"../realm.js\";\nimport type { LexicalEnvironment } from \"../environment.js\";\nimport { BreakCompletion, SimpleNormalCompletion } from \"../completions.js\";\nimport { DeclarativeEnvironmentRecord } from \"../environment.js\";\nimport { CompilerDiagnostic, FatalError } from \"../errors.js\";\nimport { ForInOfHeadEvaluation, ForInOfBodyEvaluation } from \"./ForOfStatement.js\";\nimport { EnumerableOwnProperties, UpdateEmpty } from \"../methods/index.js\";\nimport { Environment } from \"../singletons.js\";\nimport { AbstractValue, AbstractObjectValue, ArrayValue, ObjectValue, StringValue, Value } from \"../values/index.js\";\nimport type {\n  BabelNodeExpression,\n  BabelNodeForInStatement,\n  BabelNodeSourceLocation,\n  BabelNodeStatement,\n  BabelNodeVariableDeclaration,\n} from \"@babel/types\";\nimport invariant from \"../invariant.js\";\nimport * as t from \"@babel/types\";\n\n// helper func to report error\nfunction reportError(realm: Realm, loc: ?BabelNodeSourceLocation) {\n  let error = new CompilerDiagnostic(\n    \"for in loops over unknown objects are not yet supported\",\n    loc,\n    \"PP0013\",\n    \"FatalError\"\n  );\n  realm.handleError(error);\n  throw new FatalError();\n}\n\n// ECMA262 13.7.5.11\nexport default function(\n  ast: BabelNodeForInStatement,\n  strictCode: boolean,\n  env: LexicalEnvironment,\n  realm: Realm,\n  labelSet: ?Array<string>\n): Value {\n  let { left, right, body } = ast;\n\n  function reportErrorAndThrowIfNotConcrete(val: Value, loc: ?BabelNodeSourceLocation) {\n    if (val instanceof AbstractValue) reportError(realm, loc);\n  }\n\n  try {\n    if (left.type === \"VariableDeclaration\") {\n      if (left.kind === \"var\") {\n        // for (var ForBinding in Expression) Statement\n        // 1. Let keyResult be ? ForIn/OfHeadEvaluation(« », Expression, enumerate).\n        let keyResult = ForInOfHeadEvaluation(realm, env, [], right, \"enumerate\", strictCode);\n        if (keyResult.isPartialObject() && keyResult.isSimpleObject()) {\n          return emitResidualLoopIfSafe(ast, strictCode, env, realm, left, right, keyResult, body);\n        }\n        reportErrorAndThrowIfNotConcrete(keyResult, right.loc);\n        invariant(keyResult instanceof ObjectValue);\n\n        // 2. Return ? ForIn/OfBodyEvaluation(ForBinding, Statement, keyResult, varBinding, labelSet).\n        return ForInOfBodyEvaluation(\n          realm,\n          env,\n          left.declarations[0].id,\n          body,\n          keyResult,\n          \"varBinding\",\n          labelSet,\n          strictCode\n        );\n      } else {\n        // for (ForDeclaration in Expression) Statement\n        // 1. Let keyResult be the result of performing ? ForIn/OfHeadEvaluation(BoundNames of ForDeclaration, Expression, enumerate).\n        let keyResult = ForInOfHeadEvaluation(\n          realm,\n          env,\n          Environment.BoundNames(realm, left),\n          right,\n          \"enumerate\",\n          strictCode\n        );\n        reportErrorAndThrowIfNotConcrete(keyResult, right.loc);\n        invariant(keyResult instanceof ObjectValue);\n\n        // 2. Return ? ForIn/OfBodyEvaluation(ForDeclaration, Statement, keyResult, lexicalBinding, labelSet).\n        return ForInOfBodyEvaluation(realm, env, left, body, keyResult, \"lexicalBinding\", labelSet, strictCode);\n      }\n    } else {\n      // for (LeftHandSideExpression in Expression) Statement\n      // 1. Let keyResult be ? ForIn/OfHeadEvaluation(« », Expression, enumerate).\n      let keyResult = ForInOfHeadEvaluation(realm, env, [], right, \"enumerate\", strictCode);\n      reportErrorAndThrowIfNotConcrete(keyResult, right.loc);\n      invariant(keyResult instanceof ObjectValue);\n\n      // 2. Return ? ForIn/OfBodyEvaluation(LeftHandSideExpression, Statement, keyResult, assignment, labelSet).\n      return ForInOfBodyEvaluation(realm, env, left, body, keyResult, \"assignment\", labelSet, strictCode);\n    }\n  } catch (e) {\n    if (e instanceof BreakCompletion) {\n      if (!e.target) return (UpdateEmpty(realm, e, realm.intrinsics.undefined): any).value;\n    }\n    throw e;\n  }\n}\n\nfunction emitResidualLoopIfSafe(\n  ast: BabelNodeForInStatement,\n  strictCode: boolean,\n  env: LexicalEnvironment,\n  realm: Realm,\n  lh: BabelNodeVariableDeclaration,\n  obexpr: BabelNodeExpression,\n  ob: ObjectValue | AbstractObjectValue,\n  body: BabelNodeStatement\n) {\n  invariant(ob.isSimpleObject());\n  let oldEnv = realm.getRunningContext().lexicalEnvironment;\n  let blockEnv = Environment.NewDeclarativeEnvironment(realm, oldEnv);\n  realm.getRunningContext().lexicalEnvironment = blockEnv;\n  try {\n    let envRec = blockEnv.environmentRecord;\n    invariant(envRec instanceof DeclarativeEnvironmentRecord, \"expected declarative environment record\");\n    let absStr = AbstractValue.createFromType(realm, StringValue);\n    let boundName;\n    for (let n of Environment.BoundNames(realm, lh)) {\n      invariant(boundName === undefined);\n      boundName = t.identifier(n);\n      envRec.CreateMutableBinding(n, false);\n      envRec.InitializeBinding(n, absStr);\n    }\n    let { result, generator: gen, modifiedBindings, modifiedProperties, createdObjects } = realm.evaluateNodeForEffects(\n      body,\n      strictCode,\n      blockEnv\n    );\n    if (\n      result instanceof SimpleNormalCompletion &&\n      gen.empty() &&\n      modifiedBindings.size === 0 &&\n      modifiedProperties.size === 1\n    ) {\n      invariant(createdObjects.size === 0); // or there will be more than one property\n      let targetObject;\n      let sourceObject;\n      modifiedProperties.forEach((desc, key, map) => {\n        if (key.object.unknownProperty === key) {\n          targetObject = key.object;\n          invariant(desc !== undefined);\n          let sourceValue = desc.throwIfNotConcrete(realm).value;\n          if (sourceValue instanceof AbstractValue) {\n            // because sourceValue was written to key.object.unknownProperty it must be that\n            let cond = sourceValue.args[0];\n            // and because the write always creates a value of this shape\n            invariant(cond instanceof AbstractValue && cond.kind === \"template for property name condition\");\n            let falseVal = sourceValue.args[2];\n            if (falseVal instanceof AbstractValue && falseVal.kind === \"template for prototype member expression\") {\n              // check that the value that was assigned itself came from\n              // an expression of the form sourceObject[absStr].\n              let mem = sourceValue.args[1];\n              while (mem instanceof AbstractValue) {\n                if (\n                  mem.kind === \"sentinel member expression\" &&\n                  mem.args[0] instanceof ObjectValue &&\n                  mem.args[1] === absStr\n                ) {\n                  sourceObject = mem.args[0];\n                  break;\n                }\n                // check if mem is a test for absStr being equal to a known property\n                // if so skip over it until we get to the expression of the form sourceObject[absStr].\n                let condition = mem.args[0];\n                if (condition instanceof AbstractValue && condition.kind === \"check for known property\") {\n                  if (condition.args[0] === absStr) {\n                    mem = mem.args[2];\n                    continue;\n                  }\n                }\n                break;\n              }\n            }\n          }\n        }\n      });\n      if (targetObject instanceof ObjectValue && sourceObject !== undefined) {\n        let o = ob;\n        if (ob instanceof AbstractObjectValue && !ob.values.isTop() && ob.values.getElements().size === 1) {\n          // Note that it is not safe, in general, to extract a concrete object from the values domain of\n          // an abstract object. We can get away with it here only because the concrete object does not\n          // escape the code below and is thus never referenced directly in generated code because of this logic.\n          for (let oe of ob.values.getElements()) {\n            invariant(oe instanceof ObjectValue);\n            o = oe;\n          }\n        }\n        let generator = realm.generator;\n        invariant(generator !== undefined);\n        // make target object simple and partial, so that it returns a fully\n        // abstract value for every property it is queried for.\n        targetObject.makeSimple();\n        targetObject.makePartial();\n        if (sourceObject === o) {\n          // Known enumerable properties of sourceObject can become known properties of targetObject.\n          invariant(sourceObject.isPartialObject());\n          // EnumerableOwnProperties is sufficient because sourceObject is simple\n          let keyValPairs = EnumerableOwnProperties(realm, sourceObject, \"key+value\", true);\n          for (let keyVal of keyValPairs) {\n            invariant(keyVal instanceof ArrayValue);\n            let key = keyVal.$Get(\"0\", keyVal);\n            let val = keyVal.$Get(\"1\", keyVal);\n            invariant(key instanceof StringValue); // sourceObject is simple\n            targetObject.$Set(key, val, targetObject);\n          }\n        }\n        // add loop to generator\n        invariant(boundName != null);\n        generator.emitForInStatement(o, lh, sourceObject, targetObject, boundName);\n        return realm.intrinsics.undefined;\n      }\n    }\n  } finally {\n    // 6. Set the running execution context's LexicalEnvironment to oldEnv.\n    realm.getRunningContext().lexicalEnvironment = oldEnv;\n    realm.onDestroyScope(blockEnv);\n  }\n\n  reportError(realm, obexpr.loc);\n  invariant(false);\n}\n"
  },
  {
    "path": "src/evaluators/ForOfStatement.js",
    "content": "/**\n * Copyright (c) 2017-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n/* @flow */\n\nimport type { Realm } from \"../realm.js\";\nimport type { LexicalEnvironment } from \"../environment.js\";\nimport { CompilerDiagnostic, FatalError } from \"../errors.js\";\nimport { DeclarativeEnvironmentRecord } from \"../environment.js\";\nimport { Reference } from \"../environment.js\";\nimport {\n  AbruptCompletion,\n  BreakCompletion,\n  Completion,\n  ContinueCompletion,\n  JoinedAbruptCompletions,\n  NormalCompletion,\n} from \"../completions.js\";\nimport {\n  AbstractObjectValue,\n  AbstractValue,\n  EmptyValue,\n  NullValue,\n  ObjectValue,\n  UndefinedValue,\n  Value,\n} from \"../values/index.js\";\nimport invariant from \"../invariant.js\";\nimport {\n  IteratorStep,\n  IteratorValue,\n  IteratorClose,\n  UpdateEmpty,\n  DestructuringAssignmentEvaluation,\n  GetIterator,\n} from \"../methods/index.js\";\nimport { Environment, Properties, To } from \"../singletons.js\";\nimport type {\n  BabelNode,\n  BabelNodeForOfStatement,\n  BabelNodeLVal,\n  BabelNodeStatement,\n  BabelNodeVariableDeclaration,\n} from \"@babel/types\";\n\nexport type IterationKind = \"iterate\" | \"enumerate\";\nexport type LhsKind = \"lexicalBinding\" | \"varBinding\" | \"assignment\";\n\nexport function InternalGetResultValue(realm: Realm, result: Value | Completion): Value {\n  if (result instanceof Completion) {\n    return result.value;\n  } else {\n    return result;\n  }\n}\n\n// ECMA262 13.7.1.2\nexport function LoopContinues(realm: Realm, completion: Value | Completion, labelSet: ?Array<string>): boolean {\n  // 1. If completion.[[Type]] is normal, return true.\n  if (completion instanceof Value || completion instanceof NormalCompletion) return true;\n  if (completion instanceof JoinedAbruptCompletions) {\n    return (\n      LoopContinues(realm, completion.consequent, labelSet) || LoopContinues(realm, completion.alternate, labelSet)\n    );\n  }\n\n  // 2. If completion.[[Type]] is not continue, return false.\n  if (!(completion instanceof ContinueCompletion)) return false;\n\n  // 3. If completion.[[Target]] is empty, return true.\n  if (!completion.target) return true;\n\n  // 4. If completion.[[Target]] is an element of labelSet, return true.\n  if (labelSet != null && labelSet.indexOf(completion.target) >= 0) return true;\n\n  // 5. Return false.\n  return false;\n}\n\n// ECMA262 13.7.5.10\nfunction BindingInstantiation(realm: Realm, ast: BabelNodeVariableDeclaration, env: LexicalEnvironment) {\n  // ast = ForDeclaration : LetOrConst ForBinding\n\n  // 1. Let envRec be environment's EnvironmentRecord.\n  let envRec = env.environmentRecord;\n\n  // 2. Assert: envRec is a declarative Environment Record.\n  invariant(envRec instanceof DeclarativeEnvironmentRecord);\n\n  // 3. For each element name of the BoundNames of ForBinding do\n  for (let name of Environment.BoundNames(realm, ast)) {\n    // a. If IsConstantDeclaration of LetOrConst is true, then\n    if (ast.kind === \"const\") {\n      // i. Perform ! envRec.CreateImmutableBinding(name, true).\n      envRec.CreateImmutableBinding(name, true);\n    } else {\n      // b.\n      // i. Perform ! envRec.CreateMutableBinding(name, false).\n      envRec.CreateMutableBinding(name, false);\n    }\n  }\n}\n\n// ECMA262 13.7.5.12\nexport function ForInOfHeadEvaluation(\n  realm: Realm,\n  env: LexicalEnvironment,\n  TDZnames: Array<string>,\n  expr: BabelNode,\n  iterationKind: IterationKind,\n  strictCode: boolean\n): ObjectValue | AbstractObjectValue {\n  // 1. Let oldEnv be the running execution context's LexicalEnvironment.\n  let oldEnv = realm.getRunningContext().lexicalEnvironment;\n\n  // 2. If TDZnames is not an empty List, then\n  if (TDZnames.length) {\n    // a. Assert: TDZnames has no duplicate entries.\n\n    // b. Let TDZ be NewDeclarativeEnvironment(oldEnv).\n    let TDZ = Environment.NewDeclarativeEnvironment(realm, oldEnv);\n\n    // c. Let TDZEnvRec be TDZ's EnvironmentRecord.\n    let TDZEnvRec = TDZ.environmentRecord;\n\n    // d. For each string name in TDZnames, do\n    for (let name of TDZnames) {\n      // i. Perform ! TDZEnvRec.CreateMutableBinding(name, false).\n      TDZEnvRec.CreateMutableBinding(name, false);\n    }\n\n    // e. Set the running execution context's LexicalEnvironment to TDZ.\n    realm.getRunningContext().lexicalEnvironment = TDZ;\n    env = TDZ;\n  }\n\n  let exprRef;\n  try {\n    // 3. Let exprRef be the result of evaluating expr.\n    exprRef = env.evaluate(expr, strictCode);\n  } finally {\n    // 4. Set the running execution context's LexicalEnvironment to oldEnv.\n    let lexEnv = realm.getRunningContext().lexicalEnvironment;\n    if (lexEnv !== oldEnv) realm.onDestroyScope(lexEnv);\n    realm.getRunningContext().lexicalEnvironment = oldEnv;\n  }\n  env = oldEnv;\n\n  // 5. Let exprValue be ? GetValue(exprRef).\n  let exprValue = Environment.GetValue(realm, exprRef);\n\n  // 6. If iterationKind is enumerate, then\n  if (iterationKind === \"enumerate\") {\n    // a. If exprValue.[[Value]] is null or undefined, then\n    if (exprValue instanceof NullValue || exprValue instanceof UndefinedValue) {\n      // i. Return Completion{[[Type]]: break, [[Value]]: empty, [[Target]]: empty}.\n      throw new BreakCompletion(realm.intrinsics.empty, expr.loc, null);\n    }\n\n    // b. Let obj be ToObject(exprValue).\n    let obj = To.ToObject(realm, exprValue);\n\n    // c. Return ? EnumerateObjectProperties(obj).\n    if (obj.isPartialObject() || obj instanceof AbstractObjectValue) {\n      return obj;\n    } else {\n      return Properties.EnumerateObjectProperties(realm, obj);\n    }\n  } else {\n    // 8. Else,\n    // 1. Assert: iterationKind is iterate.\n    invariant(iterationKind === \"iterate\", \"expected iterationKind to be iterate\");\n\n    if (exprValue instanceof AbstractValue) {\n      let error = new CompilerDiagnostic(\n        \"for of loops over unknown collections are not yet supported\",\n        expr.loc,\n        \"PP0014\",\n        \"FatalError\"\n      );\n      realm.handleError(error);\n      throw new FatalError();\n    }\n\n    // 1. Return ? GetIterator(exprValue).\n    return GetIterator(realm, exprValue);\n  }\n}\n\n// ECMA262 13.7.5.13\nexport function ForInOfBodyEvaluation(\n  realm: Realm,\n  env: LexicalEnvironment,\n  lhs: BabelNodeVariableDeclaration | BabelNodeLVal,\n  stmt: BabelNodeStatement,\n  iterator: ObjectValue,\n  lhsKind: LhsKind,\n  labelSet: ?Array<string>,\n  strictCode: boolean\n): Value {\n  // 1. Let oldEnv be the running execution context's LexicalEnvironment.\n  let oldEnv = realm.getRunningContext().lexicalEnvironment;\n\n  // 2. Let V be undefined.\n  let V: Value = realm.intrinsics.undefined;\n\n  // 3. Let destructuring be IsDestructuring of lhs.\n  let destructuring = Environment.IsDestructuring(lhs);\n\n  // 4. If destructuring is true and if lhsKind is assignment, then\n  if (destructuring && lhsKind === \"assignment\") {\n    // a. Assert: lhs is a LeftHandSideExpression.\n    invariant(lhs.type !== \"VariableDeclaration\");\n\n    // b. Let assignmentPattern be the parse of the source text corresponding to lhs using AssignmentPattern as the goal symbol.\n  }\n\n  // 5. Repeat\n  while (true) {\n    // a. Let nextResult be ? IteratorStep(iterator).\n    let nextResult = IteratorStep(realm, iterator);\n\n    // b. If nextResult is false, return NormalCompletion(V).\n    if (!nextResult) return V;\n\n    // c. Let nextValue be ? IteratorValue(nextResult).\n    let nextValue = IteratorValue(realm, nextResult);\n\n    // d. If lhsKind is either assignment or varBinding, then\n    let iterationEnv: void | LexicalEnvironment;\n    let lhsRef;\n    if (lhsKind === \"assignment\" || lhsKind === \"varBinding\") {\n      // i. If destructuring is false, then\n      if (!destructuring) {\n        // 1. Let lhsRef be the result of evaluating lhs. (It may be evaluated repeatedly.)\n        lhsRef = env.evaluateCompletion(lhs, strictCode);\n      }\n    } else {\n      // e. Else,\n      // i. Assert: lhsKind is lexicalBinding.\n      invariant(lhsKind === \"lexicalBinding\", \"expected lhsKind to be lexicalBinding\");\n      invariant(lhs.type === \"VariableDeclaration\");\n\n      // ii. Assert: lhs is a ForDeclaration.\n\n      // iii. Let iterationEnv be NewDeclarativeEnvironment(oldEnv).\n      iterationEnv = Environment.NewDeclarativeEnvironment(realm, oldEnv);\n\n      // iv. Perform BindingInstantiation for lhs passing iterationEnv as the argument.\n      BindingInstantiation(realm, lhs, iterationEnv);\n\n      // v. Set the running execution context's LexicalEnvironment to iterationEnv.\n      realm.getRunningContext().lexicalEnvironment = iterationEnv;\n      env = iterationEnv;\n\n      // vi. If destructuring is false, then\n      if (!destructuring) {\n        let names = Environment.BoundNames(realm, lhs);\n\n        // 1. Assert: lhs binds a single name.\n        invariant(names.length === 1, \"expected single name\");\n\n        // 2. Let lhsName be the sole element of BoundNames of lhs.\n        let lhsName = names[0];\n\n        // 3. Let lhsRef be ! ResolveBinding(lhsName).\n        lhsRef = Environment.ResolveBinding(realm, lhsName, strictCode);\n      }\n    }\n\n    // f. If destructuring is false, then\n    let status;\n    try {\n      if (!destructuring) {\n        // i. If lhsRef is an abrupt completion, then\n        if (lhsRef instanceof AbruptCompletion) {\n          // 1. Let status be lhsRef.\n          status = lhsRef;\n        } else if (lhsKind === \"lexicalBinding\") {\n          // ii. Else if lhsKind is lexicalBinding, then\n          // 1. Let status be InitializeReferencedBinding(lhsRef, nextValue).\n          invariant(lhsRef instanceof Reference);\n          status = Environment.InitializeReferencedBinding(realm, lhsRef, nextValue);\n        } else {\n          // iii. Else,\n          // 1. Let status be PutValue(lhsRef, nextValue).\n          invariant(lhsRef !== undefined);\n          status = Properties.PutValue(realm, lhsRef, nextValue);\n        }\n      } else {\n        // g. Else,\n        // i. If lhsKind is assignment, then\n        if (lhsKind === \"assignment\") {\n          invariant(lhs.type === \"ArrayPattern\" || lhs.type === \"ObjectPattern\");\n\n          // 1. Let status be the result of performing DestructuringAssignmentEvaluation of assignmentPattern using nextValue as the argument.\n          status = DestructuringAssignmentEvaluation(realm, lhs, nextValue, strictCode, iterationEnv || env);\n        } else if (lhsKind === \"varBinding\") {\n          // ii. Else if lhsKind is varBinding, then\n          // 1. Assert: lhs is a ForBinding.\n\n          // 2. Let status be the result of performing BindingInitialization for lhs passing nextValue and undefined as the arguments.\n          status = Environment.BindingInitialization(realm, lhs, nextValue, strictCode, undefined);\n        } else {\n          // iii. Else,\n          // 1. Assert: lhsKind is lexicalBinding.\n          invariant(lhsKind === \"lexicalBinding\");\n\n          // 2. Assert: lhs is a ForDeclaration.\n\n          // 3. Let status be the result of performing BindingInitialization for lhs passing nextValue and iterationEnv as arguments.\n          invariant(iterationEnv !== undefined);\n          status = Environment.BindingInitialization(realm, lhs, nextValue, strictCode, iterationEnv);\n        }\n      }\n    } catch (e) {\n      if (e instanceof AbruptCompletion) {\n        status = e;\n      } else {\n        throw e;\n      }\n    }\n\n    // h. If status is an abrupt completion, then\n    if (status instanceof AbruptCompletion) {\n      // i. Set the running execution context's LexicalEnvironment to oldEnv.\n      realm.getRunningContext().lexicalEnvironment = oldEnv;\n\n      // ii. Return ? IteratorClose(iterator, status).\n      throw IteratorClose(realm, iterator, status);\n    }\n\n    // i. Let result be the result of evaluating stmt.\n    let result = env.evaluateCompletion(stmt, strictCode);\n    invariant(result instanceof Value || result instanceof AbruptCompletion);\n\n    // j. Set the running execution context's LexicalEnvironment to oldEnv.\n\n    let lexEnv = realm.getRunningContext().lexicalEnvironment;\n    if (lexEnv !== oldEnv) realm.onDestroyScope(lexEnv);\n    realm.getRunningContext().lexicalEnvironment = oldEnv;\n    env = oldEnv;\n\n    // k. If LoopContinues(result, labelSet) is false, return ? IteratorClose(iterator, UpdateEmpty(result, V)).\n    if (!LoopContinues(realm, result, labelSet)) {\n      invariant(result instanceof AbruptCompletion);\n      result = UpdateEmpty(realm, result, V);\n      invariant(result instanceof AbruptCompletion);\n      throw IteratorClose(realm, iterator, result);\n    }\n\n    // l. If result.[[Value]] is not empty, let V be result.[[Value]].\n    let resultValue = InternalGetResultValue(realm, result);\n    if (!(resultValue instanceof EmptyValue)) V = resultValue;\n  }\n\n  /* istanbul ignore next */\n  invariant(false); // can't get here but there is no other way to make Flow happy\n}\n\n// ECMA262 13.7.5.11\nexport default function(\n  ast: BabelNodeForOfStatement,\n  strictCode: boolean,\n  env: LexicalEnvironment,\n  realm: Realm,\n  labelSet: ?Array<string>\n): Value {\n  let { left, right, body } = ast;\n\n  try {\n    if (left.type === \"VariableDeclaration\") {\n      if (left.kind === \"var\") {\n        // for (var ForBinding o fAssignmentExpression) Statement\n        // 1. Let keyResult be the result of performing ? ForIn/OfHeadEvaluation(« », AssignmentExpression, iterate).\n        let keyResult = ForInOfHeadEvaluation(realm, env, [], right, \"iterate\", strictCode);\n        invariant(keyResult instanceof ObjectValue);\n\n        // 2. Return ? ForIn/OfBodyEvaluation(ForBinding, Statement, keyResult, varBinding, labelSet).\n        return ForInOfBodyEvaluation(\n          realm,\n          env,\n          left.declarations[0].id,\n          body,\n          keyResult,\n          \"varBinding\",\n          labelSet,\n          strictCode\n        );\n      } else {\n        // for (ForDeclaration of AssignmentExpression) Statement\n        // 1. Let keyResult be the result of performing ? ForIn/OfHeadEvaluation(BoundNames of ForDeclaration, AssignmentExpression, iterate).\n        let keyResult = ForInOfHeadEvaluation(\n          realm,\n          env,\n          Environment.BoundNames(realm, left),\n          right,\n          \"iterate\",\n          strictCode\n        );\n        invariant(keyResult instanceof ObjectValue);\n\n        // 2. Return ? ForIn/OfBodyEvaluation(ForDeclaration, Statement, keyResult, lexicalBinding, labelSet).\n        return ForInOfBodyEvaluation(realm, env, left, body, keyResult, \"lexicalBinding\", labelSet, strictCode);\n      }\n    } else {\n      // for (LeftHandSideExpression of AssignmentExpression) Statement\n      // 1. Let keyResult be the result of performing ? ForIn/OfHeadEvaluation(« », AssignmentExpression, iterate).\n      let keyResult = ForInOfHeadEvaluation(realm, env, [], right, \"iterate\", strictCode);\n      invariant(keyResult instanceof ObjectValue);\n\n      // 2. Return ? ForIn/OfBodyEvaluation(LeftHandSideExpression, Statement, keyResult, assignment, labelSet).\n      return ForInOfBodyEvaluation(realm, env, left, body, keyResult, \"assignment\", labelSet, strictCode);\n    }\n  } catch (e) {\n    if (e instanceof BreakCompletion) {\n      if (!e.target) return (UpdateEmpty(realm, e, realm.intrinsics.undefined): any).value;\n    }\n    throw e;\n  }\n}\n"
  },
  {
    "path": "src/evaluators/ForStatement.js",
    "content": "/**\n * Copyright (c) 2017-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n/* @flow */\n\nimport type { LexicalEnvironment } from \"../environment.js\";\nimport { Realm } from \"../realm.js\";\nimport {\n  AbstractValue,\n  Value,\n  EmptyValue,\n  ECMAScriptSourceFunctionValue,\n  type UndefinedValue,\n} from \"../values/index.js\";\nimport {\n  AbruptCompletion,\n  BreakCompletion,\n  Completion,\n  ContinueCompletion,\n  JoinedAbruptCompletions,\n  JoinedNormalAndAbruptCompletions,\n  ReturnCompletion,\n  ThrowCompletion,\n  SimpleNormalCompletion,\n} from \"../completions.js\";\nimport traverse from \"@babel/traverse\";\nimport type { BabelTraversePath } from \"@babel/traverse\";\nimport { TypesDomain, ValuesDomain } from \"../domains/index.js\";\nimport { CompilerDiagnostic, FatalError } from \"../errors.js\";\nimport { UpdateEmpty } from \"../methods/index.js\";\nimport { LoopContinues, InternalGetResultValue } from \"./ForOfStatement.js\";\nimport { Environment, Functions, Leak, To } from \"../singletons.js\";\nimport invariant from \"../invariant.js\";\nimport * as t from \"@babel/types\";\nimport type { BabelNodeExpression, BabelNodeForStatement, BabelNodeBlockStatement } from \"@babel/types\";\nimport { createOperationDescriptor } from \"../utils/generator.js\";\n\ntype BailOutWrapperInfo = {\n  usesArguments: boolean,\n  usesThis: boolean,\n  usesReturn: boolean,\n  usesGotoToLabel: boolean,\n  usesThrow: boolean,\n  varPatternUnsupported: boolean,\n};\n\n// ECMA262 13.7.4.9\nexport function CreatePerIterationEnvironment(realm: Realm, perIterationBindings: Array<string>): UndefinedValue {\n  // 1. If perIterationBindings has any elements, then\n  if (perIterationBindings.length > 0) {\n    // a. Let lastIterationEnv be the running execution context's LexicalEnvironment.\n    let lastIterationEnv = realm.getRunningContext().lexicalEnvironment;\n    // b. Let lastIterationEnvRec be lastIterationEnv's EnvironmentRecord.\n    let lastIterationEnvRec = lastIterationEnv.environmentRecord;\n    // c. Let outer be lastIterationEnv's outer environment reference.\n    let outer = lastIterationEnv.parent;\n    // d. Assert: outer is not null.\n    invariant(outer !== null);\n    // e. Let thisIterationEnv be NewDeclarativeEnvironment(outer).\n    let thisIterationEnv = Environment.NewDeclarativeEnvironment(realm, outer);\n    // f. Let thisIterationEnvRec be thisIterationEnv's EnvironmentRecord.\n    realm.onDestroyScope(lastIterationEnv);\n    let thisIterationEnvRec = thisIterationEnv.environmentRecord;\n    // g. For each element bn of perIterationBindings do,\n    for (let bn of perIterationBindings) {\n      // i. Perform ! thisIterationEnvRec.CreateMutableBinding(bn, false).\n      thisIterationEnvRec.CreateMutableBinding(bn, false);\n      // ii. Let lastValue be ? lastIterationEnvRec.GetBindingValue(bn, true).\n      let lastValue = lastIterationEnvRec.GetBindingValue(bn, true);\n      // iii.Perform thisIterationEnvRec.InitializeBinding(bn, lastValue).\n      thisIterationEnvRec.InitializeBinding(bn, lastValue);\n    }\n    // h. Set the running execution context's LexicalEnvironment to thisIterationEnv.\n    realm.getRunningContext().lexicalEnvironment = thisIterationEnv;\n  }\n  // 2. Return undefined.\n  return realm.intrinsics.undefined;\n}\n\n// ECMA262 13.7.4.8\nfunction ForBodyEvaluation(\n  realm: Realm,\n  test,\n  increment,\n  stmt,\n  perIterationBindings: Array<string>,\n  labelSet: ?Array<string>,\n  strictCode: boolean\n): Value {\n  // 1. Let V be undefined.\n  let V: Value = realm.intrinsics.undefined;\n\n  // 2. Perform ? CreatePerIterationEnvironment(perIterationBindings).\n  CreatePerIterationEnvironment(realm, perIterationBindings);\n  let env = realm.getRunningContext().lexicalEnvironment;\n  let possibleInfiniteLoopIterations = 0;\n\n  // 3. Repeat\n  while (true) {\n    let result;\n    // a. If test is not [empty], then\n    if (test) {\n      // i. Let testRef be the result of evaluating test.\n      let testRef = env.evaluate(test, strictCode);\n\n      // ii. Let testValue be ? GetValue(testRef).\n      let testValue = Environment.GetValue(realm, testRef);\n\n      // iii. If ToBoolean(testValue) is false, return NormalCompletion(V).\n      if (!To.ToBooleanPartial(realm, testValue)) {\n        result = Functions.incorporateSavedCompletion(realm, V);\n        if (result instanceof JoinedNormalAndAbruptCompletions) {\n          let selector = c => c instanceof BreakCompletion && !c.target;\n          result = Completion.normalizeSelectedCompletions(selector, result);\n          result = realm.composeWithSavedCompletion(result);\n        }\n        return V;\n      }\n    }\n\n    // b. Let result be the result of evaluating stmt.\n    result = env.evaluateCompletion(stmt, strictCode);\n    invariant(result instanceof Value || result instanceof AbruptCompletion);\n\n    // this is a join point for break and continue completions\n    result = Functions.incorporateSavedCompletion(realm, result);\n    invariant(result !== undefined);\n    if (result instanceof Value) result = new SimpleNormalCompletion(result);\n\n    // c. If LoopContinues(result, labelSet) is false, return Completion(UpdateEmpty(result, V)).\n    if (!LoopContinues(realm, result, labelSet)) {\n      invariant(result instanceof AbruptCompletion);\n      // ECMA262 13.1.7\n      if (result instanceof BreakCompletion) {\n        if (!result.target) return (UpdateEmpty(realm, result, V): any).value;\n      } else if (result instanceof JoinedAbruptCompletions) {\n        let selector = c => c instanceof BreakCompletion && !c.target;\n        if (result.containsSelectedCompletion(selector)) {\n          result = Completion.normalizeSelectedCompletions(selector, result);\n        }\n      }\n      return realm.returnOrThrowCompletion(result);\n    }\n    if (result instanceof JoinedNormalAndAbruptCompletions) {\n      result = Completion.normalizeSelectedCompletions(c => c instanceof ContinueCompletion, result);\n    }\n    invariant(result instanceof Completion);\n    result = realm.composeWithSavedCompletion(result);\n\n    // d. If result.[[Value]] is not empty, let V be result.[[Value]].\n    let resultValue = InternalGetResultValue(realm, result);\n    if (!(resultValue instanceof EmptyValue)) V = resultValue;\n\n    // e. Perform ? CreatePerIterationEnvironment(perIterationBindings).\n    CreatePerIterationEnvironment(realm, perIterationBindings);\n    env = realm.getRunningContext().lexicalEnvironment;\n\n    // f. If increment is not [empty], then\n    if (increment) {\n      // i. Let incRef be the result of evaluating increment.\n      let incRef = env.evaluate(increment, strictCode);\n\n      // ii. Perform ? GetValue(incRef).\n      Environment.GetValue(realm, incRef);\n    } else if (realm.useAbstractInterpretation) {\n      // If we have no increment and we've hit 6 iterations of trying to evaluate\n      // this loop body, then see if we have a break, return or throw completion in a\n      // guarded condition and fail if it does. We already have logic to guard\n      // against loops that are actually infinite. However, because there may be so\n      // many forked execution paths, and they're non linear, then it might\n      // computationally lead to a something that seems like an infinite loop.\n      possibleInfiniteLoopIterations++;\n      if (possibleInfiniteLoopIterations > 6) {\n        failIfContainsBreakOrReturnOrThrowCompletion(realm.savedCompletion);\n      }\n    }\n  }\n  invariant(false);\n\n  function failIfContainsBreakOrReturnOrThrowCompletion(c: void | Completion | Value) {\n    if (c === undefined) return;\n    if (c instanceof ThrowCompletion || c instanceof BreakCompletion || c instanceof ReturnCompletion) {\n      let diagnostic = new CompilerDiagnostic(\n        \"break, throw or return cannot be guarded by abstract condition\",\n        c.location,\n        \"PP0035\",\n        \"FatalError\"\n      );\n      realm.handleError(diagnostic);\n      throw new FatalError();\n    }\n    if (c instanceof JoinedAbruptCompletions || c instanceof JoinedNormalAndAbruptCompletions) {\n      failIfContainsBreakOrReturnOrThrowCompletion(c.consequent);\n      failIfContainsBreakOrReturnOrThrowCompletion(c.alternate);\n    }\n  }\n}\n\nlet BailOutWrapperClosureRefVisitor = {\n  ReferencedIdentifier(path: BabelTraversePath, state: BailOutWrapperInfo) {\n    if (path.node.name === \"arguments\") {\n      state.usesArguments = true;\n    }\n  },\n  ThisExpression(path: BabelTraversePath, state: BailOutWrapperInfo) {\n    state.usesThis = true;\n  },\n  \"BreakStatement|ContinueStatement\"(path: BabelTraversePath, state: BailOutWrapperInfo) {\n    if (path.node.label !== null) {\n      state.usesGotoToLabel = true;\n    }\n  },\n  ReturnStatement(path: BabelTraversePath, state: BailOutWrapperInfo) {\n    state.usesReturn = true;\n  },\n  ThrowStatement(path: BabelTraversePath, state: BailOutWrapperInfo) {\n    state.usesThrow = true;\n  },\n  VariableDeclaration(path: BabelTraversePath, state: BailOutWrapperInfo) {\n    let node = path.node;\n\n    // `let` and `const` are lexically scoped. We only need to change `var`s into assignments. Since we hoist the loop\n    // into its own function `var`s (which are function scoped) need to be made available outside the loop.\n    if (node.kind !== \"var\") return;\n\n    if (t.isForOfStatement(path.parentPath.node) || t.isForInStatement(path.parentPath.node)) {\n      // For-of and for-in variable declarations behave a bit differently. There is only one declarator and there is\n      // never an initializer. Furthermore we can’t replace with an expression or statement, only a\n      // `LeftHandSideExpression`. However, that `LeftHandSideExpression` will perform a `DestructuringAssignment`\n      // operation which is what we want.\n\n      invariant(node.declarations.length === 1);\n      invariant(node.declarations[0].init == null);\n\n      const { id } = node.declarations[0];\n\n      if (!t.isIdentifier(id)) {\n        // We do not currently support ObjectPattern, SpreadPattern and ArrayPattern\n        // see: https://github.com/babel/babylon/blob/master/ast/spec.md#patterns\n        state.varPatternUnsupported = true;\n        return;\n      }\n\n      // Replace with the id directly since it is a `LeftHandSideExpression`.\n      path.replaceWith(id);\n    } else {\n      // Change all variable declarations into assignment statements. We assign to capture variables made available\n      // outside of this scope.\n\n      // If our parent is a `for (var x; x < y; x++)` loop we do not need a wrapper.\n      // i.e. for (var x of y) for (var x in y) for (var x; x < y; x++)\n      let needsExpressionWrapper = !t.isForStatement(path.parentPath.node);\n\n      const getConvertedDeclarator = index => {\n        let { id, init } = node.declarations[index];\n\n        if (t.isIdentifier(id)) {\n          // If init is undefined, then we need to ensure we provide\n          // an actual Babel undefined node for it.\n          if (init === null) {\n            init = t.identifier(\"undefined\");\n          }\n          return t.assignmentExpression(\"=\", id, init);\n        } else {\n          // We do not currently support ObjectPattern, SpreadPattern and ArrayPattern\n          // see: https://github.com/babel/babylon/blob/master/ast/spec.md#patterns\n          state.varPatternUnsupported = true;\n        }\n      };\n\n      if (node.declarations.length === 1) {\n        let convertedNodeOrUndefined = getConvertedDeclarator(0);\n        if (convertedNodeOrUndefined === undefined) {\n          // Do not continue as we don't support this\n          return;\n        }\n        path.replaceWith(\n          needsExpressionWrapper ? t.expressionStatement(convertedNodeOrUndefined) : convertedNodeOrUndefined\n        );\n      } else {\n        // convert to sequence, so: `var x = 1, y = 2;` becomes `x = 1, y = 2;`\n        let expressions = [];\n        for (let i = 0; i < node.declarations.length; i++) {\n          let convertedNodeOrUndefined = getConvertedDeclarator(i);\n          if (convertedNodeOrUndefined === undefined) {\n            // Do not continue as we don't support this\n            return;\n          }\n          expressions.push(convertedNodeOrUndefined);\n        }\n        let sequenceExpression = t.sequenceExpression(((expressions: any): Array<BabelNodeExpression>));\n        path.replaceWith(needsExpressionWrapper ? t.expressionStatement(sequenceExpression) : sequenceExpression);\n      }\n    }\n  },\n};\n\nfunction generateRuntimeForStatement(\n  ast: BabelNodeForStatement,\n  strictCode: boolean,\n  env: LexicalEnvironment,\n  realm: Realm,\n  labelSet: ?Array<string>\n): AbstractValue {\n  let wrapperFunction = new ECMAScriptSourceFunctionValue(realm);\n  let body = ((t.cloneDeep(t.blockStatement([ast])): any): BabelNodeBlockStatement);\n  wrapperFunction.initialize([], body);\n  wrapperFunction.$Environment = env;\n  // We need to scan to AST looking for \"this\", \"return\", \"throw\", labels and \"arguments\"\n  let functionInfo = {\n    usesArguments: false,\n    usesThis: false,\n    usesReturn: false,\n    usesGotoToLabel: false,\n    usesThrow: false,\n    varPatternUnsupported: false,\n  };\n\n  traverse(\n    t.file(t.program([t.expressionStatement(t.functionExpression(null, [], body))])),\n    BailOutWrapperClosureRefVisitor,\n    null,\n    functionInfo\n  );\n  traverse.cache.clear();\n  let { usesReturn, usesThrow, usesArguments, usesGotoToLabel, varPatternUnsupported, usesThis } = functionInfo;\n\n  if (usesReturn || usesThrow || usesArguments || usesGotoToLabel || varPatternUnsupported) {\n    // We do not have support for these yet\n    let diagnostic = new CompilerDiagnostic(\n      `failed to recover from a for/while loop bail-out due to unsupported logic in loop body`,\n      realm.currentLocation,\n      \"PP0037\",\n      \"FatalError\"\n    );\n    realm.handleError(diagnostic);\n    throw new FatalError();\n  }\n  let args = [wrapperFunction];\n\n  if (usesThis) {\n    let thisRef = env.evaluate(t.thisExpression(), strictCode);\n    let thisVal = Environment.GetValue(realm, thisRef);\n    Leak.value(realm, thisVal);\n    args.push(thisVal);\n  }\n\n  // We leak the wrapping function value, which in turn invokes the leak\n  // logic which is transitive. The leaking logic should recursively visit\n  // all bindings/objects in the loop and its body and mark the associated\n  // bindings/objects as leaked\n  Leak.value(realm, wrapperFunction);\n\n  let wrapperValue = AbstractValue.createTemporalFromBuildFunction(\n    realm,\n    Value,\n    args,\n    createOperationDescriptor(\"FOR_STATEMENT_FUNC\", { usesThis })\n  );\n  invariant(wrapperValue instanceof AbstractValue);\n  return wrapperValue;\n}\n\nfunction tryToEvaluateForStatementOrLeaveAsAbstract(\n  ast: BabelNodeForStatement,\n  strictCode: boolean,\n  env: LexicalEnvironment,\n  realm: Realm,\n  labelSet: ?Array<string>\n): Value {\n  invariant(!realm.instantRender.enabled);\n  let effects;\n  let savedSuppressDiagnostics = realm.suppressDiagnostics;\n  try {\n    realm.suppressDiagnostics = true;\n    effects = realm.evaluateForEffects(\n      () => evaluateForStatement(ast, strictCode, env, realm, labelSet),\n      undefined,\n      \"tryToEvaluateForStatementOrLeaveAsAbstract\"\n    );\n  } catch (error) {\n    if (error instanceof FatalError) {\n      realm.suppressDiagnostics = savedSuppressDiagnostics;\n      return realm.evaluateWithPossibleThrowCompletion(\n        () => generateRuntimeForStatement(ast, strictCode, env, realm, labelSet),\n        TypesDomain.topVal,\n        ValuesDomain.topVal\n      );\n    } else {\n      throw error;\n    }\n  } finally {\n    realm.suppressDiagnostics = savedSuppressDiagnostics;\n  }\n  realm.applyEffects(effects);\n  return realm.returnOrThrowCompletion(effects.result);\n}\n\n// ECMA262 13.7.4.7\nexport default function(\n  ast: BabelNodeForStatement,\n  strictCode: boolean,\n  env: LexicalEnvironment,\n  realm: Realm,\n  labelSet: ?Array<string>\n): Value {\n  if (realm.isInPureScope() && !realm.instantRender.enabled) {\n    return tryToEvaluateForStatementOrLeaveAsAbstract(ast, strictCode, env, realm, labelSet);\n  } else {\n    return evaluateForStatement(ast, strictCode, env, realm, labelSet);\n  }\n}\n\nfunction evaluateForStatement(\n  ast: BabelNodeForStatement,\n  strictCode: boolean,\n  env: LexicalEnvironment,\n  realm: Realm,\n  labelSet: ?Array<string>\n): Value {\n  let { init, test, update, body } = ast;\n\n  if (init && init.type === \"VariableDeclaration\") {\n    if (init.kind === \"var\") {\n      // for (var VariableDeclarationList; Expression; Expression) Statement\n      // 1. Let varDcl be the result of evaluating VariableDeclarationList.\n      let varDcl = env.evaluate(init, strictCode);\n\n      // 2. ReturnIfAbrupt(varDcl).\n      varDcl;\n\n      // 3. Return ? ForBodyEvaluation(the first Expression, the second Expression, Statement, « », labelSet).\n      return ForBodyEvaluation(realm, test, update, body, [], labelSet, strictCode);\n    } else {\n      // for (LexicalDeclaration Expression; Expression) Statement\n      // 1. Let oldEnv be the running execution context's LexicalEnvironment.\n      let oldEnv = env;\n\n      // 2. Let loopEnv be NewDeclarativeEnvironment(oldEnv).\n      let loopEnv = Environment.NewDeclarativeEnvironment(realm, oldEnv);\n\n      // 3. Let loopEnvRec be loopEnv's EnvironmentRecord.\n      let loopEnvRec = loopEnv.environmentRecord;\n\n      // 4. Let isConst be the result of performing IsConstantDeclaration of LexicalDeclaration.\n      let isConst = init.kind === \"const\";\n\n      // 5. Let boundNames be the BoundNames of LexicalDeclaration.\n      let boundNames = Environment.BoundNames(realm, init);\n\n      // 6. For each element dn of boundNames do\n      for (let dn of boundNames) {\n        // a. If isConst is true, then\n        if (isConst) {\n          // i. Perform ! loopEnvRec.CreateImmutableBinding(dn, true).\n          loopEnvRec.CreateImmutableBinding(dn, true);\n        } else {\n          // b. Else,\n          // i. Perform ! loopEnvRec.CreateMutableBinding(dn, false).\n          loopEnvRec.CreateMutableBinding(dn, false);\n        }\n      }\n\n      // 7. Set the running execution context's LexicalEnvironment to loopEnv.\n      realm.getRunningContext().lexicalEnvironment = loopEnv;\n\n      // 8. Let forDcl be the result of evaluating LexicalDeclaration.\n      let forDcl = loopEnv.evaluateCompletion(init, strictCode);\n\n      // 9. If forDcl is an abrupt completion, then\n      if (forDcl instanceof AbruptCompletion) {\n        // a. Set the running execution context's LexicalEnvironment to oldEnv.\n        let currentEnv = realm.getRunningContext().lexicalEnvironment;\n        realm.onDestroyScope(currentEnv);\n        if (currentEnv !== loopEnv) invariant(loopEnv.destroyed);\n        realm.getRunningContext().lexicalEnvironment = oldEnv;\n\n        // b. Return Completion(forDcl).\n        throw forDcl;\n      }\n\n      // 10. If isConst is false, let perIterationLets be boundNames; otherwise let perIterationLets be « ».\n      let perIterationLets = !isConst ? boundNames : [];\n\n      let bodyResult;\n      try {\n        // 11. Let bodyResult be ForBodyEvaluation(the first Expression, the second Expression, Statement, perIterationLets, labelSet).\n        bodyResult = ForBodyEvaluation(realm, test, update, body, perIterationLets, labelSet, strictCode);\n      } finally {\n        // 12. Set the running execution context's LexicalEnvironment to oldEnv.\n        let currentEnv = realm.getRunningContext().lexicalEnvironment;\n        realm.onDestroyScope(currentEnv);\n        if (currentEnv !== loopEnv) invariant(loopEnv.destroyed);\n        realm.getRunningContext().lexicalEnvironment = oldEnv;\n      }\n      // 13. Return Completion(bodyResult).\n      return bodyResult;\n    }\n  } else {\n    // for (Expression; Expression; Expression) Statement\n    // 1. If the first Expression is present, then\n    if (init) {\n      // a. Let exprRef be the result of evaluating the first Expression.\n      let exprRef = env.evaluate(init, strictCode);\n\n      // b. Perform ? GetValue(exprRef).\n      Environment.GetValue(realm, exprRef);\n    }\n\n    // 2. Return ? ForBodyEvaluation(the second Expression, the third Expression, Statement, « », labelSet).\n    return ForBodyEvaluation(realm, test, update, body, [], labelSet, strictCode);\n  }\n}\n"
  },
  {
    "path": "src/evaluators/FunctionDeclaration.js",
    "content": "/**\n * Copyright (c) 2017-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n/* @flow strict-local */\n\nimport type { Realm } from \"../realm.js\";\nimport type { LexicalEnvironment } from \"../environment.js\";\nimport type { Value } from \"../values/index.js\";\nimport { MakeConstructor } from \"../methods/construct.js\";\nimport { Create, Functions, Properties } from \"../singletons.js\";\nimport { StringValue } from \"../values/index.js\";\nimport IsStrict from \"../utils/strict.js\";\nimport { PropertyDescriptor } from \"../descriptors.js\";\nimport type { BabelNodeFunctionDeclaration } from \"@babel/types\";\n\n// ECMA262 14.1.20\nexport default function(\n  ast: BabelNodeFunctionDeclaration,\n  strictCode: boolean,\n  env: LexicalEnvironment,\n  realm: Realm\n): Value {\n  if (ast.generator) {\n    // 1. If the function code for GeneratorDeclaration is strict mode code, let strict be true. Otherwise let strict be false.\n    let strict = strictCode || IsStrict(ast.body);\n\n    // 2. Let name be StringValue of BindingIdentifier.\n    let name;\n    if (ast.id) {\n      name = new StringValue(realm, ast.id.name);\n    } else {\n      name = new StringValue(realm, \"default\");\n    }\n\n    // 3. Let F be GeneratorFunctionCreate(Normal, FormalParameters, GeneratorBody, scope, strict).\n    let F = Functions.GeneratorFunctionCreate(realm, \"normal\", ast.params, ast.body, env, strict);\n\n    // 4. Let prototype be ObjectCreate(%GeneratorPrototype%).\n    let prototype = Create.ObjectCreate(realm, realm.intrinsics.GeneratorPrototype);\n\n    // 5. Perform DefinePropertyOrThrow(F, \"prototype\", PropertyDescriptor{[[Value]]: prototype, [[Writable]]: true, [[Enumerable]]: false, [[Configurable]]: false}).\n    Properties.DefinePropertyOrThrow(\n      realm,\n      F,\n      \"prototype\",\n      new PropertyDescriptor({\n        value: prototype,\n        writable: true,\n        configurable: false,\n      })\n    );\n\n    // 6. Perform SetFunctionName(F, name).\n    Functions.SetFunctionName(realm, F, name);\n\n    // 7 .Return F.\n    return F;\n  } else {\n    // 1. If the function code for FunctionDeclaration is strict mode code, let strict be true. Otherwise let strict be false.\n    let strict = strictCode || IsStrict(ast.body);\n\n    // 2. Let name be StringValue of BindingIdentifier.\n    let name;\n    if (ast.id) {\n      name = new StringValue(realm, ast.id.name);\n    } else {\n      name = new StringValue(realm, \"default\");\n    }\n\n    // 3. Let F be FunctionCreate(Normal, FormalParameters, FunctionBody, scope, strict).\n    let F = Functions.FunctionCreate(realm, \"normal\", ast.params, ast.body, env, strict);\n    if (ast.id && ast.id.name) F.__originalName = ast.id.name;\n\n    // 4. Perform MakeConstructor(F).\n    MakeConstructor(realm, F);\n\n    // 5. Perform SetFunctionName(F, name).\n    Functions.SetFunctionName(realm, F, name);\n\n    // 6. Return F.\n    return F;\n  }\n}\n"
  },
  {
    "path": "src/evaluators/FunctionExpression.js",
    "content": "/**\n * Copyright (c) 2017-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n/* @flow strict-local */\n\nimport type { Realm } from \"../realm.js\";\nimport type { LexicalEnvironment } from \"../environment.js\";\nimport type { Value } from \"../values/index.js\";\nimport { MakeConstructor } from \"../methods/index.js\";\nimport { Create, Environment, Functions, Properties } from \"../singletons.js\";\nimport { StringValue } from \"../values/index.js\";\nimport IsStrict from \"../utils/strict.js\";\nimport type { BabelNodeFunctionExpression } from \"@babel/types\";\nimport invariant from \"../invariant.js\";\nimport { PropertyDescriptor } from \"../descriptors.js\";\n\nexport default function(\n  ast: BabelNodeFunctionExpression,\n  strictCode: boolean,\n  env: LexicalEnvironment,\n  realm: Realm\n): Value {\n  // ECMA262 14.1.21\n\n  if (ast.id) {\n    if (ast.generator === true) {\n      // 1. If the function code for this GeneratorExpression is strict mode code, let strict be true. Otherwise let strict be false.\n      let strict = strictCode || IsStrict(ast.body);\n\n      // 2. Let scope be the running execution context's LexicalEnvironment.\n      let scope = env;\n\n      // 3. Let funcEnv be NewDeclarativeEnvironment(scope).\n      let funcEnv = Environment.NewDeclarativeEnvironment(realm, scope);\n\n      // 4. Let envRec be funcEnv's EnvironmentRecord.\n      let envRec = funcEnv.environmentRecord;\n\n      // 5. Let name be StringValue of BindingIdentifier.\n      invariant(ast.id);\n      let name = ast.id.name;\n\n      // 6. Perform envRec.CreateImmutableBinding(name, false).\n      envRec.CreateImmutableBinding(name, false);\n\n      // 7. Let closure be GeneratorFunctionCreate(Normal, FormalParameters, GeneratorBody, funcEnv, strict).\n      let closure = Functions.GeneratorFunctionCreate(realm, \"normal\", ast.params, ast.body, funcEnv, strict);\n      closure.loc = ast.loc;\n\n      // 8. Let prototype be ObjectCreate(%GeneratorPrototype%).\n      let prototype = Create.ObjectCreate(realm, realm.intrinsics.GeneratorPrototype);\n      prototype.originalConstructor = closure;\n\n      // 9. Perform DefinePropertyOrThrow(closure, \"prototype\", PropertyDescriptor{[[Value]]: prototype, [[Writable]]: true, [[Enumerable]]: false, [[Configurable]]: false}).\n      Properties.DefinePropertyOrThrow(\n        realm,\n        closure,\n        \"prototype\",\n        new PropertyDescriptor({\n          value: prototype,\n          writable: true,\n          enumerable: false,\n          configurable: false,\n        })\n      );\n\n      // 10. Perform SetFunctionName(closure, name).\n      Functions.SetFunctionName(realm, closure, new StringValue(realm, name));\n\n      // 11. Perform envRec.InitializeBinding(name, closure).\n      envRec.InitializeBinding(name, closure);\n\n      // 12. Return closure.\n      return closure;\n    } else {\n      // 1. If the function code for FunctionExpression is strict mode code, let strict be true. Otherwise let strict be false.\n      let strict = strictCode || IsStrict(ast.body);\n\n      // 2. Let scope be the running execution context's LexicalEnvironment.\n      let scope = env;\n\n      // 3. Let funcEnv be NewDeclarativeEnvironment(scope).\n      let funcEnv = Environment.NewDeclarativeEnvironment(realm, scope, false);\n\n      // 4. Let envRec be funcEnv's EnvironmentRecord.\n      let envRec = funcEnv.environmentRecord;\n\n      // 5. Let name be StringValue of BindingIdentifier.\n      invariant(ast.id);\n      let name = ast.id.name;\n\n      // 6. Perform envRec.CreateImmutableBinding(name, false).\n      envRec.CreateImmutableBinding(name, false, false, true);\n      // I don't think this gets deleted anywhere else\n      //if (realm.modifiedBindings) realm.modifiedBindings.delete(name);\n\n      // 7. Let closure be FunctionCreate(Normal, FormalParameters, FunctionBody, funcEnv, strict).\n      let closure = Functions.FunctionCreate(realm, \"normal\", ast.params, ast.body, funcEnv, strict);\n      closure.loc = ast.loc;\n\n      // 8. Perform MakeConstructor(closure).\n      MakeConstructor(realm, closure);\n\n      // 9. Perform SetFunctionName(closure, name).\n      Functions.SetFunctionName(realm, closure, new StringValue(realm, name));\n\n      // 10. Perform envRec.InitializeBinding(name, closure).\n      envRec.InitializeBinding(name, closure, true);\n\n      // 11. Return closure.\n      return closure;\n    }\n  } else {\n    if (ast.generator === true) {\n      // 1. If the function code for this GeneratorExpression is strict mode code, let strict be true. Otherwise let strict be false.\n      let strict = strictCode || IsStrict(ast.body);\n\n      // 2. Let scope be the LexicalEnvironment of the running execution context.\n      let scope = env;\n\n      // 3. Let closure be GeneratorFunctionCreate(Normal, FormalParameters, GeneratorBody, scope, strict).\n      let closure = Functions.GeneratorFunctionCreate(realm, \"normal\", ast.params, ast.body, scope, strict);\n\n      // 4. Let prototype be ObjectCreate(%GeneratorPrototype%).\n      let prototype = Create.ObjectCreate(realm, realm.intrinsics.GeneratorPrototype);\n      prototype.originalConstructor = closure;\n\n      // 5. Perform DefinePropertyOrThrow(closure, \"prototype\", PropertyDescriptor{[[Value]]: prototype, [[Writable]]: true, [[Enumerable]]: false, [[Configurable]]: false}).\n      Properties.DefinePropertyOrThrow(\n        realm,\n        closure,\n        \"prototype\",\n        new PropertyDescriptor({\n          value: prototype,\n          writable: true,\n          enumerable: false,\n          configurable: false,\n        })\n      );\n\n      // 6. Return closure.\n      return closure;\n    } else {\n      // 1. If the function code for FunctionExpression is strict mode code, let strict be true. Otherwise let strict be false.\n      let strict = strictCode || IsStrict(ast.body);\n\n      // 2. Let scope be the LexicalEnvironment of the running execution context.\n      let scope = env;\n\n      // 3. Let closure be FunctionCreate(Normal, FormalParameters, FunctionBody, scope, strict).\n      let closure = Functions.FunctionCreate(realm, \"normal\", ast.params, ast.body, scope, strict);\n      closure.loc = ast.loc;\n\n      // 4. Perform MakeConstructor(closure).\n      MakeConstructor(realm, closure);\n\n      // 5. Return closure.\n      return closure;\n    }\n  }\n}\n"
  },
  {
    "path": "src/evaluators/Identifier.js",
    "content": "/**\n * Copyright (c) 2017-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n/* @flow strict-local */\n\nimport type { Realm } from \"../realm.js\";\nimport type { LexicalEnvironment } from \"../environment.js\";\nimport type { Reference } from \"../environment.js\";\nimport { Environment } from \"../singletons.js\";\nimport type { BabelNodeIdentifier } from \"@babel/types\";\n\n// ECMA262 12.1.6\nexport default function(\n  ast: BabelNodeIdentifier,\n  strictCode: boolean,\n  env: LexicalEnvironment,\n  realm: Realm\n): Reference {\n  // 1. Return ? ResolveBinding(StringValue of Identifier).\n  return Environment.ResolveBinding(realm, ast.name, strictCode, env);\n}\n"
  },
  {
    "path": "src/evaluators/IfStatement.js",
    "content": "/**\n * Copyright (c) 2017-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n/* @flow strict-local */\n\nimport { AbruptCompletion } from \"../completions.js\";\nimport type { Realm } from \"../realm.js\";\nimport { construct_empty_effects } from \"../realm.js\";\nimport type { LexicalEnvironment } from \"../environment.js\";\nimport { AbstractValue, ConcreteValue, Value } from \"../values/index.js\";\nimport { Reference } from \"../environment.js\";\nimport { UpdateEmpty } from \"../methods/index.js\";\nimport type { BabelNodeIfStatement } from \"@babel/types\";\nimport invariant from \"../invariant.js\";\nimport { Environment, To } from \"../singletons.js\";\n\nexport function evaluate(ast: BabelNodeIfStatement, strictCode: boolean, env: LexicalEnvironment, realm: Realm): Value {\n  // 1. Let exprRef be the result of evaluating Expression\n  let exprRef = env.evaluate(ast.test, strictCode);\n  // 2. Let exprValue be ToBoolean(? GetValue(exprRef))\n  let exprValue: Value = Environment.GetConditionValue(realm, exprRef);\n\n  if (exprValue instanceof ConcreteValue) {\n    let stmtCompletion;\n    if (To.ToBoolean(realm, exprValue)) {\n      // 3.a. Let stmtCompletion be the result of evaluating the first Statement\n      stmtCompletion = env.evaluateCompletion(ast.consequent, strictCode);\n    } else {\n      if (ast.alternate) {\n        // 4.a. Let stmtCompletion be the result of evaluating the second Statement\n        stmtCompletion = env.evaluateCompletion(ast.alternate, strictCode);\n      } else {\n        // 3 (of the if only statement). Return NormalCompletion(undefined)\n        stmtCompletion = realm.intrinsics.undefined;\n      }\n    }\n    // 5. Return Completion(UpdateEmpty(stmtCompletion, undefined)\n    //if (stmtCompletion instanceof Reference) return stmtCompletion;\n    invariant(!(stmtCompletion instanceof Reference));\n    stmtCompletion = UpdateEmpty(realm, stmtCompletion, realm.intrinsics.undefined);\n    if (stmtCompletion instanceof AbruptCompletion) {\n      throw stmtCompletion;\n    }\n    invariant(stmtCompletion instanceof Value);\n    return stmtCompletion;\n  }\n  invariant(exprValue instanceof AbstractValue);\n\n  if (!exprValue.mightNotBeTrue()) {\n    let stmtCompletion = env.evaluate(ast.consequent, strictCode);\n    invariant(!(stmtCompletion instanceof Reference));\n    stmtCompletion = UpdateEmpty(realm, stmtCompletion, realm.intrinsics.undefined);\n    if (stmtCompletion instanceof AbruptCompletion) {\n      throw stmtCompletion;\n    }\n    invariant(stmtCompletion instanceof Value);\n    return stmtCompletion;\n  } else if (!exprValue.mightNotBeFalse()) {\n    let stmtCompletion;\n    if (ast.alternate) stmtCompletion = env.evaluate(ast.alternate, strictCode);\n    else stmtCompletion = realm.intrinsics.undefined;\n    invariant(!(stmtCompletion instanceof Reference));\n    stmtCompletion = UpdateEmpty(realm, stmtCompletion, realm.intrinsics.undefined);\n    if (stmtCompletion instanceof AbruptCompletion) {\n      throw stmtCompletion;\n    }\n    invariant(stmtCompletion instanceof Value);\n    return stmtCompletion;\n  } else {\n    invariant(exprValue instanceof AbstractValue);\n    return realm.evaluateWithAbstractConditional(\n      exprValue,\n      () => realm.evaluateNodeForEffects(ast.consequent, strictCode, env),\n      () =>\n        ast.alternate ? realm.evaluateNodeForEffects(ast.alternate, strictCode, env) : construct_empty_effects(realm)\n    );\n  }\n}\n"
  },
  {
    "path": "src/evaluators/JSXElement.js",
    "content": "/**\n * Copyright (c) 2017-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n/* @flow */\n\nimport type { Realm } from \"../realm.js\";\nimport type { LexicalEnvironment } from \"../environment.js\";\nimport type {\n  BabelNode,\n  BabelNodeStringLiteral,\n  BabelNodeJSXText,\n  BabelNodeJSXElement,\n  BabelNodeJSXIdentifier,\n  BabelNodeJSXMemberExpression,\n  BabelNodeJSXAttribute,\n  BabelNodeJSXSpreadAttribute,\n  BabelNodeJSXExpressionContainer,\n} from \"@babel/types\";\nimport {\n  AbstractObjectValue,\n  ArrayValue,\n  StringValue,\n  Value,\n  NumberValue,\n  ObjectValue,\n  AbstractValue,\n} from \"../values/index.js\";\nimport { convertJSXExpressionToIdentifier } from \"../react/jsx.js\";\nimport { Get } from \"../methods/index.js\";\nimport { Create, Environment, Properties, To } from \"../singletons.js\";\nimport invariant from \"../invariant.js\";\nimport { createReactElement } from \"../react/elements.js\";\nimport {\n  applyObjectAssignConfigsForReactElement,\n  flagPropsWithNoPartialKeyOrRef,\n  hasNoPartialKeyOrRef,\n} from \"../react/utils.js\";\n\n// taken from Babel\nfunction cleanJSXElementLiteralChild(child: string): null | string {\n  let lines = child.split(/\\r\\n|\\n|\\r/);\n\n  let lastNonEmptyLine = 0;\n\n  for (let i = 0; i < lines.length; i++) {\n    if (lines[i].match(/[^ \\t]/)) {\n      lastNonEmptyLine = i;\n    }\n  }\n\n  let str = \"\";\n\n  for (let i = 0; i < lines.length; i++) {\n    let line = lines[i];\n\n    let isFirstLine = i === 0;\n    let isLastLine = i === lines.length - 1;\n    let isLastNonEmptyLine = i === lastNonEmptyLine;\n\n    // replace rendered whitespace tabs with spaces\n    let trimmedLine = line.replace(/\\t/g, \" \");\n\n    // trim whitespace touching a newline\n    if (!isFirstLine) {\n      trimmedLine = trimmedLine.replace(/^[ ]+/, \"\");\n    }\n\n    // trim whitespace touching an endline\n    if (!isLastLine) {\n      trimmedLine = trimmedLine.replace(/[ ]+$/, \"\");\n    }\n\n    if (trimmedLine) {\n      if (!isLastNonEmptyLine) {\n        trimmedLine += \" \";\n      }\n\n      str += trimmedLine;\n    }\n  }\n\n  if (str) {\n    return str;\n  }\n  return null;\n}\n\nfunction evaluateJSXMemberExpression(\n  ast: BabelNode,\n  strictCode: boolean,\n  env: LexicalEnvironment,\n  realm: Realm\n): Value {\n  switch (ast.type) {\n    case \"JSXIdentifier\":\n      return Environment.GetValue(\n        realm,\n        Environment.ResolveBinding(realm, ((ast: any): BabelNodeJSXIdentifier).name, strictCode, env)\n      );\n    case \"JSXMemberExpression\":\n      return Environment.GetValue(\n        realm,\n        env.evaluate(convertJSXExpressionToIdentifier(((ast: any): BabelNodeJSXMemberExpression)), strictCode)\n      );\n    default:\n      invariant(false, \"Unknown JSX Identifier\");\n  }\n}\n\nfunction evaluateJSXIdentifier(ast, strictCode, env, realm): Value {\n  if (isTagName(ast)) {\n    // special cased lower-case and custom elements\n    return new StringValue(realm, ((ast: any): BabelNodeJSXIdentifier).name);\n  }\n  return evaluateJSXMemberExpression(ast, strictCode, env, realm);\n}\n\nfunction evaluateJSXValue(value: BabelNode, strictCode: boolean, env: LexicalEnvironment, realm: Realm): Value {\n  if (value != null) {\n    switch (value.type) {\n      case \"JSXText\":\n        return new StringValue(realm, ((value: any): BabelNodeJSXText).value);\n      case \"StringLiteral\":\n        return new StringValue(realm, ((value: any): BabelNodeStringLiteral).value);\n      case \"JSXExpressionContainer\":\n        return Environment.GetValue(\n          realm,\n          env.evaluate(((value: any): BabelNodeJSXExpressionContainer).expression, strictCode)\n        );\n      case \"JSXElement\":\n        return Environment.GetValue(realm, env.evaluate(value, strictCode));\n      default:\n        invariant(false, `Unknown JSX value type: ${value.type}`);\n    }\n  }\n  invariant(false, `Null or undefined value passed when trying to evaluate JSX node value`);\n}\n\nfunction isTagName(ast: BabelNode): boolean {\n  return ast.type === \"JSXIdentifier\" && /^[a-z]|\\-/.test(((ast: any): BabelNodeJSXIdentifier).name);\n}\n\nfunction evaluateJSXChildren(\n  children: Array<BabelNode>,\n  strictCode: boolean,\n  env: LexicalEnvironment,\n  realm: Realm\n): ArrayValue | Value | void {\n  if (children.length === 0) {\n    return undefined;\n  }\n  if (children.length === 1) {\n    let singleChild = evaluateJSXValue(children[0], strictCode, env, realm);\n\n    if (singleChild instanceof StringValue) {\n      let text = cleanJSXElementLiteralChild(singleChild.value);\n      if (text !== null) {\n        singleChild.value = text;\n      }\n    }\n    return singleChild;\n  }\n  let array = Create.ArrayCreate(realm, 0);\n  let dynamicChildrenLength = children.length;\n  let dynamicIterator = 0;\n  let lastChildValue = realm.intrinsics.undefined;\n  for (let i = 0; i < children.length; i++) {\n    let value = evaluateJSXValue(children[i], strictCode, env, realm);\n    if (value instanceof StringValue) {\n      let text = cleanJSXElementLiteralChild(value.value);\n      if (text === null) {\n        dynamicChildrenLength--;\n        // this is a space full of whitespace, so let's proceed\n        continue;\n      } else {\n        value.value = text;\n      }\n    }\n    lastChildValue = value;\n    Create.CreateDataPropertyOrThrow(realm, array, \"\" + dynamicIterator, value);\n    dynamicIterator++;\n  }\n  if (dynamicChildrenLength === 1) {\n    return lastChildValue;\n  }\n\n  Properties.Set(realm, array, \"length\", new NumberValue(realm, dynamicChildrenLength), false);\n  array.makeFinal();\n  return array;\n}\n\nfunction isObjectEmpty(realm: Realm, object: ObjectValue) {\n  let propertyCount = 0;\n  for (let [, binding] of object.properties) {\n    if (binding && binding.descriptor && binding.descriptor.throwIfNotConcrete(realm).enumerable) {\n      propertyCount++;\n    }\n  }\n  return propertyCount === 0;\n}\n\nfunction evaluateJSXAttributes(\n  astAttributes: Array<BabelNodeJSXAttribute | BabelNodeJSXSpreadAttribute>,\n  strictCode: boolean,\n  env: LexicalEnvironment,\n  realm: Realm\n): ObjectValue | AbstractObjectValue {\n  let config = Create.ObjectCreate(realm, realm.intrinsics.ObjectPrototype);\n  let abstractPropsArgs = [];\n  let abstractSpreadCount = 0;\n  let safeAbstractSpreadCount = 0;\n  let spreadValue;\n\n  const setConfigProperty = (name: string, value: Value): void => {\n    invariant(config instanceof ObjectValue);\n    Properties.Set(realm, config, name, value, true);\n  };\n\n  for (let astAttribute of astAttributes) {\n    switch (astAttribute.type) {\n      case \"JSXAttribute\":\n        let { name, value } = astAttribute;\n\n        invariant(name.type === \"JSXIdentifier\", `JSX attribute name type not supported: ${astAttribute.type}`);\n        setConfigProperty(name.name, evaluateJSXValue(((value: any): BabelNodeJSXIdentifier), strictCode, env, realm));\n        break;\n      case \"JSXSpreadAttribute\":\n        spreadValue = Environment.GetValue(realm, env.evaluate(astAttribute.argument, strictCode));\n\n        if (spreadValue instanceof ObjectValue && !spreadValue.isPartialObject()) {\n          for (let [spreadPropKey, binding] of spreadValue.properties) {\n            if (binding && binding.descriptor && binding.descriptor.throwIfNotConcrete(realm).enumerable) {\n              setConfigProperty(spreadPropKey, Get(realm, spreadValue, spreadPropKey));\n            }\n          }\n        } else {\n          abstractSpreadCount++;\n          if (spreadValue instanceof AbstractValue && !(spreadValue instanceof AbstractObjectValue)) {\n            spreadValue = To.ToObject(realm, spreadValue);\n          }\n          invariant(spreadValue instanceof AbstractObjectValue || spreadValue instanceof ObjectValue);\n\n          if (hasNoPartialKeyOrRef(realm, spreadValue)) {\n            safeAbstractSpreadCount++;\n          }\n          if (!isObjectEmpty(realm, config)) {\n            abstractPropsArgs.push(config);\n          }\n          abstractPropsArgs.push(spreadValue);\n          config = Create.ObjectCreate(realm, realm.intrinsics.ObjectPrototype);\n        }\n        break;\n      default:\n        invariant(false, `Unknown JSX attribute type: ${astAttribute.type}`);\n    }\n  }\n\n  if (abstractSpreadCount > 0) {\n    // if we only have a single spread config, then use that,\n    // i.e. <div {...something} />  -->  React.createElement(\"div\", something)\n    if (\n      abstractSpreadCount === 1 &&\n      astAttributes.length === 1 &&\n      (spreadValue instanceof ObjectValue || spreadValue instanceof AbstractObjectValue)\n    ) {\n      return spreadValue;\n    }\n    // we create an abstract Object.assign() to deal with the fact that we don't what\n    // the props are because they contain abstract spread attributes that we can't\n    // evaluate ahead of time\n    // push the current config\n    abstractPropsArgs.push(config);\n\n    // create a new config object that will be the target of the Object.assign\n    config = Create.ObjectCreate(realm, realm.intrinsics.ObjectPrototype);\n\n    applyObjectAssignConfigsForReactElement(realm, config, abstractPropsArgs);\n    if (safeAbstractSpreadCount === abstractSpreadCount) {\n      flagPropsWithNoPartialKeyOrRef(realm, config);\n    }\n  }\n  invariant(config instanceof ObjectValue || config instanceof AbstractObjectValue);\n  return config;\n}\n\nexport default function(ast: BabelNodeJSXElement, strictCode: boolean, env: LexicalEnvironment, realm: Realm): Value {\n  invariant(realm.react.enabled, \"JSXElements can only be evaluated with the reactEnabled option\");\n  let openingElement = ast.openingElement;\n  let type = evaluateJSXIdentifier(openingElement.name, strictCode, env, realm);\n  let children = evaluateJSXChildren(ast.children, strictCode, env, realm);\n  let config = evaluateJSXAttributes(openingElement.attributes, strictCode, env, realm);\n  invariant(type instanceof Value);\n  return createReactElement(realm, type, config, children);\n}\n"
  },
  {
    "path": "src/evaluators/LabeledStatement.js",
    "content": "/**\n * Copyright (c) 2017-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n/* @flow */\n\nimport type { Realm } from \"../realm.js\";\nimport type { LexicalEnvironment } from \"../environment.js\";\nimport { Value } from \"../values/index.js\";\nimport type { Reference } from \"../environment.js\";\nimport {\n  BreakCompletion,\n  Completion,\n  JoinedAbruptCompletions,\n  JoinedNormalAndAbruptCompletions,\n} from \"../completions.js\";\nimport type { BabelNode, BabelNodeLabeledStatement, BabelNodeVariableDeclaration } from \"@babel/types\";\nimport invariant from \"../invariant.js\";\n\n// ECMA262 13.13.14\nfunction LabelledEvaluation(\n  labelSet: Array<string>,\n  ast: BabelNode,\n  strictCode: boolean,\n  env: LexicalEnvironment,\n  realm: Realm\n): Value {\n  // LabelledStatement:LabelIdentifier:LabelledItem\n  switch (ast.type) {\n    case \"LabeledStatement\":\n      let labeledAst = ((ast: any): BabelNodeLabeledStatement);\n      // 1. Let label be the StringValue of LabelIdentifier.\n      let label = labeledAst.label.name;\n\n      // 2. Append label as an element of labelSet.\n      labelSet.push(label);\n\n      // 3. Let stmtResult be LabelledEvaluation of LabelledItem with argument labelSet.\n      let normalCompletionStmtResult;\n      try {\n        normalCompletionStmtResult = LabelledEvaluation(labelSet, labeledAst.body, strictCode, env, realm);\n      } catch (stmtResult) {\n        // 4. If stmtResult.[[Type]] is break and SameValue(stmtResult.[[Target]], label) is true, then\n        if (stmtResult instanceof BreakCompletion && stmtResult.target === label) {\n          // a. Let stmtResult be NormalCompletion(stmtResult.[[Value]]).\n          normalCompletionStmtResult = stmtResult.value;\n        } else if (\n          stmtResult instanceof JoinedAbruptCompletions ||\n          stmtResult instanceof JoinedNormalAndAbruptCompletions\n        ) {\n          let nc = Completion.normalizeSelectedCompletions(\n            c => c instanceof BreakCompletion && c.target === label,\n            stmtResult\n          );\n          return realm.returnOrThrowCompletion(nc);\n        } else {\n          // 5. Return Completion(stmtResult).\n          throw stmtResult;\n        }\n      }\n      // 5. Return Completion(stmtResult).\n      return normalCompletionStmtResult;\n\n    case \"VariableDeclaration\":\n      if (((ast: any): BabelNodeVariableDeclaration).kind === \"var\") {\n        let r = env.evaluate(ast, strictCode);\n        invariant(r instanceof Value);\n        return r;\n      }\n    // fall through to throw\n    case \"FunctionDeclaration\":\n    case \"ClassDeclaration\":\n      throw realm.createErrorThrowCompletion(realm.intrinsics.SyntaxError, ast.type + \" may not have a label\");\n\n    default:\n      let r = env.evaluate(ast, strictCode, labelSet);\n      invariant(r instanceof Value);\n      return r;\n  }\n}\n\n// ECMA262 13.13.15\nexport default function(\n  ast: BabelNodeLabeledStatement,\n  strictCode: boolean,\n  env: LexicalEnvironment,\n  realm: Realm\n): Value | Reference {\n  //1. Let newLabelSet be a new empty List.\n  let newLabelSet = [];\n\n  //2. Return LabelledEvaluation of this LabelledStatement with argument newLabelSet.\n  return LabelledEvaluation(newLabelSet, ast, strictCode, env, realm);\n}\n"
  },
  {
    "path": "src/evaluators/LogicalExpression.js",
    "content": "/**\n * Copyright (c) 2017-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n/* @flow strict-local */\n\nimport type { Realm } from \"../realm.js\";\nimport { Effects } from \"../realm.js\";\nimport { SimpleNormalCompletion } from \"../completions.js\";\nimport { InfeasiblePathError } from \"../errors.js\";\nimport { construct_empty_effects } from \"../realm.js\";\nimport type { LexicalEnvironment } from \"../environment.js\";\nimport { AbstractValue, ConcreteValue, Value } from \"../values/index.js\";\nimport { Reference } from \"../environment.js\";\nimport { Environment } from \"../singletons.js\";\nimport type { BabelNodeLogicalExpression } from \"@babel/types\";\nimport invariant from \"../invariant.js\";\nimport { Join, Path, To } from \"../singletons.js\";\n\nexport default function(\n  ast: BabelNodeLogicalExpression,\n  strictCode: boolean,\n  env: LexicalEnvironment,\n  realm: Realm\n): Value | Reference {\n  let lref = env.evaluate(ast.left, strictCode);\n  let lval = Environment.GetValue(realm, lref);\n\n  if (lval instanceof ConcreteValue) {\n    let lbool = To.ToBoolean(realm, lval);\n\n    if (ast.operator === \"&&\") {\n      // ECMA262 12.13.3\n      if (lbool === false) return lval;\n    } else {\n      invariant(ast.operator === \"||\");\n      // ECMA262 12.13.3\n      if (lbool === true) return lval;\n    }\n\n    let rref = env.evaluate(ast.right, strictCode);\n    return Environment.GetValue(realm, rref);\n  }\n  invariant(lval instanceof AbstractValue);\n  let lcond = Environment.GetConditionValue(realm, lref);\n\n  if (!lcond.mightNotBeFalse()) return ast.operator === \"||\" ? env.evaluate(ast.right, strictCode) : lval;\n  if (!lcond.mightNotBeTrue()) return ast.operator === \"&&\" ? env.evaluate(ast.right, strictCode) : lval;\n  invariant(lcond instanceof AbstractValue);\n\n  // Create empty effects for the case where ast.right is not evaluated\n  let {\n    result: result1,\n    generator: generator1,\n    modifiedBindings: modifiedBindings1,\n    modifiedProperties: modifiedProperties1,\n    createdObjects: createdObjects1,\n    createdAbstracts: createdAbstracts1,\n  } = construct_empty_effects(realm);\n  result1; // ignore\n\n  // Evaluate ast.right in a sandbox to get its effects\n  let result2, generator2, modifiedBindings2, modifiedProperties2, createdObjects2, createdAbstracts2;\n  try {\n    let wrapper = ast.operator === \"&&\" ? Path.withCondition : Path.withInverseCondition;\n    ({\n      result: result2,\n      generator: generator2,\n      modifiedBindings: modifiedBindings2,\n      modifiedProperties: modifiedProperties2,\n      createdObjects: createdObjects2,\n      createdAbstracts: createdAbstracts2,\n    } = wrapper(lcond, () => realm.evaluateNodeForEffects(ast.right, strictCode, env)));\n  } catch (e) {\n    if (e instanceof InfeasiblePathError) {\n      // if && then lcond cannot be true on this path else lcond cannot be false on this path.\n      // Either way, we need to return just lval and not evaluate ast.right\n      return lval;\n    }\n    throw e;\n  }\n\n  // Join the effects, creating an abstract view of what happened, regardless\n  // of the actual value of lval.\n  // Note that converting a value to boolean never has a side effect, so we can\n  // use lval as is for the join condition.\n  let joinedEffects;\n  if (ast.operator === \"&&\") {\n    joinedEffects = Join.joinEffects(\n      lcond,\n      new Effects(result2, generator2, modifiedBindings2, modifiedProperties2, createdObjects2, createdAbstracts2),\n      new Effects(\n        new SimpleNormalCompletion(lval),\n        generator1,\n        modifiedBindings1,\n        modifiedProperties1,\n        createdObjects1,\n        createdAbstracts1\n      )\n    );\n  } else {\n    joinedEffects = Join.joinEffects(\n      lcond,\n      new Effects(\n        new SimpleNormalCompletion(lval),\n        generator1,\n        modifiedBindings1,\n        modifiedProperties1,\n        createdObjects1,\n        createdAbstracts1\n      ),\n      new Effects(result2, generator2, modifiedBindings2, modifiedProperties2, createdObjects2, createdAbstracts2)\n    );\n  }\n\n  realm.applyEffects(joinedEffects);\n  let completion = realm.returnOrThrowCompletion(joinedEffects.result);\n  if (lval instanceof Value && result2.value instanceof Value) {\n    // joinEffects does the right thing for the side effects of the second expression but for the result the join\n    // produces a conditional expressions of the form (a ? b : a) for a && b and (a ? a : b) for a || b\n    // Rather than look for this pattern everywhere, we override this behavior and replace the completion with\n    // the actual logical operator. This helps with simplification and reasoning when dealing with path conditions.\n    completion = AbstractValue.createFromLogicalOp(realm, ast.operator, lval, result2.value, ast.loc);\n  }\n  return completion;\n}\n"
  },
  {
    "path": "src/evaluators/MemberExpression.js",
    "content": "/**\n * Copyright (c) 2017-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n/* @flow strict-local */\n\nimport type { Realm } from \"../realm.js\";\nimport type { LexicalEnvironment } from \"../environment.js\";\nimport { Reference } from \"../environment.js\";\nimport { StringValue } from \"../values/index.js\";\nimport { RequireObjectCoercible } from \"../methods/index.js\";\nimport { Environment, To } from \"../singletons.js\";\nimport type { BabelNodeMemberExpression } from \"@babel/types\";\nimport SuperProperty from \"./SuperProperty\";\n\n// ECMA262 12.3.2.1\nexport default function(\n  ast: BabelNodeMemberExpression,\n  strictCode: boolean,\n  env: LexicalEnvironment,\n  realm: Realm\n): Reference {\n  if (ast.object.type === \"Super\") {\n    return SuperProperty(ast, strictCode, env, realm);\n  }\n\n  // 1. Let baseReference be the result of evaluating MemberExpression.\n  let baseReference = env.evaluate(ast.object, strictCode);\n\n  // 2. Let baseValue be ? GetValue(baseReference).\n  let baseValue = Environment.GetValue(realm, baseReference);\n\n  let propertyNameValue;\n  if (ast.computed === true) {\n    // 3. Let propertyNameReference be the result of evaluating Expression.\n    let propertyNameReference = env.evaluate(ast.property, strictCode);\n\n    // 4. Let propertyNameValue be ? GetValue(propertyNameReference).\n    propertyNameValue = Environment.GetValue(realm, propertyNameReference);\n  } else {\n    // 3. Let propertyNameString be StringValue of IdentifierName.\n    propertyNameValue = new StringValue(realm, ast.property.name);\n  }\n\n  // 5. Let bv be ? RequireObjectCoercible(baseValue).\n  let bv = RequireObjectCoercible(realm, baseValue, ast.object.loc);\n\n  // 6. Let propertyKey be ? ToPropertyKey(propertyNameValue).\n  let propertyKey = To.ToPropertyKeyPartial(realm, propertyNameValue);\n\n  // 7. If the code matched by the syntactic production that is being evaluated is strict mode code, let strict be true, else let strict be false.\n  let strict = strictCode;\n\n  // 8. Return a value of type Reference whose base value is bv, whose referenced name is propertyKey, and whose strict reference flag is strict.\n  return new Reference(bv, propertyKey, strict);\n}\n"
  },
  {
    "path": "src/evaluators/MetaProperty.js",
    "content": "/**\n * Copyright (c) 2017-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n/* @flow strict-local */\n\nimport type { Realm } from \"../realm.js\";\nimport type { LexicalEnvironment } from \"../environment.js\";\nimport type { Value } from \"../values/index.js\";\nimport { GetNewTarget } from \"../methods/get.js\";\nimport type { BabelNodeMetaProperty } from \"@babel/types\";\n\n// ECMA 12.3.8.1\nexport default function(ast: BabelNodeMetaProperty, strictCode: boolean, env: LexicalEnvironment, realm: Realm): Value {\n  return GetNewTarget(realm);\n}\n"
  },
  {
    "path": "src/evaluators/NewExpression.js",
    "content": "/**\n * Copyright (c) 2017-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n/* @flow */\n\nimport type { Realm } from \"../realm.js\";\nimport type { LexicalEnvironment } from \"../environment.js\";\nimport { TypesDomain, ValuesDomain } from \"../domains/index.js\";\nimport { ObjectValue, Value, AbstractObjectValue, AbstractValue } from \"../values/index.js\";\nimport { Environment, Leak } from \"../singletons.js\";\nimport { IsConstructor, ArgumentListEvaluation } from \"../methods/index.js\";\nimport { Construct } from \"../methods/index.js\";\nimport invariant from \"../invariant.js\";\nimport { FatalError } from \"../errors.js\";\nimport { BabelNodeNewExpression } from \"@babel/types\";\nimport { createOperationDescriptor } from \"../utils/generator.js\";\n\nexport default function(\n  ast: BabelNodeNewExpression,\n  strictCode: boolean,\n  env: LexicalEnvironment,\n  realm: Realm\n): ObjectValue | AbstractObjectValue {\n  // ECMA262 12.3.3.1 We just implement this method inline since it's only called here.\n  // 1. Return ? EvaluateNew(NewExpression, empty).\n\n  // ECMA262 2.3.3.1.1\n\n  let constructProduction = ast.callee;\n  let args = ast.arguments;\n\n  // These steps not necessary due to our AST representation.\n  // 1. Assert: constructProduction is either a NewExpression or a MemberExpression.\n  // 2. Assert: arguments is either empty or an Arguments production.\n\n  // 3. Let ref be the result of evaluating constructProduction.\n  let ref = env.evaluate(constructProduction, strictCode);\n\n  // 4. Let constructor be ? GetValue(ref).\n  let constructor = Environment.GetValue(realm, ref);\n\n  let argsList;\n\n  // 5. If arguments is empty, let argList be a new empty List.\n  if (!args.length) {\n    argsList = [];\n  } else {\n    // 6. Else,\n    // a. Let argList be ArgumentListEvaluation of arguments.\n    argsList = ArgumentListEvaluation(realm, strictCode, env, (args: any)); // BabelNodeNewExpression needs updating\n\n    // This step not necessary since we propagate completions with exceptions.\n    // b. ReturnIfAbrupt(argList).\n  }\n\n  let previousLoc = realm.setNextExecutionContextLocation(ast.loc);\n  try {\n    // If we are in pure scope, attempt to recover from creating the construct if\n    // it fails by creating a temporal abstract\n    if (realm.isInPureScope()) {\n      return tryToEvaluateConstructOrLeaveAsAbstract(constructor, argsList, strictCode, realm);\n    } else {\n      return createConstruct(constructor, argsList, realm);\n    }\n  } finally {\n    realm.setNextExecutionContextLocation(previousLoc);\n  }\n}\n\nfunction tryToEvaluateConstructOrLeaveAsAbstract(\n  constructor: Value,\n  argsList: Array<Value>,\n  strictCode: boolean,\n  realm: Realm\n): ObjectValue | AbstractObjectValue {\n  let effects;\n  try {\n    effects = realm.evaluateForEffects(\n      () => createConstruct(constructor, argsList, realm),\n      undefined,\n      \"tryToEvaluateConstructOrLeaveAsAbstract\"\n    );\n  } catch (error) {\n    // if a FatalError occurs when constructing the constructor\n    // then try and recover and create an abstract for this construct\n    if (error instanceof FatalError) {\n      // we need to leak all the arguments and the constructor\n      Leak.value(realm, constructor);\n      for (let arg of argsList) {\n        Leak.value(realm, arg);\n      }\n      let abstractValue = realm.evaluateWithPossibleThrowCompletion(\n        () =>\n          AbstractValue.createTemporalFromBuildFunction(\n            realm,\n            ObjectValue,\n            [constructor, ...argsList],\n            createOperationDescriptor(\"NEW_EXPRESSION\")\n          ),\n        TypesDomain.topVal,\n        ValuesDomain.topVal\n      );\n      invariant(abstractValue instanceof AbstractObjectValue);\n      return abstractValue;\n    } else {\n      throw error;\n    }\n  }\n  realm.applyEffects(effects);\n  let completion = realm.returnOrThrowCompletion(effects.result);\n  invariant(completion instanceof ObjectValue || completion instanceof AbstractObjectValue);\n  return completion;\n}\n\nfunction createConstruct(constructor: Value, argsList: Array<Value>, realm: Realm): ObjectValue | AbstractObjectValue {\n  // 7. If IsConstructor(constructor) is false, throw a TypeError exception.\n  if (IsConstructor(realm, constructor) === false) {\n    throw realm.createErrorThrowCompletion(realm.intrinsics.TypeError);\n  }\n  invariant(constructor instanceof ObjectValue);\n\n  // 8. Return ? Construct(constructor, argList).\n  return Construct(realm, constructor, argsList);\n}\n"
  },
  {
    "path": "src/evaluators/NullLiteral.js",
    "content": "/**\n * Copyright (c) 2017-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n/* @flow strict-local */\n\nimport type { Realm } from \"../realm.js\";\nimport type { LexicalEnvironment } from \"../environment.js\";\nimport type { Value } from \"../values/index.js\";\nimport type { BabelNodeNullLiteral } from \"@babel/types\";\n\nexport default function(ast: BabelNodeNullLiteral, strictCode: boolean, env: LexicalEnvironment, realm: Realm): Value {\n  return realm.intrinsics.null;\n}\n"
  },
  {
    "path": "src/evaluators/NumericLiteral.js",
    "content": "/**\n * Copyright (c) 2017-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n/* @flow strict-local */\n\nimport type { Realm } from \"../realm.js\";\nimport type { LexicalEnvironment } from \"../environment.js\";\nimport type { Value } from \"../values/index.js\";\nimport { IntegralValue } from \"../values/index.js\";\nimport type { BabelNodeNumericLiteral } from \"@babel/types\";\n\nexport default function(\n  ast: BabelNodeNumericLiteral,\n  strictCode: boolean,\n  env: LexicalEnvironment,\n  realm: Realm\n): Value {\n  return IntegralValue.createFromNumberValue(realm, ast.value);\n}\n"
  },
  {
    "path": "src/evaluators/ObjectExpression.js",
    "content": "/**\n * Copyright (c) 2017-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n/* @flow */\n\nimport type { Realm } from \"../realm.js\";\nimport type { LexicalEnvironment } from \"../environment.js\";\nimport type { PropertyKeyValue } from \"../types.js\";\nimport { CompilerDiagnostic, FatalError } from \"../errors.js\";\nimport { AbstractValue, ConcreteValue, ObjectValue, StringValue } from \"../values/index.js\";\nimport { IsAnonymousFunctionDefinition, HasOwnProperty } from \"../methods/index.js\";\nimport { Create, Environment, Functions, Properties, To } from \"../singletons.js\";\nimport invariant from \"../invariant.js\";\nimport type {\n  BabelNodeObjectExpression,\n  BabelNodeObjectProperty,\n  BabelNodeObjectMethod,\n  BabelNodeClassMethod,\n} from \"@babel/types\";\n\n// Returns the result of evaluating PropertyName.\nexport function EvalPropertyName(\n  prop: BabelNodeObjectProperty | BabelNodeObjectMethod | BabelNodeClassMethod,\n  env: LexicalEnvironment,\n  realm: Realm,\n  strictCode: boolean\n): PropertyKeyValue {\n  let result = EvalPropertyNamePartial(prop, env, realm, strictCode);\n  if (result instanceof AbstractValue) {\n    let error = new CompilerDiagnostic(\"unknown computed property name\", prop.loc, \"PP0014\", \"FatalError\");\n    realm.handleError(error);\n    throw new FatalError();\n  }\n  return (result: any);\n}\n\nfunction EvalPropertyNamePartial(\n  prop: BabelNodeObjectProperty | BabelNodeObjectMethod | BabelNodeClassMethod,\n  env: LexicalEnvironment,\n  realm: Realm,\n  strictCode: boolean\n): AbstractValue | PropertyKeyValue {\n  if (prop.computed) {\n    let propertyKeyName = Environment.GetValue(realm, env.evaluate(prop.key, strictCode));\n    if (propertyKeyName instanceof AbstractValue) return propertyKeyName;\n    invariant(propertyKeyName instanceof ConcreteValue);\n    return To.ToPropertyKey(realm, propertyKeyName);\n  } else {\n    if (prop.key.type === \"Identifier\") {\n      return new StringValue(realm, prop.key.name);\n    } else {\n      let propertyKeyName = Environment.GetValue(realm, env.evaluate(prop.key, strictCode));\n      invariant(propertyKeyName instanceof ConcreteValue); // syntax only allows literals if !prop.computed\n      return To.ToString(realm, propertyKeyName);\n    }\n  }\n}\n\n// ECMA262 12.2.6.8\nexport default function(\n  ast: BabelNodeObjectExpression,\n  strictCode: boolean,\n  env: LexicalEnvironment,\n  realm: Realm\n): ObjectValue {\n  // 1. Let obj be ObjectCreate(%ObjectPrototype%).\n  let obj = Create.ObjectCreate(realm, realm.intrinsics.ObjectPrototype);\n\n  // 2. Let status be the result of performing PropertyDefinitionEvaluation of PropertyDefinitionList with arguments obj and true.\n  for (let prop of ast.properties) {\n    if (prop.type === \"ObjectProperty\") {\n      // 12.2.6.9 case 3\n      // 1. Let propKey be the result of evaluating PropertyName.\n      let propKey = EvalPropertyNamePartial(prop, env, realm, strictCode);\n\n      // 2. ReturnIfAbrupt(propKey).\n\n      // 3. Let exprValueRef be the result of evaluating AssignmentExpression.\n      let exprValueRef = env.evaluate(prop.value, strictCode);\n\n      // 4. Let propValue be ? GetValue(exprValueRef).\n      let propValue = Environment.GetValue(realm, exprValueRef);\n\n      // 5. If IsAnonymousFunctionDefinition(AssignmentExpression) is true, then\n      if (IsAnonymousFunctionDefinition(realm, prop.value)) {\n        invariant(propValue instanceof ObjectValue);\n\n        // a. Let hasNameProperty be ? HasOwnProperty(propValue, \"name\").\n        let hasNameProperty = HasOwnProperty(realm, propValue, \"name\");\n\n        // b. If hasNameProperty is false, perform SetFunctionName(propValue, propKey).\n        invariant(!hasNameProperty); // No expression that passes through IsAnonymousFunctionDefinition can have it here\n        Functions.SetFunctionName(realm, propValue, propKey);\n      }\n\n      // 6. Assert: enumerable is true.\n\n      // 7. Return CreateDataPropertyOrThrow(object, propKey, propValue).\n      if (propKey instanceof AbstractValue) {\n        if (propKey.mightNotBeString()) {\n          let error = new CompilerDiagnostic(\"property key value is unknown\", prop.loc, \"PP0011\", \"FatalError\");\n          if (realm.handleError(error) === \"Fail\") throw new FatalError();\n          continue; // recover by ignoring the property, which is only ever safe to do if the property is dead,\n          // which is assuming a bit much, hence the designation as a FatalError.\n        }\n        obj.$SetPartial(propKey, propValue, obj);\n      } else {\n        Create.CreateDataPropertyOrThrow(realm, obj, propKey, propValue);\n      }\n    } else if (prop.type === \"SpreadElement\") {\n      // 1. Let exprValue be the result of evaluating AssignmentExpression.\n      let exprValue = env.evaluate(prop.argument, strictCode);\n\n      // 2. Let fromValue be GetValue(exprValue).\n      let fromValue = Environment.GetValue(realm, exprValue);\n\n      // 3. ReturnIfAbrupt(fromValue).\n\n      // 4. Let excludedNames be a new empty List.\n      let excludedNames = [];\n\n      // 4. Return ? CopyDataProperties(object, fromValue, excludedNames).\n      Create.CopyDataProperties(realm, obj, fromValue, excludedNames);\n    } else {\n      invariant(prop.type === \"ObjectMethod\");\n      Properties.PropertyDefinitionEvaluation(realm, prop, obj, (env: any), strictCode, true);\n    }\n  }\n\n  // 3. ReturnIfAbrupt(status).\n\n  // 4. Return obj.\n  return obj;\n}\n"
  },
  {
    "path": "src/evaluators/Program.js",
    "content": "/**\n * Copyright (c) 2017-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n/* @flow */\n\nimport {\n  AbruptCompletion,\n  Completion,\n  JoinedAbruptCompletions,\n  JoinedNormalAndAbruptCompletions,\n  ThrowCompletion,\n} from \"../completions.js\";\nimport type { Realm } from \"../realm.js\";\nimport type { LexicalEnvironment } from \"../environment.js\";\nimport { Value, EmptyValue } from \"../values/index.js\";\nimport { GlobalEnvironmentRecord } from \"../environment.js\";\nimport { Environment, Functions, Join } from \"../singletons.js\";\nimport IsStrict from \"../utils/strict.js\";\nimport invariant from \"../invariant.js\";\nimport traverseFast from \"../utils/traverse-fast.js\";\nimport type { BabelNodeProgram, BabelNodeVariableDeclaration } from \"@babel/types\";\n\n// ECMA262 15.1.11\nexport function GlobalDeclarationInstantiation(\n  realm: Realm,\n  ast: BabelNodeProgram,\n  env: LexicalEnvironment,\n  strictCode: boolean\n): EmptyValue {\n  realm.getRunningContext().isStrict = realm.isStrict = strictCode;\n\n  // 1. Let envRec be env's EnvironmentRecord.\n  let envRec = env.environmentRecord;\n\n  // 2. Assert: envRec is a global Environment Record.\n  invariant(envRec instanceof GlobalEnvironmentRecord, \"expected global environment record\");\n\n  // 3. Let lexNames be the LexicallyDeclaredNames of script.\n  let lexNames = [];\n\n  // 4. Let varNames be the VarDeclaredNames of script.\n  let varNames = [];\n\n  traverseFast(ast, node => {\n    if (node.type === \"VariableDeclaration\") {\n      if (((node: any): BabelNodeVariableDeclaration).kind === \"var\") {\n        varNames = varNames.concat(Environment.BoundNames(realm, node));\n      } else {\n        lexNames = lexNames.concat(Environment.BoundNames(realm, node));\n      }\n    } else if (node.type === \"FunctionExpression\" || node.type === \"FunctionDeclaration\") {\n      return true;\n    }\n    return false;\n  });\n\n  // 5. For each name in lexNames, do\n  for (let name of lexNames) {\n    // a. If envRec.HasVarDeclaration(name) is true, throw a SyntaxError exception.\n    if (envRec.HasVarDeclaration(name)) {\n      throw realm.createErrorThrowCompletion(realm.intrinsics.SyntaxError, name + \" already declared with var\");\n    }\n\n    // b. If envRec.HasLexicalDeclaration(name) is true, throw a SyntaxError exception.\n    if (envRec.HasLexicalDeclaration(name)) {\n      throw realm.createErrorThrowCompletion(\n        realm.intrinsics.SyntaxError,\n        name + \" already declared with let or const\"\n      );\n    }\n\n    // c. Let hasRestrictedGlobal be ? envRec.HasRestrictedGlobalProperty(name).\n    let hasRestrictedGlobal = envRec.HasRestrictedGlobalProperty(name);\n\n    // d. If hasRestrictedGlobal is true, throw a SyntaxError exception.\n    if (hasRestrictedGlobal) {\n      throw realm.createErrorThrowCompletion(realm.intrinsics.SyntaxError, name + \" global object is restricted\");\n    }\n  }\n\n  // 6. For each name in varNames, do\n  for (let name of varNames) {\n    // a. If envRec.HasLexicalDeclaration(name) is true, throw a SyntaxError exception.\n    if (envRec.HasLexicalDeclaration(name)) {\n      throw realm.createErrorThrowCompletion(\n        realm.intrinsics.SyntaxError,\n        name + \" already declared with let or const\"\n      );\n    }\n  }\n\n  // 7. Let varDeclarations be the VarScopedDeclarations of script.\n  let varDeclarations = Functions.FindVarScopedDeclarations(ast);\n\n  // 8. Let functionsToInitialize be a new empty List.\n  let functionsToInitialize = [];\n\n  // 9. Let declaredFunctionNames be a new empty List.\n  let declaredFunctionNames = [];\n\n  // 10. For each d in varDeclarations, in reverse list order do\n  for (let d of varDeclarations.reverse()) {\n    // a. If d is neither a VariableDeclaration or a ForBinding, then\n    if (d.type !== \"VariableDeclaration\") {\n      // i. Assert: d is either a FunctionDeclaration or a GeneratorDeclaration.\n      invariant(d.type === \"FunctionDeclaration\", \"expected function\");\n\n      // ii. NOTE If there are multiple FunctionDeclarations for the same name, the last declaration is used.\n\n      // iii. Let fn be the sole element of the BoundNames of d.\n      let fn = Environment.BoundNames(realm, d)[0];\n\n      // iv. If fn is not an element of declaredFunctionNames, then\n      if (declaredFunctionNames.indexOf(fn) < 0) {\n        // 1. Let fnDefinable be ? envRec.CanDeclareGlobalFunction(fn).\n        let fnDefinable = envRec.CanDeclareGlobalFunction(fn);\n\n        // 2. If fnDefinable is false, throw a TypeError exception.\n        if (!fnDefinable) {\n          throw realm.createErrorThrowCompletion(\n            realm.intrinsics.TypeError,\n            fn + \": global function declarations are not allowed\"\n          );\n        }\n\n        // 3. Append fn to declaredFunctionNames.\n        declaredFunctionNames.push(fn);\n\n        // 4. Insert d as the first element of functionsToInitialize.\n        functionsToInitialize.unshift(d);\n      }\n    }\n  }\n\n  // 11. Let declaredVarNames be a new empty List.\n  let declaredVarNames = [];\n\n  // 12. For each d in varDeclarations, do\n  for (let d of varDeclarations) {\n    // a. If d is a VariableDeclaration or a ForBinding, then\n    if (d.type === \"VariableDeclaration\") {\n      // i. For each String vn in the BoundNames of d, do\n      for (let vn of Environment.BoundNames(realm, d)) {\n        // ii. If vn is not an element of declaredFunctionNames, then\n        if (declaredFunctionNames.indexOf(vn) < 0) {\n          // 1. Let vnDefinable be ? envRec.CanDeclareGlobalVar(vn).\n          let vnDefinable = envRec.CanDeclareGlobalVar(vn);\n\n          // 2. If vnDefinable is false, throw a TypeError exception.\n          if (!vnDefinable) {\n            throw realm.createErrorThrowCompletion(\n              realm.intrinsics.TypeError,\n              vn + \": global variable declarations are not allowed\"\n            );\n          }\n\n          // 3. If vn is not an element of declaredVarNames, then\n          if (declaredVarNames.indexOf(vn) < 0) {\n            // a. Append vn to declaredVarNames.\n            declaredVarNames.push(vn);\n          }\n        }\n      }\n    }\n  }\n\n  // 13. NOTE: No abnormal terminations occur after this algorithm step if the global object is an ordinary object. However, if the global object is a Proxy exotic object it may exhibit behaviours that cause abnormal terminations in some of the following steps.\n\n  // 14. NOTE: Annex B.3.3.2 adds additional steps at this point.\n\n  // 15. Let lexDeclarations be the LexicallyScopedDeclarations of script.\n  let lexDeclarations = [];\n  for (let s of ast.body) {\n    if (s.type === \"VariableDeclaration\" && s.kind !== \"var\") {\n      lexDeclarations.push(s);\n    }\n  }\n\n  // 16. For each element d in lexDeclarations do\n  for (let d of lexDeclarations) {\n    // a. NOTE Lexically declared names are only instantiated here but not initialized.\n\n    // b. For each element dn of the BoundNames of d do\n    for (let dn of Environment.BoundNames(realm, d)) {\n      // i. If IsConstantDeclaration of d is true, then\n      if (d.kind === \"const\") {\n        // 1. Perform ? envRec.CreateImmutableBinding(dn, true).\n        envRec.CreateImmutableBinding(dn, true);\n      } else {\n        // ii. Else,\n        // 1. Perform ? envRec.CreateMutableBinding(dn, false).\n        envRec.CreateMutableBinding(dn, false);\n      }\n    }\n  }\n\n  // 17. For each production f in functionsToInitialize, do\n  for (let f of functionsToInitialize) {\n    // a. Let fn be the sole element of the BoundNames of f.\n    let fn = Environment.BoundNames(realm, f)[0];\n\n    // b. Let fo be the result of performing InstantiateFunctionObject for f with argument env.\n    let fo = env.evaluate(f, strictCode);\n    invariant(fo instanceof Value);\n\n    // c. Perform ? envRec.CreateGlobalFunctionBinding(fn, fo, false).\n    envRec.CreateGlobalFunctionBinding(fn, fo, false);\n  }\n\n  // 18. For each String vn in declaredVarNames, in list order do\n  for (let vn of declaredVarNames) {\n    // a. Perform ? envRec.CreateGlobalVarBinding(vn, false).\n    envRec.CreateGlobalVarBinding(vn, false);\n  }\n\n  // 19. Return NormalCompletion(empty).\n  return realm.intrinsics.empty;\n}\n\nexport default function(ast: BabelNodeProgram, strictCode: boolean, env: LexicalEnvironment, realm: Realm): Value {\n  strictCode = IsStrict(ast);\n\n  GlobalDeclarationInstantiation(realm, ast, env, strictCode);\n\n  let val, res;\n\n  for (let node of ast.body) {\n    if (node.type !== \"FunctionDeclaration\") {\n      res = env.evaluateCompletionDeref(node, strictCode);\n      if (res instanceof AbruptCompletion && !realm.useAbstractInterpretation) throw res;\n      res = Functions.incorporateSavedCompletion(realm, res);\n      if (res instanceof Completion) {\n        emitThrowStatementsIfNeeded(res);\n        if (res instanceof ThrowCompletion) return res.value; // Program ends here at runtime, so don't carry on\n        res = res.value;\n      }\n      if (!(res instanceof EmptyValue)) {\n        val = res;\n      }\n    }\n  }\n  let directives = ast.directives;\n  if (!val && directives && directives.length) {\n    let directive = directives[directives.length - 1];\n    val = env.evaluate(directive, strictCode);\n    invariant(val instanceof Value);\n  }\n\n  // We are about to leave this program and this presents a join point where all control flows\n  // converge into a single flow and the joined effects become the final state.\n  invariant(val === undefined || val instanceof Value);\n  if (val instanceof Value) {\n    res = Functions.incorporateSavedCompletion(realm, val);\n    if (res instanceof Completion) emitThrowStatementsIfNeeded(res);\n  }\n\n  return val || realm.intrinsics.empty;\n\n  function emitThrowStatementsIfNeeded(completion: Completion): void {\n    let generator = realm.generator;\n    invariant(generator !== undefined);\n    let selector = c =>\n      c instanceof ThrowCompletion && c.value !== realm.intrinsics.__bottomValue && !(c.value instanceof EmptyValue);\n    if (res instanceof ThrowCompletion && selector(res)) {\n      generator.emitThrow(res.value);\n    } else if (\n      (res instanceof JoinedAbruptCompletions || res instanceof JoinedNormalAndAbruptCompletions) &&\n      res.containsSelectedCompletion(selector)\n    ) {\n      generator.emitConditionalThrow(Join.joinValuesOfSelectedCompletions(selector, res, true));\n      res = realm.intrinsics.undefined;\n    } else {\n      // might get here for completions where all throws have already been handled.\n    }\n  }\n}\n"
  },
  {
    "path": "src/evaluators/RegExpLiteral.js",
    "content": "/**\n * Copyright (c) 2017-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n/* @flow strict-local */\n\nimport type { Realm } from \"../realm.js\";\nimport type { LexicalEnvironment } from \"../environment.js\";\nimport { Value, StringValue } from \"../values/index.js\";\nimport { RegExpCreate } from \"../methods/index.js\";\nimport type { BabelNodeRegExpLiteral } from \"@babel/types\";\n\nexport default function(\n  ast: BabelNodeRegExpLiteral,\n  strictCode: boolean,\n  env: LexicalEnvironment,\n  realm: Realm\n): Value {\n  return RegExpCreate(\n    realm,\n    new StringValue(realm, ast.pattern),\n    ast.flags !== undefined ? new StringValue(realm, ast.flags) : undefined\n  );\n}\n"
  },
  {
    "path": "src/evaluators/ReturnStatement.js",
    "content": "/**\n * Copyright (c) 2017-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n/* @flow strict-local */\n\nimport type { Realm } from \"../realm.js\";\nimport type { LexicalEnvironment } from \"../environment.js\";\nimport type { Value } from \"../values/index.js\";\nimport { Environment } from \"../singletons.js\";\nimport { ReturnCompletion } from \"../completions.js\";\nimport type { BabelNodeReturnStatement } from \"@babel/types\";\n\nexport default function(\n  ast: BabelNodeReturnStatement,\n  strictCode: boolean,\n  env: LexicalEnvironment,\n  realm: Realm\n): Value {\n  let arg;\n  if (ast.argument) {\n    arg = Environment.GetValue(realm, env.evaluate(ast.argument, strictCode));\n  } else {\n    arg = realm.intrinsics.undefined;\n  }\n  throw new ReturnCompletion(arg, ast.loc);\n}\n"
  },
  {
    "path": "src/evaluators/SequenceExpression.js",
    "content": "/**\n * Copyright (c) 2017-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n/* @flow strict-local */\n\nimport type { Realm } from \"../realm.js\";\nimport type { LexicalEnvironment } from \"../environment.js\";\nimport type { Value } from \"../values/index.js\";\nimport { Environment } from \"../singletons.js\";\nimport type { BabelNodeSequenceExpression } from \"@babel/types\";\nimport invariant from \"../invariant.js\";\n\nexport default function(\n  ast: BabelNodeSequenceExpression,\n  strictCode: boolean,\n  env: LexicalEnvironment,\n  realm: Realm\n): Value {\n  invariant(ast.expressions.length > 0);\n  let val;\n  for (let node of ast.expressions) {\n    val = Environment.GetValue(realm, env.evaluate(node, strictCode));\n  }\n  invariant(val !== undefined);\n  return val;\n}\n"
  },
  {
    "path": "src/evaluators/StringLiteral.js",
    "content": "/**\n * Copyright (c) 2017-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n/* @flow strict-local */\n\nimport type { Realm } from \"../realm.js\";\nimport type { LexicalEnvironment } from \"../environment.js\";\nimport type { Value } from \"../values/index.js\";\nimport { StringValue } from \"../values/index.js\";\nimport type { BabelNodeStringLiteral } from \"@babel/types\";\n\nexport default function(\n  ast: BabelNodeStringLiteral,\n  strictCode: boolean,\n  env: LexicalEnvironment,\n  realm: Realm\n): Value {\n  return new StringValue(realm, ast.value);\n}\n"
  },
  {
    "path": "src/evaluators/SuperCall.js",
    "content": "/**\n * Copyright (c) 2017-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n/* @flow strict-local */\n\nimport type { BabelNodeExpression, BabelNodeSpreadElement } from \"@babel/types\";\nimport type { Realm } from \"../realm.js\";\nimport type { LexicalEnvironment } from \"../environment.js\";\nimport { FunctionEnvironmentRecord } from \"../environment.js\";\nimport { Value, UndefinedValue, ObjectValue } from \"../values/index.js\";\nimport { GetNewTarget, ArgumentListEvaluation, Construct, IsConstructor } from \"../methods/index.js\";\nimport { Environment } from \"../singletons.js\";\nimport invariant from \"../invariant.js\";\n\nfunction GetSuperConstructor(realm: Realm) {\n  // 1. Let envRec be GetThisEnvironment( ).\n  let envRec = Environment.GetThisEnvironment(realm);\n\n  // 2. Assert: envRec is a function Environment Record.\n  invariant(envRec instanceof FunctionEnvironmentRecord);\n\n  // 3. Let activeFunction be envRec.[[FunctionObject]].\n  let activeFunction = envRec.$FunctionObject;\n\n  // 4. Let superConstructor be activeFunction.[[GetPrototypeOf]]().\n  let superConstructor = activeFunction.$GetPrototypeOf();\n\n  // 5. ReturnIfAbrupt(superConstructor).\n\n  // 6. If IsConstructor(superConstructor) is false, throw a TypeError exception.\n  if (!IsConstructor(realm, superConstructor)) {\n    throw realm.createErrorThrowCompletion(realm.intrinsics.TypeError, \"super called outside of constructor\");\n  }\n  invariant(superConstructor instanceof ObjectValue);\n\n  // 7. Return superConstructor.\n  return superConstructor;\n}\n\n// ECMA262 12.3.5.1\nexport default function SuperCall(\n  Arguments: Array<BabelNodeExpression | BabelNodeSpreadElement>,\n  strictCode: boolean,\n  env: LexicalEnvironment,\n  realm: Realm\n): Value {\n  // 1. Let newTarget be GetNewTarget().\n  let newTarget = GetNewTarget(realm);\n\n  // 2. If newTarget is undefined, throw a ReferenceError exception.\n  if (newTarget instanceof UndefinedValue) {\n    throw realm.createErrorThrowCompletion(realm.intrinsics.ReferenceError, \"newTarget is undefined\");\n  }\n\n  // 3. Let func be GetSuperConstructor().\n  let func = GetSuperConstructor(realm);\n\n  // 4. ReturnIfAbrupt(func).\n\n  // 5. Let argList be ArgumentListEvaluation of Arguments.\n  let argList = ArgumentListEvaluation(realm, strictCode, env, Arguments);\n\n  // 6. ReturnIfAbrupt(argList).\n\n  // 7. Let result be Construct(func, argList, newTarget).\n  let result = Construct(realm, func, argList, newTarget).throwIfNotConcreteObject();\n\n  // 8. ReturnIfAbrupt(result).\n\n  // 9. Let thisER be GetThisEnvironment( ).\n  let thisER = Environment.GetThisEnvironment(realm);\n\n  // 10. Return thisER.BindThisValue(result).\n  return thisER.BindThisValue(result);\n}\n"
  },
  {
    "path": "src/evaluators/SuperProperty.js",
    "content": "/**\n * Copyright (c) 2017-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n/* @flow strict-local */\n\nimport type { Realm } from \"../realm.js\";\nimport type { LexicalEnvironment } from \"../environment.js\";\nimport { FunctionEnvironmentRecord } from \"../environment.js\";\nimport { Reference } from \"../environment.js\";\nimport { StringValue } from \"../values/index.js\";\nimport { RequireObjectCoercible } from \"../methods/index.js\";\nimport { Environment, To } from \"../singletons.js\";\nimport type { BabelNodeMemberExpression } from \"@babel/types\";\nimport invariant from \"../invariant.js\";\n\nfunction MakeSuperPropertyReference(realm: Realm, propertyKey, strict: boolean): Reference {\n  // 1. Let env be GetThisEnvironment( ).\n  let env = Environment.GetThisEnvironment(realm);\n  invariant(env instanceof FunctionEnvironmentRecord);\n\n  // 2. If env.HasSuperBinding() is false, throw a ReferenceError exception.\n  if (!env.HasSuperBinding()) {\n    throw realm.createErrorThrowCompletion(realm.intrinsics.ReferenceError, \"env does not have super binding\");\n  }\n\n  // 3. Let actualThis be env.GetThisBinding().\n  let actualThis = env.GetThisBinding();\n\n  // 4. ReturnIfAbrupt(actualThis).\n\n  // 5. Let baseValue be env.GetSuperBase().\n  let baseValue = env.GetSuperBase();\n\n  // 6. Let bv be RequireObjectCoercible(baseValue).\n  let bv = RequireObjectCoercible(realm, baseValue);\n\n  // 7. ReturnIfAbrupt(bv).\n\n  // 8. Return a value of type Reference that is a Super Reference whose base value is bv, whose referenced name is propertyKey, whose thisValue is actualThis, and whose strict reference flag is strict.\n  return new Reference(bv, propertyKey, strict, actualThis);\n}\n\n// ECMA262 12.3.5.1\nexport default function SuperProperty(\n  ast: BabelNodeMemberExpression,\n  strictCode: boolean,\n  env: LexicalEnvironment,\n  realm: Realm\n): Reference {\n  // SuperProperty : super [ Expression ]\n  if (ast.computed === true) {\n    // 1. Let propertyNameReference be the result of evaluating Expression.\n    let propertyNameReference = env.evaluate(ast.property, strictCode);\n\n    // 2. Let propertyNameValue be GetValue(propertyNameReference).\n    let propertyNameValue = Environment.GetValue(realm, propertyNameReference);\n\n    // 3. Let propertyKey be ToPropertyKey(propertyNameValue).\n    let propertyKey = To.ToPropertyKeyPartial(realm, propertyNameValue);\n\n    // 4. ReturnIfAbrupt(propertyKey).\n\n    // 5. If the code matched by the syntactic production that is being evaluated is strict mode code, let strict be true, else let strict be false.\n    let strict = strictCode;\n\n    // 6. Return MakeSuperPropertyReference(propertyKey, strict).\n    return MakeSuperPropertyReference(realm, propertyKey, strict);\n  } else {\n    // SuperProperty : super . IdentifierName\n    // 1. Let propertyKey be StringValue of IdentifierName.\n    let propertyKey = new StringValue(realm, ast.property.name);\n\n    // 2. If the code matched by the syntactic production that is being evaluated is strict mode code, let strict be true, else let strict be false.\n    let strict = strictCode;\n\n    // 3. Return MakeSuperPropertyReference(propertyKey, strict).\n    return MakeSuperPropertyReference(realm, propertyKey, strict);\n  }\n}\n"
  },
  {
    "path": "src/evaluators/SwitchStatement.js",
    "content": "/**\n * Copyright (c) 2017-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n/* @flow */\n\nimport type { Realm } from \"../realm.js\";\nimport type { LexicalEnvironment } from \"../environment.js\";\nimport { InfeasiblePathError } from \"../errors.js\";\nimport { computeBinary } from \"./BinaryExpression.js\";\nimport {\n  AbruptCompletion,\n  BreakCompletion,\n  Completion,\n  JoinedAbruptCompletions,\n  JoinedNormalAndAbruptCompletions,\n} from \"../completions.js\";\nimport { InternalGetResultValue } from \"./ForOfStatement.js\";\nimport { EmptyValue, AbstractValue, Value } from \"../values/index.js\";\nimport { StrictEqualityComparisonPartial, UpdateEmpty } from \"../methods/index.js\";\nimport { Environment, Functions, Join, Path } from \"../singletons.js\";\nimport type { BabelNodeSwitchStatement, BabelNodeSwitchCase, BabelNodeExpression } from \"@babel/types\";\nimport invariant from \"../invariant.js\";\n\n// 13.12.10 Runtime Semantics: CaseSelectorEvaluation\nfunction CaseSelectorEvaluation(\n  expression: BabelNodeExpression,\n  strictCode: boolean,\n  env: LexicalEnvironment,\n  realm: Realm\n): Value {\n  // 1. Let exprRef be the result of evaluating Expression.\n  let exprRef = env.evaluate(expression, strictCode);\n\n  // 2. Return ? GetValue(exprRef).\n  return Environment.GetValue(realm, exprRef);\n}\n\nfunction AbstractCaseBlockEvaluation(\n  cases: Array<BabelNodeSwitchCase>,\n  defaultCaseIndex: number,\n  input: Value,\n  strictCode: boolean,\n  env: LexicalEnvironment,\n  realm: Realm\n): Value {\n  invariant(realm.useAbstractInterpretation);\n\n  let DefiniteCaseEvaluation = (caseIndex: number): Value => {\n    let result = realm.intrinsics.undefined;\n    // we start at the case we've been asked to evaluate, and process statements\n    // until there is either a break statement or exception thrown (this means we\n    // implicitly fall through correctly in the absence of a break statement).\n    while (caseIndex < cases.length) {\n      let c = cases[caseIndex];\n      for (let i = 0; i < c.consequent.length; i += 1) {\n        let node = c.consequent[i];\n        let r = env.evaluateCompletionDeref(node, strictCode);\n\n        if (r instanceof JoinedNormalAndAbruptCompletions) {\n          r = realm.composeWithSavedCompletion(r);\n        }\n\n        result = UpdateEmpty(realm, r, result);\n        if (result instanceof Completion) break;\n      }\n\n      if (result instanceof Completion) break;\n      caseIndex++;\n    }\n    let sc = Functions.incorporateSavedCompletion(realm, result);\n    invariant(sc !== undefined);\n    result = sc;\n\n    if (result instanceof JoinedAbruptCompletions || result instanceof JoinedNormalAndAbruptCompletions) {\n      let selector = c => c instanceof BreakCompletion && !c.target;\n      let jc = AbstractValue.createJoinConditionForSelectedCompletions(selector, result);\n      let jv = AbstractValue.createFromConditionalOp(realm, jc, realm.intrinsics.empty, result.value);\n      result = Completion.normalizeSelectedCompletions(selector, result);\n      realm.composeWithSavedCompletion(result);\n      return jv;\n    } else if (result instanceof BreakCompletion) {\n      return result.value;\n    } else if (result instanceof AbruptCompletion) {\n      throw result;\n    } else {\n      invariant(result instanceof Value);\n      return result;\n    }\n  };\n\n  let AbstractCaseEvaluation = (caseIndex: number): Value => {\n    if (caseIndex === defaultCaseIndex) {\n      // skip the default case until we've exhausted all other options\n      return AbstractCaseEvaluation(caseIndex + 1);\n    } else if (caseIndex >= cases.length) {\n      // this is the stop condition for our recursive search for a matching case.\n      // we tried every available case index and since nothing matches we return\n      // the default (and if none exists....just empty)\n      if (defaultCaseIndex !== -1) {\n        return DefiniteCaseEvaluation(defaultCaseIndex);\n      } else {\n        return realm.intrinsics.empty;\n      }\n    }\n    // else we have a normal in-range case index\n\n    let c = cases[caseIndex];\n    let test = c.test;\n    invariant(test);\n\n    let selector = CaseSelectorEvaluation(test, strictCode, env, realm);\n    let selectionResult = computeBinary(realm, \"===\", input, selector);\n\n    if (Path.implies(selectionResult)) {\n      //  we have a winning result for the switch case, bubble it back up!\n      return DefiniteCaseEvaluation(caseIndex);\n    } else if (Path.impliesNot(selectionResult)) {\n      // we have a case that is definitely *not* taken\n      // so we go and look at the next one in the hope of finding a match\n      return AbstractCaseEvaluation(caseIndex + 1);\n    } else {\n      // we can't be sure whether the case selector evaluates true or not\n      // so we evaluate the case in the abstract as an if-else with the else\n      // leading to the next case statement\n      let trueEffects;\n      try {\n        trueEffects = Path.withCondition(selectionResult, () => {\n          return realm.evaluateForEffects(\n            () => {\n              return DefiniteCaseEvaluation(caseIndex);\n            },\n            undefined,\n            \"AbstractCaseEvaluation/1\"\n          );\n        });\n      } catch (e) {\n        if (e instanceof InfeasiblePathError) {\n          // selectionResult cannot be true in this path, after all.\n          return AbstractCaseEvaluation(caseIndex + 1);\n        }\n        throw e;\n      }\n\n      let falseEffects;\n      try {\n        falseEffects = Path.withInverseCondition(selectionResult, () => {\n          return realm.evaluateForEffects(\n            () => {\n              return AbstractCaseEvaluation(caseIndex + 1);\n            },\n            undefined,\n            \"AbstractCaseEvaluation/2\"\n          );\n        });\n      } catch (e) {\n        if (e instanceof InfeasiblePathError) {\n          // selectionResult cannot be false in this path, after all.\n          return DefiniteCaseEvaluation(caseIndex);\n        }\n        throw e;\n      }\n\n      invariant(trueEffects !== undefined);\n      invariant(falseEffects !== undefined);\n      let joinedEffects = Join.joinEffects(selectionResult, trueEffects, falseEffects);\n      realm.applyEffects(joinedEffects);\n\n      return realm.returnOrThrowCompletion(joinedEffects.result);\n    }\n  };\n\n  // let the recursive search for a matching case begin!\n  return AbstractCaseEvaluation(0);\n}\n\nfunction CaseBlockEvaluation(\n  cases: Array<BabelNodeSwitchCase>,\n  input: Value,\n  strictCode: boolean,\n  env: LexicalEnvironment,\n  realm: Realm\n): Value {\n  let EvaluateCase = (c: BabelNodeSwitchCase): Value | AbruptCompletion => {\n    let r = realm.intrinsics.empty;\n    for (let node of c.consequent) {\n      let res = env.evaluateCompletion(node, strictCode);\n      if (res instanceof AbruptCompletion) return (UpdateEmpty(realm, res, r): any);\n      if (!(res instanceof EmptyValue)) r = res;\n    }\n    return r;\n  };\n\n  let EvaluateCaseClauses = (A: Array<BabelNodeSwitchCase>, V: Value): [boolean, Value] => {\n    // 2. Let A be the List of CaseClause items in CaseClauses, in source text order.\n    // A is passed in\n\n    // 3. Let found be false.\n    let found = false;\n\n    // 4. Repeat for each CaseClause C in A,\n    for (let C of A) {\n      // a. If found is false, then\n      if (!found) {\n        // i. Let clauseSelector be the result of CaseSelectorEvaluation of C.\n        let test = C.test;\n        invariant(test);\n        let clauseSelector = CaseSelectorEvaluation(test, strictCode, env, realm);\n\n        // ii. ReturnIfAbrupt(clauseSelector).\n        // above will throw a Completion which will return\n\n        // iii. Let found be the result of performing Strict Equality Comparison input === clauseSelector.[[Value]].\n        found = StrictEqualityComparisonPartial(realm, input, clauseSelector);\n      }\n      if (found) {\n        // b. If found is true, then\n        // i. Let R be the result of evaluating C.\n        let R = EvaluateCase(C);\n\n        // ii. If R.[[Value]] is not empty, let V be R.[[Value]].\n        let val = InternalGetResultValue(realm, R);\n        if (!(val instanceof EmptyValue)) V = val;\n\n        // iii. If R is an abrupt completion, return Completion(UpdateEmpty(R, V)).\n        if (R instanceof AbruptCompletion) {\n          throw UpdateEmpty(realm, R, V);\n        }\n      }\n    }\n    return [found, V];\n  };\n\n  // CaseBlock:{}\n  // 1. Return NormalCompletion(undefined).\n  if (cases.length === 0) return realm.intrinsics.undefined;\n\n  // CaseBlock:{CaseClauses DefaultClause CaseClauses}\n  let default_case_num = cases.findIndex(clause => {\n    return clause.test === null;\n  });\n\n  // Abstract interpretation of case blocks is a significantly different process\n  // from regular interpretation, so we fork off early to keep things tidily separated.\n  if (input instanceof AbstractValue && cases.length < 6) {\n    return AbstractCaseBlockEvaluation(cases, default_case_num, input, strictCode, env, realm);\n  }\n\n  if (default_case_num !== -1) {\n    // 2. Let A be the List of CaseClause items in the first CaseClauses, in source text order. If the first CaseClauses is not present, A is « ».\n    let A = cases.slice(0, default_case_num);\n\n    let V = realm.intrinsics.undefined;\n\n    // 4. Repeat for each CaseClause C in A\n    [, V] = EvaluateCaseClauses(A, V);\n\n    // 5. Let foundInB be false.\n    let foundInB = false;\n\n    // 6. Let B be the List containing the CaseClause items in the second CaseClauses, in source text order. If the second CaseClauses is not present, B is « ».\n    let B = cases.slice(default_case_num + 1);\n\n    [foundInB, V] = EvaluateCaseClauses(B, V);\n\n    // 8. If foundInB is true, return NormalCompletion(V).\n    if (foundInB) return V;\n\n    // 9. Let R be the result of evaluating DefaultClause.\n    let R = EvaluateCase(cases[default_case_num]);\n\n    // 10. If R.[[Value]] is not empty, let V be R.[[Value]].\n    let val = InternalGetResultValue(realm, R);\n    if (!(val instanceof EmptyValue)) V = val;\n\n    // 11. If R is an abrupt completion, return Completion(UpdateEmpty(R, V)).\n    if (R instanceof AbruptCompletion) {\n      throw UpdateEmpty(realm, R, V);\n    }\n\n    // 12: Repeat for each CaseClause C in B (NOTE this is another complete iteration of the second CaseClauses)\n    for (let C of B) {\n      // a. Let R be the result of evaluating CaseClause C.\n      R = EvaluateCase(C);\n\n      // b. If R.[[Value]] is not empty, let V be R.[[Value]].\n      let value = InternalGetResultValue(realm, R);\n      if (!(value instanceof EmptyValue)) V = value;\n\n      // c. If R is an abrupt completion, return Completion(UpdateEmpty(R, V)).\n      if (R instanceof AbruptCompletion) {\n        throw UpdateEmpty(realm, R, V);\n      }\n    }\n\n    // 13. Return NormalCompletion(V).\n    return V;\n  } else {\n    // CaseBlock:{CaseClauses}\n    let V;\n    [, V] = EvaluateCaseClauses(cases, realm.intrinsics.undefined);\n    return V;\n  }\n}\n\n// 13.12.11\nexport default function(\n  ast: BabelNodeSwitchStatement,\n  strictCode: boolean,\n  env: LexicalEnvironment,\n  realm: Realm,\n  labelSet: Array<string>\n): Value {\n  let expression = ast.discriminant;\n\n  // 1. Let exprRef be the result of evaluating Expression.\n  let exprRef = env.evaluate(expression, strictCode);\n\n  // 2. Let switchValue be ? GetValue(exprRef).\n  let switchValue = Environment.GetValue(realm, exprRef);\n  if (switchValue instanceof AbstractValue && !switchValue.values.isTop()) {\n    let elems = switchValue.values.getElements();\n    let n = elems.size;\n    if (n > 1 && n < 10) {\n      return Join.mapAndJoin(\n        realm,\n        elems,\n        concreteSwitchValue => AbstractValue.createFromBinaryOp(realm, \"===\", switchValue, concreteSwitchValue),\n        concreteSwitchValue => evaluationHelper(ast, concreteSwitchValue, strictCode, env, realm, labelSet)\n      );\n    }\n  }\n\n  return evaluationHelper(ast, switchValue, strictCode, env, realm, labelSet);\n}\n\nfunction evaluationHelper(\n  ast: BabelNodeSwitchStatement,\n  switchValue: Value,\n  strictCode: boolean,\n  env: LexicalEnvironment,\n  realm: Realm,\n  labelSet: Array<string>\n): Value {\n  let cases: Array<BabelNodeSwitchCase> = ast.cases;\n\n  // 3. Let oldEnv be the running execution context's LexicalEnvironment.\n  let oldEnv = realm.getRunningContext().lexicalEnvironment;\n\n  // 4. Let blockEnv be NewDeclarativeEnvironment(oldEnv).\n  let blockEnv = Environment.NewDeclarativeEnvironment(realm, oldEnv);\n\n  // 5. Perform BlockDeclarationInstantiation(CaseBlock, blockEnv).\n  let CaseBlock = [];\n  cases.forEach(c => CaseBlock.push(...c.consequent));\n  Environment.BlockDeclarationInstantiation(realm, strictCode, CaseBlock, blockEnv);\n\n  // 6. Set the running execution context's LexicalEnvironment to blockEnv.\n  realm.getRunningContext().lexicalEnvironment = blockEnv;\n\n  let R;\n  try {\n    // 7. Let R be the result of performing CaseBlockEvaluation of CaseBlock with argument switchValue.\n    R = CaseBlockEvaluation(cases, switchValue, strictCode, blockEnv, realm);\n\n    // 9. Return R.\n    return R;\n  } catch (e) {\n    if (e instanceof BreakCompletion) {\n      if (!e.target) return (UpdateEmpty(realm, e, realm.intrinsics.undefined): any).value;\n    }\n    throw e;\n  } finally {\n    // 8. Set the running execution context's LexicalEnvironment to oldEnv.\n    realm.getRunningContext().lexicalEnvironment = oldEnv;\n    realm.onDestroyScope(blockEnv);\n  }\n}\n"
  },
  {
    "path": "src/evaluators/TaggedTemplateExpression.js",
    "content": "/**\n * Copyright (c) 2017-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n/* @flow strict-local */\n\nimport type { Realm } from \"../realm.js\";\nimport type { LexicalEnvironment } from \"../environment.js\";\nimport type { Value } from \"../values/index.js\";\nimport { EvaluateCall } from \"../methods/call.js\";\nimport type { BabelNodeTaggedTemplateExpression } from \"@babel/types\";\n\n// ECMA262 12.3.7\nexport default function(\n  ast: BabelNodeTaggedTemplateExpression,\n  strictCode: boolean,\n  env: LexicalEnvironment,\n  realm: Realm\n): Value {\n  // 1. Let tagRef be the result of evaluating MemberExpression.\n  let tagRef = env.evaluate(ast.tag, strictCode);\n\n  // 2. Let thisCall be this MemberExpression.\n\n  // 3. Let tailCall be IsInTailPosition(thisCall).\n\n  // 4. Return ? EvaluateCall(tagRef, TemplateLiteral, tailCall).\n  return EvaluateCall(realm, strictCode, env, tagRef, ast.quasi);\n}\n"
  },
  {
    "path": "src/evaluators/TemplateLiteral.js",
    "content": "/**\n * Copyright (c) 2017-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n/* @flow strict-local */\n\nimport type { Realm } from \"../realm.js\";\nimport type { LexicalEnvironment } from \"../environment.js\";\nimport type { Value } from \"../values/index.js\";\nimport { StringValue } from \"../values/index.js\";\nimport { Environment, To } from \"../singletons.js\";\nimport type { BabelNodeTemplateLiteral } from \"@babel/types\";\n\n// ECMA262 12.2.9\nexport default function(\n  ast: BabelNodeTemplateLiteral,\n  strictCode: boolean,\n  env: LexicalEnvironment,\n  realm: Realm\n): Value {\n  let str = \"\";\n\n  for (let i = 0; i < ast.quasis.length; i++) {\n    // add quasi\n    let elem = ast.quasis[i];\n    str += elem.value.cooked;\n\n    // add expression\n    let expr = ast.expressions[i];\n    if (expr) {\n      str += To.ToStringPartial(realm, Environment.GetValue(realm, env.evaluate(expr, strictCode)));\n    }\n  }\n\n  return new StringValue(realm, str);\n}\n"
  },
  {
    "path": "src/evaluators/ThisExpression.js",
    "content": "/**\n * Copyright (c) 2017-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n/* @flow strict-local */\n\nimport type { Realm } from \"../realm.js\";\nimport type { LexicalEnvironment } from \"../environment.js\";\nimport type { Value } from \"../values/index.js\";\nimport { Environment } from \"../singletons.js\";\nimport type { BabelNodeThisExpression } from \"@babel/types\";\n\n// ECMA262 12.2.2.1\nexport default function(\n  ast: BabelNodeThisExpression,\n  strictCode: boolean,\n  env: LexicalEnvironment,\n  realm: Realm\n): Value {\n  // 1. Return ? ResolveThisBinding( ).\n  return Environment.ResolveThisBinding(realm);\n}\n"
  },
  {
    "path": "src/evaluators/ThrowStatement.js",
    "content": "/**\n * Copyright (c) 2017-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n/* @flow strict-local */\n\nimport type { Realm } from \"../realm.js\";\nimport type { LexicalEnvironment } from \"../environment.js\";\nimport type { Value } from \"../values/index.js\";\nimport { ThrowCompletion } from \"../completions.js\";\nimport { Environment } from \"../singletons.js\";\nimport type { BabelNodeThrowStatement } from \"@babel/types\";\n\nexport default function(\n  ast: BabelNodeThrowStatement,\n  strictCode: boolean,\n  env: LexicalEnvironment,\n  realm: Realm\n): Value {\n  let exprRef = env.evaluate(ast.argument, strictCode);\n  let exprValue = Environment.GetValue(realm, exprRef);\n  throw new ThrowCompletion(exprValue, ast.loc);\n}\n"
  },
  {
    "path": "src/evaluators/TryStatement.js",
    "content": "/**\n * Copyright (c) 2017-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n/* @flow */\n\nimport type { Realm } from \"../realm.js\";\nimport { type LexicalEnvironment } from \"../environment.js\";\nimport {\n  AbruptCompletion,\n  Completion,\n  JoinedAbruptCompletions,\n  JoinedNormalAndAbruptCompletions,\n  ThrowCompletion,\n} from \"../completions.js\";\nimport { UpdateEmpty } from \"../methods/index.js\";\nimport { InfeasiblePathError } from \"../errors.js\";\nimport { construct_empty_effects } from \"../realm.js\";\nimport { Functions, Join, Path } from \"../singletons.js\";\nimport { AbstractValue, Value } from \"../values/index.js\";\nimport type { BabelNodeTryStatement } from \"@babel/types\";\nimport invariant from \"../invariant.js\";\n\nexport default function(ast: BabelNodeTryStatement, strictCode: boolean, env: LexicalEnvironment, realm: Realm): Value {\n  if (realm.useAbstractInterpretation) return joinTryBlockWithHandlers(ast, strictCode, env, realm);\n\n  let blockRes = env.evaluateCompletionDeref(ast.block, strictCode);\n  let result = blockRes;\n\n  if (blockRes instanceof ThrowCompletion && ast.handler) {\n    result = env.evaluateCompletionDeref(ast.handler, strictCode, blockRes);\n  }\n\n  if (ast.finalizer) {\n    result = composeResults(result, env.evaluateCompletionDeref(ast.finalizer, strictCode));\n  }\n\n  return realm.returnOrThrowCompletion(UpdateEmpty(realm, result, realm.intrinsics.undefined));\n}\n\nfunction composeResults(r1: Completion | Value, r2: Completion | Value): Completion | Value {\n  if (r2 instanceof AbruptCompletion) return r2;\n  return Join.composeCompletions(r2, r1);\n}\n\nfunction joinTryBlockWithHandlers(\n  ast: BabelNodeTryStatement,\n  strictCode: boolean,\n  env: LexicalEnvironment,\n  realm: Realm\n): Value {\n  let savedIsInPureTryStatement = realm.isInPureTryStatement;\n  if (realm.isInPureScope()) {\n    // TODO(1264): This is used to issue a warning if we have abstract function calls in here.\n    // We might not need it once we have full support for handling potential errors. Even\n    // then we might need it to know whether we should bother tracking error handling.\n    realm.isInPureTryStatement = true;\n  }\n  let blockRes = env.evaluateCompletionDeref(ast.block, strictCode);\n  // this is a join point for break and continue completions\n  blockRes = Functions.incorporateSavedCompletion(realm, blockRes);\n  invariant(blockRes !== undefined);\n  realm.isInPureTryStatement = savedIsInPureTryStatement;\n\n  let result = blockRes;\n  let handler = ast.handler;\n  let selector = c => c instanceof ThrowCompletion;\n  if (handler && blockRes instanceof Completion && blockRes.containsSelectedCompletion(selector)) {\n    if (blockRes instanceof ThrowCompletion) {\n      result = env.evaluateCompletionDeref(handler, strictCode, blockRes);\n    } else {\n      invariant(blockRes instanceof JoinedAbruptCompletions || blockRes instanceof JoinedNormalAndAbruptCompletions);\n      // put the handler under a guard that excludes normal paths from entering it.\n      let joinCondition = AbstractValue.createJoinConditionForSelectedCompletions(selector, blockRes);\n      if (joinCondition.mightNotBeFalse()) {\n        try {\n          let handlerEffects = Path.withCondition(joinCondition, () => {\n            invariant(blockRes instanceof Completion);\n            let joinedThrow = new ThrowCompletion(Join.joinValuesOfSelectedCompletions(selector, blockRes));\n            let handlerEval = () => env.evaluateCompletionDeref(handler, strictCode, joinedThrow);\n            return realm.evaluateForEffects(handlerEval, undefined, \"joinTryBlockWithHandlers\");\n          });\n          Completion.makeSelectedCompletionsInfeasible(selector, blockRes);\n          let emptyEffects = construct_empty_effects(realm, blockRes);\n          handlerEffects = Join.joinEffects(joinCondition, handlerEffects, emptyEffects);\n          realm.applyEffects(handlerEffects);\n          result = handlerEffects.result;\n        } catch (e) {\n          if (!(e instanceof InfeasiblePathError)) throw e;\n          // It turns out that the handler is not reachable after all so just do nothing and carry on\n        }\n      }\n    }\n  }\n\n  if (ast.finalizer) {\n    let res = env.evaluateCompletionDeref(ast.finalizer, strictCode);\n    result = composeResults(result, res);\n  }\n  return realm.returnOrThrowCompletion(UpdateEmpty(realm, result, realm.intrinsics.undefined));\n}\n"
  },
  {
    "path": "src/evaluators/UnaryExpression.js",
    "content": "/**\n * Copyright (c) 2017-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n/* @flow strict-local */\n\nimport type { Realm } from \"../realm.js\";\nimport type { LexicalEnvironment } from \"../environment.js\";\n//import { SimpleNormalCompletion } from \"../completions.js\";\nimport { CompilerDiagnostic, FatalError } from \"../errors.js\";\nimport { TypesDomain, ValuesDomain } from \"../domains/index.js\";\nimport {\n  AbstractObjectValue,\n  Value,\n  BooleanValue,\n  ConcreteValue,\n  NumberValue,\n  IntegralValue,\n  StringValue,\n  UndefinedValue,\n  NullValue,\n  SymbolValue,\n  ObjectValue,\n  AbstractValue,\n} from \"../values/index.js\";\nimport { Reference, EnvironmentRecord } from \"../environment.js\";\nimport invariant from \"../invariant.js\";\nimport { IsCallable } from \"../methods/index.js\";\nimport { Environment, To } from \"../singletons.js\";\nimport type { BabelNodeUnaryExpression } from \"@babel/types\";\n\nfunction isInstance(proto, Constructor): boolean {\n  return proto instanceof Constructor || proto === Constructor.prototype;\n}\n\nfunction evaluateDeleteOperation(expr: Value | Reference, realm: Realm) {\n  // ECMA262 12.5.3.2\n\n  // 1. Let ref be the result of evaluating UnaryExpression.\n  let ref = expr;\n\n  // 2. ReturnIfAbrupt(ref).\n\n  // 3. If Type(ref) is not Reference, return true.\n  if (!(ref instanceof Reference)) return realm.intrinsics.true;\n\n  // 4. If IsUnresolvableReference(ref) is true, then\n  if (Environment.IsUnresolvableReference(realm, ref)) {\n    // a. Assert: IsStrictReference(ref) is false.\n    invariant(!Environment.IsStrictReference(realm, ref), \"did not expect a strict reference\");\n\n    // b. Return true.\n    return realm.intrinsics.true;\n  }\n\n  // 5. If IsPropertyReference(ref) is true, then\n  if (Environment.IsPropertyReference(realm, ref)) {\n    // a. If IsSuperReference(ref) is true, throw a ReferenceError exception.\n    if (Environment.IsSuperReference(realm, ref)) {\n      throw realm.createErrorThrowCompletion(realm.intrinsics.ReferenceError);\n    }\n\n    // b. Let baseObj be ! ToObject(GetBase(ref)).\n    let base = Environment.GetBase(realm, ref);\n    // Constructing the reference checks that base is coercible to an object hence\n    invariant(base instanceof ConcreteValue || base instanceof AbstractObjectValue);\n    let baseObj = To.ToObject(realm, base);\n\n    // c. Let deleteStatus be ? baseObj.[[Delete]](GetReferencedName(ref)).\n    let deleteStatus = baseObj.$Delete(Environment.GetReferencedName(realm, ref));\n\n    // d. If deleteStatus is false and IsStrictReference(ref) is true, throw a TypeError exception.\n    if (!deleteStatus && Environment.IsStrictReference(realm, ref)) {\n      throw realm.createErrorThrowCompletion(realm.intrinsics.TypeError);\n    }\n\n    // e. Return deleteStatus.\n    return new BooleanValue(realm, deleteStatus);\n  }\n\n  // 6. Else ref is a Reference to an Environment Record binding,\n  // a. Let bindings be GetBase(ref).\n  let bindings = Environment.GetBase(realm, ref);\n  invariant(bindings instanceof EnvironmentRecord);\n\n  // b. Return ? bindings.DeleteBinding(GetReferencedName(ref)).\n  let referencedName = Environment.GetReferencedName(realm, ref);\n  invariant(typeof referencedName === \"string\");\n  return new BooleanValue(realm, bindings.DeleteBinding(referencedName));\n}\n\nfunction tryToEvaluateOperationOrLeaveAsAbstract(\n  ast: BabelNodeUnaryExpression,\n  expr: Value | Reference,\n  func: (ast: BabelNodeUnaryExpression, expr: Value | Reference, strictCode: boolean, realm: Realm) => Value,\n  strictCode: boolean,\n  realm: Realm\n): Value {\n  let effects;\n  try {\n    effects = realm.evaluateForEffects(\n      () => func(ast, expr, strictCode, realm),\n      undefined,\n      \"tryToEvaluateOperationOrLeaveAsAbstract\"\n    );\n  } catch (error) {\n    if (error instanceof FatalError) {\n      return realm.evaluateWithPossibleThrowCompletion(\n        () => {\n          let value = Environment.GetValue(realm, expr);\n\n          // if the value is abstract, then create a unary op for it,\n          // otherwise we rethrow the error as we don't handle it at this\n          // point in time\n          if (value instanceof AbstractValue) {\n            return AbstractValue.createFromUnaryOp(realm, ast.operator, value);\n          }\n          throw error;\n        },\n        TypesDomain.topVal,\n        ValuesDomain.topVal\n      );\n    } else {\n      throw error;\n    }\n  }\n  realm.applyEffects(effects);\n  return realm.returnOrThrowCompletion(effects.result);\n}\n\nfunction evaluateOperation(\n  ast: BabelNodeUnaryExpression,\n  expr: Value | Reference,\n  strictCode: boolean,\n  realm: Realm\n): Value {\n  function reportError(value: Value) {\n    if (value.getType() === SymbolValue) {\n      // Symbols never implicitly coerce to primitives.\n      throw realm.createErrorThrowCompletion(realm.intrinsics.TypeError);\n    }\n    let error = new CompilerDiagnostic(\n      \"might be a symbol or an object with an unknown valueOf or toString or Symbol.toPrimitive method\",\n      ast.argument.loc,\n      \"PP0008\",\n      \"RecoverableError\"\n    );\n    if (realm.handleError(error) === \"Fail\") throw new FatalError();\n  }\n\n  if (ast.operator === \"+\") {\n    // ECMA262 12.5.6.1\n\n    // 1. Let expr be the result of evaluating UnaryExpression.\n    expr;\n\n    // 2. Return ? ToNumber(? GetValue(expr)).\n    let value = Environment.GetValue(realm, expr);\n    if (value instanceof AbstractValue) {\n      if (!To.IsToNumberPure(realm, value)) reportError(value);\n      return AbstractValue.createFromUnaryOp(realm, \"+\", value);\n    }\n    invariant(value instanceof ConcreteValue);\n\n    return IntegralValue.createFromNumberValue(realm, To.ToNumber(realm, value));\n  } else if (ast.operator === \"-\") {\n    // ECMA262 12.5.7.1\n\n    // 1. Let expr be the result of evaluating UnaryExpression.\n    expr;\n\n    // 2. Let oldValue be ? ToNumber(? GetValue(expr)).\n    let value = Environment.GetValue(realm, expr);\n    if (value instanceof AbstractValue) {\n      if (!To.IsToNumberPure(realm, value)) reportError(value);\n      return AbstractValue.createFromUnaryOp(realm, \"-\", value);\n    }\n    invariant(value instanceof ConcreteValue);\n    let oldValue = To.ToNumber(realm, value);\n\n    // 3. If oldValue is NaN, return NaN.\n    if (isNaN(oldValue)) {\n      return realm.intrinsics.NaN;\n    }\n\n    // 4. Return the result of negating oldValue; that is, compute a Number with the same magnitude but opposite sign.\n    return IntegralValue.createFromNumberValue(realm, -oldValue);\n  } else if (ast.operator === \"~\") {\n    // ECMA262 12.5.8\n\n    // 1. Let expr be the result of evaluating UnaryExpression.\n    expr;\n\n    // 2. Let oldValue be ? ToInt32(? GetValue(expr)).\n    let value = Environment.GetValue(realm, expr);\n    if (value instanceof AbstractValue) {\n      if (!To.IsToNumberPure(realm, value)) reportError(value);\n      return AbstractValue.createFromUnaryOp(realm, \"~\", value);\n    }\n    invariant(value instanceof ConcreteValue);\n    let oldValue = To.ToInt32(realm, value);\n\n    // 3. Return the result of applying bitwise complement to oldValue. The result is a signed 32-bit integer.\n    return IntegralValue.createFromNumberValue(realm, ~oldValue);\n  } else if (ast.operator === \"!\") {\n    // ECMA262 12.6.9\n\n    // 1. Let expr be the result of evaluating UnaryExpression.\n    expr;\n\n    // 2. Let oldValue be ToBoolean(? GetValue(expr)).\n    let value = Environment.GetConditionValue(realm, expr);\n    if (value instanceof AbstractValue) return AbstractValue.createFromUnaryOp(realm, \"!\", value);\n    invariant(value instanceof ConcreteValue);\n    let oldValue = To.ToBoolean(realm, value);\n\n    // 3. If oldValue is true, return false.\n    if (oldValue === true) return realm.intrinsics.false;\n\n    // 4. Return true.\n    return realm.intrinsics.true;\n  } else if (ast.operator === \"void\") {\n    // 1. Let expr be the result of evaluating UnaryExpression.\n    expr;\n\n    // 2. Perform ? GetValue(expr).\n    Environment.GetValue(realm, expr);\n\n    // 3. Return undefined.\n    return realm.intrinsics.undefined;\n  } else {\n    invariant(ast.operator === \"typeof\");\n    // ECMA262 12.6.5\n\n    // 1. Let val be the result of evaluating UnaryExpression.\n    let val = expr;\n\n    // 2. If Type(val) is Reference, then\n    if (val instanceof Reference) {\n      // a. If IsUnresolvableReference(val) is true, return \"undefined\".\n      if (Environment.IsUnresolvableReference(realm, val)) {\n        return new StringValue(realm, \"undefined\");\n      }\n    }\n\n    // 3. Let val be ? GetValue(val).\n    val = Environment.GetValue(realm, val);\n\n    // 4. Return a String according to Table 35.\n    let proto = val.getType().prototype;\n    if (isInstance(proto, UndefinedValue)) {\n      return new StringValue(realm, \"undefined\");\n    } else if (isInstance(proto, NullValue)) {\n      return new StringValue(realm, \"object\");\n    } else if (isInstance(proto, StringValue)) {\n      return new StringValue(realm, \"string\");\n    } else if (isInstance(proto, BooleanValue)) {\n      return new StringValue(realm, \"boolean\");\n    } else if (isInstance(proto, NumberValue)) {\n      return new StringValue(realm, \"number\");\n    } else if (isInstance(proto, SymbolValue)) {\n      return new StringValue(realm, \"symbol\");\n    } else if (isInstance(proto, ObjectValue)) {\n      if (IsCallable(realm, val)) {\n        return new StringValue(realm, \"function\");\n      }\n      return new StringValue(realm, \"object\");\n    } else {\n      invariant(val instanceof AbstractValue);\n      return AbstractValue.createFromUnaryOp(realm, \"typeof\", val);\n    }\n  }\n}\n\nexport default function(\n  ast: BabelNodeUnaryExpression,\n  strictCode: boolean,\n  env: LexicalEnvironment,\n  realm: Realm\n): Value {\n  let expr = env.evaluate(ast.argument, strictCode);\n\n  if (ast.operator === \"delete\") {\n    return evaluateDeleteOperation(expr, realm);\n  }\n  if (realm.isInPureScope()) {\n    return tryToEvaluateOperationOrLeaveAsAbstract(ast, expr, evaluateOperation, strictCode, realm);\n  } else {\n    return evaluateOperation(ast, expr, strictCode, realm);\n  }\n}\n"
  },
  {
    "path": "src/evaluators/UpdateExpression.js",
    "content": "/**\n * Copyright (c) 2017-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n/* @flow strict-local */\n\nimport type { Realm } from \"../realm.js\";\nimport type { LexicalEnvironment } from \"../environment.js\";\nimport type { Value } from \"../values/index.js\";\nimport { CompilerDiagnostic, FatalError } from \"../errors.js\";\nimport { Add } from \"../methods/index.js\";\nimport { AbstractValue, NumberValue, IntegralValue } from \"../values/index.js\";\nimport type { BabelNodeUpdateExpression } from \"@babel/types\";\nimport { Environment, Leak, Properties, To } from \"../singletons.js\";\nimport invariant from \"../invariant.js\";\nimport { ValuesDomain, TypesDomain } from \"../domains/index.js\";\nimport { createOperationDescriptor } from \"../utils/generator.js\";\n\nexport default function(\n  ast: BabelNodeUpdateExpression,\n  strictCode: boolean,\n  env: LexicalEnvironment,\n  realm: Realm\n): Value {\n  // ECMA262 12.4 Update Expressions\n\n  // Let expr be the result of evaluating UnaryExpression.\n  let expr = env.evaluate(ast.argument, strictCode);\n\n  // Let oldValue be ? ToNumber(? GetValue(expr)).\n  let oldExpr = Environment.GetValue(realm, expr);\n  if (oldExpr instanceof AbstractValue) {\n    invariant(ast.operator === \"++\" || ast.operator === \"--\"); // As per BabelNodeUpdateExpression\n    let op = ast.operator === \"++\" ? \"+\" : \"-\";\n    let newAbstractValue = AbstractValue.createFromBinaryOp(realm, op, oldExpr, new NumberValue(realm, 1), ast.loc);\n    if (!To.IsToNumberPure(realm, oldExpr)) {\n      if (realm.isInPureScope()) {\n        // In pure scope we have to treat the ToNumber operation as temporal since it\n        // might throw or mutate something. We also need to leak the argument due to the\n        // possible mutations.\n        Leak.value(realm, oldExpr);\n        newAbstractValue = realm.evaluateWithPossibleThrowCompletion(\n          () =>\n            AbstractValue.createTemporalFromBuildFunction(\n              realm,\n              NumberValue,\n              [oldExpr],\n              createOperationDescriptor(\"UPDATE_INCREMENTOR\", { incrementor: op })\n            ),\n          TypesDomain.topVal,\n          ValuesDomain.topVal\n        );\n      } else {\n        let error = new CompilerDiagnostic(\n          \"might be a symbol or an object with an unknown valueOf or toString or Symbol.toPrimitive method\",\n          ast.argument.loc,\n          \"PP0008\",\n          \"RecoverableError\"\n        );\n        if (realm.handleError(error) === \"Fail\") throw new FatalError();\n      }\n    }\n    Properties.PutValue(realm, expr, newAbstractValue);\n    if (ast.prefix === true) {\n      return newAbstractValue;\n    } else {\n      return oldExpr;\n    }\n  }\n  let oldValue = To.ToNumber(realm, oldExpr);\n\n  if (ast.prefix === true) {\n    if (ast.operator === \"++\") {\n      // ECMA262 12.4.6.1\n\n      // 3. Let newValue be the result of adding the value 1 to oldValue, using the same rules as for the + operator (see 12.8.5)\n      let newValue = Add(realm, oldValue, 1);\n\n      // 4. Perform ? PutValue(expr, newValue).\n      Properties.PutValue(realm, expr, newValue);\n\n      // 5. Return newValue.\n      return newValue;\n    } else if (ast.operator === \"--\") {\n      // ECMA262 12.4.7.1\n\n      // 3. Let newValue be the result of subtracting the value 1 from oldValue, using the same rules as for the - operator (see 12.8.5).\n      let newValue = Add(realm, oldValue, -1);\n\n      // 4. Perform ? PutValue(expr, newValue).\n      Properties.PutValue(realm, expr, newValue);\n\n      // 5. Return newValue.\n      return newValue;\n    }\n    invariant(false);\n  } else {\n    if (ast.operator === \"++\") {\n      // ECMA262 12.4.4.1\n\n      // 3. Let newValue be the result of adding the value 1 to oldValue, using the same rules as for the + operator (see 12.8.5).\n      let newValue = Add(realm, oldValue, 1);\n\n      // 4. Perform ? PutValue(lhs, newValue).\n      Properties.PutValue(realm, expr, newValue);\n\n      // 5. Return oldValue.\n      return IntegralValue.createFromNumberValue(realm, oldValue);\n    } else if (ast.operator === \"--\") {\n      // ECMA262 12.4.5.1\n\n      // 3. Let newValue be the result of subtracting the value 1 from oldValue, using the same rules as for the - operator (see 12.8.5).\n      let newValue = Add(realm, oldValue, -1);\n\n      // 4. Perform ? PutValue(lhs, newValue).\n      Properties.PutValue(realm, expr, newValue);\n\n      // 5. Return oldValue.\n      return IntegralValue.createFromNumberValue(realm, oldValue);\n    }\n    invariant(false);\n  }\n}\n"
  },
  {
    "path": "src/evaluators/VariableDeclaration.js",
    "content": "/**\n * Copyright (c) 2017-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n/* @flow strict-local */\n\nimport type { Realm } from \"../realm.js\";\nimport type { LexicalEnvironment } from \"../environment.js\";\nimport type { Value } from \"../values/index.js\";\nimport { ObjectValue, StringValue } from \"../values/index.js\";\nimport { IsAnonymousFunctionDefinition, HasOwnProperty } from \"../methods/index.js\";\nimport { Environment, Functions, Properties } from \"../singletons.js\";\nimport invariant from \"../invariant.js\";\nimport type { BabelNodeVariableDeclaration } from \"@babel/types\";\n\n// ECMA262 13.3.1.4\nfunction letAndConst(\n  ast: BabelNodeVariableDeclaration,\n  strictCode: boolean,\n  env: LexicalEnvironment,\n  realm: Realm\n): Value {\n  for (let declar of ast.declarations) {\n    let Initializer = declar.init;\n    if (declar.id.type === \"Identifier\" && !Initializer) {\n      invariant(ast.kind !== \"const\", \"const without an initializer\");\n\n      // 1. Let lhs be ResolveBinding(StringValue of BindingIdentifier).\n      let bindingId = declar.id.name;\n      let lhs = Environment.ResolveBinding(realm, bindingId, strictCode);\n\n      // 2. Return InitializeReferencedBinding(lhs, undefined).\n      Environment.InitializeReferencedBinding(realm, lhs, realm.intrinsics.undefined);\n      continue;\n    } else if (declar.id.type === \"Identifier\" && Initializer) {\n      // 1. Let bindingId be StringValue of BindingIdentifier.\n      let bindingId = declar.id.name;\n\n      // 2. Let lhs be ResolveBinding(bindingId).\n      let lhs = Environment.ResolveBinding(realm, bindingId, strictCode);\n\n      // 3. Let rhs be the result of evaluating Initializer.\n      let rhs = env.evaluate(Initializer, strictCode);\n\n      // 4. Let value be ? GetValue(rhs).\n      let value = Environment.GetValue(realm, rhs);\n\n      // 5. If IsAnonymousFunctionDefinition(Initializer) is true, then\n      if (IsAnonymousFunctionDefinition(realm, Initializer)) {\n        invariant(value instanceof ObjectValue);\n\n        // a. Let hasNameProperty be ? HasOwnProperty(value, \"name\").\n        let hasNameProperty = HasOwnProperty(realm, value, \"name\");\n\n        // b. If hasNameProperty is false, perform SetFunctionName(value, bindingId).\n        if (!hasNameProperty) Functions.SetFunctionName(realm, value, new StringValue(realm, bindingId));\n      }\n\n      // 6. Return InitializeReferencedBinding(lhs, value).\n      Environment.InitializeReferencedBinding(realm, lhs, value);\n    } else if ((declar.id.type === \"ObjectPattern\" || declar.id.type === \"ArrayPattern\") && Initializer) {\n      // 1. Let rhs be the result of evaluating Initializer.\n      let rhs = env.evaluate(Initializer, strictCode);\n\n      // 2. Let rval be ? GetValue(rhs).\n      let rval = Environment.GetValue(realm, rhs);\n\n      // 3. Let env be the running execution context’s LexicalEnvironment.\n\n      // 4. Return the result of performing BindingInitialization for BindingPattern using value and env as the arguments.\n      Environment.BindingInitialization(realm, declar.id, rval, strictCode, env);\n    } else {\n      invariant(false, \"unrecognized declaration\");\n    }\n  }\n\n  return realm.intrinsics.empty;\n}\n\n// ECMA262 13.3.2.4\nexport default function(\n  ast: BabelNodeVariableDeclaration,\n  strictCode: boolean,\n  env: LexicalEnvironment,\n  realm: Realm\n): Value {\n  if (ast.kind === \"let\" || ast.kind === \"const\") {\n    return letAndConst(ast, strictCode, env, realm);\n  }\n\n  for (let declar of ast.declarations) {\n    let Initializer = declar.init;\n\n    if (declar.id.type === \"Identifier\" && !Initializer) {\n      // VariableDeclaration : BindingIdentifier\n\n      // 1. Return NormalCompletion(empty).\n      continue;\n    } else if (declar.id.type === \"Identifier\" && Initializer) {\n      // VariableDeclaration : BindingIdentifier Initializer\n\n      // 1. Let bindingId be StringValue of BindingIdentifier.\n      let bindingId = declar.id.name;\n\n      // 2. Let lhs be ? ResolveBinding(bindingId).\n      let lhs = Environment.ResolveBinding(realm, bindingId, strictCode);\n\n      // 3. Let rhs be the result of evaluating Initializer.\n      let rhs = env.evaluate(Initializer, strictCode);\n\n      // 4. Let value be ? GetValue(rhs).\n      let value = Environment.GetValue(realm, rhs);\n      if (declar.id && declar.id.name !== undefined) value.__originalName = bindingId;\n\n      // 5. If IsAnonymousFunctionDefinition(Initializer) is true, then\n      if (IsAnonymousFunctionDefinition(realm, Initializer)) {\n        invariant(value instanceof ObjectValue);\n\n        // a. Let hasNameProperty be ? HasOwnProperty(value, \"name\").\n        let hasNameProperty = HasOwnProperty(realm, value, \"name\");\n\n        // b. If hasNameProperty is false, perform SetFunctionName(value, bindingId).\n        if (!hasNameProperty) Functions.SetFunctionName(realm, value, new StringValue(realm, bindingId));\n      }\n\n      // 6. Return ? PutValue(lhs, value).\n      Properties.PutValue(realm, lhs, value);\n    } else if ((declar.id.type === \"ObjectPattern\" || declar.id.type === \"ArrayPattern\") && Initializer) {\n      // 1. Let rhs be the result of evaluating Initializer.\n      let rhs = env.evaluate(Initializer, strictCode);\n\n      // 2. Let rval be ? GetValue(rhs).\n      let rval = Environment.GetValue(realm, rhs);\n\n      // 3. Return the result of performing BindingInitialization for BindingPattern passing rval and undefined as arguments.\n      Environment.BindingInitialization(realm, declar.id, rval, strictCode, undefined);\n    } else {\n      invariant(false, \"unrecognized declaration\");\n    }\n  }\n\n  return realm.intrinsics.empty;\n}\n"
  },
  {
    "path": "src/evaluators/WhileStatement.js",
    "content": "/**\n * Copyright (c) 2017-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n/* @flow */\n\nimport type { Realm } from \"../realm.js\";\nimport type { LexicalEnvironment } from \"../environment.js\";\nimport { Value } from \"../values/index.js\";\nimport type { BabelNodeWhileStatement, BabelNode } from \"@babel/types\";\nimport invariant from \"../invariant.js\";\n\nexport default function(\n  ast: BabelNodeWhileStatement,\n  strictCode: boolean,\n  env: LexicalEnvironment,\n  realm: Realm,\n  labelSet: ?Array<string>\n): Value {\n  let r = env.evaluate(\n    (({\n      type: \"ForStatement\",\n      init: null,\n      test: ast.test,\n      update: null,\n      body: ast.body,\n    }: any): BabelNode),\n    strictCode,\n    labelSet\n  );\n  invariant(r instanceof Value);\n  return r;\n}\n"
  },
  {
    "path": "src/evaluators/WithStatement.js",
    "content": "/**\n * Copyright (c) 2017-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n/* @flow strict-local */\n\nimport type { Realm } from \"../realm.js\";\nimport { LexicalEnvironment, ObjectEnvironmentRecord } from \"../environment.js\";\nimport { CompilerDiagnostic, FatalError } from \"../errors.js\";\nimport { AbruptCompletion } from \"../completions.js\";\nimport { AbstractValue, ObjectValue, Value } from \"../values/index.js\";\nimport { UpdateEmpty } from \"../methods/index.js\";\nimport { Environment, To } from \"../singletons.js\";\nimport invariant from \"../invariant.js\";\nimport type { BabelNodeWithStatement } from \"@babel/types\";\n\n// ECMA262 13.11.7\nexport default function(\n  ast: BabelNodeWithStatement,\n  strictCode: boolean,\n  env: LexicalEnvironment,\n  realm: Realm\n): Value {\n  // 1. Let val be the result of evaluating Expression.\n  let val = env.evaluate(ast.object, strictCode);\n\n  // 2. Let obj be ? ToObject(? GetValue(val)).\n  val = Environment.GetValue(realm, val);\n  if (val instanceof AbstractValue || (val instanceof ObjectValue && val.isPartialObject())) {\n    let loc = ast.object.loc;\n    let error = new CompilerDiagnostic(\"with object must be a known value\", loc, \"PP0007\", \"RecoverableError\");\n    if (realm.handleError(error) === \"Fail\") throw new FatalError();\n  }\n  let obj = To.ToObject(realm, val);\n\n  // 3. Let oldEnv be the running execution context's LexicalEnvironment.\n  let oldEnv = env;\n\n  // 4. Let newEnv be NewObjectEnvironment(obj, oldEnv).\n  let newEnv = Environment.NewObjectEnvironment(realm, obj, oldEnv);\n\n  // 5. Set the withEnvironment flag of newEnv's EnvironmentRecord to true.\n  invariant(newEnv.environmentRecord instanceof ObjectEnvironmentRecord);\n  newEnv.environmentRecord.withEnvironment = true;\n\n  // 6. Set the running execution context's LexicalEnvironment to newEnv.\n  realm.getRunningContext().lexicalEnvironment = newEnv;\n\n  try {\n    // 7. Let C be the result of evaluating Statement.\n    let C = newEnv.evaluateCompletion(ast.body, strictCode);\n    invariant(C instanceof Value || C instanceof AbruptCompletion);\n\n    // 9. Return Completion(UpdateEmpty(C, undefined)).\n    let res = UpdateEmpty(realm, C, realm.intrinsics.undefined);\n    if (res instanceof AbruptCompletion) throw res;\n    invariant(res instanceof Value);\n    return res;\n  } finally {\n    // 8. Set the running execution context's LexicalEnvironment to oldEnv.\n    realm.getRunningContext().lexicalEnvironment = oldEnv;\n    realm.onDestroyScope(newEnv);\n  }\n}\n"
  },
  {
    "path": "src/evaluators/YieldExpression.js",
    "content": "/**\n * Copyright (c) 2017-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n/* @flow strict-local */\n\nimport type { Realm } from \"../realm.js\";\nimport type { LexicalEnvironment } from \"../environment.js\";\nimport { FatalError } from \"../errors.js\";\nimport type { Value } from \"../values/index.js\";\nimport type { BabelNodeYieldExpression } from \"@babel/types\";\n\nexport default function(\n  ast: BabelNodeYieldExpression,\n  strictCode: boolean,\n  env: LexicalEnvironment,\n  realm: Realm\n): Value {\n  throw new FatalError(\"TODO: #712 YieldExpression\");\n}\n"
  },
  {
    "path": "src/evaluators/index.js",
    "content": "/**\n * Copyright (c) 2017-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n/* @flow strict-local */\n\nexport { default as ArrayExpression } from \"./ArrayExpression.js\";\nexport { default as ArrowFunctionExpression } from \"./ArrowFunctionExpression.js\";\nexport { default as AssignmentExpression } from \"./AssignmentExpression.js\";\nexport { default as AwaitExpression } from \"./AwaitExpression.js\";\nexport { default as BinaryExpression } from \"./BinaryExpression.js\";\nexport { default as BlockStatement } from \"./BlockStatement.js\";\nexport { default as BooleanLiteral } from \"./BooleanLiteral.js\";\nexport { default as BreakStatement } from \"./BreakStatement.js\";\nexport { default as CallExpression } from \"./CallExpression.js\";\nexport { default as CatchClause } from \"./CatchClause.js\";\nexport { default as ClassExpression } from \"./ClassExpression.js\";\nexport { default as ClassDeclaration } from \"./ClassDeclaration.js\";\nexport { default as ConditionalExpression } from \"./ConditionalExpression.js\";\nexport { default as ContinueStatement } from \"./ContinueStatement.js\";\nexport { default as Directive } from \"./Directive.js\";\nexport { default as DirectiveLiteral } from \"./DirectiveLiteral.js\";\nexport { default as DoExpression } from \"./DoExpression.js\";\nexport { default as DoWhileStatement } from \"./DoWhileStatement.js\";\nexport { default as EmptyStatement } from \"./EmptyStatement.js\";\nexport { default as ExpressionStatement } from \"./ExpressionStatement.js\";\nexport { default as File } from \"./File.js\";\nexport { default as ForInStatement } from \"./ForInStatement.js\";\nexport { default as ForOfStatement } from \"./ForOfStatement.js\";\nexport { default as ForStatement } from \"./ForStatement.js\";\nexport { default as FunctionDeclaration } from \"./FunctionDeclaration.js\";\nexport { default as FunctionExpression } from \"./FunctionExpression.js\";\nexport { default as Identifier } from \"./Identifier.js\";\nexport { evaluate as IfStatement } from \"./IfStatement.js\";\nexport { default as LabeledStatement } from \"./LabeledStatement.js\";\nexport { default as LogicalExpression } from \"./LogicalExpression.js\";\nexport { default as MemberExpression } from \"./MemberExpression.js\";\nexport { default as MetaProperty } from \"./MetaProperty.js\";\nexport { default as NewExpression } from \"./NewExpression.js\";\nexport { default as NullLiteral } from \"./NullLiteral.js\";\nexport { default as NumericLiteral } from \"./NumericLiteral.js\";\nexport { default as ObjectExpression } from \"./ObjectExpression.js\";\nexport { default as Program } from \"./Program.js\";\nexport { default as RegExpLiteral } from \"./RegExpLiteral.js\";\nexport { default as ReturnStatement } from \"./ReturnStatement.js\";\nexport { default as SequenceExpression } from \"./SequenceExpression.js\";\nexport { default as StringLiteral } from \"./StringLiteral.js\";\nexport { default as SwitchStatement } from \"./SwitchStatement.js\";\nexport { default as TaggedTemplateExpression } from \"./TaggedTemplateExpression.js\";\nexport { default as TemplateLiteral } from \"./TemplateLiteral.js\";\nexport { default as ThisExpression } from \"./ThisExpression.js\";\nexport { default as ThrowStatement } from \"./ThrowStatement.js\";\nexport { default as TryStatement } from \"./TryStatement.js\";\nexport { default as UnaryExpression } from \"./UnaryExpression.js\";\nexport { default as UpdateExpression } from \"./UpdateExpression.js\";\nexport { default as VariableDeclaration } from \"./VariableDeclaration.js\";\nexport { default as WhileStatement } from \"./WhileStatement.js\";\nexport { default as WithStatement } from \"./WithStatement.js\";\nexport { default as YieldExpression } from \"./YieldExpression.js\";\nexport { default as JSXElement } from \"./JSXElement.js\";\n"
  },
  {
    "path": "src/globals.js",
    "content": "/**\n * Copyright (c) 2017-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n/* @flow strict-local */\n\nimport type { Realm } from \"./realm.js\";\nimport initializePrepackGlobals from \"./intrinsics/prepack/global.js\";\nimport initializeDOMGlobals from \"./intrinsics/dom/global.js\";\nimport initializeReactNativeGlobals from \"./intrinsics/react-native/global.js\";\nimport initializeReactMocks from \"./intrinsics/fb-www/global.js\";\n\nexport default function(realm: Realm): Realm {\n  initializePrepackGlobals(realm);\n  if (realm.isCompatibleWith(\"browser\")) {\n    initializeDOMGlobals(realm);\n  }\n  if (realm.isCompatibleWith(\"fb-www\") || realm.isCompatibleWith(\"node-react\")) {\n    initializeDOMGlobals(realm);\n    initializeReactMocks(realm);\n  }\n  if (realm.isCompatibleWith(realm.MOBILE_JSC_VERSION) || realm.isCompatibleWith(\"mobile\")) {\n    initializeReactNativeGlobals(realm);\n  }\n  return realm;\n}\n"
  },
  {
    "path": "src/initialize-singletons.js",
    "content": "/**\n * Copyright (c) 2017-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n/* @flow */\n\nimport * as Singletons from \"./singletons.js\";\nimport { CreateImplementation } from \"./methods/create.js\";\nimport { EnvironmentImplementation } from \"./methods/environment.js\";\nimport { FunctionImplementation } from \"./methods/function.js\";\nimport { LeakImplementation, MaterializeImplementation } from \"./utils/leak.js\";\nimport { ReachabilityImplementation } from \"./utils/reachability.js\";\nimport { JoinImplementation } from \"./methods/join.js\";\nimport { PathConditionsImplementation, PathImplementation } from \"./utils/paths.js\";\nimport { PropertiesImplementation } from \"./methods/properties.js\";\nimport { ToImplementation } from \"./methods/to.js\";\nimport { WidenImplementation } from \"./methods/widen.js\";\nimport { concretize } from \"./utils/ConcreteModelConverter.js\";\nimport { DebugReproManagerImplementation } from \"./utils/DebugReproManager.js\";\nimport { PathConditions } from \"./types\";\nimport * as utils from \"./utils.js\";\n\nexport default function() {\n  Singletons.setCreate(new CreateImplementation());\n  Singletons.setEnvironment(new EnvironmentImplementation());\n  Singletons.setFunctions(new FunctionImplementation());\n  Singletons.setLeak(new LeakImplementation());\n  Singletons.setMaterialize(new MaterializeImplementation());\n  Singletons.setReachability(new ReachabilityImplementation());\n  Singletons.setJoin(new JoinImplementation());\n  Singletons.setPath(new PathImplementation());\n  Singletons.setPathConditions((val: PathConditions | void) => new PathConditionsImplementation(val));\n  Singletons.setProperties((new PropertiesImplementation(): any));\n  Singletons.setTo((new ToImplementation(): any));\n  Singletons.setWiden((new WidenImplementation(): any));\n  Singletons.setConcretize(concretize);\n  Singletons.setUtils(utils);\n  Singletons.setDebugReproManager((new DebugReproManagerImplementation(): any));\n}\n"
  },
  {
    "path": "src/intrinsics/common/console.js",
    "content": "/**\n * Copyright (c) 2017-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n/* @flow strict-local */\n\nimport type { Realm } from \"../../realm.js\";\nimport { ObjectValue } from \"../../values/index.js\";\n\nconst consoleMethods = [\n  \"assert\",\n  \"clear\",\n  \"count\",\n  \"dir\",\n  \"dirxml\",\n  \"error\",\n  \"group\",\n  \"groupCollapsed\",\n  \"groupEnd\",\n  \"info\",\n  \"log\",\n  \"table\",\n  \"time\",\n  \"timeEnd\",\n  \"trace\",\n  \"warn\",\n];\n\nexport default function(realm: Realm): ObjectValue {\n  let obj = new ObjectValue(realm, realm.intrinsics.ObjectPrototype, \"console\");\n\n  for (let method of consoleMethods) {\n    obj.defineNativeMethod(method, 0, (context, args) => {\n      realm.outputToConsole(method, args);\n      return realm.intrinsics.undefined;\n    });\n  }\n\n  obj.defineNativeMethod(\"time\", 0, (context, args) => {\n    realm.outputToConsole(\"time\", args);\n    return realm.intrinsics.undefined;\n  });\n\n  obj.defineNativeMethod(\"timeEnd\", 0, (context, args) => {\n    realm.outputToConsole(\"timeEnd\", args);\n    return realm.intrinsics.undefined;\n  });\n\n  return obj;\n}\n"
  },
  {
    "path": "src/intrinsics/dom/document.js",
    "content": "/**\n * Copyright (c) 2017-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n/* @flow strict-local */\n\nimport type { Realm } from \"../../realm.js\";\nimport { ObjectValue, AbstractObjectValue } from \"../../values/index.js\";\nimport { createAbstract } from \"../prepack/utils.js\";\nimport { Properties } from \"../../singletons.js\";\nimport invariant from \"../../invariant\";\n\nconst functions = [\n  \"getElementById\",\n  \"getElementByTag\",\n  \"getElementByClassName\",\n  \"getElementByName\",\n  \"getElementByTagName\",\n  \"getElementByTagNameNS\",\n  \"querySelector\",\n  \"querySelectorAll\",\n  \"createElement\",\n  \"createDocumentFragment\",\n  \"createTextNode\",\n];\n\nexport default function(realm: Realm): AbstractObjectValue {\n  // document object\n  let document = new ObjectValue(realm, realm.intrinsics.ObjectPrototype, \"document\", false);\n\n  // check if we can use abstracts\n  if (realm.useAbstractInterpretation) {\n    // common methods on document\n    for (let name of functions) {\n      let func = createAbstract(realm, \"function\", `document.${name}`);\n      Properties.Set(realm, document, name, func, false);\n    }\n\n    // document.body\n    let body = new ObjectValue(realm, realm.intrinsics.ObjectPrototype, \"document.body\");\n    Properties.Set(realm, document, \"body\", body, false);\n\n    // make abstract\n    let abstractObject = createAbstract(realm, document, \"document\");\n    invariant(abstractObject instanceof AbstractObjectValue);\n    return abstractObject;\n  }\n  return document;\n}\n"
  },
  {
    "path": "src/intrinsics/dom/global.js",
    "content": "/**\n * Copyright (c) 2017-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n/* @flow strict-local */\n\nimport type { Realm } from \"../../realm.js\";\n\nimport { FunctionValue, NativeFunctionValue } from \"../../values/index.js\";\nimport initializeDocument from \"./document.js\";\nimport initializeConsole from \"../common/console.js\";\nimport { FatalError } from \"../../errors.js\";\nimport invariant from \"../../invariant.js\";\nimport { TypesDomain, ValuesDomain } from \"../../domains/index.js\";\nimport { PropertyDescriptor } from \"../../descriptors.js\";\n\nexport default function(realm: Realm): void {\n  let global = realm.$GlobalObject;\n\n  if (!realm.isCompatibleWith(realm.MOBILE_JSC_VERSION) && !realm.isCompatibleWith(\"mobile\"))\n    global.$DefineOwnProperty(\n      \"console\",\n      new PropertyDescriptor({\n        value: initializeConsole(realm),\n        writable: true,\n        enumerable: false,\n        configurable: true,\n      })\n    );\n\n  global.$DefineOwnProperty(\n    \"self\",\n    new PropertyDescriptor({\n      value: global,\n      writable: true,\n      enumerable: true,\n      configurable: true,\n    })\n  );\n\n  global.$DefineOwnProperty(\n    \"window\",\n    new PropertyDescriptor({\n      value: global,\n      writable: true,\n      enumerable: true,\n      configurable: true,\n    })\n  );\n\n  global.$DefineOwnProperty(\n    \"document\",\n    new PropertyDescriptor({\n      value: initializeDocument(realm),\n      writable: true,\n      enumerable: false,\n      configurable: true,\n    })\n  );\n\n  global.$DefineOwnProperty(\n    \"setTimeout\",\n    new PropertyDescriptor({\n      value: new NativeFunctionValue(realm, \"global.setTimeout\", \"\", 2, (context, args) => {\n        let callback = args[0].throwIfNotConcrete();\n        if (!(callback instanceof FunctionValue))\n          throw realm.createErrorThrowCompletion(realm.intrinsics.TypeError, \"callback arguments must be function\");\n        if (!realm.useAbstractInterpretation) throw new FatalError(\"TODO #1003: implement global.setTimeout\");\n        invariant(realm.generator !== undefined);\n        let generator = realm.generator;\n        return generator.emitCallAndCaptureResult(TypesDomain.topVal, ValuesDomain.topVal, \"global.setTimeout\", args);\n      }),\n      writable: true,\n      enumerable: true,\n      configurable: true,\n    })\n  );\n\n  global.$DefineOwnProperty(\n    \"clearTimeout\",\n    new PropertyDescriptor({\n      value: new NativeFunctionValue(realm, \"global.clearTimeout\", \"\", 2, (context, args) => {\n        if (!realm.useAbstractInterpretation) throw new FatalError(\"TODO #1003: implement global.clearTimeout\");\n        invariant(realm.generator !== undefined);\n        let generator = realm.generator;\n        generator.emitCall(\"global.clearTimeout\", args);\n        return realm.intrinsics.undefined;\n      }),\n      writable: true,\n      enumerable: true,\n      configurable: true,\n    })\n  );\n\n  global.$DefineOwnProperty(\n    \"setInterval\",\n    new PropertyDescriptor({\n      value: new NativeFunctionValue(realm, \"global.setInterval\", \"\", 2, (context, args) => {\n        if (!realm.useAbstractInterpretation) throw new FatalError(\"TODO #1003: implement global.setInterval\");\n        let callback = args[0].throwIfNotConcrete();\n        if (!(callback instanceof FunctionValue))\n          throw realm.createErrorThrowCompletion(realm.intrinsics.TypeError, \"callback arguments must be function\");\n        invariant(realm.generator !== undefined);\n        let generator = realm.generator;\n        return generator.emitCallAndCaptureResult(TypesDomain.topVal, ValuesDomain.topVal, \"global.setInterval\", args);\n      }),\n      writable: true,\n      enumerable: true,\n      configurable: true,\n    })\n  );\n\n  global.$DefineOwnProperty(\n    \"clearInterval\",\n    new PropertyDescriptor({\n      value: new NativeFunctionValue(realm, \"global.clearInterval\", \"\", 2, (context, args) => {\n        if (!realm.useAbstractInterpretation) throw new FatalError(\"TODO #1003: implement global.clearInterval\");\n        invariant(realm.generator !== undefined);\n        let generator = realm.generator;\n        generator.emitCall(\"global.clearInterval\", args);\n        return realm.intrinsics.undefined;\n      }),\n      writable: true,\n      enumerable: true,\n      configurable: true,\n    })\n  );\n}\n"
  },
  {
    "path": "src/intrinsics/dom/setInterval.js",
    "content": ""
  },
  {
    "path": "src/intrinsics/dom/setTimeout.js",
    "content": ""
  },
  {
    "path": "src/intrinsics/ecma262/Array.js",
    "content": "/**\n * Copyright (c) 2017-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n/* @flow */\n\nimport type { Realm } from \"../../realm.js\";\nimport { AbruptCompletion } from \"../../completions.js\";\nimport {\n  AbstractValue,\n  ArrayValue,\n  BooleanValue,\n  NativeFunctionValue,\n  NumberValue,\n  ObjectValue,\n  StringValue,\n  UndefinedValue,\n} from \"../../values/index.js\";\nimport {\n  Construct,\n  Call,\n  Get,\n  GetPrototypeFromConstructor,\n  GetMethod,\n  IsArray,\n  IsConstructor,\n  IsCallable,\n} from \"../../methods/index.js\";\nimport { GetIterator, IteratorClose, IteratorStep, IteratorValue } from \"../../methods/iterator.js\";\nimport { Create, Leak, Properties, To } from \"../../singletons.js\";\nimport invariant from \"../../invariant.js\";\nimport { createOperationDescriptor } from \"../../utils/generator.js\";\n\nexport default function(realm: Realm): NativeFunctionValue {\n  let func = new NativeFunctionValue(realm, \"Array\", \"Array\", 1, (context, [...items], argCount, NewTarget) => {\n    if (argCount === 0) {\n      // 1. Let numberOfArgs be the number of arguments passed to this function call.\n      let numberOfArgs = argCount;\n\n      // 2. Assert: numberOfArgs = 0.\n      invariant(numberOfArgs === 0, \"numberOfArgs = 0\");\n\n      // 3. If NewTarget is undefined, let newTarget be the active function object, else let newTarget be NewTarget.\n      let newTarget = NewTarget === undefined ? func : NewTarget;\n\n      // 4. Let proto be ? GetPrototypeFromConstructor(newTarget, \"%ArrayPrototype%\").\n      let proto = GetPrototypeFromConstructor(realm, newTarget, \"ArrayPrototype\");\n\n      // 5. Return ArrayCreate(0, proto).\n      return Create.ArrayCreate(realm, 0, proto);\n    } else if (argCount === 1) {\n      // 1. Let numberOfArgs be the number of arguments passed to this function call.\n      let numberOfArgs = argCount;\n\n      // 2. Assert: numberOfArgs = 1.\n      invariant(numberOfArgs === 1, \"numberOfArgs = 1\");\n\n      // 3. If NewTarget is undefined, let newTarget be the active function object, else let newTarget be NewTarget.\n      let newTarget = NewTarget === undefined ? func : NewTarget;\n\n      // 4. Let proto be ? GetPrototypeFromConstructor(newTarget, \"%ArrayPrototype%\").\n      let proto = GetPrototypeFromConstructor(realm, newTarget, \"ArrayPrototype\");\n\n      // 5. Let array be ArrayCreate(0, proto).\n      let array = Create.ArrayCreate(realm, 0, proto);\n\n      // 6. If Type(len) is not Number, then\n      let len = items[0];\n      invariant(len !== undefined);\n      let intLen;\n      if (!len.mightBeNumber()) {\n        // a. Let defineStatus be CreateDataProperty(array, \"0\", len).\n        let defineStatus = Create.CreateDataProperty(realm, array, \"0\", len);\n\n        // b. Assert: defineStatus is true.\n        invariant(defineStatus, \"defineStatus is true\");\n\n        // c. Let intLen be 1.\n        intLen = 1;\n      } else {\n        // 7. Else,\n\n        // a. Let intLen be ToUint32(len).\n        intLen = To.ToUint32(realm, len.throwIfNotConcreteNumber());\n        invariant(len instanceof NumberValue);\n\n        // b If intLen ≠ len, throw a RangeError exception.\n        if (intLen !== len.value) {\n          throw realm.createErrorThrowCompletion(realm.intrinsics.RangeError, \"intLen ≠ len\");\n        }\n      }\n\n      // 8. Perform ! Set(array, \"length\", intLen, true).\n      Properties.Set(realm, array, \"length\", new NumberValue(realm, intLen), true);\n\n      // 9. Return array.\n      return array;\n    } else {\n      // 1. Let numberOfArgs be the number of arguments passed to this function call.\n      let numberOfArgs = argCount;\n\n      // 2. Assert: numberOfArgs ≥ 2.\n      invariant(numberOfArgs >= 2, \"numberOfArgs >= 2\");\n\n      // 3. If NewTarget is undefined, let newTarget be the active function object, else let newTarget be NewTarget.\n      let newTarget = NewTarget === undefined ? func : NewTarget;\n\n      // 4. Let proto be ? GetPrototypeFromConstructor(newTarget, \"%ArrayPrototype%\").\n      let proto = GetPrototypeFromConstructor(realm, newTarget, \"ArrayPrototype\");\n\n      // 5. Let array be ? ArrayCreate(numberOfArgs, proto).\n      let array = Create.ArrayCreate(realm, numberOfArgs, proto);\n\n      // 6. Let k be 0.\n      let k = 0;\n\n      // 7. Let items be a zero-origined List containing the argument items in order.\n      items;\n\n      // 8. Repeat, while k < numberOfArgs\n      while (k < numberOfArgs) {\n        // a. Let Pk be ! ToString(k).\n        let Pk = To.ToString(realm, new NumberValue(realm, k));\n\n        // b. Let itemK be items[k].\n        let itemK = items[k];\n        invariant(itemK !== undefined);\n\n        // c. Let defineStatus be CreateDataProperty(array, Pk, itemK).\n        let defineStatus = Create.CreateDataProperty(realm, array, Pk, itemK);\n\n        // d. Assert: defineStatus is true.\n        invariant(defineStatus, \"defineStatus is true\");\n\n        // e. Increase k by 1.\n        k += 1;\n      }\n\n      // 9. Assert: the value of array's length property is numberOfArgs.\n      let length = Get(realm, array, \"length\").throwIfNotConcrete();\n      invariant(length instanceof NumberValue);\n      invariant(length.value === numberOfArgs, \"the value of array's length property is numberOfArgs\");\n\n      // 10. Return array.\n      return array;\n    }\n  });\n\n  // ECMA262 22.1.2.2\n  func.defineNativeMethod(\"isArray\", 1, (context, [arg]) => {\n    // 1. Return ? IsArray(arg).\n    return new BooleanValue(realm, IsArray(realm, arg));\n  });\n\n  // ECMA262 22.1.2.3\n  if (!realm.isCompatibleWith(realm.MOBILE_JSC_VERSION) && !realm.isCompatibleWith(\"mobile\"))\n    func.defineNativeMethod(\"of\", 0, (context, [...items], argCount) => {\n      // 1. Let len be the actual number of arguments passed to this function.\n      let len = argCount;\n\n      // 2. Let items be the List of arguments passed to this function.\n      items;\n\n      // 3. Let C be the this value.\n      let C = context;\n\n      // 4. If IsConstructor(C) is true, then\n      let A;\n      if (IsConstructor(realm, C)) {\n        invariant(C instanceof ObjectValue);\n        // a. Let A be ? Construct(C, « len »).\n        A = Construct(realm, C, [new NumberValue(realm, len)]);\n      } else {\n        // 5. Else,\n        // a. Let A be ? ArrayCreate(len).\n        A = Create.ArrayCreate(realm, len);\n      }\n\n      // 6. Let k be 0.\n      let k = 0;\n\n      // 7. Repeat, while k < len\n      while (k < len) {\n        // a. Let kValue be items[k].\n        let kValue = items[k];\n\n        // b. Let Pk be ! To.ToString(k).\n        let Pk = To.ToString(realm, new NumberValue(realm, k));\n\n        // c. Perform ? CreateDataPropertyOrThrow(A, Pk, kValue).\n        Create.CreateDataPropertyOrThrow(realm, A, Pk, kValue);\n\n        // d. Increase k by 1.\n        k += 1;\n      }\n\n      // 8. Perform ? Set(A, \"length\", len, true).\n      Properties.Set(realm, A, \"length\", new NumberValue(realm, len), true);\n\n      // 9. Return A.\n      return A;\n    });\n\n  // ECMA262 22.1.2.1\n  if (!realm.isCompatibleWith(realm.MOBILE_JSC_VERSION) && !realm.isCompatibleWith(\"mobile\")) {\n    let arrayFrom = func.defineNativeMethod(\"from\", 1, (context, [items, mapfn, thisArg], argCount) => {\n      // 1. Let C be the this value.\n      let C = context;\n\n      let mapping, T;\n      // 2. If mapfn is undefined, let mapping be false.\n      if (!mapfn || mapfn instanceof UndefinedValue) {\n        mapping = false;\n      } else if (mapfn.mightBeUndefined()) {\n        invariant(mapfn instanceof AbstractValue);\n        mapfn.throwIfNotConcrete();\n      } else {\n        // 3. Else,\n        // a. If IsCallable(mapfn) is false, throw a TypeError exception.\n        if (IsCallable(realm, mapfn) === false) {\n          mapfn.throwIfNotConcrete();\n          throw realm.createErrorThrowCompletion(realm.intrinsics.TypeError, \"IsCallable(mapfn) is false\");\n        }\n\n        // b. If thisArg was supplied, let T be thisArg; else let T be undefined.\n        T = thisArg !== undefined ? thisArg : realm.intrinsics.undefined;\n\n        // c. Let mapping be true.\n        mapping = true;\n      }\n      // If we're in pure scope and the items are completely abstract,\n      // then create an abstract temporal with an array kind\n      if (realm.isInPureScope() && items instanceof AbstractValue && items.values.isTop()) {\n        let args = [arrayFrom, items];\n        let possibleNestedOptimizedFunctions;\n        if (mapfn) {\n          args.push(mapfn);\n          if (thisArg) {\n            args.push(thisArg);\n          }\n          possibleNestedOptimizedFunctions = [\n            { func: mapfn, thisValue: thisArg || realm.intrinsics.undefined, kind: \"map\" },\n          ];\n        }\n        Leak.value(realm, items);\n        return ArrayValue.createTemporalWithWidenedNumericProperty(\n          realm,\n          args,\n          createOperationDescriptor(\"UNKNOWN_ARRAY_METHOD_CALL\"),\n          possibleNestedOptimizedFunctions\n        );\n      }\n\n      // 4. Let usingIterator be ? GetMethod(items, @@iterator).\n      let usingIterator = GetMethod(realm, items, realm.intrinsics.SymbolIterator);\n\n      // 5. If usingIterator is not undefined, then\n      if (!usingIterator.mightBeUndefined()) {\n        let A;\n        // a. If IsConstructor(C) is true, then\n        if (IsConstructor(realm, C)) {\n          invariant(C instanceof ObjectValue);\n          // i. Let A be ? Construct(C).\n          A = Construct(realm, C);\n        } else {\n          // b. Else,\n          // i. Let A be ArrayCreate(0).\n          A = Create.ArrayCreate(realm, 0);\n        }\n\n        // c. Let iterator be ? GetIterator(items, usingIterator).\n        let iterator = GetIterator(realm, items, usingIterator);\n\n        // d. Let k be 0.\n        let k = 0;\n\n        // e. Repeat\n        while (true) {\n          // i. If k ≥ 2^53-1, then\n          if (k >= Math.pow(2, 53) - 1) {\n            // 1. Let error be Completion{[[Type]]: throw, [[Value]]: a newly created TypeError object, [[Target]]: empty}.\n            let error = realm.createErrorThrowCompletion(realm.intrinsics.TypeError, \"k >= 2^53 - 1\");\n\n            // 2. Return ? IteratorClose(iterator, error).\n            throw IteratorClose(realm, iterator, error);\n          }\n\n          // ii. Let Pk be ! ToString(k).\n          let Pk = To.ToString(realm, new NumberValue(realm, k));\n\n          // iii. Let next be ? IteratorStep(iterator).\n          let next = IteratorStep(realm, iterator);\n\n          // iv. If next is false, then\n          if (next === false) {\n            // 1. Perform ? Set(A, \"length\", k, true).\n            Properties.Set(realm, A, \"length\", new NumberValue(realm, k), true);\n\n            // 2. Return A.\n            return A;\n          }\n\n          // v. Let nextValue be ? IteratorValue(next).\n          let nextValue = IteratorValue(realm, next);\n\n          let mappedValue;\n          // vi. If mapping is true, then\n          if (mapping === true) {\n            // 1. Let mappedValue be Call(mapfn, T, « nextValue, k »).\n            try {\n              invariant(T !== undefined);\n              mappedValue = Call(realm, mapfn, T, [nextValue, new NumberValue(realm, k)]);\n            } catch (mappedValueCompletion) {\n              if (mappedValueCompletion instanceof AbruptCompletion) {\n                // 2. If mappedValue is an abrupt completion, return ? IteratorClose(iterator, mappedValue).\n                throw IteratorClose(realm, iterator, mappedValueCompletion);\n              } else {\n                throw mappedValueCompletion;\n              }\n            }\n            // 3. Let mappedValue be mappedValue.[[Value]].\n          } else {\n            // vii. Else, let mappedValue be nextValue.\n            mappedValue = nextValue;\n          }\n\n          // viii. Let defineStatus be CreateDataPropertyOrThrow(A, Pk, mappedValue).\n          try {\n            Create.CreateDataPropertyOrThrow(realm, A, Pk, mappedValue);\n          } catch (completion) {\n            if (completion instanceof AbruptCompletion) {\n              // ix. If defineStatus is an abrupt completion, return ? IteratorClose(iterator, defineStatus).\n              throw IteratorClose(realm, iterator, completion);\n            } else throw completion;\n          }\n\n          // x. Increase k by 1.\n          k = k + 1;\n        }\n      } else {\n        usingIterator.throwIfNotConcrete();\n      }\n\n      // 6. NOTE: items is not an Iterable so assume it is an array-like object.\n      items = items.throwIfNotConcrete();\n      invariant(items instanceof ObjectValue);\n\n      // 7. Let arrayLike be ! ToObject(items).\n      let arrayLike = To.ToObject(realm, items);\n\n      // 8. Let len be ? ToLength(? Get(arrayLike, \"length\")).\n      let len = To.ToLength(realm, Get(realm, arrayLike, \"length\"));\n\n      let A;\n      // 9. If IsConstructor(C) is true, then\n      if (IsConstructor(realm, C)) {\n        invariant(C instanceof ObjectValue);\n        // a. Let A be ? Construct(C, « len »).\n        A = Construct(realm, C, [new NumberValue(realm, len)]);\n      } else {\n        // 10. Else,\n        // a. Let A be ? ArrayCreate(len).\n        A = Create.ArrayCreate(realm, len);\n      }\n\n      // 11. Let k be 0.\n      let k = 0;\n\n      // 12. Repeat, while k < len\n      while (k < len) {\n        // a. Let Pk be ! ToString(k).\n        let Pk = To.ToString(realm, new NumberValue(realm, k));\n\n        // b. Let kValue be ? Get(arrayLike, Pk).\n        let kValue = Get(realm, arrayLike, Pk);\n\n        let mappedValue;\n        // c. If mapping is true, then\n        if (mapping === true) {\n          // i. Let mappedValue be ? Call(mapfn, T, « kValue, k »).\n          invariant(T !== undefined);\n          mappedValue = Call(realm, mapfn, T, [kValue, new NumberValue(realm, k)]);\n        } else {\n          // d. Else, let mappedValue be kValue.\n          mappedValue = kValue;\n        }\n\n        // e. Perform ? CreateDataPropertyOrThrow(A, Pk, mappedValue).\n        Create.CreateDataPropertyOrThrow(realm, A, new StringValue(realm, Pk), mappedValue);\n\n        // f. Increase k by 1.\n        k = k + 1;\n      }\n\n      // 13. Perform ? Set(A, \"length\", len, true).\n      Properties.Set(realm, A, \"length\", new NumberValue(realm, len), true);\n\n      // 14. Return A.\n      return A;\n    });\n  }\n\n  // ECMA262 22.1.2.5\n  func.defineNativeGetter(realm.intrinsics.SymbolSpecies, context => {\n    // 1. Return the this value\n    return context;\n  });\n\n  return func;\n}\n"
  },
  {
    "path": "src/intrinsics/ecma262/ArrayBuffer.js",
    "content": "/**\n * Copyright (c) 2017-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n/* @flow strict-local */\n\nimport type { Realm } from \"../../realm.js\";\nimport { NativeFunctionValue } from \"../../values/index.js\";\nimport { To } from \"../../singletons.js\";\nimport { AllocateArrayBuffer } from \"../../methods/arraybuffer.js\";\n\nexport default function(realm: Realm): NativeFunctionValue {\n  // ECMA262 24.1.2.1\n  let func = new NativeFunctionValue(\n    realm,\n    \"ArrayBuffer\",\n    \"ArrayBuffer\",\n    1,\n    (context, [length], argCount, NewTarget) => {\n      // 1. If NewTarget is undefined, throw a TypeError exception.\n      if (!NewTarget) {\n        throw realm.createErrorThrowCompletion(realm.intrinsics.TypeError);\n      }\n\n      // 2. Let byteLength be ToIndex(numberLength).\n      let byteLength = To.ToIndexPartial(realm, length);\n\n      // 3. Return ? AllocateArrayBuffer(NewTarget, byteLength).\n      return AllocateArrayBuffer(realm, NewTarget, byteLength);\n    }\n  );\n\n  // ECMA262 24.1.3.1\n  func.defineNativeMethod(\"isView\", 1, (context, [_arg]) => {\n    let arg = _arg;\n    // 1. If Type(arg) is not Object, return false.\n    if (!arg.mightBeObject()) return realm.intrinsics.false;\n\n    // 2. If arg has a [[ViewedArrayBuffer]] internal slot, return true.\n    arg = arg.throwIfNotConcreteObject();\n    if (\"$ViewedArrayBuffer\" in arg) return realm.intrinsics.true;\n\n    // 3. Return false.\n    return realm.intrinsics.false;\n  });\n\n  // ECMA262 24.1.3.3\n  func.defineNativeGetter(realm.intrinsics.SymbolSpecies, context => {\n    // 1. Return the this value\n    return context;\n  });\n\n  return func;\n}\n"
  },
  {
    "path": "src/intrinsics/ecma262/ArrayBufferPrototype.js",
    "content": "/**\n * Copyright (c) 2017-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n/* @flow strict-local */\n\nimport type { Realm } from \"../../realm.js\";\nimport { ObjectValue, StringValue, NumberValue, UndefinedValue } from \"../../values/index.js\";\nimport { Construct, CopyDataBlockBytes, IsDetachedBuffer, SameValue, SpeciesConstructor } from \"../../methods/index.js\";\nimport { To } from \"../../singletons.js\";\nimport invariant from \"../../invariant.js\";\n\nexport default function(realm: Realm, obj: ObjectValue): void {\n  // ECMA262 24.1.4.1\n  obj.defineNativeGetter(\"byteLength\", context => {\n    // 1. Let O be the this value.\n    let O = context.throwIfNotConcrete();\n\n    // 2. If Type(O) is not Object, throw a TypeError exception.\n    if (!(O instanceof ObjectValue)) {\n      throw realm.createErrorThrowCompletion(realm.intrinsics.TypeError, \"Type(O) is not Object\");\n    }\n\n    // 3. If O does not have an [[ArrayBufferData]] internal slot, throw a TypeError exception.\n    if (!(\"$ArrayBufferData\" in O)) {\n      throw realm.createErrorThrowCompletion(\n        realm.intrinsics.TypeError,\n        \"O does not have an [[ArrayBufferData]] internal slot\"\n      );\n    }\n\n    // 4. If IsDetachedBuffer(O) is true, throw a TypeError exception.\n    if (IsDetachedBuffer(realm, O) === true) {\n      throw realm.createErrorThrowCompletion(realm.intrinsics.TypeError, \"IsDetachedBuffer(O) is true\");\n    }\n\n    // 5. Let length be O.[[ArrayBufferByteLength]].\n    let length = O.$ArrayBufferByteLength;\n    invariant(typeof length === \"number\");\n\n    // 6. Return length.\n    return new NumberValue(realm, length);\n  });\n\n  // ECMA262 24.1.4.3\n  obj.defineNativeMethod(\"slice\", 2, (context, [start, end]) => {\n    // 1. Let O be the this value.\n    let O = context.throwIfNotConcrete();\n\n    // 2. If Type(O) is not Object, throw a TypeError exception.\n    if (!(O instanceof ObjectValue)) {\n      throw realm.createErrorThrowCompletion(realm.intrinsics.TypeError, \"Type(O) is not Object\");\n    }\n\n    // 3. If O does not have an [[ArrayBufferData]] internal slot, throw a TypeError exception.\n    if (!(\"$ArrayBufferData\" in O)) {\n      throw realm.createErrorThrowCompletion(\n        realm.intrinsics.TypeError,\n        \"O does not have an [[ArrayBufferData]] internal slot\"\n      );\n    }\n\n    // 4. If IsDetachedBuffer(O) is true, throw a TypeError exception.\n    if (IsDetachedBuffer(realm, O) === true) {\n      throw realm.createErrorThrowCompletion(realm.intrinsics.TypeError, \"IsDetachedBuffer(O) is true\");\n    }\n\n    // 5. Let len be O.[[ArrayBufferByteLength]].\n    let len = O.$ArrayBufferByteLength;\n    invariant(typeof len === \"number\");\n\n    // 6. Let relativeStart be ? ToInteger(start).\n    let relativeStart = To.ToInteger(realm, start);\n\n    // 7. If relativeStart < 0, let first be max((len + relativeStart), 0); else let first be min(relativeStart, len).\n    let first = relativeStart < 0 ? Math.max(len + relativeStart, 0) : Math.min(relativeStart, len);\n\n    // 8. If end is undefined, let relativeEnd be len; else let relativeEnd be ? ToInteger(end).\n    let relativeEnd = !end || end instanceof UndefinedValue ? len : To.ToInteger(realm, end.throwIfNotConcrete());\n\n    // 9. If relativeEnd < 0, let final be max((len + relativeEnd), 0); else let final be min(relativeEnd, len).\n    let final = relativeEnd < 0 ? Math.max(len + relativeEnd, 0) : Math.min(relativeEnd, len);\n\n    // 10. Let newLen be max(final-first, 0).\n    let newLen = Math.max(final - first, 0);\n\n    // 11. Let ctor be ? SpeciesConstructor(O, %ArrayBuffer%).\n    let ctor = SpeciesConstructor(realm, O, realm.intrinsics.ArrayBuffer);\n\n    // 12. Let New be ? Construct(ctor, « newLen »).\n    let New = Construct(realm, ctor, [new NumberValue(realm, newLen)]).throwIfNotConcreteObject();\n\n    // 13. If New does not have an [[ArrayBufferData]] internal slot, throw a TypeError exception.\n    if (!(\"$ArrayBufferData\" in New)) {\n      throw realm.createErrorThrowCompletion(\n        realm.intrinsics.TypeError,\n        \"new does not have an [[ArrayBufferData]] internal slot\"\n      );\n    }\n\n    // 14. If IsDetachedBuffer(New) is true, throw a TypeError exception.\n    if (IsDetachedBuffer(realm, New) === true) {\n      throw realm.createErrorThrowCompletion(realm.intrinsics.TypeError, \"IsDetachedBuffer(new) is true\");\n    }\n\n    // 15. If SameValue(New, O) is true, throw a TypeError exception.\n    if (SameValue(realm, New, O) === true) {\n      throw realm.createErrorThrowCompletion(realm.intrinsics.TypeError, \"SameValue(new, O) is true\");\n    }\n\n    // 16. If new.[[ArrayBufferByteLength]] < newLen, throw a TypeError exception.\n    if (typeof New.$ArrayBufferByteLength !== \"number\" || New.$ArrayBufferByteLength < newLen) {\n      throw realm.createErrorThrowCompletion(realm.intrinsics.TypeError, \"new.[[ArrayBufferByteLength]] < newLen\");\n    }\n\n    // 17. NOTE: Side-effects of the above steps may have detached O.\n\n    // 18. If IsDetachedBuffer(O) is true, throw a TypeError exception.\n    if (IsDetachedBuffer(realm, O) === true) {\n      throw realm.createErrorThrowCompletion(realm.intrinsics.TypeError, \"IsDetachedBuffer(O) is true\");\n    }\n\n    // 19. Let fromBuf be O.[[ArrayBufferData]].\n    let fromBuf = O.$ArrayBufferData;\n    invariant(fromBuf);\n\n    // 20. Let toBuf be New.[[ArrayBufferData]].\n    let toBuf = New.$ArrayBufferData;\n    invariant(toBuf);\n\n    // 21. Perform CopyDataBlockBytes(toBuf, 0, fromBuf, first, newLen).\n    CopyDataBlockBytes(realm, toBuf, 0, fromBuf, first, newLen);\n\n    // 22. Return New.\n    return New;\n  });\n\n  // ECMA262 24.1.4.4\n  obj.defineNativeProperty(realm.intrinsics.SymbolToStringTag, new StringValue(realm, \"ArrayBuffer\"), {\n    writable: false,\n  });\n}\n"
  },
  {
    "path": "src/intrinsics/ecma262/ArrayIteratorPrototype.js",
    "content": "/**\n * Copyright (c) 2017-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n/* @flow strict-local */\n\nimport type { Realm } from \"../../realm.js\";\nimport { Create, To } from \"../../singletons.js\";\nimport { NumberValue, ObjectValue, UndefinedValue, StringValue } from \"../../values/index.js\";\nimport { Get } from \"../../methods/get.js\";\nimport invariant from \"../../invariant.js\";\n\nexport default function(realm: Realm, obj: ObjectValue): void {\n  // ECMA262 22.1.5.2.1\n  obj.defineNativeMethod(\"next\", 0, context => {\n    // 1. Let O be the this value.\n    let O = context.throwIfNotConcrete();\n\n    // 2. If Type(O) is not Object, throw a TypeError exception.\n    if (!(O instanceof ObjectValue)) {\n      throw realm.createErrorThrowCompletion(realm.intrinsics.TypeError, \"not an object\");\n    }\n\n    // 3. If O does not have all of the internal slots of an Array Iterator Instance (22.1.5.3), throw a TypeError exception.\n    if (\n      O.$IteratedObject === undefined ||\n      O.$ArrayIteratorNextIndex === undefined ||\n      O.$ArrayIterationKind === undefined\n    ) {\n      throw realm.createErrorThrowCompletion(realm.intrinsics.TypeError, \"ArrayIteratorPrototype.next isn't generic\");\n    }\n\n    // 4. Let a be the value of the [[IteratedObject]] internal slot of O.\n    let a = O.$IteratedObject;\n    invariant(a instanceof ObjectValue || a instanceof UndefinedValue);\n\n    // 5. If a is undefined, return CreateIterResultObject(undefined, true).\n    if (a instanceof UndefinedValue) {\n      return Create.CreateIterResultObject(realm, realm.intrinsics.undefined, true);\n    }\n\n    // 6. Let index be the value of the [[ArrayIteratorNextIndex]] internal slot of O.\n    let index = O.$ArrayIteratorNextIndex.value;\n\n    // 7. Let itemKind be the value of the [[ArrayIterationKind]] internal slot of O.\n    let itemKind = O.$ArrayIterationKind;\n\n    // 8. If a has a [[TypedArrayName]] internal slot, then\n    let len;\n    if (a.$TypedArrayName) {\n      // a. Let len be the value of a's [[ArrayLength]] internal slot.\n      len = a.$ArrayLength;\n      invariant(typeof len === \"number\");\n    } else {\n      // 9. Else,\n      // a. Let len be ? ToLength(? Get(a, \"length\")).\n      len = To.ToLength(realm, Get(realm, a, \"length\"));\n    }\n\n    // 10. If index ≥ len, then\n    if (index >= len) {\n      // a. Set the value of the [[IteratedObject]] internal slot of O to undefined.\n      O.$IteratedObject = realm.intrinsics.undefined;\n\n      // b. Return CreateIterResultObject(undefined, true).\n      return Create.CreateIterResultObject(realm, realm.intrinsics.undefined, true);\n    }\n\n    // 11. Set the value of the [[ArrayIteratorNextIndex]] internal slot of O to index+1.\n    O.$ArrayIteratorNextIndex = new NumberValue(realm, index + 1);\n\n    // 12. If itemKind is \"key\", return CreateIterResultObject(index, false).\n    if (itemKind === \"key\") {\n      return Create.CreateIterResultObject(realm, new NumberValue(realm, index), false);\n    }\n\n    // 13. Let elementKey be ! ToString(index).\n    let elementKey = new StringValue(realm, index + \"\");\n\n    // 14. Let elementValue be ? Get(a, elementKey).\n    let elementValue = Get(realm, a, elementKey);\n\n    // 15. If itemKind is \"value\", let result be elementValue.\n    let result;\n    if (itemKind === \"value\") {\n      result = elementValue;\n    } else {\n      // 16. Else,\n      // a. Assert: itemKind is \"key+value\".\n      invariant(itemKind === \"key+value\", \"expected item kind to be key+value\");\n\n      // b. Let result be CreateArrayFromList(« index, elementValue »).\n      result = Create.CreateArrayFromList(realm, [new NumberValue(realm, index), elementValue]);\n    }\n\n    // 17. Return CreateIterResultObject(result, false).\n    return Create.CreateIterResultObject(realm, result, false);\n  });\n\n  // ECMA262 22.1.5.2.2\n  obj.defineNativeProperty(realm.intrinsics.SymbolToStringTag, new StringValue(realm, \"Array Iterator\"), {\n    writable: false,\n  });\n}\n"
  },
  {
    "path": "src/intrinsics/ecma262/ArrayProto_toString.js",
    "content": "/**\n * Copyright (c) 2017-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n/* @flow strict-local */\n\nimport type { Realm } from \"../../realm.js\";\nimport { AbstractValue, ArrayValue, NativeFunctionValue, StringValue } from \"../../values/index.js\";\nimport { To } from \"../../singletons.js\";\nimport { Get } from \"../../methods/get.js\";\nimport { Call } from \"../../methods/call.js\";\nimport { IsCallable } from \"../../methods/is.js\";\nimport { createOperationDescriptor } from \"../../utils/generator.js\";\n\nexport default function(realm: Realm): NativeFunctionValue {\n  // ECMA262 22.1.3.30\n  return new NativeFunctionValue(\n    realm,\n    \"Array.prototype.toString\",\n    \"toString\",\n    0,\n    context => {\n      // 1. Let array be ? ToObject(this value).\n      let array = To.ToObject(realm, context);\n\n      // If we have an object that is an array with widened numeric properties, then\n      // we can return a temporal here as we know nothing of the array's properties.\n      // This should be safe to do, as we never expose the internals of the array.\n      if (\n        ArrayValue.isIntrinsicAndHasWidenedNumericProperty(array) &&\n        realm.isInPureScope() &&\n        array.$GetOwnProperty(\"toString\") === undefined\n      ) {\n        return AbstractValue.createTemporalFromBuildFunction(\n          realm,\n          StringValue,\n          [array, new StringValue(realm, \"toString\")],\n          createOperationDescriptor(\"UNKNOWN_ARRAY_METHOD_PROPERTY_CALL\")\n        );\n      }\n\n      // 2. Let func be ? Get(array, \"join\").\n      let func = Get(realm, array, \"join\");\n\n      // 3. If IsCallable(func) is false, let func be the intrinsic function %ObjProto_toString%.\n      if (!IsCallable(realm, func)) func = realm.intrinsics.ObjectProto_toString;\n\n      // 4. Return ? Call(func, array).\n      return Call(realm, func, array);\n    },\n    false\n  );\n}\n"
  },
  {
    "path": "src/intrinsics/ecma262/ArrayProto_values.js",
    "content": "/**\n * Copyright (c) 2017-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n/* @flow strict-local */\n\nimport type { Realm } from \"../../realm.js\";\nimport { AbstractValue, ArrayValue, NativeFunctionValue, StringValue, Value } from \"../../values/index.js\";\nimport { Create, To } from \"../../singletons.js\";\nimport { createOperationDescriptor } from \"../../utils/generator.js\";\n\nexport default function(realm: Realm): NativeFunctionValue {\n  // ECMA262 22.1.3.30\n  return new NativeFunctionValue(realm, \"Array.prototype.values\", \"values\", 0, context => {\n    // 1. Let O be ? ToObject(this value).\n    let O = To.ToObject(realm, context);\n\n    // If we have an object that is an array with widened numeric properties, then\n    // we can return a temporal here as we know nothing of the array's properties.\n    // This should be safe to do, as we never expose the internals of the array.\n    if (\n      ArrayValue.isIntrinsicAndHasWidenedNumericProperty(O) &&\n      realm.isInPureScope() &&\n      O.$GetOwnProperty(\"values\") === undefined\n    ) {\n      return AbstractValue.createTemporalFromBuildFunction(\n        realm,\n        Value,\n        [O, new StringValue(realm, \"values\")],\n        createOperationDescriptor(\"UNKNOWN_ARRAY_METHOD_PROPERTY_CALL\")\n      );\n    }\n\n    // 2. Return CreateArrayIterator(O, \"value\").\n    return Create.CreateArrayIterator(realm, O.throwIfNotConcreteObject(), \"value\");\n  });\n}\n"
  },
  {
    "path": "src/intrinsics/ecma262/ArrayPrototype.js",
    "content": "/**\n * Copyright (c) 2017-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n/* @flow */\n\nimport type { Realm } from \"../../realm.js\";\nimport {\n  AbstractValue,\n  ArrayValue,\n  BooleanValue,\n  BoundFunctionValue,\n  ConcreteValue,\n  ECMAScriptSourceFunctionValue,\n  NativeFunctionValue,\n  NullValue,\n  NumberValue,\n  ObjectValue,\n  StringValue,\n  UndefinedValue,\n  Value,\n} from \"../../values/index.js\";\nimport invariant from \"../../invariant.js\";\nimport { SameValueZeroPartial, AbstractRelationalComparison } from \"../../methods/abstract.js\";\nimport {\n  StrictEqualityComparisonPartial,\n  IsCallable,\n  IsConcatSpreadable,\n  IsExtensible,\n  HasOwnProperty,\n  HasProperty,\n  Call,\n  Invoke,\n  Get,\n  HasSomeCompatibleType,\n} from \"../../methods/index.js\";\nimport { Create, Join, Properties, To } from \"../../singletons.js\";\nimport { createOperationDescriptor } from \"../../utils/generator.js\";\n\nexport default function(realm: Realm, obj: ObjectValue): void {\n  // ECMA262 22.1.3.31\n  obj.defineNativeProperty(realm.intrinsics.SymbolIterator, realm.intrinsics.ArrayProto_values);\n\n  // ECMA262 22.1.3\n  obj.defineNativeProperty(\"length\", realm.intrinsics.zero);\n\n  // ECMA262 22.1.3.1\n  obj.defineNativeMethod(\"concat\", 1, (context, args, argCount) => {\n    // 1. Let O be ? ToObject(this value).\n    let O = To.ToObject(realm, context);\n\n    if (\n      ArrayValue.isIntrinsicAndHasWidenedNumericProperty(O) &&\n      realm.isInPureScope() &&\n      O.$GetOwnProperty(\"concat\") === undefined\n    ) {\n      let newArgs = [O, new StringValue(realm, \"concat\"), ...args];\n      return ArrayValue.createTemporalWithWidenedNumericProperty(\n        realm,\n        newArgs,\n        createOperationDescriptor(\"UNKNOWN_ARRAY_METHOD_PROPERTY_CALL\")\n      );\n    }\n\n    // 2. Let A be ? ArraySpeciesCreate(O, 0).\n    let A = Create.ArraySpeciesCreate(realm, O.throwIfNotConcreteObject(), 0);\n\n    // 3. Let n be 0.\n    let n = 0;\n\n    // 4. Let items be a List whose first element is O and whose subsequent elements are, in left to right\n    //    order, the arguments that were passed to this function invocation.\n    let items = argCount === 0 ? [O] : [O, ...args];\n\n    // 5. Repeat, while items is not empty\n    while (items.length) {\n      // a. Remove the first element from items and let E be the value of the element.\n      let E = items.shift();\n\n      // b. Let spreadable be ? IsConcatSpreadable(E).\n      let spreadable = IsConcatSpreadable(realm, E);\n\n      // c. If spreadable is true, then\n      if (spreadable) {\n        E = E.throwIfNotConcreteObject();\n\n        // i. Let k be 0.\n        let k = 0;\n\n        // ii. Let len be ? ToLength(? Get(E, \"length\")).\n        let len = To.ToLength(realm, Get(realm, E, \"length\"));\n\n        // ii. If n + len > 2^53-1, throw a TypeError exception.\n        if (n + len > Math.pow(2, 53) - 1) {\n          throw realm.createErrorThrowCompletion(realm.intrinsics.TypeError, \"too damn high\");\n        }\n\n        // iv. Repeat, while k < len\n        while (k < len) {\n          // 1. Let P be ! ToString(k).\n          let P = new StringValue(realm, k + \"\");\n\n          // 2. Let exists be ? HasProperty(E, P).\n          let exists = HasProperty(realm, E, P);\n\n          // 3. If exists is true, then\n          if (exists) {\n            // a. Let subElement be ? Get(E, P).\n            let subElement = Get(realm, E, P);\n\n            // b. Perform ? CreateDataPropertyOrThrow(A, ! ToString(n), subElement).\n            Create.CreateDataPropertyOrThrow(realm, A, new StringValue(realm, n + \"\"), subElement);\n          }\n\n          // 4. Increase n by 1.\n          n++;\n\n          // 5. Increase k by 1.\n          k++;\n        }\n      } else {\n        // d. Else E is added as a single item rather than spread,\n        // i. If n≥2^53-1, throw a TypeError exception.\n        if (n > Math.pow(2, 53) - 1) {\n          throw realm.createErrorThrowCompletion(realm.intrinsics.TypeError, \"too damn high\");\n        }\n\n        // ii. Perform ? CreateDataPropertyOrThrow(A, ! ToString(n), E).\n        Create.CreateDataPropertyOrThrow(realm, A, new StringValue(realm, n + \"\"), E);\n\n        // iii. Increase n by 1.\n        n++;\n      }\n    }\n\n    // 6. Perform ? Set(A, \"length\", n, true).\n    Properties.Set(realm, A, \"length\", new NumberValue(realm, n), true);\n\n    // 7. Return A.\n    return A;\n  });\n\n  // ECMA262 22.1.3.3\n  if (!realm.isCompatibleWith(realm.MOBILE_JSC_VERSION) && !realm.isCompatibleWith(\"mobile\"))\n    obj.defineNativeMethod(\"copyWithin\", 2, (context, [target, start, end]) => {\n      // 1. Let O be ? ToObject(this value).\n      let O = To.ToObject(realm, context);\n\n      // If we have an object that is an array with widened numeric properties, then\n      // we can return a temporal here as we know nothing of the array's properties.\n      // This should be safe to do, as we never expose the internals of the array.\n      if (\n        ArrayValue.isIntrinsicAndHasWidenedNumericProperty(O) &&\n        realm.isInPureScope() &&\n        O.$GetOwnProperty(\"copyWithin\") === undefined\n      ) {\n        let args = [O, new StringValue(realm, \"copyWithin\"), target];\n        if (start) {\n          args.push(start);\n        }\n        if (end) {\n          args.push(end);\n        }\n        AbstractValue.createTemporalFromBuildFunction(\n          realm,\n          BooleanValue,\n          args,\n          createOperationDescriptor(\"UNKNOWN_ARRAY_METHOD_PROPERTY_CALL\")\n        );\n        return O;\n      }\n\n      // 2. Let len be ? ToLength(? Get(O, \"length\")).\n      let len = To.ToLength(realm, Get(realm, O, \"length\"));\n\n      // 3. Let relativeTarget be ? ToInteger(target).\n      let relativeTarget = To.ToInteger(realm, target);\n\n      // 4. If relativeTarget < 0, let to be max((len + relativeTarget), 0); else let to be min(relativeTarget, len).\n      let to = relativeTarget < 0 ? Math.max(len + relativeTarget, 0) : Math.min(relativeTarget, len);\n\n      // 5. Let relativeStart be ? ToInteger(start).\n      let relativeStart = To.ToInteger(realm, start);\n\n      // 6. If relativeStart < 0, let from be max((len + relativeStart), 0); else let from be min(relativeStart, len).\n      let from = relativeStart < 0 ? Math.max(len + relativeStart, 0) : Math.min(relativeStart, len);\n\n      // 7. If end is undefined, let relativeEnd be len; else let relativeEnd be ? ToInteger(end).\n      let relativeEnd = !end || end instanceof UndefinedValue ? len : To.ToInteger(realm, end.throwIfNotConcrete());\n\n      // 8. If relativeEnd < 0, let final be max((len + relativeEnd), 0); else let final be min(relativeEnd, len).\n      let final = relativeEnd < 0 ? Math.max(len + relativeEnd, 0) : Math.min(relativeEnd, len);\n\n      // 9. Let count be min(final-from, len-to).\n      let count = Math.min(final - from, len - to);\n\n      let direction;\n      // 10. If from<to and to<from+count, then\n      if (from < to && to < from + count) {\n        // a. Let direction be -1.\n        direction = -1;\n\n        // b. Let from be from + count - 1.\n        from = from + count - 1;\n\n        // c. Let to be to + count - 1.\n        to = to + count - 1;\n      } else {\n        // 11. Else,\n        // a. Let direction be 1.\n        direction = 1;\n      }\n\n      // 12. Repeat, while count > 0\n      while (count > 0) {\n        // a. Let fromKey be ! ToString(from).\n        let fromKey = To.ToString(realm, new NumberValue(realm, from));\n\n        // b. Let toKey be ! ToString(to).\n        let toKey = To.ToString(realm, new NumberValue(realm, to));\n\n        // c. Let fromPresent be ? HasProperty(O, fromKey).\n        let fromPresent = HasProperty(realm, O, fromKey);\n\n        // d. If fromPresent is true, then\n        if (fromPresent === true) {\n          // i. Let fromVal be ? Get(O, fromKey).\n          let fromVal = Get(realm, O, fromKey);\n          // ii. Perform ? Set(O, toKey, fromVal, true).\n          Properties.Set(realm, O, toKey, fromVal, true);\n        } else {\n          // e. Else fromPresent is false,\n          // i. Perform ? DeletePropertyOrThrow(O, toKey).\n          Properties.DeletePropertyOrThrow(realm, O.throwIfNotConcreteObject(), toKey);\n        }\n\n        // f. Let from be from + direction.\n        from = from + direction;\n\n        // g. Let to be to + direction.\n        to = to + direction;\n\n        // h. Let count be count - 1.\n        count = count - 1;\n      }\n\n      // 13. Return O.\n      return O;\n    });\n\n  // ECMA262 22.1.3.4\n  obj.defineNativeMethod(\"entries\", 0, context => {\n    // 1. Let O be ? ToObject(this value).\n    let O = To.ToObject(realm, context);\n\n    // If we have an object that is an array with widened numeric properties, then\n    // we can return a temporal here as we know nothing of the array's properties.\n    // This should be safe to do, as we never expose the internals of the array.\n    if (\n      ArrayValue.isIntrinsicAndHasWidenedNumericProperty(O) &&\n      realm.isInPureScope() &&\n      O.$GetOwnProperty(\"entries\") === undefined\n    ) {\n      return AbstractValue.createTemporalFromBuildFunction(\n        realm,\n        Value,\n        [O, new StringValue(realm, \"entries\")],\n        createOperationDescriptor(\"UNKNOWN_ARRAY_METHOD_PROPERTY_CALL\")\n      );\n    }\n\n    // 2. Return CreateArrayIterator(O, \"key+value\").\n    return Create.CreateArrayIterator(realm, O.throwIfNotConcreteObject(), \"key+value\");\n  });\n\n  // ECMA262 22.1.3.5\n  obj.defineNativeMethod(\"every\", 1, (context, [callbackfn, thisArg]) => {\n    // 1. Let O be ? ToObject(this value).\n    let O = To.ToObject(realm, context);\n\n    // If we have an object that is an array with widened numeric properties, then\n    // we can return a temporal here as we know nothing of the array's properties.\n    // This should be safe to do, as we never expose the internals of the array.\n    if (\n      ArrayValue.isIntrinsicAndHasWidenedNumericProperty(O) &&\n      realm.isInPureScope() &&\n      O.$GetOwnProperty(\"every\") === undefined\n    ) {\n      let args = [O, new StringValue(realm, \"every\"), callbackfn];\n      if (thisArg) {\n        args.push(thisArg);\n      }\n      return AbstractValue.createTemporalFromBuildFunction(\n        realm,\n        BooleanValue,\n        args,\n        createOperationDescriptor(\"UNKNOWN_ARRAY_METHOD_PROPERTY_CALL\")\n      );\n    }\n\n    // 2. Let len be ? ToLength(? Get(O, \"length\")).\n    let len = To.ToLength(realm, Get(realm, O, \"length\"));\n\n    // 3. If IsCallable(callbackfn) is false, throw a TypeError exception.\n    if (!IsCallable(realm, callbackfn)) {\n      throw realm.createErrorThrowCompletion(realm.intrinsics.TypeError, \"not a function\");\n    }\n\n    // 4. If thisArg was supplied, let T be thisArg; else let T be undefined.\n    let T = thisArg || realm.intrinsics.undefined;\n\n    // 5. Let k be 0.\n    let k = 0;\n\n    // 6. Repeat, while k < len\n    while (k < len) {\n      // a. Let Pk be ! ToString(k).\n      let Pk = new StringValue(realm, k + \"\");\n\n      // b. Let kPresent be ? HasProperty(O, Pk).\n      let kPresent = HasProperty(realm, O, Pk);\n\n      // c. If kPresent is true, then\n      if (kPresent) {\n        // i. Let kValue be ? Get(O, Pk).\n        let kValue = Get(realm, O, Pk);\n\n        // ii. Let testResult be ToBoolean(? Call(callbackfn, T, « kValue, k, O »)).\n        let testResult = To.ToBooleanPartial(realm, Call(realm, callbackfn, T, [kValue, new NumberValue(realm, k), O]));\n\n        // iii. If testResult is false, return false.\n        if (!testResult) return realm.intrinsics.false;\n      }\n\n      // d. Increase k by 1.\n      k++;\n    }\n\n    // 7. Return true.\n    return realm.intrinsics.true;\n  });\n\n  // ECMA262 22.1.3.6\n  obj.defineNativeMethod(\"fill\", 1, (context, [value, start, end]) => {\n    // 1. Let O be ? ToObject(this value).\n    let O = To.ToObject(realm, context);\n\n    // If we have an object that is an array with widened numeric properties, then\n    // we can return a temporal here as we know nothing of the array's properties.\n    // This should be safe to do, as we never expose the internals of the array.\n    if (\n      ArrayValue.isIntrinsicAndHasWidenedNumericProperty(O) &&\n      realm.isInPureScope() &&\n      O.$GetOwnProperty(\"fill\") === undefined\n    ) {\n      let args = [O, new StringValue(realm, \"fill\"), value];\n      if (start) {\n        args.push(start);\n      }\n      if (end) {\n        args.push(end);\n      }\n      AbstractValue.createTemporalFromBuildFunction(\n        realm,\n        Value,\n        args,\n        createOperationDescriptor(\"UNKNOWN_ARRAY_METHOD_PROPERTY_CALL\")\n      );\n      return O;\n    }\n\n    // 2. Let len be ? ToLength(? Get(O, \"length\")).\n    let len = To.ToLength(realm, Get(realm, O, \"length\"));\n\n    // 3. Let relativeStart be ? ToInteger(start).\n    let relativeStart = To.ToInteger(realm, start || realm.intrinsics.undefined);\n\n    // 4. If relativeStart < 0, let k be max((len + relativeStart), 0); else let k be min(relativeStart, len).\n    let k = relativeStart < 0 ? Math.max(len + relativeStart, 0) : Math.min(relativeStart, len);\n\n    // 5. If end is undefined, let relativeEnd be len; else let relativeEnd be ? ToInteger(end).\n    let relativeEnd = !end || end instanceof UndefinedValue ? len : To.ToInteger(realm, end.throwIfNotConcrete());\n\n    // 6. If relativeEnd < 0, let final be max((len + relativeEnd), 0); else let final be min(relativeEnd, len).\n    let final = relativeEnd < 0 ? Math.max(len + relativeEnd, 0) : Math.min(relativeEnd, len);\n\n    // 7. Repeat, while k < final\n    while (k < final) {\n      // a. Let Pk be ! ToString(k).\n      let Pk = new StringValue(realm, k + \"\");\n\n      // b. Perform ? Set(O, Pk, value, true).\n      Properties.Set(realm, O, Pk, value, true);\n\n      // c. Increase k by 1.\n      k++;\n    }\n\n    // 8. Return O.\n    return O;\n  });\n\n  // ECMA262 22.1.3.7\n  obj.defineNativeMethod(\"filter\", 1, (context, [callbackfn, thisArg]) => {\n    // 1. Let O be ? ToObject(this value).\n    let O = To.ToObject(realm, context);\n\n    if (\n      ArrayValue.isIntrinsicAndHasWidenedNumericProperty(O) &&\n      realm.isInPureScope() &&\n      O.$GetOwnProperty(\"filter\") === undefined\n    ) {\n      let args = [O, new StringValue(realm, \"filter\"), callbackfn];\n      if (thisArg) {\n        args.push(thisArg);\n      }\n      let possibleNestedOptimizedFunctions;\n\n      // If callbackfn is a native function, it cannot be optimized, and cannot alias locations\n      // other than ones accesible via global, which leaked value analysis disregards.\n      if (!(callbackfn instanceof NativeFunctionValue)) {\n        invariant(callbackfn instanceof ECMAScriptSourceFunctionValue || callbackfn instanceof BoundFunctionValue);\n        possibleNestedOptimizedFunctions = [\n          {\n            func: callbackfn,\n            thisValue: thisArg || realm.intrinsics.undefined,\n            kind: \"filter\",\n          },\n        ];\n      }\n      return ArrayValue.createTemporalWithWidenedNumericProperty(\n        realm,\n        args,\n        createOperationDescriptor(\"UNKNOWN_ARRAY_METHOD_PROPERTY_CALL\"),\n        possibleNestedOptimizedFunctions\n      );\n    }\n\n    // 2. Let len be ? ToLength(? Get(O, \"length\")).\n    let len = To.ToLength(realm, Get(realm, O, \"length\"));\n\n    // 3. If IsCallable(callbackfn) is false, throw a TypeError exception.\n    if (!IsCallable(realm, callbackfn)) {\n      throw realm.createErrorThrowCompletion(realm.intrinsics.TypeError, \"not a function\");\n    }\n\n    // 4. If thisArg was supplied, let T be thisArg; else let T be undefined.\n    let T = thisArg || realm.intrinsics.undefined;\n\n    // 5. Let A be ? ArraySpeciesCreate(O, 0).\n    let A = Create.ArraySpeciesCreate(realm, O.throwIfNotConcreteObject(), 0);\n\n    // 6. Let k be 0.\n    let k = 0;\n\n    // 7. Let to be 0.\n    let to = 0;\n\n    // 8. Repeat, while k < len\n    while (k < len) {\n      // a. Let Pk be ! ToString(k).\n      let Pk = new StringValue(realm, k + \"\");\n\n      // b. Let kPresent be ? HasProperty(O, Pk).\n      let kPresent = HasProperty(realm, O, Pk);\n\n      // c. If kPresent is true, then\n      if (kPresent) {\n        // i. Let kValue be ? Get(O, Pk).\n        let kValue = Get(realm, O, Pk);\n\n        // ii. Let selected be ToBoolean(? Call(callbackfn, T, « kValue, k, O »)).\n        let selected = To.ToBooleanPartial(realm, Call(realm, callbackfn, T, [kValue, new NumberValue(realm, k), O]));\n\n        // iii. If selected is true, then\n        if (selected) {\n          // 1. Perform ? CreateDataPropertyOrThrow(A, ! ToString(to), kValue).\n          Create.CreateDataPropertyOrThrow(realm, A, To.ToString(realm, new NumberValue(realm, to)), kValue);\n\n          // 2. Increase to by 1.\n          to++;\n        }\n      }\n\n      // d. Increase k by 1.\n      k++;\n    }\n\n    // 9. Return A.\n    return A;\n  });\n\n  // ECMA262 22.1.3.8\n  obj.defineNativeMethod(\"find\", 1, (context, [predicate, thisArg]) => {\n    // 1. Let O be ? ToObject(this value).\n    let O = To.ToObject(realm, context);\n\n    // If we have an object that is an array with widened numeric properties, then\n    // we can return a temporal here as we know nothing of the array's properties.\n    // This should be safe to do, as we never expose the internals of the array.\n    if (\n      ArrayValue.isIntrinsicAndHasWidenedNumericProperty(O) &&\n      realm.isInPureScope() &&\n      O.$GetOwnProperty(\"find\") === undefined\n    ) {\n      let args = [O, new StringValue(realm, \"find\"), predicate];\n      if (thisArg) {\n        args.push(thisArg);\n      }\n      return AbstractValue.createTemporalFromBuildFunction(\n        realm,\n        Value,\n        args,\n        createOperationDescriptor(\"UNKNOWN_ARRAY_METHOD_PROPERTY_CALL\")\n      );\n    }\n\n    // 2. Let len be ? ToLength(? Get(O, \"length\")).\n    let len = To.ToLength(realm, Get(realm, O, \"length\"));\n\n    // 3. If IsCallable(predicate) is false, throw a TypeError exception.\n    if (!IsCallable(realm, predicate)) {\n      throw realm.createErrorThrowCompletion(realm.intrinsics.TypeError, \"not a function\");\n    }\n\n    // 4. If thisArg was supplied, let T be thisArg; else let T be undefined.\n    let T = thisArg || realm.intrinsics.undefined;\n\n    // 5. Let k be 0.\n    let k = 0;\n\n    // 6. Repeat, while k < len\n    while (k < len) {\n      // a. Let Pk be ! ToString(k).\n      let Pk = new StringValue(realm, k + \"\");\n\n      // b. Let kValue be ? Get(O, Pk).\n      let kValue = Get(realm, O, Pk);\n\n      // c. Let testResult be ToBoolean(? Call(predicate, T, « kValue, k, O »)).\n      let testResult = To.ToBooleanPartial(realm, Call(realm, predicate, T, [kValue, new NumberValue(realm, k), O]));\n\n      // d. If testResult is true, return kValue.\n      if (testResult) return kValue;\n\n      // e. Increase k by 1.\n      k++;\n    }\n\n    // 7. Return undefined.\n    return realm.intrinsics.undefined;\n  });\n\n  // ECMA262 22.1.3.9\n  obj.defineNativeMethod(\"findIndex\", 1, (context, [predicate, thisArg]) => {\n    // 1. Let O be ? ToObject(this value).\n    let O = To.ToObject(realm, context);\n\n    // If we have an object that is an array with widened numeric properties, then\n    // we can return a temporal here as we know nothing of the array's properties.\n    // This should be safe to do, as we never expose the internals of the array.\n    if (\n      ArrayValue.isIntrinsicAndHasWidenedNumericProperty(O) &&\n      realm.isInPureScope() &&\n      O.$GetOwnProperty(\"findIndex\") === undefined\n    ) {\n      let args = [O, new StringValue(realm, \"findIndex\"), predicate];\n      if (thisArg) {\n        args.push(thisArg);\n      }\n      return AbstractValue.createTemporalFromBuildFunction(\n        realm,\n        NumberValue,\n        args,\n        createOperationDescriptor(\"UNKNOWN_ARRAY_METHOD_PROPERTY_CALL\")\n      );\n    }\n\n    // 2. Let len be ? ToLength(? Get(O, \"length\")).\n    let len = To.ToLength(realm, Get(realm, O, \"length\"));\n\n    // 3. If IsCallable(predicate) is false, throw a TypeError exception.\n    if (IsCallable(realm, predicate) === false) {\n      throw realm.createErrorThrowCompletion(realm.intrinsics.TypeError, \"not a function\");\n    }\n\n    // 4. If thisArg was supplied, let T be thisArg; else let T be undefined.\n    let T = thisArg ? thisArg : realm.intrinsics.undefined;\n\n    // 5. Let k be 0.\n    let k = 0;\n\n    // 6. Repeat, while k < len\n    while (k < len) {\n      // a. Let Pk be ! ToString(k).\n      let Pk = To.ToString(realm, new NumberValue(realm, k));\n\n      // b. Let kValue be ? Get(O, Pk).\n      let kValue = Get(realm, O, new StringValue(realm, Pk));\n\n      // c. Let testResult be ToBoolean(? Call(predicate, T, « kValue, k, O »)).\n      let testResult = To.ToBooleanPartial(realm, Call(realm, predicate, T, [kValue, new NumberValue(realm, k), O]));\n\n      // d. If testResult is true, return k.\n      if (testResult === true) return new NumberValue(realm, k);\n\n      // e. Increase k by 1.\n      k = k + 1;\n    }\n\n    // 7. Return -1.\n    return new NumberValue(realm, -1);\n  });\n\n  // ECMA262 22.1.3.10\n  obj.defineNativeMethod(\"forEach\", 1, (context, [callbackfn, thisArg]) => {\n    // 1. Let O be ? ToObject(this value).\n    let O = To.ToObject(realm, context);\n\n    // If we have an object that is an array with widened numeric properties, then\n    // we can return a temporal here as we know nothing of the array's properties.\n    // This should be safe to do, as we never expose the internals of the array.\n    if (\n      ArrayValue.isIntrinsicAndHasWidenedNumericProperty(O) &&\n      realm.isInPureScope() &&\n      O.$GetOwnProperty(\"forEach\") === undefined\n    ) {\n      let args = [O, new StringValue(realm, \"forEach\"), callbackfn];\n      if (thisArg) {\n        args.push(thisArg);\n      }\n      AbstractValue.createTemporalFromBuildFunction(\n        realm,\n        BooleanValue,\n        args,\n        createOperationDescriptor(\"UNKNOWN_ARRAY_METHOD_PROPERTY_CALL\")\n      );\n      return realm.intrinsics.undefined;\n    }\n\n    // 2. Let len be ? ToLength(? Get(O, \"length\")).\n    let len = To.ToLength(realm, Get(realm, O, \"length\"));\n\n    // 3. If IsCallable(callbackfn) is false, throw a TypeError exception.\n    if (!IsCallable(realm, callbackfn)) {\n      throw realm.createErrorThrowCompletion(realm.intrinsics.TypeError, \"not a function\");\n    }\n\n    // 4. If thisArg was supplied, let T be thisArg; else let T be undefined.\n    let T = thisArg || realm.intrinsics.undefined;\n\n    // 5. Let k be 0.\n    let k = 0;\n\n    // 6. Repeat, while k < len\n    while (k < len) {\n      // a. Let Pk be ! To.ToString(k).\n      let Pk = new StringValue(realm, k + \"\");\n\n      // b. Let kPresent be ? HasProperty(O, Pk).\n      let kPresent = HasProperty(realm, O, Pk);\n\n      // c. If kPresent is true, then\n      if (kPresent) {\n        // i. Let kValue be ? Get(O, Pk).\n        let kValue = Get(realm, O, Pk);\n\n        // ii. Perform ? Call(callbackfn, T, « kValue, k, O »).\n        Call(realm, callbackfn, T, [kValue, new NumberValue(realm, k), O]);\n      }\n\n      // d. Increase k by 1.\n      k++;\n    }\n\n    // 7. Return undefined.\n    return realm.intrinsics.undefined;\n  });\n\n  // ECMA262 22.1.3.11\n  if (!realm.isCompatibleWith(realm.MOBILE_JSC_VERSION) && !realm.isCompatibleWith(\"mobile\"))\n    obj.defineNativeMethod(\"includes\", 1, (context, [searchElement, fromIndex]) => {\n      // 1. Let O be ? ToObject(this value).\n      let O = To.ToObject(realm, context);\n\n      // If we have an object that is an array with widened numeric properties, then\n      // we can return a temporal here as we know nothing of the array's properties.\n      // This should be safe to do, as we never expose the internals of the array.\n      if (\n        ArrayValue.isIntrinsicAndHasWidenedNumericProperty(O) &&\n        realm.isInPureScope() &&\n        O.$GetOwnProperty(\"includes\") === undefined\n      ) {\n        let args = [O, new StringValue(realm, \"includes\"), searchElement];\n        if (fromIndex) {\n          args.push(fromIndex);\n        }\n        return AbstractValue.createTemporalFromBuildFunction(\n          realm,\n          BooleanValue,\n          args,\n          createOperationDescriptor(\"UNKNOWN_ARRAY_METHOD_PROPERTY_CALL\")\n        );\n      }\n\n      // 2. Let len be ? ToLength(? Get(O, \"length\")).\n      let len = To.ToLength(realm, Get(realm, O, \"length\"));\n\n      // 3. If len is 0, return false.\n      if (len === 0) return realm.intrinsics.false;\n\n      // 4. Let n be ? ToInteger(fromIndex). (If fromIndex is undefined, this step produces the value 0.)\n      let n = To.ToInteger(realm, fromIndex || realm.intrinsics.undefined);\n\n      let k;\n      // 5. If n ≥ 0, then\n      if (n >= 0) {\n        // a. Let k be n.\n        k = n;\n      } else {\n        // 6. Else n < 0,\n        // a. Let k be len + n.\n        k = len + n;\n        // b. If k < 0, let k be 0.\n        if (k < 0) k = 0;\n      }\n\n      // 7. Repeat, while k < len\n      while (k < len) {\n        // a. Let elementK be the result of ? Get(O, ! ToString(k)).\n        let elementK = Get(realm, O, To.ToString(realm, new NumberValue(realm, k)));\n\n        // b. If SameValueZero(searchElement, elementK) is true, return true.\n        if (SameValueZeroPartial(realm, searchElement, elementK) === true) return realm.intrinsics.true;\n\n        // c. Increase k by 1.\n        k = k + 1;\n      }\n\n      // 8. Return false.\n      return realm.intrinsics.false;\n    });\n\n  // ECMA262 22.1.3.12\n  obj.defineNativeMethod(\"indexOf\", 1, (context, [searchElement, fromIndex]) => {\n    // 1. Let O be ? ToObject(this value).\n    let O = To.ToObject(realm, context);\n\n    // If we have an object that is an array with widened numeric properties, then\n    // we can return a temporal here as we know nothing of the array's properties.\n    // This should be safe to do, as we never expose the internals of the array.\n    if (\n      ArrayValue.isIntrinsicAndHasWidenedNumericProperty(O) &&\n      realm.isInPureScope() &&\n      O.$GetOwnProperty(\"indexOf\") === undefined\n    ) {\n      let args = [O, new StringValue(realm, \"indexOf\"), searchElement];\n      if (fromIndex) {\n        args.push(fromIndex);\n      }\n      return AbstractValue.createTemporalFromBuildFunction(\n        realm,\n        NumberValue,\n        args,\n        createOperationDescriptor(\"UNKNOWN_ARRAY_METHOD_PROPERTY_CALL\")\n      );\n    }\n\n    // 2. Let len be ? ToLength(? Get(O, \"length\")).\n    let len = To.ToLength(realm, Get(realm, O, \"length\"));\n\n    // 3. If len is 0, return -1.\n    if (len === 0) return new NumberValue(realm, -1);\n\n    // 4. Let n be ? ToInteger(fromIndex). (If fromIndex is undefined, this step produces the value 0.)\n    let n = fromIndex ? To.ToInteger(realm, fromIndex) : 0;\n\n    // 5. If n ≥ len, return -1.\n    if (n >= len) return new NumberValue(realm, -1);\n\n    // 6. If n ≥ 0, then\n    let k;\n    if (n >= 0) {\n      // a. If n is -0, let k be +0; else let k be n.\n      k = Object.is(n, -0) ? +0 : n;\n    } else {\n      // 7. Else n < 0,\n      // a. Let k be len + n.\n      k = len + n;\n\n      // b. If k < 0, let k be 0.\n      if (k < 0) k = 0;\n    }\n\n    // 8. Repeat, while k < len\n    while (k < len) {\n      // a. Let kPresent be ? HasProperty(O, ! ToString(k)).\n      let kPresent = HasProperty(realm, O, k + \"\");\n\n      // b. If kPresent is true, then\n      if (kPresent === true) {\n        // i. Let elementK be ? Get(O, ! ToString(k)).\n        let elementK = Get(realm, O, k + \"\");\n\n        // ii. Let same be the result of performing Strict Equality Comparison searchElement === elementK.\n        let same = StrictEqualityComparisonPartial(realm, searchElement, elementK);\n\n        // iii. If same is true, return k.\n        if (same) return new NumberValue(realm, k);\n      }\n\n      // c. Increase k by 1.\n      k++;\n    }\n\n    // 9. Return -1.\n    return new NumberValue(realm, -1);\n  });\n\n  // ECMA262 22.1.3.13\n  obj.defineNativeMethod(\"join\", 1, (context, [separator]) => {\n    // 1. Let O be ? ToObject(this value).\n    let O = To.ToObject(realm, context);\n\n    // If we have an object that is an array with widened numeric properties, then\n    // we can return a temporal here as we know nothing of the array's properties.\n    // This should be safe to do, as we never expose the internals of the array.\n    if (\n      ArrayValue.isIntrinsicAndHasWidenedNumericProperty(O) &&\n      realm.isInPureScope() &&\n      O.$GetOwnProperty(\"join\") === undefined\n    ) {\n      let args = [O, new StringValue(realm, \"join\")];\n      if (separator) {\n        args.push(separator);\n      }\n      return AbstractValue.createTemporalFromBuildFunction(\n        realm,\n        StringValue,\n        args,\n        createOperationDescriptor(\"UNKNOWN_ARRAY_METHOD_PROPERTY_CALL\")\n      );\n    }\n\n    // 2. Let len be ? ToLength(? Get(O, \"length\")).\n    let len = To.ToLength(realm, Get(realm, O, \"length\"));\n\n    // 3. If separator is undefined, let separator be the single-element String \",\".\n    if (!separator || separator instanceof UndefinedValue) separator = new StringValue(realm, \",\");\n\n    // 4. Let sep be ? ToString(separator).\n    let sep = To.ToStringPartial(realm, separator);\n\n    // 5. If len is zero, return the empty String.\n    if (len === 0) return realm.intrinsics.emptyString;\n\n    // 6. Let element0 be Get(O, \"0\").\n    let element0 = Get(realm, O, \"0\");\n\n    // 7. If element0 is undefined or null, let R be the empty String; otherwise, let R be ? ToString(element0).\n    let R: ?string;\n    if (HasSomeCompatibleType(element0, UndefinedValue, NullValue)) {\n      R = \"\";\n    } else {\n      R = To.ToStringPartial(realm, element0);\n    }\n\n    // 8. Let k be 1.\n    let k = 1;\n\n    // 9. Repeat, while k < len\n    while (k < len) {\n      // a. Let S be the String value produced by concatenating R and sep.\n      let S: string = R + sep;\n\n      // b. Let element be ? Get(O, ! To.ToString(k)).\n      let element = Get(realm, O, new StringValue(realm, k + \"\"));\n\n      // c. If element is undefined or null, let next be the empty String; otherwise, let next be ? ToString(element).\n      let next: ?string;\n      if (HasSomeCompatibleType(element, UndefinedValue, NullValue)) {\n        next = \"\";\n      } else {\n        next = To.ToStringPartial(realm, element);\n      }\n\n      // d. Let R be a String value produced by concatenating S and next.\n      R = S + next;\n\n      // e. Increase k by 1.\n      k++;\n    }\n\n    // 10. Return R.\n    return new StringValue(realm, R + \"\");\n  });\n\n  // ECMA262 22.1.3.14\n  obj.defineNativeMethod(\"keys\", 0, context => {\n    // 1. Let O be ? ToObject(this value).\n    let O = To.ToObject(realm, context);\n\n    // If we have an object that is an array with widened numeric properties, then\n    // we can return a temporal here as we know nothing of the array's properties.\n    // This should be safe to do, as we never expose the internals of the array.\n    if (\n      ArrayValue.isIntrinsicAndHasWidenedNumericProperty(O) &&\n      realm.isInPureScope() &&\n      O.$GetOwnProperty(\"keys\") === undefined\n    ) {\n      return AbstractValue.createTemporalFromBuildFunction(\n        realm,\n        Value,\n        [O, new StringValue(realm, \"keys\")],\n        createOperationDescriptor(\"UNKNOWN_ARRAY_METHOD_PROPERTY_CALL\")\n      );\n    }\n\n    // 2. Return CreateArrayIterator(O, \"key\").\n    return Create.CreateArrayIterator(realm, O.throwIfNotConcreteObject(), \"key\");\n  });\n\n  // ECMA262 22.1.3.15\n  obj.defineNativeMethod(\"lastIndexOf\", 1, (context, [searchElement, fromIndex]) => {\n    // 1. Let O be ? ToObject(this value).\n    let O = To.ToObject(realm, context);\n\n    // If we have an object that is an array with widened numeric properties, then\n    // we can return a temporal here as we know nothing of the array's properties.\n    // This should be safe to do, as we never expose the internals of the array.\n    if (\n      ArrayValue.isIntrinsicAndHasWidenedNumericProperty(O) &&\n      realm.isInPureScope() &&\n      O.$GetOwnProperty(\"lastIndexOf\") === undefined\n    ) {\n      let args = [O, new StringValue(realm, \"lastIndexOf\"), searchElement];\n      if (fromIndex) {\n        args.push(fromIndex);\n      }\n      return AbstractValue.createTemporalFromBuildFunction(\n        realm,\n        NumberValue,\n        args,\n        createOperationDescriptor(\"UNKNOWN_ARRAY_METHOD_PROPERTY_CALL\")\n      );\n    }\n\n    // 2. Let len be ? ToLength(? Get(O, \"length\")).\n    let len = To.ToLength(realm, Get(realm, O, \"length\"));\n\n    // 3. If len is 0, return -1.\n    if (len === 0) return new NumberValue(realm, -1);\n\n    // 4. If argument fromIndex was passed, let n be ? ToInteger(fromIndex); else let n be len-1.\n    let n = fromIndex ? To.ToInteger(realm, fromIndex) : len - 1;\n\n    // 5. If n ≥ 0, then\n    let k;\n    if (n >= 0) {\n      // a. If n is -0, let k be +0; else let k be min(n, len - 1).\n      k = Object.is(n, -0) ? +0 : Math.min(n, len - 1);\n    } else {\n      // 6. Else n < 0,\n      // a. Let k be len + n.\n      k = len + n;\n    }\n\n    // 7. Repeat, while k ≥ 0\n    while (k >= 0) {\n      // a. Let kPresent be ? HasProperty(O, ! ToString(k)).\n      let kPresent = HasProperty(realm, O, new StringValue(realm, k + \"\"));\n\n      // b. If kPresent is true, then\n      if (kPresent) {\n        // i. Let elementK be ? Get(O, ! ToString(k)).\n        let elementK = Get(realm, O, new StringValue(realm, k + \"\"));\n\n        // ii. Let same be the result of performing Strict Equality Comparison searchElement === elementK.\n        let same = StrictEqualityComparisonPartial(realm, searchElement, elementK);\n\n        // iii. If same is true, return k.\n        if (same) return new NumberValue(realm, k);\n      }\n\n      // c. Decrease k by 1.\n      k--;\n    }\n\n    // 8. Return -1.\n    return new NumberValue(realm, -1);\n  });\n\n  // ECMA262 22.1.3.16\n  obj.defineNativeMethod(\"map\", 1, (context, [callbackfn, thisArg]) => {\n    // 1. Let O be ? ToObject(this value).\n    let O = To.ToObject(realm, context);\n\n    if (\n      ArrayValue.isIntrinsicAndHasWidenedNumericProperty(O) &&\n      realm.isInPureScope() &&\n      O.$GetOwnProperty(\"map\") === undefined\n    ) {\n      let args = [O, new StringValue(realm, \"map\"), callbackfn];\n      if (thisArg) {\n        args.push(thisArg);\n      }\n      invariant(callbackfn instanceof ECMAScriptSourceFunctionValue || callbackfn instanceof BoundFunctionValue);\n      let possibleNestedOptimizedFunctions = [\n        { func: callbackfn, thisValue: thisArg || realm.intrinsics.undefined, kind: \"map\" },\n      ];\n      return ArrayValue.createTemporalWithWidenedNumericProperty(\n        realm,\n        args,\n        createOperationDescriptor(\"UNKNOWN_ARRAY_METHOD_PROPERTY_CALL\"),\n        possibleNestedOptimizedFunctions\n      );\n    }\n\n    // 2. Let len be ? ToLength(? Get(O, \"length\")).\n    let lenVal = Get(realm, O, \"length\");\n    if (lenVal instanceof AbstractValue && !lenVal.mightNotBeNumber() && !lenVal.values.isTop()) {\n      let values = lenVal.values.getElements();\n      let n = values.size;\n      if (n > 1 && n < 10) {\n        let a = Create.ArraySpeciesCreate(realm, O.throwIfNotConcreteObject(), 0);\n        return Join.mapAndJoin(\n          realm,\n          values,\n          v => AbstractValue.createFromBinaryOp(realm, \"===\", v, lenVal, lenVal.expressionLocation),\n          v => doMap(v, a)\n        );\n      }\n    }\n    return doMap(lenVal.throwIfNotConcrete());\n\n    function doMap(val: ConcreteValue, resultArray?: ObjectValue) {\n      let len = To.ToLength(realm, val);\n\n      // 3. If IsCallable(callbackfn) is false, throw a TypeError exception.\n      if (!IsCallable(realm, callbackfn)) {\n        throw realm.createErrorThrowCompletion(realm.intrinsics.TypeError, \"not a function\");\n      }\n\n      // 4. If thisArg was supplied, let T be thisArg; else let T be undefined.\n      let T = thisArg || realm.intrinsics.undefined;\n\n      // 5. Let A be ? ArraySpeciesCreate(O, len).\n      let A;\n      if (resultArray === undefined) A = Create.ArraySpeciesCreate(realm, O.throwIfNotConcreteObject(), len);\n      else {\n        A = resultArray;\n        Properties.Set(realm, A, \"length\", val, true);\n      }\n\n      // 6. Let k be 0.\n      let k = 0;\n\n      // 7. Repeat, while k < len\n      while (k < len) {\n        // a. Let Pk be ! To.ToString(k).\n        let Pk = new StringValue(realm, k + \"\");\n\n        // b. Let kPresent be ? HasProperty(O, Pk).\n        let kPresent = HasProperty(realm, O, Pk);\n\n        // c. If kPresent is true, then\n        if (kPresent) {\n          // i. Let kValue be ? Get(O, Pk).\n          let kValue = Get(realm, O, Pk);\n\n          // ii. Let mappedValue be ? Call(callbackfn, T, « kValue, k, O »).\n          let mappedValue = Call(realm, callbackfn, T, [kValue, new NumberValue(realm, k), O]);\n\n          // iii. Perform ? CreateDataPropertyOrThrow(A, Pk, mappedValue).\n          Create.CreateDataPropertyOrThrow(realm, A, Pk, mappedValue);\n        }\n\n        // d. Increase k by 1.\n        k++;\n      }\n\n      // 8. Return A.\n      return A;\n    }\n  });\n\n  // ECMA262 22.1.3.17\n  obj.defineNativeMethod(\"pop\", 0, context => {\n    // 1. Let O be ? ToObject(this value).\n    let O = To.ToObject(realm, context);\n\n    // If we have an object that is an array with widened numeric properties, then\n    // we can return a temporal here as we know nothing of the array's properties.\n    // This should be safe to do, as we never expose the internals of the array.\n    if (\n      ArrayValue.isIntrinsicAndHasWidenedNumericProperty(O) &&\n      realm.isInPureScope() &&\n      O.$GetOwnProperty(\"pop\") === undefined\n    ) {\n      return AbstractValue.createTemporalFromBuildFunction(\n        realm,\n        Value,\n        [O, new StringValue(realm, \"pop\")],\n        createOperationDescriptor(\"UNKNOWN_ARRAY_METHOD_PROPERTY_CALL\")\n      );\n    }\n\n    // 2. Let len be ? ToLength(? Get(O, \"length\")).\n    let len = To.ToLength(realm, Get(realm, O, \"length\"));\n\n    // 3. If len is zero, then\n    if (len === 0) {\n      // a. Perform ? Set(O, \"length\", 0, true).\n      Properties.Set(realm, O, \"length\", realm.intrinsics.zero, true);\n\n      // b. Return undefined.\n      return realm.intrinsics.undefined;\n    } else {\n      // 4. Else len > 0,\n      // a. Let newLen be len-1.\n      let newLen = len - 1;\n\n      // b. Let indx be ! ToString(newLen).\n      let indx = new StringValue(realm, newLen + \"\");\n\n      // c. Let element be ? Get(O, indx).\n      let element = Get(realm, O, indx);\n\n      // d. Perform ? DeletePropertyOrThrow(O, indx).\n      Properties.DeletePropertyOrThrow(realm, O.throwIfNotConcreteObject(), indx);\n\n      // e. Perform ? Set(O, \"length\", newLen, true).\n      Properties.Set(realm, O, \"length\", new NumberValue(realm, newLen), true);\n\n      // f. Return element.\n      return element;\n    }\n  });\n\n  // ECMA262 22.1.3.18\n  obj.defineNativeMethod(\"push\", 1, (context, args, argCount) => {\n    // 1. Let O be ? ToObject(this value).\n    let O = To.ToObject(realm, context);\n\n    // If we have an object that is an array with widened numeric properties, then\n    // we can return a temporal here as we know nothing of the array's properties.\n    // This should be safe to do, as we never expose the internals of the array.\n    if (\n      ArrayValue.isIntrinsicAndHasWidenedNumericProperty(O) &&\n      realm.isInPureScope() &&\n      O.$GetOwnProperty(\"push\") === undefined\n    ) {\n      return AbstractValue.createTemporalFromBuildFunction(\n        realm,\n        NumberValue,\n        [O, new StringValue(realm, \"push\"), ...args],\n        createOperationDescriptor(\"UNKNOWN_ARRAY_METHOD_PROPERTY_CALL\")\n      );\n    }\n\n    // 2. Let len be ? ToLength(? Get(O, \"length\")).\n    let len = To.ToLength(realm, Get(realm, O, new StringValue(realm, \"length\")));\n\n    // 3. Let items be a List whose elements are, in left to right order, the arguments that were passed to realm function invocation.\n    let items = argCount > 0 ? args : [];\n\n    // 4. Let argCount be the number of elements in items.\n    argCount;\n\n    // 5. If len + argCount > 2^53-1, throw a TypeError exception.\n    if (len + argCount > Math.pow(2, 53) - 1) {\n      throw realm.createErrorThrowCompletion(realm.intrinsics.TypeError, \"Array.prototype\");\n    }\n\n    // 6. Repeat, while items is not empty\n    while (items.length) {\n      // a. Remove the first element from items and let E be the value of the element.\n      let E = items.shift();\n\n      // b. Perform ? Set(O, ! ToString(len), E, true).\n      Properties.Set(realm, O, new StringValue(realm, len + \"\"), E, true);\n\n      // c. Let len be len+1.\n      len++;\n    }\n\n    // 7. Perform ? Set(O, \"length\", len, true).\n    Properties.Set(realm, O, new StringValue(realm, \"length\"), new NumberValue(realm, len), true);\n\n    // 8. Return len.\n    return new NumberValue(realm, len);\n  });\n\n  // ECMA262 22.1.3.19\n  obj.defineNativeMethod(\"reduce\", 1, (context, [callbackfn, initialValue]) => {\n    // 1. Let O be ? ToObject(this value).\n    let O = To.ToObject(realm, context);\n\n    // If we have an object that is an array with widened numeric properties, then\n    // we can return a temporal here as we know nothing of the array's properties.\n    // This should be safe to do, as we never expose the internals of the array.\n    if (\n      ArrayValue.isIntrinsicAndHasWidenedNumericProperty(O) &&\n      realm.isInPureScope() &&\n      O.$GetOwnProperty(\"reduce\") === undefined\n    ) {\n      let args = [O, new StringValue(realm, \"reduce\"), callbackfn];\n      if (initialValue) {\n        args.push(initialValue);\n      }\n      return AbstractValue.createTemporalFromBuildFunction(\n        realm,\n        Value,\n        args,\n        createOperationDescriptor(\"UNKNOWN_ARRAY_METHOD_PROPERTY_CALL\")\n      );\n    }\n\n    // 2. Let len be ? ToLength(? Get(O, \"length\")).\n    let len = To.ToLength(realm, Get(realm, O, \"length\"));\n\n    // 3. If IsCallable(callbackfn) is false, throw a TypeError exception.\n    if (!IsCallable(realm, callbackfn)) {\n      throw realm.createErrorThrowCompletion(realm.intrinsics.TypeError, \"not a function\");\n    }\n\n    // 4. If len is 0 and initialValue is not present, throw a TypeError exception.\n    if (len === 0 && !initialValue) {\n      throw realm.createErrorThrowCompletion(realm.intrinsics.TypeError, \"Array.prototype\");\n    }\n\n    // 5. Let k be 0.\n    let k = 0;\n\n    // 6. If initialValue is present, then\n    let accumulator;\n    if (initialValue) {\n      // a. Set accumulator to initialValue.\n      accumulator = initialValue;\n    } else {\n      // 7. Else initialValue is not present,\n      // a. Let kPresent be false.\n      let kPresent = false;\n\n      // b. Repeat, while kPresent is false and k < len\n      while (kPresent === false && k < len) {\n        // i. Let Pk be ! ToString(k).\n        let Pk = new StringValue(realm, k + \"\");\n\n        // ii. Let kPresent be ? HasProperty(O, Pk).\n        kPresent = HasProperty(realm, O, Pk);\n\n        // iv. If kPresent is true, then\n        if (kPresent) {\n          // 1. Let accumulator be ? Get(O, Pk).\n          accumulator = Get(realm, O, Pk);\n        }\n\n        // v. Increase k by 1.\n        k++;\n      }\n\n      // c. If kPresent is false, throw a TypeError exception.\n      if (!kPresent) {\n        throw realm.createErrorThrowCompletion(realm.intrinsics.TypeError, \"kPresent is false\");\n      }\n\n      invariant(accumulator);\n    }\n\n    // 8. Repeat, while k < len\n    while (k < len) {\n      // a. Let Pk be ! ToString(k).\n      let Pk = new StringValue(realm, k + \"\");\n\n      // b. Let kPresent be ? HasProperty(O, Pk).\n      let kPresent = HasProperty(realm, O, Pk);\n\n      // c. If kPresent is true, then\n      if (kPresent) {\n        // i. Let kValue be ? Get(O, Pk).\n        let kValue = Get(realm, O, Pk);\n\n        // ii. Let accumulator be ? Call(callbackfn, undefined, « accumulator, kValue, k, O »).\n        accumulator = Call(realm, callbackfn, realm.intrinsics.undefined, [\n          accumulator,\n          kValue,\n          new NumberValue(realm, k),\n          O,\n        ]);\n      }\n\n      // d. Increase k by 1.\n      k++;\n    }\n\n    // 9. Return accumulator.\n    return accumulator;\n  });\n\n  // ECMA262 22.1.3.20\n  obj.defineNativeMethod(\"reduceRight\", 1, (context, [callbackfn, initialValue]) => {\n    // 1. Let O be ? ToObject(this value).\n    let O = To.ToObject(realm, context);\n\n    // If we have an object that is an array with widened numeric properties, then\n    // we can return a temporal here as we know nothing of the array's properties.\n    // This should be safe to do, as we never expose the internals of the array.\n    if (\n      ArrayValue.isIntrinsicAndHasWidenedNumericProperty(O) &&\n      realm.isInPureScope() &&\n      O.$GetOwnProperty(\"reduceRight\") === undefined\n    ) {\n      let args = [O, new StringValue(realm, \"reduceRight\"), callbackfn];\n      if (initialValue) {\n        args.push(initialValue);\n      }\n      return AbstractValue.createTemporalFromBuildFunction(\n        realm,\n        Value,\n        args,\n        createOperationDescriptor(\"UNKNOWN_ARRAY_METHOD_PROPERTY_CALL\")\n      );\n    }\n\n    // 2. Let len be ? ToLength(? Get(O, \"length\")).\n    let len = To.ToLength(realm, Get(realm, O, \"length\"));\n\n    // 3. If IsCallable(callbackfn) is false, throw a TypeError exception.\n    if (!IsCallable(realm, callbackfn)) {\n      throw realm.createErrorThrowCompletion(realm.intrinsics.TypeError, \"not a function\");\n    }\n\n    // 4. If len is 0 and initialValue is not present, throw a TypeError exception.\n    if (len === 0 && !initialValue) {\n      throw realm.createErrorThrowCompletion(realm.intrinsics.TypeError, \"Array.prototype\");\n    }\n\n    // 5. Let k be len-1.\n    let k = len - 1;\n\n    // 6. If initialValue is present, then\n    let accumulator;\n    if (initialValue) {\n      // 1. Set accumulator to initialValue.\n      accumulator = initialValue;\n    } else {\n      // 7. Else initialValue is not present,\n      // a. Let kPresent be false.\n      let kPresent = false;\n\n      // b. Repeat, while kPresent is false and k ≥ 0\n      while (!kPresent && k >= 0) {\n        // i. Let Pk be ! ToString(k).\n        let Pk = new StringValue(realm, k + \"\");\n\n        // ii. Let kPresent be ? HasProperty(O, Pk).\n        kPresent = HasProperty(realm, O, Pk);\n\n        // iii. If kPresent is true, then\n        if (kPresent) {\n          // 1. Let accumulator be ? Get(O, Pk).\n          accumulator = Get(realm, O, Pk);\n        }\n\n        // iv. Decrease k by 1.\n        k--;\n      }\n\n      // c. If kPresent is false, throw a TypeError exception.\n      if (!kPresent || !accumulator) {\n        throw realm.createErrorThrowCompletion(realm.intrinsics.TypeError, \"Array.prototype\");\n      }\n    }\n\n    // 8. Repeat, while k ≥ 0\n    while (k >= 0) {\n      // a. Let Pk be ! ToString(k).\n      let Pk = new StringValue(realm, k + \"\");\n\n      // b. Let kPresent be ? HasProperty(O, Pk).\n      let kPresent = HasProperty(realm, O, Pk);\n\n      // c. If kPresent is true, then\n      if (kPresent) {\n        // i. Let kValue be ? Get(O, Pk).\n        let kValue = Get(realm, O, Pk);\n\n        // ii. Let accumulator be ? Call(callbackfn, undefined, « accumulator, kValue, k, O »).\n        accumulator = Call(realm, callbackfn, realm.intrinsics.undefined, [\n          accumulator,\n          kValue,\n          new NumberValue(realm, k),\n          O,\n        ]);\n      }\n\n      // d. Decrease k by 1.\n      k--;\n    }\n\n    // 9. Return accumulator.\n    return accumulator;\n  });\n\n  // ECMA262 22.1.3.21\n  obj.defineNativeMethod(\"reverse\", 0, context => {\n    // 1. Let O be ? ToObject(this value).\n    let O = To.ToObject(realm, context);\n\n    // If we have an object that is an array with widened numeric properties, then\n    // we can return a temporal here as we know nothing of the array's properties.\n    // This should be safe to do, as we never expose the internals of the array.\n    if (\n      ArrayValue.isIntrinsicAndHasWidenedNumericProperty(O) &&\n      realm.isInPureScope() &&\n      O.$GetOwnProperty(\"reverse\") === undefined\n    ) {\n      AbstractValue.createTemporalFromBuildFunction(\n        realm,\n        ArrayValue,\n        [O, new StringValue(realm, \"reverse\")],\n        createOperationDescriptor(\"UNKNOWN_ARRAY_METHOD_PROPERTY_CALL\")\n      );\n      return O;\n    }\n\n    // 2. Let len be ? ToLength(? Get(O, \"length\")).\n    let len = To.ToLength(realm, Get(realm, O, \"length\"));\n\n    // 3. Let middle be floor(len/2).\n    let middle = Math.floor(len / 2);\n\n    // 4. Let lower be 0.\n    let lower = 0;\n\n    // 5. Repeat, while lower ≠ middle\n    while (lower !== middle) {\n      // a. Let upper be len - lower - 1.\n      let upper = len - lower - 1;\n\n      // b. Let upperP be ! ToString(upper).\n      let upperP = new StringValue(realm, upper + \"\");\n\n      // c. Let lowerP be ! ToString(lower).\n      let lowerP = new StringValue(realm, lower + \"\");\n\n      // d. Let lowerExists be ? HasProperty(O, lowerP).\n      let lowerExists = HasProperty(realm, O, lowerP);\n\n      // e. If lowerExists is true, then\n      let lowerValue;\n      if (lowerExists) {\n        // i. Let lowerValue be ? Get(O, lowerP).\n        lowerValue = Get(realm, O, lowerP);\n      }\n\n      // f. Let upperExists be ? HasProperty(O, upperP).\n      let upperExists = HasProperty(realm, O, upperP);\n\n      // g. If upperExists is true, then\n      let upperValue;\n      if (upperExists) {\n        // i. Let upperValue be ? Get(O, upperP).\n        upperValue = Get(realm, O, upperP);\n      }\n\n      // h. If lowerExists is true and upperExists is true, then\n      if (lowerExists && upperExists) {\n        invariant(lowerValue, \"expected lower value to exist\");\n        invariant(upperValue, \"expected upper value to exist\");\n\n        // i. Perform ? Set(O, lowerP, upperValue, true).\n        Properties.Set(realm, O, lowerP, upperValue, true);\n\n        // ii. Perform ? Set(O, upperP, lowerValue, true).\n        Properties.Set(realm, O, upperP, lowerValue, true);\n      } else if (!lowerExists && upperExists) {\n        // i. Else if lowerExists is false and upperExists is true, then\n        invariant(upperValue, \"expected upper value to exist\");\n\n        // i. Perform ? Set(O, lowerP, upperValue, true).\n        Properties.Set(realm, O, lowerP, upperValue, true);\n\n        // ii. Perform ? DeletePropertyOrThrow(O, upperP).\n        Properties.DeletePropertyOrThrow(realm, O.throwIfNotConcreteObject(), upperP);\n      } else if (lowerExists && !upperExists) {\n        // j. Else if lowerExists is true and upperExists is false, then\n        invariant(lowerValue, \"expected lower value to exist\");\n\n        // i. Perform ? DeletePropertyOrThrow(O, lowerP).\n        Properties.DeletePropertyOrThrow(realm, O.throwIfNotConcreteObject(), lowerP);\n\n        // ii. Perform ? Set(O, upperP, lowerValue, true).\n        Properties.Set(realm, O, upperP, lowerValue, true);\n      } else {\n        // k. Else both lowerExists and upperExists are false,\n        // i. No action is required.\n      }\n\n      // l. Increase lower by 1.\n      lower++;\n    }\n\n    // 6. Return O.\n    return O;\n  });\n\n  // ECMA262 22.1.3.22\n  obj.defineNativeMethod(\"shift\", 0, context => {\n    // 1. Let O be ? ToObject(this value).\n    let O = To.ToObject(realm, context);\n\n    // If we have an object that is an array with widened numeric properties, then\n    // we can return a temporal here as we know nothing of the array's properties.\n    // This should be safe to do, as we never expose the internals of the array.\n    if (\n      ArrayValue.isIntrinsicAndHasWidenedNumericProperty(O) &&\n      realm.isInPureScope() &&\n      O.$GetOwnProperty(\"shift\") === undefined\n    ) {\n      return AbstractValue.createTemporalFromBuildFunction(\n        realm,\n        Value,\n        [O, new StringValue(realm, \"shift\")],\n        createOperationDescriptor(\"UNKNOWN_ARRAY_METHOD_PROPERTY_CALL\")\n      );\n    }\n\n    // 2. Let len be ? ToLength(? Get(O, \"length\")).\n    let len = To.ToLength(realm, Get(realm, O, \"length\"));\n\n    // 3. If len is zero, then\n    if (len === 0) {\n      // a. Perform ? Set(O, \"length\", 0, true).\n      Properties.Set(realm, O, \"length\", realm.intrinsics.zero, true);\n\n      // b. Return undefined.\n      return realm.intrinsics.undefined;\n    }\n\n    // 4. Let first be ? Get(O, \"0\").\n    let first = Get(realm, O, \"0\");\n\n    // 5. Let k be 1.\n    let k = 0;\n\n    // 6. Repeat, while k < len\n    while (k < len) {\n      // a. Let from be ! ToString(k).\n      let frm = new StringValue(realm, k + \"\");\n\n      // b. Let to be ! ToString(k-1).\n      let to = new StringValue(realm, k - 1 + \"\");\n\n      // c. Let fromPresent be ? HasProperty(O, from).\n      let fromPresent = HasProperty(realm, O, frm);\n\n      // d. If fromPresent is true, then\n      if (fromPresent) {\n        // i. Let fromVal be ? Get(O, from).\n        let fromVal = Get(realm, O, frm);\n\n        // ii. Perform ? Set(O, to, fromVal, true).\n        Properties.Set(realm, O, to, fromVal, true);\n      } else {\n        // d. Else fromPresent is false,\n        // i. Perform ? DeletePropertyOrThrow(O, to).\n        Properties.DeletePropertyOrThrow(realm, O.throwIfNotConcreteObject(), to);\n      }\n\n      // e. Increase k by 1.\n      k++;\n    }\n\n    // 7. Perform ? DeletePropertyOrThrow(O, ! ToString(len-1)).\n    Properties.DeletePropertyOrThrow(realm, O.throwIfNotConcreteObject(), new StringValue(realm, len - 1 + \"\"));\n\n    // 8. Perform ? Set(O, \"length\", len-1, true).\n    Properties.Set(realm, O, \"length\", new NumberValue(realm, len - 1), true);\n\n    // 9. Return first.\n    return first;\n  });\n\n  // ECMA262 22.1.3.23\n  obj.defineNativeMethod(\"slice\", 2, (context, [start, end]) => {\n    // 1. Let O be ? ToObject(this value).\n    let O = To.ToObject(realm, context);\n\n    if (\n      ArrayValue.isIntrinsicAndHasWidenedNumericProperty(O) &&\n      realm.isInPureScope() &&\n      O.$GetOwnProperty(\"slice\") === undefined\n    ) {\n      let newArgs = [O, new StringValue(realm, \"slice\"), start, end];\n      return ArrayValue.createTemporalWithWidenedNumericProperty(\n        realm,\n        newArgs,\n        createOperationDescriptor(\"UNKNOWN_ARRAY_METHOD_PROPERTY_CALL\")\n      );\n    }\n\n    // 2. Let len be ? ToLength(? Get(O, \"length\")).\n    let len = To.ToLength(realm, Get(realm, O, \"length\"));\n\n    // 3. Let relativeStart be ? ToInteger(start).\n    let relativeStart = To.ToInteger(realm, start);\n\n    // 4. If relativeStart < 0, let k be max((len + relativeStart), 0); else let k be min(relativeStart, len).\n    let k = relativeStart < 0 ? Math.max(len + relativeStart, 0) : Math.min(relativeStart, len);\n\n    // 5. If end is undefined, let relativeEnd be len; else let relativeEnd be ? ToInteger(end).\n    let relativeEnd = !end || end instanceof UndefinedValue ? len : To.ToInteger(realm, end.throwIfNotConcrete());\n\n    // 6. If relativeEnd < 0, let final be max((len + relativeEnd), 0); else let final be min(relativeEnd, len).\n    let final = relativeEnd < 0 ? Math.max(len + relativeEnd, 0) : Math.min(relativeEnd, len);\n\n    // 7. Let count be max(final - k, 0).\n    let count = Math.max(final - k, 0);\n\n    // 8. Let A be ? ArraySpeciesCreate(O, count).\n    let A = Create.ArraySpeciesCreate(realm, O.throwIfNotConcreteObject(), count);\n\n    // 9. Let n be 0.\n    let n = 0;\n\n    // 10. Repeat, while k < final\n    while (k < final) {\n      // a. Let Pk be ! ToString(k).\n      let Pk = new StringValue(realm, k + \"\");\n\n      // b. Let kPresent be ? HasProperty(O, Pk).\n      let kPresent = HasProperty(realm, O, Pk);\n\n      // c. If kPresent is true, then\n      if (kPresent) {\n        // i. Let kValue be ? Get(O, Pk).\n        let kValue = Get(realm, O, Pk);\n\n        // ii. Perform ? CreateDataPropertyOrThrow(A, ! ToString(n), kValue).\n        Create.CreateDataPropertyOrThrow(realm, A, new StringValue(realm, n + \"\"), kValue);\n      }\n\n      // d. Increase k by 1.\n      k++;\n\n      // e. Increase n by 1.\n      n++;\n    }\n\n    // 11. Perform ? Set(A, \"length\", n, true).\n    Properties.Set(realm, A, \"length\", new NumberValue(realm, n), true);\n\n    // 12. Return A.\n    return A;\n  });\n\n  // ECMA262 22.1.3.24\n  obj.defineNativeMethod(\"some\", 1, (context, [callbackfn, thisArg]) => {\n    // 1. Let O be ? ToObject(this value).\n    let O = To.ToObject(realm, context);\n\n    // If we have an object that is an array with widened numeric properties, then\n    // we can return a temporal here as we know nothing of the array's properties.\n    // This should be safe to do, as we never expose the internals of the array.\n    if (\n      ArrayValue.isIntrinsicAndHasWidenedNumericProperty(O) &&\n      realm.isInPureScope() &&\n      O.$GetOwnProperty(\"some\") === undefined\n    ) {\n      let args = [O, new StringValue(realm, \"some\"), callbackfn];\n      if (thisArg) {\n        args.push(thisArg);\n      }\n      return AbstractValue.createTemporalFromBuildFunction(\n        realm,\n        BooleanValue,\n        args,\n        createOperationDescriptor(\"UNKNOWN_ARRAY_METHOD_PROPERTY_CALL\")\n      );\n    }\n\n    // 2. Let len be ? ToLength(? Get(O, \"length\")).\n    let len = To.ToLength(realm, Get(realm, O, \"length\"));\n\n    // 3. If IsCallable(callbackfn) is false, throw a TypeError exception.\n    if (!IsCallable(realm, callbackfn)) {\n      throw realm.createErrorThrowCompletion(\n        realm.intrinsics.TypeError,\n        \"callback passed to Array.prototype.some isn't callable\"\n      );\n    }\n\n    // 4. If thisArg was supplied, let T be thisArg; else let T be undefined.\n    let T = thisArg || realm.intrinsics.undefined;\n\n    // 5. Let k be 0.\n    let k = 0;\n\n    // 6. Repeat, while k < len\n    while (k < len) {\n      // a. Let Pk be ! ToString(k).\n      let Pk = new StringValue(realm, k + \"\");\n\n      // b. Let kPresent be ? HasProperty(O, Pk).\n      let kPresent = HasProperty(realm, O, Pk);\n\n      // c. If kPresent is true, then\n      if (kPresent) {\n        // i. Let kValue be ? Get(O, Pk).\n        let kValue = Get(realm, O, Pk);\n\n        // ii. Let testResult be ToBoolean(? Call(callbackfn, T, « kValue, k, O »)).\n        let testResult = To.ToBooleanPartial(realm, Call(realm, callbackfn, T, [kValue, new NumberValue(realm, k), O]));\n\n        // iii. If testResult is true, return true.\n        if (testResult) return realm.intrinsics.true;\n      }\n\n      // d. Increase k by 1.\n      k++;\n    }\n\n    // 7. Return false.\n    return realm.intrinsics.false;\n  });\n\n  // ECMA262 22.1.3.25\n  obj.defineNativeMethod(\"sort\", 1, (context, [comparefn]) => {\n    // 1. Let obj be ? ToObject(this value).\n    let O = To.ToObject(realm, context);\n\n    // If we have an object that is an array with widened numeric properties, then\n    // we can return a temporal here as we know nothing of the array's properties.\n    // This should be safe to do, as we never expose the internals of the array.\n    if (\n      ArrayValue.isIntrinsicAndHasWidenedNumericProperty(O) &&\n      realm.isInPureScope() &&\n      O.$GetOwnProperty(\"sort\") === undefined\n    ) {\n      let args = [O, new StringValue(realm, \"sort\"), comparefn];\n      AbstractValue.createTemporalFromBuildFunction(\n        realm,\n        Value,\n        args,\n        createOperationDescriptor(\"UNKNOWN_ARRAY_METHOD_PROPERTY_CALL\")\n      );\n      // context is returned instead of O at the end of this method\n      // so we do the same here\n      return context;\n    }\n\n    // 2. Let len be ? ToLength(? Get(obj, \"length\")).\n    let len = To.ToLength(realm, Get(realm, O, \"length\"));\n\n    // Within this specification of the sort method, an object, obj, is said to be sparse if the following algorithm returns true:\n    let isSparse = () => {\n      // 1.For each integer i in the range 0≤i< len\n      for (let i = 0; i < len; i++) {\n        // a.Let elem be obj.[[GetOwnProperty]](! ToString(i)).\n        let elem = O.$GetOwnProperty(i.toString());\n        // b.If elem is undefined, return true.\n        if (elem === undefined) return true;\n        Properties.ThrowIfMightHaveBeenDeleted(elem);\n      }\n      // 2.Return false.\n      return false;\n    };\n    let sparse = isSparse();\n\n    // Let proto be obj.[[GetPrototypeOf]]().\n    let proto = O.$GetPrototypeOf();\n\n    // If proto is not null\n    if (!(proto instanceof NullValue)) {\n      // and there exists an integer j such that all of the conditions below are satisfied then the sort order is implementation-defined:\n      for (let j = 0; j < len; j++) {\n        // HasProperty(proto, ToString(j)) is true.\n        if (\n          HasProperty(realm, proto, j.toString()) &&\n          // obj is sparse\n          sparse\n        )\n          // We abord when the result of the sort is implementation defined.\n          throw Error(\"Implentation defined behavior detected\");\n      }\n    }\n\n    // The sort order is also implementation defined if obj is sparse and any of the following conditions are true:\n    if (sparse) {\n      // IsExtensible(obj) is false.\n      if (!IsExtensible(realm, O)) throw Error(\"Implementation defined behavior, Array is both sparse and extensible\");\n      // Any integer index property of obj whose name is a nonnegative integer less than len\n      for (let j = 0; j < len; j++) {\n        // is a data property whose [[Configurable]] attribute is false.\n        let prop = O.$GetOwnProperty(j.toString());\n        if (prop !== undefined && !prop.throwIfNotConcrete(realm).configurable) {\n          Properties.ThrowIfMightHaveBeenDeleted(prop);\n          throw Error(\n            \"Implementation defined behavior :  Array is sparse and it's prototype has some numbered properties\"\n          );\n        }\n      }\n    }\n\n    // Any integer index property of obj whose name is a nonnegative integer less than len\n    for (let j = 0; j < len; j++) {\n      //is a data property whose [[writable]] attribute is false.\n      let prop = O.$GetOwnProperty(j.toString());\n      if (prop !== undefined && !prop.throwIfNotConcrete(realm).writable) {\n        Properties.ThrowIfMightHaveBeenDeleted(prop);\n        throw Error(\"Implementation defined behavior : property \" + j.toString() + \"is non writable : \");\n      }\n    }\n\n    // The SortCompare abstract operation is called with two arguments x and y. It also has access to the comparefn\n    // argument passed to the current invocation of the sort method. The following steps are taken:\n\n    // 22.1.3.25.1 Runtime Semantics: SortCompare( x, y )#\n    let SortCompare = (x, y) => {\n      x = x.throwIfNotConcrete();\n      y = y.throwIfNotConcrete();\n      // 1. If x and y are both undefined, return +0.\n      if (x instanceof UndefinedValue && y instanceof UndefinedValue) {\n        return realm.intrinsics.zero;\n      }\n      // 2. If x is undefined, return 1.\n      if (x instanceof UndefinedValue) {\n        return new NumberValue(realm, 1);\n      }\n      // 3. If y is undefined, return -1.\n      if (y instanceof UndefinedValue) {\n        return new NumberValue(realm, -1);\n      }\n      // 4. If the argument comparefn is not undefined, then\n      if (!comparefn.mightBeUndefined()) {\n        // a. Let v be ? ToNumber(? Call(comparefn, undefined, « x, y »)).\n        let v = To.ToNumber(realm, Call(realm, comparefn, new UndefinedValue(realm), [x, y]));\n        // b. If v is NaN, return +0.\n        if (isNaN(v)) return new NumberValue(realm, +0);\n        // c. Return v.\n        return new NumberValue(realm, v);\n      } else {\n        comparefn.throwIfNotConcrete();\n      }\n      // 5. Let xString be ? ToString(x).\n      let xString = new StringValue(realm, To.ToString(realm, x));\n      // 6. Let yString be ? ToString(y).\n      let yString = new StringValue(realm, To.ToString(realm, y));\n      // 7. Let xSmaller be the result of performing Abstract Relational Comparison xString < yString.\n      let xSmaller = AbstractRelationalComparison(realm, xString, yString, true, \"<\");\n      // 8. If xSmaller is true, return -1.\n      if (xSmaller.value) return new NumberValue(realm, -1);\n      // 9. Let ySmaller be the result of performing Abstract Relational Comparison yString < xString.\n      let ySmaller = AbstractRelationalComparison(realm, yString, xString, true, \"<\");\n      // 10. If ySmaller is true, return 1.\n      if (ySmaller.value) return new NumberValue(realm, 1);\n      // 11. Return +0.\n      return realm.intrinsics.zero;\n    };\n\n    //1. Perform an implementation-dependent sequence of calls to the [[Get]] and [[Set]] internal methods of obj, to the DeletePropertyOrThrow and HasOwnProperty abstract operation with obj as the first argument, and to SortCompare (described below), such that:\n    //   The property key argument for each call to [[Get]], [[Set]], HasOwnProperty, or DeletePropertyOrThrow is the string representation of a nonnegative integer less than len.\n\n    // We leverage the underlying implementation sort by copying the element in a temp. array, sorting it, and\n    // transfering back the value inside the our array.\n\n    let arr = [];\n\n    // We need to adapt the comparefn function to match the expected types\n    let comparefn_ = (x, y) => {\n      invariant(x instanceof Value, \"Unexpected type\");\n      invariant(y instanceof Value, \"Unexpected type\");\n\n      let result_ = SortCompare(x, y);\n      let numb = To.ToNumber(realm, result_);\n      return numb;\n    };\n\n    for (let j = 0; j < len; j++) {\n      // The property key argument for each call to [[Get]], [[Set]], HasOwnProperty, or DeletePropertyOrThrow is the string representation of a nonnegative integer less than len.\n      if (!HasOwnProperty(realm, O, j.toString())) continue;\n      // The arguments for calls to SortCompare are values returned by a previous call to the [[Get]] internal method,\n      // unless the properties accessed by those previous calls did not exist according to HasOwnProperty.\n\n      // -- Important : We rely on the fact that the underlying sort implementation respect the standard for the following 3 properties\n      // If both perspective arguments to SortCompare correspond to non-existent properties,\n      // use +0 instead of calling SortCompare. If only the first perspective argument is non-existent use +1.\n      // If only the second perspective argument is non-existent use -1.\n      let val = O.$Get(j.toString(), O);\n      arr[j] = val;\n    }\n\n    arr.sort(comparefn_);\n\n    //Apply the permutation back to the original array.\n    for (let j = 0; j < len; j++) {\n      if (arr.hasOwnProperty(j.toString())) {\n        let ok = O.$Set(j.toString(), arr[j], O);\n        // If any [[Set]] call returns false a TypeError exception is thrown.\n        if (!ok) throw realm.createErrorThrowCompletion(realm.intrinsics.TypeError, \"[[Set]] returned false\");\n      } else {\n        // If obj is not sparse then DeletePropertyOrThrow must not be called.\n        invariant(sparse);\n        Properties.DeletePropertyOrThrow(realm, O.throwIfNotConcreteObject(), j.toString());\n      }\n    }\n    // If an abrupt completion is returned from any of these operations, it is immediately returned as the value of this function.\n\n    // 2. Return obj;\n    return context;\n  });\n\n  // ECMA262 22.1.3.26\n  obj.defineNativeMethod(\"splice\", 2, (context, [start, deleteCount, ...items], argLength) => {\n    // 1. Let O be ? ToObject(this value).\n    let O = To.ToObject(realm, context);\n\n    // If we have an object that is an array with widened numeric properties, then\n    // we can return a temporal here as we know nothing of the array's properties.\n    // This should be safe to do, as we never expose the internals of the array.\n    if (\n      ArrayValue.isIntrinsicAndHasWidenedNumericProperty(O) &&\n      realm.isInPureScope() &&\n      O.$GetOwnProperty(\"splice\") === undefined\n    ) {\n      let args = [O, new StringValue(realm, \"splice\"), start];\n      if (deleteCount) {\n        args.push(deleteCount);\n      }\n      if (items && items.length > 0) {\n        args.push(...items);\n      }\n      return AbstractValue.createTemporalFromBuildFunction(\n        realm,\n        ArrayValue,\n        args,\n        createOperationDescriptor(\"UNKNOWN_ARRAY_METHOD_PROPERTY_CALL\")\n      );\n    }\n\n    // 2. Let len be ? ToLength(? Get(O, \"length\")).\n    let len = To.ToLength(realm, Get(realm, O, \"length\"));\n\n    // 3. Let relativeStart be ? ToInteger(start).\n    let relativeStart = To.ToInteger(realm, start);\n\n    // 4. If relativeStart < 0, let actualStart be max((len + relativeStart), 0); else let actualStart be min(relativeStart, len).\n    let actualStart = relativeStart < 0 ? Math.max(len + relativeStart, 0) : Math.min(relativeStart, len);\n\n    let insertCount;\n    let actualDeleteCount;\n\n    // 5. If the number of actual arguments is 0, then\n    if (argLength === 0) {\n      // a. Let insertCount be 0.\n      insertCount = 0;\n\n      // b. Let actualDeleteCount be 0.\n      actualDeleteCount = 0;\n    } else if (argLength === 1) {\n      // 6. Else if the number of actual arguments is 1, then\n      // a. Let insertCount be 0.\n      insertCount = 0;\n\n      // b. Let actualDeleteCount be len - actualStart.\n      actualDeleteCount = len - actualStart;\n    } else {\n      // 7. Else,\n      // a. Let insertCount be the number of actual arguments minus 2.\n      insertCount = argLength - 2;\n\n      // b. Let dc be ? ToInteger(deleteCount).\n      let dc = To.ToInteger(realm, deleteCount);\n\n      // c. Let actualDeleteCount be min(max(dc, 0), len - actualStart).\n      actualDeleteCount = Math.min(Math.max(dc, 0), len - actualStart);\n    }\n\n    // 8. If len+insertCount-actualDeleteCount > 2^53-1, throw a TypeError exception.\n    if (len + insertCount - actualDeleteCount > Math.pow(2, 53) - 1) {\n      throw realm.createErrorThrowCompletion(realm.intrinsics.TypeError, \"the item count is too damn high\");\n    }\n\n    // 9. Let A be ? ArraySpeciesCreate(O, actualDeleteCount).\n    let A = Create.ArraySpeciesCreate(realm, O.throwIfNotConcreteObject(), actualDeleteCount);\n\n    // 10. Let k be 0.\n    let k = 0;\n\n    // 11. Repeat, while k < actualDeleteCount\n    while (k < actualDeleteCount) {\n      // a. Let from be ! ToString(actualStart+k).\n      let frm = new StringValue(realm, actualStart + k + \"\");\n\n      // b. Let fromPresent be ? HasProperty(O, from).\n      let fromPresent = HasProperty(realm, O, frm);\n\n      // c. If fromPresent is true, then\n      if (fromPresent) {\n        // i. Let fromValue be ? Get(O, from).\n        let fromValue = Get(realm, O, frm);\n\n        // ii. Perform ? CreateDataPropertyOrThrow(A, ! ToString(k), fromValue).\n        Create.CreateDataPropertyOrThrow(realm, A, new StringValue(realm, k + \"\"), fromValue);\n      }\n\n      // d. Increment k by 1.\n      k++;\n    }\n\n    // 12. Perform ? Set(A, \"length\", actualDeleteCount, true).\n    Properties.Set(realm, A, \"length\", new NumberValue(realm, actualDeleteCount), true);\n\n    // 13. Let items be a List whose elements are, in left to right order, the portion of the actual argument\n    //     list starting with the third argument. The list is empty if fewer than three arguments were passed.\n    items;\n\n    // 14. Let itemCount be the number of elements in items.\n    let itemCount = items.length;\n\n    // 15. If itemCount < actualDeleteCount, then\n    if (itemCount < actualDeleteCount) {\n      // a. Let k be actualStart.\n      k = actualStart;\n\n      // b. Repeat, while k < (len - actualDeleteCount)\n      while (k < len - actualDeleteCount) {\n        // i. Let from be ! ToString(k+actualDeleteCount).\n        let frm = new StringValue(realm, k + actualDeleteCount + \"\");\n\n        // ii. Let to be ! ToString(k+itemCount).\n        let to = new StringValue(realm, k + itemCount + \"\");\n\n        // iii. Let fromPresent be ? HasProperty(O, from).\n        let fromPresent = HasProperty(realm, O, frm);\n\n        // iv. If fromPresent is true, then\n        if (fromPresent) {\n          // 1. Let fromValue be ? Get(O, from).\n          let fromValue = Get(realm, O, frm);\n\n          // 2. Perform ? Set(O, to, fromValue, true).\n          Properties.Set(realm, O, to, fromValue, true);\n        } else {\n          // v. Else fromPresent is false,\n          // 1. Perform ? DeletePropertyOrThrow(O, to).\n          Properties.DeletePropertyOrThrow(realm, O.throwIfNotConcreteObject(), to);\n        }\n\n        // vi. Increase k by 1.\n        k++;\n      }\n\n      // c. Let k be len.\n      k = len;\n\n      // d. Repeat, while k > (len - actualDeleteCount + itemCount)\n      while (k > len - actualDeleteCount + itemCount) {\n        // i. Perform ? DeletePropertyOrThrow(O, ! ToString(k-1)).\n        Properties.DeletePropertyOrThrow(realm, O.throwIfNotConcreteObject(), new StringValue(realm, k - 1 + \"\"));\n\n        // ii. Decrease k by 1.\n        k--;\n      }\n    } else if (itemCount > actualDeleteCount) {\n      // 16. Else if itemCount > actualDeleteCount, then\n      // a. Let k be (len - actualDeleteCount).\n      k = len - actualDeleteCount;\n\n      // b. Repeat, while k > actualStart\n      while (k > actualStart) {\n        // i. Let from be ! ToString(k + actualDeleteCount - 1).\n        let frm = new StringValue(realm, k + actualDeleteCount - 1 + \"\");\n\n        // ii. Let to be ! ToString(k + itemCount - 1).\n        let to = new StringValue(realm, k + itemCount - 1 + \"\");\n\n        // iii. Let fromPresent be ? HasProperty(O, from).\n        let fromPresent = HasProperty(realm, O, frm);\n\n        // iv. If fromPresent is true, then\n        if (fromPresent) {\n          // 1. Let fromValue be ? Get(O, from).\n          let fromValue = Get(realm, O, frm);\n\n          // 2. Perform ? Set(O, to, fromValue, true).\n          Properties.Set(realm, O, to, fromValue, true);\n        } else {\n          // v. Else fromPresent is false,\n          // 1. Perform ? DeletePropertyOrThrow(O, to).\n          Properties.DeletePropertyOrThrow(realm, O.throwIfNotConcreteObject(), to);\n        }\n\n        // vi. Decrease k by 1.\n        k--;\n      }\n    }\n\n    // 17. Let k be actualStart.\n    k = actualStart;\n\n    // 18. Repeat, while items is not empty\n    while (items.length) {\n      // a. Remove the first element from items and let E be the value of that element.\n      let E = items.shift();\n\n      // b. Perform ? Set(O, ! ToString(k), E, true).\n      Properties.Set(realm, O, new StringValue(realm, k + \"\"), E, true);\n\n      // c. Increase k by 1.\n      k++;\n    }\n\n    // 19. Perform ? Set(O, \"length\", len - actualDeleteCount + itemCount, true).\n    Properties.Set(realm, O, \"length\", new NumberValue(realm, len - actualDeleteCount + itemCount), true);\n\n    // 20. Return A.\n    return A;\n  });\n\n  // ECMA262 22.1.3.27\n  obj.defineNativeMethod(\"toLocaleString\", 0, context => {\n    // 1. Let array be ? ToObject(this value).\n    let array = To.ToObject(realm, context);\n\n    // If we have an object that is an array with widened numeric properties, then\n    // we can return a temporal here as we know nothing of the array's properties.\n    // This should be safe to do, as we never expose the internals of the array.\n    if (\n      ArrayValue.isIntrinsicAndHasWidenedNumericProperty(array) &&\n      realm.isInPureScope() &&\n      array.$GetOwnProperty(\"toLocaleString\") === undefined\n    ) {\n      return AbstractValue.createTemporalFromBuildFunction(\n        realm,\n        StringValue,\n        [array, new StringValue(realm, \"toLocaleString\")],\n        createOperationDescriptor(\"UNKNOWN_ARRAY_METHOD_PROPERTY_CALL\")\n      );\n    }\n\n    // 2. Let len be ? ToLength(? Get(array, \"length\")).\n    let len = To.ToLength(realm, Get(realm, array, \"length\"));\n\n    // 3. Let separator be the String value for the list-separator String appropriate for the host environment's\n    //    current locale (this is derived in an implementation-defined way).\n    let separator = \",\";\n\n    // 4. If len is zero, return the empty String.\n    if (len === 0) return realm.intrinsics.emptyString;\n\n    // 5. Let firstElement be ? Get(array, \"0\").\n    let firstElement = Get(realm, array, \"0\");\n\n    // 6. If firstElement is undefined or null, then\n    let R: ?string;\n    if (HasSomeCompatibleType(firstElement, UndefinedValue, NullValue)) {\n      // a. Let R be the empty String.\n      R = \"\";\n    } else {\n      // 7. Else,\n      // a. Let R be ? ToString(? Invoke(firstElement, \"toLocaleString\")).\n      R = To.ToStringPartial(realm, Invoke(realm, firstElement, \"toLocaleString\"));\n    }\n\n    // 8. Let k be 1.\n    let k = 1;\n\n    // 9. Repeat, while k < len\n    while (k < len) {\n      // a. Let S be a String value produced by concatenating R and separator.\n      let S: string = R + separator;\n\n      // b. Let nextElement be ? Get(array, ! ToString(k)).\n      let nextElement = Get(realm, array, new StringValue(realm, k + \"\")).throwIfNotConcrete();\n\n      // c. If nextElement is undefined or null, then\n      if (HasSomeCompatibleType(nextElement, UndefinedValue, NullValue)) {\n        // i. Let R be the empty String.\n        R = \"\";\n      } else {\n        // d. Else,\n        // i. Let R be ? ToString(? Invoke(nextElement, \"toLocaleString\")).\n        R = To.ToStringPartial(realm, Invoke(realm, nextElement, \"toLocaleString\"));\n      }\n\n      // e. Let R be a String value produced by concatenating S and R.\n      R = S + R;\n\n      // f. Increase k by 1.\n      k++;\n    }\n\n    // 10. Return R.\n    return new StringValue(realm, R);\n  });\n\n  // ECMA262 22.1.3.28\n  obj.defineNativeProperty(\"toString\", realm.intrinsics.ArrayProto_toString);\n\n  // ECMA262 22.1.3.29\n  obj.defineNativeMethod(\"unshift\", 1, (context, items, argCount) => {\n    // 1. Let O be ? ToObject(this value).\n    let O = To.ToObject(realm, context);\n\n    // If we have an object that is an array with widened numeric properties, then\n    // we can return a temporal here as we know nothing of the array's properties.\n    // This should be safe to do, as we never expose the internals of the array.\n    if (\n      ArrayValue.isIntrinsicAndHasWidenedNumericProperty(O) &&\n      realm.isInPureScope() &&\n      O.$GetOwnProperty(\"unshift\") === undefined\n    ) {\n      return AbstractValue.createTemporalFromBuildFunction(\n        realm,\n        NumberValue,\n        [O, new StringValue(realm, \"unshift\")],\n        createOperationDescriptor(\"UNKNOWN_ARRAY_METHOD_PROPERTY_CALL\")\n      );\n    }\n\n    // 2. Let len be ? ToLength(? Get(O, \"length\")).\n    let len = To.ToLength(realm, Get(realm, O, \"length\"));\n\n    // 3. Let argCount be the number of actual arguments.\n    argCount;\n\n    // 4. If argCount > 0, then\n    if (argCount > 0) {\n      // a. If len+argCount > 2^53-1, throw a TypeError exception.\n      if (len + argCount > Math.pow(2, 53) - 1) {\n        throw realm.createErrorThrowCompletion(realm.intrinsics.TypeError, \"too damn high\");\n      }\n\n      // b. Let k be len.\n      let k = len;\n\n      // c. Repeat, while k > 0,\n      while (k > 0) {\n        // i. Let from be ! ToString(k-1).\n        let frm = new StringValue(realm, k - 1 + \"\");\n\n        // ii. Let to be ! ToString(k+argCount-1).\n        let to = new StringValue(realm, k + argCount - 1 + \"\");\n\n        // iv. Let fromPresent be ? HasProperty(O, from).\n        let fromPresent = HasProperty(realm, O, frm);\n\n        // v. If fromPresent is true, then\n        if (fromPresent) {\n          // 1. Let fromValue be ? Get(O, from).\n          let fromValue = Get(realm, O, frm);\n\n          // 2. Perform ? Set(O, to, fromValue, true).\n          Properties.Set(realm, O, to, fromValue, true);\n        } else {\n          // vi. Else fromPresent is false,\n          // 1. Perform ? DeletePropertyOrThrow(O, to).\n          Properties.DeletePropertyOrThrow(realm, O.throwIfNotConcreteObject(), to);\n        }\n\n        // vii. Decrease k by 1.\n        k--;\n      }\n\n      // e. Let j be 0.\n      let j = 0;\n\n      // f. Let items be a List whose elements are, in left to right order, the arguments that were passed to\n      //    this function invocation.\n      items;\n\n      // g. Repeat, while items is not empty\n      while (items.length) {\n        // i. Remove the first element from items and let E be the value of that element.\n        let E = items.shift();\n\n        // ii. Perform ? Set(O, ! ToString(j), E, true).\n        Properties.Set(realm, O, new StringValue(realm, j + \"\"), E, true);\n\n        // iii. Increase j by 1.\n        j++;\n      }\n    }\n\n    // 5. Perform ? Set(O, \"length\", len+argCount, true).\n    Properties.Set(realm, O, \"length\", new NumberValue(realm, len + argCount), true);\n\n    // 6. Return len+argCount.\n    return new NumberValue(realm, len + argCount);\n  });\n\n  // ECMA262 22.1.3.30\n  obj.defineNativeProperty(\"values\", realm.intrinsics.ArrayProto_values);\n\n  // ECMA262 22.1.3.32\n  {\n    // 1. Let unscopableList be ObjectCreate(null).\n    let unscopableList = Create.ObjectCreate(realm, realm.intrinsics.null);\n\n    // 2. Perform CreateDataProperty(unscopableList, \"copyWithin\", true).\n    Create.CreateDataProperty(realm, unscopableList, \"copyWithin\", realm.intrinsics.true);\n\n    // 3. Perform CreateDataProperty(unscopableList, \"entries\", true).\n    Create.CreateDataProperty(realm, unscopableList, \"entries\", realm.intrinsics.true);\n\n    // 4. Perform CreateDataProperty(unscopableList, \"fill\", true).\n    Create.CreateDataProperty(realm, unscopableList, \"fill\", realm.intrinsics.true);\n\n    // 5. Perform CreateDataProperty(unscopableList, \"find\", true).\n    Create.CreateDataProperty(realm, unscopableList, \"find\", realm.intrinsics.true);\n\n    // 6. Perform CreateDataProperty(unscopableList, \"findIndex\", true).\n    Create.CreateDataProperty(realm, unscopableList, \"findIndex\", realm.intrinsics.true);\n\n    // 7. Perform CreateDataProperty(unscopableList, \"includes\", true).\n    Create.CreateDataProperty(realm, unscopableList, \"includes\", realm.intrinsics.true);\n\n    // 8. Perform CreateDataProperty(unscopableList, \"keys\", true).\n    Create.CreateDataProperty(realm, unscopableList, \"keys\", realm.intrinsics.true);\n\n    // 9. Perform CreateDataProperty(unscopableList, \"values\", true).\n    Create.CreateDataProperty(realm, unscopableList, \"values\", realm.intrinsics.true);\n\n    // 10. Assert: Each of the above calls will return true.\n\n    // 11. Return unscopableList.\n    obj.defineNativeProperty(realm.intrinsics.SymbolUnscopables, unscopableList, {\n      writable: false,\n    });\n  }\n}\n"
  },
  {
    "path": "src/intrinsics/ecma262/Boolean.js",
    "content": "/**\n * Copyright (c) 2017-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n/* @flow strict-local */\n\nimport type { Realm } from \"../../realm.js\";\nimport { NativeFunctionValue, BooleanValue } from \"../../values/index.js\";\nimport { Create, To } from \"../../singletons.js\";\n\nexport default function(realm: Realm): NativeFunctionValue {\n  // ECMA262 19.3.1.1\n  let func = new NativeFunctionValue(realm, \"Boolean\", \"Boolean\", 1, (context, [value], argCount, NewTarget) => {\n    // 1. Let b be ToBoolean(value).\n    let b = new BooleanValue(realm, To.ToBooleanPartial(realm, value));\n\n    // 2. If NewTarget is undefined, return b.\n    if (!NewTarget) return b;\n\n    // 3. Let O be ? OrdinaryCreateFromConstructor(NewTarget, \"%BooleanPrototype%\", « [[BooleanData]] »).\n    let O = Create.OrdinaryCreateFromConstructor(realm, NewTarget, \"BooleanPrototype\", { $BooleanData: undefined });\n\n    // 4. Set the value of O's [[BooleanData]] internal slot to b.\n    O.$BooleanData = b;\n\n    // 5. Return O.\n    return O;\n  });\n\n  return func;\n}\n"
  },
  {
    "path": "src/intrinsics/ecma262/BooleanPrototype.js",
    "content": "/**\n * Copyright (c) 2017-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n/* @flow strict-local */\n\nimport type { Realm } from \"../../realm.js\";\nimport { ObjectValue, StringValue, AbstractValue, BooleanValue } from \"../../values/index.js\";\nimport { To } from \"../../singletons.js\";\n\nexport default function(realm: Realm, obj: ObjectValue): void {\n  // ECMA262 19.3.1\n  obj.$BooleanData = realm.intrinsics.false;\n\n  const tsTemplateSrc = \"('' + A)\";\n\n  // ECMA262 19.3.3.3\n  obj.defineNativeMethod(\"toString\", 0, context => {\n    const target = context instanceof ObjectValue ? context.$BooleanData : context;\n    if (target instanceof AbstractValue && target.getType() === BooleanValue) {\n      return AbstractValue.createFromTemplate(realm, tsTemplateSrc, StringValue, [target]);\n    }\n    // 1. Let b be ? thisBooleanValue(this value).\n    let b = To.thisBooleanValue(realm, context);\n\n    // 2. If b is true, return \"true\"; else return \"false\".\n    return new StringValue(realm, b.value ? \"true\" : \"false\");\n  });\n\n  // ECMA262 19.3.3.4\n  obj.defineNativeMethod(\"valueOf\", 0, context => {\n    // 1. Return ? thisBooleanValue(this value).\n    return To.thisBooleanValue(realm, context);\n  });\n}\n"
  },
  {
    "path": "src/intrinsics/ecma262/DataView.js",
    "content": "/**\n * Copyright (c) 2017-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n/* @flow strict-local */\n\nimport type { Realm } from \"../../realm.js\";\nimport { IsDetachedBuffer } from \"../../methods/index.js\";\nimport { NativeFunctionValue, ObjectValue, UndefinedValue } from \"../../values/index.js\";\nimport { Create, To } from \"../../singletons.js\";\nimport invariant from \"../../invariant.js\";\n\nexport default function(realm: Realm): NativeFunctionValue {\n  // ECMA262 24.2.2.1\n  let func = new NativeFunctionValue(\n    realm,\n    \"DataView\",\n    \"DataView\",\n    3,\n    (context, [_buffer, byteOffset, byteLength], argCount, NewTarget) => {\n      let buffer = _buffer;\n      // 1. If NewTarget is undefined, throw a TypeError exception.\n      if (!NewTarget) {\n        throw realm.createErrorThrowCompletion(realm.intrinsics.TypeError);\n      }\n\n      buffer = buffer.throwIfNotConcrete();\n      // 2. If Type(buffer) is not Object, throw a TypeError exception.\n      if (!(buffer instanceof ObjectValue)) {\n        throw realm.createErrorThrowCompletion(realm.intrinsics.TypeError);\n      }\n\n      // 3. If buffer does not have an [[ArrayBufferData]] internal slot, throw a TypeError exception.\n      if (!(\"$ArrayBufferData\" in buffer)) {\n        throw realm.createErrorThrowCompletion(realm.intrinsics.TypeError);\n      }\n\n      // 4. Let offset be ? ToIndex(byteOffset).\n      let offset = To.ToIndexPartial(realm, byteOffset);\n\n      // 5. If IsDetachedBuffer(buffer) is true, throw a TypeError exception.\n      if (IsDetachedBuffer(realm, buffer)) {\n        throw realm.createErrorThrowCompletion(realm.intrinsics.TypeError);\n      }\n\n      // 6. Let bufferByteLength be the value of buffer's [[ArrayBufferByteLength]] internal slot.\n      let bufferByteLength = buffer.$ArrayBufferByteLength;\n      invariant(typeof bufferByteLength === \"number\");\n\n      // 7. If offset > bufferByteLength, throw a RangeError exception.\n      if (offset > bufferByteLength) {\n        throw realm.createErrorThrowCompletion(realm.intrinsics.RangeError);\n      }\n\n      // 8. If byteLength is undefined, then\n      let viewByteLength;\n      if (!byteLength || byteLength instanceof UndefinedValue) {\n        // a. Let viewByteLength be bufferByteLength - offset.\n        viewByteLength = bufferByteLength - offset;\n      } else {\n        // 9. Else,\n        // a. Let viewByteLength be ? ToIndex(byteLength).\n        viewByteLength = To.ToIndexPartial(realm, byteLength);\n\n        // b. If offset+viewByteLength > bufferByteLength, throw a RangeError exception.\n        if (offset + viewByteLength > bufferByteLength) {\n          throw realm.createErrorThrowCompletion(realm.intrinsics.RangeError);\n        }\n      }\n\n      // 10. Let O be ? OrdinaryCreateFromConstructor(NewTarget, \"%DataViewPrototype%\", « [[DataView]], [[ViewedArrayBuffer]], [[ByteLength]], [[ByteOffset]] »).\n      let O = Create.OrdinaryCreateFromConstructor(realm, NewTarget, \"DataViewPrototype\", {\n        $DataView: undefined,\n        $ViewedArrayBuffer: undefined,\n        $ByteLength: undefined,\n        $ByteOffset: undefined,\n      });\n\n      // 11. Set O's [[DataView]] internal slot to true.\n      O.$DataView = true;\n\n      // 12. Set O's [[ViewedArrayBuffer]] internal slot to buffer.\n      O.$ViewedArrayBuffer = buffer;\n\n      // 13. Set O's [[ByteLength]] internal slot to viewByteLength.\n      O.$ByteLength = viewByteLength;\n\n      // 14. Set O's [[ByteOffset]] internal slot to offset.\n      O.$ByteOffset = offset;\n\n      // 15. Return O.\n      return O;\n    }\n  );\n\n  return func;\n}\n"
  },
  {
    "path": "src/intrinsics/ecma262/DataViewPrototype.js",
    "content": "/**\n * Copyright (c) 2017-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n/* @flow strict-local */\n\nimport type { Realm } from \"../../realm.js\";\nimport { ObjectValue, StringValue, NumberValue } from \"../../values/index.js\";\nimport { IsDetachedBuffer } from \"../../methods/is.js\";\nimport { GetViewValue, SetViewValue } from \"../../methods/arraybuffer.js\";\nimport invariant from \"../../invariant.js\";\n\nexport default function(realm: Realm, obj: ObjectValue): void {\n  // ECMA262 24.2.4.1\n  obj.defineNativeGetter(\"buffer\", context => {\n    // 1. Let O be the this value.\n    let O = context.throwIfNotConcrete();\n\n    // 2. If Type(O) is not Object, throw a TypeError exception.\n    if (!(O instanceof ObjectValue)) {\n      throw realm.createErrorThrowCompletion(realm.intrinsics.TypeError, \"Type(O) is not Object\");\n    }\n\n    // 3. If O does not have a [[DataView]] internal slot, throw a TypeError exception.\n    if (!(\"$DataView\" in O)) {\n      throw realm.createErrorThrowCompletion(\n        realm.intrinsics.TypeError,\n        \"O does not have a [[DataView]] internal slot\"\n      );\n    }\n\n    // 4. Assert: O has a [[ViewedArrayBuffer]] internal slot.\n    invariant(O.$ViewedArrayBuffer);\n\n    // 5. Let buffer be O.[[ViewedArrayBuffer]].\n    let buffer = O.$ViewedArrayBuffer;\n\n    // 6. Return buffer.\n    return buffer;\n  });\n\n  // ECMA262 24.2.4.2\n  obj.defineNativeGetter(\"byteLength\", context => {\n    // 1. Let O be the this value.\n    let O = context.throwIfNotConcrete();\n\n    // 2. If Type(O) is not Object, throw a TypeError exception.\n    if (!(O instanceof ObjectValue)) {\n      throw realm.createErrorThrowCompletion(realm.intrinsics.TypeError, \"Type(O) is not Object\");\n    }\n\n    // 3. If O does not have a [[DataView]] internal slot, throw a TypeError exception.\n    if (!(\"$DataView\" in O)) {\n      throw realm.createErrorThrowCompletion(\n        realm.intrinsics.TypeError,\n        \"O does not have a [[DataView]] internal slot\"\n      );\n    }\n\n    // 4. Assert: O has a [[ViewedArrayBuffer]] internal slot.\n    invariant(O.$ViewedArrayBuffer);\n\n    // 5. Let buffer be O.[[ViewedArrayBuffer]].\n    let buffer = O.$ViewedArrayBuffer;\n\n    // 6. If IsDetachedBuffer(buffer) is true, throw a TypeError exception.\n    if (IsDetachedBuffer(realm, buffer) === true) {\n      throw realm.createErrorThrowCompletion(realm.intrinsics.TypeError, \"IsDetachedBuffer(buffer) is true\");\n    }\n\n    // 7. Let size be O.[[ByteLength]].\n    let size = O.$ByteLength;\n    invariant(typeof size === \"number\");\n\n    // 8. Return size.\n    return new NumberValue(realm, size);\n  });\n\n  // ECMA262 24.2.4.3\n  obj.defineNativeGetter(\"byteOffset\", context => {\n    // 1. Let O be the this value.\n    let O = context.throwIfNotConcrete();\n\n    // 2. If Type(O) is not Object, throw a TypeError exception.\n    if (!(O instanceof ObjectValue)) {\n      throw realm.createErrorThrowCompletion(realm.intrinsics.TypeError, \"Type(O) is not Object\");\n    }\n\n    // 3. If O does not have a [[DataView]] internal slot, throw a TypeError exception.\n    if (!(\"$DataView\" in O)) {\n      throw realm.createErrorThrowCompletion(\n        realm.intrinsics.TypeError,\n        \"O does not have a [[DataView]] internal slot\"\n      );\n    }\n\n    // 4. Assert: O has a [[ViewedArrayBuffer]] internal slot.\n    invariant(O.$ViewedArrayBuffer);\n\n    // 5. Let buffer be O.[[ViewedArrayBuffer]].\n    let buffer = O.$ViewedArrayBuffer;\n\n    // 6. If IsDetachedBuffer(buffer) is true, throw a TypeError exception.\n    if (IsDetachedBuffer(realm, buffer) === true) {\n      throw realm.createErrorThrowCompletion(realm.intrinsics.TypeError, \"IsDetachedBuffer(buffer) is true\");\n    }\n\n    // 7. Let offset be O.[[ByteOffset]].\n    let offset = O.$ByteOffset;\n    invariant(typeof offset === \"number\");\n\n    // 8. Return offset.\n    return new NumberValue(realm, offset);\n  });\n\n  // ECMA262 24.2.4.5\n  obj.defineNativeMethod(\"getFloat32\", 1, (context, [byteOffset, _littleEndian]) => {\n    let littleEndian = _littleEndian;\n    // 1. Let v be the this value.\n    let v = context;\n\n    // 2. If littleEndian is not present, let littleEndian be false.\n    if (!littleEndian) littleEndian = realm.intrinsics.false;\n\n    // 3. Return ? GetViewValue(v, byteOffset, littleEndian, \"Float32\").\n    return GetViewValue(realm, v, byteOffset, littleEndian, \"Float32\");\n  });\n\n  // ECMA262 24.2.4.6\n  obj.defineNativeMethod(\"getFloat64\", 1, (context, [byteOffset, _littleEndian]) => {\n    let littleEndian = _littleEndian;\n    // 1. Let v be the this value.\n    let v = context;\n\n    // 2. If littleEndian is not present, let littleEndian be false.\n    if (!littleEndian) littleEndian = realm.intrinsics.false;\n\n    // 3. Return ? GetViewValue(v, byteOffset, littleEndian, \"Float64\").\n    return GetViewValue(realm, v, byteOffset, littleEndian, \"Float64\");\n  });\n\n  // ECMA262 24.2.4.7\n  obj.defineNativeMethod(\"getInt8\", 1, (context, [byteOffset]) => {\n    // 1. Let v be the this value.\n    let v = context;\n\n    // 2. Return ? GetViewValue(v, byteOffset, true, \"Int8\").\n    return GetViewValue(realm, v, byteOffset, realm.intrinsics.true, \"Int8\");\n  });\n\n  // ECMA262 24.2.4.8\n  obj.defineNativeMethod(\"getInt16\", 1, (context, [byteOffset, _littleEndian]) => {\n    let littleEndian = _littleEndian;\n    // 1. Let v be the this value.\n    let v = context;\n\n    // 2. If littleEndian is not present, let littleEndian be false.\n    if (!littleEndian) littleEndian = realm.intrinsics.false;\n\n    // 3. Return ? GetViewValue(v, byteOffset, littleEndian, \"Int16\").\n    return GetViewValue(realm, v, byteOffset, littleEndian, \"Int16\");\n  });\n\n  // ECMA262 24.2.4.9\n  obj.defineNativeMethod(\"getInt32\", 1, (context, [byteOffset, _littleEndian]) => {\n    let littleEndian = _littleEndian;\n    // 1. Let v be the this value.\n    let v = context;\n\n    // 2. If littleEndian is not present, let littleEndian be false.\n    if (!littleEndian) littleEndian = realm.intrinsics.false;\n\n    // 3. Return ? GetViewValue(v, byteOffset, littleEndian, \"Int32\").\n    return GetViewValue(realm, v, byteOffset, littleEndian, \"Int32\");\n  });\n\n  // ECMA262 24.2.4.10\n  obj.defineNativeMethod(\"getUint8\", 1, (context, [byteOffset]) => {\n    // 1. Let v be the this value.\n    let v = context;\n\n    // 2. Return ? GetViewValue(v, byteOffset, true, \"Uint8\").\n    return GetViewValue(realm, v, byteOffset, realm.intrinsics.true, \"Uint8\");\n  });\n\n  // ECMA262 24.2.4.11\n  obj.defineNativeMethod(\"getUint16\", 1, (context, [byteOffset, _littleEndian]) => {\n    let littleEndian = _littleEndian;\n    // 1. Let v be the this value.\n    let v = context;\n\n    // 2. If littleEndian is not present, let littleEndian be false.\n    if (!littleEndian) littleEndian = realm.intrinsics.false;\n\n    // 3. Return ? GetViewValue(v, byteOffset, littleEndian, \"Uint16\").\n    return GetViewValue(realm, v, byteOffset, littleEndian, \"Uint16\");\n  });\n\n  // ECMA262 24.2.4.12\n  obj.defineNativeMethod(\"getUint32\", 1, (context, [byteOffset, _littleEndian]) => {\n    let littleEndian = _littleEndian;\n    // 1. Let v be the this value.\n    let v = context;\n\n    // 2. If littleEndian is not present, let littleEndian be false.\n    if (!littleEndian) littleEndian = realm.intrinsics.false;\n\n    // 3. Return ? GetViewValue(v, byteOffset, littleEndian, \"Uint32\").\n    return GetViewValue(realm, v, byteOffset, littleEndian, \"Uint32\");\n  });\n\n  // ECMA262 24.2.4.13\n  obj.defineNativeMethod(\"setFloat32\", 2, (context, [byteOffset, value, _littleEndian]) => {\n    let littleEndian = _littleEndian;\n    // 1. Let v be the this value.\n    let v = context;\n\n    // 2. If littleEndian is not present, let littleEndian be false.\n    if (!littleEndian) littleEndian = realm.intrinsics.false;\n\n    // 3. Return ? SetViewValue(v, byteOffset, littleEndian, \"Float32\", value).\n    return SetViewValue(realm, v, byteOffset, littleEndian, \"Float32\", value);\n  });\n\n  // ECMA262 24.2.4.14\n  obj.defineNativeMethod(\"setFloat64\", 2, (context, [byteOffset, value, _littleEndian]) => {\n    let littleEndian = _littleEndian;\n    // 1. Let v be the this value.\n    let v = context;\n\n    // 2. If littleEndian is not present, let littleEndian be false.\n    if (!littleEndian) littleEndian = realm.intrinsics.false;\n\n    // 3. Return ? SetViewValue(v, byteOffset, littleEndian, \"Float64\", value).\n    return SetViewValue(realm, v, byteOffset, littleEndian, \"Float64\", value);\n  });\n\n  // ECMA262 24.2.4.15\n  obj.defineNativeMethod(\"setInt8\", 2, (context, [byteOffset, value]) => {\n    // 1. Let v be the this value.\n    let v = context;\n\n    // 2. Return ? SetViewValue(v, byteOffset, true, \"Int8\", value).\n    return SetViewValue(realm, v, byteOffset, realm.intrinsics.true, \"Int8\", value);\n  });\n\n  // ECMA262 24.2.4.16\n  obj.defineNativeMethod(\"setInt16\", 2, (context, [byteOffset, value, _littleEndian]) => {\n    let littleEndian = _littleEndian;\n    // 1. Let v be the this value.\n    let v = context;\n\n    // 2. If littleEndian is not present, let littleEndian be false.\n    if (!littleEndian) littleEndian = realm.intrinsics.false;\n\n    // 3. Return ? SetViewValue(v, byteOffset, littleEndian, \"Int16\", value).\n    return SetViewValue(realm, v, byteOffset, littleEndian, \"Int16\", value);\n  });\n\n  // ECMA262 24.2.4.17\n  obj.defineNativeMethod(\"setInt32\", 2, (context, [byteOffset, value, _littleEndian]) => {\n    let littleEndian = _littleEndian;\n    // 1. Let v be the this value.\n    let v = context;\n\n    // 2. If littleEndian is not present, let littleEndian be false.\n    if (!littleEndian) littleEndian = realm.intrinsics.false;\n\n    // 3. Return ? SetViewValue(v, byteOffset, littleEndian, \"Int32\", value).\n    return SetViewValue(realm, v, byteOffset, littleEndian, \"Int32\", value);\n  });\n\n  // ECMA262 24.2.4.18\n  obj.defineNativeMethod(\"setUint8\", 2, (context, [byteOffset, value]) => {\n    // 1. Let v be the this value.\n    let v = context;\n\n    // 2. Return ? SetViewValue(v, byteOffset, true, \"Uint8\", value).\n    return SetViewValue(realm, v, byteOffset, realm.intrinsics.true, \"Uint8\", value);\n  });\n\n  // ECMA262 24.2.4.19\n  obj.defineNativeMethod(\"setUint16\", 2, (context, [byteOffset, value, _littleEndian]) => {\n    let littleEndian = _littleEndian;\n    // 1. Let v be the this value.\n    let v = context;\n\n    // 2. If littleEndian is not present, let littleEndian be false.\n    if (!littleEndian) littleEndian = realm.intrinsics.false;\n\n    // 3. Return ? SetViewValue(v, byteOffset, littleEndian, \"Uint16\", value).\n    return SetViewValue(realm, v, byteOffset, littleEndian, \"Uint16\", value);\n  });\n\n  // ECMA262 24.2.4.20\n  obj.defineNativeMethod(\"setUint32\", 2, (context, [byteOffset, value, _littleEndian]) => {\n    let littleEndian = _littleEndian;\n    // 1. Let v be the this value.\n    let v = context;\n\n    // 2. If littleEndian is not present, let littleEndian be false.\n    if (!littleEndian) littleEndian = realm.intrinsics.false;\n\n    // 3. Return ? SetViewValue(v, byteOffset, littleEndian, \"Uint32\", value).\n    return SetViewValue(realm, v, byteOffset, littleEndian, \"Uint32\", value);\n  });\n\n  // ECMA26224.2.4.21\n  obj.defineNativeProperty(realm.intrinsics.SymbolToStringTag, new StringValue(realm, \"DataView\"), { writable: false });\n}\n"
  },
  {
    "path": "src/intrinsics/ecma262/Date.js",
    "content": "/**\n * Copyright (c) 2017-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n/* @flow strict-local */\n\nimport type { Realm } from \"../../realm.js\";\nimport { AbstractValue, NativeFunctionValue, NumberValue, StringValue, ObjectValue } from \"../../values/index.js\";\nimport { Create, To } from \"../../singletons.js\";\nimport { MakeTime, MakeDate, MakeDay, TimeClip, UTC, ToDateString, thisTimeValue } from \"../../methods/date.js\";\nimport { FatalError } from \"../../errors.js\";\nimport invariant from \"../../invariant.js\";\nimport seedrandom from \"seedrandom\";\n\nconst buildDateNowSrc = \"global.Date.now()\";\n\nexport default function(realm: Realm): NativeFunctionValue {\n  let lastNow;\n  let offsetGenerator;\n  function getCurrentTime(): AbstractValue | NumberValue {\n    if (realm.useAbstractInterpretation) {\n      return AbstractValue.createTemporalFromTemplate(realm, buildDateNowSrc, NumberValue, [], {\n        isPure: true,\n        skipInvariant: true,\n      });\n    } else {\n      let newNow = Date.now();\n      if (realm.strictlyMonotonicDateNow && lastNow >= newNow) {\n        if (!offsetGenerator) offsetGenerator = seedrandom(0);\n        // certain behaviors in the test262 test suite can only be (reliably) triggered if Date.now() is strictly monotonically increasing\n        // TODO #1004: Set the strictlyMonotonicDateNow option on the realm in the test262 test runner, fix the issues that will come up in the tests, and remove this comment.\n        newNow = lastNow + 1 + Math.floor(offsetGenerator() * 500);\n      }\n      lastNow = newNow;\n      return new NumberValue(realm, newNow);\n    }\n  }\n\n  // ECMA262 20.3.2\n  let func = new NativeFunctionValue(realm, \"Date\", \"Date\", 7, (context, args, argCount, NewTarget) => {\n    if (argCount >= 2) {\n      // ECMA262 20.3.2.1\n      let [year, month, date, hours, minutes, seconds, ms] = args;\n\n      // 1. Let numberOfArgs be the number of arguments passed to this function call.\n      let numberOfArgs = argCount;\n\n      // 2. Assert: numberOfArgs ≥ 2.\n      invariant(numberOfArgs >= 2, \"expected two or more arguments\");\n\n      // 3. If NewTarget is not undefined, then\n      if (NewTarget) {\n        // a. Let y be ? ToNumber(year).\n        let y = To.ToNumber(realm, year);\n\n        // b. Let m be ? ToNumber(month).\n        let m = To.ToNumber(realm, month);\n\n        // c. If date is supplied, let dt be ? ToNumber(date); else let dt be 1.\n        let dt = argCount >= 3 ? To.ToNumber(realm, date) : 1;\n\n        // d. If hours is supplied, let h be ? ToNumber(hours); else let h be 0.\n        let h = argCount >= 4 ? To.ToNumber(realm, hours) : 0;\n\n        // e. If minutes is supplied, let min be ? ToNumber(minutes); else let min be 0.\n        let min = argCount >= 5 ? To.ToNumber(realm, minutes) : 0;\n\n        // f. If seconds is supplied, let s be ? ToNumber(seconds); else let s be 0.\n        let s = argCount >= 6 ? To.ToNumber(realm, seconds) : 0;\n\n        // g. If ms is supplied, let milli be ? ToNumber(ms); else let milli be 0.\n        let milli = argCount >= 7 ? To.ToNumber(realm, ms) : 0;\n\n        // h. If y is not NaN and 0 ≤ ToInteger(y) ≤ 99, let yr be 1900+ToInteger(y); otherwise, let yr be y.\n        let yr;\n        if (!isNaN(y) && To.ToInteger(realm, y) >= 0 && To.ToInteger(realm, y) <= 99) {\n          yr = 1900 + To.ToInteger(realm, new NumberValue(realm, y));\n        } else {\n          yr = y;\n        }\n\n        // i. Let finalDate be MakeDate(MakeDay(yr, m, dt), MakeTime(h, min, s, milli)).\n        let finalDate = MakeDate(realm, MakeDay(realm, yr, m, dt), MakeTime(realm, h, min, s, milli));\n\n        // j. Let O be ? OrdinaryCreateFromConstructor(NewTarget, \"%DatePrototype%\", « [[DateValue]] »).\n        let O = Create.OrdinaryCreateFromConstructor(realm, NewTarget, \"DatePrototype\", { $DateValue: undefined });\n\n        // k. Set the [[DateValue]] internal slot of O to TimeClip(UTC(finalDate)).\n        O.$DateValue = TimeClip(realm, UTC(realm, finalDate));\n\n        // l. Return O.\n        return O;\n      } else {\n        // 4. Else,\n        // a. Let now be the Number that is the time value (UTC) identifying the current time.\n        let now = getCurrentTime().throwIfNotConcreteNumber().value;\n\n        // b. Return ToDateString(now).\n        return new StringValue(realm, ToDateString(realm, now));\n      }\n    } else if (argCount === 1) {\n      // ECMA262 20.3.2.2\n      let [value_] = args;\n      let value = value_.throwIfNotConcrete();\n\n      // 1. Let numberOfArgs be the number of arguments passed to this function call.\n      let numberOfArgs = argCount;\n\n      // 2. Assert: numberOfArgs = 1.\n      invariant(numberOfArgs === 1, \"expected number of arguments to equal 1\");\n\n      // 3. If NewTarget is not undefined, then\n      if (NewTarget) {\n        let tv;\n\n        // a. If Type(value) is Object and value has a [[DateValue]] internal slot, then\n        if (value instanceof ObjectValue && value.$DateValue !== undefined) {\n          // i. Let tv be thisTimeValue(value).\n          tv = thisTimeValue(realm, value);\n        } else {\n          // b. Else,\n          // i. Let v be ? ToPrimitive(value)\n          let v = To.ToPrimitive(realm, value);\n\n          // ii. If Type(v) is String, then\n          if (v instanceof StringValue) {\n            // 1. Let tv be the result of parsing v as a date, in exactly the same manner as for the parse\n            //    method (20.3.3.2). If the parse resulted in an abrupt completion, tv is the Completion Record.\n            tv = new NumberValue(realm, new Date(v.value).getTime());\n\n            // 2. ReturnIfAbrupt(tv).\n          } else {\n            // iii. Else,\n            // 1. Let tv be ? ToNumber(v).\n            tv = new NumberValue(realm, To.ToNumber(realm, v));\n          }\n        }\n\n        // c. Let O be ? OrdinaryCreateFromConstructor(NewTarget, \"%DatePrototype%\", « [[DateValue]] »).\n        let O = Create.OrdinaryCreateFromConstructor(realm, NewTarget, \"DatePrototype\", { $DateValue: undefined });\n\n        // d. Set the [[DateValue]] internal slot of O to TimeClip(tv).\n        O.$DateValue = TimeClip(realm, tv);\n\n        // e. Return O.\n        return O;\n      } else {\n        // 4. Else,\n        // a. Let now be the Number that is the time value (UTC) identifying the current time.\n        let now = getCurrentTime().throwIfNotConcreteNumber().value;\n\n        // b. Return ToDateString(now).\n        return new StringValue(realm, ToDateString(realm, now));\n      }\n    } else {\n      // ECMA262 20.3.2.3\n\n      // 1. Let numberOfArgs be the number of arguments passed to this function call.\n      let numberOfArgs = argCount;\n\n      // 2. Assert: numberOfArgs = 0.\n      invariant(numberOfArgs === 0, \"expected zero arguments\");\n\n      // 3. If NewTarget is not undefined, then\n      if (NewTarget) {\n        // a. Let O be ? OrdinaryCreateFromConstructor(NewTarget, \"%DatePrototype%\", « [[DateValue]] »).\n        let O = Create.OrdinaryCreateFromConstructor(realm, NewTarget, \"DatePrototype\", { $DateValue: undefined });\n\n        // b. Set the [[DateValue]] internal slot of O to the time value (UTC) identifying the current time.\n        O.$DateValue = getCurrentTime();\n\n        // c. Return O.\n        return O;\n      } else {\n        // 4. Else,\n        // a. Let now be the Number that is the time value (UTC) identifying the current time.\n        let now = getCurrentTime().throwIfNotConcreteNumber().value;\n\n        // b. Return ToDateString(now).\n        return new StringValue(realm, ToDateString(realm, now));\n      }\n    }\n  });\n\n  // ECMA262 20.3.3.1\n  func.defineNativeMethod(\"now\", 0, context => {\n    return getCurrentTime();\n  });\n\n  // ECMA262 20.3.3.2\n  func.defineNativeMethod(\"parse\", 1, (context, [string]) => {\n    if (realm.useAbstractInterpretation) {\n      AbstractValue.reportIntrospectionError(string);\n      throw new FatalError();\n    } else {\n      const parsedDate = Date.parse(string.value);\n      return new NumberValue(realm, parsedDate);\n    }\n  });\n\n  // ECMA262 20.3.3.4\n  func.defineNativeMethod(\"UTC\", 7, (context, [year, month, date, hours, minutes, seconds, ms], argCount) => {\n    // 1. Let y be ? ToNumber(year).\n    let y = To.ToNumber(realm, year);\n\n    // 2. Let m be ? ToNumber(month).\n    let m = argCount >= 2 ? To.ToNumber(realm, month) : 0;\n\n    // 3. If date is supplied, let dt be ? ToNumber(date); else let dt be 1.\n    let dt = argCount >= 3 ? To.ToNumber(realm, date) : 1;\n\n    // 4. If hours is supplied, let h be ? ToNumber(hours); else let h be 0.\n    let h = argCount >= 4 ? To.ToNumber(realm, hours) : 0;\n\n    // 5. If minutes is supplied, let min be ? ToNumber(minutes); else let min be 0.\n    let min = argCount >= 5 ? To.ToNumber(realm, minutes) : 0;\n\n    // 6. If seconds is supplied, let s be ? ToNumber(seconds); else let s be 0.\n    let s = argCount >= 6 ? To.ToNumber(realm, seconds) : 0;\n\n    // 7. If ms is supplied, let milli be ? ToNumber(ms); else let milli be 0.\n    let milli = argCount >= 7 ? To.ToNumber(realm, ms) : 0;\n\n    // 8. If y is not NaN and 0 ≤ ToInteger(y) ≤ 99, let yr be 1900+ToInteger(y); otherwise, let yr be y.\n    let yr =\n      !isNaN(y) && To.ToInteger(realm, y) >= 0 && To.ToInteger(realm, y) <= 99 ? 1900 + To.ToInteger(realm, y) : y;\n\n    // 9. Return TimeClip(MakeDate(MakeDay(yr, m, dt), MakeTime(h, min, s, milli))).\n    return TimeClip(realm, MakeDate(realm, MakeDay(realm, yr, m, dt), MakeTime(realm, h, min, s, milli)));\n  });\n\n  return func;\n}\n"
  },
  {
    "path": "src/intrinsics/ecma262/DatePrototype.js",
    "content": "/**\n * Copyright (c) 2017-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n/* @flow strict-local */\n\nimport type { Realm } from \"../../realm.js\";\nimport { FatalError } from \"../../errors.js\";\nimport { StringValue, ObjectValue, NumberValue } from \"../../values/index.js\";\nimport {\n  Invoke,\n  MakeTime,\n  thisTimeValue,\n  msFromTime,\n  TimeClip,\n  TimeWithinDay,\n  MakeDay,\n  YearFromTime,\n  DateFromTime,\n  MakeDate,\n  ToDateString,\n  HourFromTime,\n  MinFromTime,\n  Day,\n  SecFromTime,\n  WeekDay,\n  LocalTime,\n  MonthFromTime,\n  msPerMinute,\n  UTC,\n} from \"../../methods/index.js\";\nimport { To } from \"../../singletons\";\nimport invariant from \"../../invariant.js\";\n\nexport default function(realm: Realm, obj: ObjectValue): void {\n  // ECMA262 20.3.4.2\n  obj.defineNativeMethod(\"getDate\", 0, context => {\n    // 1. Let t be ? thisTimeValue(this value).\n    let t = thisTimeValue(realm, context).throwIfNotConcreteNumber().value;\n\n    // 2. If t is NaN, return NaN.\n    if (isNaN(t)) return realm.intrinsics.NaN;\n\n    // 3. Return DateFromTime(LocalTime(t)).\n    return new NumberValue(realm, DateFromTime(realm, LocalTime(realm, t)));\n  });\n\n  // ECMA262 20.3.4.3\n  obj.defineNativeMethod(\"getDay\", 0, context => {\n    // 1. Let t be ? thisTimeValue(this value).\n    let t = thisTimeValue(realm, context).throwIfNotConcreteNumber().value;\n\n    // 2. If t is NaN, return NaN.\n    if (isNaN(t)) return realm.intrinsics.NaN;\n\n    // 3. Return WeekDay(LocalTime(t)).\n    return new NumberValue(realm, WeekDay(realm, LocalTime(realm, t)));\n  });\n\n  // ECMA262 20.3.4.4\n  obj.defineNativeMethod(\"getFullYear\", 0, context => {\n    // 1. Let t be ? thisTimeValue(this value).\n    let t = thisTimeValue(realm, context).throwIfNotConcreteNumber().value;\n\n    // 2. If t is NaN, return NaN.\n    if (isNaN(t)) return realm.intrinsics.NaN;\n\n    // 3. Return YearFromTime(LocalTime(t)).\n    return new NumberValue(realm, YearFromTime(realm, LocalTime(realm, t)));\n  });\n\n  // ECMA262 20.3.4.5\n  obj.defineNativeMethod(\"getHours\", 0, context => {\n    // 1. Let t be ? thisTimeValue(this value).\n    let t = thisTimeValue(realm, context).throwIfNotConcreteNumber().value;\n\n    // 2. If t is NaN, return NaN.\n    if (isNaN(t)) return realm.intrinsics.NaN;\n\n    // 3. Return HourFromTime(LocalTime(t)).\n    return new NumberValue(realm, HourFromTime(realm, LocalTime(realm, t)));\n  });\n\n  // ECMA262 20.3.4.6\n  obj.defineNativeMethod(\"getMilliseconds\", 0, context => {\n    // 1. Let t be ? thisTimeValue(this value).\n    let t = thisTimeValue(realm, context).throwIfNotConcreteNumber().value;\n\n    // 2. If t is NaN, return NaN.\n    if (isNaN(t)) return realm.intrinsics.NaN;\n\n    // 3. Return msFromTime(LocalTime(t)).\n    return new NumberValue(realm, msFromTime(realm, LocalTime(realm, t)));\n  });\n\n  // ECMA262 20.3.4.7\n  obj.defineNativeMethod(\"getMinutes\", 0, context => {\n    // 1. Let t be ? thisTimeValue(this value).\n    let t = thisTimeValue(realm, context).throwIfNotConcreteNumber().value;\n\n    // 2. If t is NaN, return NaN.\n    if (isNaN(t)) return realm.intrinsics.NaN;\n\n    // 3. Return MinFromTime(LocalTime(t)).\n    return new NumberValue(realm, MinFromTime(realm, LocalTime(realm, t)));\n  });\n\n  // ECMA262 20.3.4.8\n  obj.defineNativeMethod(\"getMonth\", 0, context => {\n    // 1. Let t be ? thisTimeValue(this value).\n    let t = thisTimeValue(realm, context).throwIfNotConcreteNumber().value;\n\n    // 2. If t is NaN, return NaN.\n    if (isNaN(t)) return realm.intrinsics.NaN;\n\n    // 3. Return MonthFromTime(LocalTime(t)).\n    return new NumberValue(realm, MonthFromTime(realm, LocalTime(realm, t)));\n  });\n\n  // ECMA262 20.3.4.9\n  obj.defineNativeMethod(\"getSeconds\", 0, context => {\n    // 1. Let t be ? thisTimeValue(this value).\n    let t = thisTimeValue(realm, context).throwIfNotConcreteNumber().value;\n\n    // 2. If t is NaN, return NaN.\n    if (isNaN(t)) return realm.intrinsics.NaN;\n\n    // 3. Return SecFromTime(LocalTime(t)).\n    return new NumberValue(realm, SecFromTime(realm, LocalTime(realm, t)));\n  });\n\n  // ECMA262 20.3.4.10\n  obj.defineNativeMethod(\"getTime\", 0, context => {\n    // 1. Return ? thisTimeValue(this value).\n    return thisTimeValue(realm, context);\n  });\n\n  // ECMA262 20.3.4.11\n  obj.defineNativeMethod(\"getTimezoneOffset\", 0, context => {\n    // 1. Let t be ? thisTimeValue(this value).\n    let t = thisTimeValue(realm, context).throwIfNotConcreteNumber().value;\n\n    // 2. If t is NaN, return NaN.\n    if (isNaN(t)) return realm.intrinsics.NaN;\n\n    // 3. Return (t - LocalTime(t)) / msPerMinute.\n    return new NumberValue(realm, (t - LocalTime(realm, t)) / msPerMinute);\n  });\n\n  // ECMA262 20.3.4.12\n  obj.defineNativeMethod(\"getUTCDate\", 0, context => {\n    // 1. Let t be ? thisTimeValue(this value).\n    let t = thisTimeValue(realm, context).throwIfNotConcreteNumber().value;\n\n    // 2. If t is NaN, return NaN.\n    if (isNaN(t)) return realm.intrinsics.NaN;\n\n    // 3. Return DateFromTime(t).\n    return new NumberValue(realm, DateFromTime(realm, t));\n  });\n\n  // ECMA262 20.3.4.13\n  obj.defineNativeMethod(\"getUTCDay\", 0, context => {\n    // 1. Let t be ? thisTimeValue(this value).\n    let t = thisTimeValue(realm, context).throwIfNotConcreteNumber().value;\n\n    // 2. If t is NaN, return NaN.\n    if (isNaN(t)) return realm.intrinsics.NaN;\n\n    // 3. Return WeekDay(t).\n    return new NumberValue(realm, WeekDay(realm, t));\n  });\n\n  // ECMA262 20.3.4.14\n  obj.defineNativeMethod(\"getUTCFullYear\", 0, context => {\n    // 1. Let t be ? thisTimeValue(this value).\n    let t = thisTimeValue(realm, context).throwIfNotConcreteNumber().value;\n\n    // 2. If t is NaN, return NaN.\n    if (isNaN(t)) return realm.intrinsics.NaN;\n\n    // 3. Return YearFromTime(t).\n    return new NumberValue(realm, YearFromTime(realm, t));\n  });\n\n  // ECMA262 20.3.4.15\n  obj.defineNativeMethod(\"getUTCHours\", 0, context => {\n    // 1. Let t be ? thisTimeValue(this value).\n    let t = thisTimeValue(realm, context).throwIfNotConcreteNumber().value;\n\n    // 2. If t is NaN, return NaN.\n    if (isNaN(t)) return realm.intrinsics.NaN;\n\n    // 3. Return HourFromTime(t).\n    return new NumberValue(realm, HourFromTime(realm, t));\n  });\n\n  // ECMA262 20.3.4.16\n  obj.defineNativeMethod(\"getUTCMilliseconds\", 0, context => {\n    // 1. Let t be ? thisTimeValue(this value).\n    let t = thisTimeValue(realm, context).throwIfNotConcreteNumber().value;\n\n    // 2. If t is NaN, return NaN.\n    if (isNaN(t)) return realm.intrinsics.NaN;\n\n    // 3. Return msFromTime(t).\n    return new NumberValue(realm, msFromTime(realm, t));\n  });\n\n  // ECMA262 20.3.4.17\n  obj.defineNativeMethod(\"getUTCMinutes\", 0, context => {\n    // 1. Let t be ? thisTimeValue(this value).\n    let t = thisTimeValue(realm, context).throwIfNotConcreteNumber().value;\n\n    // 2. If t is NaN, return NaN.\n    if (isNaN(t)) return realm.intrinsics.NaN;\n\n    // 3. Return MinFromTime(t).\n    return new NumberValue(realm, MinFromTime(realm, t));\n  });\n\n  // ECMA262 20.3.4.18\n  obj.defineNativeMethod(\"getUTCMonth\", 0, context => {\n    // 1. Let t be ? thisTimeValue(this value).\n    let t = thisTimeValue(realm, context).throwIfNotConcreteNumber().value;\n\n    // 2. If t is NaN, return NaN.\n    if (isNaN(t)) return realm.intrinsics.NaN;\n\n    // 3. Return MonthFromTime(t).\n    return new NumberValue(realm, MonthFromTime(realm, t));\n  });\n\n  // ECMA262 20.3.4.19\n  obj.defineNativeMethod(\"getUTCSeconds\", 0, context => {\n    // 1. Let t be ? thisTimeValue(this value).\n    let t = thisTimeValue(realm, context).throwIfNotConcreteNumber().value;\n    invariant(context instanceof ObjectValue);\n\n    // 2. If t is NaN, return NaN.\n    if (isNaN(t)) return realm.intrinsics.NaN;\n\n    // 3. Return SecFromTime(t).\n    return new NumberValue(realm, SecFromTime(realm, t));\n  });\n\n  // ECMA262 20.3.4.20\n  obj.defineNativeMethod(\"setDate\", 1, (context, [date]) => {\n    // 1. Let t be LocalTime(? thisTimeValue(this value)).\n    let t = LocalTime(realm, thisTimeValue(realm, context).throwIfNotConcreteNumber().value);\n    invariant(context instanceof ObjectValue);\n\n    // 2. Let dt be ? ToNumber(date).\n    let dt = To.ToNumber(realm, date);\n\n    // 3. Let newDate be MakeDate(MakeDay(YearFromTime(t), MonthFromTime(t), dt), TimeWithinDay(t)).\n    let newDate = MakeDate(\n      realm,\n      MakeDay(realm, YearFromTime(realm, t), MonthFromTime(realm, t), dt),\n      TimeWithinDay(realm, t)\n    );\n\n    // 4. Let u be TimeClip(UTC(newDate)).\n    let u = TimeClip(realm, UTC(realm, newDate));\n\n    // 5. Set the [[DateValue]] internal slot of this Date object to u.\n    context.$DateValue = u;\n\n    // 6. Return u.\n    return u;\n  });\n\n  // ECMA262 20.3.4.21\n  obj.defineNativeMethod(\"setFullYear\", 3, (context, [year, month, date], argCount) => {\n    // 1. Let t be ? thisTimeValue(this value).\n    let t = thisTimeValue(realm, context).throwIfNotConcreteNumber().value;\n    invariant(context instanceof ObjectValue);\n\n    // 2. If t is NaN, let t be +0; otherwise, let t be LocalTime(t).\n    t = isNaN(t) ? +0 : LocalTime(realm, t);\n\n    // 3. Let y be ? ToNumber(year).\n    let y = To.ToNumber(realm, year);\n\n    // 4. If month is not specified, let m be MonthFromTime(t); otherwise, let m be ? ToNumber(month).\n    let m = argCount >= 2 ? To.ToNumber(realm, month) : MonthFromTime(realm, t);\n\n    // 5. If date is not specified, let dt be DateFromTime(t); otherwise, let dt be ? ToNumber(date).\n    let dt = argCount >= 3 ? To.ToNumber(realm, date) : DateFromTime(realm, t);\n\n    // 6. Let newDate be MakeDate(MakeDay(y, m, dt), TimeWithinDay(t)).\n    let newDate = MakeDate(realm, MakeDay(realm, y, m, dt), TimeWithinDay(realm, t));\n\n    // 7. Let u be TimeClip(UTC(newDate)).\n    let u = TimeClip(realm, UTC(realm, newDate));\n\n    // 8. Set the [[DateValue]] internal slot of this Date object to u.\n    context.$DateValue = u;\n\n    // 9. Return u.\n    return u;\n  });\n\n  // ECMA262 20.3.4.22\n  obj.defineNativeMethod(\"setHours\", 4, (context, [hour, min, sec, ms], argCount) => {\n    // 1. Let t be LocalTime(? thisTimeValue(this value)).\n    let t = LocalTime(realm, thisTimeValue(realm, context).throwIfNotConcreteNumber().value);\n    invariant(context instanceof ObjectValue);\n\n    // 2. Let h be ? ToNumber(hour).\n    let h = To.ToNumber(realm, hour);\n\n    // 3. If min is not specified, let m be MinFromTime(t); otherwise, let m be ? ToNumber(min).\n    let m = argCount >= 2 ? To.ToNumber(realm, min) : MinFromTime(realm, t);\n\n    // 4. If sec is not specified, let s be SecFromTime(t); otherwise, let s be ? ToNumber(sec).\n    let s = argCount >= 3 ? To.ToNumber(realm, sec) : SecFromTime(realm, t);\n\n    // 5. If ms is not specified, let milli be msFromTime(t); otherwise, let milli be ? ToNumber(ms).\n    let milli = argCount >= 4 ? To.ToNumber(realm, ms) : msFromTime(realm, t);\n\n    // 6. Let date be MakeDate(Day(t), MakeTime(h, m, s, milli)).\n    let date = MakeDate(realm, Day(realm, t), MakeTime(realm, h, m, s, milli));\n\n    // 7. Let u be TimeClip(UTC(date)).\n    let u = TimeClip(realm, UTC(realm, date));\n\n    // 8. Set the [[DateValue]] internal slot of this Date object to u.\n    context.$DateValue = u;\n\n    // 9. Return u.\n    return u;\n  });\n\n  // ECMA262 20.3.4.23\n  obj.defineNativeMethod(\"setMilliseconds\", 1, (context, [_ms]) => {\n    let ms = _ms;\n    // 1. Let t be LocalTime(? thisTimeValue(this value)).\n    let t = LocalTime(realm, thisTimeValue(realm, context).throwIfNotConcreteNumber().value);\n    invariant(context instanceof ObjectValue);\n\n    // 2. Let ms be ? ToNumber(ms).\n    ms = To.ToNumber(realm, ms);\n\n    // 3. Let time be MakeTime(HourFromTime(t), MinFromTime(t), SecFromTime(t), ms).\n    let time = MakeTime(realm, HourFromTime(realm, t), MinFromTime(realm, t), SecFromTime(realm, t), ms);\n\n    // 4. Let u be TimeClip(UTC(MakeDate(Day(t), time))).\n    let u = TimeClip(realm, UTC(realm, MakeDate(realm, Day(realm, t), time)));\n\n    // 5. Set the [[DateValue]] internal slot of this Date object to u.\n    context.$DateValue = u;\n\n    // 6. Return u.\n    return u;\n  });\n\n  // ECMA262 20.3.4.24\n  obj.defineNativeMethod(\"setMinutes\", 3, (context, [min, sec, ms], argCount) => {\n    // 1. Let t be LocalTime(? thisTimeValue(this value)).\n    let t = LocalTime(realm, thisTimeValue(realm, context).throwIfNotConcreteNumber().value);\n    invariant(context instanceof ObjectValue);\n\n    // 2. Let m be ? ToNumber(min).\n    let m = To.ToNumber(realm, min);\n\n    // 3. If sec is not specified, let s be SecFromTime(t); otherwise, let s be ? ToNumber(sec).\n    let s = argCount >= 2 ? To.ToNumber(realm, sec) : SecFromTime(realm, t);\n\n    // 4. If ms is not specified, let milli be msFromTime(t); otherwise, let milli be ? ToNumber(ms).\n    let milli = argCount >= 3 ? To.ToNumber(realm, ms) : msFromTime(realm, t);\n\n    // 5. Let date be MakeDate(Day(t), MakeTime(HourFromTime(t), m, s, milli)).\n    let date = MakeDate(realm, Day(realm, t), MakeTime(realm, HourFromTime(realm, t), m, s, milli));\n\n    // 6. Let u be TimeClip(UTC(date)).\n    let u = TimeClip(realm, UTC(realm, date));\n\n    // 7. Set the [[DateValue]] internal slot of this Date object to u.\n    context.$DateValue = u;\n\n    // 8. Return u.\n    return u;\n  });\n\n  // ECMA262 20.3.4.25\n  obj.defineNativeMethod(\"setMonth\", 2, (context, [month, date], argCount) => {\n    // 1. Let t be LocalTime(? thisTimeValue(this value)).\n    let t = LocalTime(realm, thisTimeValue(realm, context).throwIfNotConcreteNumber().value);\n    invariant(context instanceof ObjectValue);\n\n    // 2. Let m be ? ToNumber(month).\n    let m = To.ToNumber(realm, month);\n\n    // 3. If date is not specified, let dt be DateFromTime(t); otherwise, let dt be ? ToNumber(date).\n    let dt = argCount >= 2 ? To.ToNumber(realm, date) : DateFromTime(realm, t);\n\n    // 4. Let newDate be MakeDate(MakeDay(YearFromTime(t), m, dt), TimeWithinDay(t)).\n    let newDate = MakeDate(realm, MakeDay(realm, YearFromTime(realm, t), m, dt), TimeWithinDay(realm, t));\n\n    // 5. Let u be TimeClip(UTC(newDate)).\n    let u = TimeClip(realm, UTC(realm, newDate));\n\n    // 6. Set the [[DateValue]] internal slot of this Date object to u.\n    context.$DateValue = u;\n\n    // 7. Return u.\n    return u;\n  });\n\n  // ECMA262 20.3.4.26\n  obj.defineNativeMethod(\"setSeconds\", 2, (context, [sec, ms], argCount) => {\n    // 1. Let t be LocalTime(? thisTimeValue(this value)).\n    let t = LocalTime(realm, thisTimeValue(realm, context).throwIfNotConcreteNumber().value);\n    invariant(context instanceof ObjectValue);\n\n    // 2. Let s be ? ToNumber(sec).\n    let s = To.ToNumber(realm, sec);\n\n    // 3. If ms is not specified, let milli be msFromTime(t); otherwise, let milli be ? ToNumber(ms).\n    let milli = argCount >= 2 ? To.ToNumber(realm, ms) : msFromTime(realm, t);\n\n    // 4. Let date be MakeDate(Day(t), MakeTime(HourFromTime(t), MinFromTime(t), s, milli)).\n    let date = MakeDate(realm, Day(realm, t), MakeTime(realm, HourFromTime(realm, t), MinFromTime(realm, t), s, milli));\n\n    // 5. Let u be TimeClip(UTC(date)).\n    let u = TimeClip(realm, UTC(realm, date));\n\n    // 6. Set the [[DateValue]] internal slot of this Date object to u.\n    context.$DateValue = u;\n\n    // 7. Return u.\n    return u;\n  });\n\n  // ECMA262 20.3.4.27\n  obj.defineNativeMethod(\"setTime\", 1, (context, [time]) => {\n    // 1. Perform ? thisTimeValue(this value).\n    thisTimeValue(realm, context);\n    invariant(context instanceof ObjectValue);\n\n    // 2. Let t be ? ToNumber(time).\n    let t = To.ToNumber(realm, time);\n\n    // 3. Let v be TimeClip(t).\n    let v = TimeClip(realm, t);\n\n    // 4. Set the [[DateValue]] internal slot of this Date object to v.\n    context.$DateValue = v;\n\n    // 5. Return v.\n    return v;\n  });\n\n  // ECMA262 20.3.4.28\n  obj.defineNativeMethod(\"setUTCDate\", 1, (context, [date]) => {\n    // 1. Let t be ? thisTimeValue(this value).\n    let t = thisTimeValue(realm, context).throwIfNotConcreteNumber().value;\n    invariant(context instanceof ObjectValue);\n\n    // 2. Let dt be ? ToNumber(date).\n    let dt = To.ToNumber(realm, date);\n\n    // 3. Let newDate be MakeDate(MakeDay(YearFromTime(t), MonthFromTime(t), dt), TimeWithinDay(t)).\n    let newDate = MakeDate(\n      realm,\n      MakeDay(realm, YearFromTime(realm, t), MonthFromTime(realm, t), dt),\n      TimeWithinDay(realm, t)\n    );\n\n    // 4. Let v be TimeClip(newDate).\n    let v = TimeClip(realm, newDate);\n\n    // 5. Set the [[DateValue]] internal slot of this Date object to v.\n    context.$DateValue = v;\n\n    // 6. Return v.\n    return v;\n  });\n\n  // ECMA262 20.3.4.29\n  obj.defineNativeMethod(\"setUTCFullYear\", 3, (context, [year, month, date], argCount) => {\n    // 1. Let t be ? thisTimeValue(this value).\n    let t = thisTimeValue(realm, context).throwIfNotConcreteNumber().value;\n    invariant(context instanceof ObjectValue);\n\n    // 2. If t is NaN, let t be +0.\n    if (isNaN(t)) t = +0;\n\n    // 3. Let y be ? ToNumber(year).\n    let y = To.ToNumber(realm, year);\n\n    // 4. If month is not specified, let m be MonthFromTime(t); otherwise, let m be ? ToNumber(month).\n    let m = argCount >= 2 ? To.ToNumber(realm, month) : MonthFromTime(realm, t);\n\n    // 5. If date is not specified, let dt be DateFromTime(t); otherwise, let dt be ? ToNumber(date).\n    let dt = argCount >= 3 ? To.ToNumber(realm, date) : DateFromTime(realm, t);\n\n    // 6. Let newDate be MakeDate(MakeDay(y, m, dt), TimeWithinDay(t)).\n    let newDate = MakeDate(realm, MakeDay(realm, y, m, dt), TimeWithinDay(realm, t));\n\n    // 7. Let v be TimeClip(newDate).\n    let v = TimeClip(realm, newDate);\n\n    // 8. Set the [[DateValue]] internal slot of this Date object to v.\n    context.$DateValue = v;\n\n    // 9. Return v.\n    return v;\n  });\n\n  // ECMA262 20.3.4.30\n  obj.defineNativeMethod(\"setUTCHours\", 4, (context, [hour, min, sec, ms], argCount) => {\n    // 1. Let t be ? thisTimeValue(this value).\n    let t = thisTimeValue(realm, context).throwIfNotConcreteNumber().value;\n    invariant(context instanceof ObjectValue);\n\n    // 2. Let h be ? ToNumber(hour).\n    let h = To.ToNumber(realm, hour);\n\n    // 3. If min is not specified, let m be MinFromTime(t); otherwise, let m be ? ToNumber(min).\n    let m = argCount >= 2 ? To.ToNumber(realm, min) : MinFromTime(realm, t);\n\n    // 4. If sec is not specified, let s be SecFromTime(t); otherwise, let s be ? ToNumber(sec).\n    let s = argCount >= 3 ? To.ToNumber(realm, sec) : SecFromTime(realm, t);\n\n    // 5. If ms is not specified, let milli be msFromTime(t); otherwise, let milli be ? ToNumber(ms).\n    let milli = argCount >= 4 ? To.ToNumber(realm, ms) : msFromTime(realm, t);\n\n    // 6. Let newDate be MakeDate(Day(t), MakeTime(h, m, s, milli)).\n    let newDate = MakeDate(realm, Day(realm, t), MakeTime(realm, h, m, s, milli));\n\n    // 7. Let v be TimeClip(newDate).\n    let v = TimeClip(realm, newDate);\n\n    // 8. Set the [[DateValue]] internal slot of this Date object to v.\n    context.$DateValue = v;\n\n    // 9. Return v.\n    return v;\n  });\n\n  // ECMA262 20.3.4.31\n  obj.defineNativeMethod(\"setUTCMilliseconds\", 1, (context, [ms]) => {\n    // 1. Let t be ? thisTimeValue(this value).\n    let t = thisTimeValue(realm, context).throwIfNotConcreteNumber().value;\n    invariant(context instanceof ObjectValue);\n\n    // 2. Let milli be ? ToNumber(ms).\n    let milli = To.ToNumber(realm, ms);\n\n    // 3. Let time be MakeTime(HourFromTime(t), MinFromTime(t), SecFromTime(t), milli).\n    let time = MakeTime(realm, HourFromTime(realm, t), MinFromTime(realm, t), SecFromTime(realm, t), milli);\n\n    // 4. Let v be TimeClip(MakeDate(Day(t), time)).\n    let v = TimeClip(realm, MakeDate(realm, Day(realm, t), time));\n\n    // 5. Set the [[DateValue]] internal slot of this Date object to v.\n    context.$DateValue = v;\n\n    // 6. Return v.\n    return v;\n  });\n\n  // ECMA262 20.3.4.32\n  obj.defineNativeMethod(\"setUTCMinutes\", 3, (context, [min, sec, ms], argCount) => {\n    // 1. Let t be ? thisTimeValue(this value).\n    let t = thisTimeValue(realm, context).throwIfNotConcreteNumber().value;\n    invariant(context instanceof ObjectValue);\n\n    // 2. Let m be ? ToNumber(min).\n    let m = To.ToNumber(realm, min);\n\n    // 3. If sec is not specified, let s be SecFromTime(t).\n    let s;\n    if (argCount < 2) {\n      s = SecFromTime(realm, t);\n    } else {\n      // 4. Else,\n      // a. Let s be ? ToNumber(sec).\n      s = To.ToNumber(realm, sec);\n    }\n\n    // 5. If ms is not specified, let milli be msFromTime(t).\n    let milli;\n    if (argCount < 3) {\n      milli = msFromTime(realm, t);\n    } else {\n      // 6. Else,\n      // a. Let milli be ? ToNumber(ms).\n      milli = To.ToNumber(realm, ms);\n    }\n\n    // 7. Let date be MakeDate(Day(t), MakeTime(HourFromTime(t), m, s, milli)).\n    let date = MakeDate(realm, Day(realm, t), MakeTime(realm, HourFromTime(realm, t), m, s, milli));\n\n    // 8. Let v be TimeClip(date).\n    let v = TimeClip(realm, date);\n\n    // 9. Set the [[DateValue]] internal slot of this Date object to v.\n    context.$DateValue = v;\n\n    // 10. Return v.\n    return v;\n  });\n\n  // ECMA262 20.3.4.33\n  obj.defineNativeMethod(\"setUTCMonth\", 2, (context, [month, date], argCount) => {\n    // 1. Let t be ? thisTimeValue(this value).\n    let t = thisTimeValue(realm, context).throwIfNotConcreteNumber().value;\n    invariant(context instanceof ObjectValue);\n\n    // 2. Let m be ? ToNumber(month).\n    let m = To.ToNumber(realm, month);\n\n    // 3. If date is not specified, let dt be DateFromTime(t).\n    let dt;\n    if (argCount < 2) {\n      dt = DateFromTime(realm, t);\n    } else {\n      // 4. Else,\n      // a. Let dt be ? ToNumber(date).\n      dt = To.ToNumber(realm, date);\n    }\n\n    // 5. Let newDate be MakeDate(MakeDay(YearFromTime(t), m, dt), TimeWithinDay(t)).\n    let newDate = MakeDate(realm, MakeDay(realm, YearFromTime(realm, t), m, dt), TimeWithinDay(realm, t));\n\n    // 6. Let v be TimeClip(newDate).\n    let v = TimeClip(realm, newDate);\n\n    // 7. Set the [[DateValue]] internal slot of this Date object to v.\n    context.$DateValue = v;\n\n    // 8. Return v.\n    return v;\n  });\n\n  // ECMA262 20.3.4.34\n  obj.defineNativeMethod(\"setUTCSeconds\", 2, (context, [sec, ms], argCount) => {\n    // 1. Let t be ? thisTimeValue(this value).\n    let t = thisTimeValue(realm, context).throwIfNotConcreteNumber().value;\n    invariant(context instanceof ObjectValue);\n\n    // 2. Let s be ? ToNumber(sec).\n    let s = To.ToNumber(realm, sec);\n\n    // 3. If ms is not specified, let milli be msFromTime(t).\n    let milli;\n    if (argCount < 2) {\n      milli = msFromTime(realm, t);\n    } else {\n      // 4. Else,\n      // a. Let milli be ? ToNumber(ms).\n      milli = To.ToNumber(realm, ms);\n    }\n\n    // 5. Let date be MakeDate(Day(t), MakeTime(HourFromTime(t), MinFromTime(t), s, milli)).\n    let date = MakeDate(realm, Day(realm, t), MakeTime(realm, HourFromTime(realm, t), MinFromTime(realm, t), s, milli));\n\n    // 6. Let v be TimeClip(date).\n    let v = TimeClip(realm, date);\n\n    // 7. Set the [[DateValue]] internal slot of this Date object to v.\n    context.$DateValue = v;\n\n    // 8. Return v.\n    return v;\n  });\n\n  // ECMA262 20.3.4.35\n  obj.defineNativeMethod(\"toDateString\", 0, context => {\n    throw new FatalError(\"TODO #1005: implement Date.prototype.toDateString\");\n  });\n\n  // ECMA262 20.3.4.36\n  obj.defineNativeMethod(\"toISOString\", 0, context => {\n    let t = thisTimeValue(realm, context).throwIfNotConcreteNumber().value;\n    if (!isFinite(t)) {\n      throw realm.createErrorThrowCompletion(realm.intrinsics.RangeError);\n    }\n\n    return new StringValue(realm, new Date(t).toISOString());\n  });\n\n  // ECMA262 20.3.4.37\n  obj.defineNativeMethod(\"toJSON\", 1, (context, [key]) => {\n    // 1. Let O be ? ToObject(this value).\n    let O = To.ToObject(realm, context);\n\n    // 2. Let tv be ? ToPrimitive(O, hint Number).\n    let tv = To.ToPrimitive(realm, O.throwIfNotConcreteObject(), \"number\");\n\n    // 3. If Type(tv) is Number and tv is not finite, return null.\n    if (tv instanceof NumberValue && !isFinite(tv.value)) {\n      return realm.intrinsics.null;\n    }\n\n    // 4. Return ? Invoke(O, \"toISOString\").\n    return Invoke(realm, O, \"toISOString\");\n  });\n\n  // ECMA262 20.3.4.38\n  obj.defineNativeMethod(\"toLocaleDateString\", 0, context => {\n    throw new FatalError(\"TODO #1005: implement Date.prototype.toLocaleDateString\");\n  });\n\n  // ECMA262 20.3.4.39\n  obj.defineNativeMethod(\"toLocaleString\", 0, context => {\n    throw new FatalError(\"TODO #1005: implement Date.prototype.toLocaleString\");\n  });\n\n  // ECMA262 20.3.4.40\n  obj.defineNativeMethod(\"toLocaleTimeString\", 0, context => {\n    throw new FatalError(\"TODO #1005: implement Date.prototype.toLocaleTimeString\");\n  });\n\n  // ECMA262 20.3.4.41\n  obj.defineNativeMethod(\"toString\", 0, context => {\n    // 1. Let O be this Date object.\n    let O = context;\n\n    // 2. If O does not have a [[DateValue]] internal slot, then\n    let tv;\n    if (O.$DateValue === undefined) {\n      // a. Let tv be NaN.\n      tv = NaN;\n    } else {\n      // 3. Else,\n      // a. Let tv be thisTimeValue(O).\n      tv = thisTimeValue(realm, O).throwIfNotConcreteNumber().value;\n    }\n\n    // 4. Return ToDateString(tv).\n    return new StringValue(realm, ToDateString(realm, tv));\n  });\n\n  // ECMA262 20.3.4.42\n  obj.defineNativeMethod(\"toTimeString\", 0, context => {\n    throw new FatalError(\"TODO #1005: implement Date.prototype.toTimeString\");\n  });\n\n  // ECMA262 20.3.4.43\n  obj.defineNativeMethod(\"toUTCString\", 0, context => {\n    throw new FatalError(\"TODO #1005: implement Date.prototype.toUTCString\");\n  });\n\n  // ECMA262 20.3.4.44\n  obj.defineNativeMethod(\"valueOf\", 0, context => {\n    // 1. Return ? thisTimeValue(this value).\n    return thisTimeValue(realm, context);\n  });\n\n  // ECMA262 20.3.4.45\n  obj.defineNativeMethod(\n    realm.intrinsics.SymbolToPrimitive,\n    1,\n    (context, [_hint]) => {\n      let hint = _hint;\n      // 1. Let O be the this value.\n      let O = context.throwIfNotConcrete();\n\n      // 2. If Type(O) is not Object, throw a TypeError exception.\n      if (!(O instanceof ObjectValue)) {\n        throw realm.createErrorThrowCompletion(realm.intrinsics.TypeError, \"Type(O) is not Object\");\n      }\n\n      let tryFirst;\n      hint = hint.throwIfNotConcrete();\n      // 3. If hint is the String value \"string\" or the String value \"default\", then\n      if (hint instanceof StringValue && (hint.value === \"string\" || hint.value === \"default\")) {\n        // a. Let tryFirst be \"string\".\n        tryFirst = \"string\";\n      } else if (hint instanceof StringValue && hint.value === \"number\") {\n        // 4. Else if hint is the String value \"number\", then\n        // a. Let tryFirst be \"number\".\n        tryFirst = \"number\";\n      } else {\n        // 5. Else, throw a TypeError exception.\n        throw realm.createErrorThrowCompletion(realm.intrinsics.TypeError, \"Type(O) is not Object\");\n      }\n\n      // 6. Return ? OrdinaryToPrimitive(O, tryFirst).\n      return To.OrdinaryToPrimitive(realm, O, tryFirst);\n    },\n    { writable: false }\n  );\n\n  // B.2.4.1\n  obj.defineNativeMethod(\"getYear\", 0, context => {\n    // 1. Let t be ? thisTimeValue(this value).\n    let t = thisTimeValue(realm, context).throwIfNotConcreteNumber().value;\n\n    // 2. If t is NaN, return NaN.\n    if (isNaN(t)) return realm.intrinsics.NaN;\n\n    // 3. Return YearFromTime(LocalTime(t)) - 1900.\n    return new NumberValue(realm, YearFromTime(realm, LocalTime(realm, t)) - 1900);\n  });\n\n  // B.2.4.2\n  obj.defineNativeMethod(\"setYear\", 1, (context, [year]) => {\n    // 1. Let t be ? thisTimeValue(this value).\n    let t = thisTimeValue(realm, context).throwIfNotConcreteNumber().value;\n    invariant(context instanceof ObjectValue);\n\n    // 2. If t is NaN, let t be +0; otherwise, let t be LocalTime(t).\n    t = isNaN(t) ? +0 : LocalTime(realm, t);\n\n    // 3. Let y be ? ToNumber(year).\n    let y = To.ToNumber(realm, year);\n\n    // 4. If y is NaN, set the [[DateValue]] internal slot of this Date object to NaN and return NaN.\n    if (isNaN(y)) {\n      context.$DateValue = realm.intrinsics.NaN;\n      return realm.intrinsics.NaN;\n    }\n\n    // 5. If y is not NaN and 0 ≤ To.ToInteger(y) ≤ 99, let yyyy be To.ToInteger(y) + 1900.\n    let yyyy;\n    if (To.ToInteger(realm, y) < 99) {\n      yyyy = To.ToInteger(realm, y) + 1900;\n    } else {\n      // 6. Else, let yyyy be y.\n      yyyy = y;\n    }\n\n    // 7. Let d be MakeDay(yyyy, MonthFromTime(t), DateFromTime(t)).\n    let d = MakeDay(realm, yyyy, MonthFromTime(realm, t), DateFromTime(realm, t));\n\n    // 8. Let date be UTC(MakeDate(d, TimeWithinDay(t))).\n    let date = UTC(realm, MakeDate(realm, d, TimeWithinDay(realm, t)));\n\n    // 9. Set the [[DateValue]] internal slot of this Date object to TimeClip(date).\n    let dateValue = TimeClip(realm, date);\n    context.$DateValue = dateValue;\n\n    // 10. Return the value of the [[DateValue]] internal slot of this Date object.\n    return dateValue;\n  });\n\n  // B.2.4.3\n  obj.defineNativeProperty(\"toGMTString\", obj.$Get(\"toUTCString\", obj));\n}\n"
  },
  {
    "path": "src/intrinsics/ecma262/Error.js",
    "content": "/**\n * Copyright (c) 2017-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n/* @flow strict-local */\n\nimport type { Realm } from \"../../realm.js\";\nimport type { LexicalEnvironment } from \"../../environment.js\";\nimport {\n  AbstractValue,\n  ObjectValue,\n  FunctionValue,\n  NativeFunctionValue,\n  StringValue,\n  Value,\n} from \"../../values/index.js\";\nimport { Get } from \"../../methods/index.js\";\nimport { Create, Properties, To } from \"../../singletons.js\";\nimport invariant from \"../../invariant.js\";\nimport type { BabelNodeSourceLocation } from \"@babel/types\";\nimport { PropertyDescriptor } from \"../../descriptors.js\";\n\nexport default function(realm: Realm): NativeFunctionValue {\n  return build(\"Error\", realm, false);\n}\n\nexport function describeLocation(\n  realm: Realm,\n  callerFn: ?FunctionValue,\n  env: ?LexicalEnvironment,\n  loc: ?BabelNodeSourceLocation\n): void | string {\n  let locString = \"\";\n  let displayName = \"\";\n  let key = loc || callerFn;\n\n  // check if we've already encountered the callFn and if so\n  // re-use that described location. plus we may get stuck trying\n  // to get the location by recursively checking the same fun\n  // so this also prevents a stack overflow\n  if (key) {\n    if (realm.alreadyDescribedLocations.has(key)) {\n      return realm.alreadyDescribedLocations.get(key);\n    }\n    realm.alreadyDescribedLocations.set(key, undefined);\n  }\n\n  if (callerFn) {\n    if (callerFn instanceof NativeFunctionValue) {\n      locString = \"native\";\n    }\n\n    let name = callerFn._SafeGetDataPropertyValue(\"name\");\n    if (!name.mightBeUndefined()) displayName = To.ToStringPartial(realm, name);\n    else name.throwIfNotConcrete();\n\n    if (env && env.environmentRecord.$NewTarget) displayName = `new ${displayName}`;\n  }\n\n  if (!locString) {\n    if (loc) {\n      locString = `${loc.start.line}:${loc.start.column + 1}`;\n      if (loc.source !== null) locString = `${loc.source}:${locString}`;\n    } else {\n      locString = (loc ? loc.source : undefined) || \"unknown\";\n      if (!displayName) return undefined;\n    }\n  }\n\n  let location;\n  if (displayName) {\n    location = `at ${displayName} (${locString})`;\n  } else {\n    location = `at ${locString}`;\n  }\n  if (key) {\n    realm.alreadyDescribedLocations.set(key, location);\n  }\n  return location;\n}\n\nconst buildStackTemplateSrc = 'A + (B ? \": \" + B : \"\") + C';\n\nfunction buildStack(realm: Realm, context: ObjectValue): Value {\n  invariant(context.$ErrorData);\n\n  let stack = context.$ErrorData.contextStack;\n  if (!stack) return realm.intrinsics.undefined;\n\n  let lines = [];\n  let header = To.ToStringPartial(realm, Get(realm, context, \"name\"));\n\n  let message = Get(realm, context, \"message\");\n  if (!message.mightBeUndefined()) {\n    message = To.ToStringValue(realm, message);\n  } else {\n    message.throwIfNotConcrete();\n  }\n\n  for (let executionContext of stack.reverse()) {\n    let caller = executionContext.caller;\n    if (!executionContext.loc) continue; // compiler generated helper for destructuring arguments\n    let locString = describeLocation(\n      realm,\n      caller ? caller.function : undefined,\n      caller ? caller.lexicalEnvironment : undefined,\n      executionContext.loc\n    );\n    if (locString !== undefined) lines.push(locString);\n  }\n  let footer = `\\n    ${lines.join(\"\\n    \")}`;\n\n  return message instanceof StringValue\n    ? new StringValue(realm, `${header}${message.value ? `: ${message.value}` : \"\"}${footer}`)\n    : AbstractValue.createFromTemplate(realm, buildStackTemplateSrc, StringValue, [\n        new StringValue(realm, header),\n        message,\n        new StringValue(realm, footer),\n      ]);\n}\n\nexport function build(name: string, realm: Realm, inheritError?: boolean = true): NativeFunctionValue {\n  let func = new NativeFunctionValue(realm, name, name, 1, (context, [message], argLength, NewTarget) => {\n    // 1. If NewTarget is undefined, let newTarget be the active function object, else let newTarget be NewTarget.\n    let newTarget = NewTarget || func;\n\n    // 2. Let O be ? OrdinaryCreateFromConstructor(newTarget, \"%ErrorPrototype%\", « [[ErrorData]] »).\n    let O = Create.OrdinaryCreateFromConstructor(realm, newTarget, `${name}Prototype`, { $ErrorData: undefined });\n    O.$ErrorData = {\n      contextStack: realm.contextStack.slice(1),\n      locationData: undefined,\n    };\n\n    // 3. If message is not undefined, then\n    if (!message.mightBeUndefined()) {\n      // a. Let msg be ? ToString(message).\n      let msg = message.getType() === StringValue ? message : To.ToStringValue(realm, message);\n\n      // b. Let msgDesc be the PropertyDescriptor{[[Value]]: msg, [[Writable]]: true, [[Enumerable]]: false, [[Configurable]]: true}.\n      let msgDesc = new PropertyDescriptor({\n        value: msg,\n        writable: true,\n        enumerable: false,\n        configurable: true,\n      });\n\n      // c. Perform ! DefinePropertyOrThrow(O, \"message\", msgDesc).\n      Properties.DefinePropertyOrThrow(realm, O, \"message\", msgDesc);\n    } else {\n      message.throwIfNotConcrete();\n    }\n\n    // Build a text description of the stack.\n    let stackDesc = new PropertyDescriptor({\n      value: buildStack(realm, O),\n      enumerable: false,\n      configurable: true,\n      writable: true,\n    });\n    Properties.DefinePropertyOrThrow(realm, O, \"stack\", stackDesc);\n\n    // 4. Return O.\n    return O;\n  });\n\n  if (inheritError) {\n    func.$Prototype = realm.intrinsics.Error;\n  }\n\n  return func;\n}\n"
  },
  {
    "path": "src/intrinsics/ecma262/ErrorPrototype.js",
    "content": "/**\n * Copyright (c) 2017-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n/* @flow strict-local */\n\nimport type { Realm } from \"../../realm.js\";\nimport { ObjectValue, StringValue, UndefinedValue } from \"../../values/index.js\";\nimport { Get } from \"../../methods/index.js\";\nimport { To } from \"../../singletons.js\";\n\nexport default function(realm: Realm, obj: ObjectValue): void {\n  return build(\"Error\", realm, obj);\n}\n\nexport function build(name: string, realm: Realm, obj: ObjectValue): void {\n  // ECMA262 19.5.3.2\n  obj.defineNativeProperty(\"message\", realm.intrinsics.emptyString);\n\n  // ECMA262 19.5.3.3\n  obj.defineNativeProperty(\"name\", new StringValue(realm, name));\n\n  // ECMA262 19.5.3.4\n  obj.defineNativeMethod(\"toString\", 0, context => {\n    // 1. Let O be the this value.\n    let O = context.throwIfNotConcrete();\n\n    // 2. If Type(O) is not Object, throw a TypeError exception.\n    if (!(O instanceof ObjectValue)) {\n      throw realm.createErrorThrowCompletion(realm.intrinsics.TypeError);\n    }\n\n    // 3. Let name be ? Get(O, \"name\").\n    let nameValue = Get(realm, O, \"name\");\n\n    // 4. If name is undefined, let name be \"Error\"; otherwise let name be ? ToString(name).\n    let nameString = nameValue instanceof UndefinedValue ? \"Error\" : To.ToStringPartial(realm, nameValue);\n\n    // 5. Let msg be ? Get(O, \"message\").\n    let msg = Get(realm, O, \"message\");\n\n    // 6. If msg is undefined, let msg be the empty String; otherwise let msg be ? ToString(msg).\n    msg = msg instanceof UndefinedValue ? \"\" : To.ToStringPartial(realm, msg);\n\n    // Note that in ES5, both name and msg are checked for emptiness in step 7,\n    // which however is later dropped in ES6.\n    // 7. If name is the empty String, return msg.\n    if (nameString === \"\") return new StringValue(realm, msg);\n\n    // 8. If msg is the empty String, return name.\n    if (msg === \"\") return new StringValue(realm, nameString);\n\n    // 9. Return the result of concatenating name, the code unit 0x003A (COLON), the code unit 0x0020 (SPACE), and msg.\n    return new StringValue(realm, `${nameString}: ${msg}`);\n  });\n}\n"
  },
  {
    "path": "src/intrinsics/ecma262/EvalError.js",
    "content": "/**\n * Copyright (c) 2017-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n/* @flow strict-local */\n\nimport type { Realm } from \"../../realm.js\";\nimport type { NativeFunctionValue } from \"../../values/index.js\";\nimport { build } from \"./Error.js\";\n\nexport default function(realm: Realm): NativeFunctionValue {\n  return build(\"EvalError\", realm);\n}\n"
  },
  {
    "path": "src/intrinsics/ecma262/EvalErrorPrototype.js",
    "content": "/**\n * Copyright (c) 2017-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n/* @flow strict-local */\n\nimport type { Realm } from \"../../realm.js\";\nimport { ObjectValue, StringValue } from \"../../values/index.js\";\n\nexport default function(realm: Realm, obj: ObjectValue): void {\n  obj.defineNativeProperty(\"name\", new StringValue(realm, \"EvalError\"));\n  obj.defineNativeProperty(\"message\", realm.intrinsics.emptyString);\n}\n"
  },
  {
    "path": "src/intrinsics/ecma262/Float32Array.js",
    "content": "/**\n * Copyright (c) 2017-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n/* @flow strict-local */\n\nimport type { Realm } from \"../../realm.js\";\nimport { NativeFunctionValue } from \"../../values/index.js\";\nimport { build } from \"./TypedArray.js\";\n\nexport default function(realm: Realm): NativeFunctionValue {\n  return build(realm, \"Float32\");\n}\n"
  },
  {
    "path": "src/intrinsics/ecma262/Float32ArrayPrototype.js",
    "content": "/**\n * Copyright (c) 2017-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n/* @flow strict-local */\n\nimport type { Realm } from \"../../realm.js\";\nimport type { ObjectValue } from \"../../values/index.js\";\nimport { build } from \"./TypedArrayPrototype.js\";\n\nexport default function(realm: Realm, obj: ObjectValue): void {\n  build(realm, obj, \"Float32\");\n}\n"
  },
  {
    "path": "src/intrinsics/ecma262/Float64Array.js",
    "content": "/**\n * Copyright (c) 2017-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n/* @flow strict-local */\n\nimport type { Realm } from \"../../realm.js\";\nimport { NativeFunctionValue } from \"../../values/index.js\";\nimport { build } from \"./TypedArray.js\";\n\nexport default function(realm: Realm): NativeFunctionValue {\n  return build(realm, \"Float64\");\n}\n"
  },
  {
    "path": "src/intrinsics/ecma262/Float64ArrayPrototype.js",
    "content": "/**\n * Copyright (c) 2017-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n/* @flow strict-local */\n\nimport type { Realm } from \"../../realm.js\";\nimport type { ObjectValue } from \"../../values/index.js\";\nimport { build } from \"./TypedArrayPrototype.js\";\n\nexport default function(realm: Realm, obj: ObjectValue): void {\n  build(realm, obj, \"Float64\");\n}\n"
  },
  {
    "path": "src/intrinsics/ecma262/Function.js",
    "content": "/**\n * Copyright (c) 2017-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n/* @flow strict-local */\n\nimport type { Realm } from \"../../realm.js\";\nimport { NativeFunctionValue } from \"../../values/index.js\";\nimport { Create } from \"../../singletons.js\";\n\nexport default function(realm: Realm): NativeFunctionValue {\n  // ECMA262 19.2.1\n  let func = new NativeFunctionValue(realm, \"Function\", \"Function\", 1, (context, _args, argCount, NewTarget) => {\n    let args = _args;\n    // 1. Let C be the active function object.\n    let C = func;\n\n    // 2. Let args be the argumentsList that was passed to this function by [[Call]] or [[Construct]].\n    args = argCount > 0 ? args : [];\n\n    // 3. Return ? CreateDynamicFunction(C, NewTarget, \"normal\", args).\n    return Create.CreateDynamicFunction(realm, C, NewTarget, \"normal\", args);\n  });\n\n  return func;\n}\n"
  },
  {
    "path": "src/intrinsics/ecma262/FunctionPrototype.js",
    "content": "/**\n * Copyright (c) 2017-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n/* @flow strict-local */\n\nimport type { Realm } from \"../../realm.js\";\nimport { Functions, Properties } from \"../../singletons.js\";\nimport {\n  AbstractValue,\n  BooleanValue,\n  FunctionValue,\n  NativeFunctionValue,\n  NullValue,\n  NumberValue,\n  ObjectValue,\n  StringValue,\n  UndefinedValue,\n  Value,\n} from \"../../values/index.js\";\nimport { Call } from \"../../methods/call.js\";\nimport { Create, To } from \"../../singletons.js\";\nimport { Get } from \"../../methods/get.js\";\nimport { IsCallable } from \"../../methods/is.js\";\nimport { HasOwnProperty, HasSomeCompatibleType } from \"../../methods/has.js\";\nimport { OrdinaryHasInstance } from \"../../methods/abstract.js\";\nimport invariant from \"../../invariant.js\";\nimport { PropertyDescriptor } from \"../../descriptors.js\";\n\nexport default function(realm: Realm, obj: ObjectValue): void {\n  // ECMA262 19.2.3\n  obj.$Call = (thisArgument, argsList) => {\n    return realm.intrinsics.undefined;\n  };\n\n  // ECMA262 19.2.3\n  obj.defineNativeProperty(\"length\", realm.intrinsics.zero, { writable: false });\n\n  // ECMA262 19.2.3\n  obj.defineNativeProperty(\"name\", realm.intrinsics.emptyString, { writable: false });\n\n  // ECMA262 19.2.3.3\n  obj.defineNativeMethod(\"call\", 1, (func, [thisArg, ...argList]) => {\n    // 1. If IsCallable(func) is false, throw a TypeError exception.\n    if (IsCallable(realm, func) === false) {\n      throw realm.createErrorThrowCompletion(realm.intrinsics.TypeError, \"not callable\");\n    }\n\n    // 2. Let argList be a new empty List.\n    // 3. If this method was called with more than one argument, then in left to right order,\n    //    starting with the second argument, append each argument as the last element of argList.\n    argList;\n\n    // TODO #1008 4. Perform PrepareForTailCall().\n\n    // 5. Return ? Call(func, thisArg, argList).\n    return Call(realm, func, thisArg, argList);\n  });\n\n  function conditionalFunctionApply(\n    func,\n    thisArg,\n    condValue: AbstractValue,\n    consequentVal: Value,\n    alternateVal: Value\n  ): Value {\n    return realm.evaluateWithAbstractConditional(\n      condValue,\n      () => {\n        return realm.evaluateForEffects(\n          () => functionApply(func, thisArg, consequentVal),\n          null,\n          \"conditionalFunctionApply consequent\"\n        );\n      },\n      () => {\n        return realm.evaluateForEffects(\n          () => functionApply(func, thisArg, alternateVal),\n          null,\n          \"conditionalFunctionApply alternate\"\n        );\n      }\n    );\n  }\n\n  function functionApply(func, thisArg, argArray) {\n    // 1. If IsCallable(func) is false, throw a TypeError exception.\n    if (IsCallable(realm, func) === false) {\n      throw realm.createErrorThrowCompletion(realm.intrinsics.TypeError, \"not callable\");\n    }\n\n    // 2. If argArray is null or undefined, then\n    if (HasSomeCompatibleType(argArray, NullValue, UndefinedValue)) {\n      // TODO #1008 a. Perform PrepareForTailCall().\n\n      // b. Return ? Call(func, thisArg).\n      return Call(realm, func, thisArg);\n    }\n\n    if (argArray instanceof AbstractValue) {\n      if (argArray.kind === \"conditional\") {\n        let [condValue, consequentVal, alternateVal] = argArray.args;\n        invariant(condValue instanceof AbstractValue);\n        return conditionalFunctionApply(func, thisArg, condValue, consequentVal, alternateVal);\n      } else if (argArray.kind === \"||\") {\n        let [leftValue, rightValue] = argArray.args;\n        invariant(leftValue instanceof AbstractValue);\n        return conditionalFunctionApply(func, thisArg, leftValue, leftValue, rightValue);\n      } else if (argArray.kind === \"&&\") {\n        let [leftValue, rightValue] = argArray.args;\n        invariant(leftValue instanceof AbstractValue);\n        return conditionalFunctionApply(func, thisArg, leftValue, rightValue, leftValue);\n      }\n    }\n\n    // 3. Let argList be ? CreateListFromArrayLike(argArray).\n    let argList = Create.CreateListFromArrayLike(realm, argArray);\n\n    // TODO #1008 4. Perform PrepareForTailCall().\n\n    // 5. Return ? Call(func, thisArg, argList).\n    return Call(realm, func, thisArg, argList);\n  }\n\n  // ECMA262 19.2.3.1\n  obj.defineNativeMethod(\"apply\", 2, (func, [thisArg, argArray]) => functionApply(func, thisArg, argArray));\n\n  // ECMA262 19.2.3.2\n  obj.defineNativeMethod(\"bind\", 1, (context, [thisArg, ...args]) => {\n    // 1. Let Target be the realm value.\n    let Target = context;\n\n    // 2. If IsCallable(Target) is false, throw a TypeError exception.\n    if (IsCallable(realm, Target) === false) {\n      throw realm.createErrorThrowCompletion(realm.intrinsics.TypeError);\n    }\n    invariant(Target instanceof ObjectValue);\n\n    // 3. Let args be a new (possibly empty) List consisting of all of the argument values provided after thisArg in order.\n    args;\n\n    // 4. Let F be ? BoundFunctionCreate(Target, thisArg, args).\n    let F = Functions.BoundFunctionCreate(realm, Target, thisArg, args);\n\n    // 5. Let targetHasLength be ? HasOwnProperty(Target, \"length\").\n    let targetHasLength = HasOwnProperty(realm, Target, new StringValue(realm, \"length\"));\n\n    let L;\n\n    // 6. If targetHasLength is true, then\n    if (targetHasLength === true) {\n      // a. Let targetLen be ? Get(Target, \"length\").\n      let targetLen = Get(realm, Target, new StringValue(realm, \"length\"));\n\n      // b. If Type(targetLen) is not Number, let L be 0.\n      if (!targetLen.mightBeNumber()) {\n        L = 0;\n      } else {\n        // c. Else,\n        targetLen = targetLen.throwIfNotConcreteNumber();\n        // i. Let targetLen be ToInteger(targetLen).\n        targetLen = To.ToInteger(realm, targetLen);\n\n        // ii. Let L be the larger of 0 and the result of targetLen minus the number of elements of args.\n        L = Math.max(0, targetLen - args.length);\n      }\n    } else {\n      // 7. Else let L be 0.\n      L = 0;\n    }\n\n    // 8. Perform ! DefinePropertyOrThrow(F, \"length\", PropertyDescriptor {[[Value]]: L, [[Writable]]: false, [[Enumerable]]: false, [[Configurable]]: true}).\n    Properties.DefinePropertyOrThrow(\n      realm,\n      F,\n      \"length\",\n      new PropertyDescriptor({\n        value: new NumberValue(realm, L),\n        writable: false,\n        enumerable: false,\n        configurable: true,\n      })\n    );\n\n    // 9. Let targetName be ? Get(Target, \"name\").\n    let targetName = Get(realm, Target, new StringValue(realm, \"name\"));\n\n    // 10. If Type(targetName) is not String, let targetName be the empty string.\n    if (!(targetName instanceof StringValue)) targetName = realm.intrinsics.emptyString;\n\n    // 11. Perform SetFunctionName(F, targetName, \"bound\").\n    Functions.SetFunctionName(realm, F, targetName, \"bound\");\n\n    // 12. Return F.\n    return F;\n  });\n\n  // ECMA262 19.2.3.6\n  obj.defineNativeMethod(\n    realm.intrinsics.SymbolHasInstance,\n    1,\n    (context, [V]) => {\n      // 1. Let F be the this value.\n      let F = context;\n\n      // 2. Return ? OrdinaryHasInstance(F, V).\n      return new BooleanValue(realm, OrdinaryHasInstance(realm, F, V));\n    },\n    { writable: false, configurable: false }\n  );\n\n  // ECMA262 19.2.3.5\n  obj.defineNativeMethod(\"toString\", 0, _context => {\n    let context = _context.throwIfNotConcrete();\n    if (context instanceof NativeFunctionValue) {\n      let name = context.name;\n      if (name instanceof AbstractValue) {\n        return new StringValue(realm, `function () {[native code]}`);\n      } else {\n        invariant(typeof name === \"string\");\n        return new StringValue(realm, `function ${name}() { [native code] }`);\n      }\n    } else if (context instanceof FunctionValue) {\n      // TODO #1009: provide function source code\n      return new StringValue(realm, \"function () { }\");\n    } else {\n      // 3. Throw a TypeError exception.\n      throw realm.createErrorThrowCompletion(\n        realm.intrinsics.TypeError,\n        new StringValue(realm, \"Function.prototype.toString is not generic\")\n      );\n    }\n  });\n}\n"
  },
  {
    "path": "src/intrinsics/ecma262/Generator.js",
    "content": "/**\n * Copyright (c) 2017-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n/* @flow strict-local */\n\nimport type { Realm } from \"../../realm.js\";\nimport { ObjectValue, StringValue } from \"../../values/index.js\";\n\nexport default function(realm: Realm, obj: ObjectValue): void {\n  // ECMA262 25.3.1.5\n  obj.defineNativeProperty(realm.intrinsics.SymbolToStringTag, new StringValue(realm, \"GeneratorFunction\"), {\n    writable: false,\n  });\n}\n"
  },
  {
    "path": "src/intrinsics/ecma262/GeneratorFunction.js",
    "content": "/**\n * Copyright (c) 2017-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n/* @flow strict-local */\n\nimport type { Realm } from \"../../realm.js\";\nimport { NativeFunctionValue } from \"../../values/index.js\";\nimport { Create } from \"../../singletons.js\";\n\nexport default function(realm: Realm): NativeFunctionValue {\n  // ECMA262 25.2.1\n  let func = new NativeFunctionValue(\n    realm,\n    \"GeneratorFunction\",\n    \"GeneratorFunction\",\n    1,\n    (context, _args, argCount, NewTarget) => {\n      let args = _args;\n      // 1. Let C be the active function object.\n      let C = func;\n\n      // 2. Let args be the argumentsList that was passed to this function by [[Call]] or [[Construct]].\n      args = argCount > 0 ? args : [];\n\n      // 3. Return ? CreateDynamicFunction(C, NewTarget, \"generator\", args).\n      return Create.CreateDynamicFunction(realm, C, NewTarget, \"generator\", args);\n    }\n  );\n\n  return func;\n}\n"
  },
  {
    "path": "src/intrinsics/ecma262/GeneratorPrototype.js",
    "content": "/**\n * Copyright (c) 2017-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n/* @flow strict-local */\n\nimport type { Realm } from \"../../realm.js\";\nimport { ReturnCompletion } from \"../../completions.js\";\nimport { ObjectValue, StringValue } from \"../../values/index.js\";\nimport { GeneratorResume, GeneratorResumeAbrupt } from \"../../methods/generator.js\";\n\nexport default function(realm: Realm, obj: ObjectValue): void {\n  // ECMA262 25.3.1.2\n  obj.defineNativeMethod(\"next\", 1, (context, [value]) => {\n    // 1. Let g be the this value.\n    let g = context;\n\n    // 2. Return ? GeneratorResume(g, value).\n    return GeneratorResume(realm, g, value);\n  });\n\n  // ECMA262 25.3.1.3\n  obj.defineNativeMethod(\"return\", 1, (context, [value]) => {\n    // 1. Let g be the this value.\n    let g = context;\n\n    // 2. Let C be Completion{[[Type]]: return, [[Value]]: value, [[Target]]: empty}.\n    let C = new ReturnCompletion(value, realm.currentLocation);\n\n    // 3. Return ? GeneratorResumeAbrupt(g, C).\n    return GeneratorResumeAbrupt(realm, g, C);\n  });\n\n  // ECMA262 25.3.1.4\n  obj.defineNativeMethod(\"throw\", 1, (context, [exception]) => {\n    // 1. Let g be the this value.\n    let g = context;\n\n    // 2. Let C be Completion{[[Type]]: throw, [[Value]]: exception, [[Target]]: empty}.\n    let C = new ReturnCompletion(exception, realm.currentLocation);\n\n    // 3. Return ? GeneratorResumeAbrupt(g, C).\n    return GeneratorResumeAbrupt(realm, g, C);\n  });\n\n  // ECMA262 25.3.1.5\n  obj.defineNativeProperty(realm.intrinsics.SymbolToStringTag, new StringValue(realm, \"Generator\"), {\n    writable: false,\n  });\n}\n"
  },
  {
    "path": "src/intrinsics/ecma262/Int16Array.js",
    "content": "/**\n * Copyright (c) 2017-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n/* @flow strict-local */\n\nimport type { Realm } from \"../../realm.js\";\nimport { NativeFunctionValue } from \"../../values/index.js\";\nimport { build } from \"./TypedArray.js\";\n\nexport default function(realm: Realm): NativeFunctionValue {\n  return build(realm, \"Int16\");\n}\n"
  },
  {
    "path": "src/intrinsics/ecma262/Int16ArrayPrototype.js",
    "content": "/**\n * Copyright (c) 2017-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n/* @flow strict-local */\n\nimport type { Realm } from \"../../realm.js\";\nimport type { ObjectValue } from \"../../values/index.js\";\nimport { build } from \"./TypedArrayPrototype.js\";\n\nexport default function(realm: Realm, obj: ObjectValue): void {\n  build(realm, obj, \"Int16\");\n}\n"
  },
  {
    "path": "src/intrinsics/ecma262/Int32Array.js",
    "content": "/**\n * Copyright (c) 2017-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n/* @flow strict-local */\n\nimport type { Realm } from \"../../realm.js\";\nimport { NativeFunctionValue } from \"../../values/index.js\";\nimport { build } from \"./TypedArray.js\";\n\nexport default function(realm: Realm): NativeFunctionValue {\n  return build(realm, \"Int32\");\n}\n"
  },
  {
    "path": "src/intrinsics/ecma262/Int32ArrayPrototype.js",
    "content": "/**\n * Copyright (c) 2017-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n/* @flow strict-local */\n\nimport type { Realm } from \"../../realm.js\";\nimport type { ObjectValue } from \"../../values/index.js\";\nimport { build } from \"./TypedArrayPrototype.js\";\n\nexport default function(realm: Realm, obj: ObjectValue): void {\n  build(realm, obj, \"Int32\");\n}\n"
  },
  {
    "path": "src/intrinsics/ecma262/Int8Array.js",
    "content": "/**\n * Copyright (c) 2017-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n/* @flow strict-local */\n\nimport type { Realm } from \"../../realm.js\";\nimport { NativeFunctionValue } from \"../../values/index.js\";\nimport { build } from \"./TypedArray.js\";\n\nexport default function(realm: Realm): NativeFunctionValue {\n  return build(realm, \"Int8\");\n}\n"
  },
  {
    "path": "src/intrinsics/ecma262/Int8ArrayPrototype.js",
    "content": "/**\n * Copyright (c) 2017-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n/* @flow strict-local */\n\nimport type { Realm } from \"../../realm.js\";\nimport type { ObjectValue } from \"../../values/index.js\";\nimport { build } from \"./TypedArrayPrototype.js\";\n\nexport default function(realm: Realm, obj: ObjectValue): void {\n  build(realm, obj, \"Int8\");\n}\n"
  },
  {
    "path": "src/intrinsics/ecma262/IteratorPrototype.js",
    "content": "/**\n * Copyright (c) 2017-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n/* @flow strict-local */\n\nimport type { Realm } from \"../../realm.js\";\nimport { ObjectValue } from \"../../values/index.js\";\n\nexport default function(realm: Realm, obj: ObjectValue): void {\n  // ECMA262 25.1.2.1\n  obj.defineNativeMethod(realm.intrinsics.SymbolIterator, 0, context => {\n    // 1. Return the this value.\n    return context;\n  });\n}\n"
  },
  {
    "path": "src/intrinsics/ecma262/JSON.js",
    "content": "/**\n * Copyright (c) 2017-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n/* @flow strict-local */\n\nimport type { Realm } from \"../../realm.js\";\nimport {\n  AbstractObjectValue,\n  AbstractValue,\n  ArrayValue,\n  BooleanValue,\n  NullValue,\n  NumberValue,\n  ObjectValue,\n  PrimitiveValue,\n  StringValue,\n  UndefinedValue,\n  Value,\n} from \"../../values/index.js\";\nimport { Call, EnumerableOwnProperties, Get, HasSomeCompatibleType, IsArray, IsCallable } from \"../../methods/index.js\";\nimport { InternalizeJSONProperty } from \"../../methods/json.js\";\nimport { ValuesDomain } from \"../../domains/index.js\";\nimport { FatalError } from \"../../errors.js\";\nimport { Create, Properties, To } from \"../../singletons.js\";\nimport nativeToInterp from \"../../utils/native-to-interp.js\";\nimport invariant from \"../../invariant.js\";\n\ntype Context = {\n  PropertyList?: Array<StringValue>,\n  ReplacerFunction?: ObjectValue,\n  stack: Array<ObjectValue>,\n  indent: string,\n  gap: string,\n};\n\nfunction SerializeJSONArray(realm: Realm, value: ObjectValue, context: Context): string {\n  // 1. If stack contains value, throw a TypeError exception because the structure is cyclical.\n  if (context.stack.indexOf(value) >= 0) {\n    throw realm.createErrorThrowCompletion(realm.intrinsics.TypeError, \"cyclical error\");\n  }\n\n  // 2. Append value to stack.\n  context.stack.push(value);\n\n  // 3. Let stepback be indent.\n  let stepback = context.indent;\n\n  // 4. Let indent be the concatenation of indent and gap.\n  context.indent += context.gap;\n\n  // 5. Let partial be a new empty List.\n  let partial = [];\n\n  // 6. Let len be ? ToLength(? Get(value, \"length\")).\n  let len = To.ToLength(realm, Get(realm, value, \"length\"));\n\n  // 7. Let index be 0.\n  let index = 0;\n\n  // 8. Repeat while index < len\n  while (index < len) {\n    // a. Let strP be ? SerializeJSONProperty(! ToString(index), value).\n    let strP = SerializeJSONProperty(realm, new StringValue(realm, index + \"\"), value, context);\n\n    // b. If strP is undefined, then\n    if (strP === undefined) {\n      // i. Append \"null\" to partial.\n      partial.push(\"null\");\n    } else {\n      // c. Else,\n      // i. Append strP to partial.\n      partial.push(strP);\n    }\n\n    // d. Increment index by 1.\n    index++;\n  }\n\n  // 9. If partial is empty, then\n  let final = \"\";\n  if (!partial.length) {\n    // a. Let final be \"[]\".\n    final = \"[]\";\n  } else {\n    // 10. Else,\n    // a. If gap is the empty String, then\n    if (!context.gap) {\n      // i. Let properties be a String formed by concatenating all the element Strings of partial with each adjacent pair of Strings separated with code unit 0x002C (COMMA). A comma is not inserted either before the first String or after the last String.\n      let properties = partial.join(\",\");\n\n      // ii. Let final be the result of concatenating \"[\", properties, and \"]\".\n      final = `[${properties}]`;\n    } else {\n      // b. Else,\n      // i. Let separator be the result of concatenating code unit 0x002C (COMMA), code unit 0x000A (LINE FEED), and indent.\n      // ii. Let properties be a String formed by concatenating all the element Strings of partial with each adjacent pair of Strings separated with separator. The separator String is not inserted either before the first String or after the last String.\n      // iii. Let final be the result of concatenating \"[\", code unit 0x000A (LINE FEED), indent, properties, code unit 0x000A (LINE FEED), stepback, and \"]\".\n    }\n  }\n\n  // 11. Remove the last element of stack.\n  context.stack.pop();\n\n  // 12. Let indent be stepback.\n  context.indent = stepback;\n\n  // 13. Return final.\n  return final;\n}\n\nfunction QuoteJSONString(realm: Realm, value: StringValue): string {\n  return JSON.stringify(value.value);\n}\n\nfunction SerializeJSONObject(realm: Realm, value: ObjectValue, context: Context): string {\n  // 1. If stack contains value, throw a TypeError exception because the structure is cyclical.\n  if (context.stack.indexOf(value) >= 0) {\n    throw realm.createErrorThrowCompletion(realm.intrinsics.TypeError, \"cyclical error\");\n  }\n\n  // 2. Append value to stack.\n  context.stack.push(value);\n\n  // 3. Let stepback be indent.\n  let stepback = context.indent;\n\n  // 4. Let indent be the concatenation of indent and gap.\n  context.indent += context.gap;\n\n  // 5. If PropertyList is not undefined, then\n  let K;\n  if (context.PropertyList !== undefined) {\n    // a. Let K be PropertyList.\n    K = context.PropertyList;\n  } else {\n    // 6. Else,\n    // a. Let K be ? EnumerableOwnProperties(value, \"key\").\n    K = EnumerableOwnProperties(realm, value, \"key\");\n  }\n\n  // 7. Let partial be a new empty List.\n  let partial = [];\n\n  // 8. For each element P of K,\n  for (let P of K) {\n    invariant(P instanceof StringValue);\n\n    // a. Let strP be ? SerializeJSONProperty(P, value).\n    let strP = SerializeJSONProperty(realm, P, value, context);\n\n    // b. If strP is not undefined, then\n    if (strP !== undefined) {\n      // i. Let member be QuoteJSONString(P).\n      let member = QuoteJSONString(realm, P);\n\n      // ii. Let member be the concatenation of member and the string \":\".\n      member += \":\";\n\n      // iii. If gap is not the empty String, then\n      if (context.gap) {\n        // 1. Let member be the concatenation of member and code unit 0x0020 (SPACE).\n        member += \" \";\n      }\n\n      // iv. Let member be the concatenation of member and strP.\n      member += strP;\n\n      // v. Append member to partial.\n      partial.push(member);\n    }\n  }\n\n  // 9. If partial is empty, then\n  let final: string = \"\";\n  if (!partial.length) {\n    // a. Let final be \"{}\".\n    final = \"{}\";\n  } else {\n    // 10. Else,\n    // a. If gap is the empty String, then\n    if (!context.gap) {\n      // i. Let properties be a String formed by concatenating all the element Strings of partial with each adjacent pair of Strings separated with code unit 0x002C (COMMA). A comma is not inserted either before the first String or after the last String.\n      let properties = partial.join(\",\");\n\n      // ii. Let final be the result of concatenating \"{\", properties, and \"}\".\n      final = `{${properties}}`;\n    } else {\n      // b. Else gap is not the empty String,\n      // i. Let separator be the result of concatenating code unit 0x002C (COMMA), code unit 0x000A (LINE FEED), and indent.\n      // ii. Let properties be a String formed by concatenating all the element Strings of partial with each adjacent pair of Strings separated with separator. The separator String is not inserted either before the first String or after the last String.\n      // iii. Let final be the result of concatenating \"{\", code unit 0x000A (LINE FEED), indent, properties, code unit 0x000A (LINE FEED), stepback, and \"}\".\n    }\n  }\n\n  // 11. Remove the last element of stack.\n  context.stack.pop();\n\n  // 12. Let indent be stepback.\n  context.indent = stepback;\n\n  // 13. Return final.\n  return final;\n}\n\nfunction SerializeJSONProperty(realm: Realm, key: StringValue, holder: ObjectValue, context: Context): void | string {\n  // 1. Let value be ? Get(holder, key).\n  let value = Get(realm, holder, key).throwIfNotConcrete();\n\n  // 2. If Type(value) is Object, then\n  if (value instanceof ObjectValue) {\n    // a. Let toJSON be ? Get(value, \"toJSON\").\n    let toJSON = Get(realm, value, \"toJSON\");\n\n    // b. If IsCallable(toJSON) is true, then\n    if (IsCallable(realm, toJSON)) {\n      // i. Let value be ? Call(toJSON, value, « key »).\n      value = Call(realm, toJSON, value, [key]);\n    }\n  }\n\n  // 3. If ReplacerFunction is not undefined, then\n  if (context.ReplacerFunction) {\n    // a. Let value be ? Call(ReplacerFunction, holder, « key, value »).\n    value = Call(realm, context.ReplacerFunction, holder, [key, value]);\n  }\n\n  // 4. If Type(value) is Object, then\n  if (value instanceof ObjectValue) {\n    // a. If value has a [[NumberData]] internal slot, then\n    if (value.$NumberData) {\n      // b. Let value be ? ToNumber(value).\n      value = new NumberValue(realm, To.ToNumber(realm, value));\n    } else if (value.$StringData) {\n      // c. Else if value has a [[StringData]] internal slot, then\n      // d. Let value be ? ToString(value).\n      value = new StringValue(realm, To.ToString(realm, value));\n    } else if (value.$BooleanData) {\n      // e. Else if value has a [[BooleanData]] internal slot, then\n      // f. Let value be the value of the [[BooleanData]] internal slot of value.\n      value = value.$BooleanData;\n    }\n  }\n\n  // 5. If value is null, return \"null\".\n  if (value instanceof NullValue) return \"null\";\n\n  // 6. If value is true, return \"true\".\n  if (value instanceof BooleanValue && value.value) return \"true\";\n\n  // 7. If value is false, return \"false\".\n  if (value instanceof BooleanValue && !value.value) return \"false\";\n\n  // 8. If Type(value) is String, return QuoteJSONString(value).\n  if (value instanceof StringValue) return QuoteJSONString(realm, value);\n\n  // 9. If Type(value) is Number, then\n  if (value instanceof NumberValue) {\n    // a. If value is finite, return ! ToString(value).\n    if (isFinite(value.value)) {\n      return To.ToString(realm, value);\n    } else {\n      // b. Else, return \"null\".\n      return \"null\";\n    }\n  }\n\n  // 10. If Type(value) is Object and IsCallable(value) is false, then\n  if (value instanceof ObjectValue && !IsCallable(realm, value)) {\n    // a. Let isArray be ? IsArray(value).\n    let isArray = IsArray(realm, value);\n\n    // b. If isArray is true, return ? SerializeJSONArray(value).\n    if (isArray) {\n      return SerializeJSONArray(realm, value, context);\n    } else {\n      // c. Else, return ? SerializeJSONObject(value).\n      return SerializeJSONObject(realm, value, context);\n    }\n  }\n\n  // 1. Return undefined.\n  return undefined;\n}\n\nfunction InternalCloneObject(realm: Realm, val: ObjectValue): ObjectValue {\n  let clone = Create.ObjectCreate(realm, realm.intrinsics.ObjectPrototype);\n  for (let [key, binding] of val.properties) {\n    if (binding === undefined || binding.descriptor === undefined) continue; // deleted\n    let desc = binding.descriptor;\n    invariant(desc !== undefined);\n    Properties.ThrowIfMightHaveBeenDeleted(desc);\n    let value = desc.throwIfNotConcrete(realm).value;\n    if (value === undefined) {\n      AbstractValue.reportIntrospectionError(val, key); // cannot handle accessors\n      throw new FatalError();\n    }\n    invariant(value instanceof Value);\n    Create.CreateDataProperty(realm, clone, key, InternalJSONClone(realm, value));\n  }\n  if (val.isPartialObject()) clone.makePartial();\n  if (val.isSimpleObject()) clone.makeSimple();\n  clone.isScopedTemplate = true; // because this object doesn't exist ahead of time, and the visitor would otherwise declare it in the common scope\n  return clone;\n}\n\nconst JSONStringifyStr = \"global.JSON.stringify(A)\";\nconst JSONParseStr = \"global.JSON.parse(A)\";\n\nfunction InternalJSONClone(realm: Realm, val: Value): Value {\n  if (val instanceof AbstractValue) {\n    if (val instanceof AbstractObjectValue) {\n      let strVal = AbstractValue.createFromTemplate(realm, JSONStringifyStr, StringValue, [val]);\n      let obVal = AbstractValue.createFromTemplate(realm, JSONParseStr, ObjectValue, [strVal]);\n      obVal.values = new ValuesDomain(new Set([InternalCloneObject(realm, val.getTemplate())]));\n      return obVal;\n    }\n    // TODO #1010: NaN and Infinity must be mapped to null.\n    return val;\n  }\n  if (val instanceof NumberValue && !isFinite(val.value)) {\n    return realm.intrinsics.null;\n  }\n  if (val instanceof PrimitiveValue) {\n    return val;\n  }\n  if (val instanceof ObjectValue) {\n    let clonedObj;\n    let isArray = IsArray(realm, val);\n    if (isArray === true) {\n      clonedObj = Create.ObjectCreate(realm, realm.intrinsics.ArrayPrototype);\n      let I = 0;\n      let len = To.ToLength(realm, Get(realm, val, \"length\"));\n      while (I < len) {\n        let P = To.ToString(realm, new NumberValue(realm, I));\n        let newElement = Get(realm, val, P);\n        if (!(newElement instanceof UndefinedValue)) {\n          // TODO #1011: An abstract value that ultimately yields undefined should still be skipped\n          Create.CreateDataProperty(realm, clonedObj, P, InternalJSONClone(realm, newElement));\n        }\n        I += 1;\n      }\n    } else {\n      clonedObj = Create.ObjectCreate(realm, realm.intrinsics.ObjectPrototype);\n      let keys = EnumerableOwnProperties(realm, val, \"key\", true);\n      for (let P of keys) {\n        invariant(P instanceof StringValue);\n        let newElement = Get(realm, val, P);\n        if (!(newElement instanceof UndefinedValue)) {\n          // TODO #1011: An abstract value that ultimately yields undefined should still be skipped\n          Create.CreateDataProperty(realm, clonedObj, P, InternalJSONClone(realm, newElement));\n        }\n      }\n    }\n    if (val.isPartialObject()) clonedObj.makePartial();\n    clonedObj.makeSimple(); // The result of a JSON clone is always simple\n    return clonedObj;\n  }\n  invariant(false);\n}\n\nexport default function(realm: Realm): ObjectValue {\n  let obj = new ObjectValue(realm, realm.intrinsics.ObjectPrototype, \"JSON\");\n\n  // ECMA262 24.3.3\n  obj.defineNativeProperty(realm.intrinsics.SymbolToStringTag, new StringValue(realm, \"JSON\"), { writable: false });\n\n  // ECMA262 24.3.2\n  obj.defineNativeMethod(\"stringify\", 3, (context, [value, _replacer, _space]) => {\n    let replacer = _replacer.throwIfNotConcrete();\n    let space = _space.throwIfNotConcrete();\n\n    // 1. Let stack be a new empty List.\n    let stack = [];\n\n    // 2. Let indent be the empty String.\n    let indent = \"\";\n\n    // 3. Let PropertyList and ReplacerFunction be undefined.\n    let PropertyList, ReplacerFunction;\n\n    // 4. If Type(replacer) is Object, then\n    if (replacer instanceof ObjectValue) {\n      // a. If IsCallable(replacer) is true, then\n      if (IsCallable(realm, replacer)) {\n        // i. Let ReplacerFunction be replacer.\n        ReplacerFunction = replacer;\n      } else {\n        // b. Else,\n        // i. Let isArray be ? IsArray(replacer).\n        let isArray = IsArray(realm, replacer);\n\n        // ii. If isArray is true, then\n        if (isArray === true) {\n          // i. Let PropertyList be a new empty List.\n          PropertyList = [];\n\n          // ii. Let len be ? ToLength(? Get(replacer, \"length\")).\n          let len = To.ToLength(realm, Get(realm, replacer, \"length\"));\n\n          // iii. Let k be 0.\n          let k = 0;\n\n          // iv. Repeat while k<len,\n          while (k < len) {\n            // 1. Let v be ? Get(replacer, ! ToString(k)).\n            let v = Get(realm, replacer, new StringValue(realm, k + \"\"));\n            v = v.throwIfNotConcrete();\n\n            // 2. Let item be undefined.\n            let item;\n\n            // 3. If Type(v) is String, let item be v.\n            if (v instanceof StringValue) {\n              item = v;\n            } else if (v instanceof NumberValue) {\n              // 4. Else if Type(v) is Number, let item be ! ToString(v).\n              item = new StringValue(realm, To.ToString(realm, v));\n            } else if (v instanceof ObjectValue) {\n              // 5. Else if Type(v) is Object, then\n              // a. If v has a [[StringData]] or [[NumberData]] internal slot, let item be ? ToString(v).\n              if (v.$StringData || v.$NumberData) {\n                item = new StringValue(realm, To.ToString(realm, v));\n              }\n            }\n\n            // 6. If item is not undefined and item is not currently an element of PropertyList, then\n            if (item !== undefined && PropertyList.find(x => x.value === item.value) === undefined) {\n              // a. Append item to the end of PropertyList.\n              PropertyList.push(item);\n            }\n\n            // 7. Let k be k+1.\n            k++;\n          }\n        }\n      }\n    }\n\n    // 5. If Type(space) is Object, then\n    if (space instanceof ObjectValue) {\n      // a. If space has a [[NumberData]] internal slot, then\n      if (space.$NumberData) {\n        // i. Let space be ? ToNumber(space).\n        space = new NumberValue(realm, To.ToNumber(realm, space));\n      } else if (space.$StringData) {\n        // b. Else if space has a [[StringData]] internal slot, then\n        // i. Let space be ? ToString(space).\n        space = new StringValue(realm, To.ToString(realm, space));\n      }\n    }\n\n    let gap;\n    // 6. If Type(space) is Number, then\n    if (space instanceof NumberValue) {\n      // a. Let space be min(10, ToInteger(space)).\n      space = new NumberValue(realm, Math.min(10, To.ToInteger(realm, space)));\n\n      // b. Set gap to a String containing space occurrences of code unit 0x0020 (SPACE). This will be the empty String if space is less than 1.\n      gap = Array(Math.max(0, space.value)).join(\" \");\n    } else if (space instanceof StringValue) {\n      // 7. Else if Type(space) is String, then\n      // a. If the number of elements in space is 10 or less, set gap to space; otherwise set gap to a String consisting of the first 10 elements of space.\n      gap = space.value.length <= 10 ? space.value : space.value.substring(0, 10);\n    } else {\n      // 8. Else,\n      // a. Set gap to the empty String.\n      gap = \"\";\n    }\n\n    // 9. Let wrapper be ObjectCreate(%ObjectPrototype%).\n    let wrapper = Create.ObjectCreate(realm, realm.intrinsics.ObjectPrototype);\n\n    let isAbstract = value instanceof AbstractValue;\n\n    // #2411\n    if (isAbstract && value.values.isTop()) {\n      AbstractValue.reportIntrospectionError(value);\n      throw new FatalError();\n    }\n\n    // TODO #1012: Make result abstract if any nested element is an abstract value.\n    if (isAbstract || (value instanceof ObjectValue && value.isPartialObject())) {\n      // Return abstract result. This enables cloning via JSON.parse(JSON.stringify(...)).\n      let clonedValue = InternalJSONClone(realm, value);\n      let result = AbstractValue.createTemporalFromTemplate(realm, JSONStringifyStr, StringValue, [clonedValue], {\n        kind: \"JSON.stringify(...)\",\n      });\n      return result;\n    }\n\n    // 10. Let status be CreateDataProperty(wrapper, the empty String, value).\n    let status = Create.CreateDataProperty(realm, wrapper, \"\", value);\n\n    // 11. Assert: status is true.\n    invariant(status, \"expected to create data property\");\n\n    // 12. Return ? SerializeJSONProperty(the empty String, wrapper).\n    let str = SerializeJSONProperty(realm, realm.intrinsics.emptyString, wrapper, {\n      PropertyList,\n      ReplacerFunction,\n      stack,\n      indent,\n      gap,\n    });\n    if (str === undefined) {\n      return realm.intrinsics.undefined;\n    } else {\n      return new StringValue(realm, str);\n    }\n  });\n\n  // ECMA262 24.3.1\n  obj.defineNativeMethod(\"parse\", 2, (context, [text, reviver]) => {\n    let unfiltered;\n    if (text instanceof AbstractValue && text.kind === \"JSON.stringify(...)\") {\n      // Enable cloning via JSON.parse(JSON.stringify(...)).\n      // text is abstract, so we are doing abstract interpretation\n      let temporalOperationEntryArgs = realm.derivedIds.get(text.intrinsicName);\n      invariant(temporalOperationEntryArgs !== undefined);\n      let args = temporalOperationEntryArgs.args;\n      invariant(args[0] instanceof Value); // since text.kind === \"JSON.stringify(...)\"\n      let inputClone = args[0]; // A temporal copy of the object that was the argument to stringify\n      // Clone it so that every call to parse produces a different instance from stringify's clone\n      let parseResult; // A clone of inputClone, because every call to parse produces a new object\n      if (inputClone instanceof ObjectValue) {\n        parseResult = InternalCloneObject(realm, inputClone);\n      } else {\n        invariant(inputClone instanceof AbstractObjectValue);\n        parseResult = InternalCloneObject(realm, inputClone.getTemplate());\n      }\n      invariant(parseResult.isPartialObject()); // Because stringify ensures it\n      parseResult.makeSimple(); // because the result of JSON.parse is always simple\n      // Force evaluation of the parse call\n      unfiltered = AbstractValue.createTemporalFromTemplate(realm, JSONParseStr, ObjectValue, [text], {\n        kind: \"JSON.parse(...)\",\n      });\n      unfiltered.values = new ValuesDomain(new Set([parseResult]));\n      invariant(unfiltered.intrinsicName !== undefined);\n      invariant(realm.generator);\n      realm.rebuildNestedProperties(unfiltered, unfiltered.intrinsicName);\n    } else {\n      // 1. Let JText be ? ToString(text).\n      let JText = To.ToStringPartial(realm, text);\n\n      // 2. Parse JText interpreted as UTF-16 encoded Unicode points (6.1.4) as a JSON text as specified in ECMA-404. Throw a SyntaxError exception if JText is not a valid JSON text as defined in that specification.\n      // 3. Let scriptText be the result of concatenating \"(\", JText, and \");\".\n      // 4. Let completion be the result of parsing and evaluating scriptText as if it was the source text of an ECMAScript Script, but using the alternative definition of DoubleStringCharacter provided below. The extended PropertyDefinitionEvaluation semantics defined in B.3.1 must not be used during the evaluation.\n      // 5. Let unfiltered be completion.[[Value]].\n      try {\n        unfiltered = nativeToInterp(realm, JSON.parse(JText));\n      } catch (err) {\n        if (err instanceof SyntaxError) {\n          throw realm.createErrorThrowCompletion(realm.intrinsics.SyntaxError, err.message);\n        } else {\n          throw err;\n        }\n      }\n\n      // 6. Assert: unfiltered will be either a primitive value or an object that is defined by either an ArrayLiteral or an ObjectLiteral.\n      invariant(\n        HasSomeCompatibleType(unfiltered, PrimitiveValue, ObjectValue, ArrayValue),\n        \"expected primitive, object or array\"\n      );\n    }\n\n    // 7. If IsCallable(reviver) is true, then\n    if (IsCallable(realm, reviver)) {\n      // a. Let root be ObjectCreate(%ObjectPrototype%).\n      let root = Create.ObjectCreate(realm, realm.intrinsics.ObjectPrototype);\n\n      // b. Let rootName be the empty String.\n      let rootName = \"\";\n\n      // c. Let status be CreateDataProperty(root, rootName, unfiltered).\n      let status = Create.CreateDataProperty(realm, root, rootName, unfiltered);\n\n      // d. Assert: status is true.\n      invariant(status, \"expected to create data property\");\n\n      // e. Return ? InternalizeJSONProperty(root, rootName).\n      return InternalizeJSONProperty(realm, reviver, root, rootName);\n    } else {\n      // 8. Else,\n      // a. Return unfiltered.\n      return unfiltered;\n    }\n  });\n\n  return obj;\n}\n"
  },
  {
    "path": "src/intrinsics/ecma262/Map.js",
    "content": "/**\n * Copyright (c) 2017-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n/* @flow strict-local */\n\nimport type { Realm } from \"../../realm.js\";\nimport {\n  AbstractObjectValue,\n  ObjectValue,\n  NativeFunctionValue,\n  NullValue,\n  UndefinedValue,\n} from \"../../values/index.js\";\nimport { AbruptCompletion } from \"../../completions.js\";\nimport {\n  Get,\n  IsCallable,\n  IteratorStep,\n  IteratorClose,\n  IteratorValue,\n  GetIterator,\n  Call,\n  HasSomeCompatibleType,\n} from \"../../methods/index.js\";\nimport { Create } from \"../../singletons.js\";\nimport invariant from \"../../invariant.js\";\n\nexport default function(realm: Realm): NativeFunctionValue {\n  let func = new NativeFunctionValue(realm, \"Map\", \"Map\", 0, (context, [_iterable], argCount, NewTarget) => {\n    let iterable = _iterable;\n    // 1. If NewTarget is undefined, throw a TypeError exception.\n    if (!NewTarget) {\n      throw realm.createErrorThrowCompletion(realm.intrinsics.TypeError);\n    }\n\n    // 2. Let map be ? OrdinaryCreateFromConstructor(NewTarget, \"%MapPrototype%\", « [[MapData]] »).\n    let map = Create.OrdinaryCreateFromConstructor(realm, NewTarget, \"MapPrototype\", {\n      $MapData: undefined,\n    });\n\n    // 3. Set map's [[MapData]] internal slot to a new empty List.\n    map.$MapData = [];\n\n    // 4. If iterable is not present, let iterable be undefined.\n    if (iterable && realm.isCompatibleWith(realm.MOBILE_JSC_VERSION)) {\n      throw realm.createErrorThrowCompletion(realm.intrinsics.TypeError, \"the map constructor doesn't take arguments\");\n    }\n    if (!iterable) iterable = realm.intrinsics.undefined;\n\n    // 5. If iterable is either undefined or null, let iter be undefined.\n    let iter, adder;\n    if (HasSomeCompatibleType(iterable, NullValue, UndefinedValue)) {\n      adder = realm.intrinsics.undefined;\n      iter = realm.intrinsics.undefined;\n    } else {\n      // 6. Else,\n      // a. Let adder be ? Get(map, \"set\").\n      adder = Get(realm, map, \"set\");\n\n      // b. If IsCallable(adder) is false, throw a TypeError exception.\n      if (!IsCallable(realm, adder)) {\n        throw realm.createErrorThrowCompletion(realm.intrinsics.TypeError);\n      }\n\n      // c. Let iter be ? GetIterator(iterable).\n      iter = GetIterator(realm, iterable);\n    }\n\n    // 7. If iter is undefined, return map.\n    if (iter instanceof UndefinedValue) return map;\n\n    // 8. Repeat\n    while (true) {\n      // a. Let next be ? IteratorStep(iter).\n      let next = IteratorStep(realm, iter);\n\n      // b. If next is false, return map.\n      if (!next) return map;\n\n      // c. Let nextItem be ? IteratorValue(next).\n      let nextItem = IteratorValue(realm, next);\n\n      // d. If Type(nextItem) is not Object, then\n      if (nextItem.mightNotBeObject()) {\n        if (nextItem.mightBeObject()) nextItem.throwIfNotConcrete();\n        // i. Let error be Completion{[[Type]]: throw, [[Value]]: a newly created TypeError object, [[Target]]: empty}.\n        let error = realm.createErrorThrowCompletion(realm.intrinsics.TypeError);\n\n        // ii. Return ? IteratorClose(iter, error).\n        throw IteratorClose(realm, iter, error);\n      }\n      invariant(nextItem instanceof ObjectValue || nextItem instanceof AbstractObjectValue);\n\n      // e. Let k be Get(nextItem, \"0\").\n      let k;\n      try {\n        k = Get(realm, nextItem, \"0\");\n      } catch (kCompletion) {\n        if (kCompletion instanceof AbruptCompletion) {\n          // f. If k is an abrupt completion, return ? IteratorClose(iter, k).\n          throw IteratorClose(realm, iter, kCompletion);\n        } else throw kCompletion;\n      }\n\n      // g. Let v be Get(nextItem, \"1\").\n      let v;\n      try {\n        v = Get(realm, nextItem, \"1\");\n      } catch (vCompletion) {\n        if (vCompletion instanceof AbruptCompletion) {\n          // h. If v is an abrupt completion, return ? IteratorClose(iter, v).\n          throw IteratorClose(realm, iter, vCompletion);\n        } else throw vCompletion;\n      }\n\n      // i. Let status be Call(adder, map, « k.[[Value]], v.[[Value]] »).\n      let status;\n      try {\n        status = Call(realm, adder, map, [k, v]);\n      } catch (statusCompletion) {\n        if (statusCompletion instanceof AbruptCompletion) {\n          // j. If status is an abrupt completion, return ? IteratorClose(iter, status).\n          throw IteratorClose(realm, iter, statusCompletion);\n        } else throw statusCompletion;\n      }\n      status;\n    }\n\n    invariant(false);\n  });\n\n  // ECMA262 23.1.2.2\n  func.defineNativeGetter(realm.intrinsics.SymbolSpecies, context => {\n    // 1. Return the this value\n    return context;\n  });\n\n  return func;\n}\n"
  },
  {
    "path": "src/intrinsics/ecma262/MapIteratorPrototype.js",
    "content": "/**\n * Copyright (c) 2017-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n/* @flow strict-local */\n\nimport type { Realm } from \"../../realm.js\";\nimport { StringValue, NumberValue, ObjectValue, UndefinedValue } from \"../../values/index.js\";\nimport { Create } from \"../../singletons.js\";\nimport invariant from \"../../invariant.js\";\n\nexport default function(realm: Realm, obj: ObjectValue): void {\n  // ECMA262 23.1.5.2.1\n  obj.defineNativeMethod(\"next\", 0, context => {\n    // 1. Let O be the this value.\n    let O = context.throwIfNotConcrete();\n\n    // 2. If Type(O) is not Object, throw a TypeError exception.\n    if (!(O instanceof ObjectValue)) {\n      throw realm.createErrorThrowCompletion(realm.intrinsics.TypeError, \"not an object\");\n    }\n\n    // 3. If O does not have all of the internal slots of a Set Iterator Instance (23.2.5.3), throw a TypeError exception.\n    if (O.$Map === undefined || O.$MapNextIndex === undefined || O.$MapIterationKind === undefined) {\n      throw realm.createErrorThrowCompletion(realm.intrinsics.TypeError, \"MapIteratorPrototype.next isn't generic\");\n    }\n\n    // 4. Let m be O.[[Map]].\n    let m = O.$Map;\n\n    // 5. Let index be O.[[MapNextIndex]].\n    let index = O.$MapNextIndex.value;\n\n    // 6. Let itemKind be O.[[MapIterationKind]].\n    let itemKind = O.$MapIterationKind;\n\n    // 7. If m is undefined, return CreateIterResultObject(undefined, true).\n    if (!m || m instanceof UndefinedValue)\n      return Create.CreateIterResultObject(realm, realm.intrinsics.undefined, true);\n    invariant(m instanceof ObjectValue);\n\n    // 8. Assert: m has a [[MapData]] internal slot.\n    invariant(m.$MapData, \"m has a [[MapData]] internal slot\");\n\n    // 9. Let entries be the List that is m.[[MapData]].\n    let entries = m.$MapData;\n    invariant(entries);\n\n    // 10. Repeat while index is less than the total number of elements of entries. The number of elements must be redetermined each time this method is evaluated.\n    while (index < entries.length) {\n      // a. Let e be the Record {[[Key]], [[Value]]} that is the value of entries[index].\n      let e = entries[index];\n\n      // b. Set index to index+1.\n      index = index + 1;\n\n      // c. Set O.[[MapNextIndex]] to index.\n      O.$MapNextIndex = new NumberValue(realm, index);\n\n      // d. If e.[[Key]] is not empty, then\n      if (e.$Key !== undefined) {\n        invariant(e.$Value !== undefined);\n\n        let result;\n        // i. If itemKind is \"key\", let result be e.[[Key]].\n        if (itemKind === \"key\") result = e.$Key;\n        else if (itemKind === \"value\")\n          // ii. Else if itemKind is \"value\", let result be e.[[Value]].\n          result = e.$Value;\n        else {\n          // iii. Else,\n          // 1. Assert: itemKind is \"key+value\".\n          invariant(itemKind === \"key+value\");\n\n          // 2. Let result be CreateArrayFromList(« e.[[Key]], e.[[Value]] »).\n          result = Create.CreateArrayFromList(realm, [e.$Key, e.$Value]);\n        }\n\n        // iv. Return CreateIterResultObject(result, false).\n        return Create.CreateIterResultObject(realm, result, false);\n      }\n    }\n\n    // 11. Set O.[[Map]] to undefined.\n    O.$Map = realm.intrinsics.undefined;\n\n    // 12. Return CreateIterResultObject(undefined, true).\n    return Create.CreateIterResultObject(realm, realm.intrinsics.undefined, true);\n  });\n\n  // ECMA262 23.1.5.2.2\n  obj.defineNativeProperty(realm.intrinsics.SymbolToStringTag, new StringValue(realm, \"Map Iterator\"), {\n    writable: false,\n  });\n}\n"
  },
  {
    "path": "src/intrinsics/ecma262/MapPrototype.js",
    "content": "/**\n * Copyright (c) 2017-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n/* @flow */\n\nimport type { Realm } from \"../../realm.js\";\nimport { NumberValue, StringValue, NativeFunctionValue, ObjectValue } from \"../../values/index.js\";\nimport { Call, CreateMapIterator, IsCallable, SameValueZeroPartial } from \"../../methods/index.js\";\nimport { Properties } from \"../../singletons.js\";\nimport invariant from \"../../invariant.js\";\nimport { PropertyDescriptor } from \"../../descriptors.js\";\n\nexport default function(realm: Realm, obj: ObjectValue): void {\n  // ECMA262 23.1.3.1\n  obj.defineNativeMethod(\"clear\", 0, context => {\n    // 1. Let M be the this value.\n    let M = context.throwIfNotConcrete();\n\n    // 2. If Type(M) is not Object, throw a TypeError exception.\n    if (!(M instanceof ObjectValue)) {\n      throw realm.createErrorThrowCompletion(realm.intrinsics.TypeError);\n    }\n\n    // 3. If M does not have a [[MapData]] internal slot, throw a TypeError exception.\n    if (!M.$MapData) {\n      throw realm.createErrorThrowCompletion(realm.intrinsics.TypeError);\n    }\n\n    // 4. Let entries be the List that is the value of M's [[MapData]] internal slot.\n    realm.recordModifiedProperty((M: any).$MapData_binding);\n    let entries = M.$MapData;\n    invariant(entries !== undefined);\n\n    // 5. Repeat for each Record {[[Key]], [[Value]]} p that is an element of entries,\n    for (let p of entries) {\n      // a. Set p.[[Key]] to empty.\n      p.$Key = undefined;\n\n      // b. Set p.[[Value]] to empty.\n      p.$Value = undefined;\n    }\n\n    // 6. Return undefined.\n    return realm.intrinsics.undefined;\n  });\n\n  // ECMA262 23.1.3.3\n  obj.defineNativeMethod(\"delete\", 1, (context, [key]) => {\n    // 1. Let M be the this value.\n    let M = context.throwIfNotConcrete();\n\n    // 2. If Type(M) is not Object, throw a TypeError exception.\n    if (!(M instanceof ObjectValue)) {\n      throw realm.createErrorThrowCompletion(realm.intrinsics.TypeError);\n    }\n\n    // 3. If M does not have a [[MapData]] internal slot, throw a TypeError exception.\n    if (!M.$MapData) {\n      throw realm.createErrorThrowCompletion(realm.intrinsics.TypeError);\n    }\n\n    // 4. Let entries be the List that is the value of M's [[MapData]] internal slot.\n    realm.recordModifiedProperty((M: any).$MapData_binding);\n    let entries = M.$MapData;\n    invariant(entries !== undefined);\n\n    // 5. Repeat for each Record {[[Key]], [[Value]]} p that is an element of entries,\n    for (let p of entries) {\n      // a. If p.[[Key]] is not empty and SameValueZero(p.[[Key]], key) is true, then\n      if (p.$Key !== undefined && SameValueZeroPartial(realm, p.$Key, key)) {\n        // i. Set p.[[Key]] to empty.\n        p.$Key = undefined;\n\n        // ii. Set p.[[Value]] to empty.\n        p.$Value = undefined;\n\n        // iii. Return true.\n        return realm.intrinsics.true;\n      }\n    }\n\n    // 6. Return false.\n    return realm.intrinsics.false;\n  });\n\n  // ECMA262 23.1.3.4\n  obj.defineNativeMethod(\"entries\", 0, context => {\n    // 1. Let M be the this value.\n    let M = context;\n\n    // 2. Return ? CreateMapIterator(M, \"key+value\").\n    return CreateMapIterator(realm, M, \"key+value\");\n  });\n\n  // ECMA262 23.1.3.5\n  obj.defineNativeMethod(\"forEach\", 1, (context, [callbackfn, thisArg]) => {\n    // 1. Let M be the this value.\n    let M = context.throwIfNotConcrete();\n\n    // 2. If Type(M) is not Object, throw a TypeError exception.\n    if (!(M instanceof ObjectValue)) {\n      throw realm.createErrorThrowCompletion(realm.intrinsics.TypeError);\n    }\n\n    // 3. If M does not have a [[MapData]] internal slot, throw a TypeError exception.\n    if (!M.$MapData) {\n      throw realm.createErrorThrowCompletion(realm.intrinsics.TypeError);\n    }\n\n    // 4. If IsCallable(callbackfn) is false, throw a TypeError exception.\n    if (!IsCallable(realm, callbackfn)) {\n      throw realm.createErrorThrowCompletion(realm.intrinsics.TypeError);\n    }\n\n    // 5. If thisArg was supplied, let T be thisArg; else let T be undefined.\n    let T = thisArg || realm.intrinsics.undefined;\n\n    // 6. Let entries be the List that is the value of M's [[MapData]] internal slot.\n    let entries = M.$MapData;\n    invariant(entries);\n\n    // 7. Repeat for each Record {[[Key]], [[Value]]} e that is an element of entries, in original key insertion order\n    for (let e of entries) {\n      // a. If e.[[Key]] is not empty, then\n      if (e.$Key !== undefined) {\n        // i. Perform ? Call(callbackfn, T, « e.[[Value]], e.[[Key]], M »).\n        invariant(e.$Value !== undefined);\n        Call(realm, callbackfn, T, [e.$Value, e.$Key, M]);\n      }\n    }\n\n    // 8. Return undefined.\n    return realm.intrinsics.undefined;\n  });\n\n  // ECMA262 23.1.3.6\n  obj.defineNativeMethod(\"get\", 1, (context, [key]) => {\n    // 1. Let M be the this value.\n    let M = context.throwIfNotConcrete();\n\n    // 2. If Type(M) is not Object, throw a TypeError exception.\n    if (!(M instanceof ObjectValue)) {\n      throw realm.createErrorThrowCompletion(realm.intrinsics.TypeError);\n    }\n\n    // 3. If M does not have a [[MapData]] internal slot, throw a TypeError exception.\n    if (!M.$MapData) {\n      throw realm.createErrorThrowCompletion(realm.intrinsics.TypeError);\n    }\n\n    // 4. Let entries be the List that is the value of M's [[MapData]] internal slot.\n    let entries = M.$MapData;\n    invariant(entries !== undefined);\n\n    // 5. Repeat for each Record {[[Key]], [[Value]]} p that is an element of entries,\n    for (let p of entries) {\n      // a. If p.[[Key]] is not empty and SameValueZero(p.[[Key]], key) is true, return p.[[Value]].\n      if (p.$Key !== undefined && SameValueZeroPartial(realm, p.$Key, key)) {\n        invariant(p.$Value !== undefined);\n        return p.$Value;\n      }\n    }\n\n    // 6. Return undefined.\n    return realm.intrinsics.undefined;\n  });\n\n  // ECMA262 23.1.3.7\n  obj.defineNativeMethod(\"has\", 1, (context, [key]) => {\n    // 1. Let M be the this value.\n    let M = context.throwIfNotConcrete();\n\n    // 2. If Type(M) is not Object, throw a TypeError exception.\n    if (!(M instanceof ObjectValue)) {\n      throw realm.createErrorThrowCompletion(realm.intrinsics.TypeError);\n    }\n\n    // 3. If M does not have a [[MapData]] internal slot, throw a TypeError exception.\n    if (!M.$MapData) {\n      throw realm.createErrorThrowCompletion(realm.intrinsics.TypeError);\n    }\n\n    // 4. Let entries be the List that is the value of M's [[MapData]] internal slot.\n    let entries = M.$MapData;\n    invariant(entries !== undefined);\n\n    // 5. Repeat for each Record {[[Key]], [[Value]]} p that is an element of entries,\n    for (let p of entries) {\n      // a. If p.[[Key]] is not empty and SameValueZero(p.[[Key]], key) is true, return true.\n      if (p.$Key !== undefined && SameValueZeroPartial(realm, p.$Key, key)) {\n        return realm.intrinsics.true;\n      }\n    }\n\n    // 6. Return false.\n    return realm.intrinsics.false;\n  });\n\n  // ECMA262 23.1.3.8\n  obj.defineNativeMethod(\"keys\", 0, context => {\n    // 1. Let M be the this value.\n    let M = context;\n\n    // 2. Return ? CreateMapIterator(M, \"key\").\n    return CreateMapIterator(realm, M, \"key\");\n  });\n\n  // ECMA262 23.1.3.9\n  obj.defineNativeMethod(\"set\", 2, (context, [key, value]) => {\n    // 1. Let M be the this value.\n    let M = context.throwIfNotConcrete();\n\n    // 2. If Type(M) is not Object, throw a TypeError exception.\n    if (!(M instanceof ObjectValue)) {\n      throw realm.createErrorThrowCompletion(realm.intrinsics.TypeError);\n    }\n\n    // 3. If M does not have a [[MapData]] internal slot, throw a TypeError exception.\n    if (!M.$MapData) {\n      throw realm.createErrorThrowCompletion(realm.intrinsics.TypeError);\n    }\n\n    // 4. Let entries be the List that is the value of M's [[MapData]] internal slot.\n    realm.recordModifiedProperty((M: any).$MapData_binding);\n    let entries = M.$MapData;\n    invariant(entries !== undefined);\n\n    // 5. Repeat for each Record {[[Key]], [[Value]]} p that is an element of entries,\n    for (let p of entries) {\n      // a. If p.[[Key]] is not empty and SameValueZero(p.[[Key]], key) is true, then\n      if (p.$Key !== undefined && SameValueZeroPartial(realm, p.$Key, key)) {\n        // i. Set p.[[Value]] to value.\n        p.$Value = value;\n\n        // ii. Return M.\n        return M;\n      }\n    }\n\n    // 6. If key is -0, let key be +0.\n    key = key.throwIfNotConcrete();\n    if (key instanceof NumberValue && Object.is(key.value, -0)) key = realm.intrinsics.zero;\n\n    // 7. Let p be the Record {[[Key]]: key, [[Value]]: value}.\n    let p = { $Key: key, $Value: value };\n\n    // 8. Append p as the last element of entries.\n    entries.push(p);\n\n    // 9. Return M.\n    return M;\n  });\n\n  // ECMA262 23.1.3.10\n  obj.$DefineOwnProperty(\n    \"size\",\n    new PropertyDescriptor({\n      configurable: true,\n      get: new NativeFunctionValue(realm, undefined, \"get size\", 0, context => {\n        // 1. Let M be the this value.\n        let M = context.throwIfNotConcrete();\n\n        // 2. If Type(M) is not Object, throw a TypeError exception.\n        if (!(M instanceof ObjectValue)) {\n          throw realm.createErrorThrowCompletion(realm.intrinsics.TypeError);\n        }\n\n        // 3. If M does not have a [[MapData]] internal slot, throw a TypeError exception.\n        if (!M.$MapData) {\n          throw realm.createErrorThrowCompletion(realm.intrinsics.TypeError);\n        }\n\n        // 4. Let entries be the List that is the value of M's [[MapData]] internal slot.\n        let entries = M.$MapData;\n        invariant(entries !== undefined);\n\n        // 5. Let count be 0.\n        let count = 0;\n\n        // 6. For each Record {[[Key]], [[Value]]} p that is an element of entries\n        for (let p of entries) {\n          // a. If p.[[Key]] is not empty, set count to count+1.\n          if (p.$Key !== undefined) count++;\n        }\n\n        // 7. Return count.\n        return new NumberValue(realm, count);\n      }),\n    })\n  );\n\n  // ECMA262 23.1.3.11\n  obj.defineNativeMethod(\"values\", 0, context => {\n    // 1. Let M be the this value.\n    let M = context;\n\n    // 2. Return ? CreateMapIterator(M, \"value\").\n    return CreateMapIterator(realm, M, \"value\");\n  });\n\n  // ECMA262 23.1.3.12\n  let entriesPropertyDescriptor = obj.$GetOwnProperty(\"entries\");\n  invariant(entriesPropertyDescriptor instanceof PropertyDescriptor);\n  Properties.ThrowIfMightHaveBeenDeleted(entriesPropertyDescriptor);\n  obj.$DefineOwnProperty(realm.intrinsics.SymbolIterator, entriesPropertyDescriptor);\n\n  // ECMA262 23.1.3.13\n  obj.defineNativeProperty(realm.intrinsics.SymbolToStringTag, new StringValue(realm, \"Map\"), { writable: false });\n}\n"
  },
  {
    "path": "src/intrinsics/ecma262/Math.js",
    "content": "/**\n * Copyright (c) 2017-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n/* @flow */\n\nimport type { Realm } from \"../../realm.js\";\nimport { StringValue, ObjectValue, NumberValue, AbstractValue } from \"../../values/index.js\";\nimport { To } from \"../../singletons.js\";\nimport invariant from \"../../invariant.js\";\nimport { CompilerDiagnostic } from \"../../errors.js\";\nimport { Placeholders } from \"../../utils/PreludeGenerator.js\";\n\nlet buildMathTemplates: Map<string, string> = new Map();\n\nexport default function(realm: Realm): ObjectValue {\n  let obj = new ObjectValue(realm, realm.intrinsics.ObjectPrototype, \"Math\");\n\n  // ECMA262 20.2.1.9\n  obj.defineNativeProperty(realm.intrinsics.SymbolToStringTag, new StringValue(realm, \"Math\"), { writable: false });\n\n  // ECMA262 20.2.1.1\n  obj.defineNativeConstant(\"E\", new NumberValue(realm, 2.7182818284590452354));\n\n  // ECMA262 20.2.1.2\n  obj.defineNativeConstant(\"LN10\", new NumberValue(realm, 2.302585092994046));\n\n  // ECMA262 20.2.1.3\n  obj.defineNativeConstant(\"LN2\", new NumberValue(realm, 0.6931471805599453));\n\n  // ECMA262 20.2.1.4\n  obj.defineNativeConstant(\"LOG10E\", new NumberValue(realm, 0.4342944819032518));\n\n  // ECMA262 20.2.1.5\n  obj.defineNativeConstant(\"LOG2E\", new NumberValue(realm, 1.4426950408889634));\n\n  // ECMA262 20.2.1.6\n  obj.defineNativeConstant(\"PI\", new NumberValue(realm, 3.1415926535897932));\n\n  // ECMA262 20.2.1.7\n  obj.defineNativeConstant(\"SQRT1_2\", new NumberValue(realm, 0.7071067811865476));\n\n  // ECMA262 20.2.1.8\n  obj.defineNativeConstant(\"SQRT2\", new NumberValue(realm, 1.4142135623730951));\n\n  let functions = [\n    // ECMA262 20.2.2.1\n    [\"abs\", 1],\n\n    // ECMA262 20.2.2.2\n    [\"acos\", 1],\n\n    // ECMA262 20.2.2.3\n    [\"acosh\", 1],\n\n    // ECMA262 20.2.2.4\n    [\"asin\", 1],\n\n    // ECMA262 20.2.2.5\n    [\"asinh\", 1],\n\n    // ECMA262 20.2.2.6\n    [\"atan\", 1],\n\n    // ECMA262 20.2.2.7\n    [\"atanh\", 1],\n\n    // ECMA262 20.2.2.8\n    [\"atan2\", 2],\n\n    // ECMA262 20.2.2.9\n    [\"cbrt\", 1],\n\n    // ECMA262 20.2.2.10\n    [\"ceil\", 1],\n\n    // ECMA262 20.2.2.12\n    [\"cos\", 1],\n\n    // ECMA262 20.2.2.13\n    [\"cosh\", 1],\n\n    // ECMA262 20.2.2.14\n    [\"exp\", 1],\n\n    // ECMA262 20.2.2.15\n    [\"expm1\", 1],\n\n    // ECMA262 20.2.2.16\n    [\"floor\", 1],\n\n    // ECMA262 20.2.2.17\n    [\"fround\", 1],\n\n    // ECMA262 20.2.2.18\n    [\"hypot\", 2],\n\n    // ECMA262 20.2.2.20\n    [\"log\", 1],\n\n    // ECMA262 20.2.2.21\n    [\"log1p\", 1],\n\n    // ECMA262 20.2.2.22\n    [\"log10\", 1],\n\n    // ECMA262 20.2.2.23\n    [\"log2\", 1],\n\n    // ECMA262 20.2.2.24 ( _value1_, _value2_, ..._values_ )\n    [\"max\", 2],\n\n    // ECMA262 20.2.2.25\n    [\"min\", 2],\n\n    // ECMA262 20.2.2.26\n    [\"pow\", 2],\n\n    // ECMA262 20.2.2.28\n    [\"round\", 1],\n\n    // ECMA262 20.2.2.30\n    [\"sin\", 1],\n\n    // ECMA262 20.2.2.31\n    [\"sinh\", 1],\n\n    // ECMA262 20.2.2.32\n    [\"sqrt\", 1],\n\n    // ECMA262 20.2.2.33\n    [\"tan\", 1],\n\n    // ECMA262 20.2.2.34\n    [\"tanh\", 1],\n\n    // ECMA262 20.2.2.35\n    [\"trunc\", 1],\n  ];\n\n  // ECMA262 20.2.2.11\n  if (!realm.isCompatibleWith(realm.MOBILE_JSC_VERSION) && !realm.isCompatibleWith(\"mobile\"))\n    functions.push([\"clz32\", 1]);\n\n  // ECMA262 20.2.2.29 (_x_)\n  if (!realm.isCompatibleWith(realm.MOBILE_JSC_VERSION) && !realm.isCompatibleWith(\"mobile\"))\n    functions.push([\"sign\", 1]);\n\n  for (let [name, length] of functions) {\n    obj.defineNativeMethod(name, length, (context, args, originalLength) => {\n      invariant(originalLength >= 0);\n      args.length = originalLength;\n      if (\n        originalLength <= 26 &&\n        args.some(arg => arg instanceof AbstractValue) &&\n        args.every(arg => To.IsToNumberPure(realm, arg))\n      ) {\n        let templateSource = buildMathTemplates.get(name);\n        if (templateSource === undefined) {\n          let params = Placeholders.slice(0, originalLength).join(\",\");\n          templateSource = `global.Math.${name}(${params})`;\n          buildMathTemplates.set(name, templateSource);\n        }\n        return AbstractValue.createFromTemplate(realm, templateSource, NumberValue, args);\n      }\n\n      return new NumberValue(\n        realm,\n        Math[name].apply(null, args.map((arg, i) => To.ToNumber(realm, arg.throwIfNotConcrete())))\n      );\n    });\n  }\n\n  const imulTemplateSrc = \"global.Math.imul(A, B)\";\n\n  // ECMA262 20.2.2.19\n  obj.defineNativeMethod(\"imul\", 2, (context, [x, y]) => {\n    if (\n      (x instanceof AbstractValue || y instanceof AbstractValue) &&\n      To.IsToNumberPure(realm, x) &&\n      To.IsToNumberPure(realm, y)\n    ) {\n      return AbstractValue.createFromTemplate(realm, imulTemplateSrc, NumberValue, [x, y]);\n    }\n\n    return new NumberValue(\n      realm,\n      Math.imul(To.ToUint32(realm, x.throwIfNotConcrete()), To.ToUint32(realm, y.throwIfNotConcrete()))\n    );\n  });\n\n  const mathRandomTemplateSrc = \"global.Math.random()\";\n\n  // ECMA262 20.2.2.27\n  obj.defineNativeMethod(\"random\", 0, context => {\n    let mathRandomGenerator = realm.mathRandomGenerator;\n    if (mathRandomGenerator !== undefined) {\n      let loc = realm.currentLocation;\n      let error = new CompilerDiagnostic(\n        \"Result of Math.random() is made deterministic via a fixed mathRandomSeed\",\n        loc,\n        \"PP8000\",\n        \"Information\"\n      );\n      realm.handleError(error);\n\n      return new NumberValue(realm, mathRandomGenerator());\n    } else if (realm.useAbstractInterpretation) {\n      return AbstractValue.createTemporalFromTemplate(realm, mathRandomTemplateSrc, NumberValue, [], {\n        isPure: true,\n        skipInvariant: true,\n      });\n    } else {\n      return new NumberValue(realm, Math.random());\n    }\n  });\n\n  return obj;\n}\n"
  },
  {
    "path": "src/intrinsics/ecma262/Number.js",
    "content": "/**\n * Copyright (c) 2017-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n/* @flow strict-local */\n\nimport type { Realm } from \"../../realm.js\";\nimport { NativeFunctionValue, NumberValue } from \"../../values/index.js\";\nimport { Create, To } from \"../../singletons.js\";\n\nexport default function(realm: Realm): NativeFunctionValue {\n  // ECMA262 20.1.1\n  let func = new NativeFunctionValue(realm, \"Number\", \"Number\", 1, (context, [value], argCount, NewTarget) => {\n    let n;\n\n    // 1. If no arguments were passed to this function invocation, let n be +0.\n    if (argCount === 0) {\n      n = realm.intrinsics.zero;\n    } else {\n      // 2. Else, let n be ? ToNumber(value).\n      n = new NumberValue(realm, To.ToNumber(realm, value));\n    }\n\n    // 3. If NewTarget is undefined, return n.\n    if (!NewTarget) return n;\n\n    // 4. Let O be ? OrdinaryCreateFromConstructor(NewTarget, \"%NumberPrototype%\", « [[NumberData]] »).\n    let O = Create.OrdinaryCreateFromConstructor(realm, NewTarget, \"NumberPrototype\", { $NumberData: undefined });\n\n    // 5. Set the value of O's [[NumberData]] internal slot to n.\n    O.$NumberData = n;\n\n    // 6. Return O.\n    return O;\n  });\n\n  // ECMA262 20.1.2.1\n  func.defineNativeConstant(\"EPSILON\", new NumberValue(realm, 2.220446049250313e-16));\n\n  // ECMA262 20.1.2.2\n  if (!realm.isCompatibleWith(realm.MOBILE_JSC_VERSION) && !realm.isCompatibleWith(\"mobile\"))\n    func.defineNativeMethod(\"isFinite\", 1, (context, [_number]) => {\n      let number = _number;\n      // 1. If Type(number) is not Number, return false.\n      if (!number.mightBeNumber()) return realm.intrinsics.false;\n\n      // 2. If number is NaN, +∞, or -∞, return false.\n      number = number.throwIfNotConcreteNumber();\n      if (isNaN(number.value) || number.value === +Infinity || number.value === -Infinity)\n        return realm.intrinsics.false;\n\n      // 3. Otherwise, return true.\n      return realm.intrinsics.true;\n    });\n\n  // ECMA262 20.1.2.3\n  if (!realm.isCompatibleWith(realm.MOBILE_JSC_VERSION) && !realm.isCompatibleWith(\"mobile\"))\n    func.defineNativeMethod(\"isInteger\", 1, (context, [_number]) => {\n      let number = _number;\n      // 1. If Type(number) is not Number, return false.\n      if (!number.mightBeNumber()) return realm.intrinsics.false;\n\n      // 2. If number is NaN, +∞, or -∞, return false.\n      number = number.throwIfNotConcreteNumber();\n      if (isNaN(number.value) || number.value === +Infinity || number.value === -Infinity)\n        return realm.intrinsics.false;\n\n      // 3. Let integer be ToInteger(number).\n      let integer = To.ToInteger(realm, number);\n\n      // 4. If integer is not equal to number, return false.\n      if (integer !== number.value) return realm.intrinsics.false;\n\n      // 5. Otherwise, return true.\n      return realm.intrinsics.true;\n    });\n\n  // ECMA262 20.1.2.4\n  if (!realm.isCompatibleWith(realm.MOBILE_JSC_VERSION) && !realm.isCompatibleWith(\"mobile\"))\n    func.defineNativeMethod(\"isNaN\", 1, (context, [_number]) => {\n      let number = _number;\n      // 1. If Type(number) is not Number, return false.\n      if (!number.mightBeNumber()) return realm.intrinsics.false;\n\n      // 2. If number is NaN, return true.\n      number = number.throwIfNotConcreteNumber();\n      if (isNaN(number.value)) return realm.intrinsics.true;\n\n      // 3. Otherwise, return false.\n      return realm.intrinsics.false;\n    });\n\n  // ECMA262 20.1.2.5\n  if (!realm.isCompatibleWith(realm.MOBILE_JSC_VERSION) && !realm.isCompatibleWith(\"mobile\"))\n    func.defineNativeMethod(\"isSafeInteger\", 1, (context, [_number]) => {\n      let number = _number;\n      // 1. If Type(number) is not Number, return false.\n      if (!number.mightBeNumber()) return realm.intrinsics.false;\n\n      // 2. If number is NaN, +∞, or -∞, return false.\n      number = number.throwIfNotConcreteNumber();\n      if (isNaN(number.value) || number.value === +Infinity || number.value === -Infinity)\n        return realm.intrinsics.false;\n\n      // 3. Let integer be ToInteger(number).\n      let integer = To.ToInteger(realm, number);\n\n      // 4. If integer is not equal to number, return false.\n      if (integer !== number.value) return realm.intrinsics.false;\n\n      // 5. If abs(integer) ≤ 2^53-1, return true.\n      if (Math.abs(integer) <= Math.pow(2, 53) - 1) return realm.intrinsics.true;\n\n      // 6. Otherwise, return false.\n      return realm.intrinsics.false;\n    });\n\n  // ECMA262 20.1.2.6\n  if (!realm.isCompatibleWith(realm.MOBILE_JSC_VERSION))\n    func.defineNativeConstant(\"MAX_SAFE_INTEGER\", new NumberValue(realm, 9007199254740991));\n\n  // ECMA262 20.1.2.7\n  func.defineNativeConstant(\"MAX_VALUE\", new NumberValue(realm, 1.7976931348623157e308));\n\n  // ECMA262 20.1.2.8\n  if (!realm.isCompatibleWith(realm.MOBILE_JSC_VERSION))\n    func.defineNativeConstant(\"MIN_SAFE_INTEGER\", new NumberValue(realm, -9007199254740991));\n\n  // ECMA262 20.1.2.9\n  func.defineNativeConstant(\"MIN_VALUE\", new NumberValue(realm, 5e-324));\n\n  // ECMA262 20.1.2.10\n  func.defineNativeConstant(\"NaN\", realm.intrinsics.NaN);\n\n  // ECMA262 20.1.2.11\n  func.defineNativeConstant(\"NEGATIVE_INFINITY\", realm.intrinsics.negativeInfinity);\n\n  // ECMA262 20.1.2.12\n  func.defineNativeProperty(\"parseFloat\", realm.intrinsics.parseFloat);\n\n  // ECMA262 20.1.2.13\n  func.defineNativeProperty(\"parseInt\", realm.intrinsics.parseInt);\n\n  // ECMA262 20.1.2.14\n  func.defineNativeConstant(\"POSITIVE_INFINITY\", realm.intrinsics.Infinity);\n\n  return func;\n}\n"
  },
  {
    "path": "src/intrinsics/ecma262/NumberPrototype.js",
    "content": "/**\n * Copyright (c) 2017-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n/* @flow strict-local */\n\nimport type { Realm } from \"../../realm.js\";\nimport {\n  ObjectValue,\n  StringValue,\n  UndefinedValue,\n  AbstractValue,\n  NumberValue,\n  IntegralValue,\n} from \"../../values/index.js\";\nimport { To } from \"../../singletons.js\";\nimport invariant from \"../../invariant.js\";\n\nexport default function(realm: Realm, obj: ObjectValue): void {\n  // ECMA262 20.1.3\n  obj.$NumberData = realm.intrinsics.zero;\n\n  // ECMA262 20.1.3.2\n  obj.defineNativeMethod(\"toExponential\", 1, (context, [_fractionDigits]) => {\n    let fractionDigits = _fractionDigits;\n    // 1. Let x be ? thisNumberValue(this value).\n    let x = To.thisNumberValue(realm, context).value;\n\n    // 2. Let f be ? ToInteger(fractionDigits).\n    fractionDigits = fractionDigits.throwIfNotConcrete();\n    let f = To.ToInteger(realm, fractionDigits);\n\n    // 3. Assert: f is 0, when fractionDigits is undefined.\n    invariant(f === 0 || !(fractionDigits instanceof UndefinedValue));\n\n    // 4. If x is NaN, return the String \"NaN\".\n    if (isNaN(x)) return new StringValue(realm, \"NaN\");\n\n    // 5. Let s be the empty String.\n    let s = \"\";\n\n    // 6. If x < 0, then\n    if (x < 0) {\n      // 6a. Let s be \"-\".\n      s = \"-\";\n\n      // 6b. Let x be -x.\n      x = -x;\n    }\n\n    // 7. If x = +∞, then\n    if (x === +Infinity) {\n      // 7a. Return the concatenation of the Strings s and \"Infinity\".\n      return new StringValue(realm, s + \"Infinity\");\n    }\n\n    // 8. If f < 0 or f > 20, throw a RangeError exception. However, an implementation is permitted to extend the behaviour of toExponential for values of f less than 0 or greater than 20. In this case toExponential would not necessarily throw RangeError for such values.\n    if (f < 0 || f > 20) {\n      throw realm.createErrorThrowCompletion(realm.intrinsics.RangeError, \"f < 0 || f > 20\");\n    }\n\n    let positiveResultString = x.toExponential(fractionDigits instanceof UndefinedValue ? undefined : f);\n    return new StringValue(realm, s + positiveResultString);\n  });\n\n  // ECMA262 20.1.3.3\n  obj.defineNativeMethod(\"toFixed\", 1, (context, [fractionDigits]) => {\n    // 1. Let f be ToInteger(fractionDigits). (If fractionDigits is undefined, this step produces the value 0).\n    let f = To.ToInteger(realm, fractionDigits);\n\n    // 2. If f < 0 or f > 20, throw a RangeError exception.\n    if (f < 0 || f > 20) {\n      throw realm.createErrorThrowCompletion(realm.intrinsics.RangeError, \"f < 0 || f > 20\");\n    }\n\n    // 3. Let x be this Number value.\n    let x = To.thisNumberValue(realm, context).value;\n\n    // 4. If x is NaN, return the String \"NaN\".\n    if (isNaN(x)) return new StringValue(realm, \"NaN\");\n\n    return new StringValue(realm, x.toFixed(f));\n  });\n\n  let toLocaleStringSrc = \"(A).toLocaleString()\";\n\n  // ECMA262 20.1.3.4\n  obj.defineNativeMethod(\"toLocaleString\", 0, context => {\n    let x = To.thisNumberValue(realm, context);\n    if (realm.useAbstractInterpretation) {\n      // The locale is environment-dependent and may also be time-dependent\n      // so do this at runtime and at this point in time\n      return AbstractValue.createTemporalFromTemplate(realm, toLocaleStringSrc, StringValue, [x]);\n    } else {\n      return new StringValue(realm, x.toLocaleString());\n    }\n  });\n\n  // ECMA262 20.1.3.5\n  obj.defineNativeMethod(\"toPrecision\", 1, (context, [precision]) => {\n    // 1. Let x be ? thisNumberValue(this value).\n    // 2. If precision is undefined, return ! ToString(x).\n    let num = To.thisNumberValue(realm, context);\n    if (precision instanceof UndefinedValue) {\n      return new StringValue(realm, To.ToString(realm, num));\n    }\n    // 3. Let p be ? ToInteger(precision).\n    let p = To.ToInteger(realm, precision.throwIfNotConcrete());\n    // 4. If x is NaN, return the String \"NaN\".\n    let x = num.value;\n    if (isNaN(x)) {\n      return new StringValue(realm, \"NaN\");\n    }\n    // 5. Let s be the empty String.\n    let s = \"\";\n    // 6. If x < 0, then\n    if (x < 0) {\n      // a. Let s be code unit 0x002D (HYPHEN-MINUS).\n      s = \"-\";\n      // b. Let x be -x.\n      x = -x;\n    }\n    // 7. If x = +∞, then\n    if (x === +Infinity) {\n      // a. Return the String that is the concatenation of s and \"Infinity\".\n      return new StringValue(realm, s + \"Infinity\");\n    }\n    // 8. If p < 1 or p > 21, throw a RangeError exception.\n    // However, an implementation is permitted to extend the behaviour of\n    // toPrecision for values of p less than 1 or greater than 21.\n    // In this case toPrecision would not necessarily throw RangeError for such\n    // values.\n    if (p < 1 || p > 21) {\n      // for simplicity, throw the error\n      throw realm.createErrorThrowCompletion(realm.intrinsics.RangeError, \"p should be in between 1 and 21 inclusive\");\n    }\n    return new StringValue(realm, s + x.toPrecision(p));\n  });\n\n  const tsTemplateSrc = \"('' + A)\";\n\n  // ECMA262 20.1.3.6\n  obj.defineNativeMethod(\"toString\", 1, (context, [radix]) => {\n    if (radix instanceof UndefinedValue) {\n      const target = context instanceof ObjectValue ? context.$NumberData : context;\n      if (target instanceof AbstractValue && (target.getType() === NumberValue || target.getType() === IntegralValue)) {\n        return AbstractValue.createFromTemplate(realm, tsTemplateSrc, StringValue, [target]);\n      }\n    }\n    // 1. Let x be ? thisNumberValue(this value).\n    let x = To.thisNumberValue(realm, context);\n\n    // 2. If radix is not present, let radixNumber be 10.\n    // 3. Else if radix is undefined, let radixNumber be 10.\n    let radixNumber;\n    if (!radix || radix instanceof UndefinedValue) {\n      radixNumber = 10;\n    } else {\n      // 4. Else let radixNumber be ? ToInteger(radix).\n      radixNumber = To.ToInteger(realm, radix.throwIfNotConcrete());\n    }\n\n    // 5. If radixNumber < 2 or radixNumber > 36, throw a RangeError exception.\n    if (radixNumber < 2 || radixNumber > 36) {\n      throw realm.createErrorThrowCompletion(realm.intrinsics.TypeError);\n    }\n\n    // 6. If radixNumber = 10, return ! ToString(x).\n    if (radixNumber === 10) return new StringValue(realm, To.ToString(realm, x));\n\n    // 7. Return the String representation of this Number value using the radix specified by radixNumber.\n    //    Letters a-z are used for digits with values 10 through 35. The precise algorithm is\n    //    implementation-dependent, however the algorithm should be a generalization of that specified in\n    //    7.1.12.1.\n    return new StringValue(realm, x.value.toString(radixNumber));\n  });\n\n  // ECMA262 20.1.3.7\n  obj.defineNativeMethod(\"valueOf\", 0, context => {\n    // 1. Return ? thisNumberValue(this value).\n    return To.thisNumberValue(realm, context);\n  });\n}\n"
  },
  {
    "path": "src/intrinsics/ecma262/Object.js",
    "content": "/**\n * Copyright (c) 2017-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n/* @flow */\n\nimport { TypesDomain, ValuesDomain } from \"../../domains/index.js\";\nimport { FatalError } from \"../../errors.js\";\nimport { Realm } from \"../../realm.js\";\nimport { NativeFunctionValue } from \"../../values/index.js\";\n//import { AbruptCompletion } from \"../../completions.js\";\nimport {\n  AbstractValue,\n  AbstractObjectValue,\n  ArrayValue,\n  ObjectValue,\n  NullValue,\n  UndefinedValue,\n  StringValue,\n  BooleanValue,\n  SymbolValue,\n  Value,\n} from \"../../values/index.js\";\nimport {\n  IsExtensible,\n  EnumerableOwnProperties,\n  GetOwnPropertyKeys,\n  Get,\n  RequireObjectCoercible,\n  SameValuePartial,\n  TestIntegrityLevel,\n  SetIntegrityLevel,\n  HasSomeCompatibleType,\n} from \"../../methods/index.js\";\nimport { Create, Leak, Materialize, Properties as Props, To } from \"../../singletons.js\";\nimport { createOperationDescriptor } from \"../../utils/generator.js\";\nimport invariant from \"../../invariant.js\";\nimport { PropertyDescriptor } from \"../../descriptors.js\";\n\nfunction snapshotToObjectAndRemoveProperties(\n  to: ObjectValue | AbstractObjectValue,\n  delayedSources: Array<Value>\n): void {\n  // If to has properties, we better remove them because after the temporal call to Object.assign we don't know their values anymore\n  if (to.hasStringOrSymbolProperties()) {\n    // Preserve them in a snapshot and add the snapshot to the sources\n    delayedSources.push(to.getSnapshot({ removeProperties: true }));\n  }\n}\n\nfunction handleObjectAssignSnapshot(\n  to: ObjectValue | AbstractObjectValue,\n  frm: ObjectValue | AbstractObjectValue,\n  frm_was_partial: boolean,\n  delayedSources: Array<Value>\n): boolean {\n  if (to instanceof AbstractObjectValue && to.values.isTop()) {\n    // We don't know which objects to make partial and making all objects partial is failure in itself\n    AbstractValue.reportIntrospectionError(to);\n    throw new FatalError();\n  } else {\n    if (frm instanceof ObjectValue && frm.mightBeLeakedObject()) {\n      // \"frm\" is leaked, so it might contain properties that potentially overwrite\n      // properties already on the \"to\" object.\n      snapshotToObjectAndRemoveProperties(to, delayedSources);\n      // it's not safe to trust any of its values\n      delayedSources.push(frm);\n    } else if (frm_was_partial) {\n      // \"frm\" is partial, so it might contain properties that potentially overwrite\n      // properties already on the \"to\" object.\n      snapshotToObjectAndRemoveProperties(to, delayedSources);\n      if (frm instanceof AbstractObjectValue && frm.kind === \"explicit conversion to object\") {\n        // Make it implicit again since it is getting delayed into an Object.assign call.\n        delayedSources.push(frm.args[0]);\n      } else {\n        let frmSnapshot = frm.getSnapshot();\n        frm.temporalAlias = frmSnapshot;\n        frm.makePartial();\n        delayedSources.push(frmSnapshot);\n      }\n    } else {\n      return false;\n    }\n  }\n  return true;\n}\n\nfunction copyKeys(realm: Realm, keys, from, to): void {\n  // c. Repeat for each element nextKey of keys in List order,\n  for (let nextKey of keys) {\n    // i. Let desc be ? from.[[GetOwnProperty]](nextKey).\n    let desc = from.$GetOwnProperty(nextKey);\n\n    // ii. If desc is not undefined and desc.[[Enumerable]] is true, then\n    if (desc && desc.throwIfNotConcrete(realm).enumerable) {\n      Props.ThrowIfMightHaveBeenDeleted(desc);\n\n      // 1. Let propValue be ? Get(from, nextKey).\n      let propValue = Get(realm, from, nextKey);\n\n      // 2. Perform ? Set(to, nextKey, propValue, true).\n      Props.Set(realm, to, nextKey, propValue, true);\n    }\n  }\n}\n\nfunction applyObjectAssignSource(\n  realm: Realm,\n  nextSource: Value,\n  to: ObjectValue | AbstractObjectValue,\n  delayedSources: Array<Value>,\n  to_must_be_partial: boolean\n): boolean {\n  let keys, frm;\n\n  // a. If nextSource is undefined or null, let keys be a new empty List.\n  if (HasSomeCompatibleType(nextSource, NullValue, UndefinedValue)) {\n    return to_must_be_partial;\n  }\n\n  // b. Else,\n  // i. Let from be ToObject(nextSource).\n  frm = To.ToObject(realm, nextSource);\n\n  // ii. Let keys be ? from.[[OwnPropertyKeys]]().\n  let frm_was_partial = frm.isPartialObject();\n  if (frm_was_partial) {\n    if (!to.isSimpleObject() || !frm.isSimpleObject()) {\n      // If an object is not a simple object, it may have getters on it that can\n      // mutate any state as a result. We don't yet support this.\n      AbstractValue.reportIntrospectionError(nextSource);\n      throw new FatalError();\n    }\n\n    to_must_be_partial = true;\n  }\n\n  keys = frm.$OwnPropertyKeys(true);\n  if (to_must_be_partial) {\n    handleObjectAssignSnapshot(to, frm, frm_was_partial, delayedSources);\n  }\n\n  // c. Repeat for each element nextKey of keys in List order,\n  invariant(frm, \"from required\");\n  invariant(keys, \"keys required\");\n  copyKeys(realm, keys, frm, to);\n  return to_must_be_partial;\n}\n\nfunction tryAndApplySourceOrRecover(\n  realm: Realm,\n  nextSource: Value,\n  to: ObjectValue | AbstractObjectValue,\n  delayedSources: Array<Value>,\n  to_must_be_partial: boolean\n): boolean {\n  invariant(!realm.instantRender.enabled);\n  let effects;\n  let savedSuppressDiagnostics = realm.suppressDiagnostics;\n  try {\n    realm.suppressDiagnostics = true;\n    effects = realm.evaluateForEffects(\n      () => {\n        to_must_be_partial = applyObjectAssignSource(realm, nextSource, to, delayedSources, to_must_be_partial);\n        return realm.intrinsics.undefined;\n      },\n      undefined,\n      \"tryAndApplySourceOrRecover\"\n    );\n  } catch (e) {\n    invariant(nextSource !== realm.intrinsics.null && nextSource !== realm.intrinsics.undefined);\n    let frm = To.ToObject(realm, nextSource);\n\n    if (e instanceof FatalError && to.isSimpleObject()) {\n      to_must_be_partial = true;\n      let frm_was_partial = frm.isPartialObject();\n      let didSnapshot = handleObjectAssignSnapshot(to, frm, frm_was_partial, delayedSources);\n      if (!didSnapshot) {\n        delayedSources.push(frm);\n      }\n      // Leak the frm value because it can have getters on it\n      Leak.value(realm, frm);\n      return to_must_be_partial;\n    }\n    throw e;\n  } finally {\n    realm.suppressDiagnostics = savedSuppressDiagnostics;\n  }\n  realm.applyEffects(effects);\n  realm.returnOrThrowCompletion(effects.result);\n  return to_must_be_partial;\n}\n\nexport default function(realm: Realm): NativeFunctionValue {\n  // ECMA262 19.1.1.1\n  let func = new NativeFunctionValue(realm, \"Object\", \"Object\", 1, (context, [value], argCount, NewTarget) => {\n    // 1. If NewTarget is neither undefined nor the active function, then\n    if (NewTarget && NewTarget !== func) {\n      // a. Return ? OrdinaryCreateFromConstructor(NewTarget, \"%ObjectPrototype%\").\n      return Create.OrdinaryCreateFromConstructor(realm, NewTarget, \"ObjectPrototype\");\n    }\n\n    // 2. If value is null, undefined or not supplied, return ObjectCreate(%ObjectPrototype%).\n    if (HasSomeCompatibleType(value, NullValue, UndefinedValue)) {\n      return Create.ObjectCreate(realm, realm.intrinsics.ObjectPrototype);\n    }\n\n    // 3. Return ToObject(value).\n    return To.ToObject(realm, value);\n  });\n\n  function performConditionalObjectAssign(\n    condValue: AbstractValue,\n    consequentVal: Value,\n    alternateVal: Value,\n    to: ObjectValue | AbstractObjectValue,\n    prefixSources: Array<Value>,\n    suffixSources: Array<Value>\n  ): void {\n    // After applying a Object.assign on one path of the conditional value,\n    // that path may have had snapshotting applied to the \"to\" value. If\n    // that is the case and the other path has not had snapshotting applied\n    // then we need to make sure we materialize out the properties of the object.\n    let conditionallySnapshotted = false;\n\n    const evaluateForEffects = (val, materializeIfSnapshottingIsConditional) =>\n      realm.evaluateForEffects(\n        () => {\n          let wasSnapshotedBeforehand = to instanceof ObjectValue && to.temporalAlias !== undefined;\n          performObjectAssign(to, [...prefixSources, val, ...suffixSources]);\n          // Check if snapshotting occured\n          if (to instanceof ObjectValue) {\n            if (materializeIfSnapshottingIsConditional && to.temporalAlias === undefined && conditionallySnapshotted) {\n              // We don't really want to leak, but rather materialize the object\n              // so we assign its bindings correctly.\n              Materialize.materializeObject(realm, to);\n            } else if (!wasSnapshotedBeforehand && to.temporalAlias !== undefined && !conditionallySnapshotted) {\n              conditionallySnapshotted = true;\n            }\n          }\n          return realm.intrinsics.undefined;\n        },\n        null,\n        \"performConditionalObjectAssign consequent\"\n      );\n\n    // First evaluate both sides to see if snapshotting occurs on either side\n    evaluateForEffects(consequentVal, false);\n    evaluateForEffects(alternateVal, false);\n\n    // Now evaluate both sides again, but this time materialize if snapshotting is\n    // being used conditionally.\n    realm.evaluateWithAbstractConditional(\n      condValue,\n      () => evaluateForEffects(consequentVal, true),\n      () => evaluateForEffects(alternateVal, true)\n    );\n  }\n\n  function performObjectAssign(target: Value, sources: Array<Value>): Value {\n    // 1. Let to be ? ToObject(target).\n    let to = To.ToObject(realm, target);\n    let to_must_be_partial = false;\n\n    // 2. If only one argument was passed, return to.\n    if (!sources.length) return to;\n\n    // Check if any sources are conditionals and if so, fork the work\n    // into many subsequent objectAssign calls for each branch of the conditional\n    for (let i = 0; i < sources.length; i++) {\n      let nextSource = sources[i];\n      if (nextSource instanceof AbstractValue) {\n        if (nextSource.kind === \"conditional\") {\n          let [condValue, consequentVal, alternateVal] = nextSource.args;\n          invariant(condValue instanceof AbstractValue);\n          let prefixSources = sources.slice(0, i);\n          let suffixSources = sources.slice(i + 1);\n          performConditionalObjectAssign(condValue, consequentVal, alternateVal, to, prefixSources, suffixSources);\n          return to;\n        } else if (nextSource.kind === \"||\") {\n          let [leftValue, rightValue] = nextSource.args;\n          invariant(leftValue instanceof AbstractValue);\n          let prefixSources = sources.slice(0, i);\n          let suffixSources = sources.slice(i + 1);\n          performConditionalObjectAssign(leftValue, leftValue, rightValue, to, prefixSources, suffixSources);\n          return to;\n        } else if (nextSource.kind === \"&&\") {\n          let [leftValue, rightValue] = nextSource.args;\n          invariant(leftValue instanceof AbstractValue);\n          let prefixSources = sources.slice(0, i);\n          let suffixSources = sources.slice(i + 1);\n          performConditionalObjectAssign(leftValue, rightValue, leftValue, to, prefixSources, suffixSources);\n          return to;\n        }\n      }\n    }\n\n    // 3. Let sources be the List of argument values starting with the second argument.\n    sources;\n    let delayedSources = [];\n\n    // 4. For each element nextSource of sources, in ascending index order,\n    for (let nextSource of sources) {\n      if (realm.isInPureScope() && !realm.instantRender.enabled) {\n        realm.evaluateWithPossibleThrowCompletion(\n          () => {\n            to_must_be_partial = tryAndApplySourceOrRecover(realm, nextSource, to, delayedSources, to_must_be_partial);\n            return realm.intrinsics.undefined;\n          },\n          TypesDomain.topVal,\n          ValuesDomain.topVal\n        );\n      } else {\n        to_must_be_partial = applyObjectAssignSource(realm, nextSource, to, delayedSources, to_must_be_partial);\n      }\n    }\n\n    // 5. Return to.\n    if (to_must_be_partial) {\n      // if to has properties, we copy and delay them (at this stage we do not need to remove them)\n      if (to.hasStringOrSymbolProperties()) {\n        let toSnapshot = to.getSnapshot();\n        delayedSources.push(toSnapshot);\n      }\n\n      to.makePartial();\n\n      // We already established above that to is simple,\n      // but now that it is partial we need to set the _isSimple flag.\n      to.makeSimple();\n\n      AbstractValue.createTemporalObjectAssign(realm, to, delayedSources);\n    }\n    return to;\n  }\n\n  // ECMA262 19.1.2.1\n  if (!realm.isCompatibleWith(realm.MOBILE_JSC_VERSION)) {\n    func.defineNativeMethod(\"assign\", 2, (context, [target, ...sources]) => performObjectAssign(target, sources));\n  }\n\n  // ECMA262 19.1.2.2\n  func.defineNativeMethod(\"create\", 2, (context, [O, Properties]) => {\n    // 1. If Type(O) is neither Object nor Null, throw a TypeError exception.\n    if (!HasSomeCompatibleType(O, ObjectValue, NullValue)) {\n      throw realm.createErrorThrowCompletion(realm.intrinsics.TypeError);\n    }\n\n    // 2. Let obj be ObjectCreate(O).\n    let obj = Create.ObjectCreate(realm, ((O.throwIfNotConcrete(): any): ObjectValue | NullValue));\n\n    // 3. If Properties is not undefined, then\n    if (!Properties.mightBeUndefined()) {\n      // a. Return ? ObjectDefineProperties(obj, Properties).\n      return Props.ObjectDefineProperties(realm, obj, Properties);\n    }\n    Properties.throwIfNotConcrete();\n\n    // 4. Return obj.\n    return obj;\n  });\n\n  // ECMA262 19.1.2.3\n  func.defineNativeMethod(\"defineProperties\", 2, (context, [O, Properties]) => {\n    // 1. Return ? ObjectDefineProperties(O, Properties).\n    return Props.ObjectDefineProperties(realm, O, Properties);\n  });\n\n  // ECMA262 19.1.2.4\n  func.defineNativeMethod(\"defineProperty\", 3, (context, [O, P, Attributes]) => {\n    // 1. If Type(O) is not Object, throw a TypeError exception.\n    if (!O.mightBeObject()) {\n      throw realm.createErrorThrowCompletion(realm.intrinsics.TypeError);\n    }\n    O = O.throwIfNotObject();\n\n    // 2. Let key be ? ToPropertyKey(P).\n    let key = To.ToPropertyKey(realm, P.throwIfNotConcrete());\n\n    // 3. Let desc be ? ToPropertyDescriptor(Attributes).\n    let desc = To.ToPropertyDescriptor(realm, Attributes);\n\n    // 4. Perform ? DefinePropertyOrThrow(O, key, desc).\n    Props.DefinePropertyOrThrow(realm, (O: any), key, desc);\n\n    // 4. Return O.\n    return O;\n  });\n\n  // ECMA262 19.1.2.5\n  func.defineNativeMethod(\"freeze\", 1, (context, [O]) => {\n    // 1. If Type(O) is not Object, return O.\n    if (!O.mightBeObject()) return O;\n\n    // 2. Let status be ? SetIntegrityLevel(O, \"frozen\").\n    O = O.throwIfNotConcreteObject();\n    let status = SetIntegrityLevel(realm, O, \"frozen\");\n\n    // 3. If status is false, throw a TypeError exception.\n    if (status === false) {\n      throw realm.createErrorThrowCompletion(realm.intrinsics.TypeError);\n    }\n\n    // 4. Return O.\n    return O;\n  });\n\n  // ECMA262 19.1.2.6\n  let getOwnPropertyDescriptor = func.defineNativeMethod(\"getOwnPropertyDescriptor\", 2, (context, [O, P]) => {\n    // 1. Let obj be ? ToObject(O).\n    let obj = To.ToObject(realm, O);\n\n    // 2. Let key be ? ToPropertyKey(P).\n    let key = To.ToPropertyKey(realm, P.throwIfNotConcrete());\n\n    // 3. Let desc be ? obj.[[GetOwnProperty]](key).\n    let desc = obj.$GetOwnProperty(key);\n\n    // If we are returning a descriptor with a NativeFunctionValue\n    // and it has no intrinsic name, then we create a temporal as this\n    // can only be done at runtime\n    if (desc instanceof PropertyDescriptor) {\n      let getterFunc = desc.get;\n      if (\n        getterFunc instanceof NativeFunctionValue &&\n        getterFunc.intrinsicName === undefined &&\n        realm.useAbstractInterpretation\n      ) {\n        invariant(P instanceof Value);\n        // this will create a property descriptor at runtime\n        let result = AbstractValue.createTemporalFromBuildFunction(\n          realm,\n          ObjectValue,\n          [getOwnPropertyDescriptor, obj, P],\n          createOperationDescriptor(\"OBJECT_PROTO_GET_OWN_PROPERTY_DESCRIPTOR\")\n        );\n        invariant(result instanceof AbstractObjectValue);\n        result.makeSimple();\n        let get = Get(realm, result, \"get\");\n        let set = Get(realm, result, \"set\");\n        invariant(get instanceof AbstractValue);\n        invariant(set instanceof AbstractValue);\n        desc = new PropertyDescriptor({\n          get,\n          set,\n          enumerable: false,\n          configurable: true,\n        });\n      }\n    }\n\n    // 4. Return FromPropertyDescriptor(desc).\n    let propDesc = Props.FromPropertyDescriptor(realm, desc);\n\n    return propDesc;\n  });\n\n  // ECMA262 19.1.2.7\n  func.defineNativeMethod(\"getOwnPropertyNames\", 1, (context, [O]) => {\n    // 1. Return ? GetOwnPropertyKeys(O, String).\n    return GetOwnPropertyKeys(realm, O, StringValue);\n  });\n\n  // ECMA262 19.1.2.8\n  func.defineNativeMethod(\"getOwnPropertyDescriptors\", 1, (context, [O]) => {\n    // 1. Let obj be ? ToObject(O).\n    let obj = To.ToObject(realm, O);\n\n    // 2. Let ownKeys be ? obj.[[OwnPropertyKeys]]().\n    let ownKeys = obj.$OwnPropertyKeys();\n\n    // 3. Let descriptors be ! ObjectCreate(%ObjectPrototype%).\n    let descriptors = Create.ObjectCreate(realm, realm.intrinsics.ObjectPrototype);\n\n    // 4. Repeat, for each element key of ownKeys in List order,\n    for (let key of ownKeys) {\n      // a. Let desc be ? obj.[[GetOwnProperty]](key).\n      let desc = obj.$GetOwnProperty(key);\n      if (desc !== undefined) Props.ThrowIfMightHaveBeenDeleted(desc);\n\n      // b. Let descriptor be ! FromPropertyDescriptor(desc).\n      let descriptor = Props.FromPropertyDescriptor(realm, desc);\n\n      // c. If descriptor is not undefined, perform ! CreateDataProperty(descriptors, key, descriptor).\n      if (!(descriptor instanceof UndefinedValue)) Create.CreateDataProperty(realm, descriptors, key, descriptor);\n    }\n\n    // 5. Return descriptors.\n    return descriptors;\n  });\n\n  // ECMA262 19.1.2.9\n  if (!realm.isCompatibleWith(realm.MOBILE_JSC_VERSION) && !realm.isCompatibleWith(\"mobile\")) {\n    let getOwnPropertySymbols = func.defineNativeMethod(\"getOwnPropertySymbols\", 1, (context, [O]) => {\n      if (O instanceof AbstractValue && realm.isInPureScope()) {\n        let obj = O instanceof AbstractObjectValue ? O : To.ToObject(realm, O);\n\n        realm.callReportObjectGetOwnProperties(obj);\n        return ArrayValue.createTemporalWithWidenedNumericProperty(\n          realm,\n          [getOwnPropertySymbols, obj],\n          createOperationDescriptor(\"UNKNOWN_ARRAY_METHOD_CALL\")\n        );\n      } else if (ArrayValue.isIntrinsicAndHasWidenedNumericProperty(O)) {\n        realm.callReportObjectGetOwnProperties(O);\n        return ArrayValue.createTemporalWithWidenedNumericProperty(\n          realm,\n          [getOwnPropertySymbols, O],\n          createOperationDescriptor(\"UNKNOWN_ARRAY_METHOD_CALL\")\n        );\n      }\n      // Return ? GetOwnPropertyKeys(O, Symbol).\n      return GetOwnPropertyKeys(realm, O, SymbolValue);\n    });\n  }\n\n  // ECMA262 19.1.2.10\n  func.defineNativeMethod(\"getPrototypeOf\", 1, (context, [O]) => {\n    // 1. Let obj be ? ToObject(O).\n    let obj = To.ToObject(realm, O);\n\n    // 2. Return ? obj.[[GetPrototypeOf]]().\n    return obj.$GetPrototypeOf();\n  });\n\n  // ECMA262 19.1.2.11\n  func.defineNativeMethod(\"is\", 2, (context, [value1, value2]) => {\n    // 1. Return SameValue(value1, value2).\n    return new BooleanValue(realm, SameValuePartial(realm, value1, value2));\n  });\n\n  // ECMA262 19.1.2.12\n  func.defineNativeMethod(\"isExtensible\", 1, (context, [O]) => {\n    // 1. If Type(O) is not Object, return false.\n    if (!O.mightBeObject()) return realm.intrinsics.false;\n    O = O.throwIfNotObject();\n\n    // 2. Return ? IsExtensible(O).\n    return new BooleanValue(realm, IsExtensible(realm, O));\n  });\n\n  // ECMA262 19.1.2.13\n  func.defineNativeMethod(\"isFrozen\", 1, (context, [O]) => {\n    // 1. If Type(O) is not Object, return true.\n    if (!O.mightBeObject()) return realm.intrinsics.true;\n\n    // 2. Return ? TestIntegrityLevel(O, \"frozen\").\n    O = O.throwIfNotConcreteObject();\n    return new BooleanValue(realm, TestIntegrityLevel(realm, O, \"frozen\"));\n  });\n\n  // ECMA262 19.1.2.14\n  func.defineNativeMethod(\"isSealed\", 1, (context, [O]) => {\n    // 1. If Type(O) is not Object, return true.\n    if (!O.mightBeObject()) return realm.intrinsics.true;\n\n    // 2. Return ? TestIntegrityLevel(O, \"sealed\").\n    O = O.throwIfNotConcreteObject();\n    return new BooleanValue(realm, TestIntegrityLevel(realm, O, \"sealed\"));\n  });\n\n  // ECMA262 19.1.2.15\n  let objectKeys = func.defineNativeMethod(\"keys\", 1, (context, [O]) => {\n    // 1. Let obj be ? ToObject(O).\n    let obj = To.ToObject(realm, O);\n\n    // If we're in pure scope and the items are completely abstract,\n    // then create an abstract temporal with an array kind\n    if (realm.isInPureScope() && obj instanceof AbstractObjectValue) {\n      let array = ArrayValue.createTemporalWithWidenedNumericProperty(\n        realm,\n        [objectKeys, obj],\n        createOperationDescriptor(\"UNKNOWN_ARRAY_METHOD_CALL\")\n      );\n      return array;\n    } else if (ArrayValue.isIntrinsicAndHasWidenedNumericProperty(obj)) {\n      return ArrayValue.createTemporalWithWidenedNumericProperty(\n        realm,\n        [objectKeys, obj],\n        createOperationDescriptor(\"UNKNOWN_ARRAY_METHOD_CALL\")\n      );\n    }\n\n    // 2. Let nameList be ? EnumerableOwnProperties(obj, \"key\").\n    let nameList = EnumerableOwnProperties(realm, obj.throwIfNotConcreteObject(), \"key\");\n\n    // 3. Return CreateArrayFromList(nameList).\n    return Create.CreateArrayFromList(realm, nameList);\n  });\n\n  // ECMA262 9.1.2.16\n  if (!realm.isCompatibleWith(realm.MOBILE_JSC_VERSION) && !realm.isCompatibleWith(\"mobile\")) {\n    let objectValues = func.defineNativeMethod(\"values\", 1, (context, [O]) => {\n      // 1. Let obj be ? ToObject(O).\n      let obj = To.ToObject(realm, O);\n\n      if (realm.isInPureScope()) {\n        // If we're in pure scope and the items are completely abstract,\n        // then create an abstract temporal with an array kind\n        if (obj instanceof AbstractObjectValue) {\n          let array = ArrayValue.createTemporalWithWidenedNumericProperty(\n            realm,\n            [objectValues, obj],\n            createOperationDescriptor(\"UNKNOWN_ARRAY_METHOD_CALL\")\n          );\n          return array;\n        } else if (ArrayValue.isIntrinsicAndHasWidenedNumericProperty(obj)) {\n          return ArrayValue.createTemporalWithWidenedNumericProperty(\n            realm,\n            [objectValues, obj],\n            createOperationDescriptor(\"UNKNOWN_ARRAY_METHOD_CALL\")\n          );\n        }\n      }\n\n      // 2. Let nameList be ? EnumerableOwnProperties(obj, \"value\").\n      let nameList = EnumerableOwnProperties(realm, obj.throwIfNotConcreteObject(), \"value\");\n\n      // 3. Return CreateArrayFromList(nameList).\n      return Create.CreateArrayFromList(realm, nameList);\n    });\n  }\n\n  // ECMA262 19.1.2.17\n  if (!realm.isCompatibleWith(realm.MOBILE_JSC_VERSION) && !realm.isCompatibleWith(\"mobile\")) {\n    let objectEntries = func.defineNativeMethod(\"entries\", 1, (context, [O]) => {\n      // 1. Let obj be ? ToObject(O).\n      let obj = To.ToObject(realm, O);\n\n      // If we're in pure scope and the items are completely abstract,\n      // then create an abstract temporal with an array kind\n      if (realm.isInPureScope() && obj instanceof AbstractObjectValue) {\n        let array = ArrayValue.createTemporalWithWidenedNumericProperty(\n          realm,\n          [objectEntries, obj],\n          createOperationDescriptor(\"UNKNOWN_ARRAY_METHOD_CALL\")\n        );\n        return array;\n      } else if (ArrayValue.isIntrinsicAndHasWidenedNumericProperty(obj)) {\n        return ArrayValue.createTemporalWithWidenedNumericProperty(\n          realm,\n          [objectEntries, obj],\n          createOperationDescriptor(\"UNKNOWN_ARRAY_METHOD_CALL\")\n        );\n      }\n\n      // 2. Let nameList be ? EnumerableOwnProperties(obj, \"key+value\").\n      let nameList = EnumerableOwnProperties(realm, obj.throwIfNotConcreteObject(), \"key+value\");\n\n      // 3. Return CreateArrayFromList(nameList).\n      return Create.CreateArrayFromList(realm, nameList);\n    });\n  }\n\n  // ECMA262 19.1.2.18\n  func.defineNativeMethod(\"preventExtensions\", 1, (context, [O]) => {\n    // 1. If Type(O) is not Object, return O.\n    if (!O.mightBeObject()) return O;\n\n    // 2. Let status be ? O.[[PreventExtensions]]().\n    O = O.throwIfNotConcreteObject();\n    let status = O.$PreventExtensions();\n\n    // 3. If status is false, throw a TypeError exception.\n    if (status === false) {\n      throw realm.createErrorThrowCompletion(realm.intrinsics.TypeError);\n    }\n\n    // 4. Return O.\n    return O;\n  });\n\n  // ECMA262 19.1.2.19\n  func.defineNativeMethod(\"seal\", 1, (context, [O]) => {\n    // 1. If Type(O) is not Object, return O.\n    if (!O.mightBeObject()) return O;\n\n    // 2. Let status be ? SetIntegrityLevel(O, \"sealed\").\n    O = O.throwIfNotConcreteObject();\n    let status = SetIntegrityLevel(realm, O, \"sealed\");\n\n    // 3. If status is false, throw a TypeError exception.\n    if (status === false) {\n      throw realm.createErrorThrowCompletion(realm.intrinsics.TypeError);\n    }\n\n    // 4. Return O.\n    return O;\n  });\n\n  // ECMA262 19.1.2.20\n  if (!realm.isCompatibleWith(realm.MOBILE_JSC_VERSION))\n    func.defineNativeMethod(\"setPrototypeOf\", 2, (context, [O, proto]) => {\n      // 1. Let O be ? RequireObjectCoercible(O).\n      O = RequireObjectCoercible(realm, O);\n\n      // 2. If Type(proto) is neither Object nor Null, throw a TypeError exception.\n      if (!HasSomeCompatibleType(proto, ObjectValue, NullValue)) {\n        throw realm.createErrorThrowCompletion(realm.intrinsics.TypeError);\n      }\n\n      // 3. If Type(O) is not Object, return O.\n      O = O.throwIfNotConcrete();\n      if (!(O instanceof ObjectValue)) return O;\n\n      // 4. Let status be ? O.[[SetPrototypeOf]](proto).\n      let status = O.$SetPrototypeOf(((proto: any): ObjectValue | NullValue));\n\n      // 5. If status is false, throw a TypeError exception.\n      if (status === false) {\n        throw realm.createErrorThrowCompletion(realm.intrinsics.TypeError);\n      }\n\n      // 6. Return O.\n      return O;\n    });\n\n  return func;\n}\n"
  },
  {
    "path": "src/intrinsics/ecma262/ObjectProto_toString.js",
    "content": "/**\n * Copyright (c) 2017-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n/* @flow strict-local */\n\nimport type { Realm } from \"../../realm.js\";\nimport { NativeFunctionValue, UndefinedValue, StringValue, NullValue } from \"../../values/index.js\";\nimport { IsArray } from \"../../methods/is.js\";\nimport { Get } from \"../../methods/get.js\";\nimport { To } from \"../../singletons.js\";\n\nexport default function(realm: Realm): NativeFunctionValue {\n  // ECMA262 22.1.3.30\n  return new NativeFunctionValue(\n    realm,\n    \"Object.prototype.toString\",\n    \"toString\",\n    0,\n    context => {\n      // 1. If the this value is undefined, return \"[object Undefined]\".\n      if (context instanceof UndefinedValue) return new StringValue(realm, \"[object Undefined]\");\n\n      // 2. If the this value is null, return \"[object Null]\".\n      if (context instanceof NullValue) return new StringValue(realm, \"[object Null]\");\n\n      // 3. Let O be ToObject(this value).\n      let O = To.ToObject(realm, context);\n\n      let builtinTag;\n\n      // 4. Let isArray be ? IsArray(O).\n      let isArray = IsArray(realm, O);\n\n      // 5. If isArray is true, let builtinTag be \"Array\".\n      if (isArray) builtinTag = \"Array\";\n      else if (O.$StringData !== undefined)\n        // 6. Else, if O is an exotic String object, let builtinTag be \"String\".\n        builtinTag = \"String\";\n      else if (O.$ParameterMap !== undefined)\n        // 7. Else, if O has an [[ParameterMap]] internal slot, let builtinTag be \"Arguments\".\n        builtinTag = \"Arguments\";\n      else if (O.$Call !== undefined)\n        // 8. Else, if O has a [[Call]] internal method, let builtinTag be \"Function\".\n        builtinTag = \"Function\";\n      else if (O.$ErrorData !== undefined)\n        // 9. Else, if O has an [[ErrorData]] internal slot, let builtinTag be \"Error\".\n        builtinTag = \"Error\";\n      else if (O.$BooleanData !== undefined)\n        // 10. Else, if O has a [[BooleanData]] internal slot, let builtinTag be \"Boolean\".\n        builtinTag = \"Boolean\";\n      else if (O.$NumberData !== undefined)\n        // 11. Else, if O has a [[NumberData]] internal slot, let builtinTag be \"Number\".\n        builtinTag = \"Number\";\n      else if (O.$DateValue !== undefined)\n        // 12. Else, if O has a [[DateValue]] internal slot, let builtinTag be \"Date\".\n        builtinTag = \"Date\";\n      else if (O.$RegExpMatcher !== undefined)\n        // 13. Else, if O has a [[RegExpMatcher]] internal slot, let builtinTag be \"RegExp\".\n        builtinTag = \"RegExp\";\n      else {\n        // 14. Else, let builtinTag be \"Object\".\n        builtinTag = \"Object\";\n      }\n      // 15. Let tag be ? Get(O, @@toStringTag).\n      let tag = Get(realm, O, realm.intrinsics.SymbolToStringTag);\n\n      // 16. If Type(tag) is not String, let tag be builtinTag.\n      tag = tag instanceof StringValue ? tag.value : builtinTag;\n\n      // 17. Return the String that is the result of concatenating \"[object \", tag, and \"]\".\n      return new StringValue(realm, `[object ${tag}]`);\n    },\n    false\n  );\n}\n"
  },
  {
    "path": "src/intrinsics/ecma262/ObjectPrototype.js",
    "content": "/**\n * Copyright (c) 2017-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n/* @flow */\n\nimport type { Realm } from \"../../realm.js\";\nimport {\n  AbstractValue,\n  NativeFunctionValue,\n  ObjectValue,\n  BooleanValue,\n  NullValue,\n  StringValue,\n} from \"../../values/index.js\";\nimport { SameValuePartial, RequireObjectCoercible } from \"../../methods/abstract.js\";\nimport { HasOwnProperty, HasSomeCompatibleType } from \"../../methods/has.js\";\nimport { Invoke } from \"../../methods/call.js\";\nimport { Properties, To } from \"../../singletons.js\";\nimport { FatalError } from \"../../errors.js\";\nimport invariant from \"../../invariant.js\";\nimport { TypesDomain, ValuesDomain } from \"../../domains/index.js\";\nimport { createOperationDescriptor } from \"../../utils/generator.js\";\nimport { PropertyDescriptor } from \"../../descriptors.js\";\n\nexport default function(realm: Realm, obj: ObjectValue): void {\n  // ECMA262 19.1.3.2\n  const ObjectPrototypeHasOwnPrototype = obj.defineNativeMethod(\"hasOwnProperty\", 1, (context, [V]) => {\n    // 1. Let P be ? ToPropertyKey(V).\n    let P = To.ToPropertyKey(realm, V.throwIfNotConcrete());\n\n    // The pure parts are wrapped with a recovery mode.\n    try {\n      // 2. Let O be ? ToObject(this value).\n      let O = To.ToObject(realm, context);\n\n      // 3. Return ? HasOwnProperty(O, P).\n      return new BooleanValue(realm, HasOwnProperty(realm, O, P));\n    } catch (x) {\n      if (realm.isInPureScope() && x instanceof FatalError) {\n        // If we're in pure scope we can try to recover from any fatals by\n        // leaving the call in place which we do by default, but we don't\n        // have to leak the state of any arguments since this function is pure.\n        // This also lets us define the return type properly.\n        const key = typeof P === \"string\" ? new StringValue(realm, P) : P;\n        return realm.evaluateWithPossibleThrowCompletion(\n          () =>\n            AbstractValue.createTemporalFromBuildFunction(\n              realm,\n              BooleanValue,\n              [ObjectPrototypeHasOwnPrototype, context, key],\n              createOperationDescriptor(\"OBJECT_PROTO_HAS_OWN_PROPERTY\")\n            ),\n          TypesDomain.topVal,\n          ValuesDomain.topVal\n        );\n      }\n      throw x;\n    }\n  });\n\n  // ECMA262 19.1.3.3\n  obj.defineNativeMethod(\"isPrototypeOf\", 1, (context, [V]) => {\n    // 1. If Type(V) is not Object, return false.\n    if (!V.mightBeObject()) return realm.intrinsics.false;\n    V = V.throwIfNotConcreteObject();\n\n    // 2. Let O be ? ToObject(this value).\n    let O = To.ToObject(realm, context);\n\n    // 3. Repeat\n    while (true) {\n      // a. Let V be ? V.[[GetPrototypeOf]]().\n      V = V.$GetPrototypeOf();\n\n      // b. If V is null, return false.\n      if (V instanceof NullValue) return realm.intrinsics.false;\n\n      // c. If SameValue(O, V) is true, return true.\n      if (SameValuePartial(realm, O, V) === true) return realm.intrinsics.true;\n    }\n\n    invariant(false);\n  });\n\n  // ECMA262 19.1.3.4\n  obj.defineNativeMethod(\"propertyIsEnumerable\", 1, (context, [V]) => {\n    // 1. Let P be ? ToPropertyKey(V).\n    let P = To.ToPropertyKey(realm, V.throwIfNotConcrete());\n\n    // 2. Let O be ? ToObject(this value).\n    let O = To.ToObject(realm, context);\n\n    // 3. Let desc be ? O.[[GetOwnProperty]](P).\n    let desc = O.$GetOwnProperty(P);\n\n    // 4. If desc is undefined, return false.\n    if (!desc) return realm.intrinsics.false;\n    Properties.ThrowIfMightHaveBeenDeleted(desc);\n    desc = desc.throwIfNotConcrete(realm);\n\n    // 5. Return the value of desc.[[Enumerable]].\n    return desc.enumerable === undefined ? realm.intrinsics.undefined : new BooleanValue(realm, desc.enumerable);\n  });\n\n  // ECMA262 19.1.3.5\n  obj.defineNativeMethod(\"toLocaleString\", 0, context => {\n    // 1. Let O be the this value.\n    let O = context;\n\n    // 2. Return ? Invoke(O, \"toString\").\n    return Invoke(realm, O, \"toString\");\n  });\n\n  // ECMA262 19.1.3.6\n  obj.defineNativeProperty(\"toString\", realm.intrinsics.ObjectProto_toString);\n\n  // ECMA262 19.1.3.7\n  obj.defineNativeMethod(\"valueOf\", 0, context => {\n    // 1. Return ? ToObject(this value).\n    return To.ToObject(realm, context);\n  });\n\n  obj.$DefineOwnProperty(\n    \"__proto__\",\n    new PropertyDescriptor({\n      // B.2.2.1.1\n      get: new NativeFunctionValue(realm, undefined, \"get __proto__\", 0, context => {\n        // 1. Let O be ? ToObject(this value).\n        let O = To.ToObject(realm, context);\n\n        // 2. Return ? O.[[GetPrototypeOf]]().\n        return O.$GetPrototypeOf();\n      }),\n\n      // B.2.2.1.2\n      set: new NativeFunctionValue(realm, undefined, \"set __proto__\", 1, (context, [proto]) => {\n        // 1. Let O be ? RequireObjectCoercible(this value).\n        let O = RequireObjectCoercible(realm, context);\n\n        // 2. If Type(proto) is neither Object nor Null, return undefined.\n        if (!HasSomeCompatibleType(proto, ObjectValue, NullValue)) return realm.intrinsics.undefined;\n\n        // 3. If Type(O) is not Object, return undefined.\n        if (!O.mightBeObject()) return realm.intrinsics.undefined;\n        O = O.throwIfNotConcreteObject();\n\n        // 4. Let status be ? O.[[SetPrototypeOf]](proto).\n        let status = O.$SetPrototypeOf(((proto.throwIfNotConcrete(): any): ObjectValue | NullValue));\n\n        // 5. If status is false, throw a TypeError exception.\n        if (!status) {\n          throw realm.createErrorThrowCompletion(realm.intrinsics.TypeError, \"couldn't set proto\");\n        }\n\n        // 6. Return undefined.\n        return realm.intrinsics.undefined;\n      }),\n    })\n  );\n}\n"
  },
  {
    "path": "src/intrinsics/ecma262/Promise.js",
    "content": "/**\n * Copyright (c) 2017-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n/* @flow strict-local */\n\nimport type { Realm } from \"../../realm.js\";\nimport { ObjectValue, FunctionValue, NativeFunctionValue } from \"../../values/index.js\";\nimport { AbruptCompletion } from \"../../completions.js\";\nimport {\n  NewPromiseCapability,\n  PerformPromiseAll,\n  PerformPromiseRace,\n  CreateResolvingFunctions,\n} from \"../../methods/promise.js\";\nimport { IsCallable, Call, GetIterator, SameValuePartial, Get, IsPromise } from \"../../methods/index.js\";\nimport { IteratorClose } from \"../../methods/iterator.js\";\nimport { Create } from \"../../singletons.js\";\nimport invariant from \"../../invariant.js\";\n\nexport default function(realm: Realm): NativeFunctionValue {\n  // ECMA262 25.4.3.1\n  let func = new NativeFunctionValue(realm, \"Promise\", \"Promise\", 1, (context, [executor], argCount, NewTarget) => {\n    // 1. If NewTarget is undefined, throw a TypeError exception.\n    if (!NewTarget) {\n      throw realm.createErrorThrowCompletion(realm.intrinsics.TypeError);\n    }\n\n    // 2. If IsCallable(executor) is false, throw a TypeError exception.\n    if (!IsCallable(realm, executor)) {\n      throw realm.createErrorThrowCompletion(realm.intrinsics.TypeError);\n    }\n\n    // 3. Let promise be ? OrdinaryCreateFromConstructor(NewTarget, \"%PromisePrototype%\", « [[PromiseState]], [[PromiseResult]], [[PromiseFulfillReactions]], [[PromiseRejectReactions]], [[PromiseIsHandled]] »).\n    let promise = Create.OrdinaryCreateFromConstructor(realm, NewTarget, \"PromisePrototype\", {\n      $PromiseState: undefined,\n      $PromiseResult: undefined,\n      $PromiseFulfillReactions: undefined,\n      $PromiseRejectReactions: undefined,\n      $PromiseIsHandled: undefined,\n    });\n\n    // 4. Set promise's [[PromiseState]] internal slot to \"pending\".\n    promise.$PromiseState = \"pending\";\n\n    // 5. Set promise's [[PromiseFulfillReactions]] internal slot to a new empty List.\n    promise.$PromiseFulfillReactions = [];\n\n    // 6. Set promise's [[PromiseRejectReactions]] internal slot to a new empty List.\n    promise.$PromiseRejectReactions = [];\n\n    // 7. Set promise's [[PromiseIsHandled]] internal slot to false.\n    promise.$PromiseIsHandled = false;\n\n    // 8. Let resolvingFunctions be CreateResolvingFunctions(promise).\n    let resolvingFunctions = CreateResolvingFunctions(realm, promise);\n\n    // 9. Let completion be Call(executor, undefined, « resolvingFunctions.[[Resolve]], resolvingFunctions.[[Reject]] »).\n    let completion;\n    try {\n      completion = Call(realm, executor, realm.intrinsics.undefined, [\n        resolvingFunctions.resolve,\n        resolvingFunctions.reject,\n      ]);\n    } catch (err) {\n      if (err instanceof AbruptCompletion) {\n        completion = err;\n      } else {\n        throw err;\n      }\n    }\n\n    // 10. If completion is an abrupt completion, then\n    if (completion instanceof AbruptCompletion) {\n      // a. Perform ? Call(resolvingFunctions.[[Reject]], undefined, « completion.[[Value]] »).\n      Call(realm, resolvingFunctions.reject, realm.intrinsics.undefined, [completion.value]);\n    }\n\n    // 11. Return promise.\n    return promise;\n  });\n\n  // ECMA262 25.4.4.1\n  func.defineNativeMethod(\"all\", 1, (context, [iterable]) => {\n    // 1. Let C be the this value.\n    let C = context.throwIfNotConcrete();\n\n    // 2. If Type(C) is not Object, throw a TypeError exception.\n    if (!(C instanceof ObjectValue)) {\n      throw realm.createErrorThrowCompletion(realm.intrinsics.TypeError);\n    }\n\n    // 3. Let promiseCapability be ? NewPromiseCapability(C).\n    let promiseCapability = NewPromiseCapability(realm, C);\n\n    // 4. Let iterator be GetIterator(iterable).\n    let iterator;\n    try {\n      iterator = GetIterator(realm, iterable);\n    } catch (e) {\n      if (e instanceof AbruptCompletion) {\n        // 5. IfAbruptRejectPromise(iterator, promiseCapability).\n        Call(realm, promiseCapability.reject, realm.intrinsics.undefined, [e.value]);\n        return promiseCapability.promise;\n      } else throw e;\n    }\n\n    // 6. Let iteratorRecord be Record {[[Iterator]]: iterator, [[Done]]: false}.\n    let iteratorRecord = { $Iterator: iterator, $Done: false };\n\n    // 7. Let result be PerformPromiseAll(iteratorRecord, C, promiseCapability).\n    let result;\n    try {\n      invariant(C instanceof FunctionValue);\n      result = PerformPromiseAll(realm, iteratorRecord, C, promiseCapability);\n    } catch (e) {\n      // 8. If result is an abrupt completion, then\n      if (e instanceof AbruptCompletion) {\n        // a. If iteratorRecord.[[Done]] is false, let result be IteratorClose(iterator, result).\n        if (iteratorRecord.$Done === false) {\n          try {\n            result = IteratorClose(realm, iterator, e).value;\n          } catch (resultCompletion) {\n            if (resultCompletion instanceof AbruptCompletion) {\n              result = resultCompletion.value;\n            } else throw resultCompletion;\n          }\n        } else {\n          result = e.value;\n        }\n\n        // b. IfAbruptRejectPromise(result, promiseCapability).\n        Call(realm, promiseCapability.reject, realm.intrinsics.undefined, [result]);\n        return promiseCapability.promise;\n      } else throw e;\n    }\n\n    // 9. Return Completion(result).\n    return result;\n  });\n\n  // ECMA262 25.4.4.3\n  func.defineNativeMethod(\"race\", 1, (context, [iterable]) => {\n    // 1. Let C be the this value.\n    let C = context.throwIfNotConcrete();\n\n    // 2. If Type(C) is not Object, throw a TypeError exception.\n    if (!(C instanceof ObjectValue)) {\n      throw realm.createErrorThrowCompletion(realm.intrinsics.TypeError);\n    }\n\n    // 3. Let promiseCapability be ? NewPromiseCapability(C).\n    let promiseCapability = NewPromiseCapability(realm, C);\n\n    // 4. Let iterator be GetIterator(iterable).\n    let iterator;\n    try {\n      iterator = GetIterator(realm, iterable);\n    } catch (e) {\n      if (e instanceof AbruptCompletion) {\n        // 5. IfAbruptRejectPromise(iterator, promiseCapability).\n        Call(realm, promiseCapability.reject, realm.intrinsics.undefined, [e.value]);\n        return promiseCapability.promise;\n      } else throw e;\n    }\n\n    // 6. Let iteratorRecord be Record {[[Iterator]]: iterator, [[Done]]: false}.\n    let iteratorRecord = { $Iterator: iterator, $Done: false };\n\n    // 7. Let result be PerformPromiseRace(iteratorRecord, promiseCapability, C).\n    let result;\n    try {\n      result = PerformPromiseRace(realm, iteratorRecord, promiseCapability, C);\n    } catch (e) {\n      // 8. If result is an abrupt completion, then\n      if (e instanceof AbruptCompletion) {\n        // a. If iteratorRecord.[[Done]] is false, let result be IteratorClose(iterator, result).\n        if (iteratorRecord.$Done === false) {\n          try {\n            result = IteratorClose(realm, iterator, e).value;\n          } catch (resultCompletion) {\n            if (resultCompletion instanceof AbruptCompletion) {\n              result = resultCompletion.value;\n            } else throw resultCompletion;\n          }\n        } else {\n          result = e.value;\n        }\n\n        // b. IfAbruptRejectPromise(result, promiseCapability).\n        Call(realm, promiseCapability.reject, realm.intrinsics.undefined, [result]);\n        return promiseCapability.promise;\n      } else throw e;\n    }\n\n    // 9. Return Completion(result).\n    return result;\n  });\n\n  // ECMA262 25.4.4.4\n  func.defineNativeMethod(\"reject\", 1, (context, [r]) => {\n    // 1. Let C be the this value.\n    let C = context.throwIfNotConcrete();\n\n    // 2. If Type(C) is not Object, throw a TypeError exception.\n    if (!(C instanceof ObjectValue)) {\n      throw realm.createErrorThrowCompletion(realm.intrinsics.TypeError);\n    }\n\n    // 3. Let promiseCapability be ? NewPromiseCapability(C).\n    let promiseCapability = NewPromiseCapability(realm, C);\n\n    // 4. Perform ? Call(promiseCapability.[[Reject]], undefined, « r »).\n    Call(realm, promiseCapability.reject, realm.intrinsics.undefined, [r]);\n\n    // 5. Return promiseCapability.[[Promise]].\n    return promiseCapability.promise;\n  });\n\n  // ECMA262 25.4.4.5\n  func.defineNativeMethod(\"resolve\", 1, (context, [x]) => {\n    // 1. Let C be the this value.\n    let C = context.throwIfNotConcrete();\n\n    // 2. If Type(C) is not Object, throw a TypeError exception.\n    if (!(C instanceof ObjectValue)) {\n      throw realm.createErrorThrowCompletion(realm.intrinsics.TypeError);\n    }\n\n    // 3. If IsPromise(x) is true, then\n    if (IsPromise(realm, x)) {\n      invariant(x instanceof ObjectValue);\n      // a. Let xConstructor be ? Get(x, \"constructor\").\n      let xConstructor = Get(realm, x, \"constructor\");\n\n      // b. If SameValue(xConstructor, C) is true, return x.\n      if (SameValuePartial(realm, xConstructor, C)) return x;\n    }\n\n    // 4. Let promiseCapability be ? NewPromiseCapability(C).\n    let promiseCapability = NewPromiseCapability(realm, C);\n\n    // 5. Perform ? Call(promiseCapability.[[Resolve]], undefined, « x »).\n    Call(realm, promiseCapability.resolve, realm.intrinsics.undefined, [x]);\n\n    // 6. Return promiseCapability.[[Promise]].\n    return promiseCapability.promise;\n  });\n\n  // ECMA262 25.4.4.6\n  func.defineNativeGetter(realm.intrinsics.SymbolSpecies, context => {\n    // 1. Return the this value\n    return context;\n  });\n\n  return func;\n}\n"
  },
  {
    "path": "src/intrinsics/ecma262/PromisePrototype.js",
    "content": "/**\n * Copyright (c) 2017-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n/* @flow strict-local */\n\nimport type { Realm } from \"../../realm.js\";\nimport { StringValue, ObjectValue } from \"../../values/index.js\";\nimport { IsPromise, Invoke, SpeciesConstructor } from \"../../methods/index.js\";\nimport { NewPromiseCapability, PerformPromiseThen } from \"../../methods/promise.js\";\nimport invariant from \"../../invariant.js\";\n\nexport default function(realm: Realm, obj: ObjectValue): void {\n  // ECMA262 25.4.5.1\n  obj.defineNativeMethod(\"catch\", 1, (context, [onRejected]) => {\n    // 1. Let promise be the this value.\n    let promise = context;\n\n    // 2. Return ? Invoke(promise, \"then\", « undefined, onRejected »).\n    return Invoke(realm, promise, \"then\", [realm.intrinsics.undefined, onRejected]);\n  });\n\n  // ECMA262 25.4.5.3\n  obj.defineNativeMethod(\"then\", 2, (context, [onFulfilled, onRejected]) => {\n    // 1. Let promise be the this value.\n    let promise = context;\n\n    // 2. If IsPromise(promise) is false, throw a TypeError exception.\n    if (!IsPromise(realm, promise)) {\n      throw realm.createErrorThrowCompletion(realm.intrinsics.TypeError);\n    }\n    invariant(promise instanceof ObjectValue);\n\n    // 3. Let C be ? SpeciesConstructor(promise, %Promise%).\n    let C = SpeciesConstructor(realm, promise, realm.intrinsics.Promise);\n\n    // 4. Let resultCapability be ? NewPromiseCapability(C).\n    let resultCapability = NewPromiseCapability(realm, C);\n\n    // 5. Return PerformPromiseThen(promise, onFulfilled, onRejected, resultCapability).\n    return PerformPromiseThen(realm, promise, onFulfilled, onRejected, resultCapability);\n  });\n\n  // ECMA262 25.4.5.4 Promise.prototype [ @@toStringTag ]\n  obj.defineNativeProperty(realm.intrinsics.SymbolToStringTag, new StringValue(realm, \"Promise\"), { writable: false });\n}\n"
  },
  {
    "path": "src/intrinsics/ecma262/Proxy.js",
    "content": "/**\n * Copyright (c) 2017-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n/* @flow strict-local */\n\nimport type { Realm } from \"../../realm.js\";\nimport { ProxyValue, NullValue, NativeFunctionValue } from \"../../values/index.js\";\nimport { Create } from \"../../singletons.js\";\nimport { ProxyCreate } from \"../../methods/proxy.js\";\nimport invariant from \"../../invariant.js\";\n\nexport default function(realm: Realm): NativeFunctionValue {\n  // ECMA262 26.2.1.1\n  let func = new NativeFunctionValue(realm, \"Proxy\", \"Proxy\", 2, (context, [target, handler], argCount, NewTarget) => {\n    // 1. If NewTarget is undefined, throw a TypeError exception.\n    if (!NewTarget) {\n      throw realm.createErrorThrowCompletion(realm.intrinsics.TypeError);\n    }\n\n    // 2. Return ? ProxyCreate(target, handler).\n    return ProxyCreate(realm, target, handler);\n  });\n\n  // ECMA262 26.2.2.1\n  func.defineNativeMethod(\"revocable\", 2, (context, [target, handler]) => {\n    // 1. Let p be ? ProxyCreate(target, handler).\n    let p = ProxyCreate(realm, target, handler);\n\n    // 2. Let revoker be a new built-in function object as defined in 26.2.2.1.1.\n    let revoker = createRevoker();\n\n    // 3. Set the [[RevocableProxy]] internal slot of revoker to p.\n    revoker.$RevocableProxy = p;\n\n    // 4. Let result be ObjectCreate(%ObjectPrototype%).\n    let result = Create.ObjectCreate(realm, realm.intrinsics.ObjectPrototype);\n\n    // 5. Perform CreateDataProperty(result, \"proxy\", p).\n    Create.CreateDataProperty(realm, result, \"proxy\", p);\n\n    // 6. Perform CreateDataProperty(result, \"revoke\", revoker).\n    Create.CreateDataProperty(realm, result, \"revoke\", revoker);\n\n    // 7. Return result.\n    return result;\n  });\n\n  function createRevoker() {\n    let F = new NativeFunctionValue(\n      realm,\n      undefined,\n      undefined,\n      0,\n      (context, [target, handler], argCount, NewTarget) => {\n        // 1. Let p be the value of F's [[RevocableProxy]] internal slot.\n        let p = F.$RevocableProxy;\n\n        // 2. If p is null, return undefined.\n        if (p instanceof NullValue) return realm.intrinsics.undefined;\n\n        // 3. Set the value of F's [[RevocableProxy]] internal slot to null.\n        F.$RevocableProxy = realm.intrinsics.null;\n\n        // 4. Assert: p is a Proxy object.\n        invariant(p instanceof ProxyValue, \"expected proxy\");\n\n        // 5. Set the [[ProxyTarget]] internal slot of p to null.\n        p.$ProxyTarget = realm.intrinsics.null;\n\n        // 6. Set the [[ProxyHandler]] internal slot of p to null.\n        p.$ProxyHandler = realm.intrinsics.null;\n\n        // 7. Return undefined.\n        return realm.intrinsics.undefined;\n      },\n      false\n    );\n\n    return F;\n  }\n\n  return func;\n}\n"
  },
  {
    "path": "src/intrinsics/ecma262/RangeError.js",
    "content": "/**\n * Copyright (c) 2017-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n/* @flow strict-local */\n\nimport type { Realm } from \"../../realm.js\";\nimport type { NativeFunctionValue } from \"../../values/index.js\";\nimport { build } from \"./Error.js\";\n\nexport default function(realm: Realm): NativeFunctionValue {\n  return build(\"RangeError\", realm);\n}\n"
  },
  {
    "path": "src/intrinsics/ecma262/RangeErrorPrototype.js",
    "content": "/**\n * Copyright (c) 2017-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n/* @flow strict-local */\n\nimport type { Realm } from \"../../realm.js\";\nimport { ObjectValue, StringValue } from \"../../values/index.js\";\n\nexport default function(realm: Realm, obj: ObjectValue): void {\n  obj.defineNativeProperty(\"name\", new StringValue(realm, \"RangeError\"));\n  obj.defineNativeProperty(\"message\", realm.intrinsics.emptyString);\n}\n"
  },
  {
    "path": "src/intrinsics/ecma262/ReferenceError.js",
    "content": "/**\n * Copyright (c) 2017-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n/* @flow strict-local */\n\nimport type { Realm } from \"../../realm.js\";\nimport type { NativeFunctionValue } from \"../../values/index.js\";\nimport { build } from \"./Error.js\";\n\nexport default function(realm: Realm): NativeFunctionValue {\n  return build(\"ReferenceError\", realm);\n}\n"
  },
  {
    "path": "src/intrinsics/ecma262/ReferenceErrorPrototype.js",
    "content": "/**\n * Copyright (c) 2017-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n/* @flow strict-local */\n\nimport type { Realm } from \"../../realm.js\";\nimport { ObjectValue, StringValue } from \"../../values/index.js\";\n\nexport default function(realm: Realm, obj: ObjectValue): void {\n  obj.defineNativeProperty(\"name\", new StringValue(realm, \"ReferenceError\"));\n  obj.defineNativeProperty(\"message\", realm.intrinsics.emptyString);\n}\n"
  },
  {
    "path": "src/intrinsics/ecma262/Reflect.js",
    "content": "/**\n * Copyright (c) 2017-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n/* @flow strict-local */\n\nimport type { Realm } from \"../../realm.js\";\nimport { BooleanValue, ObjectValue, NullValue } from \"../../values/index.js\";\nimport { Call, Construct, IsCallable, IsConstructor } from \"../../methods/index.js\";\nimport { Create, Properties, To } from \"../../singletons.js\";\n\nexport default function(realm: Realm): ObjectValue {\n  let obj = new ObjectValue(realm, realm.intrinsics.ObjectPrototype, \"Reflect\");\n\n  // ECMA262 26.1.1\n  obj.defineNativeMethod(\"apply\", 3, (context, [target, thisArgument, argumentsList]) => {\n    // 1. If IsCallable(target) is false, throw a TypeError exception.\n    if (!IsCallable(realm, target)) {\n      throw realm.createErrorThrowCompletion(realm.intrinsics.TypeError);\n    }\n\n    // 2. Let args be ? CreateListFromArrayLike(argumentsList).\n    let args = Create.CreateListFromArrayLike(realm, argumentsList);\n\n    // TODO #1008 3. Perform PrepareForTailCall().\n\n    // 4. Return ? Call(target, thisArgument, args).\n    return Call(realm, target, thisArgument, args);\n  });\n\n  // ECMA262 26.1.2\n  obj.defineNativeMethod(\"construct\", 2, (context, [target, argumentsList, _newTarget]) => {\n    let newTarget = _newTarget;\n    // 1. If IsConstructor(target) is false, throw a TypeError exception.\n    if (!IsConstructor(realm, target)) {\n      throw realm.createErrorThrowCompletion(realm.intrinsics.TypeError);\n    }\n\n    // 2. If newTarget is not present, let newTarget be target.\n    if (!newTarget) {\n      newTarget = target;\n    } else if (!IsConstructor(realm, newTarget)) {\n      // 3. Else if IsConstructor(newTarget) is false, throw a TypeError exception.\n      throw realm.createErrorThrowCompletion(realm.intrinsics.TypeError);\n    }\n\n    // 4. Let args be ? CreateListFromArrayLike(argumentsList).\n    let args = Create.CreateListFromArrayLike(realm, argumentsList);\n\n    // 5. Return ? Construct(target, args, newTarget).\n    return Construct(realm, target, args, newTarget);\n  });\n\n  // ECMA262 26.1.3\n  obj.defineNativeMethod(\"defineProperty\", 3, (context, [_target, propertyKey, attributes]) => {\n    let target = _target.throwIfNotConcrete();\n\n    // 1. If Type(target) is not Object, throw a TypeError exception.\n    if (!(target instanceof ObjectValue)) {\n      throw realm.createErrorThrowCompletion(realm.intrinsics.TypeError);\n    }\n\n    // 2. Let key be ? ToPropertyKey(propertyKey).\n    let key = To.ToPropertyKey(realm, propertyKey);\n\n    // 3. Let desc be ? ToPropertyDescriptor(attributes).\n    let desc = To.ToPropertyDescriptor(realm, attributes);\n\n    // 4. Return ? target.[[DefineOwnProperty]](key, desc).\n    return new BooleanValue(realm, target.$DefineOwnProperty(key, desc));\n  });\n\n  // ECMA262 26.1.4\n  obj.defineNativeMethod(\"deleteProperty\", 2, (context, [_target, propertyKey]) => {\n    let target = _target.throwIfNotConcrete();\n\n    // 1. If Type(target) is not Object, throw a TypeError exception.\n    if (!(target instanceof ObjectValue)) {\n      throw realm.createErrorThrowCompletion(realm.intrinsics.TypeError);\n    }\n\n    // 2. Let key be ? ToPropertyKey(propertyKey).\n    let key = To.ToPropertyKey(realm, propertyKey);\n\n    // 3. Return ? target.[[Delete]](key).\n    return new BooleanValue(realm, target.$Delete(key));\n  });\n\n  // ECMA262 26.1.5\n  obj.defineNativeMethod(\"get\", 2, (context, [_target, propertyKey, _receiver]) => {\n    let receiver = _receiver;\n    let target = _target.throwIfNotConcrete();\n\n    // 1. If Type(target) is not Object, throw a TypeError exception.\n    if (!(target instanceof ObjectValue)) {\n      throw realm.createErrorThrowCompletion(realm.intrinsics.TypeError);\n    }\n\n    // 2. Let key be ? ToPropertyKey(propertyKey).\n    let key = To.ToPropertyKey(realm, propertyKey);\n\n    // 3. If receiver is not present, then\n    if (!receiver) {\n      // a. Let receiver be target.\n      receiver = target;\n    }\n\n    // 4. Return ? target.[[Get]](key, receiver).\n    return target.$Get(key, receiver);\n  });\n\n  // ECMA262 26.1.6\n  obj.defineNativeMethod(\"getOwnPropertyDescriptor\", 2, (context, [_target, propertyKey]) => {\n    let target = _target.throwIfNotConcrete();\n\n    // 1. If Type(target) is not Object, throw a TypeError exception.\n    if (!(target instanceof ObjectValue)) {\n      throw realm.createErrorThrowCompletion(realm.intrinsics.TypeError);\n    }\n\n    // 2. Let key be ? ToPropertyKey(propertyKey).\n    let key = To.ToPropertyKey(realm, propertyKey);\n\n    // 3. Let desc be ? target.[[GetOwnProperty]](key).\n    let desc = target.$GetOwnProperty(key);\n\n    // 4. Return FromPropertyDescriptor(desc).\n    return Properties.FromPropertyDescriptor(realm, desc);\n  });\n\n  // ECMA262 26.1.7\n  obj.defineNativeMethod(\"getPrototypeOf\", 1, (context, [_target]) => {\n    let target = _target.throwIfNotConcrete();\n\n    // 1. If Type(target) is not Object, throw a TypeError exception.\n    if (!(target instanceof ObjectValue)) {\n      throw realm.createErrorThrowCompletion(realm.intrinsics.TypeError);\n    }\n\n    // 2. Return ? target.[[GetPrototypeOf]]().\n    return target.$GetPrototypeOf();\n  });\n\n  // ECMA262 26.1.8\n  obj.defineNativeMethod(\"has\", 2, (context, [target, propertyKey]) => {\n    // 1. If Type(target) is not Object, throw a TypeError exception.\n    if (target.mightNotBeObject()) {\n      if (target.mightBeObject()) target.throwIfNotConcrete();\n      throw realm.createErrorThrowCompletion(realm.intrinsics.TypeError);\n    }\n\n    // 2. Let key be ? ToPropertyKey(propertyKey).\n    let key = To.ToPropertyKey(realm, propertyKey);\n\n    // 3. Return ? target.[[HasProperty]](key).\n    return new BooleanValue(realm, target.$HasProperty(key));\n  });\n\n  // ECMA262 26.1.9\n  obj.defineNativeMethod(\"isExtensible\", 1, (context, [_target]) => {\n    let target = _target.throwIfNotConcrete();\n\n    // 1. If Type(target) is not Object, throw a TypeError exception.\n    if (!(target instanceof ObjectValue)) {\n      throw realm.createErrorThrowCompletion(realm.intrinsics.TypeError);\n    }\n\n    // 2. Return ? target.[[IsExtensible]]().\n    return new BooleanValue(realm, target.$IsExtensible());\n  });\n\n  // ECMA262 26.1.10\n  obj.defineNativeMethod(\"ownKeys\", 1, (context, [_target]) => {\n    let target = _target.throwIfNotConcrete();\n\n    // 1. If Type(target) is not Object, throw a TypeError exception.\n    if (!(target instanceof ObjectValue)) {\n      throw realm.createErrorThrowCompletion(realm.intrinsics.TypeError);\n    }\n\n    // 2. Let keys be ? target.[[OwnPropertyKeys]]().\n    let keys = target.$OwnPropertyKeys();\n\n    // 3. Return CreateArrayFromList(keys).\n    return Create.CreateArrayFromList(realm, keys);\n  });\n\n  // ECMA262 26.1.11\n  obj.defineNativeMethod(\"preventExtensions\", 1, (context, [_target]) => {\n    let target = _target.throwIfNotConcrete();\n\n    // 1. If Type(target) is not Object, throw a TypeError exception.\n    if (!(target instanceof ObjectValue)) {\n      throw realm.createErrorThrowCompletion(realm.intrinsics.TypeError);\n    }\n\n    // 2. Return ? target.[[PreventExtensions]]().\n    return new BooleanValue(realm, target.$PreventExtensions());\n  });\n\n  // ECMA262 26.1.12\n  obj.defineNativeMethod(\"set\", 3, (context, [_target, propertyKey, V, _receiver]) => {\n    let receiver = _receiver;\n    let target = _target.throwIfNotConcrete();\n\n    // 1. If Type(target) is not Object, throw a TypeError exception.\n    if (!(target instanceof ObjectValue)) {\n      throw realm.createErrorThrowCompletion(realm.intrinsics.TypeError);\n    }\n\n    // 2. Let key be ? ToPropertyKey(propertyKey).\n    let key = To.ToPropertyKey(realm, propertyKey);\n\n    // 3. If receiver is not present, then\n    if (!receiver) {\n      // a. Let receiver be target.\n      receiver = target;\n    }\n\n    // 5. Return ? target.[[Set]](key, V, receiver).\n    return new BooleanValue(realm, target.$Set(key, V, receiver));\n  });\n\n  // ECMA262 26.1.13\n  obj.defineNativeMethod(\"setPrototypeOf\", 2, (context, [_target, _proto]) => {\n    let target = _target.throwIfNotConcrete();\n    let proto = _proto.throwIfNotConcrete();\n\n    // 1. If Type(target) is not Object, throw a TypeError exception.\n    if (!(target instanceof ObjectValue)) {\n      throw realm.createErrorThrowCompletion(realm.intrinsics.TypeError);\n    }\n\n    // 2. If Type(proto) is not Object and proto is not null, throw a TypeError exception.\n    if (!(proto instanceof ObjectValue) && !(proto instanceof NullValue)) {\n      throw realm.createErrorThrowCompletion(realm.intrinsics.TypeError);\n    }\n\n    // 3. Return ? target.[[SetPrototypeOf]](proto).\n    return new BooleanValue(realm, target.$SetPrototypeOf(proto));\n  });\n\n  return obj;\n}\n"
  },
  {
    "path": "src/intrinsics/ecma262/RegExp.js",
    "content": "/**\n * Copyright (c) 2017-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n/* @flow strict-local */\n\nimport type { Realm } from \"../../realm.js\";\nimport { StringValue, NativeFunctionValue, UndefinedValue, ObjectValue } from \"../../values/index.js\";\nimport { IsRegExp } from \"../../methods/is.js\";\nimport { Get } from \"../../methods/get.js\";\nimport { SameValuePartial } from \"../../methods/abstract.js\";\nimport { RegExpAlloc, RegExpInitialize } from \"../../methods/regexp.js\";\nimport invariant from \"../../invariant.js\";\n\nexport default function(realm: Realm): NativeFunctionValue {\n  let func = new NativeFunctionValue(realm, \"RegExp\", \"RegExp\", 2, (context, [pattern, flags], argCount, NewTarget) => {\n    // 1. Let patternIsRegExp be ? IsRegExp(pattern).\n    let patternIsRegExp = IsRegExp(realm, pattern);\n    let newTarget;\n    // 2. If NewTarget is not undefined, let newTarget be NewTarget.\n    if (NewTarget) {\n      newTarget = NewTarget;\n    } else {\n      // 3. Else,\n      // a. Let newTarget be the active function object.\n      newTarget = func;\n\n      // b. If patternIsRegExp is true and flags is undefined, then\n      if (patternIsRegExp && flags instanceof UndefinedValue) {\n        invariant(pattern instanceof ObjectValue);\n        // i. Let patternConstructor be ? Get(pattern, \"constructor\").\n        let patternConstructor = Get(realm, pattern, \"constructor\");\n\n        // ii. If SameValue(newTarget, patternConstructor) is true, return pattern.\n        if (SameValuePartial(realm, newTarget, patternConstructor)) {\n          return pattern;\n        }\n      }\n    }\n\n    let P, F;\n    // 4. If Type(pattern) is Object and pattern has a [[RegExpMatcher]] internal slot, then\n    if (pattern instanceof ObjectValue && pattern.$RegExpMatcher) {\n      // a. Let P be the value of pattern's [[OriginalSource]] internal slot.\n      invariant(typeof pattern.$OriginalSource === \"string\");\n      P = new StringValue(realm, pattern.$OriginalSource);\n\n      // b. If flags is undefined, let F be the value of pattern's [[OriginalFlags]] internal slot.\n      if (flags instanceof UndefinedValue) {\n        invariant(typeof pattern.$OriginalFlags === \"string\");\n        F = new StringValue(realm, pattern.$OriginalFlags);\n      } else {\n        // c. Else, let F be flags.\n        F = flags.throwIfNotConcrete();\n      }\n    } else if (patternIsRegExp) {\n      // 5. Else if patternIsRegExp is true, then\n      invariant(pattern instanceof ObjectValue);\n      // a. Let P be ? Get(pattern, \"source\").\n      P = Get(realm, pattern, \"source\");\n\n      // b. If flags is undefined, then\n      if (flags instanceof UndefinedValue) {\n        // i. Let F be ? Get(pattern, \"flags\").\n        F = Get(realm, pattern, \"flags\");\n      } else {\n        // c. Else, let F be flags.\n        F = flags.throwIfNotConcrete();\n      }\n    } else {\n      // 6. Else,\n      // a. Let P be pattern.\n      P = pattern.throwIfNotConcrete();\n      // b. Let F be flags.\n      F = flags.throwIfNotConcrete();\n    }\n\n    // 7. Let O be ? RegExpAlloc(newTarget).\n    let O = RegExpAlloc(realm, newTarget);\n\n    // 8. Return ? RegExpInitialize(O, P, F).\n    return RegExpInitialize(realm, O, P, F);\n  });\n\n  // ECMA262 21.2.4.2\n  func.defineNativeGetter(realm.intrinsics.SymbolSpecies, context => {\n    // 1. Return the this value\n    return context;\n  });\n\n  return func;\n}\n"
  },
  {
    "path": "src/intrinsics/ecma262/RegExpPrototype.js",
    "content": "/**\n * Copyright (c) 2017-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n/* @flow strict-local */\n\nimport type { Realm } from \"../../realm.js\";\nimport invariant from \"../../invariant.js\";\nimport {\n  BooleanValue,\n  StringValue,\n  ObjectValue,\n  NullValue,\n  NumberValue,\n  UndefinedValue,\n  Value,\n} from \"../../values/index.js\";\nimport { SameValue } from \"../../methods/abstract.js\";\nimport { Call } from \"../../methods/call.js\";\nimport { Construct, SpeciesConstructor } from \"../../methods/construct.js\";\nimport { Get, GetSubstitution } from \"../../methods/get.js\";\nimport { Create, Properties, To } from \"../../singletons.js\";\nimport { IsCallable } from \"../../methods/is.js\";\nimport { RegExpBuiltinExec, RegExpExec, EscapeRegExpPattern, AdvanceStringIndex } from \"../../methods/regexp.js\";\n\nfunction InternalHasFlag(realm: Realm, context: Value, flag: string): Value {\n  // 1. Let R be the this value.\n  let R = context.throwIfNotConcrete();\n\n  // 2. If Type(R) is not Object, throw a TypeError exception.\n  if (!(R instanceof ObjectValue)) {\n    throw realm.createErrorThrowCompletion(realm.intrinsics.TypeError, \"Type(R) is not an object\");\n  }\n\n  // 3. If R does not have an [[OriginalFlags]] internal slot, throw a TypeError exception.\n  if (typeof R.$OriginalFlags !== \"string\") {\n    // a. If SameValue(R, %RegExpPrototype%) is true, return undefined.\n    if (SameValue(realm, R, realm.intrinsics.RegExpPrototype)) {\n      return realm.intrinsics.undefined;\n    } else {\n      // b. Otherwise, throw a TypeError exception.\n      throw realm.createErrorThrowCompletion(\n        realm.intrinsics.TypeError,\n        \"R does not have an [[OriginalFlags]] internal slot\"\n      );\n    }\n  }\n\n  // 4. Let flags be the value of R's [[OriginalFlags]] internal slot.\n  let flags = R.$OriginalFlags;\n\n  // 5. If flags contains the code unit \"g\", return true.\n  if (flags.indexOf(flag) >= 0) {\n    return realm.intrinsics.true;\n  }\n\n  // 6. Return false.\n  return realm.intrinsics.false;\n}\n\nexport default function(realm: Realm, obj: ObjectValue): void {\n  // ECMA262 21.2.5.2\n  obj.defineNativeMethod(\"exec\", 1, (context, [string]) => {\n    // 1. Let R be the this value.\n    let R = context.throwIfNotConcrete();\n\n    // 2. If Type(R) is not Object, throw a TypeError exception.\n    if (!(R instanceof ObjectValue)) {\n      throw realm.createErrorThrowCompletion(realm.intrinsics.TypeError, \"Type(R) is not an object\");\n    }\n\n    // 3. If R does not have a [[RegExpMatcher]] internal slot, throw a TypeError exception.\n    if (R.$RegExpMatcher === undefined) {\n      throw realm.createErrorThrowCompletion(\n        realm.intrinsics.TypeError,\n        \"R does not have a [[RegExpMatcher]] internal slot\"\n      );\n    }\n\n    // 4. Let S be ? ToString(string).\n    let S = To.ToStringPartial(realm, string);\n\n    // 5. Return ? RegExpBuiltinExec(R, S).\n    return RegExpBuiltinExec(realm, R, S);\n  });\n\n  // ECMA262 21.2.5.3\n  obj.defineNativeGetter(\"flags\", context => {\n    // 1. Let R be the this value.\n    let R = context.throwIfNotConcrete();\n\n    // 2. If Type(R) is not Object, throw a TypeError exception.\n    if (!(R instanceof ObjectValue)) {\n      throw realm.createErrorThrowCompletion(realm.intrinsics.TypeError, \"Type(R) is not an object\");\n    }\n\n    // 3. Let result be the empty String.\n    let result = \"\";\n\n    // 4. Let global be ToBoolean(? Get(R, \"global\")).\n    let global = To.ToBooleanPartial(realm, Get(realm, R, \"global\"));\n\n    // 5. If global is true, append \"g\" as the last code unit of result.\n    if (global) result += \"g\";\n\n    // 6. Let ignoreCase be ToBoolean(? Get(R, \"ignoreCase\")).\n    let ignoreCase = To.ToBooleanPartial(realm, Get(realm, R, \"ignoreCase\"));\n\n    // 7. If ignoreCase is true, append \"i\" as the last code unit of result.\n    if (ignoreCase) result += \"i\";\n\n    // 8. Let multiline be ToBoolean(? Get(R, \"multiline\")).\n    let multiline = To.ToBooleanPartial(realm, Get(realm, R, \"multiline\"));\n\n    // 9. If multiline is true, append \"m\" as the last code unit of result.\n    if (multiline) result += \"m\";\n\n    // 10. Let unicode be ToBoolean(? Get(R, \"unicode\")).\n    let unicode = To.ToBooleanPartial(realm, Get(realm, R, \"unicode\"));\n\n    // 11. If unicode is true, append \"u\" as the last code unit of result.\n    if (unicode) result += \"u\";\n\n    // 12. Let sticky be ToBoolean(? Get(R, \"sticky\")).\n    let sticky = To.ToBooleanPartial(realm, Get(realm, R, \"sticky\"));\n\n    // 13. If sticky is true, append \"y\" as the last code unit of result.\n    if (sticky) result += \"y\";\n\n    // 14. Return result.\n    return new StringValue(realm, result);\n  });\n\n  // ECMA262 21.2.5.4\n  obj.defineNativeGetter(\"global\", context => {\n    return InternalHasFlag(realm, context, \"g\");\n  });\n\n  // ECMA262 21.2.5.5\n  obj.defineNativeGetter(\"ignoreCase\", context => {\n    return InternalHasFlag(realm, context, \"i\");\n  });\n\n  // ECMA262 21.2.5.6\n  obj.defineNativeMethod(realm.intrinsics.SymbolMatch, 1, (context, [string]) => {\n    // 1. Let rx be the this value.\n    let rx = context.throwIfNotConcrete();\n\n    // 2. If Type(rx) is not Object, throw a TypeError exception.\n    if (!(rx instanceof ObjectValue)) {\n      throw realm.createErrorThrowCompletion(realm.intrinsics.TypeError, \"Type(R) is not an object\");\n    }\n\n    // 3. Let S be ? ToString(string).\n    let S = To.ToStringPartial(realm, string);\n\n    // 4. Let global be ToBoolean(? Get(rx, \"global\")).\n    let global = To.ToBooleanPartial(realm, Get(realm, rx, \"global\"));\n\n    // 5. If global is false, then\n    if (global === false) {\n      // a. Return ? RegExpExec(rx, S).\n      return RegExpExec(realm, rx, S);\n    } else {\n      // 6. Else global is true,\n      // a. Let fullUnicode be ToBoolean(? Get(rx, \"unicode\")).\n      let fullUnicode = To.ToBooleanPartial(realm, Get(realm, rx, \"unicode\"));\n\n      // b. Perform ? Set(rx, \"lastIndex\", 0, true).\n      Properties.Set(realm, rx, \"lastIndex\", realm.intrinsics.zero, true);\n\n      // c. Let A be ArrayCreate(0).\n      let A = Create.ArrayCreate(realm, 0);\n\n      // d. Let n be 0.\n      let n = 0;\n\n      // e. Repeat,\n      while (true) {\n        // i. Let result be ? RegExpExec(rx, S).\n        let result = RegExpExec(realm, rx, S);\n\n        // ii. If result is null, then\n        if (result instanceof NullValue) {\n          // 1. If n=0, return null.\n          if (n === 0) {\n            return realm.intrinsics.null;\n          } else {\n            // 2. Else, return A.\n            return A;\n          }\n        } else {\n          // iii. Else result is not null,\n          // 1. Let matchStr be ? ToString(? Get(result, \"0\")).\n          let matchStr = To.ToStringPartial(realm, Get(realm, result, \"0\"));\n\n          // 2. Let status be CreateDataProperty(A, ! ToString(n), matchStr).\n          let status = Create.CreateDataProperty(\n            realm,\n            A,\n            To.ToString(realm, new NumberValue(realm, n)),\n            new StringValue(realm, matchStr)\n          );\n\n          // 3. Assert: status is true.\n          invariant(status === true, \"status is true\");\n\n          // 4. If matchStr is the empty String, then\n          if (matchStr === \"\") {\n            // a. Let thisIndex be ? ToLength(? Get(rx, \"lastIndex\")).\n            let thisIndex = To.ToLength(realm, Get(realm, rx, \"lastIndex\"));\n\n            // b. Let nextIndex be AdvanceStringIndex(S, thisIndex, fullUnicode).\n            let nextIndex = AdvanceStringIndex(realm, S, thisIndex, fullUnicode);\n\n            // c .Perform ? Set(rx, \"lastIndex\", nextIndex, true).\n            Properties.Set(realm, rx, \"lastIndex\", new NumberValue(realm, nextIndex), true);\n          }\n\n          // 5. Increment n.\n          n += 1;\n        }\n      }\n\n      invariant(false);\n    }\n  });\n\n  // ECMA262 21.2.5.7\n  obj.defineNativeGetter(\"multiline\", context => {\n    return InternalHasFlag(realm, context, \"m\");\n  });\n\n  // ECMA262 21.2.5.8\n  obj.defineNativeMethod(realm.intrinsics.SymbolReplace, 2, (context, [string, _replaceValue]) => {\n    let replaceValue = _replaceValue;\n    // 1. Let rx be the this value.\n    let rx = context.throwIfNotConcrete();\n\n    // 2. If Type(rx) is not Object, throw a TypeError exception.\n    if (!(rx instanceof ObjectValue)) {\n      throw realm.createErrorThrowCompletion(realm.intrinsics.TypeError, \"Type(R) is not an object\");\n    }\n\n    // 3. Let S be ? ToString(string).\n    let S = To.ToStringPartial(realm, string);\n\n    // 4. Let lengthS be the number of code unit elements in S.\n    let lengthS = S.length;\n\n    // 5. Let functionalReplace be IsCallable(replaceValue).\n    let functionalReplace = IsCallable(realm, replaceValue);\n\n    // 6. If functionalReplace is false, then\n    if (functionalReplace === false) {\n      // a. Let replaceValue be ? ToString(replaceValue).\n      replaceValue = new StringValue(realm, To.ToStringPartial(realm, replaceValue));\n    }\n\n    // 7. Let global be ToBoolean(? Get(rx, \"global\")).\n    let global = To.ToBooleanPartial(realm, Get(realm, rx, \"global\"));\n\n    let fullUnicode;\n    // 8. If global is true, then\n    if (global === true) {\n      // a. Let fullUnicode be ToBoolean(? Get(rx, \"unicode\")).\n      fullUnicode = To.ToBooleanPartial(realm, Get(realm, rx, \"unicode\"));\n\n      // b. Perform ? Set(rx, \"lastIndex\", 0, true).\n      Properties.Set(realm, rx, \"lastIndex\", realm.intrinsics.zero, true);\n    }\n\n    // 9. Let results be a new empty List.\n    let results = [];\n\n    // 10. Let done be false.\n    let done = false;\n\n    // 11. Repeat, while done is false\n    while (done === false) {\n      // a. Let result be ? RegExpExec(rx, S).\n      let result = RegExpExec(realm, rx, S);\n\n      // b. If result is null, set done to true.\n      if (result instanceof NullValue) {\n        done = true;\n      } else {\n        // c. Else result is not null,\n        // i. Append result to the end of results.\n        results.push(result);\n\n        // ii. If global is false, set done to true.\n        if (global === false) {\n          done = true;\n        } else {\n          // iii. Else,\n          invariant(fullUnicode !== undefined);\n\n          // 1. Let matchStr be ? ToString(? Get(result, \"0\")).\n          let matchStr = To.ToStringPartial(realm, Get(realm, result, \"0\"));\n\n          // 2. If matchStr is the empty String, then\n          if (matchStr === \"\") {\n            // a. Let thisIndex be ? ToLength(? Get(rx, \"lastIndex\")).\n            let thisIndex = To.ToLength(realm, Get(realm, rx, \"lastIndex\"));\n\n            // b. Let nextIndex be AdvanceStringIndex(S, thisIndex, fullUnicode).\n            let nextIndex = AdvanceStringIndex(realm, S, thisIndex, fullUnicode);\n\n            // c. Perform ? Set(rx, \"lastIndex\", nextIndex, true).\n            Properties.Set(realm, rx, \"lastIndex\", new NumberValue(realm, nextIndex), true);\n          }\n        }\n      }\n    }\n\n    // 12. Let accumulatedResult be the empty String value.\n    let accumulatedResult = \"\";\n\n    // 13. Let nextSourcePosition be 0.\n    let nextSourcePosition = 0;\n\n    // 14. Repeat, for each result in results,\n    for (let result of results) {\n      // a. Let nCaptures be ? ToLength(? Get(result, \"length\")).\n      let nCaptures = To.ToLength(realm, Get(realm, result, \"length\"));\n\n      // b. Let nCaptures be max(nCaptures - 1, 0).\n      nCaptures = Math.max(nCaptures - 1, 0);\n\n      // c. Let matched be ? ToString(? Get(result, \"0\")).\n      let matched = To.ToStringPartial(realm, Get(realm, result, \"0\"));\n\n      // d. Let matchLength be the number of code units in matched.\n      let matchLength = matched.length;\n\n      // e. Let position be ? ToInteger(? Get(result, \"index\")).\n      let position = To.ToInteger(realm, Get(realm, result, \"index\"));\n\n      // f. Let position be max(min(position, lengthS), 0).\n      position = Math.max(Math.min(position, lengthS), 0);\n\n      // g. Let n be 1.\n      let n = 1;\n\n      // h. Let captures be a new empty List.\n      let captures = [];\n\n      // i. Repeat while n ≤ nCaptures\n      while (n <= nCaptures) {\n        // i. Let capN be ? Get(result, ! ToString(n)).\n        let capN = Get(realm, result, To.ToString(realm, new NumberValue(realm, n)));\n\n        // ii. If capN is not undefined, then\n        if (!capN.mightBeUndefined()) {\n          // 1. Let capN be ? ToString(capN).\n          capN = To.ToStringPartial(realm, capN);\n        } else {\n          capN.throwIfNotConcrete();\n          capN = undefined;\n        }\n\n        // iii. Append capN as the last element of captures.\n        captures.push(capN);\n\n        // iv. Let n be n+1.\n        n = n + 1;\n      }\n\n      let replacement;\n      // j. If functionalReplace is true, then\n      if (functionalReplace) {\n        // i. Let replacerArgs be « matched ».\n        let replacerArgs = [new StringValue(realm, matched)];\n\n        // ii. Append in list order the elements of captures to the end of the List replacerArgs.\n        for (let capture of captures) {\n          replacerArgs.push(capture === undefined ? realm.intrinsics.undefined : new StringValue(realm, capture));\n        }\n\n        // iii. Append position and S as the last two elements of replacerArgs.\n        replacerArgs = replacerArgs.concat([new NumberValue(realm, position), new StringValue(realm, S)]);\n\n        // iv. Let replValue be ? Call(replaceValue, undefined, replacerArgs).\n        let replValue = Call(realm, replaceValue, realm.intrinsics.undefined, replacerArgs);\n\n        // v. Let replacement be ? ToString(replValue).\n        replacement = To.ToStringPartial(realm, replValue);\n      } else {\n        // k. Else,\n        invariant(replaceValue instanceof StringValue);\n        // i. Let replacement be GetSubstitution(matched, S, position, captures, replaceValue).\n        replacement = GetSubstitution(realm, matched, S, position, captures, replaceValue.value);\n      }\n\n      // l. If position ≥ nextSourcePosition, then\n      if (position >= nextSourcePosition) {\n        // i. NOTE position should not normally move backwards. If it does, it is an indication of an ill-behaving RegExp subclass or use of an access triggered side-effect to change the global flag or other characteristics of rx. In such cases, the corresponding substitution is ignored.\n        // ii. Let accumulatedResult be the String formed by concatenating the code units of the current value of accumulatedResult with the substring of S consisting of the code units from nextSourcePosition (inclusive) up to position (exclusive) and with the code units of replacement.\n        accumulatedResult =\n          accumulatedResult + S.substr(nextSourcePosition, position - nextSourcePosition) + replacement;\n\n        // iii. Let nextSourcePosition be position + matchLength.\n        nextSourcePosition = position + matchLength;\n      }\n    }\n    // 15. If nextSourcePosition ≥ lengthS, return accumulatedResult.\n    if (nextSourcePosition >= lengthS) return new StringValue(realm, accumulatedResult);\n\n    // 16. Return the String formed by concatenating the code units of accumulatedResult with the substring of S consisting of the code units from nextSourcePosition (inclusive) up through the final code unit of S (inclusive).\n    return new StringValue(realm, accumulatedResult + S.substr(nextSourcePosition));\n  });\n\n  // ECMA262 21.2.5.9\n  obj.defineNativeMethod(realm.intrinsics.SymbolSearch, 1, (context, [string]) => {\n    // 1. Let rx be the this value.\n    let rx = context.throwIfNotConcrete();\n\n    // 2. If Type(rx) is not Object, throw a TypeError exception.\n    if (!(rx instanceof ObjectValue)) {\n      throw realm.createErrorThrowCompletion(realm.intrinsics.TypeError, \"Type(R) is not an object\");\n    }\n\n    // 3. Let S be ? ToString(string).\n    let S = To.ToStringPartial(realm, string);\n\n    // 4. Let previousLastIndex be ? Get(rx, \"lastIndex\").\n    let previousLastIndex = Get(realm, rx, \"lastIndex\");\n\n    // 5. Perform ? Set(rx, \"lastIndex\", 0, true).\n    Properties.Set(realm, rx, \"lastIndex\", realm.intrinsics.zero, true);\n\n    // 6. Let result be ? RegExpExec(rx, S).\n    let result = RegExpExec(realm, rx, S);\n\n    // 7. Perform ? Set(rx, \"lastIndex\", previousLastIndex, true).\n    Properties.Set(realm, rx, \"lastIndex\", previousLastIndex, true);\n\n    // 8. If result is null, return -1.\n    if (result instanceof NullValue) return new NumberValue(realm, -1);\n\n    // 9. Return ? Get(result, \"index\").\n    return Get(realm, result, \"index\");\n  });\n\n  // ECMA262 21.2.5.10\n  obj.defineNativeGetter(\"source\", context => {\n    // 1. Let R be the this value.\n    let R = context.throwIfNotConcrete();\n\n    // 2. If Type(R) is not Object, throw a TypeError exception.\n    if (!(R instanceof ObjectValue)) {\n      throw realm.createErrorThrowCompletion(realm.intrinsics.TypeError, \"Type(R) is not an object\");\n    }\n\n    // 3. If R does not have an [[OriginalSource]] internal slot, throw a TypeError exception.\n    if (typeof R.$OriginalSource !== \"string\") {\n      // a. If SameValue(R, %RegExpPrototype%) is true, return undefined.\n      if (SameValue(realm, R, realm.intrinsics.RegExpPrototype)) {\n        return new StringValue(realm, \"(?:)\");\n      } else {\n        // b. Otherwise, throw a TypeError exception.\n        throw realm.createErrorThrowCompletion(\n          realm.intrinsics.TypeError,\n          \"R does not have an [[OriginalSource]] internal slot\"\n        );\n      }\n    }\n\n    // 4. Assert: R has an [[OriginalFlags]] internal slot.\n    invariant(R.$OriginalFlags !== undefined, \"R has an [[OriginalFlags]] internal slot\");\n\n    // 5. Let src be R.[[OriginalSource]].\n    let src = R.$OriginalSource;\n    invariant(typeof src === \"string\");\n\n    // 6. Let flags be R.[[OriginalFlags]].\n    let flags = R.$OriginalFlags;\n    invariant(typeof flags === \"string\");\n\n    // 7. Return EscapeRegExpPattern(src, flags).\n    return new StringValue(realm, EscapeRegExpPattern(realm, src, flags));\n  });\n\n  // ECMA262 21.2.5.11\n  obj.defineNativeMethod(realm.intrinsics.SymbolSplit, 2, (context, [string, limit]) => {\n    // 1. Let rx be the this value.\n    let rx = context.throwIfNotConcrete();\n\n    // 2. If Type(rx) is not Object, throw a TypeError exception.\n    if (!(rx instanceof ObjectValue)) {\n      throw realm.createErrorThrowCompletion(realm.intrinsics.TypeError, \"Type(rx) is not an object\");\n    }\n\n    // 3. Let S be ? ToString(string).\n    let S = To.ToStringPartial(realm, string);\n\n    // 4. Let C be ? SpeciesConstructor(rx, %RegExp%).\n    let C = SpeciesConstructor(realm, rx, realm.intrinsics.RegExp);\n\n    // 5. Let flags be ? ToString(? Get(rx, \"flags\")).\n    let flags = To.ToStringPartial(realm, Get(realm, rx, \"flags\"));\n\n    let unicodeMatching;\n    // 6. If flags contains \"u\", let unicodeMatching be true.\n    if (flags.indexOf(\"u\") >= 0) {\n      unicodeMatching = true;\n    } else {\n      // 7. Else, let unicodeMatching be false.\n      unicodeMatching = false;\n    }\n\n    let newFlags;\n    // 8. If flags contains \"y\", let newFlags be flags.\n    if (flags.indexOf(\"y\") >= 0) {\n      newFlags = flags;\n    } else {\n      // 9. Else, let newFlags be the string that is the concatenation of flags and \"y\".\n      newFlags = flags + \"y\";\n    }\n\n    // 10. Let splitter be ? Construct(C, « rx, newFlags »).\n    let splitter = Construct(realm, C, [rx, new StringValue(realm, newFlags)]).throwIfNotConcreteObject();\n\n    // 11. Let A be ArrayCreate(0).\n    let A = Create.ArrayCreate(realm, 0);\n\n    // 12. Let lengthA be 0.\n    let lengthA = 0;\n\n    // 13. If limit is undefined, let lim be 2^32-1; else let lim be ? ToUint32(limit).\n    let lim = limit instanceof UndefinedValue ? Math.pow(2, 32) - 1 : To.ToUint32(realm, limit.throwIfNotConcrete());\n\n    // 14. Let size be the number of elements in S.\n    let size = S.length;\n\n    // 15. Let p be 0.\n    let p = 0;\n\n    // 16. If lim = 0, return A.\n    if (lim === 0) return A;\n\n    // 17. If size = 0, then\n    if (size === 0) {\n      // a. Let z be ? RegExpExec(splitter, S).\n      let z = RegExpExec(realm, splitter, S);\n\n      // b. If z is not null, return A.\n      if (!(z instanceof NullValue)) return A;\n\n      // c. Perform ! CreateDataProperty(A, \"0\", S).\n      Create.CreateDataProperty(realm, A, \"0\", new StringValue(realm, S));\n\n      // d Return A.\n      return A;\n    }\n\n    // 18. Let q be p.\n    let q = p;\n\n    // 19. Repeat, while q < size\n    while (q < size) {\n      // a. Perform ? Set(splitter, \"lastIndex\", q, true).\n      Properties.Set(realm, splitter, \"lastIndex\", new NumberValue(realm, q), true);\n\n      // b. Let z be ? RegExpExec(splitter, S).\n      let z = RegExpExec(realm, splitter, S);\n\n      // c. If z is null, let q be AdvanceStringIndex(S, q, unicodeMatching).\n      if (z instanceof NullValue) {\n        q = AdvanceStringIndex(realm, S, q, unicodeMatching);\n      } else {\n        // d. Else z is not null,\n        // i. Let e be ? ToLength(? Get(splitter, \"lastIndex\")).\n        let e = To.ToLength(realm, Get(realm, splitter, \"lastIndex\"));\n\n        // ii. Let e be min(e, size).\n        e = Math.min(e, size);\n\n        // iii. If e = p, let q be AdvanceStringIndex(S, q, unicodeMatching).\n        if (e === p) {\n          q = AdvanceStringIndex(realm, S, q, unicodeMatching);\n        } else {\n          // iv. Else e ≠ p,\n          // 1. Let T be a String value equal to the substring of S consisting of the elements at indices p (inclusive) through q (exclusive).\n          let T = S.substr(p, q - p);\n\n          // 2. Perform ! CreateDataProperty(A, ! ToString(lengthA), T).\n          Create.CreateDataProperty(\n            realm,\n            A,\n            To.ToString(realm, new NumberValue(realm, lengthA)),\n            new StringValue(realm, T)\n          );\n\n          // 3. Let lengthA be lengthA + 1.\n          lengthA = lengthA + 1;\n\n          // 4. If lengthA = lim, return A.\n          if (lengthA === lim) return A;\n\n          // 5. Let p be e.\n          p = e;\n\n          // 6. Let numberOfCaptures be ? ToLength(? Get(z, \"length\")).\n          let numberOfCaptures = To.ToLength(realm, Get(realm, z, \"length\"));\n\n          // 7. Let numberOfCaptures be max(numberOfCaptures-1, 0).\n          numberOfCaptures = Math.max(numberOfCaptures - 1, 0);\n\n          // 8. Let i be 1.\n          let i = 1;\n\n          // 9. Repeat, while i ≤ numberOfCaptures,\n          while (i <= numberOfCaptures) {\n            // a. Let nextCapture be ? Get(z, ! ToString(i)).\n            let nextCapture = Get(realm, z, To.ToString(realm, new NumberValue(realm, i)));\n\n            // b. Perform ! CreateDataProperty(A, ! ToString(lengthA), nextCapture).\n            Create.CreateDataProperty(realm, A, To.ToString(realm, new NumberValue(realm, lengthA)), nextCapture);\n\n            // c. Let i be i + 1.\n            i = i + 1;\n\n            // d. Let lengthA be lengthA + 1.\n            lengthA = lengthA + 1;\n\n            // e. If lengthA = lim, return A.\n            if (lengthA === lim) return A;\n          }\n\n          // 10. Let q be p.\n          q = p;\n        }\n      }\n    }\n\n    // 20. Let T be a String value equal to the substring of S consisting of the elements at indices p (inclusive) through size (exclusive).\n    let T = S.substr(p, size - p);\n\n    // 21. Perform ! CreateDataProperty(A, ! ToString(lengthA), T).\n    Create.CreateDataProperty(realm, A, To.ToString(realm, new NumberValue(realm, lengthA)), new StringValue(realm, T));\n\n    // 22. Return A.\n    return A;\n  });\n\n  // ECMA262 21.2.5.12\n  obj.defineNativeGetter(\"sticky\", context => {\n    return InternalHasFlag(realm, context, \"y\");\n  });\n\n  // ECMA262 21.2.5.13\n  obj.defineNativeMethod(\"test\", 1, (context, [S]) => {\n    // 1. Let R be the this value.\n    let R = context.throwIfNotConcrete();\n\n    // 2. If Type(R) is not Object, throw a TypeError exception.\n    if (!(R instanceof ObjectValue)) {\n      throw realm.createErrorThrowCompletion(realm.intrinsics.TypeError, \"Type(R) is not an object\");\n    }\n\n    // 3. Let string be ? ToString(S).\n    let string = To.ToStringPartial(realm, S);\n\n    // 4. Let match be ? RegExpExec(R, string).\n    let match = RegExpExec(realm, R, string);\n\n    // 5. If match is not null, return true; else return false.\n    return new BooleanValue(realm, !(match instanceof NullValue) ? true : false);\n  });\n\n  // ECMA262 21.2.5.14\n  obj.defineNativeMethod(\"toString\", 0, context => {\n    // 1. Let R be the this value.\n    let R = context.throwIfNotConcrete();\n\n    // 2. If Type(R) is not Object, throw a TypeError exception.\n    if (!(R instanceof ObjectValue)) {\n      throw realm.createErrorThrowCompletion(realm.intrinsics.TypeError, \"Type(R) is not an object\");\n    }\n\n    // 3. Let pattern be ? ToString(? Get(R, \"source\")).\n    let pattern = To.ToStringPartial(realm, Get(realm, R, \"source\"));\n\n    // 4. Let flags be ? ToString(? Get(R, \"flags\")).\n    let flags = To.ToStringPartial(realm, Get(realm, R, \"flags\"));\n\n    // 5. Let result be the String value formed by concatenating \"/\", pattern, \"/\", and flags.\n    let result = \"/\" + pattern + \"/\" + flags;\n\n    // 6. Return result.\n    return new StringValue(realm, result);\n  });\n\n  // ECMA262 21.2.5.15\n  obj.defineNativeGetter(\"unicode\", context => {\n    return InternalHasFlag(realm, context, \"u\");\n  });\n}\n"
  },
  {
    "path": "src/intrinsics/ecma262/Set.js",
    "content": "/**\n * Copyright (c) 2017-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n/* @flow strict-local */\n\nimport type { Realm } from \"../../realm.js\";\nimport { NativeFunctionValue, NullValue, UndefinedValue } from \"../../values/index.js\";\nimport { AbruptCompletion } from \"../../completions.js\";\nimport {\n  IsCallable,\n  Call,\n  GetIterator,\n  IteratorStep,\n  IteratorValue,\n  IteratorClose,\n  Get,\n  HasSomeCompatibleType,\n} from \"../../methods/index.js\";\nimport { Create } from \"../../singletons.js\";\nimport invariant from \"../../invariant.js\";\nimport { CompilerDiagnostic } from \"../../errors.js\";\n\nexport default function(realm: Realm): NativeFunctionValue {\n  // ECMA262 23.2.1.1\n  let func = new NativeFunctionValue(realm, \"Set\", \"Set\", 0, (context, [_iterable], argCount, NewTarget) => {\n    let iterable = _iterable;\n    // 1. If NewTarget is undefined, throw a TypeError exception.\n    if (!NewTarget) {\n      throw realm.createErrorThrowCompletion(realm.intrinsics.TypeError);\n    }\n\n    // 2. Let set be ? OrdinaryCreateFromConstructor(NewTarget, \"%SetPrototype%\", « [[SetData]] »).\n    let set = Create.OrdinaryCreateFromConstructor(realm, NewTarget, \"SetPrototype\", {\n      $SetData: undefined,\n    });\n\n    // 3. Set set's [[SetData]] internal slot to a new empty List.\n    set.$SetData = [];\n\n    // 4. If iterable is not present, let iterable be undefined.\n    if (iterable && realm.isCompatibleWith(realm.MOBILE_JSC_VERSION)) {\n      let loc = realm.currentLocation;\n      let error = new CompilerDiagnostic(\n        \"This version of JSC ignores the argument to Set, require the polyfill before doing this\",\n        loc,\n        \"PP0001\",\n        \"RecoverableError\"\n      );\n      realm.handleError(error);\n    }\n    if (!iterable) iterable = realm.intrinsics.undefined;\n\n    // 5. If iterable is either undefined or null, let iter be undefined.\n    let iter, adder;\n    if (HasSomeCompatibleType(iterable, UndefinedValue, NullValue)) {\n      adder = realm.intrinsics.undefined;\n      iter = realm.intrinsics.undefined;\n    } else {\n      // 6. Else,\n      // a. Let adder be ? Get(set, \"add\").\n      adder = Get(realm, set, \"add\");\n\n      // b. If IsCallable(adder) is false, throw a TypeError exception.\n      if (!IsCallable(realm, adder)) {\n        throw realm.createErrorThrowCompletion(realm.intrinsics.TypeError);\n      }\n\n      // c. Let iter be ? GetIterator(iterable).\n      iter = GetIterator(realm, iterable);\n    }\n\n    // 7. If iter is undefined, return set.\n    if (iter instanceof UndefinedValue) {\n      return set;\n    }\n\n    // 8. Repeat\n    while (true) {\n      // a. Let next be ? IteratorStep(iter).\n      let next = IteratorStep(realm, iter);\n\n      // b. If next is false, return set.\n      if (!next) return set;\n\n      // c. Let nextValue be ? IteratorValue(next).\n      let nextValue = IteratorValue(realm, next);\n\n      // d. Let status be Call(adder, set, « nextValue.[[Value]] »).\n      try {\n        Call(realm, adder, set, [nextValue]);\n      } catch (status) {\n        if (status instanceof AbruptCompletion) {\n          // e. If status is an abrupt completion, return ? IteratorClose(iter, status).\n          throw IteratorClose(realm, iter, status);\n        } else throw status;\n      }\n    }\n\n    invariant(false);\n  });\n\n  // ECMA262 23.2.2.2\n  func.defineNativeGetter(realm.intrinsics.SymbolSpecies, context => {\n    // 1. Return the this value\n    return context;\n  });\n\n  return func;\n}\n"
  },
  {
    "path": "src/intrinsics/ecma262/SetIteratorPrototype.js",
    "content": "/**\n * Copyright (c) 2017-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n/* @flow strict-local */\n\nimport type { Realm } from \"../../realm.js\";\nimport { StringValue, ObjectValue, UndefinedValue } from \"../../values/index.js\";\nimport { Create } from \"../../singletons.js\";\nimport invariant from \"../../invariant.js\";\n\nexport default function(realm: Realm, obj: ObjectValue): void {\n  // ECMA262 23.2.5.2.1\n  obj.defineNativeMethod(\"next\", 0, context => {\n    // 1. Let O be the this value.\n    let O = context.throwIfNotConcrete();\n\n    // 2. If Type(O) is not Object, throw a TypeError exception.\n    if (!(O instanceof ObjectValue)) {\n      throw realm.createErrorThrowCompletion(realm.intrinsics.TypeError, \"not an object\");\n    }\n\n    // 3. If O does not have all of the internal slots of a Set Iterator Instance (23.2.5.3), throw a TypeError exception.\n    if (!(\"$IteratedSet\" in O) || !(\"$SetNextIndex\" in O) || !(\"$SetIterationKind\" in O)) {\n      throw realm.createErrorThrowCompletion(realm.intrinsics.TypeError, \"SetIteratorPrototype.next isn't generic\");\n    }\n\n    // 4. Let s be O.[[IteratedSet]].\n    let s = O.$IteratedSet;\n\n    // 5. Let index be O.[[SetNextIndex]].\n    let index = O.$SetNextIndex;\n    invariant(typeof index === \"number\");\n\n    // 6. Let itemKind be O.[[SetIterationKind]].\n    let itemKind = O.$SetIterationKind;\n\n    // 7. If s is undefined, return CreateIterResultObject(undefined, true).\n    if (!s || s instanceof UndefinedValue)\n      return Create.CreateIterResultObject(realm, realm.intrinsics.undefined, true);\n    invariant(s instanceof ObjectValue);\n\n    // 8. Assert: s has a [[SetData]] internal slot.\n    invariant(s.$SetData, \"s has a [[SetData]] internal slot\");\n\n    // 9. Let entries be the List that is s.[[SetData]].\n    let entries = s.$SetData;\n    invariant(entries);\n\n    // 10. Repeat while index is less than the total number of elements of entries. The number of elements must be redetermined each time this method is evaluated.\n    while (index < entries.length) {\n      // a. Let e be entries[index].\n      let e = entries[index];\n\n      // b. Set index to index+1.\n      index = index + 1;\n\n      // c. Set O.[[SetNextIndex]] to index.\n      O.$SetNextIndex = index;\n\n      // d. If e is not empty, then\n      if (e) {\n        // i. If itemKind is \"key+value\", then\n        if (itemKind === \"key+value\") {\n          // 1. Return CreateIterResultObject(CreateArrayFromList(« e, e »), false).\n          return Create.CreateIterResultObject(realm, Create.CreateArrayFromList(realm, [e, e]), false);\n        }\n        // ii. Return CreateIterResultObject(e, false).\n        return Create.CreateIterResultObject(realm, e, false);\n      }\n    }\n\n    // 11. Set O.[[IteratedSet]] to undefined.\n    O.$IteratedSet = realm.intrinsics.undefined;\n\n    // 12. Return CreateIterResultObject(undefined, true).\n    return Create.CreateIterResultObject(realm, realm.intrinsics.undefined, true);\n  });\n\n  // ECMA262 23.2.5.2.2\n  obj.defineNativeProperty(realm.intrinsics.SymbolToStringTag, new StringValue(realm, \"Set Iterator\"), {\n    writable: false,\n  });\n}\n"
  },
  {
    "path": "src/intrinsics/ecma262/SetPrototype.js",
    "content": "/**\n * Copyright (c) 2017-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n/* @flow */\n\nimport type { Realm } from \"../../realm.js\";\nimport { NativeFunctionValue, ObjectValue, StringValue, NumberValue } from \"../../values/index.js\";\nimport { Call, CreateSetIterator, IsCallable, SameValueZeroPartial } from \"../../methods/index.js\";\nimport { Properties } from \"../../singletons.js\";\nimport invariant from \"../../invariant.js\";\nimport { PropertyDescriptor } from \"../../descriptors.js\";\n\nexport default function(realm: Realm, obj: ObjectValue): void {\n  // ECMA262 23.2.3.1\n  obj.defineNativeMethod(\"add\", 1, (context, [value]) => {\n    // 1. Let S be the this value.\n    let S = context.throwIfNotConcrete();\n\n    // 2. If Type(S) is not Object, throw a TypeError exception.\n    if (!(S instanceof ObjectValue)) {\n      throw realm.createErrorThrowCompletion(realm.intrinsics.TypeError);\n    }\n\n    // 3. If S does not have a [[SetData]] internal slot, throw a TypeError exception.\n    if (!S.$SetData) {\n      throw realm.createErrorThrowCompletion(realm.intrinsics.TypeError);\n    }\n\n    // 4. Let entries be the List that is the value of S's [[SetData]] internal slot.\n    realm.recordModifiedProperty((S: any).$SetData_binding);\n    let entries = S.$SetData;\n    invariant(entries !== undefined);\n\n    // 5. Repeat for each e that is an element of entries,\n    for (let e of entries) {\n      // a. If e is not empty and SameValueZero(e, value) is true, then\n      if (e && SameValueZeroPartial(realm, e, value)) {\n        // i. Return S.\n        return S;\n      }\n    }\n\n    // 6. If value is -0, let value be +0.\n    value = value.throwIfNotConcrete();\n    if (value instanceof NumberValue && Object.is(value.value, -0)) {\n      value = realm.intrinsics.zero;\n    }\n\n    // 7. Append value as the last element of entries.\n    entries.push(value);\n\n    // 8. Return S.\n    return S;\n  });\n\n  // ECMA262 23.2.3.2\n  obj.defineNativeMethod(\"clear\", 0, context => {\n    // 1. Let S be the this value.\n    let S = context.throwIfNotConcrete();\n\n    // 2. If Type(S) is not Object, throw a TypeError exception.\n    if (!(S instanceof ObjectValue)) {\n      throw realm.createErrorThrowCompletion(realm.intrinsics.TypeError);\n    }\n\n    // 3. If S does not have a [[SetData]] internal slot, throw a TypeError exception.\n    if (!S.$SetData) {\n      throw realm.createErrorThrowCompletion(realm.intrinsics.TypeError);\n    }\n\n    // All of these steps can be replace with just reseting [[SetData]]\n    // 4. Let entries be the List that is the value of S's [[SetData]] internal slot.\n    // 5. Repeat for each e that is an element of entries,\n    // 5.a Replace the element of entries whose value is e with an element whose value is empty.\n    realm.recordModifiedProperty((S: any).$SetData_binding);\n    S.$SetData = [];\n\n    // 6. Return undefined.\n    return realm.intrinsics.undefined;\n  });\n\n  // ECMA262 23.2.3.4\n  obj.defineNativeMethod(\"delete\", 1, (context, [value]) => {\n    // 1. Let S be the this value.\n    let S = context.throwIfNotConcrete();\n\n    // 2. If Type(S) is not Object, throw a TypeError exception.\n    if (!(S instanceof ObjectValue)) {\n      throw realm.createErrorThrowCompletion(realm.intrinsics.TypeError);\n    }\n\n    // 3. If S does not have a [[SetData]] internal slot, throw a TypeError exception.\n    if (!S.$SetData) {\n      throw realm.createErrorThrowCompletion(realm.intrinsics.TypeError);\n    }\n\n    // 4. Let entries be the List that is the value of S's [[SetData]] internal slot.\n    realm.recordModifiedProperty((S: any).$SetData_binding);\n    let entries = S.$SetData;\n    invariant(entries !== undefined);\n\n    // 5. Repeat for each e that is an element of entries,\n    for (let i = 0; i < entries.length; i++) {\n      let e = entries[i];\n\n      // a. If e is not empty and SameValueZero(e, value) is true, then\n      if (e !== undefined && SameValueZeroPartial(realm, e, value)) {\n        // i. Replace the element of entries whose value is e with an element whose value is empty.\n        entries[i] = undefined;\n\n        // ii. Return true.\n        return realm.intrinsics.true;\n      }\n    }\n\n    // 6. Return false.\n    return realm.intrinsics.false;\n  });\n\n  // ECMA262 23.2.3.5\n  obj.defineNativeMethod(\"entries\", 0, context => {\n    // 1. Let S be the this value.\n    let S = context;\n\n    // 2. Return ? CreateSetIterator(S, \"key+value\").\n    return CreateSetIterator(realm, S, \"key+value\");\n  });\n\n  // ECMA262 23.2.3.6\n  obj.defineNativeMethod(\"forEach\", 1, (context, [callbackfn, thisArg]) => {\n    // 1. Let S be the this value.\n    let S = context.throwIfNotConcrete();\n\n    // 2. If Type(S) is not Object, throw a TypeError exception.\n    if (!(S instanceof ObjectValue)) {\n      throw realm.createErrorThrowCompletion(realm.intrinsics.TypeError);\n    }\n\n    // 3. If S does not have a [[SetData]] internal slot, throw a TypeError exception.\n    if (!S.$SetData) {\n      throw realm.createErrorThrowCompletion(realm.intrinsics.TypeError);\n    }\n\n    // 4. If IsCallable(callbackfn) is false, throw a TypeError exception.\n    if (!IsCallable(realm, callbackfn)) {\n      throw realm.createErrorThrowCompletion(realm.intrinsics.TypeError);\n    }\n\n    // 5. If thisArg was supplied, let T be thisArg; else let T be undefined.\n    let T = thisArg || realm.intrinsics.undefined;\n\n    // 6. Let entries be the List that is the value of S's [[SetData]] internal slot.\n    let entries = S.$SetData;\n    invariant(entries);\n\n    // 7. Repeat for each e that is an element of entries, in original insertion order\n    for (let e of entries) {\n      // a. If e is not empty, then\n      if (e) {\n        // i. Perform ? Call(callbackfn, T, « e, e, S »).\n        Call(realm, callbackfn, T, [e, e, S]);\n      }\n    }\n\n    // 8. Return undefined.\n    return realm.intrinsics.undefined;\n  });\n\n  // ECMA262 23.2.3.7\n  obj.defineNativeMethod(\"has\", 1, (context, [value]) => {\n    // 1. Let S be the this value.\n    let S = context.throwIfNotConcrete();\n\n    // 2. If Type(S) is not Object, throw a TypeError exception.\n    if (!(S instanceof ObjectValue)) {\n      throw realm.createErrorThrowCompletion(realm.intrinsics.TypeError);\n    }\n\n    // 3. If S does not have a [[SetData]] internal slot, throw a TypeError exception.\n    if (!S.$SetData) {\n      throw realm.createErrorThrowCompletion(realm.intrinsics.TypeError);\n    }\n\n    // 4. Let entries be the List that is the value of S's [[SetData]] internal slot.\n    let entries = S.$SetData;\n\n    // 5. Repeat for each e that is an element of entries,\n    for (let e of entries) {\n      // a. If e is not empty and SameValueZero(e, value) is true, return true.\n      if (e && SameValueZeroPartial(realm, e, value)) return realm.intrinsics.true;\n    }\n\n    // 6. Return false.\n    return realm.intrinsics.false;\n  });\n\n  // ECMA262 23.2.3.9 get Set.prototype.size\n  obj.$DefineOwnProperty(\n    \"size\",\n    new PropertyDescriptor({\n      get: new NativeFunctionValue(realm, undefined, \"get size\", 0, context => {\n        // 1. Let S be the this value.\n        let S = context.throwIfNotConcrete();\n\n        // 2. If Type(S) is not Object, throw a TypeError exception.\n        if (!(S instanceof ObjectValue)) {\n          throw realm.createErrorThrowCompletion(realm.intrinsics.TypeError);\n        }\n\n        // 3. If S does not have a [[SetData]] internal slot, throw a TypeError exception.\n        if (!S.$SetData) {\n          throw realm.createErrorThrowCompletion(realm.intrinsics.TypeError);\n        }\n\n        // 4. Let entries be the List that is the value of S's [[SetData]] internal slot.\n        let entries = S.$SetData;\n\n        // 5. Let count be 0.\n        let count = 0;\n\n        // 6. For each e that is an element of entries\n        for (let e of entries) {\n          // a. If e is not empty, set count to count+1.\n          if (e) count++;\n        }\n\n        // 7. Return count.\n        return new NumberValue(realm, count);\n      }),\n      configurable: true,\n    })\n  );\n\n  // ECMA262 23.2.3.10\n  obj.defineNativeMethod(\"values\", 0, context => {\n    // 1. Let S be the this value.\n    let S = context;\n\n    // 2. Return ? CreateSetIterator(S, \"value\").\n    return CreateSetIterator(realm, S, \"value\");\n  });\n\n  // ECMA262 23.2.3.8\n  let valuesPropertyDescriptor = obj.$GetOwnProperty(\"values\");\n  invariant(valuesPropertyDescriptor instanceof PropertyDescriptor);\n  Properties.ThrowIfMightHaveBeenDeleted(valuesPropertyDescriptor);\n  obj.$DefineOwnProperty(\"keys\", valuesPropertyDescriptor);\n\n  // ECMA262 23.2.3.11\n  obj.$DefineOwnProperty(realm.intrinsics.SymbolIterator, valuesPropertyDescriptor);\n\n  // ECMA262 23.2.3.12 Set.prototype [ @@toStringTag ]\n  obj.defineNativeProperty(realm.intrinsics.SymbolToStringTag, new StringValue(realm, \"Set\"), { writable: false });\n}\n"
  },
  {
    "path": "src/intrinsics/ecma262/String.js",
    "content": "/**\n * Copyright (c) 2017-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n/* @flow strict-local */\n\nimport type { Realm } from \"../../realm.js\";\nimport { NativeFunctionValue, NumberValue, StringValue, SymbolValue, Value } from \"../../values/index.js\";\nimport { Get, GetPrototypeFromConstructor, SymbolDescriptiveString } from \"../../methods/index.js\";\nimport { Create, To } from \"../../singletons.js\";\nimport invariant from \"../../invariant.js\";\n\nexport default function(realm: Realm): NativeFunctionValue {\n  // ECMA262 21.1.1\n  let func = new NativeFunctionValue(realm, \"String\", \"String\", 1, (context, [value], argCount, NewTarget) => {\n    let s: ?Value;\n\n    // 1. If no arguments were passed to this function invocation, let s be \"\".\n    if (argCount === 0) {\n      s = realm.intrinsics.emptyString;\n    } else {\n      // 2. Else,\n      // a. If NewTarget is undefined and Type(value) is Symbol, return SymbolDescriptiveString(value).\n      if (!NewTarget && value instanceof SymbolValue) {\n        return new StringValue(realm, SymbolDescriptiveString(realm, value));\n      }\n\n      // b. Let s be ? ToString(value).\n      s = To.ToStringValue(realm, value);\n    }\n\n    // 3. If NewTarget is undefined, return s.\n    if (!NewTarget) return s;\n\n    // 4. Return ? StringCreate(s, ? GetPrototypeFromConstructor(NewTarget, \"%StringPrototype%\")).\n    s = s.throwIfNotConcreteString();\n    return Create.StringCreate(realm, s, GetPrototypeFromConstructor(realm, NewTarget, \"StringPrototype\"));\n  });\n\n  // ECMA262 21.1.2.1 ( ..._codeUnits_ )\n  func.defineNativeMethod(\"fromCharCode\", 1, (context, codeUnits, argCount) => {\n    // 1. Let codeUnits be a List containing the arguments passed to this function.\n    codeUnits;\n\n    // 2. Let length be the number of elements in codeUnits.\n    let length = argCount;\n\n    // 3. Let elements be a new empty List.\n    let elements = [];\n\n    // 4. Let nextIndex be 0.\n    let nextIndex = 0;\n\n    // 5. Repeat while nextIndex < length\n    while (nextIndex < length) {\n      // a. Let next be codeUnits[nextIndex].\n      let next = codeUnits[nextIndex];\n\n      // b. Let nextCU be ? ToUint16(next).\n      let nextCU = To.ToUint16(realm, next);\n\n      // c. Append nextCU to the end of elements.\n      elements.push(nextCU);\n\n      // d. Let nextIndex be nextIndex + 1.\n      nextIndex++;\n    }\n    // 6. Return the String value whose elements are, in order, the elements in the List elements. If length\n    //    is 0, the empty string is returned.\n    return new StringValue(realm, String.fromCharCode.apply(null, elements));\n  });\n\n  // ECMA262 21.1.2.2 ( ..._codePoints_ )\n  if (!realm.isCompatibleWith(realm.MOBILE_JSC_VERSION) && !realm.isCompatibleWith(\"mobile\"))\n    func.defineNativeMethod(\"fromCodePoint\", 1, (context, codePoints, argCount) => {\n      // 1. Let codePoints be a List containing the arguments passed to this function.\n      codePoints;\n\n      // 2. Let length be the number of elements in codePoints.\n      let length = argCount;\n\n      // 3. Let elements be a new empty List.\n      let elements = [];\n\n      // 4. Let nextIndex be 0.\n      let nextIndex = 0;\n\n      // 5. Repeat while nextIndex < length\n      while (nextIndex < length) {\n        // a. Let next be codePoints[nextIndex].\n        let next = codePoints[nextIndex];\n\n        // b. Let nextCP be ? ToNumber(next).\n        let nextCP = To.ToNumber(realm, next);\n\n        // c. If SameValue(nextCP, ToInteger(nextCP)) is false, throw a RangeError exception.\n        if (nextCP !== To.ToInteger(realm, nextCP)) {\n          throw realm.createErrorThrowCompletion(\n            realm.intrinsics.RangeError,\n            \"SameValue(nextCP, To.ToInteger(nextCP)) is false\"\n          );\n        }\n\n        // d. If nextCP < 0 or nextCP > 0x10FFFF, throw a RangeError exception.\n        if (nextCP < 0 || nextCP > 0x10ffff) {\n          throw realm.createErrorThrowCompletion(\n            realm.intrinsics.RangeError,\n            \"SameValue(nextCP, To.ToInteger(nextCP)) is false\"\n          );\n        }\n\n        // e. Append the elements of the UTF16Encoding of nextCP to the end of elements.\n        elements.push(String.fromCodePoint(nextCP));\n\n        // f. Let nextIndex be nextIndex + 1.\n        nextIndex++;\n      }\n\n      // 6. Return the String value whose elements are, in order, the elements in the List elements. If length\n      //    is 0, the empty string is returned.\n      return new StringValue(realm, elements.join(\"\"));\n    });\n\n  // ECMA262 21.1.2.4\n  if (!realm.isCompatibleWith(realm.MOBILE_JSC_VERSION) && !realm.isCompatibleWith(\"mobile\"))\n    func.defineNativeMethod(\"raw\", 1, (context, [template, ..._substitutions], argCount) => {\n      let substitutions = _substitutions;\n      // 1. Let substitutions be a List consisting of all of the arguments passed to this function, starting with the second argument. If fewer than two arguments were passed, the List is empty.\n      substitutions = argCount < 2 ? [] : substitutions;\n\n      // 2. Let numberOfSubstitutions be the number of elements in substitutions.\n      let numberOfSubstitutions = substitutions.length;\n\n      // 3. Let cooked be ? ToObject(template).\n      let cooked = To.ToObject(realm, template);\n\n      // 4. Let raw be ? ToObject(? Get(cooked, \"raw\")).\n      let raw = To.ToObject(realm, Get(realm, cooked, \"raw\"));\n\n      // 5. Let literalSegments be ? ToLength(? Get(raw, \"length\")).\n      let literalSegments = To.ToLength(realm, Get(realm, raw, \"length\"));\n\n      // 6. If literalSegments ≤ 0, return the empty string.\n      if (literalSegments <= 0) return realm.intrinsics.emptyString;\n\n      // 7. Let stringElements be a new empty List.\n      let stringElements = \"\";\n\n      // 8. Let nextIndex be 0.\n      let nextIndex = 0;\n\n      // 9. Repeat\n      while (true) {\n        // a. Let nextKey be ! ToString(nextIndex).\n        let nextKey = To.ToString(realm, new NumberValue(realm, nextIndex));\n\n        // b. Let nextSeg be ? ToString(? Get(raw, nextKey)).\n        let nextSeg = To.ToStringPartial(realm, Get(realm, raw, nextKey));\n\n        // c. Append in order the code unit elements of nextSeg to the end of stringElements.\n        stringElements = stringElements + nextSeg;\n\n        // d. If nextIndex + 1 = literalSegments, then\n        if (nextIndex + 1 === literalSegments) {\n          // i. Return the String value whose code units are, in order, the elements in the List stringElements. If stringElements has no elements, the empty string is returned.\n          return new StringValue(realm, stringElements);\n        }\n\n        let next;\n        // e. If nextIndex < numberOfSubstitutions, let next be substitutions[nextIndex].\n        if (nextIndex < numberOfSubstitutions) next = substitutions[nextIndex];\n        else {\n          // f. Else, let next be the empty String.\n          next = realm.intrinsics.emptyString;\n        }\n        // g. Let nextSub be ? ToString(next).\n        let nextSub = To.ToStringPartial(realm, next);\n\n        // h. Append in order the code unit elements of nextSub to the end of stringElements.\n        stringElements = stringElements + nextSub;\n\n        // i. Let nextIndex be nextIndex + 1.\n        nextIndex = nextIndex + 1;\n      }\n      invariant(false);\n    });\n\n  return func;\n}\n"
  },
  {
    "path": "src/intrinsics/ecma262/StringIteratorPrototype.js",
    "content": "/**\n * Copyright (c) 2017-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n/* @flow strict-local */\n\nimport type { Realm } from \"../../realm.js\";\nimport { Create } from \"../../singletons.js\";\nimport { ObjectValue, StringValue } from \"../../values/index.js\";\nimport invariant from \"../../invariant.js\";\n\nexport default function(realm: Realm, obj: ObjectValue): void {\n  // ECMA262 21.1.5.2.1\n  obj.defineNativeMethod(\"next\", 0, context => {\n    // 1. Let O be the this value.\n    let O = context.throwIfNotConcrete();\n\n    // 2. If Type(O) is not Object, throw a TypeError exception.\n    if (!(O instanceof ObjectValue)) {\n      throw realm.createErrorThrowCompletion(realm.intrinsics.TypeError, \"Type(O) is not Object\");\n    }\n\n    // 3. If O does not have all of the internal slots of an String Iterator Instance (21.1.5.3), throw a TypeError exception.\n    if (!(\"$IteratedString\" in O && \"$StringIteratorNextIndex\" in O)) {\n      throw realm.createErrorThrowCompletion(realm.intrinsics.TypeError, \"Type(O) is not Object\");\n    }\n\n    // 4. Let s be O.[[IteratedString]].\n    let s = O.$IteratedString;\n\n    // 5. If s is undefined, return CreateIterResultObject(undefined, true).\n    if (!s) {\n      return Create.CreateIterResultObject(realm, realm.intrinsics.undefined, true);\n    }\n\n    // 6. Let position be O.[[StringIteratorNextIndex]].\n    let position = O.$StringIteratorNextIndex;\n    invariant(typeof position === \"number\");\n\n    // 7. Let len be the number of elements in s.\n    let len = s.value.length;\n\n    // 8. If position ≥ len, then\n    if (position >= len) {\n      // a. Set O.[[IteratedString]] to undefined.\n      O.$IteratedString = undefined;\n\n      // b. Return CreateIterResultObject(undefined, true).\n      return Create.CreateIterResultObject(realm, realm.intrinsics.undefined, true);\n    }\n\n    // 9. Let first be the code unit value at index position in s.\n    let first = s.value.charCodeAt(position);\n\n    let resultString;\n    // 10. If first < 0xD800 or first > 0xDBFF or position+1 = len, let resultString be the string consisting of the single code unit first.\n    if (first < 0xd800 || first > 0xdbff || position + 1 === len) {\n      resultString = String.fromCharCode(first);\n    } else {\n      // 11. Else,\n      // a. Let second be the code unit value at index position+1 in the String s.\n      let second = s.value.charCodeAt(position + 1);\n\n      // b. If second < 0xDC00 or second > 0xDFFF, let resultString be the string consisting of the single code unit first.\n      if (second < 0xdc00 || second > 0xdfff) {\n        resultString = String.fromCharCode(first);\n      } else {\n        // c. Else, let resultString be the string consisting of the code unit first followed by the code unit second.\n        resultString = String.fromCharCode(first, second);\n      }\n    }\n    // 12. Let resultSize be the number of code units in resultString.\n    let resultSize = resultString.length;\n\n    // 13. Set O.[[StringIteratorNextIndex]] to position + resultSize.\n    O.$StringIteratorNextIndex = position + resultSize;\n\n    // 14. Return CreateIterResultObject(resultString, false).\n    return Create.CreateIterResultObject(realm, new StringValue(realm, resultString), false);\n  });\n\n  // ECMA262 21.1.5.2.2\n  obj.defineNativeProperty(realm.intrinsics.SymbolToStringTag, new StringValue(realm, \"String Iterator\"), {\n    writable: false,\n  });\n}\n"
  },
  {
    "path": "src/intrinsics/ecma262/StringPrototype.js",
    "content": "/**\n * Copyright (c) 2017-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n/* @flow */\n\nimport { Realm } from \"../../realm.js\";\nimport { FatalError } from \"../../errors.js\";\nimport { AbstractValue, NullValue, NumberValue, ObjectValue, StringValue, UndefinedValue } from \"../../values/index.js\";\nimport { IsCallable, IsRegExp } from \"../../methods/is.js\";\nimport { GetMethod, GetSubstitution } from \"../../methods/get.js\";\nimport { Call, Invoke } from \"../../methods/call.js\";\nimport { Create, To } from \"../../singletons.js\";\nimport { RegExpCreate } from \"../../methods/regexp.js\";\nimport { SplitMatch, RequireObjectCoercible } from \"../../methods/abstract.js\";\nimport { HasSomeCompatibleType } from \"../../methods/has.js\";\nimport invariant from \"../../invariant.js\";\n\nconst sliceTemplateSrc = \"(A).slice(B,C)\";\nconst splitTemplateSrc = \"(A).split(B,C)\";\n\nexport default function(realm: Realm, obj: ObjectValue): ObjectValue {\n  // ECMA262 21.1.3\n  obj.$StringData = realm.intrinsics.emptyString;\n\n  // ECMA262 21.1.3\n  obj.defineNativeProperty(\"length\", realm.intrinsics.zero);\n\n  // ECMA262 21.1.3.1\n  obj.defineNativeMethod(\"charAt\", 1, (context, [pos]) => {\n    // 1. Let O be ? RequireObjectCoercible(this value).\n    let O = RequireObjectCoercible(realm, context);\n\n    // 2. Let S be ? ToString(O).\n    let S = To.ToString(realm, O.throwIfNotConcrete());\n\n    // 3. Let position be ? ToInteger(pos).\n    let position = To.ToInteger(realm, pos);\n\n    // 4. Let size be the number of elements in S.\n    let size = S.length;\n\n    // 5. If position < 0 or position ≥ size, return the empty String.\n    if (position < 0 || position >= size) return realm.intrinsics.emptyString;\n\n    // 6. Return a String of length 1, containing one code unit from S, namely the code unit at index position.\n    return new StringValue(realm, S.charAt(position));\n  });\n\n  // ECMA262 21.1.3.2\n  obj.defineNativeMethod(\"charCodeAt\", 1, (context, [pos]) => {\n    // 1. Let O be ? RequireObjectCoercible(this value).\n    let O = RequireObjectCoercible(realm, context);\n\n    // 2. Let S be ? ToString(O).\n    let S = To.ToString(realm, O.throwIfNotConcrete());\n\n    // 3. Let position be ? ToInteger(pos).\n    let position = To.ToInteger(realm, pos);\n\n    // 4. Let size be the number of elements in S.\n    let size = S.length;\n\n    // 5. If position < 0 or position ≥ size, return NaN.\n    if (position < 0 || position >= size) return realm.intrinsics.NaN;\n\n    // 6. Return a value of Number type, whose value is the code unit value of the element at index position\n    //    in the String S.\n    return new NumberValue(realm, S.charCodeAt(position));\n  });\n\n  // ECMA262 21.1.3.3\n  if (!realm.isCompatibleWith(realm.MOBILE_JSC_VERSION) && !realm.isCompatibleWith(\"mobile\"))\n    obj.defineNativeMethod(\"codePointAt\", 1, (context, [pos]) => {\n      // 1. Let O be ? RequireObjectCoercible(this value).\n      let O = RequireObjectCoercible(realm, context);\n\n      // 2. Let S be ? ToString(O).\n      let S = To.ToString(realm, O.throwIfNotConcrete());\n\n      // 3. Let position be ? ToInteger(pos).\n      let position = To.ToInteger(realm, pos);\n\n      // 4. Let size be the number of elements in S.\n      let size = S.length;\n\n      // 5. If position < 0 or position ≥ size, return undefined.\n      if (position < 0 || position >= size) return realm.intrinsics.undefined;\n\n      // 6. Let first be the code unit value of the element at index position in the String S.\n      // 7. If first < 0xD800 or first > 0xDBFF or position+1 = size, return first.\n      // 8. Let second be the code unit value of the element at index position+1 in the String S.\n      // 9. If second < 0xDC00 or second > 0xDFFF, return first.\n      // 10. Return UTF16Decode(first, second).\n      return new NumberValue(realm, S.codePointAt(position));\n    });\n\n  // ECMA262 21.1.3.4\n  obj.defineNativeMethod(\"concat\", 1, (context, args, argCount) => {\n    // 1. Let O be ? RequireObjectCoercible(this value).\n    let O = RequireObjectCoercible(realm, context);\n\n    // 2. Let S be ? ToString(O).\n    let S = To.ToString(realm, O.throwIfNotConcrete());\n\n    // 3. Let args be a List whose elements are the arguments passed to this function.\n    args = argCount === 0 ? [] : args;\n\n    // 4. Let R be S.\n    let R = S;\n\n    // 5. Repeat, while args is not empty\n    while (args.length) {\n      // a. Remove the first element from args and let next be the value of that element.\n      let next = args.shift();\n\n      // b. Let nextString be ? ToString(next).\n      let nextString = To.ToStringPartial(realm, next);\n\n      // c. Let R be the String value consisting of the code units of the previous value of R followed by the code units of nextString.\n      R = R + nextString;\n    }\n\n    // 6. Return R.\n    return new StringValue(realm, R);\n  });\n\n  // ECMA262 21.1.3.6\n  if (!realm.isCompatibleWith(realm.MOBILE_JSC_VERSION) && !realm.isCompatibleWith(\"mobile\"))\n    obj.defineNativeMethod(\"endsWith\", 1, (context, [searchString, endPosition]) => {\n      // 1. Let O be ? RequireObjectCoercible(this value).\n      let O = RequireObjectCoercible(realm, context);\n\n      // 2. Let S be ? ToString(O).\n      let S = To.ToString(realm, O.throwIfNotConcrete());\n\n      // 3. Let isRegExp be ? IsRegExp(searchString).\n      let isRegExp = IsRegExp(realm, searchString);\n\n      // 4. If isRegExp is true, throw a TypeError exception.\n      if (isRegExp) {\n        throw realm.createErrorThrowCompletion(realm.intrinsics.TypeError, \"String.prototype\");\n      }\n\n      // 5. Let searchStr be ? ToString(searchString).\n      let searchStr = To.ToStringPartial(realm, searchString);\n\n      // 6. Let len be the number of elements in S.\n      let len = S.length;\n\n      // 7. If endPosition is undefined, let pos be len, else let pos be ? ToInteger(endPosition).)\n      let pos;\n      if (!endPosition || endPosition instanceof UndefinedValue) {\n        pos = len;\n      } else {\n        pos = To.ToInteger(realm, endPosition.throwIfNotConcrete());\n      }\n\n      // 8. Let end be min(max(pos, 0), len).\n      let end = Math.min(Math.max(pos, 0), len);\n\n      // 9. Let searchLength be the number of elements in searchStr.\n      let searchLength = searchStr.length;\n\n      // 10. Let start be end - searchLength.\n      let start = end - searchLength;\n\n      // 11. If start is less than 0, return false.\n      if (start < 0) return realm.intrinsics.false;\n\n      // 12. If the sequence of elements of S starting at start of length searchLength is the same as the full\n      //     element sequence of searchStr, return true.\n      if (S.substr(start, searchLength) === searchStr) return realm.intrinsics.true;\n\n      // 13. Otherwise, return false.\n      return realm.intrinsics.false;\n    });\n\n  // ECMA262 21.1.3.7\n  if (!realm.isCompatibleWith(realm.MOBILE_JSC_VERSION) && !realm.isCompatibleWith(\"mobile\"))\n    obj.defineNativeMethod(\"includes\", 1, (context, [searchString, position]) => {\n      // 1. Let O be ? RequireObjectCoercible(this value).\n      let O = RequireObjectCoercible(realm, context);\n\n      // 2. Let S be ? ToString(O).\n      let S = To.ToString(realm, O.throwIfNotConcrete());\n\n      // 3. Let isRegExp be ? IsRegExp(searchString).\n      let isRegExp = IsRegExp(realm, searchString);\n\n      // 4. If isRegExp is true, throw a TypeError exception.\n      if (isRegExp) {\n        throw realm.createErrorThrowCompletion(realm.intrinsics.TypeError, \"String.prototype\");\n      }\n\n      // 5. Let searchStr be ? ToString(searchString).\n      let searchStr = To.ToStringPartial(realm, searchString);\n\n      // 6. Let pos be ? ToInteger(position). (If position is undefined, this step produces the value 0.)\n      let pos = To.ToInteger(realm, position || realm.intrinsics.undefined);\n\n      // 7. Let len be the number of elements in S.\n      let len = S.length;\n\n      // 8. Let start be min(max(pos, 0), len).\n      let start = Math.min(Math.max(pos, 0), len);\n\n      // 9. Let searchLen be the number of elements in searchStr.\n      let searchLen = searchStr.length;\n\n      // 10. If there exists any integer k not smaller than start such that k + searchLen is not greater than\n      //     len, and for all nonnegative integers j less than searchLen, the code unit at index k+j of S is the\n      //     same as the code unit at index j of searchStr, return true; but if there is no such integer k,\n      //     return false.\n      if (searchLen === 0) {\n        return realm.intrinsics.true;\n      } else {\n        for (let k = start; k + searchLen <= len; ++k) {\n          let found = true;\n          for (let j = 0; j < searchLen; ++j) {\n            if (S.charCodeAt(k + j) !== searchStr.charCodeAt(j)) {\n              found = false;\n            }\n          }\n          if (found) return realm.intrinsics.true;\n        }\n        return realm.intrinsics.false;\n      }\n    });\n\n  // ECMA262 21.1.3.8\n  obj.defineNativeMethod(\"indexOf\", 1, (context, [searchString, position]) => {\n    // 1. Let O be ? RequireObjectCoercible(this value).\n    let O = RequireObjectCoercible(realm, context);\n\n    // 2. Let S be ? ToString(O).\n    let S = To.ToString(realm, O.throwIfNotConcrete());\n\n    // 3. Let searchStr be ? ToString(searchString).\n    let searchStr = To.ToStringPartial(realm, searchString);\n\n    // 4. Let pos be ? ToInteger(position). (If position is undefined, this step produces the value 0.)\n    let pos = position ? To.ToInteger(realm, position) : 0;\n\n    // 5. Let len be the number of elements in S.\n    // 6. Let start be min(max(pos, 0), len).\n    // 7. Let searchLen be the number of elements in searchStr.\n    // 8. Return the smallest possible integer k not smaller than start such that k+searchLen is not greater\n    //    than len, and for all nonnegative integers j less than searchLen, the code unit at index k+j of S is\n    //    the same as the code unit at index j of searchStr; but if there is no such integer k, return the\n    //    value -1.\n    return new NumberValue(realm, S.indexOf(searchStr, pos));\n  });\n\n  // ECMA262 21.1.3.9\n  obj.defineNativeMethod(\"lastIndexOf\", 1, (context, [searchString, position]) => {\n    // 1. Let O be ? RequireObjectCoercible(this value).\n    let O = RequireObjectCoercible(realm, context);\n\n    // 2. Let S be ? ToString(O).\n    let S = To.ToString(realm, O.throwIfNotConcrete());\n\n    // 3. Let searchStr be ? ToString(searchString).\n    let searchStr = To.ToStringPartial(realm, searchString);\n\n    // 4. Let numPos be ? ToNumber(position). (If position is undefined, this step produces the value NaN.)\n    let numPos = To.ToNumber(realm, position || realm.intrinsics.undefined);\n\n    // 5. If numPos is NaN, let pos be +∞; otherwise, let pos be ToInteger(numPos).\n    let pos;\n    if (isNaN(numPos)) {\n      pos = Infinity;\n    } else {\n      pos = To.ToInteger(realm, numPos);\n    }\n\n    // 6. Let len be the number of elements in S.\n    // 7. Let start be min(max(pos, 0), len).\n    // 8. Let searchLen be the number of elements in searchStr.\n    // 9. Return the largest possible nonnegative integer k not larger than start such that k+searchLen is not\n    //    greater than len, and for all nonnegative integers j less than searchLen, the code unit at index k+j\n    //    of S is the same as the code unit at index j of searchStr; but if there is no such integer k, return\n    //    the value -1.\n    return new NumberValue(realm, S.lastIndexOf(searchStr, pos));\n  });\n\n  // ECMA262 21.1.3.10\n  obj.defineNativeMethod(\"localeCompare\", 1, (context, [that]) => {\n    // 1. Let O be ? RequireObjectCoercible(this value).\n    let O = RequireObjectCoercible(realm, context);\n\n    // 2. Let S be ? ToString(O).\n    let S = To.ToString(realm, O.throwIfNotConcrete());\n\n    // 3. Let That be ? ToString(that).\n    let That = To.ToStringPartial(realm, that);\n\n    return new NumberValue(realm, S.localeCompare(That));\n  });\n\n  // ECMA262 21.1.3.11\n  obj.defineNativeMethod(\"match\", 1, (context, [regexp]) => {\n    // 1. Let O be ? RequireObjectCoercible(this value).\n    let O = RequireObjectCoercible(realm, context);\n\n    // 2. If regexp is neither undefined nor null, then\n    if (!HasSomeCompatibleType(regexp, UndefinedValue, NullValue)) {\n      // a. Let matcher be ? GetMethod(regexp, @@match).\n      let matcher = GetMethod(realm, regexp, realm.intrinsics.SymbolMatch);\n\n      // b. If matcher is not undefined, then\n      if (!matcher.mightBeUndefined()) {\n        // i. Return ? Call(matcher, regexp, « O »).\n        return Call(realm, matcher, regexp, [O]);\n      }\n      matcher.throwIfNotConcrete();\n    }\n\n    // 3. Let S be ? ToString(O).\n    let S = new StringValue(realm, To.ToStringPartial(realm, O));\n\n    // 4. Let rx be ? RegExpCreate(regexp, undefined).\n    let rx = RegExpCreate(realm, regexp, undefined);\n\n    // 5. Return ? Invoke(rx, @@match, « S »).\n    return Invoke(realm, rx, realm.intrinsics.SymbolMatch, [S]);\n  });\n\n  // ECMA262 21.1.3.12\n  if (!realm.isCompatibleWith(realm.MOBILE_JSC_VERSION) && !realm.isCompatibleWith(\"mobile\"))\n    obj.defineNativeMethod(\"normalize\", 0, (context, [form]) => {\n      // 1. Let O be ? RequireObjectCoercible(this value).\n      let O = RequireObjectCoercible(realm, context);\n\n      // 2. Let S be ? ToString(O).\n      let S = To.ToString(realm, O.throwIfNotConcrete());\n\n      // 3. If form is not provided or form is undefined, let form be \"NFC\".\n      if (!form || form instanceof UndefinedValue) form = new StringValue(realm, \"NFC\");\n\n      // 4. Let f be ? ToString(form).\n      let f = To.ToStringPartial(realm, form);\n\n      // 5. If f is not one of \"NFC\", \"NFD\", \"NFKC\", or \"NFKD\", throw a RangeError exception.\n      if (f !== \"NFC\" && f !== \"NFD\" && f !== \"NFKC\" && f !== \"NFKD\") {\n        throw realm.createErrorThrowCompletion(realm.intrinsics.RangeError);\n      }\n\n      // 6. Let ns be the String value that is the result of normalizing S into the normalization form named by\n      //    f as specified in http://www.unicode.org/reports/tr15/tr15-29.html.\n      // 7. Return ns.\n      return new StringValue(realm, S.normalize(f));\n    });\n\n  // ECMA262 21.1.3.13\n  if (!realm.isCompatibleWith(realm.MOBILE_JSC_VERSION) && !realm.isCompatibleWith(\"mobile\"))\n    obj.defineNativeMethod(\"padEnd\", 1, (context, [maxLength, fillString]) => {\n      // 1. Let O be ? RequireObjectCoercible(this value).\n      let O = RequireObjectCoercible(realm, context);\n\n      // 2. Let S be ? ToString(O).\n      let S = To.ToString(realm, O.throwIfNotConcrete());\n\n      // 3. Let intMaxLength be ? ToLength(maxLength).\n      let intMaxLength = To.ToLength(realm, maxLength);\n\n      // 4. Let stringLength be the number of elements in S.\n      let stringLength = S.length;\n\n      // 5. If intMaxLength is not greater than stringLength, return S.\n      if (intMaxLength <= stringLength) return new StringValue(realm, S);\n\n      let filler;\n      // 6. If fillString is undefined, let filler be a String consisting solely of the code unit 0x0020 (SPACE).\n      if (!fillString || fillString instanceof UndefinedValue) filler = \" \";\n      else {\n        // 7. Else, let filler be ? ToString(fillString).\n        filler = To.ToStringPartial(realm, fillString);\n      }\n      // 8. If filler is the empty String, return S.\n      if (filler === \"\") return new StringValue(realm, S);\n\n      // 9. Let fillLen be intMaxLength - stringLength.\n      let fillLen = intMaxLength - stringLength;\n\n      // 10. Let truncatedStringFiller be a new String value consisting of repeated concatenations of filler truncated to length fillLen.\n      let truncatedStringFiller = filler.repeat(Math.ceil(fillLen / filler.length)).substr(0, fillLen);\n\n      // 11. Return a new String value computed by the concatenation of S and truncatedStringFiller.\n      return new StringValue(realm, S + truncatedStringFiller);\n    });\n\n  // ECMA262 21.1.3.14\n  if (!realm.isCompatibleWith(realm.MOBILE_JSC_VERSION) && !realm.isCompatibleWith(\"mobile\"))\n    obj.defineNativeMethod(\"padStart\", 1, (context, [maxLength, fillString]) => {\n      // 1. Let O be ? RequireObjectCoercible(this value).\n      let O = RequireObjectCoercible(realm, context);\n\n      // 2. Let S be ? ToString(O).\n      let S = To.ToString(realm, O.throwIfNotConcrete());\n\n      // 3. Let intMaxLength be ? ToLength(maxLength).\n      let intMaxLength = To.ToLength(realm, maxLength);\n\n      // 4. Let stringLength be the number of elements in S.\n      let stringLength = S.length;\n\n      // 5. If intMaxLength is not greater than stringLength, return S.\n      if (intMaxLength <= stringLength) return new StringValue(realm, S);\n\n      let filler;\n      // 6. If fillString is undefined, let filler be a String consisting solely of the code unit 0x0020 (SPACE).\n      if (!fillString || fillString instanceof UndefinedValue) filler = \" \";\n      else {\n        // 7. Else, let filler be ? ToString(fillString).\n        filler = To.ToStringPartial(realm, fillString);\n      }\n      // 8. If filler is the empty String, return S.\n      if (filler === \"\") return new StringValue(realm, S);\n\n      // 9. Let fillLen be intMaxLength - stringLength.\n      let fillLen = intMaxLength - stringLength;\n\n      // 10. Let truncatedStringFiller be a new String value consisting of repeated concatenations of filler truncated to length fillLen.\n      let truncatedStringFiller = filler.repeat(Math.ceil(fillLen / filler.length)).substr(0, fillLen);\n\n      // 11. Return a new String value computed by the concatenation of truncatedStringFiller and S.\n      return new StringValue(realm, truncatedStringFiller + S);\n    });\n\n  // ECMA262 21.1.3.13\n  if (!realm.isCompatibleWith(realm.MOBILE_JSC_VERSION) && !realm.isCompatibleWith(\"mobile\"))\n    obj.defineNativeMethod(\"repeat\", 1, (context, [count]) => {\n      // 1. Let O be ? RequireObjectCoercible(this value).\n      let O = RequireObjectCoercible(realm, context);\n\n      // 2. Let S be ? ToString(O).\n      let S = To.ToString(realm, O.throwIfNotConcrete());\n\n      // 3. Let n be ? ToInteger(count).\n      let n = To.ToInteger(realm, count);\n\n      // 4. If n < 0, throw a RangeError exception.\n      if (n < 0) {\n        throw realm.createErrorThrowCompletion(realm.intrinsics.RangeError);\n      }\n\n      // 5. If n is +∞, throw a RangeError exception.\n      if (!isFinite(n)) {\n        throw realm.createErrorThrowCompletion(realm.intrinsics.RangeError);\n      }\n\n      // 6. Let T be a String value that is made from n copies of S appended together. If n is 0, T is the empty String.\n      let T = \"\";\n      if (S) while (n--) T += S;\n\n      // 7. Return T.\n      return new StringValue(realm, T);\n    });\n\n  // ECMA262 21.1.3.14\n  obj.defineNativeMethod(\"replace\", 2, (context, [searchValue, replaceValue]) => {\n    let replStr;\n\n    // 1. Let O be ? RequireObjectCoercible(this value).\n    let O = RequireObjectCoercible(realm, context);\n\n    // 2. If searchValue is neither undefined nor null, then\n    if (!HasSomeCompatibleType(searchValue, NullValue, UndefinedValue)) {\n      // a. Let replacer be ? GetMethod(searchValue, @@replace).\n      let replacer = GetMethod(realm, searchValue, realm.intrinsics.SymbolReplace);\n\n      // b. If replacer is not undefined, then\n      if (!(replacer instanceof UndefinedValue)) {\n        // i. Return ? Call(replacer, searchValue, « O, replaceValue »).\n        return Call(realm, replacer, searchValue, [O, replaceValue]);\n      }\n    }\n\n    // 3. Let string be ? ToString(O).\n    let string = To.ToString(realm, O.throwIfNotConcrete());\n\n    // 4. Let searchString be ? ToString(searchValue).\n    let searchString = To.ToStringPartial(realm, searchValue);\n\n    // 5. Let functionalReplace be IsCallable(replaceValue).\n    let functionalReplace = IsCallable(realm, replaceValue);\n\n    let replaceValueString;\n    // 6. If functionalReplace is false, then\n    if (functionalReplace === false) {\n      // a. Let replaceValue be ? ToString(replaceValue).\n      replaceValueString = To.ToStringPartial(realm, replaceValue);\n    }\n\n    // 7. Search string for the first occurrence of searchString and\n    //    let pos be the index within string of the first code unit of the matched substring and\n    let pos = string.indexOf(searchString);\n\n    //    let matched be searchString.\n    let matched = searchString;\n\n    //    If no occurrences of searchString were found, return string.\n    if (pos < 0) return new StringValue(realm, string);\n\n    // 8. If functionalReplace is true, then\n    if (functionalReplace === true) {\n      // a. Let replValue be ? Call(replaceValue, undefined, « matched, pos, string »).\n      let replValue = Call(realm, replaceValue, realm.intrinsics.undefined, [\n        new StringValue(realm, matched),\n        new NumberValue(realm, pos),\n        new StringValue(realm, string),\n      ]);\n\n      // b. Let replStr be ? ToString(replValue).\n      replStr = To.ToStringPartial(realm, replValue);\n    } else {\n      // 9. Else,\n      // a. Let captures be an empty List.\n      let captures = [];\n\n      // b. Let replStr be GetSubstitution(matched, string, pos, captures, replaceValue).\n      invariant(typeof replaceValueString === \"string\");\n      replStr = To.ToString(realm, GetSubstitution(realm, matched, string, pos, captures, replaceValueString));\n    }\n\n    // 10. Let tailPos be pos + the number of code units in matched.\n    let tailPos = pos + matched.length;\n\n    // 11. Let newString be the String formed by concatenating the first pos code units of string,\n    //     replStr, and the trailing substring of string starting at index tailPos. If pos is 0,\n    //     the first element of the concatenation will be the empty String.\n    let newString = string.substr(0, pos) + replStr + string.substr(tailPos);\n\n    // 12. Return newString.\n    return new StringValue(realm, newString);\n  });\n\n  // ECMA262 21.1.3.15\n  obj.defineNativeMethod(\"search\", 1, (context, [regexp]) => {\n    // 1. Let O be ? RequireObjectCoercible(this value).\n    let O = RequireObjectCoercible(realm, context);\n\n    // 2. If regexp is neither undefined nor null, then\n    if (!HasSomeCompatibleType(regexp, UndefinedValue, NullValue)) {\n      // a. Let searcher be ? GetMethod(regexp, @@search).\n      let searcher = GetMethod(realm, regexp, realm.intrinsics.SymbolSearch);\n\n      // b. If searcher is not undefined, then\n      if (!(searcher instanceof UndefinedValue)) {\n        // i. Return ? Call(searcher, regexp, « O »).\n        return Call(realm, searcher, regexp, [O]);\n      }\n    }\n\n    // 3. Let string be ? ToString(O).\n    let string = To.ToStringPartial(realm, O);\n\n    // 4. Let rx be ? RegExpCreate(regexp, undefined).\n    let rx = RegExpCreate(realm, regexp, undefined);\n\n    // 5. Return ? Invoke(rx, @@search, « string »).\n    return Invoke(realm, rx, realm.intrinsics.SymbolSearch, [new StringValue(realm, string)]);\n  });\n\n  // ECMA262 21.1.3.16\n  obj.defineNativeMethod(\"slice\", 2, (context, [start, end]) => {\n    // 1. Let O be ? RequireObjectCoercible(this value).\n    let O = RequireObjectCoercible(realm, context);\n\n    if (O instanceof AbstractValue && O.getType() === StringValue) {\n      // This operation is a conditional atemporal\n      // See #2327\n      let absVal = AbstractValue.createFromTemplate(realm, sliceTemplateSrc, StringValue, [O, start, end]);\n      return AbstractValue.convertToTemporalIfArgsAreTemporal(realm, absVal, [O]);\n    }\n\n    // 2. Let S be ? ToString(O).\n    let S = To.ToString(realm, O.throwIfNotConcrete());\n\n    // 3. Let len be the number of elements in S.\n    let len = S.length;\n\n    // 4. Let intStart be ? ToInteger(start).\n    let intStart = To.ToInteger(realm, start);\n\n    // 5. If end is undefined, let intEnd be len; else let intEnd be ? ToInteger(end).\n    let intEnd = !end || end instanceof UndefinedValue ? len : To.ToInteger(realm, end.throwIfNotConcrete());\n\n    // 6. If intStart < 0, let from be max(len + intStart, 0); otherwise let from be min(intStart, len).\n    let from = intStart < 0 ? Math.max(len + intStart, 0) : Math.min(intStart, len);\n\n    // 7. If intEnd < 0, let to be max(len + intEnd, 0); otherwise let to be min(intEnd, len).\n    let to = intEnd < 0 ? Math.max(len + intEnd, 0) : Math.min(intEnd, len);\n\n    // 8. Let span be max(to - from, 0).\n    let span = Math.max(to - from, 0);\n\n    // 9. Return a String value containing span consecutive elements from S beginning with the element at index from.\n    return new StringValue(realm, S.substr(from, span));\n  });\n\n  // ECMA262 21.1.3.17\n  obj.defineNativeMethod(\"split\", 2, (context, [separator, limit]) => {\n    // 1. Let O be ? RequireObjectCoercible(this value).\n    let O = RequireObjectCoercible(realm, context);\n\n    if (O instanceof AbstractValue && O.getType() === StringValue) {\n      // This operation is a conditional atemporal\n      // See #2327\n      let absVal = AbstractValue.createFromTemplate(realm, splitTemplateSrc, ObjectValue, [O, separator, limit]);\n      return AbstractValue.convertToTemporalIfArgsAreTemporal(realm, absVal, [O]);\n    }\n\n    // 2. If separator is neither undefined nor null, then\n    if (!HasSomeCompatibleType(separator, UndefinedValue, NullValue)) {\n      // a. Let splitter be ? GetMethod(separator, @@split).\n      let splitter = GetMethod(realm, separator, realm.intrinsics.SymbolSplit);\n\n      // b. If splitter is not undefined, then\n      if (!(splitter instanceof UndefinedValue)) {\n        // i. Return ? Call(splitter, separator, « O, limit »).\n        return Call(realm, splitter, separator, [O, limit]);\n      }\n    }\n\n    // 3. Let S be ? ToString(O).\n    let S = To.ToString(realm, O.throwIfNotConcrete());\n\n    // 4. Let A be ArrayCreate(0).\n    let A = Create.ArrayCreate(realm, 0);\n\n    // 5. Let lengthA be 0.\n    let lengthA = 0;\n\n    // 6. If limit is undefined, let lim be 232-1; else let lim be ? ToUint32(limit).\n    let lim =\n      !limit || limit instanceof UndefinedValue ? Math.pow(2, 32) - 1 : To.ToUint32(realm, limit.throwIfNotConcrete());\n\n    // 7. Let s be the number of elements in S.\n    let s = S.length;\n\n    // 8. Let p be 0.\n    let p = 0;\n\n    // 9. Let R be ? ToString(separator).\n    let R = To.ToStringPartial(realm, separator);\n\n    // 10. If lim = 0, return A.\n    if (lim === 0) return A;\n\n    // 11. If separator is undefined, then\n    if (!separator || separator instanceof UndefinedValue) {\n      // a. Perform ! CreateDataProperty(A, \"0\", S).\n      Create.CreateDataProperty(realm, A, \"0\", new StringValue(realm, S));\n\n      // b. Return A.\n      return A;\n    }\n\n    // 12. If s = 0, then\n    if (s === 0) {\n      // a. Let z be SplitMatch(S, 0, R).\n      let z = SplitMatch(realm, S, 0, R);\n\n      // b. If z is not false, return A.\n      if (z !== false) return A;\n\n      // c. Perform ! CreateDataProperty(A, \"0\", S).\n      Create.CreateDataProperty(realm, A, \"0\", new StringValue(realm, S));\n      // d. Return A.\n      return A;\n    }\n\n    // 13. Let q be p.\n    let q = p;\n\n    // 14. Repeat, while q ≠ s\n    while (q !== s) {\n      // a. Let e be SplitMatch(S, q, R).\n      let e = SplitMatch(realm, S, q, R);\n\n      // b. If e is false, let q be q+1.\n      if (e === false) {\n        q++;\n      } else {\n        // c. Else e is an integer index ≤ s,\n        // i. If e = p, let q be q+1.\n        if (e === p) {\n          q++;\n        } else {\n          // ii. Else e ≠ p,\n          // 1. Let T be a String value equal to the substring of S consisting of the code units at indices p (inclusive) through q (exclusive).\n          let T = S.substring(p, q);\n\n          // 2. Perform ! CreateDataProperty(A, ! ToString(lengthA), T).\n          Create.CreateDataProperty(realm, A, new StringValue(realm, lengthA + \"\"), new StringValue(realm, T));\n\n          // 3. Increment lengthA by 1.\n          lengthA++;\n\n          // 4. If lengthA = lim, return A.\n          if (lengthA === lim) return A;\n\n          // 5. Let p be e.\n          p = e;\n\n          // 6. Let q be p.\n          q = p;\n        }\n      }\n    }\n\n    // 15. Let T be a String value equal to the substring of S consisting of the code units at indices p (inclusive) through s (exclusive).\n    let T = S.substring(p, s);\n\n    // 16. Perform ! CreateDataProperty(A, ! ToString(lengthA), T).\n    Create.CreateDataProperty(realm, A, new StringValue(realm, lengthA + \"\"), new StringValue(realm, T));\n\n    // 17. Return A.\n    return A;\n  });\n\n  // ECMA262 21.1.3.18\n  if (!realm.isCompatibleWith(realm.MOBILE_JSC_VERSION) && !realm.isCompatibleWith(\"mobile\"))\n    obj.defineNativeMethod(\"startsWith\", 1, (context, [searchString, position]) => {\n      // 1. Let O be ? RequireObjectCoercible(this value).\n      let O = RequireObjectCoercible(realm, context);\n\n      // 2. Let S be ? ToString(O).\n      let S = To.ToString(realm, O.throwIfNotConcrete());\n\n      // 3. Let isRegExp be ? IsRegExp(searchString).\n      let isRegExp = IsRegExp(realm, searchString);\n\n      // 4. If isRegExp is true, throw a TypeError exception.\n      if (isRegExp) {\n        throw realm.createErrorThrowCompletion(realm.intrinsics.TypeError, \"String.prototype\");\n      }\n\n      // 5. Let searchStr be ? ToString(searchString).\n      let searchStr = To.ToStringPartial(realm, searchString);\n\n      // 6. Let pos be ? ToInteger(position). (If position is undefined, this step produces the value 0.)\n      let pos = To.ToInteger(realm, position || realm.intrinsics.undefined);\n\n      // 7. Let len be the number of elements in S.\n      let len = S.length;\n\n      // 8. Let start be min(max(pos, 0), len).\n      let start = Math.min(Math.max(pos, 0), len);\n\n      // 9. Let searchLength be the number of elements in searchStr.\n      let searchLength = searchStr.length;\n\n      // 10. If searchLength+start is greater than len, return false.\n      if (searchLength + start > len) return realm.intrinsics.false;\n\n      // 11. If the sequence of elements of S starting at start of length searchLength is the same as the full element sequence of searchStr, return true.\n      if (S.substr(start, searchLength) === searchStr) return realm.intrinsics.true;\n\n      // 12. Otherwise, return false.\n      return realm.intrinsics.false;\n    });\n\n  // ECMA262 21.1.3.19\n  obj.defineNativeMethod(\"substring\", 2, (context, [start, end]) => {\n    // 1. Let O be ? RequireObjectCoercible(this value).\n    let O = RequireObjectCoercible(realm, context);\n\n    // 2. Let S be ? ToString(O).\n    let S = To.ToString(realm, O.throwIfNotConcrete());\n\n    // 3. Let len be the number of elements in S.\n    let len = S.length;\n\n    // 4. Let intStart be ? ToInteger(start).\n    let intStart = To.ToInteger(realm, start);\n\n    // 5. If end is undefined, let intEnd be len; else let intEnd be ? ToInteger(end).\n    let intEnd = !end || end instanceof UndefinedValue ? len : To.ToInteger(realm, end.throwIfNotConcrete());\n\n    // 6. Let finalStart be min(max(intStart, 0), len).\n    let finalStart = Math.min(Math.max(intStart, 0), len);\n\n    // 7. Let finalEnd be min(max(intEnd, 0), len).\n    let finalEnd = Math.min(Math.max(intEnd, 0), len);\n\n    // 8. Let from be min(finalStart, finalEnd).\n    let frm = Math.min(finalStart, finalEnd);\n\n    // 9. Let to be max(finalStart, finalEnd).\n    let to = Math.max(finalStart, finalEnd);\n\n    // 10. Return a String whose length is to - from, containing code units from S, namely the code units with indices from through to - 1, in ascending order.\n    return new StringValue(realm, S.slice(frm, to));\n  });\n\n  type toCaseTypes = \"LocaleLower\" | \"LocaleUpper\" | \"Lower\" | \"Upper\";\n  function toCase(type: toCaseTypes, context, locales) {\n    // 1. Let O be RequireObjectCoercible(this value).\n    let O = RequireObjectCoercible(realm, context);\n\n    // 2. Let S be ToString(O)\n    let S = To.ToString(realm, O.throwIfNotConcrete());\n\n    if (realm.isCompatibleWith(realm.MOBILE_JSC_VERSION) || realm.isCompatibleWith(\"mobile\")) {\n      locales = undefined;\n    } else {\n      // TODO #1013 filter locales for only serialisable values\n      if (locales) locales = locales.serialize();\n    }\n\n    if (realm.useAbstractInterpretation && (type === \"LocaleUpper\" || type === \"LocaleLower\")) {\n      // The locale is environment-dependent\n      AbstractValue.reportIntrospectionError(O);\n      throw new FatalError();\n    }\n\n    // Omit the rest of the arguments. Just use the native impl.\n    return new StringValue(realm, (S: any)[`to${type}Case`](locales));\n  }\n\n  // ECMA-262 21.1.3.20\n  // ECMA-402 13.1.2\n  obj.defineNativeMethod(\"toLocaleLowerCase\", 0, (context, [locales]) => {\n    return toCase(\"LocaleLower\", context, locales);\n  });\n\n  // ECMA-262 21.1.3.21\n  // ECMA-402 13.1.3\n  obj.defineNativeMethod(\"toLocaleUpperCase\", 0, (context, [locales]) => {\n    return toCase(\"LocaleUpper\", context, locales);\n  });\n\n  // ECMA262 21.1.3.22\n  obj.defineNativeMethod(\"toLowerCase\", 0, context => {\n    return toCase(\"Lower\", context);\n  });\n\n  // ECMA262 21.1.3.23\n  obj.defineNativeMethod(\"toString\", 0, context => {\n    const target = context instanceof ObjectValue ? context.$StringData : context;\n    if (target instanceof AbstractValue && target.getType() === StringValue) {\n      return target;\n    }\n    // 1. Return ? thisStringValue(this value).\n    return To.thisStringValue(realm, context);\n  });\n\n  // ECMA262 21.1.3.24\n  obj.defineNativeMethod(\"toUpperCase\", 0, context => {\n    return toCase(\"Upper\", context);\n  });\n\n  // ECMA262 21.1.3.25\n  obj.defineNativeMethod(\"trim\", 0, context => {\n    // 1. Let O be ? RequireObjectCoercible(this value).\n    let O = RequireObjectCoercible(realm, context);\n\n    // 2. Let S be ? ToString(O).\n    let S = To.ToString(realm, O.throwIfNotConcrete());\n\n    // 3. Let T be a String value that is a copy of S with both leading and trailing white space removed. The definition of white space is the union of WhiteSpace and LineTerminator. When determining whether a Unicode code point is in Unicode general category “Zs”, code unit sequences are interpreted as UTF-16 encoded code point sequences as specified in 6.1.4.\n    let T = S.trim();\n\n    // 4. Return T.\n    return new StringValue(realm, T);\n  });\n\n  // ECMA262 21.1.3.26\n  obj.defineNativeMethod(\"valueOf\", 0, context => {\n    // 1. Return ? thisStringValue(this value).\n    return To.thisStringValue(realm, context);\n  });\n\n  // ECMA262 21.1.3.27\n  obj.defineNativeMethod(realm.intrinsics.SymbolIterator, 0, context => {\n    // 1. Let O be ? RequireObjectCoercible(this value).\n    let O = RequireObjectCoercible(realm, context);\n\n    // 2. Let S be ? ToString(O).\n    let S = To.ToString(realm, O.throwIfNotConcrete());\n\n    // 3. Return CreateStringIterator(S).\n    return Create.CreateStringIterator(realm, new StringValue(realm, S));\n  });\n\n  // B.2.3.1\n  obj.defineNativeMethod(\"substr\", 2, (context, [start, length]) => {\n    // 1. Let O be RequireObjectCoercible(this value).\n    let O = RequireObjectCoercible(realm, context);\n\n    // 2. Let S be ToString(O).\n    let S = To.ToStringPartial(realm, O);\n\n    // 3. ReturnIfAbrupt(S).\n\n    // 4. Let intStart be ToInteger(start).\n    let intStart = To.ToInteger(realm, start);\n\n    // 5. ReturnIfAbrupt(intStart).\n\n    // 6. If length is undefined, let end be +∞; otherwise let end be ToInteger(length).\n    let end;\n    if (!length || length instanceof UndefinedValue) {\n      end = Infinity;\n    } else {\n      end = To.ToInteger(realm, length.throwIfNotConcrete());\n    }\n\n    // 7. ReturnIfAbrupt(end).\n\n    // 8. Let size be the number of code units in S.\n    let size = S.length;\n\n    // 9. If intStart < 0, let intStart be max(size + intStart,0).\n    if (intStart < 0) intStart = Math.max(size + intStart, 0);\n\n    // 10. Let resultLength be min(max(end,0), size – intStart).\n    let resultLength = Math.min(Math.max(end, 0), size - intStart);\n\n    // 11. If resultLength ≤ 0, return the empty String \"\".\n    if (resultLength <= 0) return realm.intrinsics.emptyString;\n\n    // 12. Return a String containing resultLength consecutive code units from S beginning with the code unit at index intStart.\n    return new StringValue(realm, S.slice(intStart, intStart + resultLength));\n  });\n\n  // B.2.3.2\n  obj.defineNativeMethod(\"anchor\", 1, (context, [name]) => {\n    // 1. Let S be the this value.\n    let S = context;\n\n    // 2. // 2. Return ? CreateHTML(S, \"a\", \"name\", name).\n    return Create.CreateHTML(realm, S, \"a\", \"name\", name);\n  });\n\n  // B.2.3.3\n  obj.defineNativeMethod(\"big\", 0, context => {\n    // 1. Let S be the this value.\n    let S = context;\n\n    // 2. Return ? CreateHTML(S, \"big\", \"\", \"\").\n    return Create.CreateHTML(realm, S, \"big\", \"\", \"\");\n  });\n\n  // B.2.3.4\n  obj.defineNativeMethod(\"blink\", 0, context => {\n    // 1. Let S be the this value.\n    let S = context;\n\n    // 2. Return ? CreateHTML(S, \"blink\", \"\", \"\").\n    return Create.CreateHTML(realm, S, \"blink\", \"\", \"\");\n  });\n\n  // B.2.3.5\n  obj.defineNativeMethod(\"bold\", 0, context => {\n    // 1. Let S be the this value.\n    let S = context;\n\n    // 2. Return ? CreateHTML(S, \"b\", \"\", \"\").\n    return Create.CreateHTML(realm, S, \"b\", \"\", \"\");\n  });\n\n  // B.2.3.6\n  obj.defineNativeMethod(\"fixed\", 0, context => {\n    // 1. Let S be the this value.\n    let S = context;\n\n    // 2. Return ? CreateHTML(S, \"tt\", \"\", \"\").\n    return Create.CreateHTML(realm, S, \"tt\", \"\", \"\");\n  });\n\n  // B.2.3.7\n  obj.defineNativeMethod(\"fontcolor\", 1, (context, [color]) => {\n    // 1. Let S be the this value.\n    let S = context;\n\n    // 2. Return ? CreateHTML(S, \"font\", \"color\", color).\n    return Create.CreateHTML(realm, S, \"font\", \"color\", color);\n  });\n\n  // B.2.3.8\n  obj.defineNativeMethod(\"fontsize\", 1, (context, [size]) => {\n    // 1. Let S be the this value.\n    let S = context;\n\n    // 2. Return ? CreateHTML(S, \"font\", \"size\", size).\n    return Create.CreateHTML(realm, S, \"font\", \"size\", size);\n  });\n\n  // B.2.3.9\n  obj.defineNativeMethod(\"italics\", 0, context => {\n    // 1. Let S be the this value.\n    let S = context;\n\n    // 2. Return ? CreateHTML(S, \"i\", \"\", \"\").\n    return Create.CreateHTML(realm, S, \"i\", \"\", \"\");\n  });\n\n  // B.2.3.10\n  obj.defineNativeMethod(\"link\", 1, (context, [url]) => {\n    // 1. Let S be the this value.\n    let S = context;\n\n    // 2. Return ? CreateHTML(S, \"a\", \"href\", url).\n    return Create.CreateHTML(realm, S, \"a\", \"href\", url);\n  });\n\n  // B.2.3.11\n  obj.defineNativeMethod(\"small\", 0, context => {\n    // 1. Let S be the this value.\n    let S = context;\n\n    // 2. Return ? CreateHTML(S, \"small\", \"\", \"\").\n    return Create.CreateHTML(realm, S, \"small\", \"\", \"\");\n  });\n\n  // B.2.3.12\n  obj.defineNativeMethod(\"strike\", 0, context => {\n    // 1. Let S be the this value.\n    let S = context;\n\n    // 2. Return ? CreateHTML(S, \"strike\", \"\", \"\").\n    return Create.CreateHTML(realm, S, \"strike\", \"\", \"\");\n  });\n\n  // B.2.3.13\n  obj.defineNativeMethod(\"sub\", 0, context => {\n    // 1. Let S be the this value.\n    let S = context;\n\n    // 2. Return ? CreateHTML(S, \"sub\", \"\", \"\").\n    return Create.CreateHTML(realm, S, \"sub\", \"\", \"\");\n  });\n\n  // B.2.3.14\n  obj.defineNativeMethod(\"sup\", 0, context => {\n    // 1. Let S be the this value.\n    let S = context;\n\n    // 2. Return ? CreateHTML(S, \"sup\", \"\", \"\").\n    return Create.CreateHTML(realm, S, \"sup\", \"\", \"\");\n  });\n\n  return obj;\n}\n"
  },
  {
    "path": "src/intrinsics/ecma262/Symbol.js",
    "content": "/**\n * Copyright (c) 2017-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n/* @flow strict-local */\n\nimport type { Realm } from \"../../realm.js\";\nimport { AbstractValue, NativeFunctionValue, StringValue, SymbolValue, UndefinedValue } from \"../../values/index.js\";\nimport { To } from \"../../singletons.js\";\nimport { SameValue } from \"../../methods/abstract.js\";\n\nexport default function(realm: Realm): NativeFunctionValue {\n  // ECMA262 19.4.1.1\n  let func = new NativeFunctionValue(realm, \"Symbol\", \"Symbol\", 0, (context, [description], argCount, NewTarget) => {\n    // 1. If NewTarget is not undefined, throw a TypeError exception.\n    if (NewTarget) {\n      throw realm.createErrorThrowCompletion(realm.intrinsics.TypeError);\n    }\n\n    // 2. If description is undefined, let descString be undefined.\n    let descString;\n    if (!description || description instanceof UndefinedValue) {\n      descString = undefined;\n    } else if (description instanceof AbstractValue) {\n      descString = description;\n    } else {\n      // 3. Else, let descString be ? ToString(description).\n      descString = To.ToStringPartial(realm, description);\n      descString = new StringValue(realm, descString);\n    }\n    // 4. Return a new unique Symbol value whose [[Description]] value is descString.\n    return new SymbolValue(realm, descString);\n  });\n\n  // ECMA262 19.4.2.1\n  func.defineNativeMethod(\"for\", 1, (context, [key]) => {\n    // 1. Let stringKey be ? ToString(key).\n    let stringKey = To.ToStringPartial(realm, key);\n    stringKey = new StringValue(realm, stringKey);\n\n    // 2. For each element e of the GlobalSymbolRegistry List,\n    for (let e of realm.globalSymbolRegistry) {\n      // a. If SameValue(e.[[Key]], stringKey) is true, return e.[[Symbol]].\n      if (e.$Key === stringKey.value) {\n        return e.$Symbol;\n      }\n    }\n\n    // 3. Assert: GlobalSymbolRegistry does not currently contain an entry for stringKey.\n\n    // 4. Let newSymbol be a new unique Symbol value whose [[Description]] value is stringKey.\n    let newSymbol = new SymbolValue(realm, stringKey);\n\n    // 5. Append the Record { [[Key]]: stringKey, [[Symbol]]: newSymbol } to the GlobalSymbolRegistry List.\n    realm.globalSymbolRegistry.push({ $Key: stringKey.value, $Symbol: newSymbol });\n\n    // 6. Return newSymbol.\n    return newSymbol;\n  });\n\n  // ECMA262 19.4.2.2\n  func.defineNativeMethod(\"keyFor\", 1, (context, [sym]) => {\n    // 1. If Type(sym) is not Symbol, throw a TypeError exception.\n    if (!(sym instanceof SymbolValue)) {\n      throw realm.createErrorThrowCompletion(realm.intrinsics.TypeError, \"Type(sym) is not Symbol\");\n    }\n\n    // 2. For each element e of the GlobalSymbolRegistry List (see 19.4.2.1),\n    for (let e of realm.globalSymbolRegistry) {\n      // a. If SameValue(e.[[Symbol]], sym) is true, return e.[[Key]].\n      if (SameValue(realm, e.$Symbol, sym) === true) {\n        return new StringValue(realm, e.$Key);\n      }\n    }\n\n    // 3. Assert: GlobalSymbolRegistry does not currently contain an entry for sym.\n\n    // 4. Return undefined.\n    return realm.intrinsics.undefined;\n  });\n\n  // ECMA262 19.4.2.3\n  func.defineNativeConstant(\"isConcatSpreadable\", realm.intrinsics.SymbolIsConcatSpreadable);\n\n  // ECMA262 19.4.2.10\n  func.defineNativeConstant(\"species\", realm.intrinsics.SymbolSpecies);\n\n  // ECMA262 19.4.2.8\n  func.defineNativeConstant(\"replace\", realm.intrinsics.SymbolReplace);\n\n  // ECMA262 19.4.2.4\n  func.defineNativeConstant(\"iterator\", realm.intrinsics.SymbolIterator);\n\n  // ECMA262 19.4.2.2\n  func.defineNativeConstant(\"hasInstance\", realm.intrinsics.SymbolHasInstance);\n\n  // ECMA262 19.4.2.12\n  func.defineNativeConstant(\"toPrimitive\", realm.intrinsics.SymbolToPrimitive);\n\n  // ECMA262 19.4.2.13\n  func.defineNativeConstant(\"toStringTag\", realm.intrinsics.SymbolToStringTag);\n\n  // ECMA262 19.4.2.14\n  func.defineNativeConstant(\"unscopables\", realm.intrinsics.SymbolUnscopables);\n\n  // ECMA262 19.4.2.6\n  func.defineNativeConstant(\"match\", realm.intrinsics.SymbolMatch);\n\n  // ECMA262 19.4.2.11\n  func.defineNativeConstant(\"split\", realm.intrinsics.SymbolSplit);\n\n  // ECMA262 19.4.2.9\n  func.defineNativeConstant(\"search\", realm.intrinsics.SymbolSearch);\n\n  return func;\n}\n"
  },
  {
    "path": "src/intrinsics/ecma262/SymbolPrototype.js",
    "content": "/**\n * Copyright (c) 2017-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n/* @flow strict-local */\n\nimport type { Realm } from \"../../realm.js\";\nimport { ObjectValue, StringValue, SymbolValue, AbstractValue } from \"../../values/index.js\";\nimport { SymbolDescriptiveString } from \"../../methods/index.js\";\nimport invariant from \"../../invariant.js\";\n\nexport default function(realm: Realm, obj: ObjectValue): void {\n  const tsTemplateSrc = \"('' + A)\";\n\n  // ECMA262 19.4.3.2\n  obj.defineNativeMethod(\"toString\", 0, context => {\n    const target = context instanceof ObjectValue ? context.$SymbolData : context;\n    if (target instanceof AbstractValue && target.getType() === SymbolValue) {\n      return AbstractValue.createFromTemplate(realm, tsTemplateSrc, StringValue, [target]);\n    }\n    // 1. Let s be the this value.\n    let s = context.throwIfNotConcrete();\n\n    // 2. If Type(s) is Symbol, let sym be s.\n    let sym;\n    if (s instanceof SymbolValue) {\n      sym = s;\n    } else {\n      // 3. Else,\n      // a. If Type(s) is not Object, throw a TypeError exception.\n      if (!(s instanceof ObjectValue)) {\n        throw realm.createErrorThrowCompletion(realm.intrinsics.TypeError);\n      }\n\n      // b. If s does not have a [[SymbolData]] internal slot, throw a TypeError exception.\n      if (!s.$SymbolData) {\n        throw realm.createErrorThrowCompletion(realm.intrinsics.TypeError);\n      }\n\n      // c. Let sym be the value of s's [[SymbolData]] internal slot.\n      sym = s.$SymbolData;\n    }\n    sym.throwIfNotConcreteSymbol();\n    invariant(sym instanceof SymbolValue, \"expected symbol data internal slot to be a symbol value\");\n    // 4. Return SymbolDescriptiveString(sym).\n    return new StringValue(realm, SymbolDescriptiveString(realm, sym));\n  });\n\n  // ECMA262 19.4.3.3\n  obj.defineNativeMethod(\"valueOf\", 0, context => {\n    // 1. Let s be the this value.\n    let s = context.throwIfNotConcrete();\n\n    // 2. If Type(s) is Symbol, return s.\n    if (s instanceof SymbolValue) return s;\n\n    // 3. If Type(s) is not Object, throw a TypeError exception.\n    if (!(s instanceof ObjectValue)) {\n      throw realm.createErrorThrowCompletion(realm.intrinsics.TypeError);\n    }\n\n    // 4. If s does not have a [[SymbolData]] internal slot, throw a TypeError exception.\n    if (!s.$SymbolData) {\n      throw realm.createErrorThrowCompletion(realm.intrinsics.TypeError);\n    }\n\n    // 5. Return the value of s's [[SymbolData]] internal slot.\n    return s.$SymbolData;\n  });\n\n  // ECMA262 19.4.3.4\n  obj.defineNativeMethod(\n    realm.intrinsics.SymbolToPrimitive,\n    1,\n    (context, [hint]) => {\n      // 1. Let s be the this value.\n      let s = context.throwIfNotConcrete();\n\n      // 2. If Type(s) is Symbol, return s.\n      if (s instanceof SymbolValue) return s;\n\n      // 3. If Type(s) is not Object, throw a TypeError exception.\n      if (!(s instanceof ObjectValue)) {\n        throw realm.createErrorThrowCompletion(realm.intrinsics.TypeError);\n      }\n\n      // 4. If s does not have a [[SymbolData]] internal slot, throw a TypeError exception.\n      if (!s.$SymbolData) {\n        throw realm.createErrorThrowCompletion(realm.intrinsics.TypeError);\n      }\n\n      // 5. Return s.[[SymbolData]].\n      return s.$SymbolData;\n    },\n    { writable: false }\n  );\n\n  // ECMA262 19.4.3.5\n  obj.defineNativeProperty(realm.intrinsics.SymbolToStringTag, new StringValue(realm, \"Symbol\"), { writable: false });\n}\n"
  },
  {
    "path": "src/intrinsics/ecma262/SyntaxError.js",
    "content": "/**\n * Copyright (c) 2017-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n/* @flow strict-local */\n\nimport type { Realm } from \"../../realm.js\";\nimport type { NativeFunctionValue } from \"../../values/index.js\";\nimport { build } from \"./Error.js\";\n\nexport default function(realm: Realm): NativeFunctionValue {\n  return build(\"SyntaxError\", realm);\n}\n"
  },
  {
    "path": "src/intrinsics/ecma262/SyntaxErrorPrototype.js",
    "content": "/**\n * Copyright (c) 2017-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n/* @flow strict-local */\n\nimport type { Realm } from \"../../realm.js\";\nimport { ObjectValue, StringValue } from \"../../values/index.js\";\n\nexport default function(realm: Realm, obj: ObjectValue): void {\n  obj.defineNativeProperty(\"name\", new StringValue(realm, \"SyntaxError\"));\n  obj.defineNativeProperty(\"message\", realm.intrinsics.emptyString);\n}\n"
  },
  {
    "path": "src/intrinsics/ecma262/ThrowTypeError.js",
    "content": "/**\n * Copyright (c) 2017-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n/* @flow strict-local */\n\nimport type { Realm } from \"../../realm.js\";\nimport { NativeFunctionValue } from \"../../values/index.js\";\nimport { PropertyDescriptor } from \"../../descriptors.js\";\n\nexport default function(realm: Realm): NativeFunctionValue {\n  // ECMA262 9.2.7.1\n  let func = new NativeFunctionValue(realm, \"(function() { throw new TypeError(); })\", \"\", 0, context => {\n    throw realm.createErrorThrowCompletion(realm.intrinsics.TypeError);\n  });\n\n  // ECMA262 9.2.7.1\n  func.setExtensible(false);\n\n  // ECMA262 9.2.7.1\n  func.$DefineOwnProperty(\n    \"length\",\n    new PropertyDescriptor({\n      value: realm.intrinsics.zero,\n      writable: false,\n      configurable: false,\n      enumerable: false,\n    })\n  );\n\n  return func;\n}\n"
  },
  {
    "path": "src/intrinsics/ecma262/TypeError.js",
    "content": "/**\n * Copyright (c) 2017-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n/* @flow strict-local */\n\nimport type { Realm } from \"../../realm.js\";\nimport type { NativeFunctionValue } from \"../../values/index.js\";\nimport { build } from \"./Error.js\";\n\nexport default function(realm: Realm): NativeFunctionValue {\n  return build(\"TypeError\", realm);\n}\n"
  },
  {
    "path": "src/intrinsics/ecma262/TypeErrorPrototype.js",
    "content": "/**\n * Copyright (c) 2017-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n/* @flow strict-local */\n\nimport type { Realm } from \"../../realm.js\";\nimport { ObjectValue, StringValue } from \"../../values/index.js\";\n\nexport default function(realm: Realm, obj: ObjectValue): void {\n  obj.defineNativeProperty(\"name\", new StringValue(realm, \"TypeError\"));\n  obj.defineNativeProperty(\"message\", realm.intrinsics.emptyString);\n}\n"
  },
  {
    "path": "src/intrinsics/ecma262/TypedArray.js",
    "content": "/**\n * Copyright (c) 2017-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n/* @flow strict-local */\n\nimport type { Realm } from \"../../realm.js\";\nimport type { ElementType, TypedArrayKind } from \"../../types.js\";\nimport { ElementSize } from \"../../types.js\";\nimport { NumberValue, NativeFunctionValue, ObjectValue, StringValue, UndefinedValue } from \"../../values/index.js\";\nimport {\n  ArrayElementSize,\n  ArrayElementType,\n  AllocateTypedArray,\n  AllocateTypedArrayBuffer,\n  TypedArrayCreate,\n} from \"../../methods/typedarray.js\";\nimport { SpeciesConstructor } from \"../../methods/construct.js\";\nimport { Get, GetMethod } from \"../../methods/get.js\";\nimport { Properties, To } from \"../../singletons.js\";\nimport { IterableToList } from \"../../methods/iterator.js\";\nimport { IsDetachedBuffer, IsConstructor, IsCallable } from \"../../methods/is.js\";\nimport { Call } from \"../../methods/call.js\";\nimport {\n  CloneArrayBuffer,\n  AllocateArrayBuffer,\n  GetValueFromBuffer,\n  SetValueInBuffer,\n} from \"../../methods/arraybuffer.js\";\nimport invariant from \"../../invariant.js\";\n\nexport default function(realm: Realm): NativeFunctionValue {\n  let func = new NativeFunctionValue(realm, \"TypedArray\", \"TypedArray\", 0, context => {\n    // 1. Throw a TypeError exception.\n    throw realm.createErrorThrowCompletion(realm.intrinsics.TypeError, \"TypedArray\");\n  });\n\n  // ECMA262 22.2.2.1\n  func.defineNativeMethod(\"from\", 1, (context, [source, mapfn, thisArg]) => {\n    // 1. Let C be the this value.\n    let C = context;\n\n    // 2. If IsConstructor(C) is false, throw a TypeError exception.\n    if (IsConstructor(realm, C) === false) {\n      throw realm.createErrorThrowCompletion(realm.intrinsics.TypeError, \"IsConstructor(C) is false\");\n    }\n    invariant(C instanceof ObjectValue);\n\n    let mapping;\n    // 3. If mapfn was supplied and mapfn is not undefined, then\n    if (mapfn !== undefined && !mapfn.mightBeUndefined()) {\n      // a. If IsCallable(mapfn) is false, throw a TypeError exception.\n      if (IsCallable(realm, mapfn) === false) {\n        throw realm.createErrorThrowCompletion(realm.intrinsics.TypeError, \"IsConstructor(C) is false\");\n      }\n\n      // b. Let mapping be true.\n      mapping = true;\n    } else {\n      // 4. Else, let mapping be false.\n      mapfn === undefined || mapfn.throwIfNotConcrete();\n      mapping = false;\n    }\n\n    // 5. If thisArg was supplied, let T be thisArg; else let T be undefined.\n    let T = thisArg !== undefined ? thisArg : realm.intrinsics.undefined;\n\n    // 6. Let usingIterator be ? GetMethod(source, @@iterator).\n    let usingIterator = GetMethod(realm, source, realm.intrinsics.SymbolIterator);\n\n    // 7. If usingIterator is not undefined, then\n    if (!(usingIterator instanceof UndefinedValue)) {\n      // a. Let values be ? IterableToList(source, usingIterator).\n      let values = IterableToList(realm, source, usingIterator);\n\n      // b. Let len be the number of elements in values.\n      let len = values.length;\n\n      // c. Let targetObj be ? TypedArrayCreate(C, «len»).\n      let targetObj = TypedArrayCreate(realm, C, [new NumberValue(realm, len)]);\n\n      // d. Let k be 0.\n      let k = 0;\n\n      // e. Repeat, while k < len\n      while (k < len) {\n        // i. Let Pk be ! ToString(k).\n        let Pk = To.ToString(realm, new NumberValue(realm, k));\n\n        // ii. Let kValue be the first element of values and remove that element from values.\n        let kValue = values.shift();\n\n        let mappedValue;\n        // iii. If mapping is true, then\n        if (mapping === true) {\n          // 1. Let mappedValue be ? Call(mapfn, T, « kValue, k »).\n          mappedValue = Call(realm, mapfn, T, [kValue, new NumberValue(realm, k)]);\n        } else {\n          // iv. Else, let mappedValue be kValue.\n          mappedValue = kValue;\n        }\n\n        // v. Perform ? Set(targetObj, Pk, mappedValue, true).\n        Properties.Set(realm, targetObj, Pk, mappedValue, true);\n\n        // vi. Increase k by 1.\n        k = k + 1;\n      }\n\n      // f. Assert: values is now an empty List.\n      invariant(values.length === 0, \"values is not an empty List\");\n\n      // g. Return targetObj.\n      return targetObj;\n    }\n\n    // 8. NOTE: source is not an Iterable so assume it is already an array-like object.\n\n    // 9. Let arrayLike be ! ToObject(source).\n    let arrayLike = To.ToObject(realm, source);\n\n    // 10. Let len be ? ToLength(? Get(arrayLike, \"length\")).\n    let len = To.ToLength(realm, Get(realm, arrayLike, \"length\"));\n\n    // 11. Let targetObj be ? TypedArrayCreate(C, « len »).\n    let targetObj = TypedArrayCreate(realm, C, [new NumberValue(realm, len)]);\n\n    // 12. Let k be 0.\n    let k = 0;\n\n    // 13. Repeat, while k < len\n    while (k < len) {\n      // a. Let Pk be ! ToString(k).\n      let Pk = To.ToString(realm, new NumberValue(realm, k));\n\n      // b. Let kValue be ? Get(arrayLike, Pk).\n      let kValue = Get(realm, arrayLike, Pk);\n\n      let mappedValue;\n      // c. If mapping is true, then\n      if (mapping === true) {\n        // i. Let mappedValue be ? Call(mapfn, T, « kValue, k »).\n        mappedValue = Call(realm, mapfn, T, [kValue, new NumberValue(realm, k)]);\n      } else {\n        // d. Else, let mappedValue be kValue.\n        mappedValue = kValue;\n      }\n\n      // e. Perform ? Set(targetObj, Pk, mappedValue, true).\n      Properties.Set(realm, targetObj, Pk, mappedValue, true);\n\n      // f. Increase k by 1.\n      k = k + 1;\n    }\n\n    // 14. Return targetObj.\n    return targetObj;\n  });\n\n  // ECMA262 22.2.2.2\n  func.defineNativeMethod(\"of\", 0, (context, items, argCount) => {\n    // 1. Let len be the actual number of arguments passed to this function.\n    let len = argCount;\n\n    // 2. Let items be the List of arguments passed to this function.\n    items;\n\n    // 3. Let C be the this value.\n    let C = context;\n\n    // 4. If IsConstructor(C) is false, throw a TypeError exception.\n    if (IsConstructor(realm, C) === false) {\n      throw realm.createErrorThrowCompletion(realm.intrinsics.TypeError, \"IsConstructor(C) is false\");\n    }\n    invariant(C instanceof ObjectValue);\n\n    // 5. Let newObj be ? TypedArrayCreate(C, « len »).\n    let newObj = TypedArrayCreate(realm, C, [new NumberValue(realm, len)]);\n\n    // 6. Let k be 0.\n    let k = 0;\n\n    // 7. Repeat, while k < len\n    while (k < len) {\n      // a. Let kValue be items[k].\n      let kValue = items[k];\n\n      // b. Let Pk be ! ToString(k).\n      let Pk = To.ToString(realm, new NumberValue(realm, k));\n\n      // c. Perform ? Set(newObj, Pk, kValue, true).\n      Properties.Set(realm, newObj, Pk, kValue, true);\n\n      // d. Increase k by 1.\n      k = k + 1;\n    }\n\n    // 8. Return newObj.\n    return newObj;\n  });\n\n  // ECMA262 22.2.2.4\n  func.defineNativeGetter(realm.intrinsics.SymbolSpecies, context => {\n    // 1. Return the this value\n    return context;\n  });\n\n  return func;\n}\n\n// ECMA262 22.2 Table 50\nfunction getConstructorName(type: ElementType): TypedArrayKind {\n  switch (type) {\n    case \"Float32\":\n      return \"Float32Array\";\n    case \"Float64\":\n      return \"Float64Array\";\n    case \"Int8\":\n      return \"Int8Array\";\n    case \"Int16\":\n      return \"Int16Array\";\n    case \"Int32\":\n      return \"Int32Array\";\n    case \"Uint8\":\n      return \"Uint8Array\";\n    case \"Uint16\":\n      return \"Uint16Array\";\n    case \"Uint32\":\n      return \"Uint32Array\";\n    case \"Uint8Clamped\":\n      return \"Uint8ClampedArray\";\n    default:\n      invariant(false);\n  }\n}\n\nexport function build(realm: Realm, type: ElementType): NativeFunctionValue {\n  let func = new NativeFunctionValue(realm, `${type}Array`, `${type}Array`, 3, (context, args, argCount, NewTarget) => {\n    if (argCount === 0) {\n      // ECMA262 22.2.4.1\n\n      // 1. If NewTarget is undefined, throw a TypeError exception.\n      if (!NewTarget) {\n        throw realm.createErrorThrowCompletion(realm.intrinsics.TypeError, \"NewTarget is undefined\");\n      }\n\n      // 2. Let constructorName be the String value of the Constructor Name value specified in Table 50 for this TypedArray constructor.\n      let constructorName = getConstructorName(type);\n\n      // 3. Return ? AllocateTypedArray(constructorName, NewTarget, \"%TypedArrayPrototype%\", 0).\n      return AllocateTypedArray(realm, constructorName, NewTarget, `${type}ArrayPrototype`, 0);\n    } else if (!(args[0] instanceof ObjectValue)) {\n      // ECMA262 22.2.4.2\n      let length = args[0].throwIfNotConcrete();\n\n      // 1. Assert: Type(length) is not Object.\n      invariant(!(length instanceof ObjectValue), \"Type(length) is not Object\");\n\n      // 2. If NewTarget is undefined, throw a TypeError exception.\n      if (!NewTarget) {\n        throw realm.createErrorThrowCompletion(realm.intrinsics.TypeError, \"NewTarget is undefined\");\n      }\n\n      // 3. Let elementLength be ? ToIndex(length).\n      let elementLength = To.ToIndexPartial(realm, length);\n\n      // 4. Let constructorName be the String value of the Constructor Name value specified in Table 50 for this TypedArray constructor.\n      let constructorName = getConstructorName(type);\n\n      // 5. Return ? AllocateTypedArray(constructorName, NewTarget, \"%TypedArrayPrototype%\", elementLength).\n      return AllocateTypedArray(realm, constructorName, NewTarget, `${type}ArrayPrototype`, elementLength);\n    } else if (\"$TypedArrayName\" in args[0]) {\n      // ECMA262 22.2.4.3\n      let typedArray = args[0].throwIfNotConcrete();\n\n      // 1. Assert: Type(typedArray) is Object and typedArray has a [[TypedArrayName]] internal slot.\n      invariant(typedArray instanceof ObjectValue && typeof typedArray.$TypedArrayName === \"string\");\n\n      // 2. If NewTarget is undefined, throw a TypeError exception.\n      if (!NewTarget) {\n        throw realm.createErrorThrowCompletion(realm.intrinsics.TypeError, \"NewTarget is undefined\");\n      }\n\n      // 3. Let constructorName be the String value of the Constructor Name value specified in Table 50 for this TypedArray constructor.\n      let constructorName = getConstructorName(type);\n\n      // 4. Let O be ? AllocateTypedArray(constructorName, NewTarget, \"%TypedArrayPrototype%\").\n      let O = AllocateTypedArray(realm, constructorName, NewTarget, `${type}ArrayPrototype`);\n\n      // 5. Let srcArray be typedArray.\n      let srcArray = typedArray;\n\n      // 6. Let srcData be srcArray.[[ViewedArrayBuffer]].\n      let srcData = srcArray.$ViewedArrayBuffer;\n      invariant(srcData);\n\n      // 7. If IsDetachedBuffer(srcData) is true, throw a TypeError exception.\n      if (IsDetachedBuffer(realm, srcData) === true) {\n        throw realm.createErrorThrowCompletion(realm.intrinsics.TypeError, \"IsDetachedBuffer(srcData) is true\");\n      }\n\n      // 8. Let constructorName be the String value of O.[[TypedArrayName]].\n      constructorName = O.$TypedArrayName;\n      invariant(typeof constructorName === \"string\");\n\n      // 9. Let elementType be the String value of the Element Type value in Table 50 for constructorName.\n      let elementType = ArrayElementType[constructorName];\n\n      // 10. Let elementLength be srcArray.[[ArrayLength]].\n      let elementLength = srcArray.$ArrayLength;\n      invariant(typeof elementLength === \"number\");\n\n      // 11. Let srcName be the String value of srcArray.[[TypedArrayName]].\n      let srcName = srcArray.$TypedArrayName;\n      invariant(typeof srcName === \"string\");\n\n      // 12. Let srcType be the String value of the Element Type value in Table 50 for srcName.\n      let srcType = ArrayElementType[srcName];\n\n      // 13. Let srcElementSize be the Element Size value in Table 50 for srcName.\n      let srcElementSize = ArrayElementSize[srcName];\n\n      // 14. Let srcByteOffset be srcArray.[[ByteOffset]].\n      let srcByteOffset = srcArray.$ByteOffset;\n      invariant(typeof srcByteOffset === \"number\");\n\n      // 15. Let elementSize be the Element Size value in Table 50 for constructorName.\n      let elementSize = ArrayElementSize[constructorName];\n\n      // 16. Let byteLength be elementSize × elementLength.\n      let byteLength = elementSize * elementLength;\n\n      let data;\n      // 17. If SameValue(elementType, srcType) is true, then\n      if (elementType === srcType) {\n        // a. Let data be ? CloneArrayBuffer(srcData, srcByteOffset).\n        data = CloneArrayBuffer(realm, srcData, srcByteOffset);\n      } else {\n        // 18. Else,\n        // a. Let bufferConstructor be ? SpeciesConstructor(srcData, %ArrayBuffer%).\n        let bufferConstructor = SpeciesConstructor(realm, srcData, realm.intrinsics.ArrayBuffer);\n\n        // b. Let data be ? AllocateArrayBuffer(bufferConstructor, byteLength).\n        data = AllocateArrayBuffer(realm, bufferConstructor, byteLength);\n\n        // c. If IsDetachedBuffer(srcData) is true, throw a TypeError exception.\n        if (IsDetachedBuffer(realm, srcData) === true) {\n          throw realm.createErrorThrowCompletion(realm.intrinsics.TypeError, \"IsDetachedBuffer(srcData) is true\");\n        }\n\n        // d. Let srcByteIndex be srcByteOffset.\n        let srcByteIndex = srcByteOffset;\n\n        // e. Let targetByteIndex be 0.\n        let targetByteIndex = 0;\n\n        // f. Let count be elementLength.\n        let count = elementLength;\n\n        // g. Repeat, while count > 0\n        while (count > 0) {\n          // i. Let value be GetValueFromBuffer(srcData, srcByteIndex, srcType).\n          let value = GetValueFromBuffer(realm, srcData, srcByteIndex, srcType);\n\n          // ii. Perform SetValueInBuffer(data, targetByteIndex, elementType, value).\n          SetValueInBuffer(realm, data, targetByteIndex, elementType, value.value);\n\n          // iii. Set srcByteIndex to srcByteIndex + srcElementSize.\n          srcByteIndex = srcByteIndex + srcElementSize;\n\n          // iv. Set targetByteIndex to targetByteIndex + elementSize.\n          targetByteIndex = targetByteIndex + elementSize;\n\n          // v. Decrement count by 1.\n          count -= 1;\n        }\n      }\n\n      // 19. Set O.[[ViewedArrayBuffer]] to data.\n      O.$ViewedArrayBuffer = data;\n\n      // 20. Set O.[[ByteLength]] to byteLength.\n      O.$ByteLength = byteLength;\n\n      // 21. Set O.[[ByteOffset]] to 0.\n      O.$ByteOffset = 0;\n\n      // 22. Set O.[[ArrayLength]] to elementLength.\n      O.$ArrayLength = elementLength;\n\n      // 23. Return O.\n      return O;\n    } else if (!(\"$ArrayBufferData\" in args[0]) && !(\"$TypedArrayName\" in args[0])) {\n      // ECMA262 22.2.4.4\n      let object = args[0].throwIfNotConcrete();\n\n      // 1. Assert: Type(object) is Object and object does not have either a [[TypedArrayName]] or an [[ArrayBufferData]] internal slot.\n      invariant(object instanceof ObjectValue && typeof object.$TypedArrayName && !object.$ArrayBufferData);\n\n      // 2. If NewTarget is undefined, throw a TypeError exception.\n      if (!NewTarget) {\n        throw realm.createErrorThrowCompletion(realm.intrinsics.TypeError, \"NewTarget is undefined\");\n      }\n\n      // 3. Let constructorName be the String value of the Constructor Name value specified in Table 50 for this TypedArray constructor.\n      let constructorName = getConstructorName(type);\n\n      // 4. Let O be ? AllocateTypedArray(constructorName, NewTarget, \"%TypedArrayPrototype%\").\n      let O = AllocateTypedArray(realm, constructorName, NewTarget, `${type}ArrayPrototype`);\n\n      // 5. Let usingIterator be ? GetMethod(object, @@iterator).\n      let usingIterator = GetMethod(realm, object, realm.intrinsics.SymbolIterator);\n\n      // 6. If usingIterator is not undefined, then\n      if (!(usingIterator instanceof UndefinedValue)) {\n        // a. Let values be ? IterableToList(object, usingIterator).\n        let values = IterableToList(realm, object, usingIterator);\n\n        // b. Let len be the number of elements in values.\n        let len = values.length;\n\n        // c. Perform ? AllocateTypedArrayBuffer(O, len).\n        AllocateTypedArrayBuffer(realm, O, len);\n\n        // d. Let k be 0.\n        let k = 0;\n\n        // e. Repeat, while k < len\n        while (k < len) {\n          // i. Let Pk be ! ToString(k).\n          let Pk = new StringValue(realm, To.ToString(realm, new NumberValue(realm, k)));\n\n          // ii. Let kValue be the first element of values and remove that element from values.\n          let kValue = values.shift();\n\n          // iii. Perform ? Set(O, Pk, kValue, true).\n          Properties.Set(realm, O, Pk, kValue, true);\n\n          // iv. Increase k by 1.\n          k = k + 1;\n        }\n\n        // f. Assert: values is now an empty List.\n        invariant(values.length === 0);\n\n        // g. Return O.\n        return O;\n      }\n\n      // 7. NOTE: object is not an Iterable so assume it is already an array-like object.\n\n      // 8. Let arrayLike be object.\n      let arrayLike = object;\n\n      // 9. Let len be ? ToLength(? Get(arrayLike, \"length\")).\n      let len = To.ToLength(realm, Get(realm, arrayLike, \"length\"));\n\n      // 10. Perform ? AllocateTypedArrayBuffer(O, len).\n      AllocateTypedArrayBuffer(realm, O, len);\n\n      // 11. Let k be 0.\n      let k = 0;\n\n      // 12. Repeat, while k < len\n      while (k < len) {\n        // a. Let Pk be ! ToString(k).\n        let Pk = new StringValue(realm, To.ToString(realm, new NumberValue(realm, k)));\n\n        // b. Let kValue be ? Get(arrayLike, Pk).\n        let kValue = Get(realm, arrayLike, Pk);\n\n        // c. Perform ? Set(O, Pk, kValue, true).\n        Properties.Set(realm, O, Pk, kValue, true);\n\n        // d. Increase k by 1.\n        k += 1;\n      }\n\n      // 13. Return O.\n      return O;\n    } else {\n      // ECMA262 22.2.4.5\n      let buffer = args[0].throwIfNotConcrete(),\n        byteOffset = args[1],\n        length = args[2];\n\n      // 1. Assert: Type(buffer) is Object and buffer has an [[ArrayBufferData]] internal slot.\n      invariant(buffer instanceof ObjectValue && \"$ArrayBufferData\" in buffer);\n\n      // 2. If NewTarget is undefined, throw a TypeError exception.\n      if (!NewTarget) {\n        throw realm.createErrorThrowCompletion(realm.intrinsics.TypeError, \"NewTarget is undefined\");\n      }\n\n      // 3. Let constructorName be the String value of the Constructor Name value specified in Table 50 for this TypedArray constructor.\n      let constructorName = getConstructorName(type);\n\n      // 4. Let O be ? AllocateTypedArray(constructorName, NewTarget, \"%TypedArrayPrototype%\").\n      let O = AllocateTypedArray(realm, constructorName, NewTarget, `${type}ArrayPrototype`);\n\n      // 5. Let constructorName be the String value of O.[[TypedArrayName]].\n      constructorName = O.$TypedArrayName;\n      invariant(constructorName);\n\n      // 6. Let elementSize be the Number value of the Element Size value in Table 50 for constructorName.\n      let elementSize = ArrayElementSize[constructorName];\n\n      // 7. Let offset be ? ToIndex(byteOffset).\n      let offset = To.ToIndexPartial(realm, byteOffset);\n\n      // 8. If offset modulo elementSize ≠ 0, throw a RangeError exception.\n      if (offset % elementSize !== 0) {\n        throw realm.createErrorThrowCompletion(realm.intrinsics.RangeError, \"offset modulo elementSize ≠ 0\");\n      }\n\n      // 9. If IsDetachedBuffer(buffer) is true, throw a TypeError exception.\n      if (IsDetachedBuffer(realm, buffer) === true) {\n        throw realm.createErrorThrowCompletion(realm.intrinsics.TypeError, \"IsDetachedBuffer(buffer) is true\");\n      }\n\n      // 10. Let bufferByteLength be buffer.[[ArrayBufferByteLength]].\n      let bufferByteLength = buffer.$ArrayBufferByteLength;\n      invariant(typeof bufferByteLength === \"number\");\n\n      let newByteLength;\n      // 11. If length is either not present or undefined, then\n      if (!length || length instanceof UndefinedValue) {\n        // a. If bufferByteLength modulo elementSize ≠ 0, throw a RangeError exception.\n        if (bufferByteLength % elementSize !== 0) {\n          throw realm.createErrorThrowCompletion(\n            realm.intrinsics.RangeError,\n            \"bufferByteLength modulo elementSize ≠ 0\"\n          );\n        }\n        // b. Let newByteLength be bufferByteLength - offset.\n        newByteLength = bufferByteLength - offset;\n\n        // c. If newByteLength < 0, throw a RangeError exception.\n        if (newByteLength < 0) {\n          throw realm.createErrorThrowCompletion(realm.intrinsics.RangeError, \"newByteLength < 0\");\n        }\n      } else {\n        // 12. Else,\n        // a. Let newLength be ? ToIndex(length).\n        let newLength = To.ToIndexPartial(realm, length);\n\n        // b. Let newByteLength be newLength × elementSize.\n        newByteLength = newLength * elementSize;\n\n        // c. If offset+newByteLength > bufferByteLength, throw a RangeError exception.\n        if (offset + newByteLength > bufferByteLength) {\n          throw realm.createErrorThrowCompletion(\n            realm.intrinsics.RangeError,\n            \"offset+newByteLength > bufferByteLength\"\n          );\n        }\n      }\n\n      // 13. Set O.[[ViewedArrayBuffer]] to buffer.\n      O.$ViewedArrayBuffer = buffer;\n\n      // 14. Set O.[[ByteLength]] to newByteLength.\n      O.$ByteLength = newByteLength;\n\n      // 15. Set O.[[ByteOffset]] to offset.\n      O.$ByteOffset = offset;\n\n      // 16. Set O.[[ArrayLength]] to newByteLength / elementSize.\n      O.$ArrayLength = newByteLength / elementSize;\n\n      // 17. Return O.\n      return O;\n    }\n  });\n\n  // ECMA262 22.2.5\n  func.$Prototype = realm.intrinsics.TypedArray;\n\n  // ECMA262 22.2.5.1\n  func.defineNativeConstant(\"BYTES_PER_ELEMENT\", new NumberValue(realm, ElementSize[type]));\n\n  return func;\n}\n"
  },
  {
    "path": "src/intrinsics/ecma262/TypedArrayProto_values.js",
    "content": "/**\n * Copyright (c) 2017-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n/* @flow strict-local */\n\nimport type { Realm } from \"../../realm.js\";\nimport { NativeFunctionValue } from \"../../values/index.js\";\nimport { Create, To } from \"../../singletons.js\";\nimport { ValidateTypedArray } from \"../../methods/typedarray.js\";\n\nexport default function(realm: Realm): NativeFunctionValue {\n  // ECMA262 22.1.3.30\n  return new NativeFunctionValue(realm, \"Array.prototype.values\", \"values\", 0, context => {\n    // 1. Let O be ? ToObject(this value).\n    let O = To.ToObject(realm, context);\n\n    // 2. Perform ? ValidateTypedArray(O).\n    ValidateTypedArray(realm, O);\n\n    // 3. Return CreateArrayIterator(O, \"value\").\n    return Create.CreateArrayIterator(realm, O.throwIfNotConcreteObject(), \"value\");\n  });\n}\n"
  },
  {
    "path": "src/intrinsics/ecma262/TypedArrayPrototype.js",
    "content": "/**\n * Copyright (c) 2017-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n/* @flow strict-local */\n\nimport type { Realm } from \"../../realm.js\";\nimport type { ElementType } from \"../../types.js\";\nimport { ElementSize } from \"../../types.js\";\nimport { ObjectValue, StringValue, NumberValue, UndefinedValue, NullValue } from \"../../values/index.js\";\nimport { Call, Invoke } from \"../../methods/call.js\";\nimport { Get } from \"../../methods/get.js\";\nimport { HasProperty, HasSomeCompatibleType } from \"../../methods/has.js\";\nimport { IsDetachedBuffer, IsCallable } from \"../../methods/is.js\";\nimport {\n  ArrayElementSize,\n  ArrayElementType,\n  ValidateTypedArray,\n  TypedArraySpeciesCreate,\n  IntegerIndexedElementSet,\n  IntegerIndexedElementGet,\n} from \"../../methods/typedarray.js\";\nimport { SetValueInBuffer, GetValueFromBuffer, CloneArrayBuffer } from \"../../methods/arraybuffer.js\";\nimport { SameValue, SameValueZeroPartial, StrictEqualityComparisonPartial } from \"../../methods/abstract.js\";\nimport { Create, Properties, To } from \"../../singletons.js\";\nimport invariant from \"../../invariant.js\";\n\nexport default function(realm: Realm, obj: ObjectValue): void {\n  // ECMA262 22.2.3.1\n  obj.defineNativeGetter(\"buffer\", context => {\n    // 1. Let O be the this value.\n    let O = context.throwIfNotConcrete();\n\n    // 2. If Type(O) is not Object, return undefined.\n    if (!(O instanceof ObjectValue)) {\n      throw realm.createErrorThrowCompletion(realm.intrinsics.TypeError, \"Type(O) is not Object\");\n    }\n\n    // 3. If O does not have a [[TypedArrayName]] internal slot, throw a TypeError exception.\n    if (!(\"$TypedArrayName\" in O)) {\n      throw realm.createErrorThrowCompletion(\n        realm.intrinsics.TypeError,\n        \"O does not have a [[TypedArrayName]] internal slot\"\n      );\n    }\n\n    // 4. Assert: O has a [[ViewedArrayBuffer]] internal slot.\n    invariant(O.$ViewedArrayBuffer, \"O has a [[ViewedArrayBuffer]]\");\n\n    // 5. Let buffer be O.[[ViewedArrayBuffer]].\n    let buffer = O.$ViewedArrayBuffer;\n\n    // 6. Return buffer.\n    return buffer;\n  });\n\n  // ECMA262 22.2.3.2\n  obj.defineNativeGetter(\"byteLength\", context => {\n    // 1. Let O be the this value.\n    let O = context.throwIfNotConcrete();\n\n    // 2. If Type(O) is not Object, throw a TypeError exception.\n    if (!(O instanceof ObjectValue)) {\n      throw realm.createErrorThrowCompletion(realm.intrinsics.TypeError, \"Type(O) is not Object\");\n    }\n\n    // 3. If O does not have a [[TypedArrayName]] internal slot, throw a TypeError exception.\n    if (!(\"$TypedArrayName\" in O)) {\n      throw realm.createErrorThrowCompletion(\n        realm.intrinsics.TypeError,\n        \"O does not have a [[TypedArrayName]] internal slot\"\n      );\n    }\n\n    // 4. Assert: O has [[ViewedArrayBuffer]] and [[ArrayLength]] internal slots.\n    invariant(O.$ViewedArrayBuffer, \"O has a [[ViewedArrayBuffer]] internal slot\");\n\n    // 5. Let buffer be O.[[ViewedArrayBuffer]].\n    let buffer = O.$ViewedArrayBuffer;\n    invariant(buffer);\n\n    // 6. If IsDetachedBuffer(buffer) is true, return 0.\n    if (IsDetachedBuffer(realm, buffer) === true) return realm.intrinsics.zero;\n\n    // 7. Let size be O.[[ByteLength]].\n    let size = O.$ByteLength;\n    invariant(typeof size === \"number\");\n\n    // 8. Return size.\n    return new NumberValue(realm, size);\n  });\n\n  // ECMA262 22.2.3.3\n  obj.defineNativeGetter(\"byteOffset\", context => {\n    // 1. Let O be the this value.\n    let O = context.throwIfNotConcrete();\n\n    // 2. If Type(O) is not Object, throw a TypeError exception.\n    if (!(O instanceof ObjectValue)) {\n      throw realm.createErrorThrowCompletion(realm.intrinsics.TypeError, \"Type(O) is not Object\");\n    }\n\n    // 3. If O does not have a [[TypedArrayName]] internal slot, throw a TypeError exception.\n    if (!(\"$TypedArrayName\" in O)) {\n      throw realm.createErrorThrowCompletion(\n        realm.intrinsics.TypeError,\n        \"O does not have a [[TypedArrayName]] internal slot\"\n      );\n    }\n\n    // 4. Assert: O has [[ViewedArrayBuffer]] and [[ArrayLength]] internal slots.\n    invariant(O.$ViewedArrayBuffer, \"O has a [[ViewedArrayBuffer]] internal slot\");\n\n    // 5. Let buffer be O.[[ViewedArrayBuffer]].\n    let buffer = O.$ViewedArrayBuffer;\n    invariant(buffer);\n\n    // 6. If IsDetachedBuffer(buffer) is true, return 0.\n    if (IsDetachedBuffer(realm, buffer) === true) return realm.intrinsics.zero;\n\n    // 7. Let offset be O.[[ByteOffset]].\n    let offset = O.$ByteOffset;\n    invariant(typeof offset === \"number\");\n\n    // 8. Return offset.\n    return new NumberValue(realm, offset);\n  });\n\n  // ECMA262 22.2.3.5\n  obj.defineNativeMethod(\"copyWithin\", 2, (context, [target, start, end]) => {\n    // 1. Let O be ? ToObject(this value).\n    let O = To.ToObject(realm, context);\n\n    // 2. Perform ? ValidateTypedArray(O).\n    ValidateTypedArray(realm, O);\n\n    // 3. Let len be O.[[ArrayLength]].\n    let len = O.throwIfNotConcreteObject().$ArrayLength;\n    invariant(typeof len === \"number\");\n\n    // 4. Let relativeTarget be ? ToInteger(target).\n    let relativeTarget = To.ToInteger(realm, target);\n\n    // 5. If relativeTarget < 0, let to be max((len + relativeTarget), 0); else let to be min(relativeTarget, len).\n    let to = relativeTarget < 0 ? Math.max(len + relativeTarget, 0) : Math.min(relativeTarget, len);\n\n    // 6. Let relativeStart be ? ToInteger(start).\n    let relativeStart = To.ToInteger(realm, start);\n\n    // 7. If relativeStart < 0, let from be max((len + relativeStart), 0); else let from be min(relativeStart, len).\n    let from = relativeStart < 0 ? Math.max(len + relativeStart, 0) : Math.min(relativeStart, len);\n\n    // 8. If end is undefined, let relativeEnd be len; else let relativeEnd be ? ToInteger(end).\n    let relativeEnd = !end || end instanceof UndefinedValue ? len : To.ToInteger(realm, end.throwIfNotConcrete());\n\n    // 9. If relativeEnd < 0, let final be max((len + relativeEnd), 0); else let final be min(relativeEnd, len).\n    let final = relativeEnd < 0 ? Math.max(len + relativeEnd, 0) : Math.min(relativeEnd, len);\n\n    // 10. Let count be min(final-from, len-to).\n    let count = Math.min(final - from, len - to);\n\n    let direction;\n    // 11. If from<to and to<from+count, then\n    if (from < to && to < from + count) {\n      // a. Let direction be -1.\n      direction = -1;\n\n      // b. Let from be from + count - 1.\n      from = from + count - 1;\n\n      // c. Let to be to + count - 1.\n      to = to + count - 1;\n    } else {\n      // 12. Else,\n      // a. Let direction be 1.\n      direction = 1;\n    }\n\n    // 13. Repeat, while count > 0\n    while (count > 0) {\n      // a. Let fromKey be ! ToString(from).\n      let fromKey = To.ToString(realm, new NumberValue(realm, from));\n\n      // b. Let toKey be ! ToString(to).\n      let toKey = To.ToString(realm, new NumberValue(realm, to));\n\n      // c. Let fromPresent be ? HasProperty(O, fromKey).\n      let fromPresent = HasProperty(realm, O, fromKey);\n\n      // d. If fromPresent is true, then\n      if (fromPresent === true) {\n        // i. Let fromVal be ? Get(O, fromKey).\n        let fromVal = Get(realm, O, fromKey);\n        // ii. Perform ? Set(O, toKey, fromVal, true).\n        Properties.Set(realm, O, toKey, fromVal, true);\n      } else {\n        // e. Else fromPresent is false,\n        // i. Perform ? DeletePropertyOrThrow(O, toKey).\n        Properties.DeletePropertyOrThrow(realm, O.throwIfNotConcreteObject(), toKey);\n      }\n\n      // f. Let from be from + direction.\n      from = from + direction;\n\n      // g. Let to be to + direction.\n      to = to + direction;\n\n      // h. Let count be count - 1.\n      count = count - 1;\n    }\n\n    // 14. Return O.\n    return O;\n  });\n\n  // ECMA262 22.2.3.6\n  obj.defineNativeMethod(\"entries\", 0, context => {\n    // 1. Let O be the this value.\n    let O = context;\n\n    // 2. Perform ? ValidateTypedArray(O).\n    ValidateTypedArray(realm, O);\n    invariant(O instanceof ObjectValue);\n\n    // 3. Return CreateArrayIterator(O, \"key+value\").\n    return Create.CreateArrayIterator(realm, O, \"key+value\");\n  });\n\n  // ECMA262 22.2.3.7\n  obj.defineNativeMethod(\"every\", 1, (context, [callbackfn, thisArg]) => {\n    // 1. Let O be ? ToObject(this value).\n    let O = To.ToObject(realm, context);\n\n    // 2. Perform ? ValidateTypedArray(O).\n    ValidateTypedArray(realm, O);\n\n    // 3. Let len be O.[[ArrayLength]].\n    let len = O.throwIfNotConcreteObject().$ArrayLength;\n    invariant(typeof len === \"number\");\n\n    // 4. If IsCallable(callbackfn) is false, throw a TypeError exception.\n    if (!IsCallable(realm, callbackfn)) {\n      throw realm.createErrorThrowCompletion(realm.intrinsics.TypeError, \"not a function\");\n    }\n\n    // 5. If thisArg was supplied, let T be thisArg; else let T be undefined.\n    let T = thisArg || realm.intrinsics.undefined;\n\n    // 6. Let k be 0.\n    let k = 0;\n\n    // 7. Repeat, while k < len\n    while (k < len) {\n      // a. Let Pk be ! ToString(k).\n      let Pk = new StringValue(realm, k + \"\");\n\n      // b. Let kPresent be ? HasProperty(O, Pk).\n      let kPresent = HasProperty(realm, O, Pk);\n\n      // c. If kPresent is true, then\n      if (kPresent) {\n        // i. Let kValue be ? Get(O, Pk).\n        let kValue = Get(realm, O, Pk);\n\n        // ii. Let testResult be ToBoolean(? Call(callbackfn, T, « kValue, k, O »)).\n        let testResult = To.ToBooleanPartial(realm, Call(realm, callbackfn, T, [kValue, new NumberValue(realm, k), O]));\n\n        // iii. If testResult is false, return false.\n        if (!testResult) return realm.intrinsics.false;\n      }\n\n      // d. Increase k by 1.\n      k++;\n    }\n\n    // 8. Return true.\n    return realm.intrinsics.true;\n  });\n\n  // ECMA262 22.2.3.8\n  obj.defineNativeMethod(\"fill\", 1, (context, [value, start, end]) => {\n    // 1. Let O be ? ToObject(this value).\n    let O = To.ToObject(realm, context);\n\n    // 2. Perform ? ValidateTypedArray(O).\n    ValidateTypedArray(realm, O);\n\n    // 3. Let len be O.[[ArrayLength]].\n    let len = O.throwIfNotConcreteObject().$ArrayLength;\n    invariant(typeof len === \"number\");\n\n    // 4. Let relativeStart be ? ToInteger(start).\n    let relativeStart = To.ToInteger(realm, start || realm.intrinsics.undefined);\n\n    // 5. If relativeStart < 0, let k be max((len + relativeStart), 0); else let k be min(relativeStart, len).\n    let k = relativeStart < 0 ? Math.max(len + relativeStart, 0) : Math.min(relativeStart, len);\n\n    // 6. If end is undefined, let relativeEnd be len; else let relativeEnd be ? ToInteger(end).\n    let relativeEnd = !end || end instanceof UndefinedValue ? len : To.ToInteger(realm, end.throwIfNotConcrete());\n\n    // 7. If relativeEnd < 0, let final be max((len + relativeEnd), 0); else let final be min(relativeEnd, len).\n    let final = relativeEnd < 0 ? Math.max(len + relativeEnd, 0) : Math.min(relativeEnd, len);\n\n    // 8. Repeat, while k < final\n    while (k < final) {\n      // a. Let Pk be ! ToString(k).\n      let Pk = new StringValue(realm, k + \"\");\n\n      // b. Perform ? Set(O, Pk, value, true).\n      Properties.Set(realm, O, Pk, value, true);\n\n      // c. Increase k by 1.\n      k++;\n    }\n\n    // 9. Return O.\n    return O;\n  });\n\n  // ECMA262 22.2.3.9\n  obj.defineNativeMethod(\"filter\", 1, (context, [callbackfn, thisArg]) => {\n    // 1. Let O be the this value.\n    let O = context;\n\n    // 2. Perform ? ValidateTypedArray(O).\n    ValidateTypedArray(realm, O);\n    invariant(O instanceof ObjectValue);\n\n    // 3. Let len be O.[[ArrayLength]].\n    let len = O.$ArrayLength;\n    invariant(typeof len === \"number\");\n\n    // 4. If IsCallable(callbackfn) is false, throw a TypeError exception.\n    if (IsCallable(realm, callbackfn) === false) {\n      throw realm.createErrorThrowCompletion(realm.intrinsics.TypeError, \"IsCallable(callbackfn) is false\");\n    }\n\n    // 5. If thisArg was supplied, let T be thisArg; else let T be undefined.\n    let T = thisArg ? thisArg : realm.intrinsics.undefined;\n\n    // 6. Let kept be a new empty List.\n    let kept = [];\n\n    // 7. Let k be 0.\n    let k = 0;\n\n    // 8. Let captured be 0.\n    let captured = 0;\n\n    // 9. Repeat, while k < len\n    while (k < len) {\n      // a. Let Pk be ! ToString(k).\n      let Pk = To.ToString(realm, new NumberValue(realm, k));\n\n      // b. Let kValue be ? Get(O, Pk).\n      let kValue = Get(realm, O, Pk);\n\n      // c. Let selected be ToBoolean(? Call(callbackfn, T, « kValue, k, O »)).\n      let selected = To.ToBooleanPartial(realm, Call(realm, callbackfn, T, [kValue, new NumberValue(realm, k), O]));\n\n      // d. If selected is true, then\n      if (selected === true) {\n        // i. Append kValue to the end of kept.\n        kept.push(kValue);\n\n        // ii. Increase captured by 1.\n        captured += 1;\n      }\n\n      // e. Increase k by 1.\n      k += 1;\n    }\n\n    // 10. Let A be ? TypedArraySpeciesCreate(O, « captured »).\n    let A = TypedArraySpeciesCreate(realm, O, [new NumberValue(realm, captured)]);\n\n    // 11. Let n be 0.\n    let n = 0;\n\n    // 12. For each element e of kept\n    for (let e of kept) {\n      // a. Perform ! Set(A, ! ToString(n), e, true).\n      Properties.Set(realm, A, new StringValue(realm, To.ToString(realm, new NumberValue(realm, n))), e, true);\n\n      // b. Increment n by 1.\n      n = n + 1;\n    }\n\n    // 13. Return A.\n    return A;\n  });\n\n  // ECMA262 22.2.3.10\n  obj.defineNativeMethod(\"find\", 1, (context, [predicate, thisArg]) => {\n    // 1. Let O be ? ToObject(this value).\n    let O = To.ToObject(realm, context);\n\n    // 2. Perform ? ValidateTypedArray(O).\n    ValidateTypedArray(realm, O);\n\n    // 3. Let len be O.[[ArrayLength]].\n    let len = O.throwIfNotConcreteObject().$ArrayLength;\n    invariant(typeof len === \"number\");\n\n    // 4. If IsCallable(predicate) is false, throw a TypeError exception.\n    if (!IsCallable(realm, predicate)) {\n      throw realm.createErrorThrowCompletion(realm.intrinsics.TypeError, \"not a function\");\n    }\n\n    // 5. If thisArg was supplied, let T be thisArg; else let T be undefined.\n    let T = thisArg || realm.intrinsics.undefined;\n\n    // 6. Let k be 0.\n    let k = 0;\n\n    // 7. Repeat, while k < len\n    while (k < len) {\n      // a. Let Pk be ! ToString(k).\n      let Pk = new StringValue(realm, k + \"\");\n\n      // b. Let kValue be ? Get(O, Pk).\n      let kValue = Get(realm, O, Pk);\n\n      // c. Let testResult be ToBoolean(? Call(predicate, T, « kValue, k, O »)).\n      let testResult = To.ToBooleanPartial(realm, Call(realm, predicate, T, [kValue, new NumberValue(realm, k), O]));\n\n      // d. If testResult is true, return kValue.\n      if (testResult) return kValue;\n\n      // e. Increase k by 1.\n      k++;\n    }\n\n    // 8. Return undefined.\n    return realm.intrinsics.undefined;\n  });\n\n  // ECMA262 22.2.3.11\n  obj.defineNativeMethod(\"findIndex\", 1, (context, [predicate, thisArg]) => {\n    // 1. Let O be ? ToObject(this value).\n    let O = To.ToObject(realm, context);\n\n    // 2. Perform ? ValidateTypedArray(O).\n    ValidateTypedArray(realm, O);\n\n    // 3. Let len be O.[[ArrayLength]].\n    let len = O.throwIfNotConcreteObject().$ArrayLength;\n    invariant(typeof len === \"number\");\n\n    // 4. If IsCallable(predicate) is false, throw a TypeError exception.\n    if (IsCallable(realm, predicate) === false) {\n      throw realm.createErrorThrowCompletion(realm.intrinsics.TypeError, \"not a function\");\n    }\n\n    // 5. If thisArg was supplied, let T be thisArg; else let T be undefined.\n    let T = thisArg ? thisArg : realm.intrinsics.undefined;\n\n    // 6. Let k be 0.\n    let k = 0;\n\n    // 7. Repeat, while k < len\n    while (k < len) {\n      // a. Let Pk be ! ToString(k).\n      let Pk = To.ToString(realm, new NumberValue(realm, k));\n\n      // b. Let kValue be ? Get(O, Pk).\n      let kValue = Get(realm, O, new StringValue(realm, Pk));\n\n      // c. Let testResult be ToBoolean(? Call(predicate, T, « kValue, k, O »)).\n      let testResult = To.ToBooleanPartial(realm, Call(realm, predicate, T, [kValue, new NumberValue(realm, k), O]));\n\n      // d. If testResult is true, return k.\n      if (testResult === true) return new NumberValue(realm, k);\n\n      // e. Increase k by 1.\n      k = k + 1;\n    }\n\n    // 8. Return -1.\n    return new NumberValue(realm, -1);\n  });\n\n  // ECMA262 22.2.3.12\n  obj.defineNativeMethod(\"forEach\", 1, (context, [callbackfn, thisArg]) => {\n    // 1. Let O be ? ToObject(this value).\n    let O = To.ToObject(realm, context);\n\n    // 2. Perform ? ValidateTypedArray(O).\n    ValidateTypedArray(realm, O);\n\n    // 3. Let len be O.[[ArrayLength]].\n    let len = O.throwIfNotConcreteObject().$ArrayLength;\n    invariant(typeof len === \"number\");\n\n    // 4. If IsCallable(callbackfn) is false, throw a TypeError exception.\n    if (!IsCallable(realm, callbackfn)) {\n      throw realm.createErrorThrowCompletion(realm.intrinsics.TypeError, \"not a function\");\n    }\n\n    // 5. If thisArg was supplied, let T be thisArg; else let T be undefined.\n    let T = thisArg || realm.intrinsics.undefined;\n\n    // 6. Let k be 0.\n    let k = 0;\n\n    // 7. Repeat, while k < len\n    while (k < len) {\n      // a. Let Pk be ! ToString(k).\n      let Pk = new StringValue(realm, k + \"\");\n\n      // b. Let kPresent be ? HasProperty(O, Pk).\n      let kPresent = HasProperty(realm, O, Pk);\n\n      // c. If kPresent is true, then\n      if (kPresent) {\n        // i. Let kValue be ? Get(O, Pk).\n        let kValue = Get(realm, O, Pk);\n\n        // ii. Perform ? Call(callbackfn, T, « kValue, k, O »).\n        Call(realm, callbackfn, T, [kValue, new NumberValue(realm, k), O]);\n      }\n\n      // d. Increase k by 1.\n      k++;\n    }\n\n    // 8. Return undefined.\n    return realm.intrinsics.undefined;\n  });\n\n  // ECMA262 22.2.3.14\n  obj.defineNativeMethod(\"includes\", 1, (context, [searchElement, fromIndex]) => {\n    // 1. Let O be ? ToObject(this value).\n    let O = To.ToObject(realm, context);\n\n    // 2. Perform ? ValidateTypedArray(O).\n    ValidateTypedArray(realm, O);\n\n    // 3. Let len be O.[[ArrayLength]].\n    let len = O.throwIfNotConcreteObject().$ArrayLength;\n    invariant(typeof len === \"number\");\n\n    // 4. If len is 0, return false.\n    if (len === 0) return realm.intrinsics.false;\n\n    // 5. Let n be ? ToInteger(fromIndex). (If fromIndex is undefined, this step produces the value 0.)\n    let n = To.ToInteger(realm, fromIndex || realm.intrinsics.undefined);\n\n    let k;\n    // 6. If n ≥ 0, then\n    if (n >= 0) {\n      // a. Let k be n.\n      k = n;\n    } else {\n      // 7. Else n < 0,\n      // a. Let k be len + n.\n      k = len + n;\n      // b. If k < 0, let k be 0.\n      if (k < 0) k = 0;\n    }\n\n    // 8. Repeat, while k < len\n    while (k < len) {\n      // a. Let elementK be the result of ? Get(O, ! ToString(k)).\n      let elementK = Get(realm, O, To.ToString(realm, new NumberValue(realm, k)));\n\n      // b. If SameValueZero(searchElement, elementK) is true, return true.\n      if (SameValueZeroPartial(realm, searchElement, elementK) === true) return realm.intrinsics.true;\n\n      // c. Increase k by 1.\n      k = k + 1;\n    }\n\n    // 9. Return false.\n    return realm.intrinsics.false;\n  });\n\n  // ECMA262 22.2.3.14\n  obj.defineNativeMethod(\"indexOf\", 1, (context, [searchElement, fromIndex]) => {\n    // 1. Let O be ? ToObject(this value).\n    let O = To.ToObject(realm, context);\n\n    // 2. Perform ? ValidateTypedArray(O).\n    ValidateTypedArray(realm, O);\n\n    // 3. Let len be O.[[ArrayLength]].\n    let len = O.throwIfNotConcreteObject().$ArrayLength;\n    invariant(typeof len === \"number\");\n\n    // 4. If len is 0, return -1.\n    if (len === 0) return new NumberValue(realm, -1);\n\n    // 5. Let n be ? ToInteger(fromIndex). (If fromIndex is undefined, this step produces the value 0.)\n    let n = fromIndex ? To.ToInteger(realm, fromIndex) : 0;\n\n    // 6. If n ≥ len, return -1.\n    if (n >= len) return new NumberValue(realm, -1);\n\n    // 7. If n ≥ 0, then\n    let k;\n    if (n >= 0) {\n      // a. If n is -0, let k be +0; else let k be n.\n      k = Object.is(n, -0) ? +0 : n;\n    } else {\n      // 8. Else n < 0,\n      // a. Let k be len + n.\n      k = len + n;\n\n      // b. If k < 0, let k be 0.\n      if (k < 0) k = 0;\n    }\n\n    // 9. Repeat, while k < len\n    while (k < len) {\n      // a. Let kPresent be ? HasProperty(O, ! ToString(k)).\n      let kPresent = HasProperty(realm, O, k + \"\");\n\n      // b. If kPresent is true, then\n      if (kPresent === true) {\n        // i. Let elementK be ? Get(O, ! ToString(k)).\n        let elementK = Get(realm, O, k + \"\");\n\n        // ii. Let same be the result of performing Strict Equality Comparison searchElement === elementK.\n        let same = StrictEqualityComparisonPartial(realm, searchElement, elementK);\n\n        // iii. If same is true, return k.\n        if (same) return new NumberValue(realm, k);\n      }\n\n      // c. Increase k by 1.\n      k++;\n    }\n\n    // 10. Return -1.\n    return new NumberValue(realm, -1);\n  });\n\n  // ECMA262 22.2.3.15\n  obj.defineNativeMethod(\"join\", 1, (context, [_separator]) => {\n    let separator = _separator;\n    // 1. Let O be ? ToObject(this value).\n    let O = To.ToObject(realm, context);\n\n    // 2. Perform ? ValidateTypedArray(O).\n    ValidateTypedArray(realm, O);\n\n    // 3. Let len be O.[[ArrayLength]].\n    let len = O.throwIfNotConcreteObject().$ArrayLength;\n    invariant(typeof len === \"number\");\n\n    // 4. If separator is undefined, let separator be the single-element String \",\".\n    if (!separator || separator instanceof UndefinedValue) separator = new StringValue(realm, \",\");\n\n    // 5. Let sep be ? ToString(separator).\n    let sep = To.ToStringPartial(realm, separator);\n\n    // 6. If len is zero, return the empty String.\n    if (len === 0) return realm.intrinsics.emptyString;\n\n    // 7. Let element0 be Get(O, \"0\").\n    let element0 = Get(realm, O, \"0\");\n\n    // 8. If element0 is undefined or null, let R be the empty String; otherwise, let R be ? ToString(element0).\n    let R: ?string;\n    if (HasSomeCompatibleType(element0, UndefinedValue, NullValue)) {\n      R = \"\";\n    } else {\n      R = To.ToStringPartial(realm, element0);\n    }\n\n    // 9. Let k be 1.\n    let k = 1;\n\n    // 10. Repeat, while k < len\n    while (k < len) {\n      // a. Let S be the String value produced by concatenating R and sep.\n      let S: string = R + sep;\n\n      // b. Let element be ? Get(O, ! ToString(k)).\n      let element = Get(realm, O, new StringValue(realm, k + \"\"));\n\n      // c. If element is undefined or null, let next be the empty String; otherwise, let next be ? ToString(element).\n      let next: ?string;\n      if (HasSomeCompatibleType(element, UndefinedValue, NullValue)) {\n        next = \"\";\n      } else {\n        next = To.ToStringPartial(realm, element);\n      }\n\n      // d. Let R be a String value produced by concatenating S and next.\n      R = S + next;\n\n      // e. Increase k by 1.\n      k++;\n    }\n\n    // 11. Return R.\n    return new StringValue(realm, R + \"\");\n  });\n\n  // ECMA262 22.2.3.16\n  obj.defineNativeMethod(\"keys\", 0, context => {\n    // 1. Let O be the this value.\n    let O = context;\n\n    // 2. Perform ? ValidateTypedArray(O).\n    ValidateTypedArray(realm, O);\n    invariant(O instanceof ObjectValue);\n\n    // 3. Return CreateArrayIterator(O, \"key\").\n    return Create.CreateArrayIterator(realm, O, \"key\");\n  });\n\n  // ECMA262 22.2.3.17\n  obj.defineNativeMethod(\"lastIndexOf\", 1, (context, [searchElement, fromIndex]) => {\n    // 1. Let O be ? ToObject(this value).\n    let O = To.ToObject(realm, context);\n\n    // 2. Perform ? ValidateTypedArray(O).\n    ValidateTypedArray(realm, O);\n\n    // 3. Let len be O.[[ArrayLength]].\n    let len = O.throwIfNotConcreteObject().$ArrayLength;\n    invariant(typeof len === \"number\");\n\n    // 4. If len is 0, return -1.\n    if (len === 0) return new NumberValue(realm, -1);\n\n    // 5. If argument fromIndex was passed, let n be ? ToInteger(fromIndex); else let n be len-1.\n    let n = fromIndex ? To.ToInteger(realm, fromIndex) : len - 1;\n\n    // 6. If n ≥ 0, then\n    let k;\n    if (n >= 0) {\n      // a. If n is -0, let k be +0; else let k be min(n, len - 1).\n      k = Object.is(n, -0) ? +0 : Math.min(n, len - 1);\n    } else {\n      // 7. Else n < 0,\n      // a. Let k be len + n.\n      k = len + n;\n    }\n\n    // 8. Repeat, while k ≥ 0\n    while (k >= 0) {\n      // a. Let kPresent be ? HasProperty(O, ! ToString(k)).\n      let kPresent = HasProperty(realm, O, new StringValue(realm, k + \"\"));\n\n      // b. If kPresent is true, then\n      if (kPresent) {\n        // i. Let elementK be ? Get(O, ! ToString(k)).\n        let elementK = Get(realm, O, new StringValue(realm, k + \"\"));\n\n        // ii. Let same be the result of performing Strict Equality Comparison searchElement === elementK.\n        let same = StrictEqualityComparisonPartial(realm, searchElement, elementK);\n\n        // iii. If same is true, return k.\n        if (same) return new NumberValue(realm, k);\n      }\n\n      // c. Decrease k by 1.\n      k--;\n    }\n\n    // 9. Return -1.\n    return new NumberValue(realm, -1);\n  });\n\n  // ECMA262 22.2.3.18\n  obj.defineNativeGetter(\"length\", context => {\n    // 1. Let O be the this value.\n    let O = context.throwIfNotConcrete();\n\n    // 2. If Type(O) is not Object, throw a TypeError exception.\n    if (!(O instanceof ObjectValue)) {\n      throw realm.createErrorThrowCompletion(realm.intrinsics.TypeError, \"Type(O) is not Object\");\n    }\n\n    // 3. If O does not have a [[TypedArrayName]] internal slot, throw a TypeError exception.\n    if (!(\"$TypedArrayName\" in O)) {\n      throw realm.createErrorThrowCompletion(\n        realm.intrinsics.TypeError,\n        \"O does not have a [[TypedArrayName]] internal slot\"\n      );\n    }\n\n    // 4. Assert: O has [[ViewedArrayBuffer]] and [[ArrayLength]] internal slots.\n    invariant(O.$ViewedArrayBuffer, \"O has a [[ViewedArrayBuffer]] internal slot\");\n\n    // 5. Let buffer be O.[[ViewedArrayBuffer]].\n    let buffer = O.$ViewedArrayBuffer;\n    invariant(buffer);\n\n    // 6. If IsDetachedBuffer(buffer) is true, return 0.\n    if (IsDetachedBuffer(realm, buffer) === true) return realm.intrinsics.zero;\n\n    // 7. Let length be O.[[ArrayLength]].\n    let length = O.$ArrayLength;\n    invariant(typeof length === \"number\");\n\n    // 8. Return length.\n    return new NumberValue(realm, length);\n  });\n\n  // ECMA262 22.2.3.19\n  obj.defineNativeMethod(\"map\", 1, (context, [callbackfn, thisArg]) => {\n    // 1. Let O be the this value.\n    let O = context;\n\n    // 2. Perform ? ValidateTypedArray(O).\n    ValidateTypedArray(realm, O);\n    invariant(O instanceof ObjectValue);\n\n    // 3. Let len be O.[[ArrayLength]].\n    let len = O.$ArrayLength;\n    invariant(typeof len === \"number\");\n\n    // 4. If IsCallable(callbackfn) is false, throw a TypeError exception.\n    if (IsCallable(realm, callbackfn) === false) {\n      throw realm.createErrorThrowCompletion(realm.intrinsics.TypeError, \"IsCallable(callbackfn) is false\");\n    }\n\n    // 5. If thisArg was supplied, let T be thisArg; else let T be undefined.\n    let T = thisArg ? thisArg : realm.intrinsics.undefined;\n\n    // 6. Let A be ? TypedArraySpeciesCreate(O, « len »).\n    let A = TypedArraySpeciesCreate(realm, O, [new NumberValue(realm, len)]);\n\n    // 7. Let k be 0.\n    let k = 0;\n\n    // 8. Repeat, while k < len\n    while (k < len) {\n      // a. Let Pk be ! ToString(k).\n      let Pk = To.ToString(realm, new NumberValue(realm, k));\n\n      // b. Let kValue be ? Get(O, Pk).\n      let kValue = Get(realm, O, Pk);\n\n      // c. Let mappedValue be ? Call(callbackfn, T, « kValue, k, O »).\n      let mappedValue = Call(realm, callbackfn, T, [kValue, new NumberValue(realm, k), O]);\n\n      // d. Perform ? Set(A, Pk, mappedValue, true).\n      Properties.Set(realm, A, Pk, mappedValue, true);\n\n      // e. Increase k by 1.\n      k = k + 1;\n    }\n\n    // 9. Return A.\n    return A;\n  });\n\n  // ECMA262 22.2.3.20\n  obj.defineNativeMethod(\"reduce\", 1, (context, [callbackfn, initialValue]) => {\n    // 1. Let O be ? ToObject(this value).\n    let O = To.ToObject(realm, context);\n\n    // 2. Perform ? ValidateTypedArray(O).\n    ValidateTypedArray(realm, O);\n\n    // 3. Let len be O.[[ArrayLength]].\n    let len = O.throwIfNotConcreteObject().$ArrayLength;\n    invariant(typeof len === \"number\");\n\n    // 4. If IsCallable(callbackfn) is false, throw a TypeError exception.\n    if (!IsCallable(realm, callbackfn)) {\n      throw realm.createErrorThrowCompletion(realm.intrinsics.TypeError, \"not a function\");\n    }\n\n    // 5. If len is 0 and initialValue is not present, throw a TypeError exception.\n    if (len === 0 && !initialValue) {\n      throw realm.createErrorThrowCompletion(realm.intrinsics.TypeError, \"Array.prototype\");\n    }\n\n    // 6. Let k be 0.\n    let k = 0;\n\n    // 7. If initialValue is present, then\n    let accumulator;\n    if (initialValue) {\n      // a. Set accumulator to initialValue.\n      accumulator = initialValue;\n    } else {\n      // 8. Else initialValue is not present,\n      // a. Let kPresent be false.\n      let kPresent = false;\n\n      // b. Repeat, while kPresent is false and k < len\n      while (kPresent === false && k < len) {\n        // i. Let Pk be ! ToString(k).\n        let Pk = new StringValue(realm, k + \"\");\n\n        // ii. Let kPresent be ? HasProperty(O, Pk).\n        kPresent = HasProperty(realm, O, Pk);\n\n        // iv. If kPresent is true, then\n        if (kPresent) {\n          // 1. Let accumulator be ? Get(O, Pk).\n          accumulator = Get(realm, O, Pk);\n        }\n\n        // v. Increase k by 1.\n        k++;\n      }\n\n      // c. If kPresent is false, throw a TypeError exception.\n      if (!kPresent) {\n        throw realm.createErrorThrowCompletion(realm.intrinsics.TypeError, \"kPresent is false\");\n      }\n\n      invariant(accumulator);\n    }\n\n    // 9. Repeat, while k < len\n    while (k < len) {\n      // a. Let Pk be ! ToString(k).\n      let Pk = new StringValue(realm, k + \"\");\n\n      // b. Let kPresent be ? HasProperty(O, Pk).\n      let kPresent = HasProperty(realm, O, Pk);\n\n      // c. If kPresent is true, then\n      if (kPresent) {\n        // i. Let kValue be ? Get(O, Pk).\n        let kValue = Get(realm, O, Pk);\n\n        // ii. Let accumulator be ? Call(callbackfn, undefined, « accumulator, kValue, k, O »).\n        accumulator = Call(realm, callbackfn, realm.intrinsics.undefined, [\n          accumulator,\n          kValue,\n          new NumberValue(realm, k),\n          O,\n        ]);\n      }\n\n      // d. Increase k by 1.\n      k++;\n    }\n\n    // 10. Return accumulator.\n    return accumulator;\n  });\n\n  // ECMA262 22.2.3.21\n  obj.defineNativeMethod(\"reduceRight\", 1, (context, [callbackfn, initialValue]) => {\n    // 1. Let O be ? ToObject(this value).\n    let O = To.ToObject(realm, context);\n\n    // 2. Perform ? ValidateTypedArray(O).\n    ValidateTypedArray(realm, O);\n\n    // 3. Let len be O.[[ArrayLength]].\n    let len = O.throwIfNotConcreteObject().$ArrayLength;\n    invariant(typeof len === \"number\");\n\n    // 4. If IsCallable(callbackfn) is false, throw a TypeError exception.\n    if (!IsCallable(realm, callbackfn)) {\n      throw realm.createErrorThrowCompletion(realm.intrinsics.TypeError, \"not a function\");\n    }\n\n    // 5. If len is 0 and initialValue is not present, throw a TypeError exception.\n    if (len === 0 && !initialValue) {\n      throw realm.createErrorThrowCompletion(realm.intrinsics.TypeError, \"Array.prototype\");\n    }\n\n    // 6. Let k be len-1.\n    let k = len - 1;\n\n    // 7. If initialValue is present, then\n    let accumulator;\n    if (initialValue) {\n      // 1. Set accumulator to initialValue.\n      accumulator = initialValue;\n    } else {\n      // 8. Else initialValue is not present,\n      // a. Let kPresent be false.\n      let kPresent = false;\n\n      // b. Repeat, while kPresent is false and k ≥ 0\n      while (!kPresent && k >= 0) {\n        // i. Let Pk be ! ToString(k).\n        let Pk = new StringValue(realm, k + \"\");\n\n        // ii. Let kPresent be ? HasProperty(O, Pk).\n        kPresent = HasProperty(realm, O, Pk);\n\n        // iii. If kPresent is true, then\n        if (kPresent) {\n          // 1. Let accumulator be ? Get(O, Pk).\n          accumulator = Get(realm, O, Pk);\n        }\n\n        // iv. Decrease k by 1.\n        k--;\n      }\n\n      // c. If kPresent is false, throw a TypeError exception.\n      if (!kPresent || !accumulator) {\n        throw realm.createErrorThrowCompletion(realm.intrinsics.TypeError, \"Array.prototype\");\n      }\n    }\n\n    // 9. Repeat, while k ≥ 0\n    while (k >= 0) {\n      // a. Let Pk be ! ToString(k).\n      let Pk = new StringValue(realm, k + \"\");\n\n      // b. Let kPresent be ? HasProperty(O, Pk).\n      let kPresent = HasProperty(realm, O, Pk);\n\n      // c. If kPresent is true, then\n      if (kPresent) {\n        // i. Let kValue be ? Get(O, Pk).\n        let kValue = Get(realm, O, Pk);\n\n        // ii. Let accumulator be ? Call(callbackfn, undefined, « accumulator, kValue, k, O »).\n        accumulator = Call(realm, callbackfn, realm.intrinsics.undefined, [\n          accumulator,\n          kValue,\n          new NumberValue(realm, k),\n          O,\n        ]);\n      }\n\n      // d. Decrease k by 1.\n      k--;\n    }\n\n    // 10. Return accumulator.\n    return accumulator;\n  });\n\n  // ECMA262 22.2.3.21\n  obj.defineNativeMethod(\"reverse\", 0, context => {\n    // 1. Let O be ? ToObject(this value).\n    let O = To.ToObject(realm, context);\n\n    // 2. Perform ? ValidateTypedArray(O).\n    ValidateTypedArray(realm, O);\n\n    // 3. Let len be O.[[ArrayLength]].\n    let len = O.throwIfNotConcreteObject().$ArrayLength;\n    invariant(typeof len === \"number\");\n\n    // 4. Let middle be floor(len/2).\n    let middle = Math.floor(len / 2);\n\n    // 5. Let lower be 0.\n    let lower = 0;\n\n    // 6. Repeat, while lower ≠ middle\n    while (lower !== middle) {\n      // a. Let upper be len - lower - 1.\n      let upper = len - lower - 1;\n\n      // b. Let upperP be ! ToString(upper).\n      let upperP = new StringValue(realm, upper + \"\");\n\n      // c. Let lowerP be ! ToString(lower).\n      let lowerP = new StringValue(realm, lower + \"\");\n\n      // d. Let lowerExists be ? HasProperty(O, lowerP).\n      let lowerExists = HasProperty(realm, O, lowerP);\n\n      // e. If lowerExists is true, then\n      let lowerValue;\n      if (lowerExists) {\n        // i. Let lowerValue be ? Get(O, lowerP).\n        lowerValue = Get(realm, O, lowerP);\n      }\n\n      // f. Let upperExists be ? HasProperty(O, upperP).\n      let upperExists = HasProperty(realm, O, upperP);\n\n      // g. If upperExists is true, then\n      let upperValue;\n      if (upperExists) {\n        // i. Let upperValue be ? Get(O, upperP).\n        upperValue = Get(realm, O, upperP);\n      }\n\n      // h. If lowerExists is true and upperExists is true, then\n      if (lowerExists && upperExists) {\n        invariant(lowerValue, \"expected lower value to exist\");\n        invariant(upperValue, \"expected upper value to exist\");\n\n        // i. Perform ? Set(O, lowerP, upperValue, true).\n        Properties.Set(realm, O, lowerP, upperValue, true);\n\n        // ii. Perform ? Set(O, upperP, lowerValue, true).\n        Properties.Set(realm, O, upperP, lowerValue, true);\n      } else if (!lowerExists && upperExists) {\n        // i. Else if lowerExists is false and upperExists is true, then\n        invariant(upperValue, \"expected upper value to exist\");\n\n        // i. Perform ? Set(O, lowerP, upperValue, true).\n        Properties.Set(realm, O, lowerP, upperValue, true);\n\n        // ii. Perform ? DeletePropertyOrThrow(O, upperP).\n        Properties.DeletePropertyOrThrow(realm, O.throwIfNotConcreteObject(), upperP);\n      } else if (lowerExists && !upperExists) {\n        // j. Else if lowerExists is true and upperExists is false, then\n        invariant(lowerValue, \"expected lower value to exist\");\n\n        // i. Perform ? DeletePropertyOrThrow(O, lowerP).\n        Properties.DeletePropertyOrThrow(realm, O.throwIfNotConcreteObject(), lowerP);\n\n        // ii. Perform ? Set(O, upperP, lowerValue, true).\n        Properties.Set(realm, O, upperP, lowerValue, true);\n      } else {\n        // k. Else both lowerExists and upperExists are false,\n        // i. No action is required.\n      }\n\n      // l. Increase lower by 1.\n      lower++;\n    }\n\n    // 7. Return O.\n    return O;\n  });\n\n  // ECMA262 22.2.3.23\n  obj.defineNativeMethod(\"set\", 1, (context, [overloaded, offset]) => {\n    if (overloaded.$TypedArrayName === undefined) {\n      let array = overloaded;\n\n      // 1. Assert: array is any ECMAScript language value other than an Object with a [[TypedArrayName]] internal slot. If it is such an Object, the definition in 22.2.3.23.2 applies.\n      invariant(!(overloaded instanceof ObjectValue && overloaded.$TypedArrayName));\n\n      // 2. Let target be the this value.\n      let target = context.throwIfNotConcrete();\n\n      // 3. If Type(target) is not Object, throw a TypeError exception.\n      if (!(target instanceof ObjectValue)) {\n        throw realm.createErrorThrowCompletion(realm.intrinsics.TypeError, \"Type(target) is not Object\");\n      }\n\n      // 4. If target does not have a [[TypedArrayName]] internal slot, throw a TypeError exception.\n      if (typeof target.$TypedArrayName !== \"string\") {\n        throw realm.createErrorThrowCompletion(\n          realm.intrinsics.TypeError,\n          \"target does not have a [[TypedArrayName]] internal slot\"\n        );\n      }\n\n      // 5. Assert: target has a [[ViewedArrayBuffer]] internal slot.\n      invariant(target.$ViewedArrayBuffer, \"target has a [[ViewedArrayBuffer]] internal slot\");\n\n      // 6. Let targetOffset be ? ToInteger(offset).\n      let targetOffset = To.ToInteger(realm, offset || realm.intrinsics.undefined);\n\n      // 7. If targetOffset < 0, throw a RangeError exception.\n      if (targetOffset < 0) {\n        throw realm.createErrorThrowCompletion(realm.intrinsics.RangeError, \"targetOffset < 0\");\n      }\n\n      // 8. Let targetBuffer be target.[[ViewedArrayBuffer]].\n      let targetBuffer = target.$ViewedArrayBuffer;\n      invariant(targetBuffer instanceof ObjectValue);\n\n      // 9. If IsDetachedBuffer(targetBuffer) is true, throw a TypeError exception.\n      if (IsDetachedBuffer(realm, targetBuffer) === true) {\n        throw realm.createErrorThrowCompletion(realm.intrinsics.TypeError, \"IsDetachedBuffer(targetBuffer) is true\");\n      }\n\n      // 10. Let targetLength be target.[[ArrayLength]].\n      let targetLength = target.$ArrayLength;\n      invariant(typeof targetLength === \"number\");\n\n      // 11. Let targetName be the String value of target.[[TypedArrayName]].\n      let targetName = target.$TypedArrayName;\n      invariant(typeof targetName === \"string\");\n\n      // 12. Let targetElementSize be the Number value of the Element Size value specified in Table 50 for targetName.\n      let targetElementSize = ArrayElementSize[targetName];\n\n      // 13. Let targetType be the String value of the Element Type value in Table 50 for targetName.\n      let targetType = ArrayElementType[targetName];\n\n      // 14. Let targetByteOffset be target.[[ByteOffset]].\n      let targetByteOffset = target.$ByteOffset;\n      invariant(typeof targetByteOffset === \"number\");\n\n      // 15. Let src be ? ToObject(array).\n      let src = To.ToObject(realm, array);\n\n      // 16. Let srcLength be ? ToLength(? Get(src, \"length\")).\n      let srcLength = To.ToLength(realm, Get(realm, src, \"length\"));\n\n      // 17. If srcLength + targetOffset > targetLength, throw a RangeError exception.\n      if (srcLength + targetOffset > targetLength) {\n        throw realm.createErrorThrowCompletion(realm.intrinsics.RangeError, \"srcLength + targetOffset > targetLength\");\n      }\n\n      // 18. Let targetByteIndex be targetOffset × targetElementSize + targetByteOffset.\n      let targetByteIndex = targetOffset * targetElementSize + targetByteOffset;\n\n      // 19. Let k be 0.\n      let k = 0;\n\n      // 20. Let limit be targetByteIndex + targetElementSize × srcLength.\n      let limit = targetByteIndex + targetElementSize * srcLength;\n\n      // 21. Repeat, while targetByteIndex < limit\n      while (targetByteIndex < limit) {\n        // a. Let Pk be ! ToString(k).\n        let Pk = To.ToString(realm, new NumberValue(realm, k));\n\n        // b. Let kNumber be ? ToNumber(? Get(src, Pk)).\n        let kNumber = To.ToNumber(realm, Get(realm, src, Pk));\n\n        // c. If IsDetachedBuffer(targetBuffer) is true, throw a TypeError exception.\n        if (IsDetachedBuffer(realm, targetBuffer) === true) {\n          throw realm.createErrorThrowCompletion(realm.intrinsics.TypeError, \"IsDetachedBuffer(targetBuffer) is true\");\n        }\n\n        // d. Perform SetValueInBuffer(targetBuffer, targetByteIndex, targetType, kNumber).\n        SetValueInBuffer(realm, targetBuffer, targetByteIndex, targetType, kNumber);\n\n        // e. Set k to k + 1.\n        k = k + 1;\n\n        // f. Set targetByteIndex to targetByteIndex + targetElementSize.\n        targetByteIndex = targetByteIndex + targetElementSize;\n      }\n\n      // 22. Return undefined.\n      return realm.intrinsics.undefined;\n    } else {\n      let typedArray = overloaded;\n\n      // 1. Assert: typedArray has a [[TypedArrayName]] internal slot. If it does not, the definition in 22.2.3.23.1 applies.\n      invariant(typedArray instanceof ObjectValue && typedArray.$TypedArrayName);\n\n      // 2. Let target be the this value.\n      let target = context.throwIfNotConcrete();\n\n      // 3. If Type(target) is not Object, throw a TypeError exception.\n      if (!(target instanceof ObjectValue)) {\n        throw realm.createErrorThrowCompletion(realm.intrinsics.TypeError, \"Type(target) is not Object\");\n      }\n\n      // 4. If target does not have a [[TypedArrayName]] internal slot, throw a TypeError exception.\n      if (typeof target.$TypedArrayName !== \"string\") {\n        throw realm.createErrorThrowCompletion(\n          realm.intrinsics.TypeError,\n          \"target does not have a [[TypedArrayName]] internal slot\"\n        );\n      }\n\n      // 5. Assert: target has a [[ViewedArrayBuffer]] internal slot.\n      invariant(target.$ViewedArrayBuffer);\n\n      // 6. Let targetOffset be ? ToInteger(offset).\n      let targetOffset = To.ToInteger(realm, offset || realm.intrinsics.undefined);\n\n      // 7. If targetOffset < 0, throw a RangeError exception.\n      if (targetOffset < 0) {\n        throw realm.createErrorThrowCompletion(realm.intrinsics.RangeError, \"targetOffset < 0\");\n      }\n\n      // 8. Let targetBuffer be target.[[ViewedArrayBuffer]].\n      let targetBuffer = target.$ViewedArrayBuffer;\n      invariant(targetBuffer instanceof ObjectValue);\n\n      // 9. If IsDetachedBuffer(targetBuffer) is true, throw a TypeError exception.\n      if (IsDetachedBuffer(realm, targetBuffer) === true) {\n        throw realm.createErrorThrowCompletion(realm.intrinsics.TypeError, \"IsDetachedBuffer(targetBuffer) is true\");\n      }\n\n      // 10. Let targetLength be target.[[ArrayLength]].\n      let targetLength = target.$ArrayLength;\n      invariant(typeof targetLength === \"number\");\n\n      // 11. Let srcBuffer be typedArray.[[ViewedArrayBuffer]].\n      let srcBuffer = typedArray.$ViewedArrayBuffer;\n      invariant(srcBuffer);\n\n      // 12. If IsDetachedBuffer(srcBuffer) is true, throw a TypeError exception.\n      if (IsDetachedBuffer(realm, srcBuffer) === true) {\n        throw realm.createErrorThrowCompletion(realm.intrinsics.TypeError, \"IsDetachedBuffer(srcBuffer) is true\");\n      }\n\n      // 13. Let targetName be the String value of target.[[TypedArrayName]].\n      let targetName = target.$TypedArrayName;\n      invariant(typeof targetName === \"string\");\n\n      // 14. Let targetType be the String value of the Element Type value in Table 50 for targetName.\n      let targetType = ArrayElementType[targetName];\n\n      // 15. Let targetElementSize be the Number value of the Element Size value specified in Table 50 for targetName.\n      let targetElementSize = ArrayElementSize[targetName];\n\n      // 16. Let targetByteOffset be target.[[ByteOffset]].\n      let targetByteOffset = target.$ByteOffset;\n      invariant(typeof targetByteOffset === \"number\");\n\n      // 17. Let srcName be the String value of typedArray.[[TypedArrayName]].\n      let srcName = typedArray.$TypedArrayName;\n      invariant(typeof srcName === \"string\");\n\n      // 18. Let srcType be the String value of the Element Type value in Table 50 for srcName.\n      let srcType = ArrayElementType[srcName];\n\n      // 19. Let srcElementSize be the Number value of the Element Size value specified in Table 50 for srcName.\n      let srcElementSize = ArrayElementSize[srcName];\n\n      // 20. Let srcLength be typedArray.[[ArrayLength]].\n      let srcLength = typedArray.$ArrayLength;\n      invariant(typeof srcLength === \"number\");\n\n      // 21. Let srcByteOffset be typedArray.[[ByteOffset]].\n      let srcByteOffset = typedArray.$ByteOffset;\n      invariant(typeof srcByteOffset === \"number\");\n\n      // 22. If srcLength + targetOffset > targetLength, throw a RangeError exception.\n      if (srcLength + targetOffset > targetLength) {\n        throw realm.createErrorThrowCompletion(realm.intrinsics.RangeError, \"srcLength + targetOffset > targetLength\");\n      }\n\n      let srcByteIndex;\n      // 23. If SameValue(srcBuffer, targetBuffer) is true, then\n      if (SameValue(realm, srcBuffer, targetBuffer) === true) {\n        // a. Let srcBuffer be ? CloneArrayBuffer(targetBuffer, srcByteOffset, %ArrayBuffer%).\n        srcBuffer = CloneArrayBuffer(realm, targetBuffer, srcByteOffset, realm.intrinsics.ArrayBuffer);\n\n        // b. NOTE: %ArrayBuffer% is used to clone srcBuffer because is it known to not have any observable side-effects.\n\n        // c. Let srcByteIndex be 0.\n        srcByteIndex = 0;\n      } else {\n        // 24. Else, let srcByteIndex be srcByteOffset.\n        srcByteIndex = srcByteOffset;\n      }\n\n      // 25. Let targetByteIndex be targetOffset × targetElementSize + targetByteOffset.\n      let targetByteIndex = targetOffset * targetElementSize + targetByteOffset;\n\n      // 26. Let limit be targetByteIndex + targetElementSize × srcLength.\n      let limit = targetByteIndex + targetElementSize * srcLength;\n\n      // 27. If SameValue(srcType, targetType) is true, then\n      if (srcType === targetType) {\n        // a. NOTE: If srcType and targetType are the same, the transfer must be performed in a manner that preserves the bit-level encoding of the source data.\n\n        // b. Repeat, while targetByteIndex < limit\n        while (targetByteIndex < limit) {\n          // i. Let value be GetValueFromBuffer(srcBuffer, srcByteIndex, \"Uint8\").\n          let value = GetValueFromBuffer(realm, srcBuffer, srcByteIndex, \"Uint8\");\n\n          // ii. Perform SetValueInBuffer(targetBuffer, targetByteIndex, \"Uint8\", value).\n          SetValueInBuffer(realm, targetBuffer, targetByteIndex, \"Uint8\", value.value);\n\n          // iii. Set srcByteIndex to srcByteIndex + 1.\n          srcByteIndex += 1;\n\n          // iv. Set targetByteIndex to targetByteIndex + 1.\n          targetByteIndex += 1;\n        }\n      } else {\n        // 28. Else,\n        // a. Repeat, while targetByteIndex < limit\n        while (targetByteIndex < limit) {\n          // i. Let value be GetValueFromBuffer(srcBuffer, srcByteIndex, srcType).\n          let value = GetValueFromBuffer(realm, srcBuffer, srcByteIndex, srcType);\n\n          // ii. Perform SetValueInBuffer(targetBuffer, targetByteIndex, targetType, value).\n          SetValueInBuffer(realm, targetBuffer, targetByteIndex, targetType, value.value);\n\n          // iii. Set srcByteIndex to srcByteIndex + srcElementSize.\n          srcByteIndex = srcByteIndex + srcElementSize;\n\n          // iv. Set targetByteIndex to targetByteIndex + targetElementSize.\n          targetByteIndex = targetByteIndex + targetElementSize;\n        }\n      }\n\n      // 29. Return undefined.\n      return realm.intrinsics.undefined;\n    }\n  });\n\n  // ECMA262 22.2.3.24\n  obj.defineNativeMethod(\"slice\", 2, (context, [start, end]) => {\n    // 1. Let O be the this value.\n    let O = context;\n\n    // 2. Perform ? ValidateTypedArray(O).\n    ValidateTypedArray(realm, O);\n    invariant(O instanceof ObjectValue);\n\n    // 3. Let len be O.[[ArrayLength]].\n    let len = O.$ArrayLength;\n    invariant(typeof len === \"number\");\n\n    // 4. Let relativeStart be ? ToInteger(start).\n    let relativeStart = To.ToInteger(realm, start);\n\n    // 5. If relativeStart < 0, let k be max((len + relativeStart), 0); else let k be min(relativeStart, len).\n    let k = relativeStart < 0 ? Math.max(len + relativeStart, 0) : Math.min(relativeStart, len);\n\n    // 6. If end is undefined, let relativeEnd be len; else let relativeEnd be ? ToInteger(end).\n    let relativeEnd = !end || end instanceof UndefinedValue ? len : To.ToInteger(realm, end.throwIfNotConcrete());\n\n    // 7. If relativeEnd < 0, let final be max((len + relativeEnd), 0); else let final be min(relativeEnd, len).\n    let final = relativeEnd < 0 ? Math.max(len + relativeEnd, 0) : Math.min(relativeEnd, len);\n\n    // 8. Let count be max(final - k, 0).\n    let count = Math.max(final - k, 0);\n\n    // 9. Let A be ? TypedArraySpeciesCreate(O, « count »).\n    let A = TypedArraySpeciesCreate(realm, O, [new NumberValue(realm, count)]);\n\n    // 10. Let srcName be the String value of O.[[TypedArrayName]].\n    let srcName = O.$TypedArrayName;\n    invariant(typeof srcName === \"string\");\n\n    // 11. Let srcType be the String value of the Element Type value in Table 50 for srcName.\n    let srcType = ArrayElementType[srcName];\n\n    // 12. Let targetName be the String value of A.[[TypedArrayName]].\n    let targetName = A.$TypedArrayName;\n    invariant(typeof targetName === \"string\");\n\n    // 13. Let targetType be the String value of the Element Type value in Table 50 for targetName.\n    let targetType = ArrayElementType[targetName];\n\n    // 14. If SameValue(srcType, targetType) is false, then\n    if (srcType !== targetType) {\n      // a. Let n be 0.\n      let n = 0;\n\n      // b. Repeat, while k < final\n      while (k < final) {\n        // i. Let Pk be ! ToString(k).\n        let Pk = To.ToString(realm, new NumberValue(realm, k));\n\n        // ii. Let kValue be ? Get(O, Pk).\n        let kValue = Get(realm, O, Pk);\n\n        // iii. Perform ! Set(A, ! ToString(n), kValue).\n        Properties.Set(realm, A, To.ToString(realm, new NumberValue(realm, n)), kValue, true);\n\n        // iv. Increase k by 1.\n        k += 1;\n\n        // v. Increase n by 1.\n        n += 1;\n      }\n    } else if (count > 0) {\n      // 15. Else if count > 0, then\n      // a. Let srcBuffer be O.[[ViewedArrayBuffer]].\n      let srcBuffer = O.$ViewedArrayBuffer;\n      invariant(srcBuffer);\n\n      // b. If IsDetachedBuffer(srcBuffer) is true, throw a TypeError exception.\n      if (IsDetachedBuffer(realm, srcBuffer) === true) {\n        throw realm.createErrorThrowCompletion(realm.intrinsics.TypeError, \"IsDetachedBuffer(srcBuffer) is true\");\n      }\n\n      // c. Let targetBuffer be A.[[ViewedArrayBuffer]].\n      let targetBuffer = A.$ViewedArrayBuffer;\n      invariant(targetBuffer instanceof ObjectValue);\n\n      // d. Let elementSize be the Number value of the Element Size value specified in Table 50 for srcType.\n      let elementSize = ElementSize[srcType];\n\n      // e. NOTE: If srcType and targetType are the same, the transfer must be performed in a manner that preserves the bit-level encoding of the source data.\n\n      // f. Let srcByteOffset be O.[[ByteOffset]].\n      let srcByteOffset = O.$ByteOffset;\n      invariant(typeof srcByteOffset === \"number\");\n\n      // g. Let targetByteIndex be A.[[ByteOffset]].\n      let targetByteIndex = A.$ByteOffset;\n      invariant(typeof targetByteIndex === \"number\");\n\n      // h. Let srcByteIndex be (k × elementSize) + srcByteOffset.\n      let srcByteIndex = k * elementSize + srcByteOffset;\n\n      // i. Let limit be targetByteIndex + count × elementSize.\n      let limit = targetByteIndex + count * elementSize;\n\n      // j. Repeat, while targetByteIndex < limit\n      while (targetByteIndex < limit) {\n        // i. Let value be GetValueFromBuffer(srcBuffer, srcByteIndex, \"Uint8\").\n        let value = GetValueFromBuffer(realm, srcBuffer, srcByteIndex, \"Uint8\");\n\n        // ii. Perform SetValueInBuffer(targetBuffer, targetByteIndex, \"Uint8\", value).\n        SetValueInBuffer(realm, targetBuffer, targetByteIndex, \"Uint8\", value.value);\n\n        // iii. Increase srcByteIndex by 1.\n        srcByteIndex += 1;\n\n        // iv. Increase targetByteIndex by 1.\n        targetByteIndex += 1;\n      }\n    }\n\n    // 16. Return A.\n    return A;\n  });\n\n  // ECMA262 22.2.3.25\n  obj.defineNativeMethod(\"some\", 1, (context, [callbackfn, thisArg]) => {\n    // 1. Let O be ? ToObject(this value).\n    let O = To.ToObject(realm, context);\n\n    // 2. Perform ? ValidateTypedArray(O).\n    ValidateTypedArray(realm, O);\n\n    // 3. Let len be O.[[ArrayLength]].\n    let len = O.throwIfNotConcreteObject().$ArrayLength;\n    invariant(typeof len === \"number\");\n\n    // 4. If IsCallable(callbackfn) is false, throw a TypeError exception.\n    if (!IsCallable(realm, callbackfn)) {\n      throw realm.createErrorThrowCompletion(\n        realm.intrinsics.TypeError,\n        \"callback passed to Array.prototype.some isn't callable\"\n      );\n    }\n\n    // 5. If thisArg was supplied, let T be thisArg; else let T be undefined.\n    let T = thisArg || realm.intrinsics.undefined;\n\n    // 6. Let k be 0.\n    let k = 0;\n\n    // 7. Repeat, while k < len\n    while (k < len) {\n      // a. Let Pk be ! ToString(k).\n      let Pk = new StringValue(realm, k + \"\");\n\n      // b. Let kPresent be ? HasProperty(O, Pk).\n      let kPresent = HasProperty(realm, O, Pk);\n\n      // c. If kPresent is true, then\n      if (kPresent) {\n        // i. Let kValue be ? Get(O, Pk).\n        let kValue = Get(realm, O, Pk);\n\n        // ii. Let testResult be ToBoolean(? Call(callbackfn, T, « kValue, k, O »)).\n        let testResult = To.ToBooleanPartial(realm, Call(realm, callbackfn, T, [kValue, new NumberValue(realm, k), O]));\n\n        // iii. If testResult is true, return true.\n        if (testResult) return realm.intrinsics.true;\n      }\n\n      // d. Increase k by 1.\n      k++;\n    }\n\n    // 8. Return false.\n    return realm.intrinsics.false;\n  });\n\n  // ECMA262 22.2.3.26\n  obj.defineNativeMethod(\"sort\", 1, (context, [comparefn]) => {\n    // 1. Let obj be the this value.\n    let O = To.ToObject(realm, context);\n\n    // 2. Let buffer be ? ValidateTypedArray(obj).\n    let buffer = ValidateTypedArray(realm, O);\n\n    // 3. Let len be the value of obj's [[ArrayLength]] internal slot.\n    let len = O.throwIfNotConcreteObject().$ArrayLength;\n    invariant(typeof len === \"number\");\n\n    // 22.2.3.26 Runtime Semantics: SortCompare( x, y )#\n    let SortCompare = (x, y) => {\n      // 1. Assert: Both Type(x) and Type(y) is Number.\n      invariant(x instanceof NumberValue);\n      invariant(y instanceof NumberValue);\n\n      // 2. If the argument comparefn is not undefined, then\n      if (!comparefn.mightBeUndefined()) {\n        // a. Let v be ? Call(comparefn, undefined, « x, y »).\n        let v = Call(realm, comparefn, realm.intrinsics.undefined, [x, y]);\n\n        // b. If IsDetachedBuffer(buffer) is true, throw a TypeError exception.\n        if (IsDetachedBuffer(realm, buffer) === true)\n          throw realm.createErrorThrowCompletion(realm.intrinsics.TypeError, \"array buffer has been detached\");\n\n        // c. If v is NaN, return +0.\n        if (v instanceof NumberValue && isNaN(v.value)) return realm.intrinsics.zero;\n\n        // d. Return v.\n        return v;\n      }\n      comparefn.throwIfNotConcrete();\n\n      // If x and y are both NaN, return +0.\n      // If x is NaN, return 1.\n      if (isNaN(x.value)) {\n        if (isNaN(y.value)) return realm.intrinsics.zero;\n        return new NumberValue(realm, 1);\n      }\n\n      // If y is NaN, return -1.\n      if (isNaN(y.value)) return new NumberValue(realm, -1);\n\n      // If x < y, return -1.\n      if (x.value < y.value) return new NumberValue(realm, -1);\n\n      // If x > y, return 1.\n      if (x.value > y.value) return new NumberValue(realm, +1);\n\n      // If x is -0 and y is +0, return -1.\n      if (Object.is(x.value, -0) && Object.is(y.value, +0)) return new NumberValue(realm, -1);\n\n      // If x is +0 and y is -0, return 1.\n      if (Object.is(x.value, +0) && Object.is(y.value, -0)) return new NumberValue(realm, 1);\n\n      // Return +0.\n      return realm.intrinsics.zero;\n    };\n\n    //1. Perform an implementation-dependent sequence of calls to the [[Get]] and [[Set]] internal methods of obj, to the DeletePropertyOrThrow and HasOwnProperty abstract operation with obj as the first argument, and to SortCompare (described below), such that:\n    //   The property key argument for each call to [[Get]], [[Set]], HasOwnProperty, or DeletePropertyOrThrow is the string representation of a nonnegative integer less than len.\n\n    // We leverage the underlying implementation sort by copying the element in a temp. array, sorting it, and\n    // transfering back the value inside the our array.\n\n    // We need to adapt the comparefn function to match the expected types\n    let comparefn_ = (x, y) => {\n      invariant(x instanceof NumberValue, \"Unexpected type\");\n      invariant(y instanceof NumberValue, \"Unexpected type\");\n\n      let result_ = SortCompare(x, y);\n      let numb = To.ToNumber(realm, result_);\n      return numb;\n    };\n\n    let arr = [];\n    for (let j = 0; j < len; j++) {\n      let val = IntegerIndexedElementGet(realm, O.throwIfNotConcreteObject(), j);\n      arr[j] = val;\n    }\n\n    arr.sort(comparefn_);\n\n    //Apply the permutation back to the original array.\n    for (let j = 0; j < len; j++) {\n      IntegerIndexedElementSet(realm, O.throwIfNotConcreteObject(), j, arr[j]);\n    }\n\n    // 2. Return obj;\n    return context;\n  });\n\n  // ECMA262 22.2.3.27\n  obj.defineNativeMethod(\"subarray\", 2, (context, [begin, end]) => {\n    // 1. Let O be the this value.\n    let O = context.throwIfNotConcrete();\n\n    // 2. If Type(O) is not Object, throw a TypeError exception.\n    if (!(O instanceof ObjectValue)) {\n      throw realm.createErrorThrowCompletion(realm.intrinsics.TypeError, \"Type(O) is not Object\");\n    }\n\n    // 3. If O does not have a [[TypedArrayName]] internal slot, throw a TypeError exception.\n    if (!(\"$TypedArrayName\" in O)) {\n      throw realm.createErrorThrowCompletion(\n        realm.intrinsics.TypeError,\n        \"O does not have a [[TypedArrayName]] internal slot\"\n      );\n    }\n\n    // 4. Assert: O has a [[ViewedArrayBuffer]] internal slot.\n    invariant(O.$ViewedArrayBuffer, \"O has a [[ViewedArrayBuffer]] internal slot\");\n\n    // 5. Let buffer be O.[[ViewedArrayBuffer]].\n    let buffer = O.$ViewedArrayBuffer;\n    invariant(buffer);\n\n    // 6. Let srcLength be O.[[ArrayLength]].\n    let srcLength = O.$ArrayLength;\n    invariant(typeof srcLength === \"number\");\n\n    // 7. Let relativeBegin be ? ToInteger(begin).\n    let relativeBegin = To.ToInteger(realm, begin);\n\n    // 8. If relativeBegin < 0, let beginIndex be max((srcLength + relativeBegin), 0); else let beginIndex be min(relativeBegin, srcLength).\n    let beginIndex = relativeBegin < 0 ? Math.max(srcLength + relativeBegin, 0) : Math.min(relativeBegin, srcLength);\n\n    // 9. If end is undefined, let relativeEnd be srcLength; else, let relativeEnd be ? ToInteger(end).\n    let relativeEnd = !end || end instanceof UndefinedValue ? srcLength : To.ToInteger(realm, end.throwIfNotConcrete());\n\n    // 10. If relativeEnd < 0, let endIndex be max((srcLength + relativeEnd), 0); else let endIndex be min(relativeEnd, srcLength).\n    let endIndex = relativeEnd < 0 ? Math.max(srcLength + relativeEnd, 0) : Math.min(relativeEnd, srcLength);\n\n    // 11. Let newLength be max(endIndex - beginIndex, 0).\n    let newLength = Math.max(endIndex - beginIndex, 0);\n\n    // 12. Let constructorName be the String value of O.[[TypedArrayName]].\n    let constructorName = O.$TypedArrayName;\n    invariant(typeof constructorName === \"string\");\n\n    // 13. Let elementSize be the Number value of the Element Size value specified in Table 50 for constructorName.\n    let elementSize = ArrayElementSize[constructorName];\n\n    // 14. Let srcByteOffset be O.[[ByteOffset]].\n    let srcByteOffset = O.$ByteOffset;\n    invariant(typeof srcByteOffset === \"number\");\n\n    // 15. Let beginByteOffset be srcByteOffset + beginIndex × elementSize.\n    let beginByteOffset = srcByteOffset + beginIndex * elementSize;\n\n    // 16. Let argumentsList be « buffer, beginByteOffset, newLength ».\n    let argumentsList = [buffer, new NumberValue(realm, beginByteOffset), new NumberValue(realm, newLength)];\n\n    // 17. Return ? TypedArraySpeciesCreate(O, argumentsList).\n    return TypedArraySpeciesCreate(realm, O, argumentsList);\n  });\n\n  // ECMA262 22.2.3.28\n  obj.defineNativeMethod(\"toLocaleString\", 0, context => {\n    // 1. Let array be ? ToObject(this value).\n    let array = To.ToObject(realm, context);\n\n    // 2. Perform ? ValidateTypedArray(array).\n    ValidateTypedArray(realm, array);\n\n    // 3. Let len be array.[[ArrayLength]].\n    let len = array.throwIfNotConcreteObject().$ArrayLength;\n    invariant(typeof len === \"number\");\n\n    // 4. Let separator be the String value for the list-separator String appropriate for the host environment's current locale (this is derived in an implementation-defined way).\n    let separator = \",\";\n\n    // 5. If len is zero, return the empty String.\n    if (len === 0) return realm.intrinsics.emptyString;\n\n    // 6. Let firstElement be ? Get(array, \"0\").\n    let firstElement = Get(realm, array, \"0\");\n\n    // 7. If firstElement is undefined or null, then\n    let R: ?string;\n    if (HasSomeCompatibleType(firstElement, UndefinedValue, NullValue)) {\n      // a. Let R be the empty String.\n      R = \"\";\n    } else {\n      // 8. Else,\n      // a. Let R be ? ToString(? Invoke(firstElement, \"toLocaleString\")).\n      R = To.ToStringPartial(realm, Invoke(realm, firstElement, \"toLocaleString\"));\n    }\n\n    // 9. Let k be 1.\n    let k = 1;\n\n    // 10. Repeat, while k < len\n    while (k < len) {\n      // a. Let S be a String value produced by concatenating R and separator.\n      let S: string = R + separator;\n\n      // b. Let nextElement be ? Get(array, ! ToString(k)).\n      let nextElement = Get(realm, array, new StringValue(realm, k + \"\"));\n\n      // c. If nextElement is undefined or null, then\n      if (HasSomeCompatibleType(nextElement, UndefinedValue, NullValue)) {\n        // i. Let R be the empty String.\n        R = \"\";\n      } else {\n        // d. Else,\n        // i. Let R be ? ToString(? Invoke(nextElement, \"toLocaleString\")).\n        R = To.ToStringPartial(realm, Invoke(realm, nextElement, \"toLocaleString\"));\n      }\n\n      // e. Let R be a String value produced by concatenating S and R.\n      R = S + R;\n\n      // f. Increase k by 1.\n      k++;\n    }\n\n    // 11. Return R.\n    return new StringValue(realm, R);\n  });\n\n  // ECMA262 22.2.3.29\n  obj.defineNativeProperty(\"toString\", realm.intrinsics.ArrayProto_toString);\n\n  // ECMA262 22.2.3.30\n  obj.defineNativeProperty(\"values\", realm.intrinsics.TypedArrayProto_values);\n\n  // ECMA262 22.2.3.31\n  obj.defineNativeProperty(realm.intrinsics.SymbolIterator, realm.intrinsics.TypedArrayProto_values);\n\n  // ECMA262 22.2.3.32\n  obj.defineNativeGetter(realm.intrinsics.SymbolToStringTag, context => {\n    // 1. Let O be the this value.\n    let O = context.throwIfNotConcrete();\n\n    // 2. If Type(O) is not Object, return undefined.\n    if (!(O instanceof ObjectValue)) return realm.intrinsics.undefined;\n\n    // 3. If O does not have a [[TypedArrayName]] internal slot, return undefined.\n    if (!(\"$TypedArrayName\" in O)) return realm.intrinsics.undefined;\n\n    // 4. Let name be O.[[TypedArrayName]].\n    let name = O.$TypedArrayName;\n\n    // 5. Assert: name is a String value.\n    invariant(typeof name === \"string\", \"name is a String value\");\n\n    // 6. Return name.\n    return new StringValue(realm, name);\n  });\n}\n\nexport function build(realm: Realm, obj: ObjectValue, type: ElementType): void {\n  // ECMA262 22.2.6\n  obj.$Prototype = realm.intrinsics.TypedArrayPrototype;\n\n  // ECMA262 22.2.6.1\n  obj.defineNativeConstant(\"BYTES_PER_ELEMENT\", new NumberValue(realm, ElementSize[type]));\n}\n"
  },
  {
    "path": "src/intrinsics/ecma262/URIError.js",
    "content": "/**\n * Copyright (c) 2017-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n/* @flow strict-local */\n\nimport type { Realm } from \"../../realm.js\";\nimport type { NativeFunctionValue } from \"../../values/index.js\";\nimport { build } from \"./Error.js\";\n\nexport default function(realm: Realm): NativeFunctionValue {\n  return build(\"URIError\", realm);\n}\n"
  },
  {
    "path": "src/intrinsics/ecma262/URIErrorPrototype.js",
    "content": "/**\n * Copyright (c) 2017-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n/* @flow strict-local */\n\nimport type { Realm } from \"../../realm.js\";\nimport { ObjectValue, StringValue } from \"../../values/index.js\";\n\nexport default function(realm: Realm, obj: ObjectValue): void {\n  obj.defineNativeProperty(\"name\", new StringValue(realm, \"URIError\"));\n  obj.defineNativeProperty(\"message\", realm.intrinsics.emptyString);\n}\n"
  },
  {
    "path": "src/intrinsics/ecma262/Uint16Array.js",
    "content": "/**\n * Copyright (c) 2017-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n/* @flow strict-local */\n\nimport type { Realm } from \"../../realm.js\";\nimport { NativeFunctionValue } from \"../../values/index.js\";\nimport { build } from \"./TypedArray.js\";\n\nexport default function(realm: Realm): NativeFunctionValue {\n  return build(realm, \"Uint16\");\n}\n"
  },
  {
    "path": "src/intrinsics/ecma262/Uint16ArrayPrototype.js",
    "content": "/**\n * Copyright (c) 2017-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n/* @flow strict-local */\n\nimport type { Realm } from \"../../realm.js\";\nimport type { ObjectValue } from \"../../values/index.js\";\nimport { build } from \"./TypedArrayPrototype.js\";\n\nexport default function(realm: Realm, obj: ObjectValue): void {\n  build(realm, obj, \"Uint16\");\n}\n"
  },
  {
    "path": "src/intrinsics/ecma262/Uint32Array.js",
    "content": "/**\n * Copyright (c) 2017-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n/* @flow strict-local */\n\nimport type { Realm } from \"../../realm.js\";\nimport { NativeFunctionValue } from \"../../values/index.js\";\nimport { build } from \"./TypedArray.js\";\n\nexport default function(realm: Realm): NativeFunctionValue {\n  return build(realm, \"Uint32\");\n}\n"
  },
  {
    "path": "src/intrinsics/ecma262/Uint32ArrayPrototype.js",
    "content": "/**\n * Copyright (c) 2017-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n/* @flow strict-local */\n\nimport type { Realm } from \"../../realm.js\";\nimport type { ObjectValue } from \"../../values/index.js\";\nimport { build } from \"./TypedArrayPrototype.js\";\n\nexport default function(realm: Realm, obj: ObjectValue): void {\n  build(realm, obj, \"Uint32\");\n}\n"
  },
  {
    "path": "src/intrinsics/ecma262/Uint8Array.js",
    "content": "/**\n * Copyright (c) 2017-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n/* @flow strict-local */\n\nimport type { Realm } from \"../../realm.js\";\nimport { NativeFunctionValue } from \"../../values/index.js\";\nimport { build } from \"./TypedArray.js\";\n\nexport default function(realm: Realm): NativeFunctionValue {\n  return build(realm, \"Uint8\");\n}\n"
  },
  {
    "path": "src/intrinsics/ecma262/Uint8ArrayPrototype.js",
    "content": "/**\n * Copyright (c) 2017-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n/* @flow strict-local */\n\nimport type { Realm } from \"../../realm.js\";\nimport type { ObjectValue } from \"../../values/index.js\";\nimport { build } from \"./TypedArrayPrototype.js\";\n\nexport default function(realm: Realm, obj: ObjectValue): void {\n  build(realm, obj, \"Uint8\");\n}\n"
  },
  {
    "path": "src/intrinsics/ecma262/Uint8ClampedArray.js",
    "content": "/**\n * Copyright (c) 2017-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n/* @flow strict-local */\n\nimport type { Realm } from \"../../realm.js\";\nimport { NativeFunctionValue } from \"../../values/index.js\";\nimport { build } from \"./TypedArray.js\";\n\nexport default function(realm: Realm): NativeFunctionValue {\n  return build(realm, \"Uint8Clamped\");\n}\n"
  },
  {
    "path": "src/intrinsics/ecma262/Uint8ClampedArrayPrototype.js",
    "content": "/**\n * Copyright (c) 2017-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n/* @flow strict-local */\n\nimport type { Realm } from \"../../realm.js\";\nimport type { ObjectValue } from \"../../values/index.js\";\nimport { build } from \"./TypedArrayPrototype.js\";\n\nexport default function(realm: Realm, obj: ObjectValue): void {\n  build(realm, obj, \"Uint8Clamped\");\n}\n"
  },
  {
    "path": "src/intrinsics/ecma262/WeakMap.js",
    "content": "/**\n * Copyright (c) 2017-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n/* @flow */\n\nimport type { Realm } from \"../../realm.js\";\nimport { NativeFunctionValue, ObjectValue, NullValue, UndefinedValue } from \"../../values/index.js\";\nimport { AbruptCompletion } from \"../../completions.js\";\nimport { Get, IsCallable, IteratorClose, IteratorValue, GetIterator, IteratorStep, Call } from \"../../methods/index.js\";\nimport { Create } from \"../../singletons.js\";\nimport invariant from \"../../invariant.js\";\n\nexport default function(realm: Realm): NativeFunctionValue {\n  let func = new NativeFunctionValue(realm, \"WeakMap\", \"WeakMap\", 0, (args, [iterable], argCount, NewTarget) => {\n    // 1. If NewTarget is undefined, throw a TypeError exception.\n    if (!NewTarget) {\n      throw realm.createErrorThrowCompletion(realm.intrinsics.TypeError);\n    }\n\n    // 2. Let map be ? OrdinaryCreateFromConstructor(NewTarget, \"%WeakMapPrototype%\", « [[WeakMapData]] »).\n    let map = Create.OrdinaryCreateFromConstructor(realm, NewTarget, \"WeakMapPrototype\", {\n      $WeakMapData: undefined,\n    });\n\n    // 3. Set map's [[WeakMapData]] internal slot to a new empty List.\n    map.$WeakMapData = [];\n\n    // 4. If iterable is not present, let iterable be undefined.\n    if (iterable && realm.isCompatibleWith(realm.MOBILE_JSC_VERSION)) {\n      throw realm.createErrorThrowCompletion(\n        realm.intrinsics.TypeError,\n        \"the weak map constructor doesn't take arguments\"\n      );\n    }\n    if (!iterable) iterable = realm.intrinsics.undefined;\n\n    // 5. If iterable is either undefined or null, let iter be undefined.\n    let iter, adder;\n    if ((iterable: any) instanceof UndefinedValue || (iterable: any) instanceof NullValue) {\n      adder = realm.intrinsics.undefined;\n      iter = realm.intrinsics.undefined;\n    } else {\n      // 6. Else,\n      // a. Let adder be ? Get(map, \"set\").\n      adder = Get(realm, map, \"set\");\n\n      // b. If IsCallable(adder) is false, throw a TypeError exception.\n      if (!IsCallable(realm, adder)) {\n        throw realm.createErrorThrowCompletion(realm.intrinsics.TypeError);\n      }\n\n      // c. Let iter be ? GetIterator(iterable).\n      iter = GetIterator(realm, iterable);\n    }\n\n    // 7. If iter is undefined, return map.\n    if (iter instanceof UndefinedValue) {\n      return map;\n    }\n\n    // 8. Repeat\n    while (true) {\n      // a. Let next be ? IteratorStep(iter).\n      let next = IteratorStep(realm, iter);\n\n      // b. If next is false, return map.\n      if (!next) return map;\n\n      // c. Let nextItem be ? IteratorValue(next).\n      let nextItem = IteratorValue(realm, next).throwIfNotConcrete();\n\n      // d. If Type(nextItem) is not Object, then\n      if (!(nextItem instanceof ObjectValue)) {\n        // i. Let error be Completion{[[Type]]: throw, [[Value]]: a newly created TypeError object, [[Target]]: empty}.\n        let error = realm.createErrorThrowCompletion(realm.intrinsics.TypeError);\n\n        // ii. Return ? IteratorClose(iter, error).\n        throw IteratorClose(realm, iter, error);\n      }\n\n      // e. Let k be Get(nextItem, \"0\").\n      let k;\n      try {\n        k = Get(realm, nextItem, \"0\");\n      } catch (kCompletion) {\n        if (kCompletion instanceof AbruptCompletion) {\n          // f. If k is an abrupt completion, return ? IteratorClose(iter, k).\n          throw IteratorClose(realm, iter, kCompletion);\n        } else throw kCompletion;\n      }\n\n      // g. Let v be Get(nextItem, \"1\").\n      let v;\n      try {\n        v = Get(realm, nextItem, \"1\");\n      } catch (vCompletion) {\n        if (vCompletion instanceof AbruptCompletion) {\n          // h. If v is an abrupt completion, return ? IteratorClose(iter, v).\n          throw IteratorClose(realm, iter, vCompletion);\n        } else throw vCompletion;\n      }\n\n      // i. Let status be Call(adder, map, « k.[[Value]], v.[[Value]] »).\n      let status;\n      try {\n        status = Call(realm, adder, map, [k, v]);\n      } catch (statusCompletion) {\n        if (statusCompletion instanceof AbruptCompletion) {\n          // j. If status is an abrupt completion, return ? IteratorClose(iter, status).\n          throw IteratorClose(realm, iter, statusCompletion);\n        } else throw statusCompletion;\n      }\n      status;\n    }\n\n    invariant(false);\n  });\n\n  return func;\n}\n"
  },
  {
    "path": "src/intrinsics/ecma262/WeakMapPrototype.js",
    "content": "/**\n * Copyright (c) 2017-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n/* @flow */\n\nimport type { Realm } from \"../../realm.js\";\nimport { StringValue, ObjectValue } from \"../../values/index.js\";\nimport { SameValuePartial } from \"../../methods/index.js\";\nimport invariant from \"../../invariant.js\";\n\nexport default function(realm: Realm, obj: ObjectValue): void {\n  // ECMA262 23.3.3.6\n  obj.defineNativeProperty(realm.intrinsics.SymbolToStringTag, new StringValue(realm, \"WeakMap\"), { writable: false });\n\n  // ECMA262 23.3.3.2\n  obj.defineNativeMethod(\"delete\", 1, (context, [key]) => {\n    // 1. Let M be the this value.\n    let M = context.throwIfNotConcrete();\n\n    // 2. If Type(M) is not Object, throw a TypeError exception.\n    if (!(M instanceof ObjectValue)) {\n      throw realm.createErrorThrowCompletion(realm.intrinsics.TypeError);\n    }\n\n    // 3. If M does not have a [[WeakMapData]] internal slot, throw a TypeError exception.\n    if (!M.$WeakMapData) {\n      throw realm.createErrorThrowCompletion(realm.intrinsics.TypeError);\n    }\n\n    // 4. Let entries be the List that is the value of M's [[WeakMapData]] internal slot.\n    let entries = M.$WeakMapData;\n    realm.recordModifiedProperty((M: any).$WeakMapData_binding);\n    invariant(entries !== undefined);\n\n    // 5. If Type(key) is not Object, return false.\n    key = key.throwIfNotConcrete();\n    if (!(key instanceof ObjectValue)) {\n      return realm.intrinsics.false;\n    }\n\n    // 6. Repeat for each Record {[[Key]], [[Value]]} p that is an element of entries,\n    for (let p of entries) {\n      // a. If p.[[Key]] is not empty and SameValue(p.[[Key]], key) is true, then\n      if (p.$Key !== undefined && SameValuePartial(realm, p.$Key, key)) {\n        // i. Set p.[[Key]] to empty.\n        p.$Key = undefined;\n\n        // ii. Set p.[[Value]] to empty.\n        p.$Value = undefined;\n\n        // iii. Return true.\n        return realm.intrinsics.true;\n      }\n    }\n\n    // 7. Return false.\n    return realm.intrinsics.false;\n  });\n\n  // ECMA262 23.3.3.3\n  obj.defineNativeMethod(\"get\", 1, (context, [key]) => {\n    // 1. Let M be the this value.\n    let M = context.throwIfNotConcrete();\n\n    // 2. If Type(M) is not Object, throw a TypeError exception.\n    if (!(M instanceof ObjectValue)) {\n      throw realm.createErrorThrowCompletion(realm.intrinsics.TypeError);\n    }\n\n    // 3. If M does not have a [[WeakMapData]] internal slot, throw a TypeError exception.\n    if (!M.$WeakMapData) {\n      throw realm.createErrorThrowCompletion(realm.intrinsics.TypeError);\n    }\n\n    // 4. Let entries be the List that is the value of M's [[WeakMapData]] internal slot.\n    let entries = M.$WeakMapData;\n    invariant(entries !== undefined);\n\n    // 5. If Type(key) is not Object, return undefined.\n    key = key.throwIfNotConcrete();\n    if (!(key instanceof ObjectValue)) {\n      return realm.intrinsics.undefined;\n    }\n\n    // 6. Repeat for each Record {[[Key]], [[Value]]} p that is an element of entries,\n    for (let p of entries) {\n      // a. If p.[[Key]] is not empty and SameValue(p.[[Key]], key) is true, return p.[[Value]].\n      if (p.$Key !== undefined && SameValuePartial(realm, p.$Key, key)) {\n        invariant(p.$Value !== undefined);\n        return p.$Value;\n      }\n    }\n\n    // 7. Return undefined.\n    return realm.intrinsics.undefined;\n  });\n\n  // ECMA262 23.3.3.4\n  obj.defineNativeMethod(\"has\", 1, (context, [key]) => {\n    // 1. Let M be the this value.\n    let M = context.throwIfNotConcrete();\n\n    // 2. If Type(M) is not Object, throw a TypeError exception.\n    if (!(M instanceof ObjectValue)) {\n      throw realm.createErrorThrowCompletion(realm.intrinsics.TypeError);\n    }\n\n    // 3. If M does not have a [[WeakMapData]] internal slot, throw a TypeError exception.\n    if (!M.$WeakMapData) {\n      throw realm.createErrorThrowCompletion(realm.intrinsics.TypeError);\n    }\n\n    // 4. Let entries be the List that is the value of M's [[WeakMapData]] internal slot.\n    let entries = M.$WeakMapData;\n    invariant(entries !== undefined);\n\n    // 5. If Type(key) is not Object, return false.\n    key = key.throwIfNotConcrete();\n    if (!(key instanceof ObjectValue)) {\n      return realm.intrinsics.false;\n    }\n\n    // 6. Repeat for each Record {[[Key]], [[Value]]} p that is an element of entries,\n    for (let p of entries) {\n      // a. If p.[[Key]] is not empty and SameValue(p.[[Key]], key) is true, return true.\n      if (p.$Key !== undefined && SameValuePartial(realm, p.$Key, key)) return realm.intrinsics.true;\n    }\n\n    // 7. Return false.\n    return realm.intrinsics.false;\n  });\n\n  // ECMA262 23.3.3.5\n  obj.defineNativeMethod(\"set\", 2, (context, [key, value]) => {\n    // 1. Let M be the this value.\n    let M = context.throwIfNotConcrete();\n\n    // 2. If Type(M) is not Object, throw a TypeError exception.\n    if (!(M instanceof ObjectValue)) {\n      throw realm.createErrorThrowCompletion(realm.intrinsics.TypeError);\n    }\n\n    // 3. If M does not have a [[WeakMapData]] internal slot, throw a TypeError exception.\n    if (!M.$WeakMapData) {\n      throw realm.createErrorThrowCompletion(realm.intrinsics.TypeError);\n    }\n\n    // 4. Let entries be the List that is the value of M's [[WeakMapData]] internal slot.\n    realm.recordModifiedProperty((M: any).$WeakMapData_binding);\n    let entries = M.$WeakMapData;\n    invariant(entries !== undefined);\n\n    // 5. If Type(key) is not Object, throw a TypeError exception.\n    key = key.throwIfNotConcrete();\n    if (!(key instanceof ObjectValue)) {\n      throw realm.createErrorThrowCompletion(realm.intrinsics.TypeError);\n    }\n\n    // 6. Repeat for each Record {[[Key]], [[Value]]} p that is an element of entries,\n    for (let p of entries) {\n      // a. If p.[[Key]] is not empty and SameValue(p.[[Key]], key) is true, then\n      if (p.$Key !== undefined && SameValuePartial(realm, p.$Key, key)) {\n        // i. Set p.[[Value]] to value.\n        p.$Value = value;\n\n        // ii. Return M.\n        return M;\n      }\n    }\n\n    // 7. Let p be the Record {[[Key]]: key, [[Value]]: value}.\n    let p = { $Key: key, $Value: value };\n\n    // 8. Append p as the last element of entries.\n    entries.push(p);\n\n    // 9. Return M.\n    return M;\n  });\n}\n"
  },
  {
    "path": "src/intrinsics/ecma262/WeakSet.js",
    "content": "/**\n * Copyright (c) 2017-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n/* @flow */\n\nimport type { Realm } from \"../../realm.js\";\nimport { NativeFunctionValue, NullValue, UndefinedValue } from \"../../values/index.js\";\nimport { AbruptCompletion } from \"../../completions.js\";\nimport { Get, IsCallable, IteratorClose, IteratorValue, GetIterator, IteratorStep, Call } from \"../../methods/index.js\";\nimport { Create } from \"../../singletons.js\";\nimport invariant from \"../../invariant.js\";\n\nexport default function(realm: Realm): NativeFunctionValue {\n  // ECMA262 23.4.1.1\n  let func = new NativeFunctionValue(realm, \"WeakSet\", \"WeakSet\", 0, (args, [iterable], argCount, NewTarget) => {\n    // 1. If NewTarget is undefined, throw a TypeError exception.\n    if (!NewTarget) {\n      throw realm.createErrorThrowCompletion(realm.intrinsics.TypeError);\n    }\n\n    // 2. Let set be ? OrdinaryCreateFromConstructor(NewTarget, \"%WeakSetPrototype%\", « [[WeakSetData]] »).\n    let set = Create.OrdinaryCreateFromConstructor(realm, NewTarget, \"WeakSetPrototype\", {\n      $WeakSetData: undefined,\n    });\n\n    // 3. Set set.[[WeakSetData]] to a new empty List.\n    set.$WeakSetData = [];\n\n    // 4. If iterable is not present, let iterable be undefined.\n    if (iterable === undefined) iterable = realm.intrinsics.undefined;\n\n    let iter, adder;\n    // 5. If iterable is either undefined or null, let iter be undefined.\n    if ((iterable: any) instanceof UndefinedValue || (iterable: any) instanceof NullValue) {\n      iter = realm.intrinsics.undefined;\n      adder = realm.intrinsics.undefined;\n    } else {\n      // 6. Else,\n      // a. Let adder be ? Get(set, \"add\").\n      adder = Get(realm, set, \"add\");\n\n      // b. If IsCallable(adder) is false, throw a TypeError exception.\n      if (!IsCallable(realm, adder)) {\n        throw realm.createErrorThrowCompletion(realm.intrinsics.TypeError, \"IsCallable(adder) is false\");\n      }\n\n      // c. Let iter be ? GetIterator(iterable).\n      iter = GetIterator(realm, iterable);\n    }\n    // 7. If iter is undefined, return set.\n    if (iter instanceof UndefinedValue) return set;\n\n    // 8. Repeat\n    while (true) {\n      // a. Let next be ? IteratorStep(iter).\n      let next = IteratorStep(realm, iter);\n\n      // b. If next is false, return set.\n      if (next === false) return set;\n\n      // c. Let nextValue be ? IteratorValue(next).\n      let nextValue = IteratorValue(realm, next);\n\n      // d. Let status be Call(adder, set, « nextValue »).\n      try {\n        Call(realm, adder, set, [nextValue]);\n      } catch (statusCompletion) {\n        if (!(statusCompletion instanceof AbruptCompletion)) throw statusCompletion;\n        // e. If status is an abrupt completion, return ? IteratorClose(iter, status).\n        throw IteratorClose(realm, iter, statusCompletion);\n      }\n    }\n\n    invariant(false);\n  });\n\n  return func;\n}\n"
  },
  {
    "path": "src/intrinsics/ecma262/WeakSetPrototype.js",
    "content": "/**\n * Copyright (c) 2017-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n/* @flow */\n\nimport type { Realm } from \"../../realm.js\";\nimport { StringValue, ObjectValue } from \"../../values/index.js\";\nimport { SameValuePartial } from \"../../methods/index.js\";\nimport invariant from \"../../invariant.js\";\n\nexport default function(realm: Realm, obj: ObjectValue): void {\n  // ECMA262 23.4.3.1\n  obj.defineNativeMethod(\"add\", 1, (context, [value]) => {\n    // 1. Let S be the this value.\n    let S = context.throwIfNotConcrete();\n\n    // 2. If Type(S) is not Object, throw a TypeError exception.\n    if (!(S instanceof ObjectValue)) {\n      throw realm.createErrorThrowCompletion(realm.intrinsics.TypeError, \"Type(S) is not Object\");\n    }\n\n    // 3. If S does not have a [[WeakSetData]] internal slot, throw a TypeError exception.\n    if (!S.$WeakSetData) {\n      throw realm.createErrorThrowCompletion(\n        realm.intrinsics.TypeError,\n        \"S does not have a [[WeakSetData]] internal slot\"\n      );\n    }\n\n    // 4. If Type(value) is not Object, throw a TypeError exception.\n    value = value.throwIfNotConcrete();\n    if (!(value instanceof ObjectValue)) {\n      throw realm.createErrorThrowCompletion(realm.intrinsics.TypeError, \"Type(value) is not Object\");\n    }\n\n    // 5. Let entries be the List that is S.[[WeakSetData]].\n    realm.recordModifiedProperty((S: any).$WeakSetData_binding);\n    let entries = S.$WeakSetData;\n    invariant(entries != null);\n\n    // 6. Repeat for each e that is an element of entries,\n    for (let e of entries) {\n      // a. If e is not empty and SameValue(e, value) is true, then\n      if (e !== undefined && SameValuePartial(realm, e, value) === true) {\n        // i. Return S.\n        return S;\n      }\n    }\n\n    // 7. Append value as the last element of entries.\n    entries.push(value);\n\n    // 8. Return S.\n    return S;\n  });\n\n  // ECMA262 23.4.3.3\n  obj.defineNativeMethod(\"delete\", 1, (context, [value]) => {\n    // 1. Let S be the this value.\n    let S = context.throwIfNotConcrete();\n\n    // 2. If Type(S) is not Object, throw a TypeError exception.\n    if (!(S instanceof ObjectValue)) {\n      throw realm.createErrorThrowCompletion(realm.intrinsics.TypeError, \"Type(S) is not Object\");\n    }\n\n    // 3. If S does not have a [[WeakSetData]] internal slot, throw a TypeError exception.\n    if (!S.$WeakSetData) {\n      throw realm.createErrorThrowCompletion(\n        realm.intrinsics.TypeError,\n        \"S does not have a [[WeakSetData]] internal slot\"\n      );\n    }\n\n    // 4. If Type(value) is not Object, throw a TypeError exception.\n    value = value.throwIfNotConcrete();\n    if (!(value instanceof ObjectValue)) return realm.intrinsics.false;\n\n    // 5. Let entries be the List that is S.[[WeakSetData]].\n    realm.recordModifiedProperty((S: any).$WeakSetData_binding);\n    let entries = S.$WeakSetData;\n    invariant(entries != null);\n\n    // 6. Repeat for each e that is an element of entries,\n    for (let i = 0; i < entries.length; ++i) {\n      let e = entries[i];\n\n      // a. If e is not empty and SameValue(e, value) is true, then\n      if (e !== undefined && SameValuePartial(realm, e, value) === true) {\n        // i. Replace the element of entries whose value is e with an element whose value is empty.\n        entries[i] = undefined;\n\n        // ii. Return true.\n        return realm.intrinsics.true;\n      }\n    }\n\n    // 7. Return false.\n    return realm.intrinsics.false;\n  });\n\n  // ECMA262 23.4.3.3\n  obj.defineNativeMethod(\"has\", 1, (context, [value]) => {\n    // 1. Let S be the this value.\n    let S = context.throwIfNotConcrete();\n\n    // 2. If Type(S) is not Object, throw a TypeError exception.\n    if (!(S instanceof ObjectValue)) {\n      throw realm.createErrorThrowCompletion(realm.intrinsics.TypeError, \"Type(S) is not Object\");\n    }\n\n    // 3. If S does not have a [[WeakSetData]] internal slot, throw a TypeError exception.\n    if (!S.$WeakSetData) {\n      throw realm.createErrorThrowCompletion(\n        realm.intrinsics.TypeError,\n        \"S does not have a [[WeakSetData]] internal slot\"\n      );\n    }\n\n    // 4. Let entries be the List that is S.[[WeakSetData]].\n    let entries = S.$WeakSetData;\n\n    // 5. If Type(value) is not Object, return false.\n    value = value.throwIfNotConcrete();\n    if (!(value instanceof ObjectValue)) return realm.intrinsics.false;\n\n    // 6. Repeat for each e that is an element of entries,\n    for (let e of entries) {\n      // a. If e is not empty and SameValue(e, value) is true, return true.\n      if (e !== undefined && SameValuePartial(realm, e, value) === true) return realm.intrinsics.true;\n    }\n\n    // 7. Return false.\n    return realm.intrinsics.false;\n  });\n\n  // ECMA262 23.4.3.5\n  obj.defineNativeProperty(realm.intrinsics.SymbolToStringTag, new StringValue(realm, \"WeakSet\"), { writable: false });\n}\n"
  },
  {
    "path": "src/intrinsics/ecma262/decodeURI.js",
    "content": "/**\n * Copyright (c) 2017-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n/* @flow strict-local */\n\nimport type { Realm } from \"../../realm.js\";\nimport { NativeFunctionValue } from \"../../values/index.js\";\nimport { StringValue } from \"../../values/index.js\";\nimport { To } from \"../../singletons.js\";\n\nexport default function(realm: Realm): NativeFunctionValue {\n  // ECMA262 18.2.6.2\n  let name = \"decodeURI\";\n  return new NativeFunctionValue(realm, name, name, 1, (context, [_encodedURI], argCount, NewTarget) => {\n    let encodedURI = _encodedURI;\n    if (NewTarget) throw realm.createErrorThrowCompletion(realm.intrinsics.TypeError, `${name} is not a constructor`);\n\n    encodedURI = encodedURI.throwIfNotConcrete();\n    // 1. Let uriString be ? ToString(encodedURI).\n    let uriString = To.ToString(realm, encodedURI);\n    // 2. Let reservedURISet be a String containing one instance of each code unit valid in uriReserved plus \"#\".\n    // 3. Return ? Decode(uriString, reservedURISet).\n    try {\n      return new StringValue(realm, decodeURI(uriString));\n    } catch (e) {\n      throw realm.createErrorThrowCompletion(realm.intrinsics.URIError, e.message);\n    }\n  });\n}\n"
  },
  {
    "path": "src/intrinsics/ecma262/decodeURIComponent.js",
    "content": "/**\n * Copyright (c) 2017-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n/* @flow strict-local */\n\nimport type { Realm } from \"../../realm.js\";\nimport { NativeFunctionValue } from \"../../values/index.js\";\nimport { To } from \"../../singletons.js\";\nimport { StringValue } from \"../../values/index.js\";\n\nexport default function(realm: Realm): NativeFunctionValue {\n  // ECMA262 18.2.6.3\n  let name = \"decodeURIComponent\";\n  return new NativeFunctionValue(realm, name, name, 1, (context, [_encodedURIComponent], argCount, NewTarget) => {\n    let encodedURIComponent = _encodedURIComponent;\n    if (NewTarget) throw realm.createErrorThrowCompletion(realm.intrinsics.TypeError, `${name} is not a constructor`);\n\n    encodedURIComponent = encodedURIComponent.throwIfNotConcrete();\n\n    // 1. Let componentString be ? ToString(uri).\n    let componentString = To.ToString(realm, encodedURIComponent);\n\n    // 2. Let reservedURIComponentSet be the empty String.\n    // 3. Return ? Encode(componentString, unescapedURIComponentSet).\n    try {\n      return new StringValue(realm, decodeURIComponent(componentString));\n    } catch (e) {\n      throw realm.createErrorThrowCompletion(realm.intrinsics.URIError, e.message);\n    }\n  });\n}\n"
  },
  {
    "path": "src/intrinsics/ecma262/encodeURI.js",
    "content": "/**\n * Copyright (c) 2017-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n/* @flow strict-local */\n\nimport type { Realm } from \"../../realm.js\";\nimport { NativeFunctionValue } from \"../../values/index.js\";\nimport { To } from \"../../singletons.js\";\nimport { StringValue } from \"../../values/index.js\";\n\nexport default function(realm: Realm): NativeFunctionValue {\n  // ECMA262 18.2.6.4\n  let name = \"encodeURI\";\n  return new NativeFunctionValue(realm, name, name, 1, (context, [_uri], argCount, NewTarget) => {\n    let uri = _uri;\n    if (NewTarget) throw realm.createErrorThrowCompletion(realm.intrinsics.TypeError, `${name} is not a constructor`);\n\n    uri = uri.throwIfNotConcrete();\n    // 1. Let uriString be ? ToString(uri).\n    let uriString = To.ToString(realm, uri);\n    // 2. Let unescapedURISet be a String containing one instance of each code unit valid in uriReserved and uriUnescaped plus \"#\".\n    // 3. Return ? Encode(uriString, unescapedURISet).\n    try {\n      return new StringValue(realm, encodeURI(uriString));\n    } catch (e) {\n      throw realm.createErrorThrowCompletion(realm.intrinsics.URIError, e.message);\n    }\n  });\n}\n"
  },
  {
    "path": "src/intrinsics/ecma262/encodeURIComponent.js",
    "content": "/**\n * Copyright (c) 2017-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n/* @flow strict-local */\n\nimport type { Realm } from \"../../realm.js\";\nimport { NativeFunctionValue } from \"../../values/index.js\";\nimport { To } from \"../../singletons.js\";\nimport { StringValue } from \"../../values/index.js\";\n\nexport default function(realm: Realm): NativeFunctionValue {\n  // ECMA262 18.2.6.5\n  let name = \"encodeURIComponent\";\n  return new NativeFunctionValue(realm, name, name, 1, (context, [_uriComponent], argCount, NewTarget) => {\n    let uriComponent = _uriComponent;\n    if (NewTarget) throw realm.createErrorThrowCompletion(realm.intrinsics.TypeError, `${name} is not a constructor`);\n\n    uriComponent = uriComponent.throwIfNotConcrete();\n\n    // 1. Let componentString be ? ToString(uri).\n    let componentString = To.ToString(realm, uriComponent);\n\n    // 2. Let unescapedURIComponentSet be a String containing one instance of each code unit valid in uriUnescaped.\n    // 3. Return ? Encode(componentString, unescapedURIComponentSet).\n    try {\n      return new StringValue(realm, encodeURIComponent(componentString));\n    } catch (e) {\n      throw realm.createErrorThrowCompletion(realm.intrinsics.URIError, e.message);\n    }\n  });\n}\n"
  },
  {
    "path": "src/intrinsics/ecma262/eval.js",
    "content": "/**\n * Copyright (c) 2017-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n/* @flow strict-local */\n\nimport type { Realm } from \"../../realm.js\";\nimport { NativeFunctionValue } from \"../../values/index.js\";\nimport { Functions } from \"../../singletons.js\";\n\nexport default function(realm: Realm): NativeFunctionValue {\n  // ECMA262 18.2.1\n  return new NativeFunctionValue(\n    realm,\n    \"eval\",\n    \"eval\",\n    1,\n    (context, [x]) => {\n      // 1. Let evalRealm be the value of the active function object's [[Realm]] internal slot.\n      let rcontext = realm.getRunningContext();\n      let evalRealm = rcontext.function == null ? realm : rcontext.function.$Realm;\n\n      // 2. Let strictCaller be false.\n      let strictCaller = false;\n\n      // 3. Let directEval be false.\n      let directEval = false;\n\n      // 4. Return ? PerformEval(x, evalRealm, strictCaller, directEval).\n      return Functions.PerformEval(realm, x, evalRealm, strictCaller, directEval);\n    },\n    false\n  );\n}\n"
  },
  {
    "path": "src/intrinsics/ecma262/global.js",
    "content": "/**\n * Copyright (c) 2017-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n/* @flow strict-local */\n\nimport type { Realm } from \"../../realm.js\";\nimport invariant from \"../../invariant.js\";\nimport { PropertyDescriptor } from \"../../descriptors.js\";\n\nexport default function(realm: Realm): void {\n  let global = realm.$GlobalObject;\n\n  global.$DefineOwnProperty(\n    \"global\",\n    new PropertyDescriptor({\n      value: global,\n      writable: true,\n      enumerable: false,\n      configurable: true,\n    })\n  );\n\n  for (let name of [\"undefined\", \"NaN\", \"Infinity\"]) {\n    global.$DefineOwnProperty(\n      name,\n      new PropertyDescriptor({\n        value: realm.intrinsics[name],\n        writable: false,\n        enumerable: false,\n        configurable: false,\n      })\n    );\n  }\n  let typeNames = [\n    \"String\",\n    \"Object\",\n    \"Function\",\n    \"Array\",\n    \"Number\",\n    \"RegExp\",\n    \"Date\",\n    \"Math\",\n    \"Error\",\n    \"Function\",\n    \"TypeError\",\n    \"RangeError\",\n    \"ReferenceError\",\n    \"SyntaxError\",\n    \"URIError\",\n    \"EvalError\",\n    \"Boolean\",\n    \"DataView\",\n    \"Float32Array\",\n    \"Float64Array\",\n    \"Int8Array\",\n    \"Int16Array\",\n    \"Int32Array\",\n    \"Map\",\n    \"Set\",\n    \"WeakMap\",\n    \"Uint8Array\",\n    \"Uint8ClampedArray\",\n    \"Uint16Array\",\n    \"Uint32Array\",\n    \"ArrayBuffer\",\n    \"JSON\",\n  ];\n  if (!realm.isCompatibleWith(realm.MOBILE_JSC_VERSION) && !realm.isCompatibleWith(\"mobile\"))\n    typeNames = typeNames.concat(\"Symbol\", \"Promise\", \"WeakSet\", \"Proxy\", \"Reflect\");\n  for (let name of typeNames) {\n    // need to check if the property exists (it may not due to --compatibility)\n    if (realm.intrinsics[name]) {\n      global.$DefineOwnProperty(\n        name,\n        new PropertyDescriptor({\n          value: realm.intrinsics[name],\n          writable: true,\n          enumerable: false,\n          configurable: true,\n        })\n      );\n    } else {\n      invariant(\n        name === \"Symbol\" || name === \"Promise\" || name === \"WeakSet\" || name === \"Proxy\" || name === \"Reflect\"\n      );\n      invariant(realm.isCompatibleWith(realm.MOBILE_JSC_VERSION) || realm.isCompatibleWith(\"mobile\"));\n    }\n  }\n  for (let name of [\n    \"parseFloat\",\n    \"parseInt\",\n    \"console\",\n    \"isNaN\",\n    \"eval\",\n    \"isFinite\",\n    \"encodeURI\",\n    \"decodeURI\",\n    \"encodeURIComponent\",\n    \"decodeURIComponent\",\n  ]) {\n    global.$DefineOwnProperty(\n      name,\n      new PropertyDescriptor({\n        value: realm.intrinsics[name],\n        writable: true,\n        enumerable: false,\n        configurable: true,\n      })\n    );\n  }\n}\n"
  },
  {
    "path": "src/intrinsics/ecma262/isFinite.js",
    "content": "/**\n * Copyright (c) 2017-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n/* @flow strict-local */\n\nimport type { Realm } from \"../../realm.js\";\nimport { NativeFunctionValue } from \"../../values/index.js\";\nimport { To } from \"../../singletons.js\";\n\nexport default function(realm: Realm): NativeFunctionValue {\n  // ECMA262 18.2.2\n  return new NativeFunctionValue(\n    realm,\n    \"isFinite\",\n    \"isFinite\",\n    1,\n    (context, [number]) => {\n      // 1. Let num be ? ToNumber(number).\n      let num = To.ToNumber(realm, number);\n\n      // 2. If num is NaN, +∞, or -∞, return false.\n      if (isNaN(num) || num === +Infinity || num === -Infinity) return realm.intrinsics.false;\n\n      // 3. Otherwise, return true.\n      return realm.intrinsics.true;\n    },\n    false\n  );\n}\n"
  },
  {
    "path": "src/intrinsics/ecma262/isNaN.js",
    "content": "/**\n * Copyright (c) 2017-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n/* @flow strict-local */\n\nimport type { Realm } from \"../../realm.js\";\nimport { NativeFunctionValue } from \"../../values/index.js\";\nimport { To } from \"../../singletons.js\";\n\nexport default function(realm: Realm): NativeFunctionValue {\n  // ECMA262 18.2.3\n  return new NativeFunctionValue(\n    realm,\n    \"isNaN\",\n    \"isNaN\",\n    1,\n    (context, [number]) => {\n      // 1. Let num be ? ToNumber(number).\n      let num = To.ToNumber(realm, number);\n\n      // 2. If num is NaN, return true.\n      if (isNaN(num)) return realm.intrinsics.true;\n\n      // 3. Otherwise, return false.\n      return realm.intrinsics.false;\n    },\n    false\n  );\n}\n"
  },
  {
    "path": "src/intrinsics/ecma262/parseFloat.js",
    "content": "/**\n * Copyright (c) 2017-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n/* @flow strict-local */\n\nimport type { Realm } from \"../../realm.js\";\nimport { NativeFunctionValue } from \"../../values/index.js\";\nimport { NumberValue } from \"../../values/index.js\";\nimport { To } from \"../../singletons.js\";\n\nexport default function(realm: Realm): NativeFunctionValue {\n  // ECMA262 18.2.4\n  return new NativeFunctionValue(\n    realm,\n    \"parseFloat\",\n    \"parseFloat\",\n    1,\n    (context, [string]) => {\n      if (!string) return realm.intrinsics.NaN;\n\n      // 1. Let inputString be ? ToString(string).\n      let inputString = To.ToStringPartial(realm, string);\n\n      return new NumberValue(realm, parseFloat(inputString));\n    },\n    false\n  );\n}\n"
  },
  {
    "path": "src/intrinsics/ecma262/parseInt.js",
    "content": "/**\n * Copyright (c) 2017-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n/* @flow strict-local */\n\nimport type { Realm } from \"../../realm.js\";\nimport { NativeFunctionValue } from \"../../values/index.js\";\nimport { NumberValue } from \"../../values/index.js\";\nimport { To } from \"../../singletons.js\";\n\nfunction ToDigit(ch: string): number | void {\n  if (ch >= \"0\" && ch <= \"9\") {\n    return ch.charCodeAt(0) - \"0\".charCodeAt(0);\n  } else if (ch >= \"A\" && ch <= \"Z\") {\n    return 10 + ch.charCodeAt(0) - \"A\".charCodeAt(0);\n  } else if (ch >= \"a\" && ch <= \"z\") {\n    return 10 + ch.charCodeAt(0) - \"a\".charCodeAt(0);\n  }\n  return undefined;\n}\n\nexport default function(realm: Realm): NativeFunctionValue {\n  return new NativeFunctionValue(\n    realm,\n    \"parseInt\",\n    \"parseInt\",\n    2,\n    (context, [string, radix]) => {\n      // 1. Let inputString be ? ToString(string).\n      let inputString = To.ToStringPartial(realm, string);\n\n      // 2. Let S be a newly created substring of inputString consisting of the first code unit that is not a StrWhiteSpaceChar and all code units following that code unit. (In other words, remove leading white space.) If inputString does not contain any such code unit, let S be the empty string.\n      let S = inputString.trim();\n\n      // 3. Let sign be 1.\n      let sign = 1;\n\n      // 4. If S is not empty and the first code unit of S is 0x002D (HYPHEN-MINUS), let sign be -1.\n      if (S !== \"\" && S.charAt(0) === \"-\") sign = -1;\n\n      // 5. If S is not empty and the first code unit of S is 0x002B (PLUS SIGN) or 0x002D (HYPHEN-MINUS), remove the first code unit from S.\n      if (S !== \"\" && (S.charAt(0) === \"-\" || S.charAt(0) === \"+\")) S = S.substr(1);\n\n      // 6. Let R be ? ToInt32(radix).\n      let R = To.ToInt32(realm, radix);\n\n      // 7. Let stripPrefix be true.\n      let stripPrefix = true;\n\n      // 8. If R ≠ 0, then\n      if (R !== 0) {\n        // a. If R < 2 or R > 36, return NaN.\n        if (R < 2 || R > 36) return realm.intrinsics.NaN;\n\n        // b .If R ≠ 16, let stripPrefix be false.\n        if (R !== 16) stripPrefix = false;\n      } else {\n        // 9. Else R = 0,\n        // a. Let R be 10.\n        R = 10;\n      }\n\n      // 10. If stripPrefix is true, then\n      if (stripPrefix === true) {\n        // a. If the length of S is at least 2 and the first two code units of S are either \"0x\" or \"0X\", remove the first two code units from S and let R be 16.\n        if (S.length >= 2 && S.charAt(0) === \"0\" && (S.charAt(1) === \"x\" || S.charAt(1) === \"X\")) {\n          S = S.substr(2);\n          R = 16;\n        }\n      }\n\n      // 11. If S contains a code unit that is not a radix-R digit, let Z be the substring of S consisting of all code units before the first such code unit; otherwise, let Z be S.\n      let Z = \"\";\n      for (let i = 0; i < S.length; ++i) {\n        let digit = ToDigit(S.charAt(i));\n        if (digit === undefined || digit >= R) {\n          break;\n        }\n        Z = Z + S.charAt(i);\n      }\n\n      // 12. If Z is empty, return NaN.\n      if (Z === \"\") return realm.intrinsics.NaN;\n\n      // 13. Let mathInt be the mathematical integer value that is represented by Z in radix-R notation, using the letters A-Z and a-z for digits with values 10 through 35. (However, if R is 10 and Z contains more than 20 significant digits, every significant digit after the 20th may be replaced by a 0 digit, at the option of the implementation; and if R is not 2, 4, 8, 10, 16, or 32, then mathInt may be an implementation-dependent approximation to the mathematical integer value that is represented by Z in radix-R notation.)\n      let mathInt = 0;\n      for (let i = 0; i < Z.length; ++i) {\n        mathInt = mathInt * R + (ToDigit(Z.charAt(i)) || 0);\n      }\n\n      // 14. If mathInt = 0, then\n      if (mathInt === 0) {\n        // a. If sign = -1, return -0.\n        if (sign === -1) return realm.intrinsics.negativeZero;\n        // b. Return +0.\n        return realm.intrinsics.zero;\n      }\n\n      // 15. Let number be the Number value for mathInt.\n      let number = Number(mathInt);\n\n      // 5. Return sign × number.\n      return new NumberValue(realm, sign * number);\n    },\n    false\n  );\n}\n"
  },
  {
    "path": "src/intrinsics/fb-www/fb-mocks.js",
    "content": "/**\n * Copyright (c) 2017-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n/* @flow */\n\nimport type { Realm } from \"../../realm.js\";\nimport { ValuesDomain } from \"../../domains/index.js\";\nimport {\n  ArrayValue,\n  AbstractValue,\n  FunctionValue,\n  AbstractObjectValue,\n  NativeFunctionValue,\n  ObjectValue,\n  StringValue,\n  NumberValue,\n} from \"../../values/index.js\";\nimport { Create } from \"../../singletons.js\";\nimport { Get } from \"../../methods/index.js\";\nimport invariant from \"../../invariant.js\";\nimport { Properties } from \"../../singletons.js\";\nimport { forEachArrayValue } from \"../../react/utils.js\";\nimport { createOperationDescriptor } from \"../../utils/generator.js\";\nimport { PropertyDescriptor } from \"../../descriptors.js\";\n\nconst fbMagicGlobalFunctions = [\n  \"asset\",\n  \"cx\",\n  \"cssVar\",\n  \"csx\",\n  \"errorDesc\",\n  \"errorHelpCenterID\",\n  \"errorSummary\",\n  \"gkx\",\n  \"glyph\",\n  \"ifRequired\",\n  \"ix\",\n  \"fbglyph\",\n  \"requireWeak\",\n  \"xuiglyph\",\n];\n\nconst fbMagicGlobalObjects = [\"JSResource\", \"fbt\"];\n\nfunction createBabelHelpers(realm: Realm, global: ObjectValue | AbstractObjectValue) {\n  let babelHelpersValue = new ObjectValue(realm, realm.intrinsics.ObjectPrototype, `babelHelpers`, true);\n  let objectAssign = Get(realm, realm.intrinsics.Object, \"assign\");\n  let objectCreate = Get(realm, realm.intrinsics.Object, \"create\");\n\n  //babelHelpers.objectWithoutProperties\n  let inheritsValue = new NativeFunctionValue(realm, undefined, `inherits`, 2, (context, [subClass, superClass]) => {\n    invariant(objectAssign instanceof NativeFunctionValue);\n    let objectAssignCall = objectAssign.$Call;\n    invariant(objectAssignCall !== undefined);\n    objectAssignCall(realm.intrinsics.undefined, [subClass, superClass]);\n\n    invariant(superClass instanceof ObjectValue);\n    let superClassPrototype = Get(realm, superClass, \"prototype\");\n    invariant(objectCreate instanceof NativeFunctionValue);\n    let objectCreateCall = objectCreate.$Call;\n    invariant(typeof objectCreateCall === \"function\");\n    let newPrototype = objectCreateCall(realm.intrinsics.undefined, [superClassPrototype]);\n\n    invariant(subClass instanceof ObjectValue);\n    invariant(newPrototype instanceof ObjectValue);\n    Properties.Set(realm, subClass, \"prototype\", newPrototype, true);\n    Properties.Set(realm, newPrototype, \"constructor\", subClass, true);\n    Properties.Set(realm, subClass, \"__superConstructor__\", superClass, true);\n\n    return superClass;\n  });\n  babelHelpersValue.defineNativeProperty(\"inherits\", inheritsValue, {\n    writable: false,\n    enumerable: false,\n    configurable: true,\n  });\n  inheritsValue.intrinsicName = `babelHelpers.inherits`;\n\n  const createObjectWithoutProperties = (obj: ObjectValue, keys: ArrayValue) => {\n    let removeKeys = new Set();\n    forEachArrayValue(realm, keys, key => {\n      if (key instanceof StringValue || key instanceof NumberValue) {\n        removeKeys.add(key.value);\n      }\n    });\n    let newObject = Create.ObjectCreate(realm, realm.intrinsics.ObjectPrototype);\n    for (let [propName, binding] of obj.properties) {\n      if (!removeKeys.has(propName)) {\n        if (binding && binding.descriptor && binding.descriptor.throwIfNotConcrete(realm).enumerable) {\n          let value = Get(realm, obj, propName);\n          Properties.Set(realm, newObject, propName, value, true);\n        }\n      }\n    }\n    return newObject;\n  };\n\n  //babelHelpers.objectWithoutProperties\n  let objectWithoutPropertiesValue = new NativeFunctionValue(\n    realm,\n    undefined,\n    `objectWithoutProperties`,\n    2,\n    (context, [obj, keys]) => {\n      invariant(obj instanceof ObjectValue || obj instanceof AbstractObjectValue || obj instanceof AbstractValue);\n      invariant(keys instanceof ArrayValue);\n      if (obj.mightBeObject() && ((obj instanceof AbstractValue && obj.values.isTop()) || obj.isPartialObject())) {\n        let temporalArgs = [objectWithoutPropertiesValue, obj, keys];\n        let temporalConfig = { skipInvariant: true, isPure: true };\n        let value = AbstractValue.createTemporalFromBuildFunction(\n          realm,\n          ObjectValue,\n          temporalArgs,\n          createOperationDescriptor(\"BABEL_HELPERS_OBJECT_WITHOUT_PROPERTIES\"),\n          temporalConfig\n        );\n        invariant(value instanceof AbstractObjectValue);\n        if (obj instanceof ObjectValue) {\n          let template = createObjectWithoutProperties(obj, keys);\n          value.values = new ValuesDomain(template);\n        }\n        // as we are returning an abstract object, we mark it as simple\n        value.makeSimple();\n        return value;\n      } else {\n        invariant(obj instanceof ObjectValue);\n        return createObjectWithoutProperties(obj, keys);\n      }\n    }\n  );\n  babelHelpersValue.defineNativeProperty(\"objectWithoutProperties\", objectWithoutPropertiesValue, {\n    writable: false,\n    enumerable: false,\n    configurable: true,\n  });\n  objectWithoutPropertiesValue.intrinsicName = `babelHelpers.objectWithoutProperties`;\n\n  //babelHelpers.taggedTemplateLiteralLoose\n  let taggedTemplateLiteralLooseValue = new NativeFunctionValue(\n    realm,\n    undefined,\n    `taggedTemplateLiteralLoose`,\n    2,\n    (context, [strings, raw]) => {\n      invariant(strings instanceof ObjectValue);\n      Properties.Set(realm, strings, \"raw\", raw, true);\n      return strings;\n    }\n  );\n  babelHelpersValue.defineNativeProperty(\"taggedTemplateLiteralLoose\", taggedTemplateLiteralLooseValue, {\n    writable: false,\n    enumerable: false,\n    configurable: true,\n  });\n  taggedTemplateLiteralLooseValue.intrinsicName = `babelHelpers.taggedTemplateLiteralLoose`;\n\n  //babelHelpers.extends & babelHelpers._extends\n  babelHelpersValue.defineNativeProperty(\"extends\", objectAssign, {\n    writable: true,\n    enumerable: true,\n    configurable: true,\n  });\n\n  babelHelpersValue.defineNativeProperty(\"_extends\", objectAssign, {\n    writable: true,\n    enumerable: true,\n    configurable: true,\n  });\n\n  //babelHelpers.bind\n  let functionBind = Get(realm, realm.intrinsics.FunctionPrototype, \"bind\");\n\n  babelHelpersValue.defineNativeProperty(\"bind\", functionBind, {\n    writable: true,\n    enumerable: true,\n    configurable: true,\n  });\n\n  global.$DefineOwnProperty(\n    \"babelHelpers\",\n    new PropertyDescriptor({\n      value: babelHelpersValue,\n      writable: true,\n      enumerable: true,\n      configurable: true,\n    })\n  );\n  babelHelpersValue.refuseSerialization = false;\n}\n\nfunction createMagicGlobalFunction(realm: Realm, global: ObjectValue | AbstractObjectValue, functionName: string) {\n  global.$DefineOwnProperty(\n    functionName,\n    new PropertyDescriptor({\n      value: new NativeFunctionValue(realm, functionName, functionName, 0, (context, args) => {\n        let val = AbstractValue.createTemporalFromBuildFunction(\n          realm,\n          FunctionValue,\n          [new StringValue(realm, functionName), ...args],\n          createOperationDescriptor(\"FB_MOCKS_MAGIC_GLOBAL_FUNCTION\"),\n          { skipInvariant: true, isPure: true }\n        );\n        invariant(val instanceof AbstractValue);\n        return val;\n      }),\n      writable: true,\n      enumerable: false,\n      configurable: true,\n    })\n  );\n}\n\nfunction createMagicGlobalObject(realm: Realm, global: ObjectValue | AbstractObjectValue, objectName: string) {\n  let globalObject = AbstractValue.createAbstractObject(realm, objectName);\n  globalObject.kind = \"resolved\";\n\n  global.$DefineOwnProperty(\n    objectName,\n    new PropertyDescriptor({\n      value: globalObject,\n      writable: true,\n      enumerable: false,\n      configurable: true,\n    })\n  );\n}\n\nfunction createBootloader(realm: Realm, global: ObjectValue | AbstractObjectValue) {\n  let bootloader = new ObjectValue(realm, realm.intrinsics.ObjectPrototype);\n\n  let loadModules = new NativeFunctionValue(realm, \"loadModules\", \"loadModules\", 1, (context, args) => {\n    invariant(context.$Realm.generator);\n    let val = AbstractValue.createTemporalFromBuildFunction(\n      realm,\n      FunctionValue,\n      args,\n      createOperationDescriptor(\"FB_MOCKS_BOOTLOADER_LOAD_MODULES\"),\n      { skipInvariant: true }\n    );\n    invariant(val instanceof AbstractValue);\n    return val;\n  });\n\n  Properties.Set(realm, bootloader, \"loadModules\", loadModules, false);\n\n  global.$DefineOwnProperty(\n    \"Bootloader\",\n    new PropertyDescriptor({\n      value: bootloader,\n      writable: true,\n      enumerable: false,\n      configurable: true,\n    })\n  );\n\n  return AbstractValue.createAbstractObject(realm, \"Bootloader\", bootloader);\n}\n\nexport function createFbMocks(realm: Realm, global: ObjectValue | AbstractObjectValue): void {\n  global.$DefineOwnProperty(\n    \"__DEV__\",\n    new PropertyDescriptor({\n      // TODO: we'll likely want to make this configurable from the outside.\n      value: realm.intrinsics.false,\n      writable: true,\n      enumerable: false,\n      configurable: true,\n    })\n  );\n\n  createBabelHelpers(realm, global);\n\n  for (let functionName of fbMagicGlobalFunctions) {\n    createMagicGlobalFunction(realm, global, functionName);\n  }\n\n  for (let objectName of fbMagicGlobalObjects) {\n    createMagicGlobalObject(realm, global, objectName);\n  }\n  createBootloader(realm, global);\n}\n"
  },
  {
    "path": "src/intrinsics/fb-www/global.js",
    "content": "/**\n * Copyright (c) 2017-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n/* @flow strict-local */\n\nimport type { Realm } from \"../../realm.js\";\nimport { AbstractValue, ArrayValue, NativeFunctionValue, StringValue, ObjectValue } from \"../../values/index.js\";\nimport { createMockReact } from \"./react-mocks.js\";\nimport { createMockReactDOM, createMockReactDOMServer } from \"./react-dom-mocks.js\";\nimport { createMockReactNative } from \"./react-native-mocks.js\";\nimport { createMockReactRelay } from \"./relay-mocks.js\";\nimport { createAbstract } from \"../prepack/utils.js\";\nimport { createFbMocks } from \"./fb-mocks.js\";\nimport { FatalError } from \"../../errors\";\nimport { Get } from \"../../methods/index.js\";\nimport invariant from \"../../invariant\";\nimport { createDefaultPropsHelper } from \"../../react/utils.js\";\nimport { PropertyDescriptor } from \"../../descriptors.js\";\n\nexport default function(realm: Realm): void {\n  let global = realm.$GlobalObject;\n\n  if (realm.react.enabled) {\n    // Create it eagerly so it's created outside effect branches\n    realm.react.defaultPropsHelper = createDefaultPropsHelper(realm);\n    let emptyArray = new ArrayValue(realm);\n    emptyArray.makeFinal();\n    realm.react.emptyArray = emptyArray;\n    let emptyObject = new ObjectValue(realm, realm.intrinsics.ObjectPrototype);\n    emptyObject.makeFinal();\n    realm.react.emptyObject = emptyObject;\n  }\n\n  // module.exports support\n  let moduleValue = AbstractValue.createAbstractObject(realm, \"module\");\n  moduleValue.kind = \"resolved\";\n  let moduleExportsValue = AbstractValue.createAbstractObject(realm, \"module.exports\");\n  moduleExportsValue.kind = \"resolved\";\n\n  moduleValue.$DefineOwnProperty(\n    \"exports\",\n    new PropertyDescriptor({\n      value: moduleExportsValue,\n      writable: true,\n      enumerable: false,\n      configurable: true,\n    })\n  );\n  global.$DefineOwnProperty(\n    \"module\",\n    new PropertyDescriptor({\n      value: moduleValue,\n      writable: true,\n      enumerable: false,\n      configurable: true,\n    })\n  );\n\n  // apply require() mock\n  global.$DefineOwnProperty(\n    \"require\",\n    new PropertyDescriptor({\n      value: new NativeFunctionValue(realm, \"require\", \"require\", 0, (context, [requireNameVal]) => {\n        invariant(requireNameVal instanceof StringValue);\n        let requireNameValValue = requireNameVal.value;\n\n        if (requireNameValValue === \"react\" || requireNameValValue === \"React\") {\n          if (realm.fbLibraries.react === undefined) {\n            let react = createMockReact(realm, requireNameValValue);\n            realm.fbLibraries.react = react;\n            return react;\n          }\n          return realm.fbLibraries.react;\n        } else if (requireNameValValue === \"react-dom\" || requireNameValValue === \"ReactDOM\") {\n          if (realm.fbLibraries.reactDom === undefined) {\n            let reactDom = createMockReactDOM(realm, requireNameValValue);\n            realm.fbLibraries.reactDom = reactDom;\n            return reactDom;\n          }\n          return realm.fbLibraries.reactDom;\n        } else if (requireNameValValue === \"react-dom/server\" || requireNameValValue === \"ReactDOMServer\") {\n          if (realm.fbLibraries.reactDomServer === undefined) {\n            let reactDomServer = createMockReactDOMServer(realm, requireNameValValue);\n            realm.fbLibraries.reactDomServer = reactDomServer;\n            return reactDomServer;\n          }\n          return realm.fbLibraries.reactDomServer;\n        } else if (requireNameValValue === \"react-native\" || requireNameValValue === \"ReactNative\") {\n          if (realm.fbLibraries.reactNative === undefined) {\n            let reactNative = createMockReactNative(realm, requireNameValValue);\n            realm.fbLibraries.reactNative = reactNative;\n            return reactNative;\n          }\n          return realm.fbLibraries.reactNative;\n        } else if (requireNameValValue === \"react-relay\" || requireNameValValue === \"RelayModern\") {\n          if (realm.fbLibraries.reactRelay === undefined) {\n            let reactRelay = createMockReactRelay(realm, requireNameValValue);\n            realm.fbLibraries.reactRelay = reactRelay;\n            return reactRelay;\n          }\n          return realm.fbLibraries.reactRelay;\n        } else if (requireNameValValue === \"prop-types\" || requireNameValValue === \"PropTypes\") {\n          if (realm.fbLibraries.react === undefined) {\n            throw new FatalError(\"unable to require PropTypes due to React not being referenced in scope\");\n          }\n          let propTypes = Get(realm, realm.fbLibraries.react, \"PropTypes\");\n          invariant(propTypes instanceof ObjectValue);\n          return propTypes;\n        } else {\n          let requireVal;\n\n          if (realm.fbLibraries.other.has(requireNameValValue)) {\n            requireVal = realm.fbLibraries.other.get(requireNameValValue);\n          } else {\n            requireVal = createAbstract(realm, \"function\", `require(\"${requireNameValValue}\")`);\n            realm.fbLibraries.other.set(requireNameValValue, requireVal);\n          }\n          invariant(requireVal instanceof AbstractValue);\n          return requireVal;\n        }\n      }),\n      writable: true,\n      enumerable: false,\n      configurable: true,\n    })\n  );\n\n  if (realm.isCompatibleWith(\"fb-www\")) {\n    createFbMocks(realm, global);\n  }\n}\n"
  },
  {
    "path": "src/intrinsics/fb-www/react-dom-mocks.js",
    "content": "/**\n * Copyright (c) 2017-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n/* @flow */\n\nimport type { Realm } from \"../../realm.js\";\nimport { ObjectValue, AbstractObjectValue, AbstractValue, FunctionValue } from \"../../values/index.js\";\nimport { createReactHintObject, isReactElement } from \"../../react/utils.js\";\nimport invariant from \"../../invariant.js\";\nimport { updateIntrinsicNames, addMockFunctionToObject } from \"./utils.js\";\nimport { renderToString } from \"../../react/experimental-server-rendering/rendering.js\";\nimport { createOperationDescriptor } from \"../../utils/generator.js\";\n\nexport function createMockReactDOM(realm: Realm, reactDomRequireName: string): ObjectValue {\n  let reactDomValue = new ObjectValue(realm, realm.intrinsics.ObjectPrototype);\n  reactDomValue.refuseSerialization = true;\n\n  updateIntrinsicNames(realm, reactDomValue, reactDomRequireName);\n\n  const genericTemporalFunc = (funcVal, args) => {\n    let reactDomMethod = AbstractValue.createTemporalFromBuildFunction(\n      realm,\n      FunctionValue,\n      [funcVal, ...args],\n      createOperationDescriptor(\"REACT_TEMPORAL_FUNC\"),\n      { skipInvariant: true, isPure: true }\n    );\n    invariant(reactDomMethod instanceof AbstractObjectValue);\n    return reactDomMethod;\n  };\n\n  addMockFunctionToObject(realm, reactDomValue, reactDomRequireName, \"render\", genericTemporalFunc);\n  addMockFunctionToObject(realm, reactDomValue, reactDomRequireName, \"hydrate\", genericTemporalFunc);\n  addMockFunctionToObject(realm, reactDomValue, reactDomRequireName, \"findDOMNode\", genericTemporalFunc);\n  addMockFunctionToObject(realm, reactDomValue, reactDomRequireName, \"unmountComponentAtNode\", genericTemporalFunc);\n\n  const createPortalFunc = (funcVal, [reactPortalValue, domNodeValue]) => {\n    let reactDomMethod = AbstractValue.createTemporalFromBuildFunction(\n      realm,\n      ObjectValue,\n      [funcVal, reactPortalValue, domNodeValue],\n      createOperationDescriptor(\"REACT_TEMPORAL_FUNC\"),\n      { skipInvariant: true, isPure: true }\n    );\n    invariant(reactDomMethod instanceof AbstractObjectValue);\n    realm.react.abstractHints.set(\n      reactDomMethod,\n      createReactHintObject(reactDomValue, \"createPortal\", [reactPortalValue, domNodeValue], realm.intrinsics.undefined)\n    );\n    return reactDomMethod;\n  };\n\n  addMockFunctionToObject(realm, reactDomValue, reactDomRequireName, \"createPortal\", createPortalFunc);\n\n  reactDomValue.refuseSerialization = false;\n  reactDomValue.makeFinal();\n  return reactDomValue;\n}\n\nexport function createMockReactDOMServer(realm: Realm, requireName: string): ObjectValue {\n  let reactDomServerValue = new ObjectValue(realm, realm.intrinsics.ObjectPrototype);\n  reactDomServerValue.refuseSerialization = true;\n\n  updateIntrinsicNames(realm, reactDomServerValue, requireName);\n\n  const genericTemporalFunc = (funcVal, args) => {\n    let reactDomMethod = AbstractValue.createTemporalFromBuildFunction(\n      realm,\n      FunctionValue,\n      [funcVal, ...args],\n      createOperationDescriptor(\"REACT_TEMPORAL_FUNC\"),\n      { skipInvariant: true, isPure: true }\n    );\n    invariant(reactDomMethod instanceof AbstractObjectValue);\n    return reactDomMethod;\n  };\n\n  addMockFunctionToObject(realm, reactDomServerValue, requireName, \"renderToString\", (funcVal, [input]) => {\n    if (input instanceof ObjectValue && isReactElement(input)) {\n      return renderToString(realm, input, false);\n    }\n    return genericTemporalFunc(funcVal, [input]);\n  });\n  addMockFunctionToObject(realm, reactDomServerValue, requireName, \"renderToStaticMarkup\", (funcVal, [input]) => {\n    if (input instanceof ObjectValue && isReactElement(input)) {\n      return renderToString(realm, input, true);\n    }\n    return genericTemporalFunc(funcVal, [input]);\n  });\n  addMockFunctionToObject(realm, reactDomServerValue, requireName, \"renderToNodeStream\", genericTemporalFunc);\n  addMockFunctionToObject(realm, reactDomServerValue, requireName, \"renderToStaticNodeStream\", genericTemporalFunc);\n\n  reactDomServerValue.refuseSerialization = false;\n  reactDomServerValue.makeFinal();\n  return reactDomServerValue;\n}\n"
  },
  {
    "path": "src/intrinsics/fb-www/react-mocks.js",
    "content": "/**\n * Copyright (c) 2017-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n/* @flow */\n\nimport type { Realm } from \"../../realm.js\";\nimport { parseExpression } from \"@babel/parser\";\nimport { ValuesDomain } from \"../../domains/index.js\";\nimport {\n  AbstractObjectValue,\n  AbstractValue,\n  ECMAScriptSourceFunctionValue,\n  FunctionValue,\n  NativeFunctionValue,\n  NullValue,\n  NumberValue,\n  ObjectValue,\n  Value,\n} from \"../../values/index.js\";\nimport { Environment } from \"../../singletons.js\";\nimport { createInternalReactElement, getReactSymbol } from \"../../react/utils.js\";\nimport { cloneReactElement, createReactElement } from \"../../react/elements.js\";\nimport { Properties, Create, To } from \"../../singletons.js\";\nimport invariant from \"../../invariant.js\";\nimport { updateIntrinsicNames, addMockFunctionToObject } from \"./utils.js\";\nimport { createOperationDescriptor } from \"../../utils/generator.js\";\n\n// most of the code here was taken from https://github.com/facebook/react/blob/master/packages/react/src/ReactElement.js\nlet reactCode = `\n  function createReact(\n    REACT_ELEMENT_TYPE,\n    REACT_FRAGMENT_TYPE,\n    REACT_PORTAL_TYPE,\n    REACT_FORWARD_REF_TYPE,\n    ReactElement,\n    ReactCurrentOwner\n  ) {\n    function makeEmptyFunction(arg) {\n      return function() {\n        return arg;\n      };\n    }\n    var emptyFunction = function() {};\n\n    emptyFunction.thatReturns = makeEmptyFunction;\n    emptyFunction.thatReturnsFalse = makeEmptyFunction(false);\n    emptyFunction.thatReturnsTrue = makeEmptyFunction(true);\n    emptyFunction.thatReturnsNull = makeEmptyFunction(null);\n    emptyFunction.thatReturnsThis = function() { return this; };\n    emptyFunction.thatReturnsArgument = function(arg) { return arg; };\n\n    var hasOwnProperty = Object.prototype.hasOwnProperty;\n    var RESERVED_PROPS = {\n      key: true,\n      ref: true,\n      __self: true,\n      __source: true,\n    };\n\n    function hasValidRef(config) {\n      return config.ref !== undefined;\n    }\n\n    function hasValidKey(config) {\n      return config.key !== undefined;\n    }\n\n    function Component(props, context) {\n      this.props = props;\n      this.context = context;\n      this.refs = {};\n      this.setState = function () {}; // NO-OP\n      this.setState.__PREPACK_MOCK__ = true;\n    }\n\n    Component.prototype.isReactComponent = {};\n\n    function PureComponent(props, context) {\n      this.props = props;\n      this.context = context;\n      this.refs = {};\n      this.setState = function () {}; // NO-OP\n      this.setState.__PREPACK_MOCK__ = true;\n    }\n\n    PureComponent.prototype.isReactComponent = {};\n    PureComponent.prototype.isPureReactComponent = true;\n\n    function forwardRef(render) {\n      // NOTE: In development there are a bunch of warnings which will be logged to validate the \\`render\\` function.\n      // Since Prepack is a production only tool (for now) we don’t include these warnings.\n      //\n      // https://github.com/facebook/react/blob/f9358c51c8de93abe3cdd0f4720b489befad8c48/packages/react/src/forwardRef.js\n      return {\n        $$typeof: REACT_FORWARD_REF_TYPE,\n        render,\n      };\n    }\n\n    var userProvidedKeyEscapeRegex = /\\/+/g;\n\n    function escapeUserProvidedKey(text) {\n      return ('' + text).replace(userProvidedKeyEscapeRegex, '$&/');\n    }\n\n    function escape(key) {\n      const escapeRegex = /[=:]/g;\n      const escaperLookup = {\n        '=': '=0',\n        ':': '=2',\n      };\n      const escapedString = ('' + key).replace(escapeRegex, function(match) {\n        return escaperLookup[match];\n      });\n\n      return '$' + escapedString;\n    }\n\n    var SEPARATOR = '.';\n    var SUBSEPARATOR = ':';\n    var POOL_SIZE = 10;\n    function getPooledTraverseContext(\n      mapResult,\n      keyPrefix,\n      mapFunction,\n      mapContext,\n    ) {\n      return {\n        result: mapResult,\n        keyPrefix: keyPrefix,\n        func: mapFunction,\n        context: mapContext,\n        count: 0,\n      };\n    }\n\n    function traverseAllChildren(children, callback, traverseContext) {\n      if (children == null) {\n        return 0;\n      }\n\n      return traverseAllChildrenImpl(children, '', callback, traverseContext);\n    }\n\n    function getComponentKey(component, index) {\n      // Do some typechecking here since we call this blindly. We want to ensure\n      // that we don't block potential future ES APIs.\n      if (\n        typeof component === 'object' &&\n        component !== null &&\n        component.key != null\n      ) {\n        // Explicit key\n        return escape(component.key);\n      }\n      // Implicit key determined by the index in the set\n      return index.toString(36);\n    }\n\n    function traverseAllChildrenImpl(\n      children,\n      nameSoFar,\n      callback,\n      traverseContext,\n    ) {\n      const type = typeof children;\n\n      if (type === 'undefined' || type === 'boolean') {\n        // All of the above are perceived as null.\n        children = null;\n      }\n\n      let invokeCallback = false;\n\n      if (children === null) {\n        invokeCallback = true;\n      } else {\n        switch (type) {\n          case 'string':\n          case 'number':\n            invokeCallback = true;\n            break;\n          case 'object':\n            switch (children.$$typeof) {\n              case REACT_ELEMENT_TYPE:\n              case REACT_PORTAL_TYPE:\n                invokeCallback = true;\n            }\n        }\n      }\n\n      if (invokeCallback) {\n        callback(\n          traverseContext,\n          children,\n          // If it's the only child, treat the name as if it was wrapped in an array\n          // so that it's consistent if the number of children grows.\n          nameSoFar === '' ? SEPARATOR + getComponentKey(children, 0) : nameSoFar,\n        );\n        return 1;\n      }\n\n      let child;\n      let nextName;\n      let subtreeCount = 0; // Count of children found in the current subtree.\n      const nextNamePrefix =\n        nameSoFar === '' ? SEPARATOR : nameSoFar + SUBSEPARATOR;\n\n      if (Array.isArray(children)) {\n        for (let i = 0; i < children.length; i++) {\n          child = children[i];\n          nextName = nextNamePrefix + getComponentKey(child, i);\n          subtreeCount += traverseAllChildrenImpl(\n            child,\n            nextName,\n            callback,\n            traverseContext,\n          );\n        }\n      } else {\n        const iteratorFn = getIteratorFn(children);\n        if (typeof iteratorFn === 'function') {\n          var iterator = iteratorFn.call(children);\n          let step;\n          let ii = 0;\n          while (!(step = iterator.next()).done) {\n            child = step.value;\n            nextName = nextNamePrefix + getComponentKey(child, ii++);\n            subtreeCount += traverseAllChildrenImpl(\n              child,\n              nextName,\n              callback,\n              traverseContext,\n            );\n          }\n        } else if (type === 'object') {\n          let addendum = '';\n          var childrenString = '' + children;\n        }\n      }\n\n      return subtreeCount;\n    }\n\n    function cloneAndReplaceKey(oldElement, newKey) {\n      var newElement = ReactElement(\n        oldElement.type,\n        newKey,\n        oldElement.ref,\n        oldElement.props,\n      );\n    \n      return newElement;\n    }\n\n    function mapSingleChildIntoContext(bookKeeping, child, childKey) {\n      var {result, keyPrefix, func, context} = bookKeeping;\n    \n      let mappedChild = func.call(context, child);\n      if (Array.isArray(mappedChild)) {\n        mapIntoWithKeyPrefixInternal(mappedChild, result, childKey, c => c);\n      } else if (mappedChild != null) {\n        if (isValidElement(mappedChild)) {\n          mappedChild = cloneAndReplaceKey(\n            mappedChild,\n            // Keep both the (mapped) and old keys if they differ, just as\n            // traverseAllChildren used to do for objects as children\n            keyPrefix +\n              (mappedChild.key && (!child || child.key !== mappedChild.key)\n                ? escapeUserProvidedKey(mappedChild.key) + '/'\n                : '') +\n              childKey,\n          );\n        }\n        result.push(mappedChild);\n      }\n    }\n\n    function mapIntoWithKeyPrefixInternal(children, array, prefix, func, context) {\n      var escapedPrefix = '';\n      if (prefix != null) {\n        escapedPrefix = escapeUserProvidedKey(prefix) + '/';\n      }\n      const traverseContext = getPooledTraverseContext(\n        array,\n        escapedPrefix,\n        func,\n        context,\n      );\n      traverseAllChildren(children, mapSingleChildIntoContext, traverseContext);\n    }\n\n    function forEachSingleChild(bookKeeping, child, name) {\n      var {func, context} = bookKeeping;\n      func.call(context, child);\n    }\n\n    function forEachChildren(children, forEachFunc, forEachContext) {\n      if (children == null) {\n        return children;\n      }\n      var traverseContext = getPooledTraverseContext(\n        null,\n        null,\n        forEachFunc,\n        forEachContext,\n      );\n      traverseAllChildren(children, forEachSingleChild, traverseContext);\n    }\n\n    function mapChildren(children, func, context) {\n      if (children == null) {\n        return children;\n      }\n      var result = [];\n      mapIntoWithKeyPrefixInternal(children, result, null, func, context);\n      return result;\n    }\n\n    function countChildren(children) {\n      return traverseAllChildren(children, emptyFunction.thatReturnsNull, null);\n    }\n\n    function onlyChild(children) {\n      return children;\n    }\n\n    function toArray(children) {\n      var result = [];\n      mapIntoWithKeyPrefixInternal(\n        children,\n        result,\n        null,\n        emptyFunction.thatReturnsArgument,\n      );\n      return result;\n    }\n\n    function isValidElement(object) {\n      return (\n        typeof object === 'object' &&\n        object !== null &&\n        object.$$typeof === REACT_ELEMENT_TYPE\n      );\n    }\n\n    function shim() {\n\n    }\n    shim.isRequired = shim;\n\n    function getShim() {\n      return shim;\n    };\n\n    var ReactPropTypes = {\n      array: shim,\n      bool: shim,\n      func: shim,\n      number: shim,\n      object: shim,\n      string: shim,\n      symbol: shim,\n\n      any: shim,\n      arrayOf: getShim,\n      element: shim,\n      instanceOf: getShim,\n      node: shim,\n      objectOf: getShim,\n      oneOf: getShim,\n      oneOfType: getShim,\n      shape: getShim,\n      exact: getShim\n    };\n\n    ReactPropTypes.checkPropTypes = shim;\n    ReactPropTypes.PropTypes = ReactPropTypes;\n\n    var ReactSharedInternals = {\n      ReactCurrentOwner,\n    };\n\n    return {\n      Children: {\n        forEach: forEachChildren,\n        map: mapChildren,\n        count: countChildren,\n        only: onlyChild,\n        toArray,\n      },\n      Component,\n      PureComponent,\n      forwardRef,\n      Fragment: REACT_FRAGMENT_TYPE,\n      isValidElement,\n      version: \"16.2.0\",\n      PropTypes: ReactPropTypes,\n      __SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED: ReactSharedInternals,\n    };\n  }\n`;\nlet reactAst = parseExpression(reactCode, { plugins: [\"flow\"] });\n\nexport function createMockReact(realm: Realm, reactRequireName: string): ObjectValue {\n  let reactFactory = Environment.GetValue(realm, realm.$GlobalEnv.evaluate(reactAst, false));\n  invariant(reactFactory instanceof ECMAScriptSourceFunctionValue);\n\n  let currentOwner = (realm.react.currentOwner = new ObjectValue(\n    realm,\n    realm.intrinsics.ObjectPrototype,\n    \"currentOwner\"\n  ));\n  // this is to get around Flow getting confused\n  let factory = reactFactory.$Call;\n  invariant(factory !== undefined);\n\n  let mockReactElementBuilder = new NativeFunctionValue(\n    realm,\n    undefined,\n    \"ReactElement\",\n    0,\n    (context, [type, key, ref, props]) => {\n      invariant(props instanceof ObjectValue);\n      return createInternalReactElement(realm, type, key, ref, props);\n    }\n  );\n\n  let reactValue = factory(realm.intrinsics.undefined, [\n    getReactSymbol(\"react.element\", realm),\n    getReactSymbol(\"react.fragment\", realm),\n    getReactSymbol(\"react.portal\", realm),\n    getReactSymbol(\"react.forward_ref\", realm),\n    mockReactElementBuilder,\n    currentOwner,\n  ]);\n  invariant(reactValue instanceof ObjectValue);\n  reactValue.refuseSerialization = true;\n\n  // update existing properties with the new intrinsic mock values\n  updateIntrinsicNames(realm, reactValue, reactRequireName, [\n    \"PropTypes\",\n    \"Children\",\n    \"isValidElement\",\n    { name: \"Component\", updatePrototype: true },\n    { name: \"PureComponent\", updatePrototype: true },\n  ]);\n\n  addMockFunctionToObject(\n    realm,\n    reactValue,\n    reactRequireName,\n    \"createElement\",\n    (context, [type, config, ...children]) => {\n      invariant(type instanceof Value);\n      // if config is undefined/null, use an empy object\n      if (config === realm.intrinsics.undefined || config === realm.intrinsics.null || config === undefined) {\n        config = new ObjectValue(realm, realm.intrinsics.ObjectPrototype);\n      }\n      if (config instanceof AbstractValue && !(config instanceof AbstractObjectValue)) {\n        config = To.ToObject(realm, config);\n      }\n      invariant(config instanceof ObjectValue || config instanceof AbstractObjectValue);\n\n      if (Array.isArray(children)) {\n        if (children.length === 0) {\n          children = undefined;\n        } else if (children.length === 1) {\n          children = children[0];\n        } else {\n          let array = Create.ArrayCreate(realm, 0);\n          let length = children.length;\n\n          for (let i = 0; i < length; i++) {\n            Create.CreateDataPropertyOrThrow(realm, array, \"\" + i, children[i]);\n          }\n          children = array;\n          children.makeFinal();\n        }\n      }\n      return createReactElement(realm, type, config, children);\n    }\n  );\n\n  addMockFunctionToObject(\n    realm,\n    reactValue,\n    reactRequireName,\n    \"cloneElement\",\n    (context, [element, config, ...children]) => {\n      invariant(element instanceof ObjectValue);\n      // if config is undefined/null, use an empy object\n      if (config === realm.intrinsics.undefined || config === realm.intrinsics.null || config === undefined) {\n        config = realm.intrinsics.null;\n      }\n      if (config instanceof AbstractValue && !(config instanceof AbstractObjectValue)) {\n        config = To.ToObject(realm, config);\n      }\n      invariant(config instanceof ObjectValue || config instanceof AbstractObjectValue || config instanceof NullValue);\n\n      if (Array.isArray(children)) {\n        if (children.length === 0) {\n          children = undefined;\n        } else if (children.length === 1) {\n          children = children[0];\n        } else {\n          let array = Create.ArrayCreate(realm, 0);\n          let length = children.length;\n\n          for (let i = 0; i < length; i++) {\n            Create.CreateDataPropertyOrThrow(realm, array, \"\" + i, children[i]);\n          }\n          children = array;\n          children.makeFinal();\n        }\n      }\n      return cloneReactElement(realm, element, config, children);\n    }\n  );\n\n  addMockFunctionToObject(\n    realm,\n    reactValue,\n    reactRequireName,\n    \"createContext\",\n    (funcValue, [defaultValue = realm.intrinsics.undefined]) => {\n      invariant(defaultValue instanceof Value);\n      let consumerObject = new ObjectValue(realm, realm.intrinsics.ObjectPrototype);\n      let providerObject = new ObjectValue(realm, realm.intrinsics.ObjectPrototype);\n      let consumer = AbstractValue.createTemporalFromBuildFunction(\n        realm,\n        ObjectValue,\n        [funcValue, defaultValue],\n        createOperationDescriptor(\"REACT_TEMPORAL_FUNC\"),\n        { skipInvariant: true, isPure: true }\n      );\n      invariant(consumer instanceof AbstractObjectValue);\n      consumer.values = new ValuesDomain(new Set([consumerObject]));\n\n      let provider = AbstractValue.createTemporalFromBuildFunction(\n        realm,\n        ObjectValue,\n        [consumer],\n        createOperationDescriptor(\"REACT_CREATE_CONTEXT_PROVIDER\"),\n        { skipInvariant: true, isPure: true }\n      );\n      invariant(provider instanceof AbstractObjectValue);\n      provider.values = new ValuesDomain(new Set([providerObject]));\n\n      Properties.Set(realm, consumerObject, \"$$typeof\", getReactSymbol(\"react.context\", realm), true);\n      Properties.Set(realm, consumerObject, \"currentValue\", defaultValue, true);\n      Properties.Set(realm, consumerObject, \"defaultValue\", defaultValue, true);\n      Properties.Set(realm, consumerObject, \"changedBits\", new NumberValue(realm, 0), true);\n      Properties.Set(realm, consumerObject, \"Consumer\", consumer, true);\n\n      Properties.Set(realm, providerObject, \"$$typeof\", getReactSymbol(\"react.provider\", realm), true);\n      Properties.Set(realm, providerObject, \"context\", consumer, true);\n\n      Properties.Set(realm, consumerObject, \"Provider\", provider, true);\n      return consumer;\n    }\n  );\n\n  addMockFunctionToObject(realm, reactValue, reactRequireName, \"createRef\", funcVal => {\n    let createRef = AbstractValue.createTemporalFromBuildFunction(\n      realm,\n      FunctionValue,\n      [funcVal],\n      createOperationDescriptor(\"REACT_TEMPORAL_FUNC\"),\n      { skipInvariant: true, isPure: true }\n    );\n    invariant(createRef instanceof AbstractObjectValue);\n    return createRef;\n  });\n\n  reactValue.refuseSerialization = false;\n  reactValue.makeFinal();\n  return reactValue;\n}\n"
  },
  {
    "path": "src/intrinsics/fb-www/react-native-mocks.js",
    "content": "/**\n * Copyright (c) 2017-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n/* @flow */\n\nimport type { Realm } from \"../../realm.js\";\nimport { AbstractValue, ECMAScriptSourceFunctionValue, ObjectValue, StringValue } from \"../../values/index.js\";\nimport { Environment } from \"../../singletons.js\";\nimport invariant from \"../../invariant.js\";\nimport { parseExpression } from \"@babel/parser\";\nimport { createOperationDescriptor } from \"../../utils/generator.js\";\n\nlet reactNativeCode = `\n  function createReactNative(React, reactNameRequireName) {\n    var Platform = __abstract(\"object\", 'require(\"' + reactNameRequireName + '\").Platform');\n\n    var NativeModules = __abstract({\n      nativePerformanceNow: __abstract(\"function\"),\n      nativeTraceBeginAsyncSection: __abstract(\"function\"),\n      nativeTraceEndAsyncSection: __abstract(\"function\"),\n      UIManager: __abstract({\n        customBubblingEventTypes: __abstract(),\n        customDirectEventTypes: __abstract(),\n        ViewManagerNames: __abstract(),\n        __takeSnapshot: undefined,\n        takeSnapshot: undefined,\n        RCTVirtualText: null,\n      }),\n      DeviceInfo: __abstract({\n        Dimensions: __abstract({\n          window: undefined,\n          screen: undefined,\n          windowPhysicalPixels: __abstract({\n            width: __abstract(\"number\"),\n            height: __abstract(\"number\"),\n            scale: __abstract(\"number\"),\n            fontScale: __abstract(\"number\"),\n          }),\n          screenPhysicalPixels: __abstract({\n            width: __abstract(\"number\"),\n            height: __abstract(\"number\"),\n            scale: __abstract(\"number\"),\n            fontScale: __abstract(\"number\"),\n          }),\n        }),\n      }),\n      I18n: __abstract({\n        localeCountryCode: __abstract(),\n        localeIdentifier: __abstract(),\n        fbLocaleIdentifier: __abstract(),\n        AdsCountriesConfig: __abstract({}),\n        exports: __abstract({}),\n      }),\n      I18nManager: __abstract({\n        isRTL: __abstract(\"boolean\"),\n        isRTLForced: __abstract(\"boolean\"),\n        doLeftAndRightSwapInRTL: __abstract(\"boolean\"),\n        allowRTL: function(allowRTL) {\n          return __residual(\"void\", function(allowRTL, global) {\n            global.nativeModuleProxy.I18nManager.allowRTL(allowRTL);\n          }, allowRTL, global);\n        },\n        forceRTL: function(forceRTL) {\n          return __residual(\"void\", function(forceRTL, global) {\n            global.nativeModuleProxy.I18nManager.forceRTL(forceRTL);\n          }, forceRTL, global);\n        },\n        swapLeftAndRightInRTL: function(flipStyles) {\n          return __residual(\"void\", function(flipStyles, global) {\n            global.nativeModuleProxy.I18nManager.swapLeftAndRightInRTL(flipStyles);\n          }, flipStyles, global);\n        },\n        exports: __abstract({}),\n      }),\n      DeviceEventManager: __abstract({}),\n      Timing: __abstract({\n        createTimer: function(id, duration, time, recurring) {\n          return __residual(\"object\", function(id, duration, time, recurring, global, Object) {\n            global.nativeModuleProxy.Timing.createTimer(id, duration, time, recurring);\n            return Object.create(null);\n          }, id, duration, time, recurring, global, Object);\n        }\n      }),\n      ExceptionsManager: __abstract({\n        reportFatalException: function(message, stack, id) {\n          console.log(\"nativeModuleProxy.ExceptionsManager.reportFatalException\");\n          console.log(message);\n          for (var i = 0; i < stack.length; i++) {\n            var s = stack[i];\n            console.log(\"  at \" + s.methodName + \" (\" + s.file + \":\" + s.lineNumber + \":\" + s.column + \")\");\n          }\n        }\n      }),\n      PlatformConstants: __abstract({\n        isTesting: false,\n        reactNativeVersion: __abstract({\n          major: 0,\n          minor: 0,\n          patch: 0,\n          prerelease: null,\n        }),\n        Version: __abstract(\"number\"),\n        forceTouchAvailable: undefined,\n        uiMode: __abstract(),\n      }),\n      RelayAPIConfig: __abstract({\n        graphBatchURI: __abstract(),\n      }),\n      SourceCode: __abstract({\n        scriptURL: __abstract(\"string\"),\n      }),\n    }, 'require(\"' + reactNameRequireName + '\").NativeModules');\n\n    const {UIManager} = NativeModules;\n\n    const ReactNativeViewAttributes = {};\n    const viewConfigCallbacks = new Map();\n\n    const TextAncestor = React.createContext(false);\n\n    const ReactNativeStyleAttributes = {};\n\n    const dummySize = {width: undefined, height: undefined};\n\n    const sizesDiffer = function(one, two) {\n      one = one || dummySize;\n      two = two || dummySize;\n      return one !== two && (one.width !== two.width || one.height !== two.height);\n    };\n\n    ReactNativeStyleAttributes.transform = {process: processTransform};\n    ReactNativeStyleAttributes.shadowOffset = {diff: sizesDiffer};\n\n    const colorAttributes = {process: processColor};\n    ReactNativeStyleAttributes.backgroundColor = colorAttributes;\n    ReactNativeStyleAttributes.borderBottomColor = colorAttributes;\n    ReactNativeStyleAttributes.borderColor = colorAttributes;\n    ReactNativeStyleAttributes.borderLeftColor = colorAttributes;\n    ReactNativeStyleAttributes.borderRightColor = colorAttributes;\n    ReactNativeStyleAttributes.borderTopColor = colorAttributes;\n    ReactNativeStyleAttributes.borderStartColor = colorAttributes;\n    ReactNativeStyleAttributes.borderEndColor = colorAttributes;\n    ReactNativeStyleAttributes.color = colorAttributes;\n    ReactNativeStyleAttributes.shadowColor = colorAttributes;\n    ReactNativeStyleAttributes.textDecorationColor = colorAttributes;\n    ReactNativeStyleAttributes.tintColor = colorAttributes;\n    ReactNativeStyleAttributes.textShadowColor = colorAttributes;\n    ReactNativeStyleAttributes.overlayColor = colorAttributes;\n\n    ReactNativeViewAttributes.UIView = {\n      pointerEvents: true,\n      accessible: true,\n      accessibilityActions: true,\n      accessibilityLabel: true,\n      accessibilityComponentType: true,\n      accessibilityLiveRegion: true,\n      accessibilityRole: true,\n      accessibilityStates: true,\n      accessibilityTraits: true,\n      importantForAccessibility: true,\n      nativeID: true,\n      testID: true,\n      renderToHardwareTextureAndroid: true,\n      shouldRasterizeIOS: true,\n      onLayout: true,\n      onAccessibilityAction: true,\n      onAccessibilityTap: true,\n      onMagicTap: true,\n      collapsable: true,\n      needsOffscreenAlphaCompositing: true,\n      style: ReactNativeStyleAttributes,\n    };\n\n    ReactNativeViewAttributes.RCTView = Object.assign({},\n      ReactNativeViewAttributes.UIView,\n      { removeClippedSubviews: true }\n    );\n\n    var viewConfig = {\n      validAttributes: Object.assign({}, ReactNativeViewAttributes.UIView, {\n        isHighlighted: true,\n        numberOfLines: true,\n        ellipsizeMode: true,\n        allowFontScaling: true,\n        disabled: true,\n        selectable: true,\n        selectionColor: true,\n        adjustsFontSizeToFit: true,\n        minimumFontScale: true,\n        textBreakStrategy: true\n      }),\n      uiViewClassName: 'RCTText'\n    };\n\n    var MatrixMath = {\n      createIdentityMatrix: function() {\n        return [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1];\n      },\n\n      createCopy: function(m) {\n        return [\n          m[0],\n          m[1],\n          m[2],\n          m[3],\n          m[4],\n          m[5],\n          m[6],\n          m[7],\n          m[8],\n          m[9],\n          m[10],\n          m[11],\n          m[12],\n          m[13],\n          m[14],\n          m[15],\n        ];\n      },\n\n      createOrthographic: function(left, right, bottom, top, near, far) {\n        const a = 2 / (right - left);\n        const b = 2 / (top - bottom);\n        const c = -2 / (far - near);\n\n        const tx = -(right + left) / (right - left);\n        const ty = -(top + bottom) / (top - bottom);\n        const tz = -(far + near) / (far - near);\n\n        return [a, 0, 0, 0, 0, b, 0, 0, 0, 0, c, 0, tx, ty, tz, 1];\n      },\n\n      createFrustum: function(left, right, bottom, top, near, far) {\n        const r_width = 1 / (right - left);\n        const r_height = 1 / (top - bottom);\n        const r_depth = 1 / (near - far);\n        const x = 2 * (near * r_width);\n        const y = 2 * (near * r_height);\n        const A = (right + left) * r_width;\n        const B = (top + bottom) * r_height;\n        const C = (far + near) * r_depth;\n        const D = 2 * (far * near * r_depth);\n        return [x, 0, 0, 0, 0, y, 0, 0, A, B, C, -1, 0, 0, D, 0];\n      },\n\n      /**\n       * This create a perspective projection towards negative z\n       * Clipping the z range of [-near, -far]\n       *\n       * @param fovInRadians - field of view in randians\n       */\n      createPerspective: function(fovInRadians, aspect, near, far) {\n        const h = 1 / Math.tan(fovInRadians / 2);\n        const r_depth = 1 / (near - far);\n        const C = (far + near) * r_depth;\n        const D = 2 * (far * near * r_depth);\n        return [h / aspect, 0, 0, 0, 0, h, 0, 0, 0, 0, C, -1, 0, 0, D, 0];\n      },\n\n      createTranslate2d: function(x, y) {\n        const mat = MatrixMath.createIdentityMatrix();\n        MatrixMath.reuseTranslate2dCommand(mat, x, y);\n        return mat;\n      },\n\n      reuseTranslate2dCommand: function(matrixCommand, x, y) {\n        matrixCommand[12] = x;\n        matrixCommand[13] = y;\n      },\n\n      reuseTranslate3dCommand: function(matrixCommand, x, y, z) {\n        matrixCommand[12] = x;\n        matrixCommand[13] = y;\n        matrixCommand[14] = z;\n      },\n\n      createScale: function(factor) {\n        const mat = MatrixMath.createIdentityMatrix();\n        MatrixMath.reuseScaleCommand(mat, factor);\n        return mat;\n      },\n\n      reuseScaleCommand: function(matrixCommand, factor) {\n        matrixCommand[0] = factor;\n        matrixCommand[5] = factor;\n      },\n\n      reuseScale3dCommand: function(matrixCommand, x, y, z) {\n        matrixCommand[0] = x;\n        matrixCommand[5] = y;\n        matrixCommand[10] = z;\n      },\n\n      reusePerspectiveCommand: function(matrixCommand, p) {\n        matrixCommand[11] = -1 / p;\n      },\n\n      reuseScaleXCommand(matrixCommand, factor) {\n        matrixCommand[0] = factor;\n      },\n\n      reuseScaleYCommand(matrixCommand, factor) {\n        matrixCommand[5] = factor;\n      },\n\n      reuseScaleZCommand(matrixCommand, factor) {\n        matrixCommand[10] = factor;\n      },\n\n      reuseRotateXCommand: function(matrixCommand, radians) {\n        matrixCommand[5] = Math.cos(radians);\n        matrixCommand[6] = Math.sin(radians);\n        matrixCommand[9] = -Math.sin(radians);\n        matrixCommand[10] = Math.cos(radians);\n      },\n\n      reuseRotateYCommand: function(matrixCommand, amount) {\n        matrixCommand[0] = Math.cos(amount);\n        matrixCommand[2] = -Math.sin(amount);\n        matrixCommand[8] = Math.sin(amount);\n        matrixCommand[10] = Math.cos(amount);\n      },\n\n      // http://www.w3.org/TR/css3-transforms/#recomposing-to-a-2d-matrix\n      reuseRotateZCommand: function(matrixCommand, radians) {\n        matrixCommand[0] = Math.cos(radians);\n        matrixCommand[1] = Math.sin(radians);\n        matrixCommand[4] = -Math.sin(radians);\n        matrixCommand[5] = Math.cos(radians);\n      },\n\n      createRotateZ: function(radians) {\n        const mat = MatrixMath.createIdentityMatrix();\n        MatrixMath.reuseRotateZCommand(mat, radians);\n        return mat;\n      },\n\n      reuseSkewXCommand: function(matrixCommand, radians) {\n        matrixCommand[4] = Math.tan(radians);\n      },\n\n      reuseSkewYCommand: function(matrixCommand, radians) {\n        matrixCommand[1] = Math.tan(radians);\n      },\n\n      multiplyInto: function(out, a, b) {\n        const a00 = a[0],\n          a01 = a[1],\n          a02 = a[2],\n          a03 = a[3],\n          a10 = a[4],\n          a11 = a[5],\n          a12 = a[6],\n          a13 = a[7],\n          a20 = a[8],\n          a21 = a[9],\n          a22 = a[10],\n          a23 = a[11],\n          a30 = a[12],\n          a31 = a[13],\n          a32 = a[14],\n          a33 = a[15];\n\n        let b0 = b[0],\n          b1 = b[1],\n          b2 = b[2],\n          b3 = b[3];\n        out[0] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30;\n        out[1] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31;\n        out[2] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32;\n        out[3] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33;\n\n        b0 = b[4];\n        b1 = b[5];\n        b2 = b[6];\n        b3 = b[7];\n        out[4] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30;\n        out[5] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31;\n        out[6] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32;\n        out[7] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33;\n\n        b0 = b[8];\n        b1 = b[9];\n        b2 = b[10];\n        b3 = b[11];\n        out[8] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30;\n        out[9] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31;\n        out[10] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32;\n        out[11] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33;\n\n        b0 = b[12];\n        b1 = b[13];\n        b2 = b[14];\n        b3 = b[15];\n        out[12] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30;\n        out[13] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31;\n        out[14] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32;\n        out[15] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33;\n      },\n\n      determinant(matrix) {\n        const [\n          m00,\n          m01,\n          m02,\n          m03,\n          m10,\n          m11,\n          m12,\n          m13,\n          m20,\n          m21,\n          m22,\n          m23,\n          m30,\n          m31,\n          m32,\n          m33,\n        ] = matrix;\n        return (\n          m03 * m12 * m21 * m30 -\n          m02 * m13 * m21 * m30 -\n          m03 * m11 * m22 * m30 +\n          m01 * m13 * m22 * m30 +\n          m02 * m11 * m23 * m30 -\n          m01 * m12 * m23 * m30 -\n          m03 * m12 * m20 * m31 +\n          m02 * m13 * m20 * m31 +\n          m03 * m10 * m22 * m31 -\n          m00 * m13 * m22 * m31 -\n          m02 * m10 * m23 * m31 +\n          m00 * m12 * m23 * m31 +\n          m03 * m11 * m20 * m32 -\n          m01 * m13 * m20 * m32 -\n          m03 * m10 * m21 * m32 +\n          m00 * m13 * m21 * m32 +\n          m01 * m10 * m23 * m32 -\n          m00 * m11 * m23 * m32 -\n          m02 * m11 * m20 * m33 +\n          m01 * m12 * m20 * m33 +\n          m02 * m10 * m21 * m33 -\n          m00 * m12 * m21 * m33 -\n          m01 * m10 * m22 * m33 +\n          m00 * m11 * m22 * m33\n        );\n      },\n\n      /**\n       * Inverse of a matrix. Multiplying by the inverse is used in matrix math\n       * instead of division.\n       *\n       * Formula from:\n       * http://www.euclideanspace.com/maths/algebra/matrix/functions/inverse/fourD/index.htm\n       */\n      inverse(matrix: Array<number>): Array<number> {\n        const det = MatrixMath.determinant(matrix);\n        if (!det) {\n          return matrix;\n        }\n        const [\n          m00,\n          m01,\n          m02,\n          m03,\n          m10,\n          m11,\n          m12,\n          m13,\n          m20,\n          m21,\n          m22,\n          m23,\n          m30,\n          m31,\n          m32,\n          m33,\n        ] = matrix;\n        return [\n          (m12 * m23 * m31 -\n            m13 * m22 * m31 +\n            m13 * m21 * m32 -\n            m11 * m23 * m32 -\n            m12 * m21 * m33 +\n            m11 * m22 * m33) /\n            det,\n          (m03 * m22 * m31 -\n            m02 * m23 * m31 -\n            m03 * m21 * m32 +\n            m01 * m23 * m32 +\n            m02 * m21 * m33 -\n            m01 * m22 * m33) /\n            det,\n          (m02 * m13 * m31 -\n            m03 * m12 * m31 +\n            m03 * m11 * m32 -\n            m01 * m13 * m32 -\n            m02 * m11 * m33 +\n            m01 * m12 * m33) /\n            det,\n          (m03 * m12 * m21 -\n            m02 * m13 * m21 -\n            m03 * m11 * m22 +\n            m01 * m13 * m22 +\n            m02 * m11 * m23 -\n            m01 * m12 * m23) /\n            det,\n          (m13 * m22 * m30 -\n            m12 * m23 * m30 -\n            m13 * m20 * m32 +\n            m10 * m23 * m32 +\n            m12 * m20 * m33 -\n            m10 * m22 * m33) /\n            det,\n          (m02 * m23 * m30 -\n            m03 * m22 * m30 +\n            m03 * m20 * m32 -\n            m00 * m23 * m32 -\n            m02 * m20 * m33 +\n            m00 * m22 * m33) /\n            det,\n          (m03 * m12 * m30 -\n            m02 * m13 * m30 -\n            m03 * m10 * m32 +\n            m00 * m13 * m32 +\n            m02 * m10 * m33 -\n            m00 * m12 * m33) /\n            det,\n          (m02 * m13 * m20 -\n            m03 * m12 * m20 +\n            m03 * m10 * m22 -\n            m00 * m13 * m22 -\n            m02 * m10 * m23 +\n            m00 * m12 * m23) /\n            det,\n          (m11 * m23 * m30 -\n            m13 * m21 * m30 +\n            m13 * m20 * m31 -\n            m10 * m23 * m31 -\n            m11 * m20 * m33 +\n            m10 * m21 * m33) /\n            det,\n          (m03 * m21 * m30 -\n            m01 * m23 * m30 -\n            m03 * m20 * m31 +\n            m00 * m23 * m31 +\n            m01 * m20 * m33 -\n            m00 * m21 * m33) /\n            det,\n          (m01 * m13 * m30 -\n            m03 * m11 * m30 +\n            m03 * m10 * m31 -\n            m00 * m13 * m31 -\n            m01 * m10 * m33 +\n            m00 * m11 * m33) /\n            det,\n          (m03 * m11 * m20 -\n            m01 * m13 * m20 -\n            m03 * m10 * m21 +\n            m00 * m13 * m21 +\n            m01 * m10 * m23 -\n            m00 * m11 * m23) /\n            det,\n          (m12 * m21 * m30 -\n            m11 * m22 * m30 -\n            m12 * m20 * m31 +\n            m10 * m22 * m31 +\n            m11 * m20 * m32 -\n            m10 * m21 * m32) /\n            det,\n          (m01 * m22 * m30 -\n            m02 * m21 * m30 +\n            m02 * m20 * m31 -\n            m00 * m22 * m31 -\n            m01 * m20 * m32 +\n            m00 * m21 * m32) /\n            det,\n          (m02 * m11 * m30 -\n            m01 * m12 * m30 -\n            m02 * m10 * m31 +\n            m00 * m12 * m31 +\n            m01 * m10 * m32 -\n            m00 * m11 * m32) /\n            det,\n          (m01 * m12 * m20 -\n            m02 * m11 * m20 +\n            m02 * m10 * m21 -\n            m00 * m12 * m21 -\n            m01 * m10 * m22 +\n            m00 * m11 * m22) /\n            det,\n        ];\n      },\n\n      /**\n       * Turns columns into rows and rows into columns.\n       */\n      transpose(m: Array<number>): Array<number> {\n        return [\n          m[0],\n          m[4],\n          m[8],\n          m[12],\n          m[1],\n          m[5],\n          m[9],\n          m[13],\n          m[2],\n          m[6],\n          m[10],\n          m[14],\n          m[3],\n          m[7],\n          m[11],\n          m[15],\n        ];\n      },\n\n      /**\n       * Based on: http://tog.acm.org/resources/GraphicsGems/gemsii/unmatrix.c\n       */\n      multiplyVectorByMatrix(v: Array<number>, m: Array<number>): Array<number> {\n        const [vx, vy, vz, vw] = v;\n        return [\n          vx * m[0] + vy * m[4] + vz * m[8] + vw * m[12],\n          vx * m[1] + vy * m[5] + vz * m[9] + vw * m[13],\n          vx * m[2] + vy * m[6] + vz * m[10] + vw * m[14],\n          vx * m[3] + vy * m[7] + vz * m[11] + vw * m[15],\n        ];\n      },\n\n      /**\n       * From: https://code.google.com/p/webgl-mjs/source/browse/mjs.js\n       */\n      v3Length(a: Array<number>): number {\n        return Math.sqrt(a[0] * a[0] + a[1] * a[1] + a[2] * a[2]);\n      },\n\n      /**\n       * Based on: https://code.google.com/p/webgl-mjs/source/browse/mjs.js\n       */\n      v3Normalize(vector: Array<number>, v3Length: number): Array<number> {\n        const im = 1 / (v3Length || MatrixMath.v3Length(vector));\n        return [vector[0] * im, vector[1] * im, vector[2] * im];\n      },\n\n      /**\n       * The dot product of a and b, two 3-element vectors.\n       * From: https://code.google.com/p/webgl-mjs/source/browse/mjs.js\n       */\n      v3Dot(a, b) {\n        return a[0] * b[0] + a[1] * b[1] + a[2] * b[2];\n      },\n\n      /**\n       * From:\n       * http://www.opensource.apple.com/source/WebCore/WebCore-514/platform/graphics/transforms/TransformationMatrix.cpp\n       */\n      v3Combine(\n        a: Array<number>,\n        b: Array<number>,\n        aScale: number,\n        bScale: number,\n      ): Array<number> {\n        return [\n          aScale * a[0] + bScale * b[0],\n          aScale * a[1] + bScale * b[1],\n          aScale * a[2] + bScale * b[2],\n        ];\n      },\n\n      /**\n       * From:\n       * http://www.opensource.apple.com/source/WebCore/WebCore-514/platform/graphics/transforms/TransformationMatrix.cpp\n       */\n      v3Cross(a: Array<number>, b: Array<number>): Array<number> {\n        return [\n          a[1] * b[2] - a[2] * b[1],\n          a[2] * b[0] - a[0] * b[2],\n          a[0] * b[1] - a[1] * b[0],\n        ];\n      },\n\n      /**\n       * Based on:\n       * http://www.euclideanspace.com/maths/geometry/rotations/conversions/quaternionToEuler/\n       * and:\n       * http://quat.zachbennett.com/\n       *\n       * Note that this rounds degrees to the thousandth of a degree, due to\n       * floating point errors in the creation of the quaternion.\n       *\n       * Also note that this expects the qw value to be last, not first.\n       *\n       * Also, when researching this, remember that:\n       * yaw   === heading            === z-axis\n       * pitch === elevation/attitude === y-axis\n       * roll  === bank               === x-axis\n       */\n      quaternionToDegreesXYZ(q: Array<number>, matrix, row): Array<number> {\n        const [qx, qy, qz, qw] = q;\n        const qw2 = qw * qw;\n        const qx2 = qx * qx;\n        const qy2 = qy * qy;\n        const qz2 = qz * qz;\n        const test = qx * qy + qz * qw;\n        const unit = qw2 + qx2 + qy2 + qz2;\n        const conv = 180 / Math.PI;\n\n        if (test > 0.49999 * unit) {\n          return [0, 2 * Math.atan2(qx, qw) * conv, 90];\n        }\n        if (test < -0.49999 * unit) {\n          return [0, -2 * Math.atan2(qx, qw) * conv, -90];\n        }\n\n        return [\n          MatrixMath.roundTo3Places(\n            Math.atan2(2 * qx * qw - 2 * qy * qz, 1 - 2 * qx2 - 2 * qz2) * conv,\n          ),\n          MatrixMath.roundTo3Places(\n            Math.atan2(2 * qy * qw - 2 * qx * qz, 1 - 2 * qy2 - 2 * qz2) * conv,\n          ),\n          MatrixMath.roundTo3Places(Math.asin(2 * qx * qy + 2 * qz * qw) * conv),\n        ];\n      },\n\n      /**\n       * Based on:\n       * https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/round\n       */\n      roundTo3Places(n: number): number {\n        const arr = n.toString().split('e');\n        return Math.round(arr[0] + 'e' + (arr[1] ? +arr[1] - 3 : 3)) * 0.001;\n      },\n\n      /**\n       * Decompose a matrix into separate transform values, for use on platforms\n       * where applying a precomposed matrix is not possible, and transforms are\n       * applied in an inflexible ordering (e.g. Android).\n       *\n       * Implementation based on\n       * http://www.w3.org/TR/css3-transforms/#decomposing-a-2d-matrix\n       * http://www.w3.org/TR/css3-transforms/#decomposing-a-3d-matrix\n       * which was based on\n       * http://tog.acm.org/resources/GraphicsGems/gemsii/unmatrix.c\n       */\n      decomposeMatrix(transformMatrix: Array<number>): ?Object {\n\n        // output values\n        var perspective = [];\n        const quaternion = [];\n        const scale = [];\n        const skew = [];\n        const translation = [];\n\n        // create normalized, 2d array matrix\n        // and normalized 1d array perspectiveMatrix with redefined 4th column\n        if (!transformMatrix[15]) {\n          return;\n        }\n        const matrix = [];\n        const perspectiveMatrix = [];\n        for (var i = 0; i < 4; i++) {\n          matrix.push([]);\n          for (let j = 0; j < 4; j++) {\n            const value = transformMatrix[i * 4 + j] / transformMatrix[15];\n            matrix[i].push(value);\n            perspectiveMatrix.push(j === 3 ? 0 : value);\n          }\n        }\n        perspectiveMatrix[15] = 1;\n\n        // test for singularity of upper 3x3 part of the perspective matrix\n        if (!MatrixMath.determinant(perspectiveMatrix)) {\n          return;\n        }\n\n        // isolate perspective\n        if (matrix[0][3] !== 0 || matrix[1][3] !== 0 || matrix[2][3] !== 0) {\n          // rightHandSide is the right hand side of the equation.\n          // rightHandSide is a vector, or point in 3d space relative to the origin.\n          const rightHandSide = [\n            matrix[0][3],\n            matrix[1][3],\n            matrix[2][3],\n            matrix[3][3],\n          ];\n\n          // Solve the equation by inverting perspectiveMatrix and multiplying\n          // rightHandSide by the inverse.\n          const inversePerspectiveMatrix = MatrixMath.inverse(perspectiveMatrix);\n          const transposedInversePerspectiveMatrix = MatrixMath.transpose(\n            inversePerspectiveMatrix,\n          );\n          var perspective = MatrixMath.multiplyVectorByMatrix(\n            rightHandSide,\n            transposedInversePerspectiveMatrix,\n          );\n        } else {\n          // no perspective\n          perspective[0] = perspective[1] = perspective[2] = 0;\n          perspective[3] = 1;\n        }\n\n        // translation is simple\n        for (var i = 0; i < 3; i++) {\n          translation[i] = matrix[3][i];\n        }\n\n        // Now get scale and shear.\n        // 'row' is a 3 element array of 3 component vectors\n        const row = [];\n        for (i = 0; i < 3; i++) {\n          row[i] = [matrix[i][0], matrix[i][1], matrix[i][2]];\n        }\n\n        // Compute X scale factor and normalize first row.\n        scale[0] = MatrixMath.v3Length(row[0]);\n        row[0] = MatrixMath.v3Normalize(row[0], scale[0]);\n\n        // Compute XY shear factor and make 2nd row orthogonal to 1st.\n        skew[0] = MatrixMath.v3Dot(row[0], row[1]);\n        row[1] = MatrixMath.v3Combine(row[1], row[0], 1.0, -skew[0]);\n\n        // Compute XY shear factor and make 2nd row orthogonal to 1st.\n        skew[0] = MatrixMath.v3Dot(row[0], row[1]);\n        row[1] = MatrixMath.v3Combine(row[1], row[0], 1.0, -skew[0]);\n\n        // Now, compute Y scale and normalize 2nd row.\n        scale[1] = MatrixMath.v3Length(row[1]);\n        row[1] = MatrixMath.v3Normalize(row[1], scale[1]);\n        skew[0] /= scale[1];\n\n        // Compute XZ and YZ shears, orthogonalize 3rd row\n        skew[1] = MatrixMath.v3Dot(row[0], row[2]);\n        row[2] = MatrixMath.v3Combine(row[2], row[0], 1.0, -skew[1]);\n        skew[2] = MatrixMath.v3Dot(row[1], row[2]);\n        row[2] = MatrixMath.v3Combine(row[2], row[1], 1.0, -skew[2]);\n\n        // Next, get Z scale and normalize 3rd row.\n        scale[2] = MatrixMath.v3Length(row[2]);\n        row[2] = MatrixMath.v3Normalize(row[2], scale[2]);\n        skew[1] /= scale[2];\n        skew[2] /= scale[2];\n\n        // At this point, the matrix (in rows) is orthonormal.\n        // Check for a coordinate system flip.  If the determinant\n        // is -1, then negate the matrix and the scaling factors.\n        const pdum3 = MatrixMath.v3Cross(row[1], row[2]);\n        if (MatrixMath.v3Dot(row[0], pdum3) < 0) {\n          for (i = 0; i < 3; i++) {\n            scale[i] *= -1;\n            row[i][0] *= -1;\n            row[i][1] *= -1;\n            row[i][2] *= -1;\n          }\n        }\n\n        // Now, get the rotations out\n        quaternion[0] =\n          0.5 * Math.sqrt(Math.max(1 + row[0][0] - row[1][1] - row[2][2], 0));\n        quaternion[1] =\n          0.5 * Math.sqrt(Math.max(1 - row[0][0] + row[1][1] - row[2][2], 0));\n        quaternion[2] =\n          0.5 * Math.sqrt(Math.max(1 - row[0][0] - row[1][1] + row[2][2], 0));\n        quaternion[3] =\n          0.5 * Math.sqrt(Math.max(1 + row[0][0] + row[1][1] + row[2][2], 0));\n\n        if (row[2][1] > row[1][2]) {\n          quaternion[0] = -quaternion[0];\n        }\n        if (row[0][2] > row[2][0]) {\n          quaternion[1] = -quaternion[1];\n        }\n        if (row[1][0] > row[0][1]) {\n          quaternion[2] = -quaternion[2];\n        }\n\n        // correct for occasional, weird Euler synonyms for 2d rotation\n        let rotationDegrees;\n        if (\n          quaternion[0] < 0.001 &&\n          quaternion[0] >= 0 &&\n          quaternion[1] < 0.001 &&\n          quaternion[1] >= 0\n        ) {\n          // this is a 2d rotation on the z-axis\n          rotationDegrees = [\n            0,\n            0,\n            MatrixMath.roundTo3Places(\n              Math.atan2(row[0][1], row[0][0]) * 180 / Math.PI,\n            ),\n          ];\n        } else {\n          rotationDegrees = MatrixMath.quaternionToDegreesXYZ(\n            quaternion,\n            matrix,\n            row,\n          );\n        }\n\n        // expose both base data and convenience names\n        return {\n          rotationDegrees,\n          perspective,\n          quaternion,\n          scale,\n          skew,\n          translation,\n\n          rotate: rotationDegrees[2],\n          rotateX: rotationDegrees[0],\n          rotateY: rotationDegrees[1],\n          scaleX: scale[0],\n          scaleY: scale[1],\n          translateX: translation[0],\n          translateY: translation[1],\n        };\n      },\n    };\n\n    function _multiplyTransform(result, matrixMathFunction, args): void {\n      const matrixToApply = MatrixMath.createIdentityMatrix();\n      const argsWithIdentity = [matrixToApply].concat(args);\n      matrixMathFunction.apply(this, argsWithIdentity);\n      MatrixMath.multiplyInto(result, result, matrixToApply);\n    }\n\n    function _convertToRadians(value: string): number {\n      const floatValue = parseFloat(value);\n      return value.indexOf('rad') > -1 ? floatValue : floatValue * Math.PI / 180;\n    }\n\n    function processTransform(transform) {\n      // Android & iOS implementations of transform property accept the list of\n      // transform properties as opposed to a transform Matrix. This is necessary\n      // to control transform property updates completely on the native thread.\n      if (Platform.OS === 'android' || Platform.OS === 'ios') {\n        return transform;\n      }\n\n      const result = MatrixMath.createIdentityMatrix();\n\n      transform.forEach(transformation => {\n        const key = Object.keys(transformation)[0];\n        const value = transformation[key];\n\n        switch (key) {\n          case 'matrix':\n            MatrixMath.multiplyInto(result, result, value);\n            break;\n          case 'perspective':\n            _multiplyTransform(result, MatrixMath.reusePerspectiveCommand, [value]);\n            break;\n          case 'rotateX':\n            _multiplyTransform(result, MatrixMath.reuseRotateXCommand, [\n              _convertToRadians(value),\n            ]);\n            break;\n          case 'rotateY':\n            _multiplyTransform(result, MatrixMath.reuseRotateYCommand, [\n              _convertToRadians(value),\n            ]);\n            break;\n          case 'rotate':\n          case 'rotateZ':\n            _multiplyTransform(result, MatrixMath.reuseRotateZCommand, [\n              _convertToRadians(value),\n            ]);\n            break;\n          case 'scale':\n            _multiplyTransform(result, MatrixMath.reuseScaleCommand, [value]);\n            break;\n          case 'scaleX':\n            _multiplyTransform(result, MatrixMath.reuseScaleXCommand, [value]);\n            break;\n          case 'scaleY':\n            _multiplyTransform(result, MatrixMath.reuseScaleYCommand, [value]);\n            break;\n          case 'translate':\n            _multiplyTransform(result, MatrixMath.reuseTranslate3dCommand, [\n              value[0],\n              value[1],\n              value[2] || 0,\n            ]);\n            break;\n          case 'translateX':\n            _multiplyTransform(result, MatrixMath.reuseTranslate2dCommand, [\n              value,\n              0,\n            ]);\n            break;\n          case 'translateY':\n            _multiplyTransform(result, MatrixMath.reuseTranslate2dCommand, [\n              0,\n              value,\n            ]);\n            break;\n          case 'skewX':\n            _multiplyTransform(result, MatrixMath.reuseSkewXCommand, [\n              _convertToRadians(value),\n            ]);\n            break;\n          case 'skewY':\n            _multiplyTransform(result, MatrixMath.reuseSkewYCommand, [\n              _convertToRadians(value),\n            ]);\n            break;\n          default:\n            throw new Error('Invalid transform name: ' + key);\n        }\n      });\n\n      return result;\n    }\n\n    function register(name, callback) {\n      viewConfigCallbacks.set(name, callback);\n      return name;\n    };\n\n    const createReactNativeComponentClass = function(name, callback) {\n      return register(name, callback);\n    };\n\n    const RCTText = createReactNativeComponentClass(\n      viewConfig.uiViewClassName,\n      function () { return viewConfig }\n    );\n\n    const RCTVirtualText = UIManager.RCTVirtualText == null\n      ? RCTText\n      : createReactNativeComponentClass('RCTVirtualText', () => ({\n            validAttributes: Object.assign({},\n              ReactNativeViewAttributes.UIView,\n              { isHighlighted: true }\n            ),\n            uiViewClassName: 'RCTVirtualText',\n          }));\n\n    function normalizeColor(color) {\n      const matchers = getMatchers();\n      let match;\n\n      if (typeof color === 'number') {\n        if (color >>> 0 === color && color >= 0 && color <= 0xffffffff) {\n          return color;\n        }\n        return null;\n      }\n\n      // Ordered based on occurrences on Facebook codebase\n      if ((match = matchers.hex6.exec(color))) {\n        return parseInt(match[1] + 'ff', 16) >>> 0;\n      }\n\n      if (names.hasOwnProperty(color)) {\n        return names[color];\n      }\n\n      if ((match = matchers.rgb.exec(color))) {\n        return (\n          // b\n          ((parse255(match[1]) << 24) | // r\n          (parse255(match[2]) << 16) | // g\n            (parse255(match[3]) << 8) |\n            0x000000ff) >>> // a\n          0\n        );\n      }\n\n      if ((match = matchers.rgba.exec(color))) {\n        return (\n          // b\n          ((parse255(match[1]) << 24) | // r\n          (parse255(match[2]) << 16) | // g\n            (parse255(match[3]) << 8) |\n            parse1(match[4])) >>> // a\n          0\n        );\n      }\n\n      if ((match = matchers.hex3.exec(color))) {\n        return (\n          parseInt(\n            match[1] +\n            match[1] + // r\n            match[2] +\n            match[2] + // g\n            match[3] +\n            match[3] + // b\n              'ff', // a\n            16,\n          ) >>> 0\n        );\n      }\n\n      // https://drafts.csswg.org/css-color-4/#hex-notation\n      if ((match = matchers.hex8.exec(color))) {\n        return parseInt(match[1], 16) >>> 0;\n      }\n\n      if ((match = matchers.hex4.exec(color))) {\n        return (\n          parseInt(\n            match[1] +\n            match[1] + // r\n            match[2] +\n            match[2] + // g\n            match[3] +\n            match[3] + // b\n              match[4] +\n              match[4], // a\n            16,\n          ) >>> 0\n        );\n      }\n\n      if ((match = matchers.hsl.exec(color))) {\n        return (\n          (hslToRgb(\n            parse360(match[1]), // h\n            parsePercentage(match[2]), // s\n            parsePercentage(match[3]), // l\n          ) |\n            0x000000ff) >>> // a\n          0\n        );\n      }\n\n      if ((match = matchers.hsla.exec(color))) {\n        return (\n          (hslToRgb(\n            parse360(match[1]), // h\n            parsePercentage(match[2]), // s\n            parsePercentage(match[3]), // l\n          ) |\n            parse1(match[4])) >>> // a\n          0\n        );\n      }\n\n      return null;\n    }\n\n    function hue2rgb(p, q, t) {\n      if (t < 0) {\n        t += 1;\n      }\n      if (t > 1) {\n        t -= 1;\n      }\n      if (t < 1 / 6) {\n        return p + (q - p) * 6 * t;\n      }\n      if (t < 1 / 2) {\n        return q;\n      }\n      if (t < 2 / 3) {\n        return p + (q - p) * (2 / 3 - t) * 6;\n      }\n      return p;\n    }\n\n    function hslToRgb(h, s, l) {\n      const q = l < 0.5 ? l * (1 + s) : l + s - l * s;\n      const p = 2 * l - q;\n      const r = hue2rgb(p, q, h + 1 / 3);\n      const g = hue2rgb(p, q, h);\n      const b = hue2rgb(p, q, h - 1 / 3);\n\n      return (\n        (Math.round(r * 255) << 24) |\n        (Math.round(g * 255) << 16) |\n        (Math.round(b * 255) << 8)\n      );\n    }\n\n    // var INTEGER = '[-+]?\\\\d+';\n    const NUMBER = '[-+]?\\\\d*\\\\.?\\\\d+';\n    const PERCENTAGE = NUMBER + '%';\n\n    function call(...args) {\n      return '\\\\(\\\\s*(' + args.join(')\\\\s*,\\\\s*(') + ')\\\\s*\\\\)';\n    }\n\n    function getMatchers() {\n      var cachedMatchers = {\n          rgb: new RegExp('rgb' + call(NUMBER, NUMBER, NUMBER)),\n          rgba: new RegExp('rgba' + call(NUMBER, NUMBER, NUMBER, NUMBER)),\n          hsl: new RegExp('hsl' + call(NUMBER, PERCENTAGE, PERCENTAGE)),\n          hsla: new RegExp('hsla' + call(NUMBER, PERCENTAGE, PERCENTAGE, NUMBER)),\n          hex3: /^#([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,\n          hex4: /^#([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,\n          hex6: /^#([0-9a-fA-F]{6})$/,\n          hex8: /^#([0-9a-fA-F]{8})$/,\n        };\n      return cachedMatchers;\n    }\n\n    function parse255(str) {\n      const int = parseInt(str, 10);\n      if (int < 0) {\n        return 0;\n      }\n      if (int > 255) {\n        return 255;\n      }\n      return int;\n    }\n\n    function parse360(str) {\n      const int = parseFloat(str);\n      return (((int % 360) + 360) % 360) / 360;\n    }\n\n    function parse1(str) {\n      const num = parseFloat(str);\n      if (num < 0) {\n        return 0;\n      }\n      if (num > 1) {\n        return 255;\n      }\n      return Math.round(num * 255);\n    }\n\n    function parsePercentage(str) {\n      // parseFloat conveniently ignores the final %\n      const int = parseFloat(str);\n      if (int < 0) {\n        return 0;\n      }\n      if (int > 100) {\n        return 1;\n      }\n      return int / 100;\n    }\n\n    const names = {\n      transparent: 0x00000000,\n\n      // http://www.w3.org/TR/css3-color/#svg-color\n      aliceblue: 0xf0f8ffff,\n      antiquewhite: 0xfaebd7ff,\n      aqua: 0x00ffffff,\n      aquamarine: 0x7fffd4ff,\n      azure: 0xf0ffffff,\n      beige: 0xf5f5dcff,\n      bisque: 0xffe4c4ff,\n      black: 0x000000ff,\n      blanchedalmond: 0xffebcdff,\n      blue: 0x0000ffff,\n      blueviolet: 0x8a2be2ff,\n      brown: 0xa52a2aff,\n      burlywood: 0xdeb887ff,\n      burntsienna: 0xea7e5dff,\n      cadetblue: 0x5f9ea0ff,\n      chartreuse: 0x7fff00ff,\n      chocolate: 0xd2691eff,\n      coral: 0xff7f50ff,\n      cornflowerblue: 0x6495edff,\n      cornsilk: 0xfff8dcff,\n      crimson: 0xdc143cff,\n      cyan: 0x00ffffff,\n      darkblue: 0x00008bff,\n      darkcyan: 0x008b8bff,\n      darkgoldenrod: 0xb8860bff,\n      darkgray: 0xa9a9a9ff,\n      darkgreen: 0x006400ff,\n      darkgrey: 0xa9a9a9ff,\n      darkkhaki: 0xbdb76bff,\n      darkmagenta: 0x8b008bff,\n      darkolivegreen: 0x556b2fff,\n      darkorange: 0xff8c00ff,\n      darkorchid: 0x9932ccff,\n      darkred: 0x8b0000ff,\n      darksalmon: 0xe9967aff,\n      darkseagreen: 0x8fbc8fff,\n      darkslateblue: 0x483d8bff,\n      darkslategray: 0x2f4f4fff,\n      darkslategrey: 0x2f4f4fff,\n      darkturquoise: 0x00ced1ff,\n      darkviolet: 0x9400d3ff,\n      deeppink: 0xff1493ff,\n      deepskyblue: 0x00bfffff,\n      dimgray: 0x696969ff,\n      dimgrey: 0x696969ff,\n      dodgerblue: 0x1e90ffff,\n      firebrick: 0xb22222ff,\n      floralwhite: 0xfffaf0ff,\n      forestgreen: 0x228b22ff,\n      fuchsia: 0xff00ffff,\n      gainsboro: 0xdcdcdcff,\n      ghostwhite: 0xf8f8ffff,\n      gold: 0xffd700ff,\n      goldenrod: 0xdaa520ff,\n      gray: 0x808080ff,\n      green: 0x008000ff,\n      greenyellow: 0xadff2fff,\n      grey: 0x808080ff,\n      honeydew: 0xf0fff0ff,\n      hotpink: 0xff69b4ff,\n      indianred: 0xcd5c5cff,\n      indigo: 0x4b0082ff,\n      ivory: 0xfffff0ff,\n      khaki: 0xf0e68cff,\n      lavender: 0xe6e6faff,\n      lavenderblush: 0xfff0f5ff,\n      lawngreen: 0x7cfc00ff,\n      lemonchiffon: 0xfffacdff,\n      lightblue: 0xadd8e6ff,\n      lightcoral: 0xf08080ff,\n      lightcyan: 0xe0ffffff,\n      lightgoldenrodyellow: 0xfafad2ff,\n      lightgray: 0xd3d3d3ff,\n      lightgreen: 0x90ee90ff,\n      lightgrey: 0xd3d3d3ff,\n      lightpink: 0xffb6c1ff,\n      lightsalmon: 0xffa07aff,\n      lightseagreen: 0x20b2aaff,\n      lightskyblue: 0x87cefaff,\n      lightslategray: 0x778899ff,\n      lightslategrey: 0x778899ff,\n      lightsteelblue: 0xb0c4deff,\n      lightyellow: 0xffffe0ff,\n      lime: 0x00ff00ff,\n      limegreen: 0x32cd32ff,\n      linen: 0xfaf0e6ff,\n      magenta: 0xff00ffff,\n      maroon: 0x800000ff,\n      mediumaquamarine: 0x66cdaaff,\n      mediumblue: 0x0000cdff,\n      mediumorchid: 0xba55d3ff,\n      mediumpurple: 0x9370dbff,\n      mediumseagreen: 0x3cb371ff,\n      mediumslateblue: 0x7b68eeff,\n      mediumspringgreen: 0x00fa9aff,\n      mediumturquoise: 0x48d1ccff,\n      mediumvioletred: 0xc71585ff,\n      midnightblue: 0x191970ff,\n      mintcream: 0xf5fffaff,\n      mistyrose: 0xffe4e1ff,\n      moccasin: 0xffe4b5ff,\n      navajowhite: 0xffdeadff,\n      navy: 0x000080ff,\n      oldlace: 0xfdf5e6ff,\n      olive: 0x808000ff,\n      olivedrab: 0x6b8e23ff,\n      orange: 0xffa500ff,\n      orangered: 0xff4500ff,\n      orchid: 0xda70d6ff,\n      palegoldenrod: 0xeee8aaff,\n      palegreen: 0x98fb98ff,\n      paleturquoise: 0xafeeeeff,\n      palevioletred: 0xdb7093ff,\n      papayawhip: 0xffefd5ff,\n      peachpuff: 0xffdab9ff,\n      peru: 0xcd853fff,\n      pink: 0xffc0cbff,\n      plum: 0xdda0ddff,\n      powderblue: 0xb0e0e6ff,\n      purple: 0x800080ff,\n      rebeccapurple: 0x663399ff,\n      red: 0xff0000ff,\n      rosybrown: 0xbc8f8fff,\n      royalblue: 0x4169e1ff,\n      saddlebrown: 0x8b4513ff,\n      salmon: 0xfa8072ff,\n      sandybrown: 0xf4a460ff,\n      seagreen: 0x2e8b57ff,\n      seashell: 0xfff5eeff,\n      sienna: 0xa0522dff,\n      silver: 0xc0c0c0ff,\n      skyblue: 0x87ceebff,\n      slateblue: 0x6a5acdff,\n      slategray: 0x708090ff,\n      slategrey: 0x708090ff,\n      snow: 0xfffafaff,\n      springgreen: 0x00ff7fff,\n      steelblue: 0x4682b4ff,\n      tan: 0xd2b48cff,\n      teal: 0x008080ff,\n      thistle: 0xd8bfd8ff,\n      tomato: 0xff6347ff,\n      turquoise: 0x40e0d0ff,\n      violet: 0xee82eeff,\n      wheat: 0xf5deb3ff,\n      white: 0xffffffff,\n      whitesmoke: 0xf5f5f5ff,\n      yellow: 0xffff00ff,\n      yellowgreen: 0x9acd32ff,\n    };\n\n    function processColor(color) {\n      if (color === undefined || color === null) {\n        return color;\n      }\n\n      var int32Color = normalizeColor(color);\n      if (int32Color === null || int32Color === undefined) {\n        return undefined;\n      }\n\n      // Converts 0xrrggbbaa into 0xaarrggbb\n      int32Color = ((int32Color << 24) | (int32Color >>> 8)) >>> 0;\n\n      if (Platform.OS === 'android') {\n        // Android use 32 bit *signed* integer to represent the color\n        // We utilize the fact that bitwise operations in JS also operates on\n        // signed 32 bit integers, so that we can use those to convert from\n        // *unsigned* to *signed* 32bit int that way.\n        int32Color = int32Color | 0x0;\n      }\n      return int32Color;\n    }\n\n    const isTouchable = props =>\n      props.onPress != null ||\n      props.onLongPress != null ||\n      props.onStartShouldSetResponder != null;\n\n    // this is not a full implementation, but just for a hack\n    function TouchableText(props) {\n      var newProps = props;\n      if (isTouchable(newProps)) {\n        throw new Error(\"TODO: mocked TouchableText does not handle touch events\");\n      }\n      if (props.selectionColor != null) {\n        newProps = Object.assign({}, props, {\n          selectionColor: processColor(props.selectionColor)\n        });\n      }\n      return (\n        React.createElement(\n          TextAncestor.Consumer,\n          null,\n          function (hasTextAncestor) {\n            return (\n              hasTextAncestor ? (\n                React.createElement(\n                  RCTVirtualText,\n                  Object.assign(\n                    {},\n                    newProps,\n                    { ref: newProps.forwardedRef }\n                  )\n                )\n              ) : (\n                React.createElement(\n                  TextAncestor.Provider,\n                  { value: true },\n                  React.createElement(\n                    RCTText,\n                    Object.assign(\n                      {},\n                      newProps,\n                      { ref: newProps.forwardedRef }\n                    )\n                  )\n                )\n              )\n            );\n          }\n        )\n      );\n    }\n\n    TouchableText.defaultProps = {\n      accessible: true,\n      allowFontScaling: true,\n      ellipsizeMode: 'tail',\n    };\n\n    function getDifferForType(typeName: string) {\n      switch (typeName) {\n        // iOS Types\n        case 'CATransform3D':\n          return matricesDiffer;\n        case 'CGPoint':\n          return pointsDiffer;\n        case 'CGSize':\n          return sizesDiffer;\n        case 'UIEdgeInsets':\n          return insetsDiffer;\n        // Android Types\n        // (not yet implemented)\n      }\n      return null;\n    }\n\n    function getProcessorForType(typeName) {\n      switch (typeName) {\n        // iOS Types\n        case 'CGColor':\n        case 'UIColor':\n          return processColor;\n        case 'CGColorArray':\n        case 'UIColorArray':\n          return processColorArray;\n        case 'CGImage':\n        case 'UIImage':\n        case 'RCTImageSource':\n          return resolveAssetSource;\n        // Android Types\n        case 'Color':\n          return processColor;\n        case 'ColorArray':\n          return processColorArray;\n      }\n      return null;\n    }\n\n    function merge(destination, source) {\n      if (!source) {\n        return destination;\n      }\n      if (!destination) {\n        return source;\n      }\n\n      for (const key in source) {\n        if (!source.hasOwnProperty(key)) {\n          continue;\n        }\n\n        let sourceValue = source[key];\n        if (destination.hasOwnProperty(key)) {\n          const destinationValue = destination[key];\n          if (\n            typeof sourceValue === 'object' &&\n            typeof destinationValue === 'object'\n          ) {\n            sourceValue = merge(destinationValue, sourceValue);\n          }\n        }\n        destination[key] = sourceValue;\n      }\n      return destination;\n    }\n\n    function requireNativeComponent(uiViewClassName) {\n      return createReactNativeComponentClass(uiViewClassName, function() {\n        const viewConfig = UIManager[viewName];\n\n        let {baseModuleName, bubblingEventTypes, directEventTypes} = viewConfig;\n        let nativeProps = viewConfig.NativeProps;\n\n        while (baseModuleName) {\n          const baseModule = UIManager[baseModuleName];\n          if (!baseModule) {\n            baseModuleName = null;\n          } else {\n            bubblingEventTypes = Object.assign({}, baseModule.bubblingEventTypes, bubblingEventTypes);\n            directEventTypes = Object.assign({}, baseModule.directEventTypes, directEventTypes);\n            nativeProps = Object.assign({}, baseModule.NativeProps, nativeProps);\n            baseModuleName = baseModule.baseModuleName;\n          }\n        }\n\n        const viewAttributes = {};\n\n        for (const key in nativeProps) {\n          const typeName = nativeProps[key];\n          const diff = getDifferForType(typeName);\n          const process = getProcessorForType(typeName);\n\n          viewAttributes[key] =\n            diff == null && process == null ? true : {diff, process};\n        }\n        viewAttributes.style = ReactNativeStyleAttributes;\n\n        Object.assign(viewConfig, {\n          uiViewClassName: viewName,\n          validAttributes: viewAttributes,\n          bubblingEventTypes,\n          directEventTypes,\n        });\n\n        if (!hasAttachedDefaultEventTypes) {\n          attachDefaultEventTypes(viewConfig);\n          hasAttachedDefaultEventTypes = true;\n        }\n\n        return viewConfig;\n      });\n    }\n\n    var hasAttachedDefaultEventTypes = false;\n\n    function attachDefaultEventTypes(viewConfig) {\n      // This is supported on UIManager platforms (ex: Android),\n      // as lazy view managers are not implemented for all platforms.\n      // See [UIManager] for details on constants and implementations.\n      if (UIManager.ViewManagerNames) {\n        // Lazy view managers enabled.\n        viewConfig = merge(viewConfig, UIManager.getDefaultEventTypes());\n      } else {\n        viewConfig.bubblingEventTypes = merge(\n          viewConfig.bubblingEventTypes,\n          UIManager.genericBubblingEventTypes,\n        );\n        viewConfig.directEventTypes = merge(\n          viewConfig.directEventTypes,\n          UIManager.genericDirectEventTypes,\n        );\n      }\n    }\n\n    const Text = React.forwardRef(function(props, ref) {\n      return React.createElement(\n        TouchableText,\n        Object.assign(\n          {},\n          props\n          // { forwardedRef: ref }\n        )\n      );\n    });\n\n    const StyleSheet = {\n      create(obj){\n        return obj;\n      },\n    };\n\n    const RCTView = requireNativeComponent(\n      'RCTView',\n      {},\n      {\n        nativeOnly: {\n          nativeBackgroundAndroid: true,\n          nativeForegroundAndroid: true,\n        },\n      },\n    );\n\n    return {\n      StyleSheet,\n      Text,\n      View: RCTView,\n    };\n  }\n`;\n\nlet reactNativeAst = parseExpression(reactNativeCode, { plugins: [\"flow\"] });\n\nexport function createMockReactNative(realm: Realm, reactNativeRequireName: string): ObjectValue {\n  let reactNativeFactory = Environment.GetValue(realm, realm.$GlobalEnv.evaluate(reactNativeAst, false));\n  invariant(reactNativeFactory instanceof ECMAScriptSourceFunctionValue);\n  let factory = reactNativeFactory.$Call;\n  invariant(factory !== undefined);\n\n  let RCTViewDerivedReference = AbstractValue.createTemporalFromBuildFunction(\n    realm,\n    StringValue,\n    [new StringValue(realm, \"RCTView\")],\n    createOperationDescriptor(\"REACT_NATIVE_STRING_LITERAL\"),\n    { skipInvariant: true, isPure: true }\n  );\n  invariant(RCTViewDerivedReference instanceof AbstractValue);\n  realm.react.reactElementStringTypeReferences.set(\"RCTView\", RCTViewDerivedReference);\n\n  let RCTTextDerivedReference = AbstractValue.createTemporalFromBuildFunction(\n    realm,\n    StringValue,\n    [new StringValue(realm, \"RCTText\")],\n    createOperationDescriptor(\"REACT_NATIVE_STRING_LITERAL\"),\n    { skipInvariant: true, isPure: true }\n  );\n  invariant(RCTTextDerivedReference instanceof AbstractValue);\n  realm.react.reactElementStringTypeReferences.set(\"RCTText\", RCTTextDerivedReference);\n\n  let RCTActivityIndicatorViewDerivedReference = AbstractValue.createTemporalFromBuildFunction(\n    realm,\n    StringValue,\n    [new StringValue(realm, \"RCTActivityIndicatorView\")],\n    createOperationDescriptor(\"REACT_NATIVE_STRING_LITERAL\"),\n    { skipInvariant: true, isPure: true }\n  );\n  invariant(RCTActivityIndicatorViewDerivedReference instanceof AbstractValue);\n  realm.react.reactElementStringTypeReferences.set(\n    \"RCTActivityIndicatorView\",\n    RCTActivityIndicatorViewDerivedReference\n  );\n\n  let reactLibrary = realm.fbLibraries.react;\n  invariant(\n    reactLibrary !== undefined,\n    \"Could not find React library in sourcecode. Ensure React is bundled or required.\"\n  );\n  let reactNativeValue = factory(realm.intrinsics.undefined, [\n    reactLibrary,\n    new StringValue(realm, reactNativeRequireName),\n  ]);\n  invariant(reactNativeValue instanceof ObjectValue);\n  reactNativeValue.refuseSerialization = true;\n\n  reactNativeValue.intrinsicName = `require(\"${reactNativeRequireName}\")`;\n\n  reactNativeValue.refuseSerialization = false;\n  return reactNativeValue;\n}\n"
  },
  {
    "path": "src/intrinsics/fb-www/relay-mocks.js",
    "content": "/**\n * Copyright (c) 2017-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n/* @flow */\n\nimport type { Realm } from \"../../realm.js\";\nimport {\n  AbstractValue,\n  ECMAScriptSourceFunctionValue,\n  FunctionValue,\n  ObjectValue,\n  StringValue,\n} from \"../../values/index.js\";\nimport { Create, Environment } from \"../../singletons.js\";\nimport { createAbstract } from \"../prepack/utils.js\";\nimport { Get } from \"../../methods/index.js\";\nimport invariant from \"../../invariant.js\";\nimport { createReactHintObject } from \"../../react/utils.js\";\nimport { parseExpression } from \"@babel/parser\";\nimport { addMockFunctionToObject } from \"./utils.js\";\nimport { createOperationDescriptor } from \"../../utils/generator.js\";\n\nlet reactRelayCode = `\n  function createReactRelay(React) {\n\n   function mapObject(obj, func) {\n     var newObj = {};\n\n      Object.keys(obj).forEach(function(key) {\n        newObj[key] = func(obj[key]);\n      });\n\n      return newObj;\n   }\n\n    function isReactComponent(component) {\n      return !!(\n        component &&\n        typeof component.prototype === 'object' &&\n        component.prototype &&\n        component.prototype.isReactComponent\n      );\n    }\n\n    function getReactComponent(Component) {\n      if (isReactComponent(Component)) {\n        return Component;\n      } else {\n        return null;\n      }\n    }\n\n    function getComponentName(Component) {\n      let name;\n      const ComponentClass = getReactComponent(Component);\n      if (ComponentClass) {\n        name = ComponentClass.displayName || ComponentClass.name;\n      } else if (typeof Component === 'function') {\n        name = Component.displayName || Component.name || 'StatelessComponent';\n      } else {\n        name = 'ReactElement';\n      }\n      return String(name);\n    }\n\n    function createFragmentContainer(Component, fragmentSpec) {\n      var componentName = getComponentName(Component);\n      var containerName = \\`Relay(\\${componentName})\\`;\n\n      return function(props, context) {\n        var relay = context.relay;\n        var {\n          createFragmentSpecResolver,\n          getFragment: getFragmentFromTag,\n        } = relay.environment.unstable_internal;\n        var fragments = mapObject(fragmentSpec, getFragmentFromTag);\n        var resolver = createFragmentSpecResolver(\n          relay,\n          containerName,\n          fragments,\n          props,\n        );\n        var relayProp = {\n          isLoading: resolver.isLoading(),\n          environment: relay.environment,\n        };\n        var newProps = Object.assign({}, props, resolver.resolve(), {\n          relay: relayProp,\n        });\n        return React.createElement(Component, newProps);\n      };\n    }\n\n    return {\n      createFragmentContainer,\n    };\n  }\n`;\nlet reactRelayAst = parseExpression(reactRelayCode, { plugins: [\"flow\"] });\n\nfunction createReactRelayContainer(\n  realm: Realm,\n  reactRelay: ObjectValue,\n  containerName: string,\n  reactRelayFirstRenderValue: ObjectValue,\n  relayRequireName: string\n) {\n  // we create a ReactRelay container function that returns an abstract object\n  // allowing us to reconstruct this ReactReact.createSomeContainer(...) again\n  // we also pass a reactHint so the reconciler can properly deal with this\n  addMockFunctionToObject(realm, reactRelay, relayRequireName, containerName, (funcValue, args) => {\n    let value = AbstractValue.createTemporalFromBuildFunction(\n      realm,\n      FunctionValue,\n      [reactRelay, new StringValue(realm, containerName), ...args],\n      createOperationDescriptor(\"REACT_RELAY_MOCK_CONTAINER\"),\n      { skipInvariant: true, isPure: true }\n    );\n    invariant(value instanceof AbstractValue);\n    let firstRenderContainerValue = Get(realm, reactRelayFirstRenderValue, containerName);\n    let firstRenderValue = realm.intrinsics.undefined;\n\n    if (firstRenderContainerValue instanceof ECMAScriptSourceFunctionValue) {\n      let firstRenderContainerValueCall = firstRenderContainerValue.$Call;\n      invariant(firstRenderContainerValueCall !== undefined);\n      firstRenderValue = firstRenderContainerValueCall(realm.intrinsics.undefined, args);\n      invariant(firstRenderValue instanceof ECMAScriptSourceFunctionValue);\n    }\n\n    realm.react.abstractHints.set(value, createReactHintObject(reactRelay, containerName, args, firstRenderValue));\n    return value;\n  });\n}\n\nexport function createMockReactRelay(realm: Realm, relayRequireName: string): ObjectValue {\n  let reactRelayFirstRenderFactory = Environment.GetValue(realm, realm.$GlobalEnv.evaluate(reactRelayAst, false));\n  invariant(reactRelayFirstRenderFactory instanceof ECMAScriptSourceFunctionValue);\n  let factory = reactRelayFirstRenderFactory.$Call;\n  invariant(factory !== undefined);\n  invariant(realm.fbLibraries.react instanceof ObjectValue, \"mock ReactRelay cannot be required before mock React\");\n  let reactRelayFirstRenderValue = factory(realm.intrinsics.undefined, [realm.fbLibraries.react]);\n  invariant(reactRelayFirstRenderValue instanceof ObjectValue);\n\n  // we set refuseSerialization to true so we don't serialize the below properties straight away\n  let reactRelay = new ObjectValue(realm, realm.intrinsics.ObjectPrototype, `require(\"${relayRequireName}\")`, true);\n  // for QueryRenderer, we want to leave the component alone but process it's \"render\" prop\n  let queryRendererComponent = createAbstract(realm, \"function\", `require(\"${relayRequireName}\").QueryRenderer`);\n  Create.CreateDataPropertyOrThrow(realm, reactRelay, \"QueryRenderer\", queryRendererComponent);\n\n  let graphql = createAbstract(realm, \"function\", `require(\"${relayRequireName}\").graphql`);\n  Create.CreateDataPropertyOrThrow(realm, reactRelay, \"graphql\", graphql);\n\n  let reactRelayContainers = [\"createFragmentContainer\", \"createPaginationContainer\", \"createRefetchContainer\"];\n  for (let reactRelayContainer of reactRelayContainers) {\n    createReactRelayContainer(realm, reactRelay, reactRelayContainer, reactRelayFirstRenderValue, relayRequireName);\n  }\n\n  let commitLocalUpdate = createAbstract(realm, \"function\", `require(\"${relayRequireName}\").commitLocalUpdate`);\n  Create.CreateDataPropertyOrThrow(realm, reactRelay, \"commitLocalUpdate\", commitLocalUpdate);\n\n  let commitMutation = createAbstract(realm, \"function\", `require(\"${relayRequireName}\").commitMutation`);\n  Create.CreateDataPropertyOrThrow(realm, reactRelay, \"commitMutation\", commitMutation);\n\n  let fetchQuery = createAbstract(realm, \"function\", `require(\"${relayRequireName}\").fetchQuery`);\n  Create.CreateDataPropertyOrThrow(realm, reactRelay, \"fetchQuery\", fetchQuery);\n\n  let requestSubscription = createAbstract(realm, \"function\", `require(\"${relayRequireName}\").requestSubscription`);\n  Create.CreateDataPropertyOrThrow(realm, reactRelay, \"requestSubscription\", requestSubscription);\n\n  // we set refuseSerialization back to false\n  reactRelay.refuseSerialization = false;\n  reactRelay.makeFinal();\n  return reactRelay;\n}\n"
  },
  {
    "path": "src/intrinsics/fb-www/utils.js",
    "content": "/**\n * Copyright (c) 2017-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n/* @flow */\n\nimport type { Realm } from \"../../realm.js\";\nimport { ObjectValue, NativeFunctionValue, Value } from \"../../values/index.js\";\nimport { Get } from \"../../methods/index.js\";\nimport invariant from \"../../invariant.js\";\n\nexport function updateIntrinsicNames(\n  realm: Realm,\n  obj: ObjectValue,\n  requireName: string,\n  properties?: Array<string | { name: string, updatePrototype: boolean }>\n): void {\n  obj.intrinsicName = `require(\"${requireName}\")`;\n  if (properties) {\n    for (let property of properties) {\n      if (typeof property === \"string\") {\n        let val = Get(realm, obj, property);\n        invariant(val instanceof Value);\n        val.intrinsicName = `require(\"${requireName}\").${property}`;\n      } else if (typeof property === \"object\" && property !== null) {\n        let { name, updatePrototype } = property;\n\n        let val = Get(realm, obj, name);\n        invariant(val instanceof Value);\n        val.intrinsicName = `require(\"${requireName}\").${name}`;\n        if (updatePrototype) {\n          invariant(val instanceof ObjectValue);\n          let proto = Get(realm, val, \"prototype\");\n          proto.intrinsicName = `require(\"${requireName}\").${name}.prototype`;\n        }\n      }\n    }\n  }\n}\n\nexport function addMockFunctionToObject(\n  realm: Realm,\n  obj: ObjectValue,\n  requireName: string,\n  funcName: string,\n  func: (funcValue: NativeFunctionValue, args: Array<Value>) => Value\n): void {\n  let funcValue = new NativeFunctionValue(realm, undefined, funcName, 0, (context, args) => func(funcValue, args));\n\n  obj.defineNativeProperty(funcName, funcValue, {\n    writable: false,\n    enumerable: false,\n    configurable: true,\n  });\n  funcValue.intrinsicName = `require(\"${requireName}\").${funcName}`;\n}\n"
  },
  {
    "path": "src/intrinsics/index.js",
    "content": "/**\n * Copyright (c) 2017-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n/* @flow strict-local */\n\nimport { TypesDomain, ValuesDomain } from \"../domains/index.js\";\nimport type { Intrinsics } from \"../types.js\";\nimport type { Realm } from \"../realm.js\";\nimport {\n  AbstractValue,\n  BooleanValue,\n  EmptyValue,\n  NativeFunctionValue,\n  NullValue,\n  NumberValue,\n  ObjectValue,\n  StringValue,\n  SymbolValue,\n  UndefinedValue,\n  Value,\n} from \"../values/index.js\";\nimport { Functions } from \"../singletons.js\";\n\nimport initializeObject from \"./ecma262/Object.js\";\nimport initializeObjectPrototype from \"./ecma262/ObjectPrototype.js\";\n\nimport initializeError from \"./ecma262/Error.js\";\nimport initializeErrorPrototype from \"./ecma262/ErrorPrototype.js\";\n\nimport initializeTypeError from \"./ecma262/TypeError.js\";\nimport initializeTypeErrorPrototype from \"./ecma262/TypeErrorPrototype.js\";\n\nimport initializeRangeError from \"./ecma262/RangeError.js\";\nimport initializeRangeErrorPrototype from \"./ecma262/RangeErrorPrototype.js\";\n\nimport initializeReferenceError from \"./ecma262/ReferenceError.js\";\nimport initializeReferenceErrorPrototype from \"./ecma262/ReferenceErrorPrototype.js\";\n\nimport initializeSyntaxError from \"./ecma262/SyntaxError.js\";\nimport initializeSyntaxErrorPrototype from \"./ecma262/SyntaxErrorPrototype.js\";\n\nimport initializeURIError from \"./ecma262/URIError.js\";\nimport initializeURIErrorPrototype from \"./ecma262/URIErrorPrototype.js\";\n\nimport initializeEvalError from \"./ecma262/EvalError.js\";\nimport initializeEvalErrorPrototype from \"./ecma262/EvalErrorPrototype.js\";\n\nimport initializeFunction from \"./ecma262/Function.js\";\nimport initializeFunctionPrototype from \"./ecma262/FunctionPrototype.js\";\n\nimport initializeGenerator from \"./ecma262/Generator.js\";\nimport initializeGeneratorFunction from \"./ecma262/GeneratorFunction.js\";\nimport initializeGeneratorPrototype from \"./ecma262/GeneratorPrototype.js\";\n\nimport initializeArray from \"./ecma262/Array.js\";\nimport initializeArrayPrototype from \"./ecma262/ArrayPrototype.js\";\n\nimport initializeDate from \"./ecma262/Date.js\";\nimport initializeDatePrototype from \"./ecma262/DatePrototype.js\";\n\nimport initializeRegExp from \"./ecma262/RegExp.js\";\nimport initializeRegExpPrototype from \"./ecma262/RegExpPrototype.js\";\n\nimport initializeSymbol from \"./ecma262/Symbol.js\";\nimport initializeSymbolPrototype from \"./ecma262/SymbolPrototype.js\";\n\nimport initializeString from \"./ecma262/String.js\";\nimport initializeStringPrototype from \"./ecma262/StringPrototype.js\";\n\nimport initializeNumber from \"./ecma262/Number.js\";\nimport initializeNumberPrototype from \"./ecma262/NumberPrototype.js\";\n\nimport initializeBoolean from \"./ecma262/Boolean.js\";\nimport initializeBooleanPrototype from \"./ecma262/BooleanPrototype.js\";\n\nimport initializeDataView from \"./ecma262/DataView.js\";\nimport initializeDataViewPrototype from \"./ecma262/DataViewPrototype.js\";\n\nimport initializeTypedArray from \"./ecma262/TypedArray.js\";\nimport initializeTypedArrayPrototype from \"./ecma262/TypedArrayPrototype.js\";\n\nimport initializeFloat32Array from \"./ecma262/Float32Array.js\";\nimport initializeFloat32ArrayPrototype from \"./ecma262/Float32ArrayPrototype.js\";\n\nimport initializeFloat64Array from \"./ecma262/Float64Array.js\";\nimport initializeFloat64ArrayPrototype from \"./ecma262/Float64ArrayPrototype.js\";\n\nimport initializeInt8Array from \"./ecma262/Int8Array.js\";\nimport initializeInt8ArrayPrototype from \"./ecma262/Int8ArrayPrototype.js\";\n\nimport initializeInt16Array from \"./ecma262/Int16Array.js\";\nimport initializeInt16ArrayPrototype from \"./ecma262/Int16ArrayPrototype.js\";\n\nimport initializeInt32Array from \"./ecma262/Int32Array.js\";\nimport initializeInt32ArrayPrototype from \"./ecma262/Int32ArrayPrototype.js\";\n\nimport initializeMap from \"./ecma262/Map.js\";\nimport initializeMapPrototype from \"./ecma262/MapPrototype.js\";\n\nimport initializeWeakMap from \"./ecma262/WeakMap.js\";\nimport initializeWeakMapPrototype from \"./ecma262/WeakMapPrototype.js\";\n\nimport initializeSet from \"./ecma262/Set.js\";\nimport initializeSetPrototype from \"./ecma262/SetPrototype.js\";\n\nimport initializePromise from \"./ecma262/Promise.js\";\nimport initializePromisePrototype from \"./ecma262/PromisePrototype.js\";\n\nimport initializeUint8Array from \"./ecma262/Uint8Array.js\";\nimport initializeUint8ArrayPrototype from \"./ecma262/Uint8ArrayPrototype.js\";\n\nimport initializeUint8ClampedArray from \"./ecma262/Uint8ClampedArray.js\";\nimport initializeUint8ClampedArrayPrototype from \"./ecma262/Uint8ClampedArrayPrototype.js\";\n\nimport initializeUint16Array from \"./ecma262/Uint16Array.js\";\nimport initializeUint16ArrayPrototype from \"./ecma262/Uint16ArrayPrototype.js\";\n\nimport initializeUint32Array from \"./ecma262/Uint32Array.js\";\nimport initializeUint32ArrayPrototype from \"./ecma262/Uint32ArrayPrototype.js\";\n\nimport initializeWeakSet from \"./ecma262/WeakSet.js\";\nimport initializeWeakSetPrototype from \"./ecma262/WeakSetPrototype.js\";\n\nimport initializeArrayBuffer from \"./ecma262/ArrayBuffer.js\";\nimport initializeArrayBufferPrototype from \"./ecma262/ArrayBufferPrototype.js\";\n\nimport initializeJSON from \"./ecma262/JSON.js\";\nimport initializeReflect from \"./ecma262/Reflect.js\";\nimport initializeMath from \"./ecma262/Math.js\";\n\nimport initializeProxy from \"./ecma262/Proxy.js\";\n\nimport initializeParseInt from \"./ecma262/parseInt.js\";\nimport initializeParseFloat from \"./ecma262/parseFloat.js\";\nimport initializeIsFinite from \"./ecma262/isFinite.js\";\nimport initializeDecodeURI from \"./ecma262/decodeURI.js\";\nimport initializeDecodeURIComponent from \"./ecma262/decodeURIComponent.js\";\nimport initializeEncodeURI from \"./ecma262/encodeURI.js\";\nimport initializeEncodeURIComponent from \"./ecma262/encodeURIComponent.js\";\nimport initializeEval from \"./ecma262/eval.js\";\nimport initializeIsNaN from \"./ecma262/isNaN.js\";\n\nimport initializeArrayIteratorPrototype from \"./ecma262/ArrayIteratorPrototype.js\";\nimport initializeStringIteratorPrototype from \"./ecma262/StringIteratorPrototype.js\";\nimport initializeMapIteratorPrototype from \"./ecma262/MapIteratorPrototype.js\";\nimport initializeSetIteratorPrototype from \"./ecma262/SetIteratorPrototype.js\";\nimport initializeIteratorPrototype from \"./ecma262/IteratorPrototype.js\";\nimport initializeArrayProto_values from \"./ecma262/ArrayProto_values.js\";\nimport initializeArrayProto_toString from \"./ecma262/ArrayProto_toString.js\";\nimport initializeObjectProto_toString from \"./ecma262/ObjectProto_toString.js\";\nimport initializeTypedArrayProto_values from \"./ecma262/TypedArrayProto_values.js\";\nimport initializeThrowTypeError from \"./ecma262/ThrowTypeError.js\";\n\nimport initialize__IntrospectionError from \"./prepack/__IntrospectionError.js\";\nimport initialize__IntrospectionErrorPrototype from \"./prepack/__IntrospectionErrorPrototype.js\";\nimport { PropertyDescriptor } from \"../descriptors.js\";\n\nexport function initialize(i: Intrinsics, realm: Realm): Intrinsics {\n  i.undefined = new UndefinedValue(realm);\n  i.empty = new EmptyValue(realm);\n  i.null = new NullValue(realm);\n  i.false = new BooleanValue(realm, false);\n  i.true = new BooleanValue(realm, true);\n  i.NaN = new NumberValue(realm, NaN);\n  i.negativeInfinity = new NumberValue(realm, -Infinity);\n  i.Infinity = new NumberValue(realm, +Infinity);\n  i.negativeZero = new NumberValue(realm, -0);\n  i.zero = new NumberValue(realm, +0);\n  i.emptyString = new StringValue(realm, \"\");\n\n  //\n  i.ObjectPrototype = new ObjectValue(realm, i.ObjectPrototype, \"Object.prototype\");\n  i.FunctionPrototype = i.ObjectPrototype;\n  i.FunctionPrototype = new NativeFunctionValue(realm, \"Function.prototype\", \"\", 0, context => i.undefined, false);\n\n  i.parseFloat = initializeParseFloat(realm);\n  i.parseInt = initializeParseInt(realm);\n\n  i.SymbolPrototype = new ObjectValue(realm, i.ObjectPrototype, \"Symbol.prototype\");\n\n  // initialize common symbols\n  i.SymbolIsConcatSpreadable = new SymbolValue(\n    realm,\n    new StringValue(realm, \"Symbol.isConcatSpreadable\"),\n    \"Symbol.isConcatSpreadable\"\n  );\n  i.SymbolSpecies = new SymbolValue(realm, new StringValue(realm, \"Symbol.species\"), \"Symbol.species\");\n  i.SymbolReplace = new SymbolValue(realm, new StringValue(realm, \"Symbol.replace\"), \"Symbol.replace\");\n  i.SymbolIterator = new SymbolValue(realm, new StringValue(realm, \"Symbol.iterator\"), \"Symbol.iterator\");\n  i.SymbolHasInstance = new SymbolValue(realm, new StringValue(realm, \"Symbol.hasInstance\"), \"Symbol.hasInstance\");\n  i.SymbolToPrimitive = new SymbolValue(realm, new StringValue(realm, \"Symbol.toPrimitive\"), \"Symbol.toPrimitive\");\n  i.SymbolToStringTag = new SymbolValue(realm, new StringValue(realm, \"Symbol.toStringTag\"), \"Symbol.toStringTag\");\n  i.SymbolMatch = new SymbolValue(realm, new StringValue(realm, \"Symbol.match\"), \"Symbol.match\");\n  i.SymbolSplit = new SymbolValue(realm, new StringValue(realm, \"Symbol.split\"), \"Symbol.split\");\n  i.SymbolSearch = new SymbolValue(realm, new StringValue(realm, \"Symbol.search\"), \"Symbol.search\");\n  i.SymbolUnscopables = new SymbolValue(realm, new StringValue(realm, \"Symbol.unscopables\"), \"Symbol.unscopables\");\n\n  //\n  i.ArrayProto_values = initializeArrayProto_values(realm);\n  i.ArrayProto_toString = initializeArrayProto_toString(realm);\n\n  //\n  i.ObjectProto_toString = initializeObjectProto_toString(realm);\n\n  //\n  if (!realm.isCompatibleWith(realm.MOBILE_JSC_VERSION) && !realm.isCompatibleWith(\"mobile\"))\n    i.TypedArrayProto_values = initializeTypedArrayProto_values(realm);\n\n  //\n  i.ArrayPrototype = new ObjectValue(realm, i.ObjectPrototype, \"Array.prototype\");\n  i.RegExpPrototype = new ObjectValue(realm, i.ObjectPrototype, \"RegExp.prototype\");\n  i.DatePrototype = new ObjectValue(realm, i.ObjectPrototype, \"Date.prototype\");\n  i.StringPrototype = new ObjectValue(realm, i.ObjectPrototype, \"String.prototype\");\n  i.BooleanPrototype = new ObjectValue(realm, i.ObjectPrototype, \"Boolean.prototype\");\n  i.NumberPrototype = new ObjectValue(realm, i.ObjectPrototype, \"Number.prototype\");\n  i.DataViewPrototype = new ObjectValue(realm, i.ObjectPrototype, \"DataView.prototype\");\n  i.PromisePrototype = new ObjectValue(realm, i.ObjectPrototype, \"Promise.prototype\");\n  i.ArrayBufferPrototype = new ObjectValue(realm, i.ObjectPrototype, \"ArrayBuffer.prototype\");\n\n  // error prototypes\n  i.ErrorPrototype = new ObjectValue(realm, i.ObjectPrototype, \"Error.prototype\");\n  i.RangeErrorPrototype = new ObjectValue(realm, i.ErrorPrototype, \"RangeError.prototype\");\n  i.TypeErrorPrototype = new ObjectValue(realm, i.ErrorPrototype, \"TypeError.prototype\");\n  i.ReferenceErrorPrototype = new ObjectValue(realm, i.ErrorPrototype, \"ReferenceError.prototype\");\n  i.URIErrorPrototype = new ObjectValue(realm, i.ErrorPrototype, \"URIError.prototype\");\n  i.EvalErrorPrototype = new ObjectValue(realm, i.ErrorPrototype, \"EvalError.prototype\");\n  i.SyntaxErrorPrototype = new ObjectValue(realm, i.ErrorPrototype, \"SyntaxError.prototype\");\n  i.__IntrospectionErrorPrototype = new ObjectValue(realm, i.ErrorPrototype, \"__IntrospectionError.prototype\");\n\n  // collection prototypes\n  i.MapPrototype = new ObjectValue(realm, i.ObjectPrototype, \"Map.prototype\");\n  i.SetPrototype = new ObjectValue(realm, i.ObjectPrototype, \"Set.prototype\");\n  i.WeakMapPrototype = new ObjectValue(realm, i.ObjectPrototype, \"WeakMap.prototype\");\n  if (!realm.isCompatibleWith(realm.MOBILE_JSC_VERSION) && !realm.isCompatibleWith(\"mobile\")) {\n    i.WeakSetPrototype = new ObjectValue(realm, i.ObjectPrototype, \"WeakSet.prototype\");\n  }\n\n  // typed array prototypes\n  if (!realm.isCompatibleWith(realm.MOBILE_JSC_VERSION) && !realm.isCompatibleWith(\"mobile\"))\n    i.TypedArrayPrototype = new ObjectValue(\n      realm,\n      i.ObjectPrototype,\n      \"TypedArray.prototype\",\n      /* refuseSerialization */ true\n    );\n  i.Float32ArrayPrototype = new ObjectValue(realm, i.ObjectPrototype, \"Float32Array.prototype\");\n  i.Float64ArrayPrototype = new ObjectValue(realm, i.ObjectPrototype, \"Float64Array.prototype\");\n  i.Int8ArrayPrototype = new ObjectValue(realm, i.ObjectPrototype, \"Int8Array.prototype\");\n  i.Int16ArrayPrototype = new ObjectValue(realm, i.ObjectPrototype, \"Int16Array.prototype\");\n  i.Int32ArrayPrototype = new ObjectValue(realm, i.ObjectPrototype, \"Int32Array.prototype\");\n  i.Uint8ArrayPrototype = new ObjectValue(realm, i.ObjectPrototype, \"Uint8Array.prototype\");\n  i.Uint8ClampedArrayPrototype = new ObjectValue(realm, i.ObjectPrototype, \"Uint8ClampedArray.prototype\");\n  i.Uint16ArrayPrototype = new ObjectValue(realm, i.ObjectPrototype, \"Uint16Array.prototype\");\n  i.Uint32ArrayPrototype = new ObjectValue(realm, i.ObjectPrototype, \"Uint32Array.prototype\");\n\n  // iterator prototypes\n  i.IteratorPrototype = new ObjectValue(realm, i.ObjectPrototype, \"([][Symbol.iterator]().__proto__.__proto__)\");\n  i.MapIteratorPrototype = new ObjectValue(realm, i.IteratorPrototype, \"(new Map()[Symbol.iterator]().__proto__)\");\n  i.SetIteratorPrototype = new ObjectValue(realm, i.IteratorPrototype, \"(new Set()[Symbol.iterator]().__proto__)\");\n  i.ArrayIteratorPrototype = new ObjectValue(realm, i.IteratorPrototype, \"([][Symbol.iterator]().__proto__)\");\n  i.StringIteratorPrototype = new ObjectValue(realm, i.IteratorPrototype, '(\"\"[Symbol.iterator]().__proto__)');\n\n  //\n  initializeObjectPrototype(realm, i.ObjectPrototype);\n  initializeFunctionPrototype(realm, i.FunctionPrototype);\n  initializeArrayPrototype(realm, i.ArrayPrototype);\n  initializeDatePrototype(realm, i.DatePrototype);\n  initializeRegExpPrototype(realm, i.RegExpPrototype);\n  initializeStringPrototype(realm, i.StringPrototype);\n  initializeBooleanPrototype(realm, i.BooleanPrototype);\n  initializeNumberPrototype(realm, i.NumberPrototype);\n  initializeSymbolPrototype(realm, i.SymbolPrototype);\n  initializeErrorPrototype(realm, i.ErrorPrototype);\n  initializeTypeErrorPrototype(realm, i.TypeErrorPrototype);\n  initializeRangeErrorPrototype(realm, i.RangeErrorPrototype);\n  initializeReferenceErrorPrototype(realm, i.ReferenceErrorPrototype);\n  initializeURIErrorPrototype(realm, i.URIErrorPrototype);\n  initializeEvalErrorPrototype(realm, i.EvalErrorPrototype);\n  initializeSyntaxErrorPrototype(realm, i.SyntaxErrorPrototype);\n  initialize__IntrospectionErrorPrototype(realm, i.__IntrospectionErrorPrototype);\n  initializeDataViewPrototype(realm, i.DataViewPrototype);\n  initializeWeakMapPrototype(realm, i.WeakMapPrototype);\n  if (!realm.isCompatibleWith(realm.MOBILE_JSC_VERSION) && !realm.isCompatibleWith(\"mobile\")) {\n    initializeTypedArrayPrototype(realm, i.TypedArrayPrototype);\n    initializeWeakSetPrototype(realm, i.WeakSetPrototype);\n  }\n  initializeFloat32ArrayPrototype(realm, i.Float32ArrayPrototype);\n  initializeFloat64ArrayPrototype(realm, i.Float64ArrayPrototype);\n  initializeInt8ArrayPrototype(realm, i.Int8ArrayPrototype);\n  initializeInt16ArrayPrototype(realm, i.Int16ArrayPrototype);\n  initializeInt32ArrayPrototype(realm, i.Int32ArrayPrototype);\n  initializeMapPrototype(realm, i.MapPrototype);\n  initializeSetPrototype(realm, i.SetPrototype);\n  initializePromisePrototype(realm, i.PromisePrototype);\n  initializeUint8ArrayPrototype(realm, i.Uint8ArrayPrototype);\n  initializeUint8ClampedArrayPrototype(realm, i.Uint8ClampedArrayPrototype);\n  initializeUint16ArrayPrototype(realm, i.Uint16ArrayPrototype);\n  initializeUint32ArrayPrototype(realm, i.Uint32ArrayPrototype);\n  initializeArrayBufferPrototype(realm, i.ArrayBufferPrototype);\n\n  // iterator prototypes\n  initializeIteratorPrototype(realm, i.IteratorPrototype);\n  initializeArrayIteratorPrototype(realm, i.ArrayIteratorPrototype);\n  initializeStringIteratorPrototype(realm, i.StringIteratorPrototype);\n  initializeMapIteratorPrototype(realm, i.MapIteratorPrototype);\n  initializeSetIteratorPrototype(realm, i.SetIteratorPrototype);\n\n  //\n  i.Object = initializeObject(realm);\n  i.Function = initializeFunction(realm);\n  i.Array = initializeArray(realm);\n  i.RegExp = initializeRegExp(realm);\n  i.Date = initializeDate(realm);\n  i.String = initializeString(realm);\n  i.Math = initializeMath(realm);\n  i.Boolean = initializeBoolean(realm);\n  i.Number = initializeNumber(realm);\n  i.Symbol = initializeSymbol(realm);\n  i.JSON = initializeJSON(realm);\n  i.Proxy = initializeProxy(realm);\n  if (!realm.isCompatibleWith(realm.MOBILE_JSC_VERSION) && !realm.isCompatibleWith(\"mobile\"))\n    i.Reflect = initializeReflect(realm);\n  i.Promise = initializePromise(realm);\n  i.DataView = initializeDataView(realm);\n\n  // collections\n  i.Set = initializeSet(realm);\n  i.Map = initializeMap(realm);\n  i.WeakMap = initializeWeakMap(realm);\n  if (!realm.isCompatibleWith(realm.MOBILE_JSC_VERSION) && !realm.isCompatibleWith(\"mobile\")) {\n    i.WeakSet = initializeWeakSet(realm);\n  }\n  i.ArrayBuffer = initializeArrayBuffer(realm);\n\n  // typed arrays\n  if (!realm.isCompatibleWith(realm.MOBILE_JSC_VERSION) && !realm.isCompatibleWith(\"mobile\"))\n    i.TypedArray = initializeTypedArray(realm);\n  i.Float32Array = initializeFloat32Array(realm);\n  i.Float64Array = initializeFloat64Array(realm);\n  i.Int8Array = initializeInt8Array(realm);\n  i.Int16Array = initializeInt16Array(realm);\n  i.Int32Array = initializeInt32Array(realm);\n  i.Uint8Array = initializeUint8Array(realm);\n  i.Uint8ClampedArray = initializeUint8ClampedArray(realm);\n  i.Uint16Array = initializeUint16Array(realm);\n  i.Uint32Array = initializeUint32Array(realm);\n\n  //\n  i.Error = initializeError(realm);\n  i.TypeError = initializeTypeError(realm);\n  i.RangeError = initializeRangeError(realm);\n  i.ReferenceError = initializeReferenceError(realm);\n  i.URIError = initializeURIError(realm);\n  i.EvalError = initializeEvalError(realm);\n  i.SyntaxError = initializeSyntaxError(realm);\n  i.__IntrospectionError = initialize__IntrospectionError(realm);\n\n  //\n  let builtins = [\n    \"Object\",\n    \"Function\",\n    \"Symbol\",\n    \"String\",\n    \"Array\",\n    \"Boolean\",\n    \"RegExp\",\n    \"Date\",\n    \"Error\",\n    \"Number\",\n    \"TypeError\",\n    \"RangeError\",\n    \"ReferenceError\",\n    \"SyntaxError\",\n    \"URIError\",\n    \"EvalError\",\n    \"DataView\",\n    \"Float32Array\",\n    \"Float64Array\",\n    \"Int8Array\",\n    \"Int16Array\",\n    \"Int32Array\",\n    \"Map\",\n    \"Set\",\n    \"WeakMap\",\n    \"Promise\",\n    \"Uint8Array\",\n    \"Uint8ClampedArray\",\n    \"Uint16Array\",\n    \"Uint32Array\",\n    \"ArrayBuffer\",\n  ];\n  if (!realm.isCompatibleWith(realm.MOBILE_JSC_VERSION) && !realm.isCompatibleWith(\"mobile\")) {\n    builtins = builtins.concat([\"WeakSet\", \"TypedArray\"]);\n  }\n\n  for (let name of builtins) {\n    let fn = i[name];\n    let proto = i[`${name}Prototype`];\n\n    proto.$DefineOwnProperty(\n      \"constructor\",\n      new PropertyDescriptor({\n        value: fn,\n        writable: true,\n        enumerable: false,\n        configurable: true,\n      })\n    );\n\n    fn.$DefineOwnProperty(\n      \"prototype\",\n      new PropertyDescriptor({\n        value: proto,\n        writable: false,\n        enumerable: false,\n        configurable: false,\n      })\n    );\n\n    fn.$DefineOwnProperty(\n      \"constructor\",\n      new PropertyDescriptor({\n        value: i.Function,\n        writable: true,\n        enumerable: false,\n        configurable: true,\n      })\n    );\n  }\n\n  //\n  i.GeneratorPrototype = new ObjectValue(realm, i.FunctionPrototype, \"Generator.prototype\");\n  initializeGeneratorPrototype(realm, i.GeneratorPrototype);\n  i.Generator = new ObjectValue(realm, i.FunctionPrototype, \"Generator\");\n  initializeGenerator(realm, i.Generator);\n  i.GeneratorFunction = initializeGeneratorFunction(realm);\n\n  i.Generator.$DefineOwnProperty(\n    \"prototype\",\n    new PropertyDescriptor({\n      value: i.GeneratorPrototype,\n      writable: false,\n      enumerable: false,\n      configurable: true,\n    })\n  );\n  i.GeneratorPrototype.$DefineOwnProperty(\n    \"constructor\",\n    new PropertyDescriptor({\n      value: i.Generator,\n      writable: false,\n      enumerable: false,\n      configurable: true,\n    })\n  );\n\n  i.GeneratorFunction.$DefineOwnProperty(\n    \"prototype\",\n    new PropertyDescriptor({\n      value: i.Generator,\n      writable: false,\n      enumerable: false,\n      configurable: false,\n    })\n  );\n  i.Generator.$DefineOwnProperty(\n    \"constructor\",\n    new PropertyDescriptor({\n      value: i.GeneratorFunction,\n      writable: false,\n      enumerable: false,\n      configurable: true,\n    })\n  );\n\n  //\n  i.isNaN = initializeIsNaN(realm);\n  i.isFinite = initializeIsFinite(realm);\n  i.decodeURI = initializeDecodeURI(realm);\n  i.decodeURIComponent = initializeDecodeURIComponent(realm);\n  i.encodeURI = initializeEncodeURI(realm);\n  i.encodeURIComponent = initializeEncodeURIComponent(realm);\n  i.ThrowTypeError = initializeThrowTypeError(realm);\n  i.eval = initializeEval(realm);\n\n  // 8.2.2, step 12\n  Functions.AddRestrictedFunctionProperties(i.FunctionPrototype, realm);\n\n  //\n  if (realm.useAbstractInterpretation) {\n    TypesDomain.topVal = new TypesDomain(undefined);\n    ValuesDomain.topVal = new ValuesDomain(undefined);\n    i.__topValue = new AbstractValue(realm, TypesDomain.topVal, ValuesDomain.topVal, Number.MAX_SAFE_INTEGER, []);\n    TypesDomain.bottomVal = new TypesDomain(EmptyValue);\n    ValuesDomain.bottomVal = new ValuesDomain(new Set());\n    i.__bottomValue = new AbstractValue(\n      realm,\n      TypesDomain.bottomVal,\n      ValuesDomain.bottomVal,\n      Number.MIN_SAFE_INTEGER,\n      []\n    );\n    i.__leakedValue = AbstractValue.createFromType(realm, Value, \"leaked binding value\", []);\n  }\n\n  return i;\n}\n"
  },
  {
    "path": "src/intrinsics/prepack/__IntrospectionError.js",
    "content": "/**\n * Copyright (c) 2017-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n/* @flow strict-local */\n\nimport type { Realm } from \"../../realm.js\";\nimport type { NativeFunctionValue } from \"../../values/index.js\";\nimport { build } from \"../ecma262/Error.js\";\n\nexport default function(realm: Realm): NativeFunctionValue {\n  return build(\"__IntrospectionError\", realm, false);\n}\n"
  },
  {
    "path": "src/intrinsics/prepack/__IntrospectionErrorPrototype.js",
    "content": "/**\n * Copyright (c) 2017-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n/* @flow strict-local */\n\nimport type { Realm } from \"../../realm.js\";\nimport { ObjectValue, StringValue } from \"../../values/index.js\";\n\nexport default function(realm: Realm, obj: ObjectValue): void {\n  obj.defineNativeProperty(\"name\", new StringValue(realm, \"__IntrospectionError\"));\n  obj.defineNativeProperty(\"message\", realm.intrinsics.emptyString);\n}\n"
  },
  {
    "path": "src/intrinsics/prepack/global.js",
    "content": "/**\n * Copyright (c) 2017-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n/* @flow */\n\nimport type { Realm } from \"../../realm.js\";\nimport {\n  AbstractObjectValue,\n  AbstractValue,\n  BooleanValue,\n  BoundFunctionValue,\n  ConcreteValue,\n  ECMAScriptSourceFunctionValue,\n  FunctionValue,\n  IntegralValue,\n  NativeFunctionValue,\n  ObjectValue,\n  StringValue,\n  Value,\n} from \"../../values/index.js\";\nimport { To, Path } from \"../../singletons.js\";\nimport { IsCallable } from \"../../methods/index.js\";\nimport { ValuesDomain } from \"../../domains/index.js\";\nimport invariant from \"../../invariant.js\";\nimport { createAbstract, parseTypeNameOrTemplate } from \"./utils.js\";\nimport { describeValue } from \"../../utils.js\";\nimport { valueIsKnownReactAbstraction } from \"../../react/utils.js\";\nimport { CompilerDiagnostic, FatalError } from \"../../errors.js\";\nimport * as t from \"@babel/types\";\nimport { createOperationDescriptor, type OperationDescriptor } from \"../../utils/generator.js\";\nimport { createAndValidateArgModel } from \"../../utils/ShapeInformation\";\nimport { PropertyDescriptor } from \"../../descriptors.js\";\n\nexport function createAbstractFunction(realm: Realm, ...additionalValues: Array<ConcreteValue>): NativeFunctionValue {\n  return new NativeFunctionValue(\n    realm,\n    \"global.__abstract\",\n    \"__abstract\",\n    0,\n    (context, [typeNameOrTemplate, _name, options]) => {\n      let name = _name;\n      if (name instanceof StringValue) name = name.value;\n      if (name !== undefined && typeof name !== \"string\") {\n        throw realm.createErrorThrowCompletion(realm.intrinsics.TypeError, \"intrinsic name argument is not a string\");\n      }\n      if (options && !(options instanceof ObjectValue)) {\n        throw realm.createErrorThrowCompletion(\n          realm.intrinsics.TypeError,\n          \"options must be an ObjectValue if provided\"\n        );\n      }\n      return createAbstract(realm, typeNameOrTemplate, name, options, ...additionalValues);\n    }\n  );\n}\n\nexport default function(realm: Realm): void {\n  let global = realm.$GlobalObject;\n\n  global.$DefineOwnProperty(\n    \"__dump\",\n    new PropertyDescriptor({\n      value: new NativeFunctionValue(realm, \"global.__dump\", \"__dump\", 0, (context, args) => {\n        console.log(\"dump\", args.map(arg => arg.serialize()));\n        return context;\n      }),\n      writable: true,\n      enumerable: false,\n      configurable: true,\n    })\n  );\n\n  // Helper function to model values that are obtained from the environment,\n  // and whose concrete values are not known at Prepack-time.\n  // __abstract(typeNameOrTemplate, name, options) creates a new abstract value\n  // where typeNameOrTemplate can be...\n  // - 'string', 'boolean', 'number', 'object', 'function' or\n  // - ':string', ':boolean', ':number', ':object', ':function' to indicate that\n  //   the abstract value represents a function that only returns values of the specified type, or\n  // - an actual object defining known properties.\n  // options is an optional object that may contain:\n  // - allowDuplicateNames: boolean representing whether the name of the abstract value may be\n  //   repeated, by default they must be unique\n  // - disablePlaceholders: boolean representing whether placeholders should be substituted in\n  //   the abstract value's name.\n  // If the abstract value gets somehow embedded in the final heap,\n  // it will be referred to by the supplied name in the generated code.\n  global.$DefineOwnProperty(\n    \"__abstract\",\n    new PropertyDescriptor({\n      value: createAbstractFunction(realm),\n      writable: true,\n      enumerable: false,\n      configurable: true,\n    })\n  );\n\n  global.$DefineOwnProperty(\n    \"__abstractOrNull\",\n    new PropertyDescriptor({\n      value: createAbstractFunction(realm, realm.intrinsics.null),\n      writable: true,\n      enumerable: false,\n      configurable: true,\n    })\n  );\n\n  global.$DefineOwnProperty(\n    \"__abstractOrNullOrUndefined\",\n    new PropertyDescriptor({\n      value: createAbstractFunction(realm, realm.intrinsics.null, realm.intrinsics.undefined),\n      writable: true,\n      enumerable: false,\n      configurable: true,\n    })\n  );\n\n  global.$DefineOwnProperty(\n    \"__abstractOrUndefined\",\n    new PropertyDescriptor({\n      value: createAbstractFunction(realm, realm.intrinsics.undefined),\n      writable: true,\n      enumerable: false,\n      configurable: true,\n    })\n  );\n\n  // Allows dynamically registering optimized functions.\n  // WARNING: these functions will get exposed at global scope and called there.\n  // NB: If we interpret one of these calls in an evaluateForEffects context\n  //     that is not subsequently applied, the function will not be registered\n  //     (because prepack won't have a correct value for the FunctionValue itself)\n  // If we encounter an invalid input, we will emit a warning and not optimize the function\n  global.$DefineOwnProperty(\n    \"__optimize\",\n    new PropertyDescriptor({\n      value: new NativeFunctionValue(\n        realm,\n        \"global.__optimize\",\n        \"__optimize\",\n        1,\n        (context, [value, argModelString]) => {\n          let argModel;\n          if (argModelString !== undefined) {\n            argModel = createAndValidateArgModel(realm, argModelString);\n          }\n          if (value instanceof ECMAScriptSourceFunctionValue || value instanceof AbstractValue) {\n            let currentArgModel = realm.optimizedFunctions.get(value);\n            // Verify that if there is an existing argModel, that it is the same as the new one.\n            if (currentArgModel) {\n              let currentString = argModelString instanceof StringValue ? argModelString.value : argModelString;\n              if (JSON.stringify(currentArgModel) !== currentString) {\n                let argModelError = new CompilerDiagnostic(\n                  \"__optimize called twice with different argModelStrings\",\n                  realm.currentLocation,\n                  \"PP1008\",\n                  \"Warning\"\n                );\n                if (realm.handleError(argModelError) !== \"Recover\") throw new FatalError();\n                else return realm.intrinsics.undefined;\n              }\n            }\n            realm.optimizedFunctions.set(value, argModel);\n          } else {\n            let location = value.expressionLocation\n              ? `${value.expressionLocation.start.line}:${value.expressionLocation.start.column} ` +\n                `${value.expressionLocation.end.line}:${value.expressionLocation.end.line}`\n              : \"location unknown\";\n            let result = realm.handleError(\n              new CompilerDiagnostic(\n                `Optimized Function Value ${location} is an not a function or react element`,\n                realm.currentLocation,\n                \"PP0033\",\n                \"Warning\"\n              )\n            );\n            if (result !== \"Recover\") throw new FatalError();\n            else return realm.intrinsics.undefined;\n          }\n          return value;\n        }\n      ),\n      writable: true,\n      enumerable: false,\n      configurable: true,\n    })\n  );\n\n  if (realm.react.enabled) {\n    global.$DefineOwnProperty(\n      \"__reactComponentTrees\",\n      new PropertyDescriptor({\n        value: new ObjectValue(\n          realm,\n          realm.intrinsics.ObjectPrototype,\n          \"__reactComponentTrees\",\n          /* refuseSerialization */ true\n        ),\n        writable: true,\n        enumerable: false,\n        configurable: true,\n      })\n    );\n    let reactComponentRootUid = 0;\n    global.$DefineOwnProperty(\n      \"__optimizeReactComponentTree\",\n      new PropertyDescriptor({\n        value: new NativeFunctionValue(\n          realm,\n          \"global.__optimizeReactComponentTree\",\n          \"__optimizeReactComponentTree\",\n          0,\n          (context, [component, config]) => {\n            let hasValidComponent =\n              component instanceof ECMAScriptSourceFunctionValue ||\n              component instanceof BoundFunctionValue ||\n              valueIsKnownReactAbstraction(realm, component);\n            let hasValidConfig =\n              config instanceof ObjectValue || config === realm.intrinsics.undefined || config === undefined;\n\n            if (!hasValidComponent || !hasValidConfig) {\n              let diagnostic = new CompilerDiagnostic(\n                \"__optimizeReactComponentTree(rootComponent, config) has been called with invalid arguments\",\n                realm.currentLocation,\n                \"PP0024\",\n                \"FatalError\"\n              );\n              realm.handleError(diagnostic);\n              if (realm.handleError(diagnostic) === \"Fail\") throw new FatalError();\n            }\n            let reactComponentTree = new ObjectValue(realm, realm.intrinsics.ObjectPrototype);\n            reactComponentTree.$Set(\"rootComponent\", component, reactComponentTree);\n            reactComponentTree.$Set(\"config\", config || realm.intrinsics.undefined, reactComponentTree);\n\n            realm.assignToGlobal(\n              t.memberExpression(\n                t.memberExpression(t.identifier(\"global\"), t.identifier(\"__reactComponentTrees\")),\n                t.identifier(\"\" + reactComponentRootUid++)\n              ),\n              reactComponentTree\n            );\n            return component;\n          }\n        ),\n        writable: true,\n        enumerable: false,\n        configurable: true,\n      })\n    );\n  }\n\n  global.$DefineOwnProperty(\n    \"__evaluatePureFunction\",\n    new PropertyDescriptor({\n      value: new NativeFunctionValue(\n        realm,\n        \"global.__evaluatePureFunction\",\n        \"__evaluatePureFunction\",\n        0,\n        (context, [functionValue]) => {\n          invariant(!realm.isInPureScope(), \"__evaluatePureFunction cannot be nested in another pure scope\");\n          invariant(functionValue instanceof ECMAScriptSourceFunctionValue);\n          invariant(typeof functionValue.$Call === \"function\");\n          let functionCall: Function = functionValue.$Call;\n          return realm.evaluateWithPureScope(() => functionCall(realm.intrinsics.undefined, []));\n        }\n      ),\n      writable: true,\n      enumerable: false,\n      configurable: true,\n    })\n  );\n\n  // Maps from initialized moduleId to exports object\n  // NB: Changes to this shouldn't ever be serialized\n  global.$DefineOwnProperty(\n    \"__initializedModules\",\n    new PropertyDescriptor({\n      value: new ObjectValue(\n        realm,\n        realm.intrinsics.ObjectPrototype,\n        \"__initializedModules\",\n        /* refuseSerialization */ true\n      ),\n      writable: true,\n      enumerable: false,\n      configurable: true,\n    })\n  );\n\n  // Set of property bindings whose invariant got checked\n  // NB: Changes to this shouldn't ever be serialized\n  global.$DefineOwnProperty(\n    \"__checkedBindings\",\n    new PropertyDescriptor({\n      value: new ObjectValue(\n        realm,\n        realm.intrinsics.ObjectPrototype,\n        \"__checkedBindings\",\n        /* refuseSerialization */ true\n      ),\n      writable: true,\n      enumerable: false,\n      configurable: true,\n    })\n  );\n\n  // Helper function used to instantiate a residual function\n  function createNativeFunctionForResidualCall(unsafe: boolean): NativeFunctionValue {\n    return new NativeFunctionValue(\n      realm,\n      \"global.__residual\",\n      \"__residual\",\n      2,\n      (context, [typeNameOrTemplate, f, ...args]) => {\n        if (!realm.useAbstractInterpretation) {\n          throw realm.createErrorThrowCompletion(realm.intrinsics.TypeError, \"realm is not partial\");\n        }\n\n        let { type, template } = parseTypeNameOrTemplate(realm, typeNameOrTemplate);\n\n        if (!Value.isTypeCompatibleWith(f.constructor, FunctionValue)) {\n          throw realm.createErrorThrowCompletion(realm.intrinsics.TypeError, \"cannot determine residual function\");\n        }\n        invariant(f instanceof FunctionValue);\n        f.isResidual = true;\n        if (unsafe) f.isUnsafeResidual = true;\n        let result = AbstractValue.createTemporalFromBuildFunction(\n          realm,\n          type,\n          [f].concat(args),\n          createOperationDescriptor(\"RESIDUAL_CALL\")\n        );\n        if (template) {\n          invariant(\n            result instanceof AbstractValue,\n            \"the nested properties should only be rebuilt for an abstract value\"\n          );\n          template.makePartial();\n          result.values = new ValuesDomain(new Set([template]));\n          invariant(realm.generator);\n          realm.rebuildNestedProperties(result, result.getIdentifier());\n        }\n        return result;\n      }\n    );\n  }\n\n  function createNativeFunctionForResidualInjection(\n    name: string,\n    initializeAndValidateArgs: (Array<Value>) => void,\n    operationDescriptor: OperationDescriptor,\n    numArgs: number\n  ): NativeFunctionValue {\n    return new NativeFunctionValue(realm, \"global.\" + name, name, numArgs, (context, ciArgs) => {\n      initializeAndValidateArgs(ciArgs);\n      invariant(realm.generator !== undefined);\n      realm.generator.emitStatement(ciArgs, operationDescriptor);\n      return realm.intrinsics.undefined;\n    });\n  }\n\n  // Helper function that specifies a dynamic invariant that cannot be evaluated at prepack time, and needs code to\n  // be injected into the serialized output.\n  global.$DefineOwnProperty(\n    \"__assume\",\n    new PropertyDescriptor({\n      value: createNativeFunctionForResidualInjection(\n        \"__assume\",\n        ([c, s]): void => {\n          if (!c.mightBeTrue()) {\n            let error = new CompilerDiagnostic(\n              `Assumed condition cannot hold`,\n              realm.currentLocation,\n              \"PP0040\",\n              \"FatalError\"\n            );\n            realm.handleError(error);\n            throw new FatalError();\n          }\n          Path.pushAndRefine(c);\n        },\n        createOperationDescriptor(\"ASSUME_CALL\"),\n        2\n      ),\n      writable: true,\n      enumerable: false,\n      configurable: true,\n    })\n  );\n\n  // Helper function for Prepack developers inspect a value\n  // when interpreting a particular node in the AST.\n  global.$DefineOwnProperty(\n    \"__debugValue\",\n    new PropertyDescriptor({\n      value: createNativeFunctionForResidualInjection(\n        \"__debugValue\",\n        ([v, s]): void => {\n          debugger; // eslint-disable-line no-debugger\n        },\n        createOperationDescriptor(\"NOOP\"),\n        2\n      ),\n      writable: true,\n      enumerable: false,\n      configurable: true,\n    })\n  );\n\n  // Helper function that identifies a computation that must remain part of the residual program and cannot be partially evaluated,\n  // e.g. because it contains a loop over abstract values.\n  // __residual(typeNameOrTemplate, function, arg0, arg1, ...) creates a new abstract value\n  // that is computed by invoking function(arg0, arg1, ...) in the residual program and\n  // where typeNameOrTemplate either either 'string', 'boolean', 'number', 'object', or an actual object defining known properties.\n  // The function must not have side effects, and it must not access any state (besides the supplied arguments).\n  global.$DefineOwnProperty(\n    \"__residual\",\n    new PropertyDescriptor({\n      value: createNativeFunctionForResidualCall(false),\n      writable: true,\n      enumerable: false,\n      configurable: true,\n    })\n  );\n\n  // Helper function that identifies a variant of the residual function that has implicit dependencies. This version of residual will infer the dependencies\n  // and rewrite the function body to do the same thing as the original residual function.\n  global.$DefineOwnProperty(\n    \"__residual_unsafe\",\n    new PropertyDescriptor({\n      value: createNativeFunctionForResidualCall(true),\n      writable: true,\n      enumerable: false,\n      configurable: true,\n    })\n  );\n\n  // Internal helper function for tests.\n  // __isAbstract(value) checks if a given value is abstract.\n  global.$DefineOwnProperty(\n    \"__isAbstract\",\n    new PropertyDescriptor({\n      value: new NativeFunctionValue(realm, \"global.__isAbstract\", \"__isAbstract\", 1, (context, [value]) => {\n        return new BooleanValue(realm, value instanceof AbstractValue);\n      }),\n      writable: true,\n      enumerable: false,\n      configurable: true,\n    })\n  );\n\n  // __makePartial(object) marks an (abstract) object as partial.\n  global.$DefineOwnProperty(\n    \"__makePartial\",\n    new PropertyDescriptor({\n      value: new NativeFunctionValue(realm, \"global.__makePartial\", \"__makePartial\", 1, (context, [object]) => {\n        if (object instanceof AbstractObjectValue || object instanceof ObjectValue) {\n          object.makePartial();\n          return object;\n        }\n        throw realm.createErrorThrowCompletion(realm.intrinsics.TypeError, \"not an (abstract) object\");\n      }),\n      writable: true,\n      enumerable: false,\n      configurable: true,\n    })\n  );\n\n  global.$DefineOwnProperty(\n    \"__makeFinal\",\n    new PropertyDescriptor({\n      value: new NativeFunctionValue(realm, \"global.__makeFinal\", \"__makeFinal\", 1, (context, [object]) => {\n        if (object instanceof ObjectValue || (object instanceof AbstractObjectValue && !object.values.isTop())) {\n          object.makeFinal();\n          return object;\n        }\n        throw realm.createErrorThrowCompletion(\n          realm.intrinsics.TypeError,\n          \"not an object or abstract object value (non-top)\"\n        );\n      }),\n      writable: true,\n      enumerable: false,\n      configurable: true,\n    })\n  );\n\n  // __makeSimple(object) marks an (abstract) object as one that has no getters or setters.\n  global.$DefineOwnProperty(\n    \"__makeSimple\",\n    new PropertyDescriptor({\n      value: new NativeFunctionValue(realm, \"global.__makeSimple\", \"__makeSimple\", 1, (context, [object, option]) => {\n        if (object instanceof AbstractObjectValue || object instanceof ObjectValue) {\n          object.makeSimple(option);\n          return object;\n        }\n        throw realm.createErrorThrowCompletion(realm.intrinsics.TypeError, \"not an (abstract) object\");\n      }),\n      writable: true,\n      enumerable: false,\n      configurable: true,\n    })\n  );\n\n  // Helper function that emits a check whether a given object property has a particular value.\n  global.$DefineOwnProperty(\n    \"__assumeDataProperty\",\n    new PropertyDescriptor({\n      value: new NativeFunctionValue(\n        realm,\n        \"global.__assumeDataProperty\",\n        \"__assumeDataProperty\",\n        3,\n        (context, [object, propertyName, value, invariantOptions]) => {\n          if (!realm.useAbstractInterpretation) {\n            throw realm.createErrorThrowCompletion(realm.intrinsics.TypeError, \"realm is not partial\");\n          }\n\n          if (object instanceof AbstractObjectValue || object instanceof ObjectValue) {\n            let generator = realm.generator;\n            invariant(generator);\n\n            let key = To.ToStringPartial(realm, propertyName);\n\n            if (realm.emitConcreteModel) {\n              generator.emitConcreteModel(key, value);\n            } else if (realm.invariantLevel >= 1) {\n              let invariantOptionString = invariantOptions\n                ? To.ToStringPartial(realm, invariantOptions)\n                : \"FULL_INVARIANT\";\n              switch (invariantOptionString) {\n                // checks (!property in object || object.property === undefined)\n                case \"VALUE_DEFINED_INVARIANT\":\n                  generator.emitPropertyInvariant(object, key, value.mightBeUndefined() ? \"PRESENT\" : \"DEFINED\");\n                  break;\n                case \"SKIP_INVARIANT\":\n                  break;\n                case \"FULL_INVARIANT\":\n                  generator.emitFullInvariant((object: any), key, value);\n                  break;\n                default:\n                  invariant(false, \"Invalid invariantOption \" + invariantOptionString);\n              }\n              if (!realm.neverCheckProperty(object, key)) realm.markPropertyAsChecked(object, key);\n            }\n            realm.generator = undefined; // don't emit code during the following $Set call\n            // casting to due to Flow workaround above\n            (object: any).$Set(key, value, object);\n            realm.generator = generator;\n            if (object.intrinsicName) realm.rebuildObjectProperty(object, key, value, object.intrinsicName);\n            return context.$Realm.intrinsics.undefined;\n          }\n\n          throw realm.createErrorThrowCompletion(realm.intrinsics.TypeError, \"not an (abstract) object\");\n        }\n      ),\n      writable: true,\n      enumerable: false,\n      configurable: true,\n    })\n  );\n\n  // Helper function that replaces the implementation of a source function with\n  // the details from another source function body, including the captured\n  // environment, the actual code, etc.\n  // This realizes a form of monkey-patching, enabling mocking a function if\n  // one doesn't control all existing references to that function,\n  // or if the storage location to those references cannot be easily updated.\n  // NOTE: This function affects un-tracked state, so care must be taken\n  // that this helper function is executed at the right time; typically, one\n  // would want to execute this function before any call is executed to that\n  // function. Care must be taken not to make reachable conditionally\n  // defined values. Because of this limitations, this helper function\n  // should be considered only as a last resort.\n  global.$DefineOwnProperty(\n    \"__replaceFunctionImplementation_unsafe\",\n    new PropertyDescriptor({\n      value: new NativeFunctionValue(\n        realm,\n        \"global.__replaceFunctionImplementation_unsafe\",\n        \"__replaceFunctionImplementation_unsafe\",\n        2,\n        (context, [target, source]) => {\n          if (!(target instanceof ECMAScriptSourceFunctionValue)) {\n            throw realm.createErrorThrowCompletion(\n              realm.intrinsics.TypeError,\n              \"first argument is not a function with source code\"\n            );\n          }\n          if (!(source instanceof ECMAScriptSourceFunctionValue)) {\n            throw realm.createErrorThrowCompletion(\n              realm.intrinsics.TypeError,\n              \"second argument is not a function with source code\"\n            );\n          }\n\n          // relevant properties for functionValue\n          target.$Environment = source.$Environment;\n          target.$ScriptOrModule = source.$ScriptOrModule;\n\n          // properties for ECMAScriptFunctionValue\n          target.$ConstructorKind = source.$ConstructorKind;\n          target.$ThisMode = source.$ThisMode;\n          target.$HomeObject = source.$HomeObject;\n          target.$FunctionKind = source.$FunctionKind;\n\n          // properties for ECMAScriptSourceFunctionValue\n          target.$Strict = source.$Strict;\n          target.$FormalParameters = source.$FormalParameters;\n          target.$ECMAScriptCode = source.$ECMAScriptCode;\n          target.$HasComputedName = source.$HasComputedName;\n          target.$HasEmptyConstructor = source.$HasEmptyConstructor;\n          target.loc = source.loc;\n\n          return context.$Realm.intrinsics.undefined;\n        }\n      ),\n      writable: true,\n      enumerable: false,\n      configurable: true,\n    })\n  );\n\n  global.$DefineOwnProperty(\n    \"__IntrospectionError\",\n    new PropertyDescriptor({\n      value: realm.intrinsics.__IntrospectionError,\n      writable: true,\n      enumerable: false,\n      configurable: true,\n    })\n  );\n\n  global.$DefineOwnProperty(\n    \"__isIntegral\",\n    new PropertyDescriptor({\n      value: new NativeFunctionValue(realm, \"global.__isIntegral\", \"__isIntegral\", 1, (context, [value]) => {\n        return new BooleanValue(realm, value instanceof IntegralValue);\n      }),\n      writable: true,\n      enumerable: false,\n      configurable: true,\n    })\n  );\n\n  global.$DefineOwnProperty(\n    \"__describe\",\n    new PropertyDescriptor({\n      value: new NativeFunctionValue(realm, \"global.__describe\", \"__describe\", 1, (context, [value]) => {\n        return new StringValue(realm, describeValue(value));\n      }),\n      writable: true,\n      enumerable: false,\n      configurable: true,\n    })\n  );\n\n  global.$DefineOwnProperty(\n    \"__fatal\",\n    new PropertyDescriptor({\n      value: new NativeFunctionValue(realm, \"global.__fatal\", \"__fatal\", 0, (context, []) => {\n        throw new FatalError();\n      }),\n      writable: true,\n      enumerable: false,\n      configurable: true,\n    })\n  );\n\n  global.$DefineOwnProperty(\n    \"__eagerlyRequireModuleDependencies\",\n    new PropertyDescriptor({\n      value: new NativeFunctionValue(\n        realm,\n        \"global.__eagerlyRequireModuleDependencies\",\n        \"__eagerlyRequireModuleDependencies\",\n        1,\n        (context, [functionValue]) => {\n          if (!IsCallable(realm, functionValue) || !(functionValue instanceof FunctionValue))\n            throw realm.createErrorThrowCompletion(realm.intrinsics.TypeError, \"argument must be callable function\");\n          let functionCall: void | ((thisArgument: Value, argumentsList: Array<Value>) => Value) = functionValue.$Call;\n          if (typeof functionCall !== \"function\") {\n            throw realm.createErrorThrowCompletion(realm.intrinsics.TypeError, \"argument must be directly callable\");\n          }\n          let old = realm.eagerlyRequireModuleDependencies;\n          realm.eagerlyRequireModuleDependencies = true;\n          try {\n            return functionCall(realm.intrinsics.undefined, []);\n          } finally {\n            realm.eagerlyRequireModuleDependencies = old;\n          }\n        }\n      ),\n      writable: true,\n      enumerable: false,\n      configurable: true,\n    })\n  );\n}\n"
  },
  {
    "path": "src/intrinsics/prepack/utils.js",
    "content": "/**\n * Copyright (c) 2017-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n/* @flow strict-local */\n\nimport type { Realm } from \"../../realm.js\";\nimport {\n  AbstractValue,\n  ConcreteValue,\n  FunctionValue,\n  ObjectValue,\n  StringValue,\n  UndefinedValue,\n  Value,\n} from \"../../values/index.js\";\nimport { DisablePlaceholderSuffix } from \"../../utils/PreludeGenerator.js\";\nimport { ValuesDomain } from \"../../domains/index.js\";\nimport { describeLocation } from \"../ecma262/Error.js\";\nimport { To } from \"../../singletons.js\";\nimport AbstractObjectValue from \"../../values/AbstractObjectValue.js\";\nimport { CompilerDiagnostic, FatalError } from \"../../errors.js\";\nimport { Utils } from \"../../singletons.js\";\nimport invariant from \"../../invariant.js\";\n\nconst throwTemplateSrc = \"(function(){throw new global.Error('abstract value defined at ' + A);})()\";\n\nexport function parseTypeNameOrTemplate(\n  realm: Realm,\n  typeNameOrTemplate: void | Value | string\n): { type: typeof Value, template: void | ObjectValue, functionResultType?: typeof Value } {\n  if (typeNameOrTemplate === undefined || typeNameOrTemplate instanceof UndefinedValue) {\n    return { type: Value, template: undefined };\n  } else if (typeof typeNameOrTemplate === \"string\") {\n    let type = Utils.getTypeFromName(typeNameOrTemplate);\n    if (type === undefined) {\n      throw realm.createErrorThrowCompletion(realm.intrinsics.TypeError, \"unknown typeNameOrTemplate\");\n    }\n    return { type, template: undefined };\n  } else if (typeNameOrTemplate instanceof StringValue) {\n    let typeNameString = To.ToStringPartial(realm, typeNameOrTemplate);\n    let hasFunctionResultType = typeNameString.startsWith(\":\");\n    if (hasFunctionResultType) typeNameString = typeNameString.substring(1);\n    let type = Utils.getTypeFromName(typeNameString);\n    if (type === undefined) {\n      throw realm.createErrorThrowCompletion(realm.intrinsics.TypeError, \"unknown typeNameOrTemplate\");\n    }\n    return hasFunctionResultType\n      ? { type: FunctionValue, template: undefined, functionResultType: type }\n      : { type, template: undefined };\n  } else if (typeNameOrTemplate instanceof FunctionValue) {\n    return { type: FunctionValue, template: typeNameOrTemplate };\n  } else if (typeNameOrTemplate instanceof ObjectValue) {\n    return { type: ObjectValue, template: typeNameOrTemplate };\n  } else {\n    throw realm.createErrorThrowCompletion(realm.intrinsics.TypeError, \"typeNameOrTemplate has unsupported type\");\n  }\n}\n\nexport function createAbstract(\n  realm: Realm,\n  typeNameOrTemplate?: Value | string,\n  name?: string,\n  options?: ObjectValue,\n  ...additionalValues: Array<ConcreteValue>\n): AbstractValue | AbstractObjectValue {\n  if (!realm.useAbstractInterpretation) {\n    throw realm.createErrorThrowCompletion(realm.intrinsics.TypeError, \"realm is not partial\");\n  }\n\n  let { type, template, functionResultType } = parseTypeNameOrTemplate(realm, typeNameOrTemplate);\n  let optionsMap = options ? options.properties : new Map();\n\n  let result;\n  let locString,\n    loc = null;\n  for (let executionContext of realm.contextStack.slice().reverse()) {\n    let caller = executionContext.caller;\n    loc = executionContext.loc;\n    locString = describeLocation(\n      realm,\n      caller ? caller.function : undefined,\n      caller ? caller.lexicalEnvironment : undefined,\n      loc\n    );\n    if (locString !== undefined) break;\n  }\n  if (name === undefined) {\n    let locVal = new StringValue(realm, locString !== undefined ? locString : \"(unknown location)\");\n    result = AbstractValue.createFromTemplate(realm, throwTemplateSrc, type, [locVal]);\n    result.hashValue = ++realm.objectCount; // need not be an object, but must be unique\n  } else {\n    if (!optionsMap.get(\"allowDuplicateNames\") && !realm.isNameStringUnique(name)) {\n      let error = new CompilerDiagnostic(\"An abstract value with the same name exists\", loc, \"PP0019\", \"FatalError\");\n      realm.handleError(error);\n      throw new FatalError();\n    } else {\n      realm.saveNameString(name);\n    }\n    result = AbstractValue.createFromTemplate(\n      realm,\n      optionsMap.get(\"disablePlaceholders\") ? name + DisablePlaceholderSuffix : name,\n      type,\n      []\n    );\n    result.intrinsicName = name;\n  }\n\n  if (template) result.values = new ValuesDomain(new Set([template]));\n  if (template && !(template instanceof FunctionValue)) {\n    // why exclude functions?\n    template.makePartial();\n    if (name !== undefined) realm.rebuildNestedProperties(result, name);\n  }\n  if (functionResultType) {\n    invariant(result instanceof AbstractObjectValue);\n    result.functionResultType = functionResultType;\n  }\n\n  if (additionalValues.length > 0) result = AbstractValue.createAbstractConcreteUnion(realm, result, additionalValues);\n  return result;\n}\n"
  },
  {
    "path": "src/intrinsics/react-native/global.js",
    "content": "/**\n * Copyright (c) 2017-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n/* @flow strict-local */\n\nimport type { Realm } from \"../../realm.js\";\n\nimport initializeConsole from \"../common/console.js\";\nimport { PropertyDescriptor } from \"../../descriptors.js\";\n\nexport default function(realm: Realm): void {\n  let global = realm.$GlobalObject;\n\n  if (!realm.isCompatibleWith(realm.MOBILE_JSC_VERSION) && !realm.isCompatibleWith(\"mobile\"))\n    global.$DefineOwnProperty(\n      \"console\",\n      new PropertyDescriptor({\n        value: initializeConsole(realm),\n        writable: true,\n        enumerable: false,\n        configurable: true,\n      })\n    );\n\n  for (let name of [\n    \"document\",\n    \"setTimeout\",\n    \"setInterval\",\n\n    \"window\",\n    \"process\",\n    \"setImmediate\",\n    \"clearTimeout\",\n    \"clearInterval\",\n    \"clearImmediate\",\n    \"alert\",\n    \"navigator\",\n    \"module\",\n    \"requestAnimationFrame\",\n    \"cancelAnimationFrame\",\n    \"requestIdleCallback\",\n    \"cancelIdleCallback\",\n    \"Symbol\",\n    \"Promise\",\n    \"WeakSet\",\n    \"Proxy\",\n    \"WebSocket\",\n    \"Request\",\n    \"Response\",\n    \"Headers\",\n    \"FormData\",\n    \"Worker\",\n    \"Node\",\n    \"Blob\",\n    \"URLSearchParams\",\n    \"FileReader\",\n    \"XMLHttpRequest\",\n  ]) {\n    global.$DefineOwnProperty(\n      name,\n      new PropertyDescriptor({\n        value: realm.intrinsics.undefined,\n        writable: true,\n        enumerable: false,\n        configurable: true,\n      })\n    );\n  }\n}\n"
  },
  {
    "path": "src/invariant.js",
    "content": "/**\n * Copyright (c) 2017-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n/* @flow strict */\n\nimport { InvariantError } from \"./errors.js\";\n\nexport default function invariant(condition: boolean, format: string = \"\"): void {\n  if (condition) return;\n  const message = `${format}\nThis is likely a bug in Prepack, not your code. Feel free to open an issue on GitHub.`;\n  let error = new InvariantError(message);\n  error.name = \"Invariant Violation\";\n  throw error;\n}\n"
  },
  {
    "path": "src/methods/abstract.js",
    "content": "/**\n * Copyright (c) 2017-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n/* @flow */\n\nimport type { Realm } from \"../realm.js\";\nimport type { PropertyKeyValue } from \"../types.js\";\nimport { CompilerDiagnostic, FatalError } from \"../errors.js\";\nimport {\n  BoundFunctionValue,\n  EmptyValue,\n  NumberValue,\n  IntegralValue,\n  SymbolValue,\n  StringValue,\n  NullValue,\n  ObjectValue,\n  Value,\n  BooleanValue,\n  UndefinedValue,\n  ConcreteValue,\n  AbstractValue,\n} from \"../values/index.js\";\nimport { Call } from \"./call.js\";\nimport { IsCallable } from \"./is.js\";\nimport { Completion, ReturnCompletion, ThrowCompletion } from \"../completions.js\";\nimport { GetMethod, Get } from \"./get.js\";\nimport { HasCompatibleType } from \"./has.js\";\nimport { To } from \"../singletons.js\";\nimport type { BabelNodeSourceLocation, BabelBinaryOperator } from \"@babel/types\";\nimport invariant from \"../invariant.js\";\n\nexport const URIReserved = \";/?:@&=+$,\";\nexport const URIAlpha = \"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ\";\nexport const DecimalDigit = \"0123456789\";\nexport const URIMark = \"-_.!~*'()\";\nexport const URIUnescaped = URIAlpha + DecimalDigit + URIMark;\n\n// ECMA262 21.1.3.17.1\nexport function SplitMatch(realm: Realm, S: string, q: number, R: string): false | number {\n  // 1. Assert: Type(R) is String.\n  invariant(typeof R === \"string\", \"expected a string\");\n\n  // 2. Let r be the number of code units in R.\n  let r = R.length;\n\n  // 3. Let s be the number of code units in S.\n  let s = S.length;\n\n  // 4. If q+r > s, return false.\n  if (q + r > s) return false;\n\n  // 5. If there exists an integer i between 0 (inclusive) and r (exclusive) such that the code unit at index\n  //    q+i of S is different from the code unit at index i of R, return false.\n  for (let i = 0; i < r; i++) {\n    if (S[q + i] !== R[i]) {\n      return false;\n    }\n  }\n\n  // 6. Return q+r.\n  return q + r;\n}\n\n// ECMA262 7.2.1\nexport function RequireObjectCoercible(\n  realm: Realm,\n  arg: Value,\n  argLoc?: ?BabelNodeSourceLocation\n): AbstractValue | ObjectValue | BooleanValue | StringValue | SymbolValue | NumberValue {\n  if (!arg.mightNotBeNull() || !arg.mightNotBeUndefined()) {\n    throw realm.createErrorThrowCompletion(realm.intrinsics.TypeError, \"null or undefined\");\n  }\n  if (arg instanceof AbstractValue && (arg.mightBeNull() || arg.mightBeUndefined())) {\n    if (realm.isInPureScope()) {\n      // In a pure function it is ok to throw if this happens to be null or undefined.\n      return arg;\n    }\n    if (argLoc) {\n      let error = new CompilerDiagnostic(\n        `member expression object ${AbstractValue.describe(arg)} is unknown`,\n        argLoc,\n        \"PP0012\",\n        \"FatalError\"\n      );\n      realm.handleError(error);\n      throw new FatalError();\n    }\n    arg.throwIfNotConcrete();\n  }\n  return (arg: any);\n}\n\nexport function HasSameType(x: ConcreteValue, y: ConcreteValue): boolean {\n  const xType = x.getType();\n  const yType = y.getType();\n  return (\n    xType === yType ||\n    ((xType === IntegralValue || xType === NumberValue) && (yType === IntegralValue || yType === NumberValue))\n  );\n}\n\n// ECMA262 7.2.12 Abstract Relational Comparison\nexport function AbstractRelationalComparison(\n  realm: Realm,\n  x: ConcreteValue,\n  y: ConcreteValue,\n  LeftFirst: boolean,\n  op: BabelBinaryOperator\n): BooleanValue | UndefinedValue | AbstractValue {\n  let px, py;\n\n  // 1. If the LeftFirst flag is true, then\n  if (LeftFirst) {\n    // a. Let px be ? ToPrimitive(x, hint Number).\n    px = To.ToPrimitiveOrAbstract(realm, x, \"number\");\n\n    // b. Let py be ? ToPrimitive(y, hint Number).\n    py = To.ToPrimitiveOrAbstract(realm, y, \"number\");\n  } else {\n    // 2. Else the order of evaluation needs to be reversed to preserve left to right evaluation\n    // a. Let py be ? ToPrimitive(y, hint Number).\n    py = To.ToPrimitiveOrAbstract(realm, y, \"number\");\n\n    // b. Let px be ? ToPrimitive(x, hint Number).\n    px = To.ToPrimitiveOrAbstract(realm, x, \"number\");\n  }\n\n  if (px instanceof AbstractValue || py instanceof AbstractValue) {\n    let res;\n    if (LeftFirst) {\n      res = AbstractValue.createFromBinaryOp(realm, op, px, py);\n    } else {\n      res = AbstractValue.createFromBinaryOp(realm, op, py, px);\n    }\n    invariant(res instanceof BooleanValue || res instanceof UndefinedValue || res instanceof AbstractValue);\n    return res;\n  }\n\n  // 3. If both px and py are Strings, then\n  if (px instanceof StringValue && py instanceof StringValue) {\n    // a. If py is a prefix of px, return false. (A String value p is a prefix of String value q if q can be the result of concatenating p and some other String r. Note that any String is a prefix of itself, because r may be the empty String.)\n    if (px.value.startsWith(py.value)) return realm.intrinsics.false;\n\n    // b. If px is a prefix of py, return true.\n    if (py.value.startsWith(px.value)) return realm.intrinsics.true;\n\n    // c. Let k be the smallest nonnegative integer such that the code unit at index k within px is different from the code unit at index k within py. (There must be such a k, for neither String is a prefix of the other.)\n    let k = 0;\n    while (px.value.charCodeAt(k) === py.value.charCodeAt(k)) {\n      k += 1;\n    }\n\n    // d. Let m be the integer that is the code unit value at index k within px.\n    let m = px.value.charCodeAt(k);\n\n    // e. Let n be the integer that is the code unit value at index k within py.\n    let n = py.value.charCodeAt(k);\n\n    // f. If m < n, return true. Otherwise, return false.\n    return m < n ? realm.intrinsics.true : realm.intrinsics.false;\n  } else {\n    // 4. Else,\n    // a. Let nx be ? ToNumber(px). Because px and py are primitive values evaluation order is not important.\n    let nx = To.ToNumber(realm, px);\n\n    // b. Let ny be ? ToNumber(py).\n    let ny = To.ToNumber(realm, py);\n\n    // c. If nx is NaN, return undefined.\n    if (isNaN(nx)) return realm.intrinsics.undefined;\n\n    // d. If ny is NaN, return undefined.\n    if (isNaN(ny)) return realm.intrinsics.undefined;\n\n    // e. If nx and ny are the same Number value, return false.\n    if (Object.is(nx, ny)) {\n      return realm.intrinsics.false;\n    }\n\n    // f. If nx is +0 and ny is -0, return false.\n    if (Object.is(nx, +0) && Object.is(ny, -0)) {\n      return realm.intrinsics.false;\n    }\n\n    // g. If nx is -0 and ny is +0, return false.\n    if (Object.is(nx, -0) && Object.is(ny, +0)) {\n      return realm.intrinsics.false;\n    }\n\n    // h. If nx is +∞, return false.\n    // i. If ny is +∞, return true.\n    // j. If ny is -∞, return false.\n    // k. If nx is -∞, return true.\n\n    // i. If the mathematical value of nx is less than the mathematical value of ny —note that these\n    //    mathematical values are both finite and not both zero—return true. Otherwise, return false.\n    if (nx < ny) {\n      return realm.intrinsics.true;\n    } else {\n      return realm.intrinsics.false;\n    }\n  }\n}\n\n// ECMA262 7.2.13\nexport function AbstractEqualityComparison(\n  realm: Realm,\n  x: ConcreteValue,\n  y: ConcreteValue,\n  op: BabelBinaryOperator\n): BooleanValue | AbstractValue {\n  // 1. If Type(x) is the same as Type(y), then\n  if (HasSameType(x, y)) {\n    // a. Return the result of performing Strict Equality Comparison x === y.\n    const strictResult = StrictEqualityComparison(realm, x, y);\n    return new BooleanValue(realm, op === \"==\" ? strictResult : !strictResult);\n  }\n\n  // 2. If x is null and y is undefined, return true.\n  if (x instanceof NullValue && y instanceof UndefinedValue) {\n    return new BooleanValue(realm, op === \"==\");\n  }\n\n  // 3. If x is undefined and y is null, return true.\n  if (x instanceof UndefinedValue && y instanceof NullValue) {\n    return new BooleanValue(realm, op === \"==\");\n  }\n\n  // 4. If Type(x) is Number and Type(y) is String, return the result of the comparison x == ToNumber(y).\n  if (x instanceof NumberValue && y instanceof StringValue) {\n    return AbstractEqualityComparison(realm, x, new NumberValue(realm, To.ToNumber(realm, y)), op);\n  }\n\n  // 5. If Type(x) is String and Type(y) is Number, return the result of the comparison ToNumber(x) == y.\n  if (x instanceof StringValue && y instanceof NumberValue) {\n    return AbstractEqualityComparison(realm, new NumberValue(realm, To.ToNumber(realm, x)), y, op);\n  }\n\n  // 6. If Type(x) is Boolean, return the result of the comparison ToNumber(x) == y.\n  if (x instanceof BooleanValue) {\n    return AbstractEqualityComparison(realm, new NumberValue(realm, To.ToNumber(realm, x)), y, op);\n  }\n\n  // 7. If Type(y) is Boolean, return the result of the comparison x == ToNumber(y).\n  if (y instanceof BooleanValue) {\n    return AbstractEqualityComparison(realm, x, new NumberValue(realm, To.ToNumber(realm, y)), op);\n  }\n\n  // 8. If Type(x) is either String, Number, or Symbol and Type(y) is Object, return the result of the comparison x == ToPrimitive(y).\n  if ((x instanceof StringValue || x instanceof NumberValue || x instanceof SymbolValue) && y instanceof ObjectValue) {\n    const py = To.ToPrimitiveOrAbstract(realm, y);\n    if (py instanceof AbstractValue) {\n      let res = AbstractValue.createFromBinaryOp(realm, \"==\", x, py);\n      invariant(res instanceof BooleanValue || res instanceof AbstractValue);\n      return res;\n    }\n    return AbstractEqualityComparison(realm, x, py, op);\n  }\n\n  // 9. If Type(x) is Object and Type(y) is either String, Number, or Symbol, return the result of the comparison ToPrimitive(x) == y.\n  if (x instanceof ObjectValue && (y instanceof StringValue || y instanceof NumberValue || y instanceof SymbolValue)) {\n    const px = To.ToPrimitiveOrAbstract(realm, x);\n    if (px instanceof AbstractValue) {\n      let res = AbstractValue.createFromBinaryOp(realm, \"==\", px, y);\n      invariant(res instanceof BooleanValue || res instanceof AbstractValue);\n      return res;\n    }\n    return AbstractEqualityComparison(realm, px, y, op);\n  }\n\n  // 10. Return false.\n  return new BooleanValue(realm, op !== \"==\");\n}\n\n// ECMA262 7.2.14 Strict Equality Comparison\nexport function StrictEqualityComparison(realm: Realm, x: ConcreteValue, y: ConcreteValue): boolean {\n  // 1. If Type(x) is different from Type(y), return false.\n  if (!HasSameType(x, y)) {\n    return false;\n  }\n\n  // 2. If Type(x) is Number, then\n  if (x instanceof NumberValue && y instanceof NumberValue) {\n    // a. If x is NaN, return false.\n    if (isNaN(x.value)) return false;\n\n    // b. If y is NaN, return false.\n    if (isNaN(y.value)) return false;\n\n    // c. If x is the same Number value as y, return true.\n    // d. If x is +0 and y is -0, return true. (handled by c)\n    // e. If x is -0 and y is +0, return true. (handled by c)\n    if (x.value === y.value) return true;\n\n    // f. Return false.\n    return false;\n  }\n\n  // 3. Return SameValueNonNumber(x, y).\n  return SameValueNonNumber(realm, x, y);\n}\n\nexport function StrictEqualityComparisonPartial(realm: Realm, x: Value, y: Value): boolean {\n  return StrictEqualityComparison(realm, x.throwIfNotConcrete(), y.throwIfNotConcrete());\n}\n\n// ECMA262 7.2.10\nexport function SameValueZero(realm: Realm, x: ConcreteValue, y: ConcreteValue): boolean {\n  // 1. If Type(x) is different from Type(y), return false.\n  if (!HasSameType(x, y)) {\n    return false;\n  }\n\n  // 2. If Type(x) is Number, then\n  if (x instanceof NumberValue) {\n    invariant(y instanceof NumberValue);\n\n    // a. If x is NaN and y is NaN, return true.\n    if (isNaN(x.value) && isNaN(y.value)) return true;\n\n    // b. If x is +0 and y is -0, return true.\n    if (Object.is(x.value, +0) && Object.is(y.value, -0)) return true;\n\n    // c. If x is -0 and y is +0, return true.\n    if (Object.is(x.value, -0) && Object.is(y.value, +0)) return true;\n\n    // d. If x is the same Number value as y, return true.\n    if (x.value === y.value) return true;\n\n    // e. Return false.\n    return false;\n  }\n\n  // 3. Return SameValueNonNumber(x, y).\n  return SameValueNonNumber(realm, x, y);\n}\n\nexport function SameValueZeroPartial(realm: Realm, x: Value, y: Value): boolean {\n  return SameValueZero(realm, x.throwIfNotConcrete(), y.throwIfNotConcrete());\n}\n\n// ECMA262 7.2.9\nexport function SameValue(realm: Realm, x: ConcreteValue, y: ConcreteValue): boolean {\n  // 1. If Type(x) is different from Type(y), return false.\n  if (!HasSameType(x, y)) {\n    return false;\n  }\n\n  // 2. If Type(x) is Number, then\n  if (x instanceof NumberValue && y instanceof NumberValue) {\n    // a. If x is NaN and y is NaN, return true.\n    if (isNaN(x.value) && isNaN(y.value)) return true;\n\n    // b. If x is +0 and y is -0, return false.\n    if (Object.is(x.value, +0) && Object.is(y.value, -0)) return false;\n\n    // c. If x is -0 and y is +0, return false.\n    if (Object.is(x.value, -0) && Object.is(y.value, +0)) return false;\n\n    // d. If x is the same Number value as y, return true.\n    if (x.value === y.value) return true;\n\n    // e. Return false.\n    return false;\n  }\n\n  // 3. Return SameValueNonNumber(x, y).\n  return SameValueNonNumber(realm, x, y);\n}\n\nexport function SameValuePartial(realm: Realm, x: Value, y: Value): boolean {\n  return SameValue(realm, x.throwIfNotConcrete(), y.throwIfNotConcrete());\n}\n\n// ECMA262 7.2.11\nexport function SameValueNonNumber(realm: Realm, x: ConcreteValue, y: ConcreteValue): boolean {\n  // 1. Assert: Type(x) is not Number.\n  invariant(!(x instanceof NumberValue), \"numbers not allowed\");\n\n  // 2. Assert: Type(x) is the same as Type(y).\n  invariant(x.getType() === y.getType(), \"must be same type\");\n\n  // 3. If Type(x) is Undefined, return true.\n  if (x instanceof UndefinedValue) return true;\n\n  // 4. If Type(x) is Null, return true.\n  if (x instanceof NullValue) return true;\n\n  // 5. If Type(x) is String, then\n  if (x instanceof StringValue && y instanceof StringValue) {\n    // a. If x and y are exactly the same sequence of code units (same length and same code units at corresponding indices), return true; otherwise, return false.\n    return x.value === y.value;\n  }\n\n  // 6. If Type(x) is Boolean, then\n  if (x instanceof BooleanValue && y instanceof BooleanValue) {\n    // a. If x and y are both true or both false, return true; otherwise, return false.\n    return x.value === y.value;\n  }\n\n  // 7. If Type(x) is Symbol, then\n  if (x instanceof SymbolValue) {\n    // a. If x and y are both the same Symbol value, return true; otherwise, return false.\n    return x === y;\n  }\n\n  // 8. Return true if x and y are the same Object value. Otherwise, return false.\n  return x === y;\n}\n\n// Checks if two property keys are identical.\nexport function SamePropertyKey(realm: Realm, x: PropertyKeyValue, y: PropertyKeyValue): boolean {\n  if (typeof x === \"string\" && typeof y === \"string\") {\n    return x === y;\n  }\n  if (x instanceof StringValue && y instanceof StringValue) {\n    return x.value === y.value;\n  }\n  if (x instanceof SymbolValue && y instanceof SymbolValue) {\n    return x === y;\n  }\n  return false;\n}\n\n// ECMA262 12.8.5 Applying the Additive Operators to Numbers\nexport function Add(realm: Realm, a: number, b: number, subtract?: boolean = false): NumberValue {\n  // If either operand is NaN, the result is NaN.\n  if (isNaN(a) || isNaN(b)) {\n    return realm.intrinsics.NaN;\n  }\n\n  // The sum of two infinities of opposite sign is NaN.\n  // The sum of two infinities of the same sign is the infinity of that sign.\n  // The sum of an infinity and a finite value is equal to the infinite operand.\n  // The sum of two negative zeroes is -0. The sum of two positive zeroes, or of two zeroes of opposite sign, is +0.\n  // The sum of a zero and a nonzero finite value is equal to the nonzero operand.\n  // The sum of two nonzero finite values of the same magnitude and opposite sign is +0.\n\n  let anum = a;\n  let bnum = b;\n\n  // The - operator performs subtraction when applied to two operands of numeric type,\n  // producing the difference of its operands; the left operand is the minuend and the right\n  // operand is the subtrahend. Given numeric operands a and b, it is always the case that\n  // a-b produces the same result as a+(-b).\n  if (subtract) {\n    bnum = -bnum;\n  }\n\n  return IntegralValue.createFromNumberValue(realm, anum + bnum);\n}\n\n// ECMA262 12.10.4\nexport function InstanceofOperator(realm: Realm, O: Value, C: Value): boolean {\n  // 1. If Type(C) is not Object, throw a TypeError exception.\n  if (!C.mightBeObject()) {\n    throw realm.createErrorThrowCompletion(realm.intrinsics.TypeError, \"Expecting a function in instanceof check\");\n  }\n\n  // 2. Let instOfHandler be ? GetMethod(C, @@hasInstance).\n  let instOfHandler = GetMethod(realm, C, realm.intrinsics.SymbolHasInstance);\n\n  // 3. If instOfHandler is not undefined, then\n  if (!(instOfHandler instanceof UndefinedValue)) {\n    // a. Return ToBoolean(? Call(instOfHandler, C, « O »)).\n    return To.ToBooleanPartial(realm, Call(realm, instOfHandler, C, [O]));\n  }\n\n  // 4. If IsCallable(C) is false, throw a TypeError exception.\n  if (IsCallable(realm, C) === false) {\n    throw realm.createErrorThrowCompletion(realm.intrinsics.TypeError, \"Expecting a function in instanceof check\");\n  }\n\n  // 5. Return ? OrdinaryHasInstance(C, O).\n  return OrdinaryHasInstance(realm, C, O);\n}\n\n// ECMA262 7.3.19\nexport function OrdinaryHasInstance(realm: Realm, C: Value, O: Value): boolean {\n  // 1. If IsCallable(C) is false, return false.\n  if (IsCallable(realm, C) === false) return false;\n  invariant(C instanceof ObjectValue);\n\n  // 2. If C has a [[BoundTargetFunction]] internal slot, then\n  if (C instanceof BoundFunctionValue) {\n    // a. Let BC be the value of C's [[BoundTargetFunction]] internal slot.\n    let BC = C.$BoundTargetFunction;\n\n    // b. Return ? InstanceofOperator(O, BC).\n    return InstanceofOperator(realm, O, BC);\n  }\n\n  // 3. If Type(O) is not Object, return false.\n  O = O.throwIfNotConcrete();\n  if (!(O instanceof ObjectValue)) return false;\n\n  // 4. Let P be ? Get(C, \"prototype\").\n  let P = Get(realm, C, \"prototype\").throwIfNotConcrete();\n\n  // 5. If Type(P) is not Object, throw a TypeError exception.\n  if (!(P instanceof ObjectValue)) {\n    throw realm.createErrorThrowCompletion(realm.intrinsics.TypeError, \"Type(P) is not Object\");\n  }\n\n  // 6. Repeat\n  while (true) {\n    // a. Let O be ? O.[[GetPrototypeOf]]().\n    O = O.$GetPrototypeOf();\n\n    // b. If O is null, return false.\n    if (O instanceof NullValue) return false;\n\n    // c. If SameValue(P, O) is true, return true.\n    if (SameValuePartial(realm, P, O) === true) return true;\n  }\n\n  return false;\n}\n\n//\nexport function Type(realm: Realm, val: Value): string {\n  if (val instanceof UndefinedValue) {\n    return \"Undefined\";\n  } else if (val instanceof NullValue) {\n    return \"Null\";\n  } else if (HasCompatibleType(val, BooleanValue)) {\n    return \"Boolean\";\n  } else if (HasCompatibleType(val, StringValue)) {\n    return \"String\";\n  } else if (HasCompatibleType(val, SymbolValue)) {\n    return \"Symbol\";\n  } else if (HasCompatibleType(val, IntegralValue)) {\n    return \"Number\";\n  } else if (HasCompatibleType(val, NumberValue)) {\n    return \"Number\";\n  } else if (!val.mightNotBeObject()) {\n    return \"Object\";\n  } else {\n    invariant(val instanceof AbstractValue);\n    AbstractValue.reportIntrospectionError(val);\n    throw new FatalError();\n  }\n}\n\n// ECMA262 19.4.3.2.1\nexport function SymbolDescriptiveString(realm: Realm, sym: SymbolValue): string {\n  // 1. Assert: Type(sym) is Symbol.\n  invariant(sym instanceof SymbolValue, \"expected symbol\");\n\n  // 2. Let desc be sym's [[Description]] value.\n  let desc = sym.$Description;\n\n  // 3. If desc is undefined, let desc be the empty string.\n  if (!desc) desc = \"\";\n  else desc = desc.throwIfNotConcreteString().value;\n\n  // 4. Assert: Type(desc) is String.\n  invariant(typeof desc === \"string\", \"expected string\");\n\n  // 5. Return the result of concatenating the strings \"Symbol(\", desc, and \")\".\n  return `Symbol(${desc})`;\n}\n\n// ECMA262 6.2.2.5\nexport function UpdateEmpty(realm: Realm, completionRecord: Completion | Value, value: Value): Completion | Value {\n  // 1. Assert: If completionRecord.[[Type]] is either return or throw, then completionRecord.[[Value]] is not empty.\n  if (completionRecord instanceof ReturnCompletion || completionRecord instanceof ThrowCompletion) {\n    invariant(completionRecord.value, \"expected completion record to have a value\");\n  }\n\n  // 2. If completionRecord.[[Value]] is not empty, return Completion(completionRecord).\n  if (completionRecord instanceof EmptyValue) return value;\n  if (completionRecord instanceof Value || (completionRecord.value && !(completionRecord.value instanceof EmptyValue)))\n    return completionRecord;\n\n  // 3. Return Completion{[[Type]]: completionRecord.[[Type]], [[Value]]: value, [[Target]]: completionRecord.[[Target]] }.'\n  completionRecord.value = value;\n  return completionRecord;\n}\n"
  },
  {
    "path": "src/methods/arraybuffer.js",
    "content": "/**\n * Copyright (c) 2017-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n/* @flow strict-local */\n\nimport type { Realm } from \"../realm.js\";\nimport type { DataBlock, ElementType } from \"../types.js\";\nimport { Value, ObjectValue, NumberValue, EmptyValue, NullValue, UndefinedValue } from \"../values/index.js\";\nimport { SpeciesConstructor } from \"./construct.js\";\nimport { IsConstructor } from \"./index.js\";\nimport { IsDetachedBuffer } from \"./is.js\";\nimport { Create, Properties, To } from \"../singletons.js\";\nimport invariant from \"../invariant.js\";\nimport { ElementSize } from \"../types.js\";\n\n// ECMA262 6.2.6.1\nexport function CreateByteDataBlock(realm: Realm, size: number): DataBlock {\n  // 1. Assert: size≥0.\n  invariant(size >= 0, \"size >= 0\");\n\n  // 2. Let db be a new Data Block value consisting of size bytes. If it is impossible to create such a Data Block, throw a RangeError exception.\n  let db;\n  try {\n    db = new Uint8Array(size);\n  } catch (e) {\n    if (e instanceof RangeError) {\n      throw realm.createErrorThrowCompletion(realm.intrinsics.RangeError, \"Invalid typed array length\");\n    } else {\n      throw e;\n    }\n  }\n\n  // 3. Set all of the bytes of db to 0.\n  for (let i = 0; i < size; ++i) {\n    db[i] = 0;\n  }\n\n  // 4. Return db.\n  return db;\n}\n\n// ECMA262 6.2.6.2\nexport function CopyDataBlockBytes(\n  realm: Realm,\n  toBlock: DataBlock,\n  _toIndex: number,\n  fromBlock: DataBlock,\n  _fromIndex: number,\n  _count: number\n): EmptyValue {\n  let toIndex = _toIndex;\n  let fromIndex = _fromIndex;\n  let count = _count;\n  // 1. Assert: fromBlock and toBlock are distinct Data Block values.\n  invariant(toBlock instanceof Uint8Array && fromBlock instanceof Uint8Array && toBlock !== fromBlock);\n\n  // 2. Assert: fromIndex, toIndex, and count are integer values ≥ 0.\n  invariant(toIndex >= 0 && fromIndex >= 0 && count >= 0);\n\n  // 3. Let fromSize be the number of bytes in fromBlock.\n  let fromSize = fromBlock.length;\n\n  // 4. Assert: fromIndex+count ≤ fromSize.\n  invariant(fromIndex + count <= fromSize, \"fromIndex+count ≤ fromSize\");\n\n  // 5. Let toSize be the number of bytes in toBlock.\n  let toSize = toBlock.length;\n\n  // 6. Assert: toIndex+count ≤ toSize.\n  invariant(toIndex + count <= toSize, \"toIndex+count ≤ toSize\");\n\n  // 7. Repeat, while count>0\n  while (count > 0) {\n    // a. Set toBlock[toIndex] to the value of fromBlock[fromIndex].\n    toBlock[toIndex] = fromBlock[fromIndex];\n\n    // b. Increment toIndex and fromIndex each by 1.\n    toIndex += 1;\n    fromIndex += 1;\n\n    // c. Decrement count by 1.\n    count -= 1;\n  }\n\n  // 8. Return NormalCompletion(empty).\n  return realm.intrinsics.empty;\n}\n\n// ECMA262 24.1.1.1\nexport function AllocateArrayBuffer(realm: Realm, constructor: ObjectValue, byteLength: number): ObjectValue {\n  // 1. Let obj be ? OrdinaryCreateFromConstructor(constructor, \"%ArrayBufferPrototype%\", « [[ArrayBufferData]], [[ArrayBufferByteLength]] »).\n  let obj = Create.OrdinaryCreateFromConstructor(realm, constructor, \"ArrayBufferPrototype\", {\n    $ArrayBufferData: undefined,\n    $ArrayBufferByteLength: undefined,\n  });\n\n  // 2. Assert: byteLength is an integer value ≥ 0.\n  invariant(typeof byteLength === \"number\" && byteLength >= 0, \"byteLength is an integer value ≥ 0\");\n\n  // 3. Let block be ? CreateByteDataBlock(byteLength).\n  let block = CreateByteDataBlock(realm, byteLength);\n\n  // 4. Set obj's [[ArrayBufferData]] internal slot to block.\n  obj.$ArrayBufferData = block;\n\n  // 5. Set obj's [[ArrayBufferByteLength]] internal slot to byteLength.\n  obj.$ArrayBufferByteLength = byteLength;\n\n  // 6. Return obj.\n  return obj;\n}\n\n// ECMA262 24.1.1.3\nexport function DetachArrayBuffer(realm: Realm, arrayBuffer: ObjectValue): NullValue {\n  // 1. Assert: Type(arrayBuffer) is Object and it has [[ArrayBufferData]] and [[ArrayBufferByteLength]] internal slots.\n  invariant(\n    arrayBuffer instanceof ObjectValue && \"$ArrayBufferData\" in arrayBuffer && \"$ArrayBufferByteLength\" in arrayBuffer\n  );\n\n  // 2. Set arrayBuffer.[[ArrayBufferData]] to null.\n  Properties.ThrowIfInternalSlotNotWritable(realm, arrayBuffer, \"$ArrayBufferData\").$ArrayBufferData = null;\n\n  // 3. Set arrayBuffer.[[ArrayBufferByteLength]] to 0.\n  Properties.ThrowIfInternalSlotNotWritable(realm, arrayBuffer, \"$ArrayBufferByteLength\").$ArrayBufferByteLength = 0;\n\n  // 4. Return NormalCompletion(null).\n  return realm.intrinsics.null;\n}\n\n// ECMA262 24.2.1.1\nexport function GetViewValue(\n  realm: Realm,\n  _view: Value,\n  requestIndex: Value,\n  isLittleEndian: Value,\n  type: ElementType\n): NumberValue {\n  let view = _view.throwIfNotConcrete();\n\n  // 1. If Type(view) is not Object, throw a TypeError exception.\n  if (!(view instanceof ObjectValue)) {\n    throw realm.createErrorThrowCompletion(realm.intrinsics.TypeError, \"Type(view) is not Object\");\n  }\n\n  // 2. If view does not have a [[DataView]] internal slot, throw a TypeError exception.\n  if (!(\"$DataView\" in view)) {\n    throw realm.createErrorThrowCompletion(\n      realm.intrinsics.TypeError,\n      \"view does not have a [[DataView]] internal slot\"\n    );\n  }\n\n  // 3. Assert: view has a [[ViewedArrayBuffer]] internal slot.\n  invariant(view.$ViewedArrayBuffer);\n\n  // 4. Let getIndex be ? ToIndex(requestIndex).\n  let getIndex = To.ToIndexPartial(realm, requestIndex);\n\n  // 5. Let littleEndian be ToBoolean(isLittleEndian).\n  let littleEndian = To.ToBooleanPartial(realm, isLittleEndian);\n\n  // 6. Let buffer be view.[[ViewedArrayBuffer]].\n  let buffer = view.$ViewedArrayBuffer;\n  invariant(buffer);\n\n  // 7. If IsDetachedBuffer(buffer) is true, throw a TypeError exception.\n  if (IsDetachedBuffer(realm, buffer) === true) {\n    throw realm.createErrorThrowCompletion(realm.intrinsics.TypeError, \"IsDetachedBuffer(buffer) is true\");\n  }\n\n  // 8. Let viewOffset be view.[[ByteOffset]].\n  let viewOffset = view.$ByteOffset;\n  invariant(typeof viewOffset === \"number\");\n\n  // 9. Let viewSize be view.[[ByteLength]].\n  let viewSize = view.$ByteLength;\n  invariant(typeof viewSize === \"number\");\n\n  // 10. Let elementSize be the Number value of the Element Size value specified in Table 50 for Element Type type.\n  let elementSize = ElementSize[type];\n\n  // 11. If getIndex + elementSize > viewSize, throw a RangeError exception.\n  if (getIndex + elementSize > viewSize) {\n    throw realm.createErrorThrowCompletion(realm.intrinsics.RangeError, \"getIndex + elementSize > viewSize\");\n  }\n\n  // 12. Let bufferIndex be getIndex + viewOffset.\n  let bufferIndex = getIndex + viewOffset;\n\n  // 13. Return GetValueFromBuffer(buffer, bufferIndex, type, littleEndian).\n  return GetValueFromBuffer(realm, buffer, bufferIndex, type, littleEndian);\n}\n\n// ECMA262 24.1.1.5\nexport function GetValueFromBuffer(\n  realm: Realm,\n  arrayBuffer: ObjectValue,\n  byteIndex: number,\n  type: ElementType,\n  _isLittleEndian?: boolean\n): NumberValue {\n  let isLittleEndian = _isLittleEndian;\n  // 1. Assert: IsDetachedBuffer(arrayBuffer) is false.\n  invariant(IsDetachedBuffer(realm, arrayBuffer) === false);\n\n  // 2. Assert: There are sufficient bytes in arrayBuffer starting at byteIndex to represent a value of type.\n  invariant(\n    arrayBuffer.$ArrayBufferData instanceof Uint8Array &&\n      byteIndex + ElementSize[type] <= arrayBuffer.$ArrayBufferData.length\n  );\n\n  // 3. Assert: byteIndex is an integer value ≥ 0.\n  invariant(byteIndex >= 0);\n\n  // 4. Let block be arrayBuffer.[[ArrayBufferData]].\n  let block = arrayBuffer.$ArrayBufferData;\n  invariant(block instanceof Uint8Array);\n\n  // 5. Let elementSize be the Number value of the Element Size value specified in Table 50 for Element Type type.\n  let elementSize = ElementSize[type];\n\n  // 6. Let rawValue be a List of elementSize containing, in order, the elementSize sequence of bytes starting with block[byteIndex].\n  let rawValue = new DataView(block.buffer, byteIndex, elementSize);\n\n  // 7. If isLittleEndian is not present, set isLittleEndian to either true or false. The choice is implementation dependent and should be the alternative that is most efficient for the implementation. An implementation must use the same value each time this step is executed and the same value must be used for the corresponding step in the SetValueInBuffer abstract operation.\n  if (isLittleEndian === undefined) isLittleEndian = true;\n\n  // 8. If isLittleEndian is false, reverse the order of the elements of rawValue.\n\n  // 9. If type is \"Float32\", then\n  if (type === \"Float32\") {\n    // a. Let value be the byte elements of rawValue concatenated and interpreted as a little-endian bit string encoding of an IEEE 754-2008 binary32 value.\n    // b. If value is an IEEE 754-2008 binary32 NaN value, return the NaN Number value.\n    // c. Return the Number value that corresponds to value.\n    return new NumberValue(realm, rawValue.getFloat32(0, isLittleEndian));\n  }\n\n  // 10. If type is \"Float64\", then\n  if (type === \"Float64\") {\n    // a. Let value be the byte elements of rawValue concatenated and interpreted as a little-endian bit string encoding of an IEEE 754-2008 binary64 value.\n    // b. If value is an IEEE 754-2008 binary64 NaN value, return the NaN Number value.\n    // c. Return the Number value that corresponds to value.\n    return new NumberValue(realm, rawValue.getFloat64(0, isLittleEndian));\n  }\n\n  let intValue;\n  // 11. If the first code unit of type is \"U\", then\n  if (type === \"Uint8\" || type === \"Uint16\" || type === \"Uint32\" || type === \"Uint8Clamped\") {\n    // a. Let intValue be the byte elements of rawValue concatenated and interpreted as a bit string encoding of an unsigned little-endian binary number.\n    if (elementSize === 1) {\n      intValue = rawValue.getUint8(0);\n    } else if (elementSize === 2) {\n      intValue = rawValue.getUint16(0, isLittleEndian);\n    } else {\n      intValue = rawValue.getUint32(0, isLittleEndian);\n    }\n  } else {\n    // 12. Else,\n    // a. Let intValue be the byte elements of rawValue concatenated and interpreted as a bit string encoding of a binary little-endian 2's complement number of bit length elementSize × 8.\n    if (elementSize === 1) {\n      intValue = rawValue.getInt8(0);\n    } else if (elementSize === 2) {\n      intValue = rawValue.getInt16(0, isLittleEndian);\n    } else {\n      intValue = rawValue.getInt32(0, isLittleEndian);\n    }\n  }\n\n  // 13. Return the Number value that corresponds to intValue.\n  return new NumberValue(realm, intValue);\n}\n\n// ECMA262 24.2.1.2\nexport function SetViewValue(\n  realm: Realm,\n  _view: Value,\n  requestIndex: Value,\n  isLittleEndian: Value,\n  type: ElementType,\n  value: Value\n): UndefinedValue {\n  let view = _view.throwIfNotConcrete();\n\n  // 1. If Type(view) is not Object, throw a TypeError exception.\n  if (!(view instanceof ObjectValue)) {\n    throw realm.createErrorThrowCompletion(realm.intrinsics.TypeError, \"Type(view) is not Object\");\n  }\n\n  // 2. If view does not have a [[DataView]] internal slot, throw a TypeError exception.\n  if (!(\"$DataView\" in view)) {\n    throw realm.createErrorThrowCompletion(\n      realm.intrinsics.TypeError,\n      \"view does not have a [[DataView]] internal slot\"\n    );\n  }\n\n  // 3. Assert: view has a [[ViewedArrayBuffer]] internal slot.\n  invariant(view.$ViewedArrayBuffer);\n\n  // 4. Let getIndex be ? ToIndex(requestIndex).\n  let getIndex = To.ToIndexPartial(realm, requestIndex);\n\n  // 5. Let numberValue be ? ToNumber(value).\n  let numberValue = To.ToNumber(realm, value);\n\n  // 6. Let littleEndian be ToBoolean(isLittleEndian).\n  let littleEndian = To.ToBooleanPartial(realm, isLittleEndian);\n\n  // 7. Let buffer be view.[[ViewedArrayBuffer]].\n  let buffer = view.$ViewedArrayBuffer;\n  invariant(buffer);\n\n  // 8. If IsDetachedBuffer(buffer) is true, throw a TypeError exception.\n  if (IsDetachedBuffer(realm, buffer) === true) {\n    throw realm.createErrorThrowCompletion(realm.intrinsics.TypeError, \"IsDetachedBuffer(buffer) is true\");\n  }\n\n  // 9. Let viewOffset be view.[[ByteOffset]].\n  let viewOffset = view.$ByteOffset;\n  invariant(typeof viewOffset === \"number\");\n\n  // 10. Let viewSize be view.[[ByteLength]].\n  let viewSize = view.$ByteLength;\n  invariant(typeof viewSize === \"number\");\n\n  // 11. Let elementSize be the Number value of the Element Size value specified in Table 50 for Element Type type.\n  let elementSize = ElementSize[type];\n\n  // 12. If getIndex + elementSize > viewSize, throw a RangeError exception.\n  if (getIndex + elementSize > viewSize) {\n    throw realm.createErrorThrowCompletion(realm.intrinsics.RangeError, \"getIndex + elementSize > viewSize\");\n  }\n\n  // 13. Let bufferIndex be getIndex + viewOffset.\n  let bufferIndex = getIndex + viewOffset;\n\n  // 14. Return SetValueInBuffer(buffer, bufferIndex, type, numberValue, littleEndian).\n  return SetValueInBuffer(realm, buffer, bufferIndex, type, numberValue, littleEndian);\n}\n\n// ECMA262 24.1.1.4\nexport function CloneArrayBuffer(\n  realm: Realm,\n  srcBuffer: ObjectValue,\n  srcByteOffset: number,\n  _cloneConstructor?: ObjectValue\n): ObjectValue {\n  let cloneConstructor = _cloneConstructor;\n  // 1. Assert: Type(srcBuffer) is Object and it has an [[ArrayBufferData]] internal slot.\n  invariant(srcBuffer instanceof ObjectValue && srcBuffer.$ArrayBufferData);\n\n  // 2. If cloneConstructor is not present, then\n  if (cloneConstructor === undefined) {\n    // a. Let cloneConstructor be ? SpeciesConstructor(srcBuffer, %ArrayBuffer%).\n    cloneConstructor = SpeciesConstructor(realm, srcBuffer, realm.intrinsics.ArrayBuffer);\n\n    // b. If IsDetachedBuffer(srcBuffer) is true, throw a TypeError exception.\n    if (IsDetachedBuffer(realm, srcBuffer) === true) {\n      throw realm.createErrorThrowCompletion(realm.intrinsics.TypeError, \"IsDetachedBuffer(srcBuffer) is true\");\n    }\n  } else {\n    // 3. Else, Assert: IsConstructor(cloneConstructor) is true.\n    invariant(IsConstructor(realm, cloneConstructor) === true, \"IsConstructor(cloneConstructor) is true\");\n  }\n\n  // 4. Let srcLength be the value of srcBuffer's [[ArrayBufferByteLength]] internal slot.\n  let srcLength = srcBuffer.$ArrayBufferByteLength;\n  invariant(typeof srcLength === \"number\");\n\n  // 5. Assert: srcByteOffset ≤ srcLength.\n  invariant(srcByteOffset <= srcLength, \"srcByteOffset ≤ srcLength\");\n\n  // 6. Let cloneLength be srcLength - srcByteOffset.\n  let cloneLength = srcLength - srcByteOffset;\n\n  // 7. Let srcBlock be srcBuffer.[[ArrayBufferData]].\n  let srcBlock = srcBuffer.$ArrayBufferData;\n  invariant(srcBlock);\n\n  // 8. Let targetBuffer be ? AllocateArrayBuffer(cloneConstructor, srcLength).\n  let targetBuffer = AllocateArrayBuffer(realm, (cloneConstructor: ObjectValue), srcLength);\n\n  // 9. If IsDetachedBuffer(srcBuffer) is true, throw a TypeError exception.\n  if (IsDetachedBuffer(realm, srcBuffer) === true) {\n    throw realm.createErrorThrowCompletion(realm.intrinsics.TypeError, \"IsDetachedBuffer(srcBuffer) is true\");\n  }\n\n  // 10. Let targetBlock be targetBuffer.[[ArrayBufferData]].\n  let targetBlock = targetBuffer.$ArrayBufferData;\n  invariant(targetBlock);\n\n  // 11. Perform CopyDataBlockBytes(targetBlock, 0, srcBlock, srcByteOffset, cloneLength).\n  CopyDataBlockBytes(realm, targetBlock, 0, srcBlock, srcByteOffset, cloneLength);\n\n  // 12. Return targetBuffer.\n  return targetBuffer;\n}\n\n// ECMA262 24.1.1.6\nexport function SetValueInBuffer(\n  realm: Realm,\n  arrayBuffer: ObjectValue,\n  byteIndex: number,\n  type: ElementType,\n  value: number,\n  _isLittleEndian?: boolean\n): UndefinedValue {\n  let isLittleEndian = _isLittleEndian;\n  // 1. Assert: IsDetachedBuffer(arrayBuffer) is false.\n  invariant(IsDetachedBuffer(realm, arrayBuffer) === false);\n\n  // 2. Assert: There are sufficient bytes in arrayBuffer starting at byteIndex to represent a value of type.\n  invariant(\n    arrayBuffer.$ArrayBufferData instanceof Uint8Array &&\n      byteIndex + ElementSize[type] <= arrayBuffer.$ArrayBufferData.length\n  );\n\n  // 3. Assert: byteIndex is an integer value ≥ 0.\n  invariant(byteIndex >= 0);\n\n  // 4. Assert: Type(value) is Number.\n  invariant(typeof value === \"number\");\n\n  // 5. Let block be arrayBuffer.[[ArrayBufferData]].\n  let block = Properties.ThrowIfInternalSlotNotWritable(realm, arrayBuffer, \"$ArrayBufferData\").$ArrayBufferData;\n\n  // 6. Assert: block is not undefined.\n  invariant(block instanceof Uint8Array);\n\n  // 7. If isLittleEndian is not present, set isLittleEndian to either true or false. The choice is implementation dependent and should be the alternative that is most efficient for the implementation. An implementation must use the same value each time this step is executed and the same value must be used for the corresponding step in the SetValueInBuffer abstract operation.\n  if (isLittleEndian === undefined) isLittleEndian = true;\n\n  let rawBytes = new Uint8Array(ElementSize[type]);\n  // 8. If type is \"Float32\", then\n  if (type === \"Float32\") {\n    // a. Set rawBytes to a List containing the 4 bytes that are the result of converting value to IEEE 754-2008 binary32 format using “Round to nearest, ties to even” rounding mode. If isLittleEndian is false, the bytes are arranged in big endian order. Otherwise, the bytes are arranged in little endian order. If value is NaN, rawValue may be set to any implementation chosen IEEE 754-2008 binary32 format Not-a-Number encoding. An implementation must always choose the same encoding for each implementation distinguishable NaN value.\n    new DataView(rawBytes.buffer).setFloat32(0, value, isLittleEndian);\n  } else if (type === \"Float64\") {\n    // 9. Else if type is \"Float64\", then\n    // a. Set rawBytes to a List containing the 8 bytes that are the IEEE 754-2008 binary64 format encoding of value. If isLittleEndian is false, the bytes are arranged in big endian order. Otherwise, the bytes are arranged in little endian order. If value is NaN, rawValue may be set to any implementation chosen IEEE 754-2008 binary64 format Not-a-Number encoding. An implementation must always choose the same encoding for each implementation distinguishable NaN value.\n    new DataView(rawBytes.buffer).setFloat64(0, value, isLittleEndian);\n  } else {\n    // 10. Else,\n    // a. Let n be the Number value of the Element Size specified in Table 50 for Element Type type.\n    let n = ElementSize[type];\n\n    // b. Let convOp be the abstract operation named in the Conversion Operation column in Table 50 for Element Type type.\n    let convOp = To.ElementConv[type];\n\n    // c. Let intValue be convOp(value).\n    let intValue = convOp(realm, value);\n\n    // d. If intValue ≥ 0, then\n    if (intValue > 0) {\n      // i. Let rawBytes be a List containing the n-byte binary encoding of intValue. If isLittleEndian is false, the bytes are ordered in big endian order. Otherwise, the bytes are ordered in little endian order.\n      if (n === 1) {\n        new DataView(rawBytes.buffer).setUint8(0, intValue);\n      } else if (n === 2) {\n        new DataView(rawBytes.buffer).setUint16(0, intValue, isLittleEndian);\n      } else if (n === 4) {\n        new DataView(rawBytes.buffer).setUint32(0, intValue, isLittleEndian);\n      } else {\n        invariant(false);\n      }\n    } else {\n      // e. Else,\n      // i. Let rawBytes be a List containing the n-byte binary 2's complement encoding of intValue. If isLittleEndian is false, the bytes are ordered in big endian order. Otherwise, the bytes are ordered in little endian order.\n      if (n === 1) {\n        new DataView(rawBytes.buffer).setInt8(0, intValue);\n      } else if (n === 2) {\n        new DataView(rawBytes.buffer).setInt16(0, intValue, isLittleEndian);\n      } else if (n === 4) {\n        new DataView(rawBytes.buffer).setInt32(0, intValue, isLittleEndian);\n      } else {\n        invariant(false);\n      }\n    }\n  }\n\n  // 11. Store the individual bytes of rawBytes into block, in order, starting at block[byteIndex].\n  for (let i = 0; i < rawBytes.length; ++i) {\n    block[byteIndex + i] = rawBytes[i];\n  }\n\n  // 12. Return NormalCompletion(undefined).\n  return realm.intrinsics.undefined;\n}\n"
  },
  {
    "path": "src/methods/call.js",
    "content": "/**\n * Copyright (c) 2017-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n/* @flow */\n\nimport type { PropertyKeyValue } from \"../types.js\";\nimport type { ECMAScriptFunctionValue } from \"../values/index.js\";\nimport {\n  EnvironmentRecord,\n  GlobalEnvironmentRecord,\n  LexicalEnvironment,\n  mightBecomeAnObject,\n  Reference,\n} from \"../environment.js\";\nimport { FatalError } from \"../errors.js\";\nimport { Realm, ExecutionContext } from \"../realm.js\";\nimport Value from \"../values/Value.js\";\nimport {\n  AbstractObjectValue,\n  AbstractValue,\n  ECMAScriptSourceFunctionValue,\n  FunctionValue,\n  NativeFunctionValue,\n  NullValue,\n  ObjectValue,\n  UndefinedValue,\n} from \"../values/index.js\";\nimport { GetIterator, HasSomeCompatibleType, IsCallable, IsPropertyKey, IteratorStep, IteratorValue } from \"./index.js\";\nimport { GeneratorStart } from \"./generator.js\";\nimport {\n  AbruptCompletion,\n  Completion,\n  JoinedAbruptCompletions,\n  JoinedNormalAndAbruptCompletions,\n  NormalCompletion,\n  ReturnCompletion,\n  ThrowCompletion,\n} from \"../completions.js\";\nimport { GetTemplateObject, GetV, GetThisValue } from \"./get.js\";\nimport { Create, Environment, Functions, Leak, Join, To, Widen } from \"../singletons.js\";\nimport invariant from \"../invariant.js\";\nimport { createOperationDescriptor } from \"../utils/generator.js\";\nimport type { BabelNodeExpression, BabelNodeSpreadElement, BabelNodeTemplateLiteral } from \"@babel/types\";\n\n// ECMA262 12.3.6.1\nexport function ArgumentListEvaluation(\n  realm: Realm,\n  strictCode: boolean,\n  env: LexicalEnvironment,\n  argNodes: Array<BabelNodeExpression | BabelNodeSpreadElement> | BabelNodeTemplateLiteral\n): Array<Value> {\n  if (Array.isArray(argNodes)) {\n    let args = [];\n    for (let node_ of argNodes) {\n      if (node_.type === \"SpreadElement\") {\n        let node = (node_: BabelNodeSpreadElement);\n        // 1. Let list be a new empty List.\n        let list = args;\n\n        // 2. Let spreadRef be the result of evaluating AssignmentExpression.\n        let spreadRef = env.evaluate(node.argument, strictCode);\n\n        // 3. Let spreadObj be ? GetValue(spreadRef).\n        let spreadObj = Environment.GetValue(realm, spreadRef);\n\n        // 4. Let iterator be ? GetIterator(spreadObj).\n        let iterator = GetIterator(realm, spreadObj);\n\n        // 5. Repeat\n        while (true) {\n          // a. Let next be ? IteratorStep(iterator).\n          let next = IteratorStep(realm, iterator);\n\n          // b. If next is false, return list.\n          if (!next) {\n            break;\n          }\n\n          // c. Let nextArg be ? IteratorValue(next).\n          let nextArg = IteratorValue(realm, next);\n\n          // d. Append nextArg as the last element of list.\n          list.push(nextArg);\n        }\n      } else {\n        let ref = env.evaluate(node_, strictCode);\n        let expr = Environment.GetValue(realm, ref);\n        args.push(expr);\n      }\n    }\n    return args;\n  } else {\n    let node = (argNodes: BabelNodeTemplateLiteral);\n    if (node.expressions.length === 0) {\n      // 1. Let templateLiteral be this TemplateLiteral.\n      let templateLiteral = node;\n\n      // 2. Let siteObj be GetTemplateObject(templateLiteral).\n      let siteObj = GetTemplateObject(realm, templateLiteral);\n\n      // 3. Return a List containing the one element which is siteObj.\n      return [siteObj];\n    } else {\n      // 1. Let templateLiteral be this TemplateLiteral.\n      let templateLiteral = node;\n\n      // 2. Let siteObj be GetTemplateObject(templateLiteral).\n      let siteObj = GetTemplateObject(realm, templateLiteral);\n\n      // 3. Let firstSubRef be the result of evaluating Expression.\n      let firstSubRef = env.evaluate(node.expressions[0], strictCode);\n\n      // 4. Let firstSub be ? GetValue(firstSubRef).\n      let firstSub = Environment.GetValue(realm, firstSubRef);\n\n      // 5. Let restSub be SubstitutionEvaluation of TemplateSpans.\n      let restSub = node.expressions.slice(1, node.expressions.length).map(expr => {\n        return Environment.GetValue(realm, env.evaluate(expr, strictCode));\n      });\n\n      // 6. ReturnIfAbrupt(restSub).\n\n      // 7. Assert: restSub is a List.\n      invariant(restSub.constructor === Array, \"restSub is a List\");\n\n      // 8. Return a List whose first element is siteObj, whose second elements is firstSub, and whose subsequent elements are the elements of restSub, in order. restSub may contain no elements.\n      return [siteObj, firstSub, ...restSub];\n    }\n  }\n}\n\n// ECMA262 7.3.18\nexport function Invoke(realm: Realm, V: Value, P: PropertyKeyValue, argumentsList?: Array<Value>): Value {\n  // 1. Assert: IsPropertyKey(P) is true.\n  invariant(IsPropertyKey(realm, P), \"expected property key\");\n\n  // 2. If argumentsList was not passed, let argumentsList be a new empty List.\n  if (!argumentsList) argumentsList = [];\n\n  // 3. Let func be ? GetV(V, P).\n  let func = GetV(realm, V, P);\n\n  // 4. Return ? Call(func, V, argumentsList).\n  return Call(realm, func, V, argumentsList);\n}\n\n// ECMA262 12.3.4.2\nexport function EvaluateCall(\n  realm: Realm,\n  strictCode: boolean,\n  env: LexicalEnvironment,\n  ref: Reference | Value,\n  args: Array<BabelNode> | BabelNodeTemplateLiteral\n): Value {\n  let thisValue;\n\n  // 1. Let func be ? GetValue(ref).\n  let func = Environment.GetValue(realm, ref);\n\n  // 2. If Type(ref) is Reference, then\n  if (ref instanceof Reference) {\n    // a. If IsPropertyReference(ref) is true, then\n    if (Environment.IsPropertyReference(realm, ref)) {\n      // i. Let thisValue be GetThisValue(ref).\n      thisValue = GetThisValue(realm, ref);\n    } else {\n      // b. Else, the base of ref is an Environment Record\n      // i. Let refEnv be GetBase(ref).\n      let refEnv = Environment.GetBase(realm, ref);\n      invariant(refEnv instanceof EnvironmentRecord);\n\n      // ii. Let thisValue be refEnv.WithBaseObject().\n      thisValue = refEnv.WithBaseObject();\n    }\n  } else {\n    // 3. Else Type(ref) is not Reference,\n    // a. Let thisValue be undefined.\n    thisValue = realm.intrinsics.undefined;\n  }\n\n  // 4. Return ? EvaluateDirectCall(func, thisValue, arguments, tailPosition).\n  return EvaluateDirectCall(realm, strictCode, env, ref, func, thisValue, args);\n}\n\n// ECMA262 9.2.1.1\nexport function PrepareForOrdinaryCall(\n  realm: Realm,\n  F: ECMAScriptFunctionValue,\n  newTarget?: ObjectValue\n): ExecutionContext {\n  // 1. Assert: Type(newTarget) is Undefined or Object.\n  invariant(\n    newTarget === undefined || newTarget instanceof ObjectValue,\n    \"expected undefined or object value for new target\"\n  );\n\n  // 2. Let callerContext be the running execution context.\n  let callerContext = realm.getRunningContext();\n\n  // 3. Let calleeContext be a new ECMAScript code execution context.\n  let calleeContext = realm.createExecutionContext();\n\n  // 4. Set the Function of calleeContext to F.\n  calleeContext.setFunction(F);\n  calleeContext.setCaller(realm.getRunningContext());\n\n  // 5. Let calleeRealm be the value of F's [[Realm]] internal slot.\n  let calleeRealm = realm;\n\n  // 6. Set the Realm of calleeContext to calleeRealm.\n  calleeContext.realm = calleeRealm;\n\n  // 7. Set the ScriptOrModule of calleeContext to the value of F's [[ScriptOrModule]] internal slot.\n  calleeContext.ScriptOrModule = F.$ScriptOrModule;\n\n  // 8. Let localEnv be NewFunctionEnvironment(F, newTarget).\n  let localEnv = Environment.NewFunctionEnvironment(realm, F, newTarget);\n\n  // 9. Set the LexicalEnvironment of calleeContext to localEnv.\n  calleeContext.lexicalEnvironment = localEnv;\n\n  // 10. Set the VariableEnvironment of calleeContext to localEnv.\n  calleeContext.variableEnvironment = localEnv;\n\n  // 11. If callerContext is not already suspended, suspend callerContext.\n  callerContext.suspend();\n\n  // 12. Push calleeContext onto the execution context stack; calleeContext is now the running execution context.\n  try {\n    realm.pushContext(calleeContext);\n  } catch (error) {\n    // `realm.pushContext` may throw if we have exceeded the maximum stack size.\n    realm.onDestroyScope(localEnv);\n    throw error;\n  }\n\n  // 13. NOTE Any exception objects produced after this point are associated with calleeRealm.\n\n  // 14. Return calleeContext.\n  return calleeContext;\n}\n\n// ECMA262 9.2.1.2\nexport function OrdinaryCallBindThis(\n  realm: Realm,\n  F: ECMAScriptFunctionValue,\n  calleeContext: ExecutionContext,\n  thisArgument: Value\n): NullValue | ObjectValue | AbstractObjectValue | UndefinedValue {\n  // 1. Let thisMode be the value of F's [[ThisMode]] internal slot.\n  let thisMode = F.$ThisMode;\n\n  // 2. If thisMode is lexical, return NormalCompletion(undefined).\n  if (thisMode === \"lexical\") return realm.intrinsics.undefined;\n\n  // 3. Let calleeRealm be the value of F's [[Realm]] internal slot.\n  let calleeRealm = F.$Realm;\n\n  // 4. Let localEnv be the LexicalEnvironment of calleeContext.\n  let localEnv = calleeContext.lexicalEnvironment;\n\n  let thisValue;\n  // 5. If thisMode is strict, let thisValue be thisArgument.\n  if (thisMode === \"strict\") {\n    thisValue = (thisArgument: any);\n  } else {\n    // 6. Else,\n    // a. If thisArgument is null or undefined, then\n    if (HasSomeCompatibleType(thisArgument, NullValue, UndefinedValue)) {\n      // i. Let globalEnv be calleeRealm.[[GlobalEnv]].\n      let globalEnv = realm.$GlobalEnv;\n\n      // ii. Let globalEnvRec be globalEnv's EnvironmentRecord.\n      let globalEnvRec = globalEnv.environmentRecord;\n      invariant(globalEnvRec instanceof GlobalEnvironmentRecord);\n\n      // iii. Let thisValue be globalEnvRec.[[GlobalThisValue]].\n      thisValue = globalEnvRec.$GlobalThisValue;\n    } else {\n      //  b. Else,\n      // i. Let thisValue be ! ToObject(thisArgument).\n      thisValue = To.ToObject(calleeRealm, thisArgument);\n\n      // ii. NOTE ToObject produces wrapper objects using calleeRealm.\n    }\n  }\n\n  // 7. Let envRec be localEnv's EnvironmentRecord.\n  invariant(localEnv !== undefined);\n  let envRec = localEnv.environmentRecord;\n\n  // 8. Assert: The next step never returns an abrupt completion because envRec.[[ThisBindingStatus]] is not \"initialized\".\n\n  // 9. Return envRec.BindThisValue(thisValue).\n  return envRec.BindThisValue(thisValue);\n}\n\nfunction callNativeFunctionValue(\n  realm: Realm,\n  f: NativeFunctionValue,\n  argumentsList: Array<Value>\n): void | AbruptCompletion {\n  let env = realm.getRunningContext().lexicalEnvironment;\n  let context = env.environmentRecord.GetThisBinding();\n\n  // we have an inConditional flag, as we do not want to return\n  const functionCall = (contextVal, inConditional) => {\n    try {\n      invariant(\n        contextVal instanceof AbstractObjectValue ||\n          contextVal instanceof ObjectValue ||\n          contextVal instanceof NullValue ||\n          contextVal instanceof UndefinedValue ||\n          mightBecomeAnObject(contextVal)\n      );\n      let completion = f.callCallback(\n        // TODO: this is not right. Either fix the type signature of callCallback or wrap contextVal in a coercion\n        ((contextVal: any): AbstractObjectValue | ObjectValue | NullValue | UndefinedValue),\n        argumentsList,\n        env.environmentRecord.$NewTarget\n      );\n      return inConditional ? completion.value : completion;\n    } catch (err) {\n      if (err instanceof AbruptCompletion) {\n        return inConditional ? err.value : err;\n      } else if (err instanceof Error) {\n        throw err;\n      } else {\n        throw new FatalError(err);\n      }\n    }\n  };\n\n  const wrapInReturnCompletion = contextVal => new ReturnCompletion(contextVal, realm.currentLocation);\n\n  if (context instanceof AbstractObjectValue && context.kind === \"conditional\") {\n    let [condValue, consequentVal, alternateVal] = context.args;\n    invariant(condValue instanceof AbstractValue);\n\n    return wrapInReturnCompletion(\n      realm.evaluateWithAbstractConditional(\n        condValue,\n        () => {\n          return realm.evaluateForEffects(\n            () => functionCall(consequentVal, true),\n            null,\n            \"callNativeFunctionValue consequent\"\n          );\n        },\n        () => {\n          return realm.evaluateForEffects(\n            () => functionCall(alternateVal, true),\n            null,\n            \"callNativeFunctionValue alternate\"\n          );\n        }\n      )\n    );\n  }\n  let c = functionCall(context, false);\n  if (c instanceof AbruptCompletion) return c;\n  return undefined;\n}\n\n// ECMA262 9.2.1.3\nexport function OrdinaryCallEvaluateBody(\n  realm: Realm,\n  f: ECMAScriptFunctionValue,\n  argumentsList: Array<Value>\n): void | AbruptCompletion {\n  if (f instanceof NativeFunctionValue) {\n    return callNativeFunctionValue(realm, f, argumentsList);\n  } else {\n    invariant(f instanceof ECMAScriptSourceFunctionValue);\n    let F = f;\n    if (F.$FunctionKind === \"generator\") {\n      // 1. Perform ? FunctionDeclarationInstantiation(functionObject, argumentsList).\n      Functions.FunctionDeclarationInstantiation(realm, F, argumentsList);\n\n      // 2. Let G be ? OrdinaryCreateFromConstructor(functionObject, \"%GeneratorPrototype%\", « [[GeneratorState]], [[GeneratorContext]] »).\n      let G = Create.OrdinaryCreateFromConstructor(realm, F, \"GeneratorPrototype\", {\n        $GeneratorState: undefined,\n        $GeneratorContext: undefined,\n      });\n\n      // 3. Perform GeneratorStart(G, FunctionBody).\n      let code = F.$ECMAScriptCode;\n      invariant(code !== undefined);\n      GeneratorStart(realm, G, code);\n\n      // 4. Return Completion{[[Type]]: return, [[Value]]: G, [[Target]]: empty}.\n      return new ReturnCompletion(G, realm.currentLocation);\n    } else {\n      // TODO #1586: abstractRecursionSummarization is disabled for now, as it is likely too limiting\n      // (as observed in large internal tests).\n      const abstractRecursionSummarization = false;\n      if (!realm.useAbstractInterpretation || realm.pathConditions.isEmpty() || !abstractRecursionSummarization)\n        return normalCall();\n      let savedIsSelfRecursive = F.isSelfRecursive;\n      try {\n        F.isSelfRecursive = false;\n        let effects = realm.evaluateForEffects(guardedCall, undefined, \"OrdinaryCallEvaluateBody\");\n        if (F.isSelfRecursive) {\n          AbstractValue.reportIntrospectionError(F, \"call to function that calls itself\");\n          throw new FatalError();\n          //todo: need to emit a specialized function that temporally captures the heap state at this point\n        } else {\n          realm.applyEffects(effects);\n          let c = effects.result;\n          return processResult(() => {\n            if (c instanceof AbruptCompletion || c instanceof JoinedNormalAndAbruptCompletions) return c;\n            return undefined;\n          });\n        }\n      } finally {\n        F.isSelfRecursive = savedIsSelfRecursive;\n      }\n\n      function guardedCall(): Value | Completion {\n        let currentLocation = realm.currentLocation;\n        if (F.activeArguments !== undefined && F.activeArguments.has(currentLocation)) {\n          let [previousPathLength, previousArguments] = F.activeArguments.get(currentLocation);\n          if (realm.pathConditions.getLength() > previousPathLength) {\n            invariant(previousArguments !== undefined);\n            // F is being called recursively while a call to it is still active\n            F.isSelfRecursive = true;\n            let widenedArgumentsList: Array<Value> = (Widen.widenValues(realm, previousArguments, argumentsList): any);\n            if (Widen.containsArraysOfValue(realm, previousArguments, widenedArgumentsList)) {\n              // Reached a fixed point. Executing this call will not add any knowledge\n              // about the effects of the original call.\n              return realm.intrinsics.undefined;\n            } else {\n              argumentsList = widenedArgumentsList;\n            }\n          }\n        }\n        try {\n          if (F.activeArguments === undefined) F.activeArguments = new Map();\n          F.activeArguments.set(currentLocation, [realm.pathConditions.getLength(), argumentsList]);\n          return normalCall() || realm.intrinsics.undefined;\n        } finally {\n          F.activeArguments.delete(currentLocation);\n        }\n      }\n\n      function normalCall(): void | AbruptCompletion {\n        // 1. Perform ? FunctionDeclarationInstantiation(F, argumentsList).\n        Functions.FunctionDeclarationInstantiation(realm, F, argumentsList);\n\n        // 2. Return the result of EvaluateBody of the parsed code that is the value of F's\n        //    [[ECMAScriptCode]] internal slot passing F as the argument.\n        let code = F.$ECMAScriptCode;\n        invariant(code !== undefined);\n        let context = realm.getRunningContext();\n        return processResult(() => {\n          let c = context.lexicalEnvironment.evaluateCompletionDeref(code, F.$Strict);\n          if (c instanceof AbruptCompletion || c instanceof JoinedNormalAndAbruptCompletions) return c;\n          return undefined;\n        });\n      }\n\n      function processResult(\n        getCompletion: () => void | AbruptCompletion | JoinedNormalAndAbruptCompletions\n      ): void | AbruptCompletion {\n        // We don't want the callee to see abrupt completions from the caller.\n        let priorSavedCompletion = realm.savedCompletion;\n        realm.savedCompletion = undefined;\n\n        let c;\n        try {\n          c = getCompletion();\n        } catch (e) {\n          invariant(!(e instanceof AbruptCompletion));\n          throw e;\n        }\n        c = Functions.incorporateSavedCompletion(realm, c); // in case the callee had conditional abrupt completions\n        realm.savedCompletion = priorSavedCompletion;\n        if (c === undefined) return undefined; // the callee had no returns or throws\n        if (c instanceof ThrowCompletion || c instanceof ReturnCompletion) return c;\n        // Non mixed completions will not be joined completions, but single completions with joined values.\n        // At this point it must be true that\n        // c contains return completions and possibly also normal completions (which are implicitly \"return undefined;\")\n        // and c also contains throw completions. Hence we assert:\n        invariant(c instanceof JoinedAbruptCompletions || c instanceof JoinedNormalAndAbruptCompletions);\n\n        // We want to add only the throw completions to priorSavedCompletion (but must keep their conditions in tact).\n        // The (joined) return completions must be returned to our caller\n        let rc = c;\n        Completion.makeAllNormalCompletionsResultInUndefined(c);\n        c = Completion.normalizeSelectedCompletions(r => r instanceof ReturnCompletion, c);\n        invariant(c.containsSelectedCompletion(r => r instanceof NormalCompletion));\n        let rv = Join.joinValuesOfSelectedCompletions(r => r instanceof NormalCompletion, c);\n        if (c.containsSelectedCompletion(r => r instanceof ThrowCompletion)) {\n          realm.composeWithSavedCompletion(c);\n          if (rv instanceof AbstractValue) {\n            rv = realm.simplifyAndRefineAbstractValue(rv);\n          }\n        }\n        rc = new ReturnCompletion(rv);\n        return rc;\n      }\n    }\n  }\n}\n\n// ECMA262 12.3.4.3\nexport function EvaluateDirectCall(\n  realm: Realm,\n  strictCode: boolean,\n  env: LexicalEnvironment,\n  ref: Value | Reference,\n  func: Value,\n  thisValue: Value,\n  args: Array<BabelNodeExpression | BabelNodeSpreadElement> | BabelNodeTemplateLiteral,\n  tailPosition?: boolean\n): Value {\n  // 1. Let argList be ? ArgumentListEvaluation(arguments).\n  let argList = ArgumentListEvaluation(realm, strictCode, env, args);\n\n  return EvaluateDirectCallWithArgList(realm, strictCode, env, ref, func, thisValue, argList, tailPosition);\n}\n\nexport function EvaluateDirectCallWithArgList(\n  realm: Realm,\n  strictCode: boolean,\n  env: LexicalEnvironment,\n  ref: Value | Reference,\n  func: Value,\n  thisValue: Value,\n  argList: Array<Value>,\n  tailPosition?: boolean\n): Value {\n  if (func instanceof AbstractObjectValue && Value.isTypeCompatibleWith(func.getType(), FunctionValue)) {\n    return AbstractValue.createTemporalFromBuildFunction(\n      realm,\n      func.functionResultType || Value,\n      [func].concat(argList),\n      createOperationDescriptor(\"DIRECT_CALL_WITH_ARG_LIST\")\n    );\n  }\n  func = func.throwIfNotConcrete();\n\n  // 2. If Type(func) is not Object, throw a TypeError exception.\n  if (!(func instanceof ObjectValue)) {\n    throw realm.createErrorThrowCompletion(realm.intrinsics.TypeError, \"not an object\");\n  }\n\n  // 3. If IsCallable(func) is false, throw a TypeError exception.\n  if (!IsCallable(realm, func)) {\n    throw realm.createErrorThrowCompletion(realm.intrinsics.TypeError, \"not callable\");\n  }\n\n  // 4. If tailPosition is true, perform PrepareForTailCall().\n  if (tailPosition === true) PrepareForTailCall(realm);\n\n  // 5. Let result be Call(func, thisValue, argList).\n  let result = Call(realm, func, thisValue, argList);\n\n  // 6. Assert: If tailPosition is true, the above call will not return here, but instead\n  //    evaluation will continue as if the following return has already occurred.\n\n  // 7. Assert: If result is not an abrupt completion, then Type(result) is an ECMAScript language type.\n  invariant(result instanceof Value, \"expected language value type\");\n\n  // 8. Return result.\n  return result;\n}\n\n// ECMA262 14.6.3\nexport function PrepareForTailCall(realm: Realm): void {\n  // 1. Let leafContext be the running execution context.\n  let leafContext = realm.getRunningContext();\n\n  // 2. Suspend leafContext.\n  leafContext.suspend();\n\n  // 3. Pop leafContext from the execution context stack. The execution context now on the\n  //    top of the stack becomes the running execution context.\n  realm.onDestroyScope(leafContext.lexicalEnvironment);\n  realm.popContext(leafContext);\n\n  // TODO #1008 4. Assert: leafContext has no further use. It will never be activated as the running execution context.\n}\n\n// ECMA262 7.3.12\nexport function Call(realm: Realm, F: Value, V: Value, argsList?: Array<Value>): Value {\n  // 1. If argumentsList was not passed, let argumentsList be a new empty List.\n  argsList = argsList || [];\n\n  // 2. If IsCallable(F) is false, throw a TypeError exception.\n  if (IsCallable(realm, F) === false) {\n    throw realm.createErrorThrowCompletion(realm.intrinsics.TypeError, \"not callable\");\n  }\n  if (F instanceof AbstractValue && Value.isTypeCompatibleWith(F.getType(), FunctionValue)) {\n    Leak.value(realm, V);\n    for (let arg of argsList) {\n      Leak.value(realm, arg);\n    }\n    if (V === realm.intrinsics.undefined) {\n      let fullArgs = [F].concat(argsList);\n      return AbstractValue.createTemporalFromBuildFunction(\n        realm,\n        Value,\n        fullArgs,\n        createOperationDescriptor(\"CALL_ABSTRACT_FUNC\")\n      );\n    } else {\n      let fullArgs = [F, V].concat(argsList);\n      return AbstractValue.createTemporalFromBuildFunction(\n        realm,\n        Value,\n        fullArgs,\n        createOperationDescriptor(\"CALL_ABSTRACT_FUNC_THIS\")\n      );\n    }\n  }\n  invariant(F instanceof ObjectValue);\n\n  // 3. Return ? F.[[Call]](V, argumentsList).\n  invariant(F.$Call, \"no call method on this value\");\n  return F.$Call(V, argsList);\n}\n"
  },
  {
    "path": "src/methods/construct.js",
    "content": "/**\n * Copyright (c) 2017-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n/* @flow strict-local */\n\nimport type { Realm } from \"../realm.js\";\nimport {\n  AbstractObjectValue,\n  ECMAScriptSourceFunctionValue,\n  ObjectValue,\n  UndefinedValue,\n  NullValue,\n  Value,\n  EmptyValue,\n} from \"../values/index.js\";\nimport { IsConstructor, IsStatic } from \"./is.js\";\nimport { Get } from \"./get.js\";\nimport { HasSomeCompatibleType } from \"./has.js\";\nimport { Create, Properties } from \"../singletons.js\";\nimport invariant from \"../invariant.js\";\nimport type { BabelNodeClassMethod } from \"@babel/types\";\nimport { PropertyDescriptor } from \"../descriptors.js\";\n\n// ECMA262 9.2.8\nexport function MakeConstructor(\n  realm: Realm,\n  F: ECMAScriptSourceFunctionValue,\n  _writablePrototype?: boolean,\n  _prototype?: ObjectValue\n): UndefinedValue {\n  let writablePrototype = _writablePrototype;\n  let prototype = _prototype;\n  // 1. Assert: F is an ECMAScript function object.\n  invariant(F instanceof ECMAScriptSourceFunctionValue, \"expected function value\");\n\n  // 2. Assert: F has a [[Construct]] internal method.\n  invariant(F.$Construct !== undefined, \"expected construct internal method\");\n\n  // 3. Assert: F is an extensible object that does not have a prototype own property.\n  invariant(F.getExtensible(), \"expected extensible object that doesn't have prototype own property\");\n\n  // 4. If the writablePrototype argument was not provided, let writablePrototype be true.\n  if (writablePrototype === null || writablePrototype === undefined) {\n    writablePrototype = true;\n  }\n\n  // 5. If the prototype argument was not provided, then\n  if (!prototype) {\n    // a. Let prototype be ObjectCreate(%ObjectPrototype%).\n    prototype = Create.ObjectCreate(realm, realm.intrinsics.ObjectPrototype);\n    prototype.originalConstructor = F;\n\n    // b. Perform ! DefinePropertyOrThrow(prototype, \"constructor\", PropertyDescriptor{[[Value]]: F, [[Writable]]: writablePrototype, [[Enumerable]]: false, [[Configurable]]: true }).\n    Properties.DefinePropertyOrThrow(\n      realm,\n      prototype,\n      \"constructor\",\n      new PropertyDescriptor({\n        value: F,\n        writable: writablePrototype,\n        enumerable: false,\n        configurable: true,\n      })\n    );\n  }\n\n  // 6. Perform ! DefinePropertyOrThrow(F, \"prototype\", PropertyDescriptor{[[Value]]: prototype, [[Writable]]: writablePrototype, [[Enumerable]]: false, [[Configurable]]: false}).\n  Properties.DefinePropertyOrThrow(\n    realm,\n    F,\n    \"prototype\",\n    new PropertyDescriptor({\n      value: prototype,\n      writable: writablePrototype,\n      enumerable: false,\n      configurable: false,\n    })\n  );\n\n  // 7. Return NormalCompletion(undefined).\n  return realm.intrinsics.undefined;\n}\n\n// ECMA262 7.3.13\nexport function Construct(\n  realm: Realm,\n  F: ObjectValue,\n  _argumentsList?: Array<Value>,\n  _newTarget?: ObjectValue\n): ObjectValue | AbstractObjectValue {\n  let argumentsList = _argumentsList;\n  let newTarget = _newTarget;\n  // If newTarget was not passed, let newTarget be F.\n  if (!newTarget) newTarget = F;\n\n  // If argumentsList was not passed, let argumentsList be a new empty List.\n  if (!argumentsList) argumentsList = [];\n\n  // Assert: IsConstructor(F) is true.\n  invariant(IsConstructor(realm, F), \"expected constructor\");\n\n  // Assert: IsConstructor(newTarget) is true.\n  invariant(IsConstructor(realm, newTarget), \"expected constructor\");\n\n  // Return ? F.[[Construct]](argumentsList, newTarget).\n  invariant(F.$Construct !== undefined, \"no construct method on realm value\");\n  return F.$Construct(argumentsList, newTarget);\n}\n\n// ECMA262 7.3.20\nexport function SpeciesConstructor(realm: Realm, O: ObjectValue, defaultConstructor: ObjectValue): ObjectValue {\n  // 1. Assert: Type(O) is Object.\n  invariant(O instanceof ObjectValue, \"Type(O) is Object\");\n\n  // 2. Let C be ? Get(O, \"constructor\").\n  let C = Get(realm, O, \"constructor\");\n\n  // 3. If C is undefined, return defaultConstructor.\n  if (C instanceof UndefinedValue) return defaultConstructor;\n\n  // 4. If Type(C) is not Object, throw a TypeError exception.\n  if (C.mightNotBeObject()) {\n    if (C.mightBeObject()) C.throwIfNotConcrete();\n    throw realm.createErrorThrowCompletion(realm.intrinsics.TypeError, \"Type(C) is not an object\");\n  }\n  invariant(C instanceof ObjectValue || C instanceof AbstractObjectValue);\n\n  // 5. Let S be ? Get(C, @@species).\n  let S = Get(realm, C, realm.intrinsics.SymbolSpecies);\n\n  // 6. If S is either undefined or null, return defaultConstructor.\n  if (HasSomeCompatibleType(S, UndefinedValue, NullValue)) return defaultConstructor;\n\n  // 7. If IsConstructor(S) is true, return S.\n  if (IsConstructor(realm, S)) {\n    invariant(S instanceof ObjectValue);\n    return S;\n  }\n\n  // 8. Throw a TypeError exception.\n  throw realm.createErrorThrowCompletion(realm.intrinsics.TypeError, \"Throw a TypeError exception\");\n}\n\n// ECMA 9.2.9\nexport function MakeClassConstructor(realm: Realm, F: ECMAScriptSourceFunctionValue): UndefinedValue {\n  // 1. Assert: F is an ECMAScript function object.\n  invariant(F instanceof ECMAScriptSourceFunctionValue, \"expected function value\");\n\n  // 2. Assert: F’s [[FunctionKind]] internal slot is \"normal\".\n  invariant(F.$FunctionKind === \"normal\");\n\n  // 3. Set F’s [[FunctionKind]] internal slot to \"classConstructor\".\n  F.$FunctionKind = \"classConstructor\";\n\n  // 4. Return NormalCompletion(undefined).\n  return realm.intrinsics.undefined;\n}\n\n// ECMA 14.5.3\nexport function ConstructorMethod(\n  realm: Realm,\n  ClassElementList: Array<BabelNodeClassMethod>\n): EmptyValue | BabelNodeClassMethod {\n  let ClassElement;\n  // ClassElementList : ClassElement\n  if (ClassElementList.length === 1) {\n    ClassElement = ClassElementList[0];\n    // 1. If ClassElement is the production ClassElement : ; , return empty.\n    // It looks like Babel parses out ClassElements that are only ;\n\n    // 2. If IsStatic of ClassElement is true, return empty.\n    if (IsStatic(ClassElement)) {\n      return realm.intrinsics.empty;\n    }\n    // 3. If PropName of ClassElement is not \"constructor\", return empty.\n    if (ClassElement.key.name !== \"constructor\") {\n      return realm.intrinsics.empty;\n    }\n\n    // 4. Return ClassElement.\n    return ClassElement;\n  } else {\n    // ClassElementList : ClassElementList ClassElement\n    // 1. Let head be ConstructorMethod of ClassElementList.\n    let head = ConstructorMethod(realm, ClassElementList.slice(0, -1));\n    // 2. If head is not empty, return head.\n    if (!(head instanceof EmptyValue)) {\n      return head;\n    }\n\n    ClassElement = ClassElementList[ClassElementList.length - 1];\n    // 3. If ClassElement is the production ClassElement : ; , return empty.\n    // It looks like Babel parses out ClassElements that are only ;\n\n    // 4. If IsStatic of ClassElement is true, return empty.\n    if (IsStatic(ClassElement)) {\n      return realm.intrinsics.empty;\n    }\n    // If PropName of ClassElement is not \"constructor\", return empty.\n    if (ClassElement.key.name !== \"constructor\") {\n      return realm.intrinsics.empty;\n    }\n\n    // Return ClassElement.\n    return ClassElement;\n  }\n}\n\n// ECMA 14.5.10\nexport function NonConstructorMethodDefinitions(\n  realm: Realm,\n  ClassElementList: Array<BabelNodeClassMethod>\n): Array<BabelNodeClassMethod> {\n  let ClassElement;\n  // ClassElementList : ClassElement\n  if (ClassElementList.length === 1) {\n    ClassElement = ClassElementList[0];\n    // If ClassElement is the production ClassElement : ; , return a new empty List.\n\n    // If IsStatic of ClassElement is false and PropName of ClassElement is \"constructor\", return a new empty List.\n    if (!IsStatic(ClassElement) && ClassElement.key.name === \"constructor\") {\n      return [];\n    }\n    // Return a List containing ClassElement.\n    return [ClassElement];\n  } else {\n    // ClassElementList : ClassElementList ClassElement\n    ClassElement = ClassElementList[ClassElementList.length - 1];\n\n    // Let list be NonConstructorMethodDefinitions of ClassElementList.\n    let list = NonConstructorMethodDefinitions(realm, ClassElementList.slice(0, -1));\n\n    // If ClassElement is the production ClassElement : ; , return list.\n\n    // If IsStatic of ClassElement is false and PropName of ClassElement is \"constructor\", return list.\n    if (!IsStatic(ClassElement) && ClassElement.key.name === \"constructor\") {\n      return list;\n    }\n\n    // Append ClassElement to the end of list.\n    list.push(ClassElement);\n\n    // Return list.\n    return list;\n  }\n}\n"
  },
  {
    "path": "src/methods/create.js",
    "content": "/**\n * Copyright (c) 2017-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n/* @flow */\n\nimport type { Realm } from \"../realm.js\";\nimport type { EnvironmentRecord } from \"../environment.js\";\nimport type { PropertyKeyValue, IterationKind } from \"../types.js\";\nimport {\n  AbstractObjectValue,\n  ArrayValue,\n  ArgumentsExotic,\n  BooleanValue,\n  FunctionValue,\n  NativeFunctionValue,\n  NullValue,\n  NumberValue,\n  ObjectValue,\n  StringExotic,\n  StringValue,\n  UndefinedValue,\n  Value,\n} from \"../values/index.js\";\nimport { GetPrototypeFromConstructor } from \"./get.js\";\nimport { IsConstructor, IsPropertyKey, IsArray } from \"./is.js\";\nimport { Type, SameValue, RequireObjectCoercible } from \"./abstract.js\";\nimport { Get, GetFunctionRealm } from \"./get.js\";\nimport { Construct, MakeConstructor } from \"./construct.js\";\nimport { Functions, Properties, To } from \"../singletons.js\";\nimport IsStrict from \"../utils/strict.js\";\nimport invariant from \"../invariant.js\";\nimport parse from \"../utils/parse.js\";\nimport traverseFast from \"../utils/traverse-fast.js\";\nimport type { BabelNodeIdentifier, BabelNodeLVal, BabelNodeFunctionDeclaration } from \"@babel/types\";\nimport { PropertyDescriptor } from \"../descriptors.js\";\n\nconst allElementTypes = [\"Undefined\", \"Null\", \"Boolean\", \"String\", \"Symbol\", \"Number\", \"Object\"];\n\nexport class CreateImplementation {\n  // ECMA262 9.4.3.3\n  StringCreate(realm: Realm, value: StringValue, prototype: ObjectValue | AbstractObjectValue): ObjectValue {\n    // 1. Assert: Type(value) is String.\n    invariant(value instanceof StringValue, \"expected string value\");\n\n    // 2. Let S be a newly created String exotic object.\n    let S = new StringExotic(realm);\n\n    // 3. Set the [[StringData]] internal slot of S to value.\n    S.$StringData = value;\n\n    // 4. Set S's essential internal methods to the default ordinary object definitions specified in 9.1.\n\n    // 5. Set the [[GetOwnProperty]] internal method of S as specified in 9.4.3.1.\n\n    // 6. Set the [[OwnPropertyKeys]] internal method of S as specified in 9.4.3.2.\n\n    // 7. Set the [[Prototype]] internal slot of S to prototype.\n    S.$Prototype = prototype;\n\n    // 8. Set the [[Extensible]] internal slot of S to true.\n    S.setExtensible(true);\n\n    // 9. Let length be the number of code unit elements in value.\n    let length = value.value.length;\n\n    // 10. Perform ! DefinePropertyOrThrow(S, \"length\", PropertyDescriptor{[[Value]]: length, [[Writable]]: false, [[Enumerable]]: false, [[Configurable]]: false }).\n    Properties.DefinePropertyOrThrow(\n      realm,\n      S,\n      \"length\",\n      new PropertyDescriptor({\n        value: new NumberValue(realm, length),\n        writable: false,\n        enumerable: false,\n        configurable: false,\n      })\n    );\n\n    // 11. Return S.\n    return S;\n  }\n\n  // B.2.3.2.1\n  CreateHTML(realm: Realm, string: Value, tag: string, attribute: string, value: string | Value): StringValue {\n    // 1. Let str be ? RequireObjectCoercible(string).\n    let str = RequireObjectCoercible(realm, string);\n\n    // 2. Let S be ? ToString(str).\n    let S = To.ToStringPartial(realm, str);\n\n    // 3. Let p1 be the String value that is the concatenation of \"<\" and tag.\n    let p1 = `<${tag}`;\n\n    // 4. If attribute is not the empty String, then\n    if (attribute) {\n      // a. Let V be ? ToString(value).\n      let V = To.ToStringPartial(realm, value);\n\n      // b. Let escapedV be the String value that is the same as V except that each occurrence of the code unit\n      //    0x0022 (QUOTATION MARK) in V has been replaced with the six code unit sequence \"&quot;\".\n      let escapedV = V.replace(/\"/g, \"&quot;\");\n\n      // c. Let p1 be the String value that is the concatenation of the following String values:\n      // - The String value of p1\n      // - Code unit 0x0020 (SPACE)\n      // - The String value of attribute\n      // - Code unit 0x003D (EQUALS SIGN)\n      // - Code unit 0x0022 (QUOTATION MARK)\n      // - The String value of escapedV\n      // - Code unit 0x0022 (QUOTATION MARK)\n      p1 = `${p1} ${attribute}=\"${escapedV}\"`;\n    }\n\n    // 5. Let p2 be the String value that is the concatenation of p1 and \">\".\n    let p2 = `${p1}>`;\n\n    // 6. Let p3 be the String value that is the concatenation of p2 and S.\n    let p3 = `${p2}${S}`;\n\n    // 7. Let p4 be the String value that is the concatenation of p3, \"</\", tag, and \">\".\n    let p4 = `${p3}</${tag}>`;\n\n    // 8. Return p4.\n    return new StringValue(realm, p4);\n  }\n\n  // ECMA262 9.4.4.8.1\n  MakeArgGetter(realm: Realm, name: string, env: EnvironmentRecord): NativeFunctionValue {\n    return new NativeFunctionValue(\n      realm,\n      undefined,\n      undefined,\n      0,\n      context => {\n        return env.GetBindingValue(name, false);\n      },\n      false\n    );\n  }\n\n  // ECMA262 9.4.4.8.1\n  MakeArgSetter(realm: Realm, name: string, env: EnvironmentRecord): NativeFunctionValue {\n    return new NativeFunctionValue(\n      realm,\n      undefined,\n      undefined,\n      1,\n      (context, [value]) => {\n        return env.SetMutableBinding(name, value, false);\n      },\n      false\n    );\n  }\n\n  // ECMA262 21.1.5.1\n  CreateStringIterator(realm: Realm, string: StringValue): ObjectValue {\n    // 1. Assert: Type(string) is String.\n    invariant(string instanceof StringValue, \"expected string to be a string value\");\n\n    // 2. Let iterator be ObjectCreate(%StringIteratorPrototype%, « [[IteratedString]], [[StringIteratorNextIndex]] »).\n    let iterator = this.ObjectCreate(realm, realm.intrinsics.StringIteratorPrototype, {\n      $IteratedString: undefined,\n      $StringIteratorNextIndex: undefined,\n    });\n\n    // 3. Set iterator's [[IteratedString]] internal slot to string.\n    iterator.$IteratedString = string;\n\n    // 4. Set iterator's [[StringIteratorNextIndex]] internal slot to 0.\n    iterator.$StringIteratorNextIndex = 0;\n\n    // 5. Return iterator.\n    return iterator;\n  }\n\n  // ECMA262 9.4.2.3\n  ArraySpeciesCreate(realm: Realm, originalArray: ObjectValue, length: number): ObjectValue {\n    // 1. Assert: length is an integer Number ≥ 0.\n    invariant(length >= 0, \"expected length >= 0\");\n\n    // 2. If length is -0, let length be +0.\n    if (Object.is(length, -0)) length = +0;\n\n    // 3. Let C be undefined.\n    let C = realm.intrinsics.undefined;\n\n    // 4. Let isArray be ? IsArray(originalArray).\n    let isArray = IsArray(realm, originalArray);\n\n    // 5. If isArray is true, then\n    if (isArray) {\n      // a. Let C be ? Get(originalArray, \"constructor\").\n      C = Get(realm, originalArray, \"constructor\");\n\n      // b. If IsConstructor(C) is true, then\n      if (IsConstructor(realm, C)) {\n        invariant(C instanceof ObjectValue);\n        // i. Let thisRealm be the current Realm Record.\n        let thisRealm = realm;\n\n        // ii. Let realmC be ? GetFunctionRealm(C).\n        let realmC = GetFunctionRealm(realm, C);\n\n        // iii. If thisRealm and realmC are not the same Realm Record, then\n        if (thisRealm !== realmC) {\n          // 1. If SameValue(C, realmC.[[Intrinsics]].[[%Array%]]) is true, let C be undefined.\n          if (SameValue(realm, C, realmC.intrinsics.Array)) {\n            C = realm.intrinsics.undefined;\n          }\n        }\n      }\n\n      // c. If Type(C) is Object, then\n      if (C.mightBeObject()) {\n        if (C.mightNotBeObject()) C.throwIfNotConcrete();\n        invariant(C instanceof ObjectValue || C instanceof AbstractObjectValue);\n        // i. Let C be ? Get(C, @@species).\n        C = Get(realm, C, realm.intrinsics.SymbolSpecies);\n\n        // ii. If C is null, let C be undefined.\n        if (C instanceof NullValue) C = realm.intrinsics.undefined;\n      }\n    }\n\n    // 6. If C is undefined, return ? ArrayCreate(length).\n    if (C instanceof UndefinedValue) return this.ArrayCreate(realm, length);\n\n    // 7. If IsConstructor(C) is false, throw a TypeError exception.\n    if (!IsConstructor(realm, C)) {\n      throw realm.createErrorThrowCompletion(realm.intrinsics.TypeError, \"not a constructor\");\n    }\n\n    // 8. Return ? Construct(C, « length »).\n    return Construct(realm, C.throwIfNotConcreteObject(), [new NumberValue(realm, length)]).throwIfNotConcreteObject();\n  }\n\n  // ECMA262 7.4.7\n  CreateIterResultObject(realm: Realm, value: Value, done: boolean): ObjectValue {\n    // 1. Assert: Type(done) is Boolean.\n    invariant(typeof done === \"boolean\", \"expected done to be a boolean\");\n\n    // 2. Let obj be ObjectCreate(%ObjectPrototype%).\n    let obj = this.ObjectCreate(realm, realm.intrinsics.ObjectPrototype);\n\n    // 3. Perform CreateDataProperty(obj, \"value\", value).\n    this.CreateDataProperty(realm, obj, \"value\", value);\n\n    // 4. Perform CreateDataProperty(obj, \"done\", done).\n    this.CreateDataProperty(realm, obj, \"done\", new BooleanValue(realm, done));\n\n    // 5. Return obj.\n    return obj;\n  }\n\n  // ECMA262 22.1.5.1\n  CreateArrayIterator(realm: Realm, array: ObjectValue, kind: IterationKind): ObjectValue {\n    // 1. Assert: Type(array) is Object.\n    invariant(array instanceof ObjectValue, \"expected object\");\n\n    // 2. Let iterator be ObjectCreate(%ArrayIteratorPrototype%, « [[IteratedObject]],\n    //    [[ArrayIteratorNextIndex]], [[ArrayIterationKind]] »).\n    let iterator = this.ObjectCreate(realm, realm.intrinsics.ArrayIteratorPrototype, {\n      $IteratedObject: undefined,\n      $ArrayIteratorNextIndex: undefined,\n      $ArrayIterationKind: undefined,\n    });\n\n    // 3. Set iterator's [[IteratedObject]] internal slot to array.\n    iterator.$IteratedObject = array;\n\n    // 4. Set iterator's [[ArrayIteratorNextIndex]] internal slot to 0.\n    iterator.$ArrayIteratorNextIndex = new NumberValue(realm, 0);\n\n    // 5. Set iterator's [[ArrayIterationKind]] internal slot to kind.\n    iterator.$ArrayIterationKind = kind;\n\n    // 6. Return iterator.\n    return iterator;\n  }\n\n  // ECMA262 9.4.2.2\n  ArrayCreate(realm: Realm, length: number, proto?: ObjectValue | AbstractObjectValue): ArrayValue {\n    // 1. Assert: length is an integer Number ≥ 0.\n    invariant(length >= 0);\n\n    // 2. If length is -0, let length be +0.\n    if (Object.is(length, -0)) length = +0;\n\n    // 3. If length>232-1, throw a RangeError exception.\n    if (length > Math.pow(2, 32) - 1) {\n      throw realm.createErrorThrowCompletion(realm.intrinsics.RangeError, \"length>2^32-1\");\n    }\n\n    // 4. If the proto argument was not passed, let proto be the intrinsic object %ArrayPrototype%.\n    proto = proto || realm.intrinsics.ArrayPrototype;\n\n    // 5. Let A be a newly created Array exotic object.\n    let A = new ArrayValue(realm);\n\n    // 6. Set A's essential internal methods except for [[DefineOwnProperty]] to the default ordinary object definitions specified in 9.1.\n    // 7. Set the [[DefineOwnProperty]] internal method of A as specified in 9.4.2.1.\n\n    // 8. Set the [[Prototype]] internal slot of A to proto.\n    A.$Prototype = proto;\n\n    // 9. Set the [[Extensible]] internal slot of A to true.\n    A.setExtensible(true);\n\n    // 10. Perform ! OrdinaryDefineOwnProperty(A, \"length\", PropertyDescriptor{[[Value]]: length, [[Writable]]: true, [[Enumerable]]: false, [[Configurable]]: false}).\n    Properties.OrdinaryDefineOwnProperty(\n      realm,\n      A,\n      \"length\",\n      new PropertyDescriptor({\n        value: new NumberValue(realm, length),\n        writable: true,\n        enumerable: false,\n        configurable: false,\n      })\n    );\n\n    // 11. Return A.\n    return A;\n  }\n\n  // ECMA262 7.3.16\n  CreateArrayFromList(realm: Realm, elems: Array<Value>): ArrayValue {\n    // 1. Assert: elements is a List whose elements are all ECMAScript language values.\n    for (let elem of elems) invariant(elem instanceof Value, \"value expected\");\n\n    // 2. Let array be ArrayCreate(0) (see 9.4.2.2).\n    let arr = this.ArrayCreate(realm, 0);\n\n    // 3. Let n be 0.\n    let n = 0;\n\n    // 4. For each element e of elements\n    for (let elem of elems) {\n      // a. Let status be CreateDataProperty(array, ! ToString(n), e).\n      let status = this.CreateDataProperty(realm, arr, new StringValue(realm, n + \"\"), elem);\n\n      // b. Assert: status is true.\n      invariant(status, \"couldn't create data property\");\n\n      // c. Increment n by 1.\n      n++;\n    }\n\n    // 5. Return array.\n    return arr;\n  }\n\n  // ECMA262 9.4.4.7\n  CreateUnmappedArgumentsObject(realm: Realm, argumentsList: Array<Value>): ObjectValue {\n    // 1. Let len be the number of elements in argumentsList.\n    let len = argumentsList.length;\n\n    // 2. Let obj be ObjectCreate(%ObjectPrototype%, « [[ParameterMap]] »).\n    let obj = this.ObjectCreate(realm, realm.intrinsics.ObjectPrototype);\n\n    // 3. Set obj's [[ParameterMap]] internal slot to undefined.\n    obj.$ParameterMap = obj; // The value is never used, but allows us to use undefined for \"not in\"\n\n    // 4. Perform DefinePropertyOrThrow(obj, \"length\", PropertyDescriptor{[[Value]]: len,\n    //    [[Writable]]: true, [[Enumerable]]: false, [[Configurable]]: true}).\n    Properties.DefinePropertyOrThrow(\n      realm,\n      obj,\n      \"length\",\n      new PropertyDescriptor({\n        value: new NumberValue(realm, len),\n        writable: true,\n        enumerable: false,\n        configurable: true,\n      })\n    );\n\n    // 5. Let index be 0.\n    let index = 0;\n\n    // 6. Repeat while index < len,\n    while (index < len) {\n      // a. Let val be argumentsList[index].\n      let val = argumentsList[index];\n\n      // b. Perform CreateDataProperty(obj, ! ToString(index), val).\n      this.CreateDataProperty(realm, obj, new StringValue(realm, index + \"\"), val);\n\n      // c. Let index be index + 1.\n      index++;\n    }\n\n    // 7. Perform ! DefinePropertyOrThrow(obj, @@iterator, PropertyDescriptor {[[Value]]:\n    //    %ArrayProto_values%, [[Writable]]: true, [[Enumerable]]: false, [[Configurable]]: true}).\n    Properties.DefinePropertyOrThrow(\n      realm,\n      obj,\n      realm.intrinsics.SymbolIterator,\n      new PropertyDescriptor({\n        value: realm.intrinsics.ArrayProto_values,\n        writable: true,\n        enumerable: false,\n        configurable: true,\n      })\n    );\n\n    // 8. Perform ! DefinePropertyOrThrow(obj, \"callee\", PropertyDescriptor {[[Get]]:\n    // %ThrowTypeError%, [[Set]]: %ThrowTypeError%, [[Enumerable]]: false, [[Configurable]]: false}).\n    Properties.DefinePropertyOrThrow(\n      realm,\n      obj,\n      \"callee\",\n      new PropertyDescriptor({\n        get: realm.intrinsics.ThrowTypeError,\n        set: realm.intrinsics.ThrowTypeError,\n        enumerable: false,\n        configurable: false,\n      })\n    );\n\n    // 10. Return obj.\n    return obj;\n  }\n\n  // ECMA262 9.4.4.8\n  CreateMappedArgumentsObject(\n    realm: Realm,\n    func: FunctionValue,\n    formals: Array<BabelNodeLVal>,\n    argumentsList: Array<Value>,\n    env: EnvironmentRecord\n  ): ObjectValue {\n    // 1. Assert: formals does not contain a rest parameter, any binding patterns, or any\n    //    initializers. It may contain duplicate identifiers.\n    for (let param of formals) {\n      invariant(param.type === \"Identifier\", \"expected only simple params\");\n    }\n\n    // 2. Let len be the number of elements in argumentsList.\n    let len = argumentsList.length;\n\n    // 3. Let obj be a newly created arguments exotic object with a [[ParameterMap]] internal slot.\n    let obj = new ArgumentsExotic(realm);\n\n    // 4. Set the [[GetOwnProperty]] internal method of obj as specified in 9.4.4.1.\n\n    // 5. Set the [[DefineOwnProperty]] internal method of obj as specified in 9.4.4.2.\n\n    // 6. Set the [[Get]] internal method of obj as specified in 9.4.4.3.\n\n    // 7. Set the [[Set]] internal method of obj as specified in 9.4.4.4.\n\n    // 8. Set the [[Delete]] internal method of obj as specified in 9.4.4.6.\n\n    // 9. Set the remainder of obj's essential internal methods to the default ordinary\n    //    object definitions specified in 9.1.\n\n    // 10. Set the [[Prototype]] internal slot of obj to %ObjectPrototype%.\n    obj.$Prototype = realm.intrinsics.ObjectPrototype;\n\n    // 11. Set the [[Extensible]] internal slot of obj to true.\n    obj.setExtensible(true);\n\n    // 12. Let map be ObjectCreate(null).\n    let map: ObjectValue = new ObjectValue(realm);\n\n    // 13. Set the [[ParameterMap]] internal slot of obj to map.\n    obj.$ParameterMap = map;\n\n    // 14. Let parameterNames be the BoundNames of formals.\n    let parameterNames = [];\n    for (let param of formals) {\n      parameterNames.push(((param: any): BabelNodeIdentifier).name);\n    }\n\n    // 15. Let numberOfParameters be the number of elements in parameterNames.\n    let numberOfParameters = parameterNames.length;\n\n    // 16. Let index be 0.\n    let index = 0;\n\n    // 17. Repeat while index < len,\n    while (index < len) {\n      // a. Let val be argumentsList[index].\n      let val = argumentsList[index];\n\n      // b. Perform CreateDataProperty(obj, ! ToString(index), val).\n      this.CreateDataProperty(realm, obj, new StringValue(realm, index + \"\"), val);\n\n      // c. Let index be index + 1.\n      index++;\n    }\n\n    // 18. Perform DefinePropertyOrThrow(obj, \"length\", PropertyDescriptor{[[Value]]: len,\n    //     [[Writable]]: true, [[Enumerable]]: false, [[Configurable]]: true}).\n    Properties.DefinePropertyOrThrow(\n      realm,\n      obj,\n      \"length\",\n      new PropertyDescriptor({\n        value: new NumberValue(realm, len),\n        writable: true,\n        enumerable: false,\n        configurable: true,\n      })\n    );\n\n    // 19. Let mappedNames be an empty List.\n    let mappedNames = [];\n\n    // 20. Let index be numberOfParameters - 1.\n    index = numberOfParameters - 1;\n\n    // 21. Repeat while index ≥ 0,\n    while (index >= 0) {\n      // a. Let name be parameterNames[index].\n      let name = parameterNames[index];\n\n      // b. If name is not an element of mappedNames, then\n      if (mappedNames.indexOf(name) < 0) {\n        // i. Add name as an element of the list mappedNames.\n        mappedNames.push(name);\n\n        // ii. If index < len, then\n        if (index < len) {\n          // 1. Let g be MakeArgGetter(name, env).\n          let g = this.MakeArgGetter(realm, name, env);\n\n          // 2. Let p be MakeArgSetter(name, env).\n          let p = this.MakeArgSetter(realm, name, env);\n\n          // 3. Perform map.[[DefineOwnProperty]](! ToString(index), PropertyDescriptor{[[Set]]: p, [[Get]]: g,\n          //    [[Enumerable]]: false, [[Configurable]]: true}).\n          map.$DefineOwnProperty(\n            new StringValue(realm, index + \"\"),\n            new PropertyDescriptor({\n              set: p,\n              get: g,\n              enumerable: false,\n              configurable: true,\n            })\n          );\n        }\n      }\n\n      // c. Let index be index - 1.\n      index--;\n    }\n\n    // 22. Perform ! DefinePropertyOrThrow(obj, @@iterator, PropertyDescriptor {[[Value]]:\n    //     %ArrayProto_values%, [[Writable]]: true, [[Enumerable]]: false, [[Configurable]]: true}).\n    Properties.DefinePropertyOrThrow(\n      realm,\n      obj,\n      realm.intrinsics.SymbolIterator,\n      new PropertyDescriptor({\n        value: realm.intrinsics.ArrayProto_values,\n        writable: true,\n        enumerable: false,\n        configurable: true,\n      })\n    );\n\n    // 23. Perform ! DefinePropertyOrThrow(obj, \"callee\", PropertyDescriptor {[[Value]]:\n    //     func, [[Writable]]: true, [[Enumerable]]: false, [[Configurable]]: true}).\n    Properties.DefinePropertyOrThrow(\n      realm,\n      obj,\n      \"callee\",\n      new PropertyDescriptor({\n        value: func,\n        writable: true,\n        enumerable: false,\n        configurable: true,\n      })\n    );\n\n    // 24. Return obj.\n    return obj;\n  }\n\n  // ECMA262 7.3.4\n  CreateDataProperty(realm: Realm, O: ObjectValue | AbstractObjectValue, P: PropertyKeyValue, V: Value): boolean {\n    // 1. Assert: Type(O) is Object.\n\n    // 2. Assert: IsPropertyKey(P) is true.\n    invariant(IsPropertyKey(realm, P), \"Not a property key\");\n\n    // 3. Let newDesc be the PropertyDescriptor{[[Value]]: V, [[Writable]]: true, [[Enumerable]]: true, [[Configurable]]: true}.\n    let newDesc = new PropertyDescriptor({\n      value: V,\n      writable: true,\n      enumerable: true,\n      configurable: true,\n    });\n\n    // 4. Return ? O.[[DefineOwnProperty]](P, newDesc).\n    return O.$DefineOwnProperty(P, newDesc);\n  }\n\n  CopyDataProperties(realm: Realm, target: ObjectValue, source: Value, excluded: Array<PropertyKeyValue>): ObjectValue {\n    // Assert: Type(target) is Object.\n    invariant(target instanceof ObjectValue, \"Not an object value\");\n\n    // Assert: Type(excluded) is List.\n    invariant(excluded instanceof Array, \"Not an array\");\n\n    //   If source is undefined or null,\n    if (source === realm.intrinsics.null || source === realm.intrinsics.undefined) {\n      // let keys be a new empty List.\n    } else {\n      //   Else,\n      // Let from be ! ToObject(source).\n      let from = To.ToObject(realm, source);\n\n      // Let keys be ? from.[[OwnPropertyKeys]]().\n      let keys = from.$OwnPropertyKeys();\n\n      //   Repeat for each element nextKey of keys in List order,\n      for (let nextKey of keys) {\n        // Let found be false.\n        let found = false;\n\n        //   Repeat for each element e of excluded,\n        for (let e of excluded) {\n          // Seems necessary. Flow complained too. Did I go wrong somewhere else?\n          invariant(e instanceof StringValue);\n          invariant(nextKey instanceof StringValue);\n\n          // If e is not empty and SameValue(e, nextKey) is true, then\n          if (!e.mightBeFalse() && SameValue(realm, e, nextKey)) {\n            // Set found to true.\n            found = true;\n          }\n        }\n        // If found is false, then\n        if (found === false) {\n          // Let desc be ? from.[[GetOwnProperty]](nextKey).\n          let desc = from.$GetOwnProperty(nextKey);\n\n          // If desc is not undefined and desc.[[Enumerable]] is true, then\n          if (desc !== undefined && desc.throwIfNotConcrete(realm).enumerable === true) {\n            // Let propValue be ? Get(from, nextKey).\n            let propValue = Get(realm, from, nextKey);\n            // Perform ! CreateDataProperty(target, nextKey, propValue).\n            this.CreateDataProperty(realm, target, nextKey, propValue);\n          }\n        }\n      }\n    }\n\n    // Return target.\n    return target;\n  }\n\n  // ECMA262 7.3.5\n  CreateMethodProperty(realm: Realm, O: ObjectValue, P: PropertyKeyValue, V: Value): boolean {\n    // 1. Assert: Type(O) is Object.\n    invariant(O instanceof ObjectValue, \"Not an object value\");\n\n    // 2. Assert: IsPropertyKey(P) is true.\n    invariant(IsPropertyKey(realm, P), \"Not a property key\");\n\n    // 3. Let newDesc be the PropertyDescriptor{[[Value]]: V, [[Writable]]: true, [[Enumerable]]: false, [[Configurable]]: true}.\n    let newDesc = new PropertyDescriptor({\n      value: V,\n      writable: true,\n      enumerable: false,\n      configurable: true,\n    });\n\n    // 4. Return ? O.[[DefineOwnProperty]](P, newDesc).\n    return O.$DefineOwnProperty(P, newDesc);\n  }\n\n  // ECMA262 7.3.6\n  CreateDataPropertyOrThrow(realm: Realm, O: Value, P: PropertyKeyValue, V: Value): boolean {\n    // 1. Assert: Type(O) is Object.\n    invariant(O instanceof ObjectValue, \"Not an object value\");\n\n    // 2. Assert: IsPropertyKey(P) is true.\n    invariant(IsPropertyKey(realm, P), \"Not a property key\");\n\n    //3. Let success be ? CreateDataProperty(O, P, V).\n    let success = this.CreateDataProperty(realm, O, P, V);\n\n    // 4. If success is false, throw a TypeError exception.\n    if (success === false) {\n      throw realm.createErrorThrowCompletion(realm.intrinsics.TypeError, \"not a function\");\n    }\n\n    // 5. Return success.\n    return success;\n  }\n\n  // ECMA262 9.1.12\n  ObjectCreate(\n    realm: Realm,\n    proto: ObjectValue | AbstractObjectValue | NullValue,\n    internalSlotsList?: { [key: string]: void }\n  ): ObjectValue {\n    // 1. If internalSlotsList was not provided, let internalSlotsList be an empty List.\n    internalSlotsList = internalSlotsList || {};\n\n    // 2. Let obj be a newly created object with an internal slot for each name in internalSlotsList.\n    let obj = new ObjectValue(realm);\n    Object.assign(obj, internalSlotsList);\n\n    // 3. Set obj's essential internal methods to the default ordinary object definitions specified in 9.1.\n\n    // 4. Set the [[Prototype]] internal slot of obj to proto.\n    obj.$Prototype = proto;\n\n    // 5. Set the [[Extensible]] internal slot of obj to true.\n    obj.setExtensible(true);\n\n    // 6. Return obj.\n    return obj;\n  }\n\n  // ECMA262 9.1.13\n  OrdinaryCreateFromConstructor(\n    realm: Realm,\n    constructor: ObjectValue,\n    intrinsicDefaultProto: string,\n    internalSlotsList?: { [key: string]: void }\n  ): ObjectValue {\n    // 1. Assert: intrinsicDefaultProto is a String value that is this specification's name of an intrinsic\n    //    object. The corresponding object must be an intrinsic that is intended to be used as the [[Prototype]]\n    //    value of an object.\n    invariant(realm.intrinsics[intrinsicDefaultProto], \"not a valid proto ref\");\n\n    // 2. Let proto be ? GetPrototypeFromConstructor(constructor, intrinsicDefaultProto).\n    let proto = GetPrototypeFromConstructor(realm, constructor, intrinsicDefaultProto);\n\n    // 3. Return ObjectCreate(proto, internalSlotsList).\n    return this.ObjectCreate(realm, proto, internalSlotsList);\n  }\n\n  // ECMA262 7.3.17\n  CreateListFromArrayLike(realm: Realm, obj: Value, elementTypes?: Array<string>): Array<Value> {\n    // 1. If elementTypes was not passed, let elementTypes be « Undefined, Null, Boolean, String, Symbol, Number, Object ».\n    elementTypes = elementTypes || allElementTypes;\n\n    // 2. If Type(obj) is not Object, throw a TypeError exception.\n    if (!(obj instanceof ObjectValue)) {\n      throw realm.createErrorThrowCompletion(realm.intrinsics.TypeError, \"Not an object\");\n    }\n\n    // 3. Let len be ? ToLength(? Get(obj, \"length\")).\n    let len = To.ToLength(realm, Get(realm, obj, \"length\"));\n\n    // 4. Let list be a new empty List.\n    let list: Array<Value> = [];\n\n    // 5. Let index be 0.\n    let index = 0;\n\n    // 6. Repeat while index < len\n    while (index < len) {\n      // a. Let indexName be ! ToString(index).\n      let indexName = index + \"\";\n\n      // b. Let next be ? Get(obj, indexName).\n      let next = Get(realm, obj, indexName);\n\n      // c. If Type(next) is not an element of elementTypes, throw a TypeError exception.\n      if (elementTypes !== allElementTypes && elementTypes.indexOf(Type(realm, next)) < 0) {\n        throw realm.createErrorThrowCompletion(realm.intrinsics.TypeError, \"invalid element type\");\n      }\n\n      // d. Append next as the last element of list.\n      list.push(next);\n\n      // e. Set index to index + 1.\n      index++;\n    }\n\n    // 7. Return list.\n    return list;\n  }\n\n  // ECMA262 19.2.1.1.1\n  CreateDynamicFunction(\n    realm: Realm,\n    constructor: ObjectValue,\n    newTarget: void | ObjectValue,\n    kind: \"normal\" | \"generator\",\n    args: Array<Value>\n  ): Value {\n    // 1. If newTarget is undefined, let newTarget be constructor.\n    newTarget = !newTarget ? constructor : newTarget;\n\n    let fallbackProto;\n    // 2. If kind is \"normal\", then\n    if (kind === \"normal\") {\n      // a. Let goal be the grammar symbol FunctionBody.\n\n      // b. Let parameterGoal be the grammar symbol FormalParameters.\n\n      // c. Let fallbackProto be \"%FunctionPrototype%\".\n      fallbackProto = \"FunctionPrototype\";\n    } else {\n      // 3. Else,\n      // a. Let goal be the grammar symbol GeneratorBody.\n\n      // b. Let parameterGoal be the grammar symbol FormalParameters[Yield].\n\n      // c. Let fallbackProto be \"%Generator%\".\n      fallbackProto = \"Generator\";\n    }\n\n    // 4. Let argCount be the number of elements in args.\n    let argCount = args.length;\n\n    // 5. Let P be the empty String.\n    let P = \"\";\n\n    let bodyText;\n    // 6. If argCount = 0, let bodyText be the empty String.\n    if (argCount === 0) {\n      bodyText = realm.intrinsics.emptyString;\n    } else if (argCount === 1) {\n      // 7. Else if argCount = 1, let bodyText be args[0].\n      bodyText = args[0];\n    } else {\n      // 8. Else argCount > 1,\n      // a. Let firstArg be args[0].\n      let firstArg = args[0];\n\n      // b. Let P be ? ToString(firstArg).\n      P = To.ToStringPartial(realm, firstArg);\n\n      // c. Let k be 1.\n      let k = 1;\n\n      // d. Repeat, while k < argCount-1\n      while (k < argCount - 1) {\n        // i. Let nextArg be args[k].\n        let nextArg = args[k];\n\n        // ii. Let nextArgString be ? ToString(nextArg).\n        let nextArgString = To.ToStringPartial(realm, nextArg);\n\n        // iii. Let P be the result of concatenating the previous value of P, the String \",\" (a comma), and nextArgString.\n        P = P + \",\" + nextArgString;\n\n        // iv. Increase k by 1.\n        k += 1;\n      }\n\n      // e. Let bodyText be args[k].\n      bodyText = args[k];\n    }\n\n    // 9. Let bodyText be ? ToString(bodyText).\n    bodyText = To.ToStringPartial(realm, bodyText);\n\n    // 10. Let parameters be the result of parsing P, interpreted as UTF-16 encoded Unicode text as described in 6.1.4, using parameterGoal as the goal symbol. Throw a SyntaxError exception if the parse fails.\n    // 11. Let body be the result of parsing bodyText, interpreted as UTF-16 encoded Unicode text as described in 6.1.4, using goal as the goal symbol. Throw a SyntaxError exception if the parse fails.\n    let ast;\n    try {\n      ast = parse(realm, \"function\" + (kind === \"generator\" ? \"*\" : \"\") + \" _(\" + P + \"){\" + bodyText + \"}\", \"eval\");\n    } catch (e) {\n      throw realm.createErrorThrowCompletion(realm.intrinsics.SyntaxError, \"parse failed\");\n    }\n    let {\n      program: {\n        body: [functionDeclaration],\n      },\n    } = ast;\n    if (!functionDeclaration) {\n      throw realm.createErrorThrowCompletion(realm.intrinsics.SyntaxError, \"parse failed\");\n    }\n    invariant(functionDeclaration.type === \"FunctionDeclaration\");\n    let { params, body } = ((functionDeclaration: any): BabelNodeFunctionDeclaration);\n\n    // 12. If bodyText is strict mode code, then let strict be true, else let strict be false.\n    let strict = IsStrict(body);\n\n    // 13. If any static semantics errors are detected for parameters or body, throw a SyntaxError or a ReferenceError exception, depending on the type of the error. If strict is true, the Early Error rules for StrictFormalParameters:FormalParameters are applied. Parsing and early error detection may be interweaved in an implementation dependent manner.\n\n    // 14. If ContainsUseStrict of body is true and IsSimpleParameterList of parameters is false, throw a SyntaxError exception.\n\n    // 15. If any element of the BoundNames of parameters also occurs in the LexicallyDeclaredNames of body, throw a SyntaxError exception.\n\n    // 16. If body Contains SuperCall is true, throw a SyntaxError exception.\n\n    // 17. If parameters Contains SuperCall is true, throw a SyntaxError exception.\n\n    // 18. If body Contains SuperProperty is true, throw a SyntaxError exception.\n\n    // 19. If parameters Contains SuperProperty is true, throw a SyntaxError exception.\n\n    // 20. If kind is \"generator\", then\n    if (kind === \"generator\") {\n      // a. If parameters Contains YieldExpression is true, throw a SyntaxError exception.\n      let containsYield = false;\n      for (let param of params) {\n        traverseFast(param, node => {\n          if (node.type === \"YieldExpression\") {\n            containsYield = true;\n            return true;\n          }\n          if (node.type === \"Identifier\" && ((node: any): BabelNodeIdentifier).name === \"yield\") {\n            containsYield = true;\n            return true;\n          }\n          return false;\n        });\n      }\n      if (containsYield) {\n        throw realm.createErrorThrowCompletion(realm.intrinsics.SyntaxError, \"parse failed\");\n      }\n    }\n\n    // 21. If strict is true, then\n    if (strict === true) {\n      // a. If BoundNames of parameters contains any duplicate elements, throw a SyntaxError exception.\n    }\n\n    // 22. Let proto be ? GetPrototypeFromConstructor(newTarget, fallbackProto).\n    let proto = GetPrototypeFromConstructor(realm, newTarget, fallbackProto);\n\n    // 23. Let F be FunctionAllocate(proto, strict, kind).\n    let F = Functions.FunctionAllocate(realm, proto, strict, kind);\n\n    // 24. Let realmF be the value of F's [[Realm]] internal slot.\n    let realmF = F.$Realm;\n\n    // 25. Let scope be realmF.[[GlobalEnv]].\n    let scope = realmF.$GlobalEnv;\n\n    // 26. Perform FunctionInitialize(F, Normal, parameters, body, scope).\n    Functions.FunctionInitialize(realm, F, \"normal\", params, body, scope);\n\n    // 27. If kind is \"generator\", then\n    if (kind === \"generator\") {\n      // a. Let prototype be ObjectCreate(%GeneratorPrototype%).\n      let prototype = this.ObjectCreate(realm, realm.intrinsics.GeneratorPrototype);\n      prototype.originalConstructor = F;\n\n      // b. Perform DefinePropertyOrThrow(F, \"prototype\", PropertyDescriptor{[[Value]]: prototype, [[Writable]]: true, [[Enumerable]]: false, [[Configurable]]: false}).\n      Properties.DefinePropertyOrThrow(\n        realm,\n        F,\n        \"prototype\",\n        new PropertyDescriptor({\n          value: prototype,\n          writable: true,\n          enumerable: false,\n          configurable: false,\n        })\n      );\n    } else {\n      // 28. Else, perform MakeConstructor(F).\n      MakeConstructor(realm, F);\n    }\n\n    // 29. Perform SetFunctionName(F, \"anonymous\").\n    Functions.SetFunctionName(realm, F, \"anonymous\");\n\n    // 30. Return F.\n    return F;\n  }\n}\n"
  },
  {
    "path": "src/methods/date.js",
    "content": "/**\n * Copyright (c) 2017-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n/* @flow strict-local */\n\nimport { NumberValue, Value, ObjectValue } from \"../values/index.js\";\nimport type { Realm } from \"../realm.js\";\nimport { To } from \"../singletons.js\";\nimport invariant from \"../invariant.js\";\n\n// Constants\nexport const SecondsPerMinute = 60;\nexport const MinutesPerHour = 60;\nexport const HoursPerDay = 24;\nexport const msPerSecond = 1000;\nexport const msPerMinute = msPerSecond * SecondsPerMinute;\nexport const msPerHour = msPerMinute * MinutesPerHour;\nexport const msPerDay = msPerHour * HoursPerDay;\n\nlet LocalTZA = -new Date(0).getTimezoneOffset() * msPerMinute;\n\n// ECMA262 20.3.1.2\nexport function Day(realm: Realm, t: number): number {\n  return Math.floor(t / msPerDay);\n}\n\n// ECMA262 20.3.1.2\nexport function TimeWithinDay(realm: Realm, t: number): number {\n  return t % msPerDay;\n}\n\n// ECMA262 20.3.1.3\nexport function DaysInYear(realm: Realm, y: number): 365 | 366 {\n  if (y % 4 !== 0) return 365;\n  if (y % 4 === 0 && y % 100 !== 0) return 366;\n  if (y % 100 === 0 && y % 400 !== 0) return 365;\n  if (y % 400 === 0) return 366;\n\n  invariant(false, \"Invalid condition\");\n}\n\n// ECMA262 20.3.1.3\nexport function DayFromYear(realm: Realm, y: number): number {\n  return 365 * (y - 1970) + Math.floor((y - 1969) / 4) - Math.floor((y - 1901) / 100) + Math.floor((y - 1601) / 400);\n}\n\n// ECMA262 20.3.1.3\nexport function TimeFromYear(realm: Realm, y: number): number {\n  return msPerDay * DayFromYear(realm, y);\n}\n\n// ECMA262 20.3.1.3\nexport function YearFromTime(realm: Realm, t: number): number {\n  let y = Math.floor(t / (msPerDay * 365.2425)) + 1970;\n  let t2 = TimeFromYear(realm, y);\n\n  if (t2 > t) {\n    y--;\n  } else {\n    if (t2 + msPerDay * DaysInYear(realm, y) <= t) {\n      y++;\n    }\n  }\n  return y;\n}\n\n// ECMA262 20.3.1.3\nexport function InLeapYear(realm: Realm, t: number): number {\n  let daysInYear = DaysInYear(realm, YearFromTime(realm, t));\n  if (daysInYear === 365) return 0;\n  if (daysInYear === 366) return 1;\n  invariant(false, \"invalid condition\");\n}\n\n// ECMA262 20.3.1.4\nexport function MonthFromTime(realm: Realm, t: number): number {\n  let step: ?number;\n  let d = DayWithinYear(realm, t);\n\n  if (d < (step = 31)) return 0;\n\n  step += InLeapYear(realm, t) ? 29 : 28;\n  if (d < step) return 1;\n  if (d < (step += 31)) return 2;\n  if (d < (step += 30)) return 3;\n  if (d < (step += 31)) return 4;\n  if (d < (step += 30)) return 5;\n  if (d < (step += 31)) return 6;\n  if (d < (step += 31)) return 7;\n  if (d < (step += 30)) return 8;\n  if (d < (step += 31)) return 9;\n  if (d < (step += 30)) return 10;\n  return 11;\n}\n\n// ECMA262 20.3.1.4\nexport function DayWithinYear(realm: Realm, t: number): number {\n  return Day(realm, t) - DayFromYear(realm, YearFromTime(realm, t));\n}\n\n// ECMA262 20.3.1.5\nexport function DateFromTime(realm: Realm, t: number): number {\n  let step: ?number;\n  let next: ?number;\n  let d = DayWithinYear(realm, t);\n\n  if (d <= (next = 30)) return d + 1;\n\n  step = next;\n  next += InLeapYear(realm, t) ? 29 : 28;\n  if (d <= next) return d - step;\n\n  step = next;\n  if (d <= (next += 31)) return d - step;\n\n  step = next;\n  if (d <= (next += 30)) return d - step;\n\n  step = next;\n  if (d <= (next += 31)) return d - step;\n\n  step = next;\n  if (d <= (next += 30)) return d - step;\n\n  step = next;\n  if (d <= (next += 31)) return d - step;\n\n  step = next;\n  if (d <= (next += 31)) return d - step;\n\n  step = next;\n  if (d <= (next += 30)) return d - step;\n\n  step = next;\n  if (d <= (next += 31)) return d - step;\n\n  step = next;\n  if (d <= (next += 30)) return d - step;\n\n  step = next;\n  return d - step;\n}\n\n// ECMA262 20.3.1.6\nexport function WeekDay(realm: Realm, t: number): number {\n  return (Day(realm, t) + 4) % 7;\n}\n\n// ECMA262 20.3.1.7\nexport function DaylightSavingTA(realm: Realm, t: number): number {\n  // TODO #1014: Implement DaylightSavingTA\n  return 0;\n}\n\n// ECMA262 20.3.1.9\nexport function LocalTime(realm: Realm, t: number): number {\n  // 1. Return t + LocalTZA + DaylightSavingTA(t).\n  return t + LocalTZA + DaylightSavingTA(realm, t);\n}\n\n// ECMA262 20.3.1.10\nexport function UTC(realm: Realm, _t: number | Value): NumberValue {\n  let t = _t;\n  if (t instanceof Value) t = t.throwIfNotConcreteNumber().value;\n\n  // 1. Return t - LocalTZA - DaylightSavingTA(t - LocalTZA).\n  return new NumberValue(realm, (t: number) - LocalTZA - DaylightSavingTA(realm, (t: number) - LocalTZA));\n}\n\n// ECMA262 20.3.1.11\nexport function HourFromTime(realm: Realm, t: number): number {\n  return Math.floor(t / msPerHour) % HoursPerDay;\n}\n\n// ECMA262 20.3.1.11\nexport function MinFromTime(realm: Realm, t: number): number {\n  return Math.floor(t / msPerMinute) % MinutesPerHour;\n}\n\n// ECMA262 20.3.1.11\nexport function SecFromTime(realm: Realm, t: number): number {\n  return Math.floor(t / msPerSecond) % SecondsPerMinute;\n}\n\n// ECMA262 20.3.1.11\nexport function msFromTime(realm: Realm, t: number): number {\n  return t % msPerSecond;\n}\n\n// ECMA262 20.3.1.12\nexport function MakeTime(realm: Realm, hour: number, min: number, sec: number, ms: number): number {\n  // 1. If hour is not finite or min is not finite or sec is not finite or ms is not finite, return NaN.\n  if (!isFinite(hour) || !isFinite(min) || !isFinite(sec) || !isFinite(ms)) return NaN;\n\n  // 2. Let h be ToInteger(hour).\n  let h = To.ToInteger(realm, new NumberValue(realm, hour));\n\n  // 3. Let m be ToInteger(min).\n  let m = To.ToInteger(realm, new NumberValue(realm, min));\n\n  // 4. Let s be ToInteger(sec).\n  let s = To.ToInteger(realm, new NumberValue(realm, sec));\n\n  // 5. Let milli be ToInteger(ms).\n  let milli = To.ToInteger(realm, new NumberValue(realm, ms));\n\n  // 6. Let t be h * msPerHour + m * msPerMinute + s * msPerSecond + milli, performing the arithmetic\n  //    according to IEEE 754-2008 rules (that is, as if using the ECMAScript operators * and +).\n  let t = h * msPerHour + m * msPerMinute + s * msPerSecond + milli;\n\n  // 7. Return t.\n  return t;\n}\n\n// ECMA262 20.3.1.13\nexport function MakeDay(realm: Realm, year: number, month: number, date: number): number {\n  // 1. If year is not finite or month is not finite or date is not finite, return NaN.\n  if (!isFinite(year) || !isFinite(month) || !isFinite(date)) return NaN;\n\n  // 2. Let y be ToInteger(year).\n  let y = To.ToInteger(realm, new NumberValue(realm, year));\n\n  // 3. Let m be ToInteger(month).\n  let m = To.ToInteger(realm, new NumberValue(realm, month));\n\n  // 4. Let dt be ToInteger(date).\n  let dt = To.ToInteger(realm, new NumberValue(realm, date));\n\n  // 5. Let ym be y + floor(m / 12).\n  let ym = y + Math.floor(m / 12);\n\n  // 6. Let mn be m modulo 12.\n  let mn = m < 0 ? (m % 12) + 12 : m % 12;\n\n  // 7. Find a value t such that YearFromTime(t) is ym and MonthFromTime(t) is mn and DateFromTime(t) is 1;\n  //    but if this is not possible (because some argument is out of range), return NaN.\n  //    Inspired by the V8 implementation.\n  if (Math.abs(ym) >= 1000000.0 || Math.abs(mn) >= 1000000.0) {\n    return NaN;\n  }\n  const yearDelta = 399999;\n  const baseDay =\n    365 * (1970 + yearDelta) +\n    Math.floor((1970 + yearDelta) / 4) -\n    Math.floor((1970 + yearDelta) / 100) +\n    Math.floor((1970 + yearDelta) / 400);\n  let t =\n    365 * (ym + yearDelta) +\n    Math.floor((ym + yearDelta) / 4) -\n    Math.floor((ym + yearDelta) / 100) +\n    Math.floor((ym + yearDelta) / 400) -\n    baseDay;\n\n  if (ym % 4 !== 0 || (ym % 100 === 0 && ym % 400 !== 0)) {\n    t += [0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334][mn];\n  } else {\n    t += [0, 31, 60, 91, 121, 152, 182, 213, 244, 274, 305, 335][mn];\n  }\n\n  // 8. Return Day(t) + dt - 1.\n  return t + dt - 1;\n}\n\n// ECMA262 20.3.1.14\nexport function MakeDate(realm: Realm, day: number, time: number): number {\n  // 1. If day is not finite or time is not finite, return NaN.\n  if (!isFinite(day) || !isFinite(time)) return NaN;\n\n  // 2. Return day × msPerDay + time.\n  return day * msPerDay + time;\n}\n\n// ECMA262 20.3.1.15\nexport function TimeClip(realm: Realm, _time: number | Value): NumberValue {\n  let time = _time;\n  if (time instanceof Value) time = time.throwIfNotConcreteNumber().value;\n  // 1. If time is not finite, return NaN.\n  if (!isFinite(time)) return realm.intrinsics.NaN;\n\n  // 2. If abs(time) > 8.64 × 10^15, return NaN.\n  if (Math.abs((time: number)) > 8640000000000000) {\n    return realm.intrinsics.NaN;\n  }\n\n  // 3. Let clippedTime be ToInteger(time).\n  let clippedTime = To.ToInteger(realm, new NumberValue(realm, (time: number)));\n\n  // 4. If clippedTime is -0, let clippedTime be +0.\n  if (Object.is(clippedTime, -0)) clippedTime = +0;\n\n  // 5. Return clippedTime.\n  return new NumberValue(realm, clippedTime);\n}\n\n// ECMA262 20.3.4\nexport function thisTimeValue(realm: Realm, value: Value): Value {\n  // 1. If Type(value) is Object and value has a [[DateValue]] internal slot, then\n  if (value instanceof ObjectValue && value.$DateValue !== undefined) {\n    // a. Return the value of value's [[DateValue]] internal slot.\n    return value.$DateValue;\n  }\n\n  // 2. Throw a TypeError exception.\n  throw realm.createErrorThrowCompletion(realm.intrinsics.TypeError);\n}\n\n// ECMA262 20.3.4.41.1\nexport function ToDateString(realm: Realm, tv: number): string {\n  // 1. Assert: Type(tv) is Number.\n  invariant(typeof tv === \"number\", \"expected tv to be a number\");\n\n  // 2. If tv is NaN, return \"Invalid Date\".\n  if (isNaN(tv)) return \"Invalid Date\";\n\n  // 3. Return an implementation-dependent String value that represents tv as a date and time in the current\n  //    time zone using a convenient, human-readable form.\n  return new Date(tv).toString();\n}\n"
  },
  {
    "path": "src/methods/destructuring.js",
    "content": "/**\n * Copyright (c) 2017-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n/* @flow strict-local */\n\nimport invariant from \"../invariant.js\";\nimport type { Realm } from \"../realm.js\";\nimport type { LexicalEnvironment } from \"../environment.js\";\nimport { Reference } from \"../environment.js\";\nimport type { PropertyKeyValue } from \"../types.js\";\nimport { Value, ObjectValue, UndefinedValue, StringValue, SymbolValue } from \"../values/index.js\";\nimport { AbruptCompletion, SimpleNormalCompletion } from \"../completions.js\";\nimport { EvalPropertyName } from \"../evaluators/ObjectExpression.js\";\nimport {\n  RequireObjectCoercible,\n  GetIterator,\n  IteratorClose,\n  IteratorStep,\n  IteratorValue,\n  IsAnonymousFunctionDefinition,\n  IsIdentifierRef,\n  HasOwnProperty,\n  GetV,\n} from \"./index.js\";\nimport { Create, Environment, Functions, Properties } from \"../singletons.js\";\nimport type {\n  BabelNodeIdentifier,\n  BabelNodeAssignmentPattern,\n  BabelNodeObjectProperty,\n  BabelNodeRestElement,\n  BabelNodeLVal,\n  BabelNodeArrayPattern,\n  BabelNodeObjectPattern,\n} from \"@babel/types\";\n\nfunction RestDestructuringAssignmentEvaluation(\n  realm: Realm,\n  property: BabelNodeRestElement,\n  value: Value,\n  excludedNames: Array<PropertyKeyValue>,\n  strictCode: boolean,\n  env: LexicalEnvironment\n): void | boolean | Value {\n  let DestructuringAssignmentTarget = property.argument;\n\n  let lref;\n  // 1. If DestructuringAssignmentTarget is neither an ObjectLiteral nor an ArrayLiteral, then\n  if (DestructuringAssignmentTarget.type !== \"ObjectPattern\" && DestructuringAssignmentTarget.type !== \"ArrayPattern\") {\n    // a. Let lref be the result of evaluating DestructuringAssignmentTarget.\n    lref = env.evaluate(DestructuringAssignmentTarget, strictCode);\n\n    // b. ReturnIfAbrupt(lref).\n  }\n\n  // 2. Let restObj be ObjectCreate(%ObjectPrototype%).\n  let restObj = Create.ObjectCreate(realm, realm.intrinsics.ObjectPrototype);\n\n  // 3. Let assignStatus be CopyDataProperties(restObj, value, excludedNames).\n  /* let assignStatus = */ Create.CopyDataProperties(realm, restObj, value, excludedNames);\n  // 4. ReturnIfAbrupt(assignStatus).\n\n  // 5. If DestructuringAssignmentTarget is neither an ObjectLiteral nor an ArrayLiteral, then\n  if (DestructuringAssignmentTarget.type !== \"ObjectPattern\" && DestructuringAssignmentTarget.type !== \"ArrayPattern\") {\n    invariant(lref);\n    // Return PutValue(lref, restObj).\n    return Properties.PutValue(realm, lref, restObj);\n  }\n\n  // 6. Let nestedAssignmentPattern be the parse of the source text corresponding to DestructuringAssignmentTarget using either AssignmentPattern[?Yield, ?Await] as the goal symbol, adopting the parameter values from AssignmentRestElement.\n  let nestedAssignmentPattern = DestructuringAssignmentTarget;\n\n  return DestructuringAssignmentEvaluation(realm, nestedAssignmentPattern, restObj, strictCode, env);\n}\n\nfunction PropertyDestructuringAssignmentEvaluation(\n  realm: Realm,\n  properties: Array<BabelNodeObjectProperty>,\n  value: Value,\n  strictCode: boolean,\n  env: LexicalEnvironment\n): Array<string | StringValue | SymbolValue> {\n  // Base condition for recursive call below\n  if (properties.length === 0) {\n    return [];\n  }\n\n  let AssignmentProperty = properties.slice(-1)[0];\n  let AssignmentPropertyList = properties.slice(0, -1);\n\n  // 1. Let propertyNames be the result of performing PropertyDestructuringAssignmentEvaluation for AssignmentPropertyList using value as the argument.\n  let propertyNames = PropertyDestructuringAssignmentEvaluation(realm, AssignmentPropertyList, value, strictCode, env);\n\n  // 2. ReturnIfAbrupt(status propertyNames).\n\n  // Let nextNames be the result of performing PropertyDestructuringAssignmentEvaluation for AssignmentProperty using value as the argument.\n  let nextNames;\n\n  // AssignmentProperty : IdentifierReference Initializer\n  if (\n    AssignmentProperty.key.type === \"Identifier\" &&\n    ((AssignmentProperty.value.type === \"Identifier\" &&\n      AssignmentProperty.value.name === AssignmentProperty.key.name) ||\n      (AssignmentProperty.value.type === \"AssignmentPattern\" &&\n        AssignmentProperty.value.left.name === AssignmentProperty.key.name)) &&\n    AssignmentProperty.computed === false\n  ) {\n    let Initializer;\n\n    if (AssignmentProperty.value.type === \"AssignmentPattern\") {\n      Initializer = (AssignmentProperty.value: BabelNodeAssignmentPattern).right;\n    }\n\n    // 1. Let P be StringValue of IdentifierReference.\n    let P = (AssignmentProperty.key: BabelNodeIdentifier).name;\n\n    // 2. Let lref be ? ResolveBinding(P).\n    let lref = Environment.ResolveBinding(realm, P, strictCode, env);\n\n    // 3. Let v be ? GetV(value, P).\n    let v = GetV(realm, value, P);\n\n    // 4. If Initializer is present and v is undefined, then\n    if (Initializer !== undefined && v instanceof UndefinedValue) {\n      // 4a. Let defaultValue be the result of evaluating Initializer.\n      let defaultValue = env.evaluate(Initializer, strictCode);\n\n      // 4b. Let v be ? GetValue(defaultValue).\n      v = Environment.GetValue(realm, defaultValue);\n\n      // 4c. If IsAnonymousFunctionDefinition(Initializer) is true, then\n      if (IsAnonymousFunctionDefinition(realm, Initializer)) {\n        invariant(v instanceof ObjectValue);\n\n        // i. Let hasNameProperty be ? HasOwnProperty(v, \"name\").\n        let hasNameProperty = HasOwnProperty(realm, v, \"name\");\n\n        // j. If hasNameProperty is false, perform SetFunctionName(v, P).\n        if (hasNameProperty === false) {\n          Functions.SetFunctionName(realm, v, P);\n        }\n      }\n    }\n\n    // Perform ? PutValue(lref, v).\n    Properties.PutValue(realm, lref, v);\n\n    // Return a new List containing P.\n    nextNames = [new StringValue(realm, P)];\n  } else {\n    // AssignmentProperty : PropertyName:AssignmentElement\n\n    // 1. Let name be the result of evaluating PropertyName.\n    let name = EvalPropertyName(AssignmentProperty, env, realm, strictCode);\n\n    // 2. ReturnIfAbrupt(name).\n\n    // 3. Let status be the result of performing KeyedDestructuringAssignmentEvaluation of AssignmentElement with value and name as the arguments.\n    /* let status = */ KeyedDestructuringAssignmentEvaluation(\n      realm,\n      // $FlowFixMe\n      AssignmentProperty.value,\n      value,\n      name,\n      strictCode,\n      env\n    );\n\n    // 4. ReturnIfAbrupt(status).\n\n    // 5. Return a new List containing name.\n    nextNames = [name];\n  }\n\n  // 4. ReturnIfAbrupt(nextNames).\n\n  invariant(nextNames instanceof Array);\n  // 5. Append each item in nextNames to the end of propertyNames.\n  propertyNames = propertyNames.concat(nextNames);\n\n  // 6. Return propertyNames.\n  return propertyNames;\n}\n\n// 2.1 Object Rest/Spread Properties\nexport function DestructuringAssignmentEvaluation(\n  realm: Realm,\n  pattern: BabelNodeArrayPattern | BabelNodeObjectPattern,\n  value: Value,\n  strictCode: boolean,\n  env: LexicalEnvironment\n): void | boolean | Value {\n  if (pattern.type === \"ObjectPattern\") {\n    let AssignmentPropertyList = [],\n      AssignmentRestElement = null;\n\n    for (let property of pattern.properties) {\n      if (property.type === \"RestElement\") {\n        AssignmentRestElement = property;\n      } else {\n        AssignmentPropertyList.push(property);\n      }\n    }\n\n    // ObjectAssignmentPattern:\n    //   { AssignmentPropertyList }\n    //   { AssignmentPropertyList, }\n    if (!AssignmentRestElement) {\n      // 1. Perform ? RequireObjectCoercible(value).\n      RequireObjectCoercible(realm, value);\n\n      // 2. Perform ? PropertyDestructuringAssignmentEvaluation for AssignmentPropertyList using value as the argument.\n      PropertyDestructuringAssignmentEvaluation(realm, AssignmentPropertyList, value, strictCode, env);\n\n      // 3. Return NormalCompletion(empty).\n      return realm.intrinsics.empty;\n    }\n\n    // ObjectAssignmentPattern : { AssignmentRestElement }\n    if (AssignmentPropertyList.length === 0) {\n      // 1. Let excludedNames be a new empty List.\n      let excludedNames = [];\n\n      // 2. Return the result of performing RestDestructuringAssignmentEvaluation of AssignmentRestElement with value and excludedNames as the arguments.\n      return RestDestructuringAssignmentEvaluation(realm, AssignmentRestElement, value, excludedNames, strictCode, env);\n    } else {\n      // ObjectAssignmentPattern : { AssignmentPropertyList, AssignmentRestElement }\n      // 1. Let excludedNames be the result of performing ? PropertyDestructuringAssignmentEvaluation for AssignmentPropertyList using value as the argument.\n      let excludedNames = PropertyDestructuringAssignmentEvaluation(\n        realm,\n        AssignmentPropertyList,\n        value,\n        strictCode,\n        env\n      );\n\n      // 2. Return the result of performing RestDestructuringAssignmentEvaluation of AssignmentRestElement with value and excludedNames as the arguments.\n      return RestDestructuringAssignmentEvaluation(realm, AssignmentRestElement, value, excludedNames, strictCode, env);\n    }\n  } else if (pattern.type === \"ArrayPattern\") {\n    // 1. Let iterator be ? GetIterator(value).\n    let iterator = GetIterator(realm, value);\n\n    // 2. Let iteratorRecord be Record {[[Iterator]]: iterator, [[Done]]: false}.\n    let iteratorRecord = {\n      $Iterator: iterator,\n      $Done: false,\n    };\n\n    // 3. Let result be the result of performing IteratorDestructuringAssignmentEvaluation of AssignmentElementList using iteratorRecord as the argument.\n    let result;\n    try {\n      result = IteratorDestructuringAssignmentEvaluation(realm, pattern.elements, iteratorRecord, strictCode, env);\n    } catch (error) {\n      // 4. If iteratorRecord.[[Done]] is false, return ? IteratorClose(iterator, result).\n      if (iteratorRecord.$Done === false && error instanceof AbruptCompletion) {\n        throw IteratorClose(realm, iterator, error);\n      }\n      throw error;\n    }\n\n    // 4. If iteratorRecord.[[Done]] is false, return ? IteratorClose(iterator, result).\n    if (iteratorRecord.$Done === false) {\n      let completion = IteratorClose(realm, iterator, new SimpleNormalCompletion(realm.intrinsics.undefined));\n      if (completion instanceof AbruptCompletion) {\n        throw completion;\n      }\n    }\n\n    // 5. Return result.\n    return result;\n  }\n}\n\n// ECMA262 12.15.5.3\nexport function IteratorDestructuringAssignmentEvaluation(\n  realm: Realm,\n  _elements: $ReadOnlyArray<BabelNodeLVal | null>,\n  iteratorRecord: { $Iterator: ObjectValue, $Done: boolean },\n  strictCode: boolean,\n  env: LexicalEnvironment\n): void | boolean | Value {\n  let elements = _elements;\n  // Check if the last element is a rest element. If so then we want to save the\n  // element and handle it separately after we iterate through the other\n  // formals. This also enforces that a rest element may only ever be in the\n  // last position.\n  let restEl;\n  if (elements.length > 0) {\n    let lastEl = elements[elements.length - 1];\n    if (lastEl !== null && lastEl.type === \"RestElement\") {\n      restEl = lastEl;\n      elements = elements.slice(0, -1);\n    }\n  }\n\n  for (let element of elements) {\n    if (element === null) {\n      // Elision handling\n\n      // 1. If iteratorRecord.[[Done]] is false, then\n      if (iteratorRecord.$Done === false) {\n        // a. Let next be IteratorStep(iteratorRecord.[[Iterator]]).\n        let next;\n        try {\n          next = IteratorStep(realm, iteratorRecord.$Iterator);\n        } catch (e) {\n          // b. If next is an abrupt completion, set iteratorRecord.[[Done]] to true.\n          if (e instanceof AbruptCompletion) {\n            iteratorRecord.$Done = true;\n          }\n          // c. ReturnIfAbrupt(next).\n          throw e;\n        }\n        // d. If next is false, set iteratorRecord.[[Done]] to true.\n        if (next === false) {\n          iteratorRecord.$Done = true;\n        }\n      }\n      // 2. Return NormalCompletion(empty).\n      continue;\n    }\n\n    // AssignmentElement : DestructuringAssignmentTarget Initializer\n\n    let DestructuringAssignmentTarget;\n    let Initializer;\n\n    if (element.type === \"AssignmentPattern\") {\n      Initializer = element.right;\n      DestructuringAssignmentTarget = element.left;\n    } else {\n      DestructuringAssignmentTarget = element;\n    }\n\n    let lref;\n\n    // 1. If DestructuringAssignmentTarget is neither an ObjectLiteral nor an ArrayLiteral, then\n    //\n    // The spec assumes we haven't yet distinguished between literals and\n    // patterns, but our parser does that work for us. That means we check for\n    // \"*Pattern\" instead of \"*Literal\" like the spec text suggests.\n    if (\n      DestructuringAssignmentTarget.type !== \"ObjectPattern\" &&\n      DestructuringAssignmentTarget.type !== \"ArrayPattern\"\n    ) {\n      // a. Let lref be the result of evaluating DestructuringAssignmentTarget.\n      lref = env.evaluate(DestructuringAssignmentTarget, strictCode);\n\n      // b. ReturnIfAbrupt(lref).\n    }\n\n    let value;\n\n    // 2. If iteratorRecord.[[Done]] is false, then\n    if (iteratorRecord.$Done === false) {\n      // a. Let next be IteratorStep(iteratorRecord.[[Iterator]]).\n      let next;\n      try {\n        next = IteratorStep(realm, iteratorRecord.$Iterator);\n      } catch (e) {\n        // b. If next is an abrupt completion, set iteratorRecord.[[Done]] to true.\n        if (e instanceof AbruptCompletion) {\n          iteratorRecord.$Done = true;\n        }\n        // c. ReturnIfAbrupt(next).\n        throw e;\n      }\n\n      // d. If next is false, set iteratorRecord.[[Done]] to true.\n      if (next === false) {\n        iteratorRecord.$Done = true;\n        // Normally this assignment would be done in step 3, but we do it\n        // here so that Flow knows `value` will always be initialized by step 4.\n        value = realm.intrinsics.undefined;\n      } else {\n        // e. Else,\n        // i. Let value be IteratorValue(next).\n        try {\n          value = IteratorValue(realm, next);\n        } catch (e) {\n          // ii. If value is an abrupt completion, set iteratorRecord.[[Done]] to true.\n          if (e instanceof AbruptCompletion) {\n            iteratorRecord.$Done = true;\n          }\n          // iii. ReturnIfAbrupt(v).\n          throw e;\n        }\n      }\n    } else {\n      // 3. If iteratorRecord.[[Done]] is true, let value be undefined.\n      value = realm.intrinsics.undefined;\n    }\n\n    let v;\n\n    // 4. If Initializer is present and value is undefined, then\n    if (Initializer && value instanceof UndefinedValue) {\n      // a. Let defaultValue be the result of evaluating Initializer.\n      let defaultValue = env.evaluate(Initializer, strictCode);\n\n      // b. Let v be ? GetValue(defaultValue).\n      v = Environment.GetValue(realm, defaultValue);\n    } else {\n      // 5. Else, let v be value.\n      v = value;\n    }\n\n    // 6. If DestructuringAssignmentTarget is an ObjectLiteral or an ArrayLiteral, then\n    //\n    // The spec assumes we haven't yet distinguished between literals and\n    // patterns, but our parser does that work for us. That means we check for\n    // \"*Pattern\" instead of \"*Literal\" like the spec text suggests.\n    if (\n      DestructuringAssignmentTarget.type === \"ObjectPattern\" ||\n      DestructuringAssignmentTarget.type === \"ArrayPattern\"\n    ) {\n      // a. Let nestedAssignmentPattern be the parse of the source text corresponding to DestructuringAssignmentTarget using either AssignmentPattern or AssignmentPattern[Yield] as the goal symbol depending upon whether this AssignmentElement has the [Yield] parameter.\n      let nestedAssignmentPattern = DestructuringAssignmentTarget;\n\n      // b. Return the result of performing DestructuringAssignmentEvaluation of nestedAssignmentPattern with v as the argument.\n      DestructuringAssignmentEvaluation(realm, nestedAssignmentPattern, v, strictCode, env);\n      continue;\n    }\n\n    // We know `lref` exists because of how the algorithm is setup, but tell\n    // Flow that `lref` exists with an `invariant()`.\n    invariant(lref);\n\n    // 7. If Initializer is present and value is undefined and IsAnonymousFunctionDefinition(Initializer) and IsIdentifierRef of DestructuringAssignmentTarget are both true, then\n    if (\n      Initializer &&\n      value instanceof UndefinedValue &&\n      IsAnonymousFunctionDefinition(realm, Initializer) &&\n      IsIdentifierRef(realm, DestructuringAssignmentTarget) &&\n      v instanceof ObjectValue\n    ) {\n      // a. Let hasNameProperty be ? HasOwnProperty(v, \"name\").\n      let hasNameProperty = HasOwnProperty(realm, v, \"name\");\n\n      // b. If hasNameProperty is false, perform SetFunctionName(v, GetReferencedName(lref)).\n      if (hasNameProperty === false) {\n        // All of the nodes that may be evaluated to produce lref create\n        // references. Assert this with an invariant as GetReferencedName may\n        // not be called with a value.\n        invariant(lref instanceof Reference);\n\n        Functions.SetFunctionName(realm, v, Environment.GetReferencedName(realm, lref));\n      }\n    }\n\n    // 8. Return ? PutValue(lref, v).\n    Properties.PutValue(realm, lref, v);\n    continue;\n  }\n\n  // Handle the rest element if we have one.\n  if (restEl) {\n    // AssignmentRestElement : ...DestructuringAssignmentTarget\n    let DestructuringAssignmentTarget = restEl.argument;\n\n    let lref;\n\n    // 1. If DestructuringAssignmentTarget is neither an ObjectLiteral nor an ArrayLiteral, then\n    //\n    // The spec assumes we haven't yet distinguished between literals and\n    // patterns, but our parser does that work for us. That means we check for\n    // \"*Pattern\" instead of \"*Literal\" like the spec text suggests.\n    if (\n      DestructuringAssignmentTarget.type !== \"ObjectPattern\" &&\n      DestructuringAssignmentTarget.type !== \"ArrayPattern\"\n    ) {\n      // a. Let lref be the result of evaluating DestructuringAssignmentTarget.\n      lref = env.evaluate(DestructuringAssignmentTarget, strictCode);\n\n      // b. ReturnIfAbrupt(lref).\n    }\n\n    // 2. Let A be ArrayCreate(0).\n    let A = Create.ArrayCreate(realm, 0);\n\n    // 3. Let n be 0.\n    let n = 0;\n\n    // 4. Repeat while iteratorRecord.[[Done]] is false,\n    while (iteratorRecord.$Done === false) {\n      // a. Let next be IteratorStep(iteratorRecord.[[Iterator]]).\n      let next;\n      try {\n        next = IteratorStep(realm, iteratorRecord.$Iterator);\n      } catch (e) {\n        // b. If next is an abrupt completion, set iteratorRecord.[[Done]] to true.\n        if (e instanceof AbruptCompletion) {\n          iteratorRecord.$Done = true;\n        }\n        // c. ReturnIfAbrupt(next).\n        throw e;\n      }\n\n      // d. If next is false, set iteratorRecord.[[Done]] to true.\n      if (next === false) {\n        iteratorRecord.$Done = true;\n      } else {\n        // e. Else,\n        // i. Let nextValue be IteratorValue(next).\n        let nextValue;\n        try {\n          nextValue = IteratorValue(realm, next);\n        } catch (e) {\n          // ii. If nextValue is an abrupt completion, set iteratorRecord.[[Done]] to true.\n          if (e instanceof AbruptCompletion) {\n            iteratorRecord.$Done = true;\n          }\n          // iii. ReturnIfAbrupt(nextValue).\n          throw e;\n        }\n\n        // iv. Let status be CreateDataProperty(A, ! ToString(n), nextValue).\n        let status = Create.CreateDataProperty(realm, A, n.toString(), nextValue);\n\n        // v. Assert: status is true.\n        invariant(status, \"expected to create data property\");\n\n        // vi. Increment n by 1.\n        n += 1;\n      }\n    }\n\n    // 5. If DestructuringAssignmentTarget is neither an ObjectLiteral nor an ArrayLiteral, then\n    if (\n      DestructuringAssignmentTarget.type !== \"ObjectPattern\" &&\n      DestructuringAssignmentTarget.type !== \"ArrayPattern\"\n    ) {\n      // `lref` will always be defined at this point. Let Flow know with an\n      // invariant.\n      invariant(lref);\n\n      // a. Return ? PutValue(lref, A).\n      return Properties.PutValue(realm, lref, A);\n    } else {\n      // 6. Let nestedAssignmentPattern be the parse of the source text corresponding to DestructuringAssignmentTarget using either AssignmentPattern or AssignmentPattern[Yield] as the goal symbol depending upon whether this AssignmentElement has the [Yield] parameter.\n      let nestedAssignmentPattern = DestructuringAssignmentTarget;\n\n      // 7. Return the result of performing DestructuringAssignmentEvaluation of nestedAssignmentPattern with A as the argument.\n      return DestructuringAssignmentEvaluation(realm, nestedAssignmentPattern, A, strictCode, env);\n    }\n  }\n}\n\n// ECMA262 12.15.5.4\nexport function KeyedDestructuringAssignmentEvaluation(\n  realm: Realm,\n  node: BabelNodeLVal,\n  value: Value,\n  propertyName: PropertyKeyValue,\n  strictCode: boolean,\n  env: LexicalEnvironment\n): void | boolean | Value {\n  let DestructuringAssignmentTarget;\n  let Initializer;\n\n  if (node.type === \"AssignmentPattern\") {\n    Initializer = node.right;\n    DestructuringAssignmentTarget = node.left;\n  } else {\n    DestructuringAssignmentTarget = node;\n  }\n\n  let lref;\n\n  // 1. If DestructuringAssignmentTarget is neither an ObjectLiteral nor an ArrayLiteral, then\n  //\n  // The spec assumes we haven't yet distinguished between literals and\n  // patterns, but our parser does that work for us. That means we check for\n  // \"*Pattern\" instead of \"*Literal\" like the spec text suggests.\n  if (DestructuringAssignmentTarget.type !== \"ObjectPattern\" && DestructuringAssignmentTarget.type !== \"ArrayPattern\") {\n    // a. Let lref be the result of evaluating DestructuringAssignmentTarget.\n    lref = env.evaluate(DestructuringAssignmentTarget, strictCode);\n\n    // b. ReturnIfAbrupt(lref).\n  }\n\n  let rhsValue;\n\n  // 2. Let v be ? GetV(value, propertyName).\n  let v = GetV(realm, value, propertyName);\n\n  // 3. If Initializer is present and v is undefined, then\n  if (Initializer && v instanceof UndefinedValue) {\n    // a. Let defaultValue be the result of evaluating Initializer.\n    let defaultValue = env.evaluate(Initializer, strictCode);\n\n    // b. Let rhsValue be ? GetValue(defaultValue).\n    rhsValue = Environment.GetValue(realm, defaultValue);\n  } else {\n    // 4. Else, let rhsValue be v.\n    rhsValue = v;\n  }\n\n  // 5. If DestructuringAssignmentTarget is an ObjectLiteral or an ArrayLiteral, then\n  //\n  // The spec assumes we haven't yet distinguished between literals and\n  // patterns, but our parser does that work for us. That means we check for\n  // \"*Pattern\" instead of \"*Literal\" like the spec text suggests.\n  if (DestructuringAssignmentTarget.type === \"ObjectPattern\" || DestructuringAssignmentTarget.type === \"ArrayPattern\") {\n    // a. Let assignmentPattern be the parse of the source text corresponding to DestructuringAssignmentTarget using either AssignmentPattern or AssignmentPattern[Yield] as the goal symbol depending upon whether this AssignmentElement has the [Yield] parameter.\n    let assignmentPattern = DestructuringAssignmentTarget;\n\n    // b. Return the result of performing DestructuringAssignmentEvaluation of assignmentPattern with rhsValue as the argument.\n    return DestructuringAssignmentEvaluation(realm, assignmentPattern, rhsValue, strictCode, env);\n  }\n\n  // `lref` will always be defined at this point. Let Flow know with an\n  // invariant.\n  invariant(lref);\n\n  // 6. If Initializer is present and v is undefined and IsAnonymousFunctionDefinition(Initializer) and IsIdentifierRef of DestructuringAssignmentTarget are both true, then\n  if (\n    Initializer &&\n    v instanceof UndefinedValue &&\n    IsAnonymousFunctionDefinition(realm, Initializer) &&\n    IsIdentifierRef(realm, DestructuringAssignmentTarget) &&\n    rhsValue instanceof ObjectValue\n  ) {\n    // a. Let hasNameProperty be ? HasOwnProperty(rhsValue, \"name\").\n    let hasNameProperty = HasOwnProperty(realm, rhsValue, \"name\");\n\n    // b. If hasNameProperty is false, perform SetFunctionName(rhsValue, GetReferencedName(lref)).\n    if (hasNameProperty === false) {\n      // All of the nodes that may be evaluated to produce lref create\n      // references. Assert this with an invariant as GetReferencedName may\n      // not be called with a value.\n      invariant(lref instanceof Reference);\n\n      Functions.SetFunctionName(realm, rhsValue, Environment.GetReferencedName(realm, lref));\n    }\n  }\n\n  // 7. Return ? PutValue(lref, rhsValue).\n  return Properties.PutValue(realm, lref, rhsValue);\n}\n"
  },
  {
    "path": "src/methods/environment.js",
    "content": "/**\n * Copyright (c) 2017-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n/* @flow */\n\nimport type { Realm } from \"../realm.js\";\nimport invariant from \"../invariant.js\";\nimport type { PropertyKeyValue } from \"../types.js\";\nimport {\n  AbstractObjectValue,\n  AbstractValue,\n  BooleanValue,\n  ECMAScriptFunctionValue,\n  IntegralValue,\n  NullValue,\n  NumberValue,\n  ObjectValue,\n  StringValue,\n  SymbolValue,\n  Value,\n  UndefinedValue,\n} from \"../values/index.js\";\nimport {\n  DeclarativeEnvironmentRecord,\n  EnvironmentRecord,\n  FunctionEnvironmentRecord,\n  GlobalEnvironmentRecord,\n  isValidBaseValue,\n  LexicalEnvironment,\n  ObjectEnvironmentRecord,\n  Reference,\n  type BaseValue,\n} from \"../environment.js\";\nimport { AbruptCompletion, SimpleNormalCompletion } from \"../completions.js\";\nimport { FatalError } from \"../errors.js\";\nimport { EvalPropertyName } from \"../evaluators/ObjectExpression.js\";\nimport {\n  GetV,\n  GetThisValue,\n  HasSomeCompatibleType,\n  GetIterator,\n  IteratorStep,\n  IteratorValue,\n  IteratorClose,\n  IsAnonymousFunctionDefinition,\n  HasOwnProperty,\n  RequireObjectCoercible,\n} from \"./index.js\";\nimport { Create, Functions, Properties, To } from \"../singletons.js\";\nimport type {\n  BabelNode,\n  BabelNodeVariableDeclaration,\n  BabelNodeIdentifier,\n  BabelNodeRestElement,\n  BabelNodeObjectProperty,\n  BabelNodeObjectPattern,\n  BabelNodeArrayPattern,\n  BabelNodeStatement,\n  BabelNodeLVal,\n  BabelNodePattern,\n} from \"@babel/types\";\nimport * as t from \"@babel/types\";\n\nexport class EnvironmentImplementation {\n  // 2.6 RestBindingInitialization (please suggest an appropriate section name)\n  RestBindingInitialization(\n    realm: Realm,\n    property: BabelNodeRestElement,\n    value: Value,\n    excludedNames: Array<PropertyKeyValue>,\n    strictCode: boolean,\n    environment: ?LexicalEnvironment\n  ): void | boolean | Value {\n    let BindingIdentifier = ((property.argument: any): BabelNodeIdentifier);\n\n    // 1. Let restObj be ObjectCreate(%ObjectPrototype%).\n    let restObj = Create.ObjectCreate(realm, realm.intrinsics.ObjectPrototype);\n\n    // 2. Let assignStatus be CopyDataProperties(restObj, value, excludedNames).\n    /* let assignStatus = */ Create.CopyDataProperties(realm, restObj, value, excludedNames);\n\n    // 3. ReturnIfAbrupt(assignStatus).\n\n    // 4. Let bindingId be StringValue of BindingIdentifier.\n    let bindingId = BindingIdentifier.name;\n\n    // 5. Let lhs be ResolveBinding(bindingId, environment).\n    let lhs = this.ResolveBinding(realm, bindingId, strictCode, environment);\n\n    // 6. ReturnIfAbrupt(lhs).\n\n    // 7. If environment is undefined, return PutValue(lhs, restObj).\n    if (environment === undefined) {\n      return Properties.PutValue(realm, lhs, restObj);\n    }\n\n    // 8. Return InitializeReferencedBinding(lhs, restObj).\n    return this.InitializeReferencedBinding(realm, lhs, restObj);\n  }\n\n  // 2.5  PropertyBindingInitialization (please suggest an appropriate section name)\n  PropertyBindingInitialization(\n    realm: Realm,\n    properties: Array<BabelNodeObjectProperty>,\n    value: Value,\n    strictCode: boolean,\n    environment: ?LexicalEnvironment\n  ): Array<PropertyKeyValue> {\n    // Base condition for recursive call below\n    if (properties.length === 0) {\n      return [];\n    }\n\n    let BindingProperty = properties.slice(-1)[0];\n    let BindingPropertyList = properties.slice(0, -1);\n\n    // 1. Let boundNames be the result of performing PropertyBindingInitialization for BindingPropertyList using value and environment as arguments.\n    let boundNames = this.PropertyBindingInitialization(realm, BindingPropertyList, value, strictCode, environment);\n\n    // 2. ReturnIfAbrupt(status boundNames).\n\n    // 3. Let nextNames be the result of performing PropertyBindingInitialization for BindingProperty using value and environment as arguments.\n    let nextNames;\n\n    // SingleNameBinding\n    // PropertyName : BindingElement\n    // 1. Let P be the result of evaluating PropertyName.\n    let env = environment ? environment : realm.getRunningContext().lexicalEnvironment;\n    let P = EvalPropertyName(BindingProperty, env, realm, strictCode);\n    // 2. ReturnIfAbrupt(P).\n\n    // 3. Let status be the result of performing KeyedBindingInitialization of BindingElement with value, environment, and P as the arguments.\n    /* let status = */ this.KeyedBindingInitialization(\n      realm,\n      ((BindingProperty.value: any): BabelNodeIdentifier | BabelNodePattern),\n      value,\n      strictCode,\n      environment,\n      P\n    );\n\n    // 4. ReturnIfAbrupt(status).\n\n    // 5. Return a new List containing P.\n    nextNames = [P];\n\n    // 4. ReturnIfAbrupt(nextNames).\n\n    // 5. Append each item in nextNames to the end of boundNames.\n    boundNames = boundNames.concat(nextNames);\n\n    return boundNames;\n  }\n\n  // ECMA262 6.2.3\n  // IsSuperReference(V). Returns true if this reference has a thisValue component.\n  IsSuperReference(realm: Realm, V: Reference): boolean {\n    return V.thisValue !== undefined;\n  }\n\n  // ECMA262 6.2.3\n  // HasPrimitiveBase(V). Returns true if Type(base) is Boolean, String, Symbol, or Number.\n  HasPrimitiveBase(realm: Realm, V: Reference): boolean {\n    let base = this.GetBase(realm, V);\n    // void | ObjectValue | BooleanValue | StringValue | SymbolValue | NumberValue | EnvironmentRecord | AbstractValue;\n    if (!base || base instanceof EnvironmentRecord) return false;\n    let type = base.getType();\n    return (\n      type === BooleanValue ||\n      type === StringValue ||\n      type === SymbolValue ||\n      type === NumberValue ||\n      type === IntegralValue\n    );\n  }\n\n  // ECMA262 6.2.3\n  // GetReferencedName(V). Returns the referenced name component of the reference V.\n  GetReferencedName(realm: Realm, V: Reference): string | SymbolValue {\n    if (V.referencedName instanceof AbstractValue) {\n      AbstractValue.reportIntrospectionError(V.referencedName);\n      throw new FatalError();\n    }\n    return V.referencedName;\n  }\n\n  GetReferencedNamePartial(realm: Realm, V: Reference): AbstractValue | string | SymbolValue {\n    return V.referencedName;\n  }\n\n  // ECMA262 6.2.3.1\n  GetValue(realm: Realm, V: Reference | Value): Value {\n    let val = this._dereference(realm, V);\n    if (val instanceof AbstractValue) return realm.simplifyAndRefineAbstractValue(val);\n    return val;\n  }\n\n  GetConditionValue(realm: Realm, V: Reference | Value): Value {\n    let val = this._dereference(realm, V);\n    if (val instanceof AbstractValue) return realm.simplifyAndRefineAbstractCondition(val);\n    return val;\n  }\n\n  _dereferenceConditional(\n    realm: Realm,\n    ref: Reference,\n    condValue: AbstractValue,\n    consequentVal: Value,\n    alternateVal: Value\n  ): Value {\n    return realm.evaluateWithAbstractConditional(\n      condValue,\n      () => {\n        return realm.evaluateForEffects(\n          () => {\n            if (isValidBaseValue(consequentVal)) {\n              let consequentRef = new Reference(\n                ((consequentVal: any): BaseValue),\n                ref.referencedName,\n                ref.strict,\n                ref.thisValue\n              );\n              return this._dereference(realm, consequentRef);\n            }\n            return this._dereference(realm, ref, false);\n          },\n          null,\n          \"_dereferenceConditional consequent\"\n        );\n      },\n      () => {\n        return realm.evaluateForEffects(\n          () => {\n            if (isValidBaseValue(alternateVal)) {\n              let alternateRef = new Reference(\n                ((alternateVal: any): BaseValue),\n                ref.referencedName,\n                ref.strict,\n                ref.thisValue\n              );\n              return this._dereference(realm, alternateRef);\n            }\n            return this._dereference(realm, ref, false);\n          },\n          null,\n          \"_dereferenceConditional alternate\"\n        );\n      }\n    );\n  }\n\n  _dereference(realm: Realm, V: Reference | Value, deferenceConditionals?: boolean = true): Value {\n    // This step is not necessary as we propagate completions with exceptions.\n    // 1. ReturnIfAbrupt(V).\n\n    // 2. If Type(V) is not Reference, return V.\n    if (!(V instanceof Reference)) return V;\n\n    // 3. Let base be GetBase(V).\n    let base = this.GetBase(realm, V);\n\n    // 4. If IsUnresolvableReference(V) is true, throw a ReferenceError exception.\n    if (this.IsUnresolvableReference(realm, V)) {\n      throw realm.createErrorThrowCompletion(\n        realm.intrinsics.ReferenceError,\n        `${V.referencedName.toString()} is not defined`\n      );\n    }\n\n    // 5. If IsPropertyReference(V) is true, then\n    if (this.IsPropertyReference(realm, V)) {\n      if (base instanceof AbstractValue) {\n        if (deferenceConditionals && !(base instanceof AbstractObjectValue)) {\n          if (base.kind === \"conditional\") {\n            let [condValue, consequentVal, alternateVal] = base.args;\n            invariant(condValue instanceof AbstractValue);\n            if (isValidBaseValue(consequentVal) || isValidBaseValue(alternateVal)) {\n              return this._dereferenceConditional(realm, V, condValue, consequentVal, alternateVal);\n            }\n          } else if (base.kind === \"||\") {\n            let [leftValue, rightValue] = base.args;\n            invariant(leftValue instanceof AbstractValue);\n            return this._dereferenceConditional(realm, V, leftValue, leftValue, rightValue);\n          } else if (base.kind === \"&&\") {\n            let [leftValue, rightValue] = base.args;\n            invariant(leftValue instanceof AbstractValue);\n            return this._dereferenceConditional(realm, V, leftValue, rightValue, leftValue);\n          }\n        }\n        // Ensure that abstract values are coerced to objects. This might yield\n        // an operation that might throw.\n        base = To.ToObject(realm, base);\n      }\n      // a. If HasPrimitiveBase(V) is true, then\n      if (this.HasPrimitiveBase(realm, V)) {\n        // i. Assert: In this case, base will never be null or undefined.\n        invariant(base instanceof Value && !HasSomeCompatibleType(base, UndefinedValue, NullValue));\n\n        // ii. Let base be To.ToObject(base).\n        base = To.ToObject(realm, base);\n      }\n      invariant(base instanceof ObjectValue || base instanceof AbstractObjectValue);\n\n      // b. Return ? base.[[Get]](GetReferencedName(V), GetThisValue(V)).\n      return base.$GetPartial(this.GetReferencedNamePartial(realm, V), GetThisValue(realm, V));\n    }\n\n    // 6. Else base must be an Environment Record,\n    if (base instanceof EnvironmentRecord) {\n      // a. Return ? base.GetBindingValue(GetReferencedName(V), IsStrictReference(V)) (see 8.1.1).\n      let referencedName = this.GetReferencedName(realm, V);\n      invariant(typeof referencedName === \"string\");\n      return base.GetBindingValue(referencedName, this.IsStrictReference(realm, V));\n    }\n\n    invariant(false);\n  }\n\n  // ECMA262 6.2.3\n  // IsStrictReference(V). Returns the strict reference flag component of the reference V.\n  IsStrictReference(realm: Realm, V: Reference): boolean {\n    return V.strict;\n  }\n\n  // ECMA262 6.2.3\n  // IsPropertyReference(V). Returns true if either the base value is an object or HasPrimitiveBase(V) is true; otherwise returns false.\n  IsPropertyReference(realm: Realm, V: Reference): boolean {\n    // V.base is AbstractValue | void | ObjectValue | BooleanValue | StringValue | SymbolValue | NumberValue | EnvironmentRecord;\n    return V.base instanceof AbstractValue || V.base instanceof ObjectValue || this.HasPrimitiveBase(realm, V);\n  }\n\n  // ECMA262 6.2.3\n  // GetBase(V). Returns the base value component of the reference V.\n  GetBase(realm: Realm, V: Reference): void | Value | EnvironmentRecord {\n    return V.base;\n  }\n\n  // ECMA262 6.2.3\n  // IsUnresolvableReference(V). Returns true if the base value is undefined and false otherwise.\n  IsUnresolvableReference(realm: Realm, V: Reference): boolean {\n    return !V.base;\n  }\n\n  // ECMA262 8.1.2.2\n  NewDeclarativeEnvironment(realm: Realm, E: LexicalEnvironment, active: boolean = true): LexicalEnvironment {\n    // 1. Let env be a new Lexical Environment.\n    let env = new LexicalEnvironment(realm);\n    if (active) realm.activeLexicalEnvironments.add(env);\n\n    // 2. Let envRec be a new declarative Environment Record containing no bindings.\n    let envRec = new DeclarativeEnvironmentRecord(realm);\n    envRec.lexicalEnvironment = env;\n\n    // 3. Set env's EnvironmentRecord to envRec.\n    env.environmentRecord = envRec;\n\n    // 4. Set the outer lexical environment reference of env to E.\n    env.parent = E;\n\n    // 5. Return env.\n    return env;\n  }\n\n  BoundNames(realm: Realm, node: BabelNode): Array<string> {\n    return Object.keys(t.getOuterBindingIdentifiers(node));\n  }\n\n  // ECMA262 13.3.3.2\n  ContainsExpression(realm: Realm, node: ?BabelNode): boolean {\n    if (!node) {\n      return false;\n    }\n    switch (node.type) {\n      case \"ObjectPattern\":\n        for (let prop of ((node: any): BabelNodeObjectPattern).properties) {\n          if (this.ContainsExpression(realm, prop)) return true;\n        }\n        return false;\n      case \"ArrayPattern\":\n        for (let elem of ((node: any): BabelNodeArrayPattern).elements) {\n          if (this.ContainsExpression(realm, elem)) return true;\n        }\n        return false;\n      case \"RestElement\":\n        return this.ContainsExpression(realm, ((node: any): BabelNodeRestElement).argument);\n      case \"AssignmentPattern\":\n        return true;\n      default:\n        return false;\n    }\n  }\n\n  // ECMA262 8.3.2\n  ResolveBinding(realm: Realm, name: string, strict: boolean, env?: ?LexicalEnvironment): Reference {\n    // 1. If env was not passed or if env is undefined, then\n    if (!env) {\n      // a. Let env be the running execution context's LexicalEnvironment.\n      env = realm.getRunningContext().lexicalEnvironment;\n    }\n\n    // 2. Assert: env is a Lexical Environment.\n    invariant(env instanceof LexicalEnvironment, \"expected lexical environment\");\n\n    // 3. If the code matching the syntactic production that is being evaluated is contained in strict mode code, let strict be true, else let strict be false.\n\n    // 4. Return ? GetIdentifierReference(env, name, strict).\n    return this.GetIdentifierReference(realm, env, name, strict);\n  }\n\n  // ECMA262 8.1.2.1\n  GetIdentifierReference(realm: Realm, lex: ?LexicalEnvironment, name: string, strict: boolean): Reference {\n    // 1. If lex is the value null, then\n    if (!lex) {\n      // a. Return a value of type Reference whose base value is undefined, whose referenced name is name, and whose strict reference flag is strict.\n      return new Reference(undefined, name, strict);\n    }\n\n    // 2. Let envRec be lex's EnvironmentRecord.\n    let envRec = lex.environmentRecord;\n\n    // 3. Let exists be ? envRec.HasBinding(name).\n    let exists = envRec.HasBinding(name);\n\n    // 4. If exists is true, then\n    if (exists) {\n      // a. Return a value of type Reference whose base value is envRec, whose referenced name is name, and whose strict reference flag is strict.\n      return new Reference(envRec, name, strict);\n    } else {\n      // 5. Else,\n      // a. Let outer be the value of lex's outer environment reference.\n      let outer = lex.parent;\n\n      // b. Return ? GetIdentifierReference(outer, name, strict).\n      return this.GetIdentifierReference(realm, outer, name, strict);\n    }\n  }\n\n  // ECMA262 6.2.3.4\n  InitializeReferencedBinding(realm: Realm, V: Reference, W: Value): Value {\n    // 1. ReturnIfAbrupt(V).\n    // 2. ReturnIfAbrupt(W).\n\n    // 3. Assert: Type(V) is Reference.\n    invariant(V instanceof Reference, \"expected reference\");\n\n    // 4. Assert: IsUnresolvableReference(V) is false.\n    invariant(!this.IsUnresolvableReference(realm, V), \"expected resolvable reference\");\n\n    // 5. Let base be GetBase(V).\n    let base = this.GetBase(realm, V);\n\n    // 6. Assert: base is an Environment Record.\n    invariant(base instanceof EnvironmentRecord, \"expected environment record\");\n\n    // 7. Return base.InitializeBinding(GetReferencedName(V), W).\n    let referencedName = this.GetReferencedName(realm, V);\n    invariant(typeof referencedName === \"string\");\n    return base.InitializeBinding(referencedName, W);\n  }\n\n  // ECMA262 13.2.14\n  BlockDeclarationInstantiation(\n    realm: Realm,\n    strictCode: boolean,\n    body: Array<BabelNodeStatement>,\n    env: LexicalEnvironment\n  ): void {\n    // 1. Let envRec be env's EnvironmentRecord.\n    let envRec = env.environmentRecord;\n\n    // 2. Assert: envRec is a declarative Environment Record.\n    invariant(envRec instanceof DeclarativeEnvironmentRecord, \"expected declarative environment record\");\n\n    // 3. Let declarations be the LexicallyScopedDeclarations of code.\n    let declarations = [];\n    for (let node of body) {\n      if (\n        node.type === \"ClassDeclaration\" ||\n        node.type === \"FunctionDeclaration\" ||\n        (node.type === \"VariableDeclaration\" && node.kind !== \"var\")\n      ) {\n        declarations.push(node);\n      }\n    }\n\n    // 4. For each element d in declarations do\n    for (let d of declarations) {\n      // a. For each element dn of the BoundNames of d do\n      for (let dn of this.BoundNames(realm, d)) {\n        if (envRec.HasBinding(dn)) {\n          //ECMA262 13.2.1\n          throw realm.createErrorThrowCompletion(realm.intrinsics.SyntaxError, dn + \" already declared\");\n        }\n        // i. If IsConstantDeclaration of d is true, then\n        if (d.type === \"VariableDeclaration\" && d.kind === \"const\") {\n          // 1. Perform ! envRec.CreateImmutableBinding(dn, true).\n          envRec.CreateImmutableBinding(dn, true);\n        } else {\n          // ii. Else,\n          // 1. Perform ! envRec.CreateMutableBinding(dn, false).\n          envRec.CreateMutableBinding(dn, false);\n        }\n      }\n\n      // b. If d is a GeneratorDeclaration production or a FunctionDeclaration production, then\n      if (d.type === \"FunctionDeclaration\") {\n        // i. Let fn be the sole element of the BoundNames of d.\n        let fn = this.BoundNames(realm, d)[0];\n\n        // ii. Let fo be the result of performing InstantiateFunctionObject for d with argument env.\n        let fo = env.evaluate(d, strictCode);\n        invariant(fo instanceof Value);\n\n        // iii. Perform envRec.InitializeBinding(fn, fo).\n        envRec.InitializeBinding(fn, fo);\n      }\n    }\n  }\n\n  // ECMA262 8.1.2.5\n  NewGlobalEnvironment(\n    realm: Realm,\n    G: ObjectValue | AbstractObjectValue,\n    thisValue: ObjectValue | AbstractObjectValue\n  ): LexicalEnvironment {\n    // 1. Let env be a new Lexical Environment.\n    let env = new LexicalEnvironment(realm);\n\n    // 2. Let objRec be a new object Environment Record containing G as the binding object.\n    let objRec = new ObjectEnvironmentRecord(realm, G);\n\n    // 3. Let dclRec be a new declarative Environment Record containing no bindings.\n    let dclRec = new DeclarativeEnvironmentRecord(realm);\n    dclRec.lexicalEnvironment = env;\n\n    // 4. Let globalRec be a new global Environment Record.\n    let globalRec = new GlobalEnvironmentRecord(realm);\n\n    // 5. Set globalRec.[[ObjectRecord]] to objRec.\n    globalRec.$ObjectRecord = objRec;\n\n    // 6. Set globalRec.[[GlobalThisValue]] to thisValue.\n    globalRec.$GlobalThisValue = thisValue;\n\n    // 7. Set globalRec.[[DeclarativeRecord]] to dclRec.\n    globalRec.$DeclarativeRecord = dclRec;\n\n    // 8. Set globalRec.[[VarNames]] to a new empty List.\n    globalRec.$VarNames = [];\n\n    // 9. Set env's EnvironmentRecord to globalRec.\n    env.environmentRecord = globalRec;\n    realm.activeLexicalEnvironments.add(env);\n\n    // 10. Set the outer lexical environment reference of env to null.\n    env.parent = null;\n\n    // 11. Return env.\n    return env;\n  }\n\n  // ECMA262 8.1.2.3\n  NewObjectEnvironment(realm: Realm, O: ObjectValue | AbstractObjectValue, E: LexicalEnvironment): LexicalEnvironment {\n    // 1. Let env be a new Lexical Environment.\n    let env = new LexicalEnvironment(realm);\n    realm.activeLexicalEnvironments.add(env);\n\n    // 2. Let envRec be a new object Environment Record containing O as the binding object.\n    let envRec = new ObjectEnvironmentRecord(realm, O);\n\n    // 3. Set env's EnvironmentRecord to envRec.\n    env.environmentRecord = envRec;\n\n    // 4. Set the outer lexical environment reference of env to E.\n    env.parent = E;\n\n    // 5. Return env.\n    return env;\n  }\n\n  // ECMA262 8.1.2.4\n  NewFunctionEnvironment(realm: Realm, F: ECMAScriptFunctionValue, newTarget?: ObjectValue): LexicalEnvironment {\n    // 1. Assert: F is an ECMAScript function.\n    invariant(F instanceof ECMAScriptFunctionValue, \"expected a function\");\n\n    // 2. Assert: Type(newTarget) is Undefined or Object.\n    invariant(\n      newTarget === undefined || newTarget instanceof ObjectValue,\n      \"expected undefined or object value for new target\"\n    );\n\n    // 3. Let env be a new Lexical Environment.\n    let env = new LexicalEnvironment(realm);\n    realm.activeLexicalEnvironments.add(env);\n\n    // 4. Let envRec be a new function Environment Record containing no bindings.\n    let envRec = new FunctionEnvironmentRecord(realm);\n    envRec.lexicalEnvironment = env;\n\n    // 5. Set envRec.[[FunctionObject]] to F.\n    envRec.$FunctionObject = F;\n\n    // 6. If F's [[ThisMode]] internal slot is lexical, set envRec.[[ThisBindingStatus]] to \"lexical\".\n    if (F.$ThisMode === \"lexical\") {\n      envRec.$ThisBindingStatus = \"lexical\";\n    } else {\n      // 7. Else, set envRec.[[ThisBindingStatus]] to \"uninitialized\".\n      envRec.$ThisBindingStatus = \"uninitialized\";\n    }\n\n    // 8. Let home be the value of F's [[HomeObject]] internal slot.\n    let home = F.$HomeObject;\n\n    // 9. Set envRec.[[HomeObject]] to home.\n    envRec.$HomeObject = home;\n\n    // 10. Set envRec.[[NewTarget]] to newTarget.\n    envRec.$NewTarget = newTarget;\n\n    // 11. Set env's EnvironmentRecord to envRec.\n    env.environmentRecord = envRec;\n\n    // 12. Set the outer lexical environment reference of env to the value of F's [[Environment]] internal slot.\n    env.parent = F.$Environment;\n    // Set the inner environment so we can easily traverse environmental scopes\n    F.$InnerEnvironment = env;\n\n    // 13. Return env.\n    return env;\n  }\n\n  // ECMA262 8.3.1\n  GetActiveScriptOrModule(realm: Realm): any {\n    // The GetActiveScriptOrModule abstract operation is used to determine the running script or module, based on the active function object.\n    // GetActiveScriptOrModule performs the following steps:\n    //\n    // If the execution context stack is empty, return null.\n    if (realm.contextStack.length === 0) return null;\n    // Let ec be the topmost execution context on the execution context stack whose Function component's [[ScriptOrModule]] component is not null.\n    // If such an execution context exists, return ec's Function component's [[ScriptOrModule]] slot's value.\n    let ec;\n    for (let i = realm.contextStack.length - 1; i >= 0; i--) {\n      ec = realm.contextStack[i];\n      let F = ec.function;\n      if (F == null) continue;\n      if (F.$ScriptOrModule instanceof Object) {\n        return F.$ScriptOrModule;\n      }\n    }\n    // Otherwise, let ec be the running execution context.\n    ec = realm.getRunningContext();\n    // Assert: ec's ScriptOrModule component is not null.\n    invariant(ec.ScriptOrModule !== null);\n    // Return ec's ScriptOrModule component.\n    return ec.ScriptOrModule;\n  }\n\n  // ECMA262 8.3.3\n  GetThisEnvironment(realm: Realm): EnvironmentRecord {\n    // 1. Let lex be the running execution context's LexicalEnvironment.\n    let lex = realm.getRunningContext().lexicalEnvironment;\n\n    // 2. Repeat\n    while (true) {\n      // a. Let envRec be lex's EnvironmentRecord.\n      let envRec = lex.environmentRecord;\n\n      // b. Let exists be envRec.HasThisBinding().\n      let exists = envRec.HasThisBinding();\n\n      // c. If exists is true, return envRec.\n      if (exists) return envRec;\n\n      // d. Let outer be the value of lex's outer environment reference.\n      let outer = lex.parent;\n      invariant(outer);\n\n      // e. Let lex be outer.\n      lex = outer;\n    }\n\n    invariant(false);\n  }\n\n  // ECMA262 8.3.4\n  ResolveThisBinding(realm: Realm): NullValue | ObjectValue | AbstractObjectValue | UndefinedValue {\n    // 1. Let envRec be GetThisEnvironment( ).\n    let envRec = this.GetThisEnvironment(realm);\n\n    // 2. Return ? envRec.GetThisBinding().\n    return envRec.GetThisBinding();\n  }\n\n  BindingInitialization(\n    realm: Realm,\n    node: BabelNodeLVal | BabelNodeVariableDeclaration,\n    value: Value,\n    strictCode: boolean,\n    environment: void | LexicalEnvironment\n  ): void | boolean | Value {\n    if (node.type === \"ArrayPattern\") {\n      // ECMA262 13.3.3.5\n      // 1. Let iterator be ? GetIterator(value).\n      let iterator = GetIterator(realm, value);\n\n      // 2. Let iteratorRecord be Record {[[Iterator]]: iterator, [[Done]]: false}.\n      let iteratorRecord = {\n        $Iterator: iterator,\n        $Done: false,\n      };\n\n      let result;\n\n      // 3. Let result be IteratorBindingInitialization for ArrayBindingPattern using iteratorRecord and environment as arguments.\n      try {\n        result = this.IteratorBindingInitialization(realm, node.elements, iteratorRecord, strictCode, environment);\n      } catch (error) {\n        // 4. If iteratorRecord.[[Done]] is false, return ? IteratorClose(iterator, result).\n        if (iteratorRecord.$Done === false && error instanceof AbruptCompletion) {\n          throw IteratorClose(realm, iterator, error);\n        }\n        throw error;\n      }\n\n      // 4. If iteratorRecord.[[Done]] is false, return ? IteratorClose(iterator, result).\n      if (iteratorRecord.$Done === false) {\n        let completion = IteratorClose(realm, iterator, new SimpleNormalCompletion(realm.intrinsics.undefined));\n        if (completion instanceof AbruptCompletion) {\n          throw completion;\n        }\n      }\n\n      // 5. Return result.\n      return result;\n    } else if (node.type === \"ObjectPattern\") {\n      RequireObjectCoercible(realm, value);\n\n      let BindingPropertyList = [],\n        BindingRestElement = null;\n\n      for (let property of node.properties) {\n        if (property.type === \"RestElement\") {\n          BindingRestElement = property;\n        } else {\n          BindingPropertyList.push(property);\n        }\n      }\n\n      // ObjectBindingPattern:\n      //   { BindingPropertyList }\n      //   { BindingPropertyList, }\n\n      if (!BindingRestElement) {\n        // 1. Let excludedNames be the result of performing PropertyBindingInitialization for BindingPropertyList using value and environment as the argument.\n        /* let excludedNames = */ this.PropertyBindingInitialization(\n          realm,\n          BindingPropertyList,\n          value,\n          strictCode,\n          environment\n        );\n\n        // 2. ReturnIfAbrupt(excludedNames).\n\n        // 3. Return NormalCompletion(empty).\n        return realm.intrinsics.empty;\n      }\n\n      // ObjectBindingPattern : { BindingRestElement }\n      if (BindingPropertyList.length === 0) {\n        // 1. Let excludedNames be a new empty List.\n        let excludedNames = [];\n\n        // 2. Return the result of performing RestBindingInitialization of BindingRestElement with value, environment and excludedNames as the arguments.\n        return this.RestBindingInitialization(realm, BindingRestElement, value, excludedNames, strictCode, environment);\n      } else {\n        // ObjectBindingPattern : { BindingPropertyList, BindingRestElement }\n\n        // 1. Let excludedNames be the result of performing PropertyBindingInitialization of BindingPropertyList using value and environment as arguments.\n        let excludedNames = this.PropertyBindingInitialization(\n          realm,\n          BindingPropertyList,\n          value,\n          strictCode,\n          environment\n        );\n\n        // 2. ReturnIfAbrupt(excludedNames).\n\n        // 3. Return the result of performing RestBindingInitialization of BindingRestElement with value, environment and excludedNames as the arguments.\n        return this.RestBindingInitialization(realm, BindingRestElement, value, excludedNames, strictCode, environment);\n      }\n    } else if (node.type === \"Identifier\") {\n      // ECMA262 12.1.5\n      // 1. Let name be StringValue of Identifier.\n      let name = ((node: any): BabelNodeIdentifier).name;\n\n      // 2. Return ? InitializeBoundName(name, value, environment).\n      return this.InitializeBoundName(realm, name, value, environment);\n    } else {\n      invariant(node.type === \"VariableDeclaration\");\n      // ECMA262 13.7.5.9\n      for (let decl of ((node: any): BabelNodeVariableDeclaration).declarations) {\n        this.BindingInitialization(realm, decl.id, value, strictCode, environment);\n      }\n    }\n  }\n\n  // ECMA262 13.3.3.6\n  // ECMA262 14.1.19\n  IteratorBindingInitialization(\n    realm: Realm,\n    formals: $ReadOnlyArray<BabelNodeLVal | null>,\n    iteratorRecord: { $Iterator: ObjectValue, $Done: boolean },\n    strictCode: boolean,\n    environment: void | LexicalEnvironment\n  ): void {\n    let env = environment ? environment : realm.getRunningContext().lexicalEnvironment;\n\n    // Check if the last formal is a rest element. If so then we want to save the\n    // element and handle it separately after we iterate through the other\n    // formals. This also enforces that a rest element may only ever be in the\n    // last position.\n    let restEl;\n    if (formals.length > 0) {\n      let lastFormal = formals[formals.length - 1];\n      if (lastFormal !== null && lastFormal.type === \"RestElement\") {\n        restEl = lastFormal;\n        formals = formals.slice(0, -1);\n      }\n    }\n\n    for (let param of formals) {\n      if (param === null) {\n        // Elision handling in IteratorDestructuringAssignmentEvaluation\n\n        // 1. If iteratorRecord.[[Done]] is false, then\n        if (iteratorRecord.$Done === false) {\n          // a. Let next be IteratorStep(iteratorRecord.[[Iterator]]).\n          let next;\n          try {\n            next = IteratorStep(realm, iteratorRecord.$Iterator);\n          } catch (e) {\n            // b. If next is an abrupt completion, set iteratorRecord.[[Done]] to true.\n            if (e instanceof AbruptCompletion) {\n              iteratorRecord.$Done = true;\n            }\n            // c. ReturnIfAbrupt(next).\n            throw e;\n          }\n          // d. If next is false, set iteratorRecord.[[Done]] to true.\n          if (next === false) {\n            iteratorRecord.$Done = true;\n          }\n        }\n        // 2. Return NormalCompletion(empty).\n        continue;\n      }\n\n      let Initializer;\n      if (param.type === \"AssignmentPattern\") {\n        Initializer = param.right;\n        param = param.left;\n      }\n\n      if (param.type === \"Identifier\") {\n        // SingleNameBinding : BindingIdentifier Initializer\n\n        // 1. Let bindingId be StringValue of BindingIdentifier.\n        let bindingId = param.name;\n\n        // 2. Let lhs be ? ResolveBinding(bindingId, environment).\n        let lhs = this.ResolveBinding(realm, param.name, strictCode, environment);\n\n        // Initialized later in the algorithm.\n        let v;\n\n        // 3. If iteratorRecord.[[Done]] is false, then\n        if (iteratorRecord.$Done === false) {\n          // a. Let next be IteratorStep(iteratorRecord.[[Iterator]]).\n          let next: ObjectValue | false;\n          try {\n            next = IteratorStep(realm, iteratorRecord.$Iterator);\n          } catch (e) {\n            // b. If next is an abrupt completion, set iteratorRecord.[[Done]] to true.\n            if (e instanceof AbruptCompletion) {\n              iteratorRecord.$Done = true;\n            }\n            // c. ReturnIfAbrupt(next).\n            throw e;\n          }\n\n          // d. If next is false, set iteratorRecord.[[Done]] to true.\n          if (next === false) {\n            iteratorRecord.$Done = true;\n            // Normally this assignment would be done in step 4, but we do it\n            // here so that Flow knows `v` will always be initialized by step 5.\n            v = realm.intrinsics.undefined;\n          } else {\n            // e. Else,\n            // i. Let v be IteratorValue(next).\n            try {\n              v = IteratorValue(realm, next);\n            } catch (e) {\n              // ii. If v is an abrupt completion, set iteratorRecord.[[Done]] to true.\n              if (e instanceof AbruptCompletion) {\n                iteratorRecord.$Done = true;\n              }\n              // iii. ReturnIfAbrupt(v).\n              throw e;\n            }\n          }\n        } else {\n          // 4. If iteratorRecord.[[Done]] is true, let v be undefined.\n          v = realm.intrinsics.undefined;\n        }\n\n        // 5. If Initializer is present and v is undefined, then\n        if (Initializer && v instanceof UndefinedValue) {\n          // a. Let defaultValue be the result of evaluating Initializer.\n          let defaultValue = env.evaluate(Initializer, strictCode);\n\n          // b. Let v be ? GetValue(defaultValue).\n          v = this.GetValue(realm, defaultValue);\n\n          // c. If IsAnonymousFunctionDefinition(Initializer) is true, then\n          if (IsAnonymousFunctionDefinition(realm, Initializer) && v instanceof ObjectValue) {\n            // i. Let hasNameProperty be ? HasOwnProperty(v, \"name\").\n            let hasNameProperty = HasOwnProperty(realm, v, \"name\");\n\n            // ii. If hasNameProperty is false, perform SetFunctionName(v, bindingId).\n            if (hasNameProperty === false) {\n              Functions.SetFunctionName(realm, v, bindingId);\n            }\n          }\n        }\n\n        // 6. If environment is undefined, return ? PutValue(lhs, v).\n        if (!environment) {\n          Properties.PutValue(realm, lhs, v);\n          continue;\n        }\n\n        // 7. Return InitializeReferencedBinding(lhs, v).\n        this.InitializeReferencedBinding(realm, lhs, v);\n        continue;\n      } else {\n        invariant(param.type === \"ObjectPattern\" || param.type === \"ArrayPattern\");\n        // BindingElement : BindingPatternInitializer\n\n        // Initialized later in the algorithm.\n        let v;\n\n        // 1. If iteratorRecord.[[Done]] is false, then\n        if (iteratorRecord.$Done === false) {\n          // a. Let next be IteratorStep(iteratorRecord.[[Iterator]]).\n          let next;\n          try {\n            next = IteratorStep(realm, iteratorRecord.$Iterator);\n          } catch (e) {\n            // b. If next is an abrupt completion, set iteratorRecord.[[Done]] to true.\n            if (e instanceof AbruptCompletion) {\n              iteratorRecord.$Done = true;\n            }\n            // c. ReturnIfAbrupt(next).\n            throw e;\n          }\n\n          // d. If next is false, set iteratorRecord.[[Done]] to true.\n          if (next === false) {\n            iteratorRecord.$Done = true;\n            // Normally this assignment would be done in step 2, but we do it\n            // here so that Flow knows `v` will always be initialized by step 3.\n            v = realm.intrinsics.undefined;\n          } else {\n            // e. Else,\n            // i. Let v be IteratorValue(next).\n            try {\n              v = IteratorValue(realm, next);\n            } catch (e) {\n              // ii. If v is an abrupt completion, set iteratorRecord.[[Done]] to true.\n              if (e instanceof AbruptCompletion) {\n                iteratorRecord.$Done = true;\n              }\n              // iii. ReturnIfAbrupt(v).\n              throw e;\n            }\n          }\n        } else {\n          // 2. If iteratorRecord.[[Done]] is true, let v be undefined.\n          v = realm.intrinsics.undefined;\n        }\n\n        // 3. If Initializer is present and v is undefined, then\n        if (Initializer && v instanceof UndefinedValue) {\n          // a. Let defaultValue be the result of evaluating Initializer.\n          let defaultValue = env.evaluate(Initializer, strictCode);\n\n          // b. Let v be ? GetValue(defaultValue).\n          v = this.GetValue(realm, defaultValue);\n        }\n\n        // 4. Return the result of performing BindingInitialization of BindingPattern with v and environment as the arguments.\n        this.BindingInitialization(realm, param, v, strictCode, environment);\n        continue;\n      }\n    }\n\n    // Handle the rest element if we have one.\n    if (restEl && restEl.argument.type === \"Identifier\") {\n      // BindingRestElement : ...BindingIdentifier\n\n      // 1. Let lhs be ? ResolveBinding(StringValue of BindingIdentifier, environment).\n      let lhs = this.ResolveBinding(realm, restEl.argument.name, strictCode, environment);\n\n      // 2. Let A be ArrayCreate(0).\n      let A = Create.ArrayCreate(realm, 0);\n\n      // 3. Let n be 0.\n      let n = 0;\n\n      // 4. Repeat,\n      while (true) {\n        // Initialized later in the algorithm.\n        let next: ObjectValue | false;\n\n        // a. If iteratorRecord.[[Done]] is false, then\n        if (iteratorRecord.$Done === false) {\n          // i. Let next be IteratorStep(iteratorRecord.[[Iterator]]).\n          try {\n            next = IteratorStep(realm, iteratorRecord.$Iterator);\n          } catch (e) {\n            // ii. If next is an abrupt completion, set iteratorRecord.[[Done]] to true.\n            if (e instanceof AbruptCompletion) {\n              iteratorRecord.$Done = true;\n            }\n            // iii. ReturnIfAbrupt(next).\n            throw e;\n          }\n          // iv. If next is false, set iteratorRecord.[[Done]] to true.\n          if (next === false) {\n            iteratorRecord.$Done = true;\n          }\n        }\n\n        // b. If iteratorRecord.[[Done]] is true, then\n        if (iteratorRecord.$Done === true) {\n          // i. If environment is undefined, return ? PutValue(lhs, A).\n          if (!environment) {\n            Properties.PutValue(realm, lhs, A);\n            break;\n          }\n\n          // ii. Return InitializeReferencedBinding(lhs, A).\n          this.InitializeReferencedBinding(realm, lhs, A);\n          break;\n        }\n\n        // Given the nature of the algorithm this should always be true, however\n        // it is difficult to arrange the code in such a way where Flow's control\n        // flow analysis will pick that up, so we add an invariant here.\n        invariant(next instanceof ObjectValue);\n\n        // c. Let nextValue be IteratorValue(next).\n        let nextValue;\n        try {\n          nextValue = IteratorValue(realm, next);\n        } catch (e) {\n          // d. If nextValue is an abrupt completion, set iteratorRecord.[[Done]] to true.\n          if (e instanceof AbruptCompletion) {\n            iteratorRecord.$Done = true;\n          }\n          // e. ReturnIfAbrupt(nextValue).\n          throw e;\n        }\n\n        // f. Let status be CreateDataProperty(A, ! To.ToString(n), nextValue).\n        let status = Create.CreateDataProperty(realm, A, n.toString(), nextValue);\n\n        // g. Assert: status is true.\n        invariant(status, \"expected to create data property\");\n\n        // h. Increment n by 1.\n        n += 1;\n      }\n    } else if (restEl) {\n      invariant(restEl.argument.type === \"ArrayPattern\" || restEl.argument.type === \"ObjectPattern\");\n      // 1. Let A be ArrayCreate(0).\n      let A = Create.ArrayCreate(realm, 0);\n\n      // 2. Let n be 0.\n      let n = 0;\n\n      // 3. Repeat,\n      while (true) {\n        // Initialized later in the algorithm.\n        let next;\n\n        // a. If iteratorRecord.[[Done]] is false, then\n        if (iteratorRecord.$Done === false) {\n          // i. Let next be IteratorStep(iteratorRecord.[[Iterator]]).\n          try {\n            next = IteratorStep(realm, iteratorRecord.$Iterator);\n          } catch (e) {\n            // ii. If next is an abrupt completion, set iteratorRecord.[[Done]] to true.\n            if (e instanceof AbruptCompletion) {\n              iteratorRecord.$Done = true;\n            }\n            // iii. ReturnIfAbrupt(next).\n            throw e;\n          }\n          // iv. If next is false, set iteratorRecord.[[Done]] to true.\n          if (next === false) {\n            iteratorRecord.$Done = true;\n          }\n        }\n\n        // b. If iteratorRecord.[[Done]] is true, then\n        if (iteratorRecord.$Done === true) {\n          // i. Return the result of performing BindingInitialization of BindingPattern with A and environment as the arguments.\n          this.BindingInitialization(realm, restEl.argument, A, strictCode, environment);\n          break;\n        }\n\n        // Given the nature of the algorithm this should always be true, however\n        // it is difficult to arrange the code in such a way where Flow's control\n        // flow analysis will pick that up, so we add an invariant here.\n        invariant(next instanceof ObjectValue);\n\n        // c. Let nextValue be IteratorValue(next).\n        let nextValue;\n        try {\n          nextValue = IteratorValue(realm, next);\n        } catch (e) {\n          // d. If nextValue is an abrupt completion, set iteratorRecord.[[Done]] to true.\n          if (e instanceof AbruptCompletion) {\n            iteratorRecord.$Done = true;\n          }\n          // e. ReturnIfAbrupt(nextValue).\n          throw e;\n        }\n\n        // f. Let status be CreateDataProperty(A, ! To.ToString(n), nextValue).\n        let status = Create.CreateDataProperty(realm, A, n.toString(), nextValue);\n\n        // g. Assert: status is true.\n        invariant(status, \"expected to create data property\");\n\n        // h. Increment n by 1.\n        n += 1;\n      }\n    }\n  }\n\n  // ECMA262 12.1.5.1\n  InitializeBoundName(\n    realm: Realm,\n    name: string,\n    value: Value,\n    environment: void | LexicalEnvironment\n  ): void | boolean | Value {\n    // 1. Assert: Type(name) is String.\n    invariant(typeof name === \"string\", \"expected name to be a string\");\n\n    // 2. If environment is not undefined, then\n    if (environment) {\n      // a. Let env be the EnvironmentRecord component of environment.\n      let env = environment.environmentRecord;\n\n      // b. Perform env.InitializeBinding(name, value).\n      env.InitializeBinding(name, value);\n\n      // c. Return NormalCompletion(undefined).\n      return realm.intrinsics.undefined;\n    } else {\n      // 3. Else,\n      // a. Let lhs be ResolveBinding(name).\n      // Note that the undefined environment implies non-strict.\n      let lhs = this.ResolveBinding(realm, name, false);\n\n      // b. Return ? PutValue(lhs, value).\n      return Properties.PutValue(realm, lhs, value);\n    }\n  }\n\n  // ECMA262 12.3.1.3 and 13.7.5.6\n  IsDestructuring(ast: BabelNode): boolean {\n    switch (ast.type) {\n      case \"VariableDeclaration\":\n        for (let decl of ((ast: any): BabelNodeVariableDeclaration).declarations) {\n          switch (decl.type) {\n            case \"VariableDeclarator\":\n              switch (decl.id.type) {\n                case \"ArrayPattern\":\n                case \"AssignmentPattern\":\n                case \"ObjectPattern\":\n                  return true;\n                default:\n                  break;\n              }\n              break;\n            default:\n              break;\n          }\n        }\n        return false;\n      case \"ArrayLiteral\":\n      case \"ObjectLiteral\":\n        return true;\n      case \"ArrayPattern\":\n      case \"ObjectPattern\":\n        return true;\n      default:\n        return false;\n    }\n  }\n\n  // ECMA262 13.3.3.7\n  KeyedBindingInitialization(\n    realm: Realm,\n    node: BabelNodeIdentifier | BabelNodePattern,\n    value: Value,\n    strictCode: boolean,\n    environment: ?LexicalEnvironment,\n    propertyName: PropertyKeyValue\n  ): void | boolean | Value {\n    let env = environment ? environment : realm.getRunningContext().lexicalEnvironment;\n\n    let Initializer;\n    if (node.type === \"AssignmentPattern\") {\n      Initializer = node.right;\n      node = node.left;\n    }\n\n    if (node.type === \"Identifier\") {\n      // SingleNameBinding : BindingIdentifier Initializer\n\n      // 1. Let bindingId be StringValue of BindingIdentifier.\n      let bindingId = node.name;\n\n      // 2. Let lhs be ? ResolveBinding(bindingId, environment).\n      let lhs = this.ResolveBinding(realm, bindingId, strictCode, environment);\n\n      // 3. Let v be ? GetV(value, propertyName).\n      let v = GetV(realm, value, propertyName);\n\n      // 4. If Initializer is present and v is undefined, then\n      if (Initializer && v instanceof UndefinedValue) {\n        // a. Let defaultValue be the result of evaluating Initializer.\n        let defaultValue = env.evaluate(Initializer, strictCode);\n\n        // b. Let v be ? GetValue(defaultValue).\n        v = this.GetValue(realm, defaultValue);\n\n        // c. If IsAnonymousFunctionDefinition(Initializer) is true, then\n        if (IsAnonymousFunctionDefinition(realm, Initializer) && v instanceof ObjectValue) {\n          // i. Let hasNameProperty be ? HasOwnProperty(v, \"name\").\n          let hasNameProperty = HasOwnProperty(realm, v, \"name\");\n          // ii. If hasNameProperty is false, perform SetFunctionName(v, bindingId).\n          if (hasNameProperty === false) {\n            Functions.SetFunctionName(realm, v, bindingId);\n          }\n        }\n      }\n\n      // 5. If environment is undefined, return ? PutValue(lhs, v).\n      if (!environment) return Properties.PutValue(realm, lhs, v);\n\n      // 6. Return InitializeReferencedBinding(lhs, v).\n      return this.InitializeReferencedBinding(realm, lhs, v);\n    } else if (node.type === \"ObjectPattern\" || node.type === \"ArrayPattern\") {\n      // BindingElement : BindingPattern Initializer\n\n      // 1. Let v be ? GetV(value, propertyName).\n      let v = GetV(realm, value, propertyName);\n\n      // 2. If Initializer is present and v is undefined, then\n      if (Initializer && v instanceof UndefinedValue) {\n        // a. Let defaultValue be the result of evaluating Initializer.\n        let defaultValue = env.evaluate(Initializer, strictCode);\n\n        // b. Let v be ? GetValue(defaultValue).\n        v = this.GetValue(realm, defaultValue);\n      }\n\n      // 3. Return the result of performing BindingInitialization for BindingPattern passing v and environment as arguments.\n      return this.BindingInitialization(realm, node, v, strictCode, env);\n    }\n  }\n}\n"
  },
  {
    "path": "src/methods/function.js",
    "content": "/**\n * Copyright (c) 2017-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n/* @flow */\n\nimport type { LexicalEnvironment } from \"../environment.js\";\nimport type { PropertyKeyValue } from \"../types.js\";\nimport { FatalError } from \"../errors.js\";\nimport type { Realm } from \"../realm.js\";\nimport type { ECMAScriptFunctionValue } from \"../values/index.js\";\nimport {\n  AbruptCompletion,\n  Completion,\n  JoinedNormalAndAbruptCompletions,\n  ReturnCompletion,\n  SimpleNormalCompletion,\n} from \"../completions.js\";\nimport { GlobalEnvironmentRecord, ObjectEnvironmentRecord } from \"../environment.js\";\nimport {\n  AbstractValue,\n  AbstractObjectValue,\n  BoundFunctionValue,\n  ECMAScriptSourceFunctionValue,\n  EmptyValue,\n  FunctionValue,\n  NumberValue,\n  ObjectValue,\n  StringValue,\n  SymbolValue,\n  UndefinedValue,\n  Value,\n} from \"../values/index.js\";\nimport { OrdinaryCallEvaluateBody, OrdinaryCallBindThis, PrepareForOrdinaryCall, Call } from \"./call.js\";\nimport { SameValue } from \"../methods/abstract.js\";\nimport { Construct } from \"../methods/construct.js\";\nimport { UpdateEmpty } from \"../methods/index.js\";\nimport { CreateListIterator } from \"../methods/iterator.js\";\nimport { EvalPropertyName } from \"../evaluators/ObjectExpression.js\";\nimport { Create, Environment, Join, Properties } from \"../singletons.js\";\nimport traverseFast from \"../utils/traverse-fast.js\";\nimport invariant from \"../invariant.js\";\nimport parse from \"../utils/parse.js\";\nimport IsStrict from \"../utils/strict.js\";\nimport type {\n  BabelNode,\n  BabelNodeBlockStatement,\n  BabelNodeClassMethod,\n  BabelNodeDoWhileStatement,\n  BabelNodeForInStatement,\n  BabelNodeForOfStatement,\n  BabelNodeForStatement,\n  BabelNodeIfStatement,\n  BabelNodeLabeledStatement,\n  BabelNodeLVal,\n  BabelNodeObjectMethod,\n  BabelNodeProgram,\n  BabelNodeStatement,\n  BabelNodeSwitchStatement,\n  BabelNodeTryStatement,\n  BabelNodeVariableDeclaration,\n  BabelNodeWhileStatement,\n  BabelNodeWithStatement,\n} from \"@babel/types\";\nimport * as t from \"@babel/types\";\nimport { PropertyDescriptor } from \"../descriptors.js\";\n\nfunction InternalCall(\n  realm: Realm,\n  F: ECMAScriptFunctionValue,\n  thisArgument: Value,\n  argsList: Array<Value>,\n  tracerIndex: number\n): Value {\n  realm.startCall();\n  try {\n    // 1. Assert: F is an ECMAScript function object.\n    invariant(F instanceof FunctionValue, \"expected function value\");\n\n    // Tracing: Give all registered tracers a chance to detour, wrapping around each other if needed.\n    while (tracerIndex < realm.tracers.length) {\n      let tracer = realm.tracers[tracerIndex];\n      let nextIndex = ++tracerIndex;\n      let detourResult = tracer.detourCall(F, thisArgument, argsList, undefined, () =>\n        InternalCall(realm, F, thisArgument, argsList, nextIndex)\n      );\n      if (detourResult instanceof Value) return detourResult;\n    }\n\n    // 2. If F's [[FunctionKind]] internal slot is \"classConstructor\", throw a TypeError exception.\n    if (F.$FunctionKind === \"classConstructor\")\n      throw realm.createErrorThrowCompletion(realm.intrinsics.TypeError, \"not callable\");\n\n    // 3. Let callerContext be the running execution context.\n    let callerContext = realm.getRunningContext();\n\n    // 4. Let calleeContext be PrepareForOrdinaryCall(F, undefined).\n    let calleeContext = PrepareForOrdinaryCall(realm, F, undefined);\n    let calleeEnv = calleeContext.lexicalEnvironment;\n\n    let result;\n    try {\n      for (let t1 of realm.tracers) t1.beforeCall(F, thisArgument, argsList, undefined);\n\n      // 5. Assert: calleeContext is now the running execution context.\n      invariant(realm.getRunningContext() === calleeContext, \"calleeContext should be current execution context\");\n\n      // 6. Perform OrdinaryCallBindThis(F, calleeContext, thisArgument).\n      OrdinaryCallBindThis(realm, F, calleeContext, thisArgument);\n\n      // 7. Let result be OrdinaryCallEvaluateBody(F, argumentsList).\n      result = OrdinaryCallEvaluateBody(realm, F, argsList);\n    } finally {\n      // 8. Remove calleeContext from the execution context stack and restore callerContext as the running execution context.\n      realm.popContext(calleeContext);\n      realm.onDestroyScope(calleeContext.lexicalEnvironment);\n      if (calleeContext.lexicalEnvironment !== calleeEnv) realm.onDestroyScope(calleeEnv);\n      invariant(realm.getRunningContext() === callerContext);\n\n      for (let t2 of realm.tracers) t2.afterCall(F, thisArgument, argsList, undefined, (result: any));\n    }\n\n    // 9. If result.[[Type]] is return, return NormalCompletion(result.[[Value]]).\n    if (result instanceof ReturnCompletion) {\n      return result.value;\n    }\n\n    // 10. ReturnIfAbrupt(result).\n    if (result instanceof AbruptCompletion) {\n      throw result;\n    }\n\n    // 11. Return NormalCompletion(undefined).\n    return realm.intrinsics.undefined;\n  } finally {\n    realm.endCall();\n  }\n}\n\n// ECMA262 9.4.1.1\nfunction $BoundCall(realm: Realm, F: BoundFunctionValue, thisArgument: Value, argumentsList: Array<Value>): Value {\n  // 1. Let target be the value of F's [[BoundTargetFunction]] internal slot.\n  let target = F.$BoundTargetFunction;\n\n  // 2. Let boundThis be the value of F's [[BoundThis]] internal slot.\n  let boundThis = F.$BoundThis;\n\n  // 3. Let boundArgs be the value of F's [[BoundArguments]] internal slot.\n  let boundArgs = F.$BoundArguments;\n\n  // 4. Let args be a new list containing the same values as the list boundArgs in the same order followed\n  //    by the same values as the list argumentsList in the same order.\n  let args = boundArgs.concat(argumentsList);\n\n  // 5. Return ? Call(target, boundThis, args).\n  return Call(realm, target, boundThis, args);\n}\n\n// ECMA262 9.4.1.2\nfunction $BoundConstruct(\n  realm: Realm,\n  F: BoundFunctionValue,\n  argumentsList: Array<Value>,\n  newTarget: ObjectValue\n): ObjectValue | AbstractObjectValue {\n  // 1. Let target be the value of F's [[BoundTargetFunction]] internal slot.\n  let target = F.$BoundTargetFunction;\n\n  // 2. Assert: target has a [[Construct]] internal method.\n  invariant(target.$Construct !== undefined, \"doesn't have a construct internal method\");\n\n  // 3. Let boundArgs be the value of F's [[BoundArguments]] internal slot.\n  let boundArgs = F.$BoundArguments;\n\n  // 4. Let args be a new list containing the same values as the list boundArgs in the same order followed\n  //    by the same values as the list argumentsList in the same order.\n  let args = boundArgs.concat(argumentsList);\n\n  // 5. If SameValue(F, newTarget) is true, let newTarget be target.\n  if (SameValue(realm, F, newTarget)) newTarget = target;\n\n  // 6. Return ? Construct(target, args, newTarget).\n  return Construct(realm, target, args, newTarget);\n}\n\nfunction InternalConstruct(\n  realm: Realm,\n  F: ECMAScriptFunctionValue,\n  argumentsList: Array<Value>,\n  newTarget: ObjectValue,\n  thisArgument: void | ObjectValue,\n  tracerIndex: number\n): ObjectValue | AbstractObjectValue {\n  realm.startCall();\n  try {\n    // 1. Assert: F is an ECMAScript function object.\n    invariant(F instanceof FunctionValue, \"expected function\");\n\n    // 2. Assert: Type(newTarget) is Object.\n    invariant(newTarget instanceof ObjectValue, \"expected object\");\n\n    if (!realm.hasRunningContext()) {\n      invariant(realm.useAbstractInterpretation);\n      throw new FatalError(\"no running context\");\n    }\n\n    // 3. Let callerContext be the running execution context.\n    let callerContext = realm.getRunningContext();\n\n    // 4. Let kind be F's [[ConstructorKind]] internal slot.\n    let kind = F.$ConstructorKind;\n\n    // 5. If kind is \"base\", then\n    if (thisArgument === undefined && kind === \"base\") {\n      // a. Let thisArgument be ? OrdinaryCreateFromConstructor(newTarget, \"%ObjectPrototype%\").\n      thisArgument = Create.OrdinaryCreateFromConstructor(realm, newTarget, \"ObjectPrototype\");\n    }\n\n    // Tracing: Give all registered tracers a chance to detour, wrapping around each other if needed.\n    while (tracerIndex < realm.tracers.length) {\n      let tracer = realm.tracers[tracerIndex];\n      let nextIndex = ++tracerIndex;\n      let detourResult = tracer.detourCall(F, thisArgument, argumentsList, newTarget, () =>\n        InternalConstruct(realm, F, argumentsList, newTarget, thisArgument, nextIndex)\n      );\n      if (detourResult instanceof ObjectValue) return detourResult;\n      invariant(detourResult === undefined);\n    }\n\n    // 6. Let calleeContext be PrepareForOrdinaryCall(F, newTarget).\n    let calleeContext = PrepareForOrdinaryCall(realm, F, newTarget);\n    let calleeEnv = calleeContext.lexicalEnvironment;\n\n    // 7. Assert: calleeContext is now the running execution context.\n    invariant(realm.getRunningContext() === calleeContext, \"expected calleeContext to be running context\");\n\n    let result, envRec;\n    try {\n      for (let t1 of realm.tracers) t1.beforeCall(F, thisArgument, argumentsList, newTarget);\n\n      // 8. If kind is \"base\", perform OrdinaryCallBindThis(F, calleeContext, thisArgument).\n      if (kind === \"base\") {\n        invariant(thisArgument, \"this wasn't initialized for some reason\");\n        OrdinaryCallBindThis(realm, F, calleeContext, thisArgument);\n      }\n\n      // 9. Let constructorEnv be the LexicalEnvironment of calleeContext.\n      let constructorEnv = calleeContext.lexicalEnvironment;\n\n      // 10. Let envRec be constructorEnv's EnvironmentRecord.\n      envRec = constructorEnv.environmentRecord;\n\n      // 11. Let result be OrdinaryCallEvaluateBody(F, argumentsList).\n      result = OrdinaryCallEvaluateBody(realm, F, argumentsList);\n    } finally {\n      // 12. Remove calleeContext from the execution context stack and restore callerContext as the running execution context.\n      realm.popContext(calleeContext);\n      realm.onDestroyScope(calleeContext.lexicalEnvironment);\n      if (calleeContext.lexicalEnvironment !== calleeEnv) realm.onDestroyScope(calleeEnv);\n      invariant(realm.getRunningContext() === callerContext);\n\n      for (let t2 of realm.tracers) t2.afterCall(F, thisArgument, argumentsList, newTarget, result);\n    }\n\n    // 13. If result.[[Type]] is return, then\n    if (result instanceof ReturnCompletion) {\n      const v = map(result.value);\n      invariant(v instanceof ObjectValue || v instanceof AbstractObjectValue);\n      return v;\n\n      function map(value: Value) {\n        if (value === realm.intrinsics.__bottomValue) return value;\n\n        if (value instanceof AbstractValue) {\n          if (value.kind === \"conditional\") {\n            const [condition, consequent, alternate] = value.args;\n            return realm.evaluateWithAbstractConditional(\n              condition,\n              () => realm.evaluateForEffects(() => map(consequent), undefined, \"AbstractValue/conditional/true\"),\n              () => realm.evaluateForEffects(() => map(alternate), undefined, \"AbstractValue/conditional/false\")\n            );\n          }\n          if (!(value instanceof AbstractObjectValue)) {\n            if (kind === \"base\") {\n              invariant(thisArgument, \"this wasn't initialized for some reason\");\n              return AbstractValue.createFromTemplate(\n                realm,\n                \"typeof A === 'object' || typeof A === 'function' ? A : B\",\n                ObjectValue,\n                [value, thisArgument]\n              );\n            } else {\n              value.throwIfNotConcreteObject(); // Not yet supported.\n            }\n          }\n        }\n\n        // a. If Type(result.[[Value]]) is Object, return NormalCompletion(result.[[Value]]).\n        if (value instanceof ObjectValue || value instanceof AbstractObjectValue) return value;\n\n        // b. If kind is \"base\", return NormalCompletion(thisArgument).\n        if (kind === \"base\") {\n          invariant(thisArgument, \"this wasn't initialized for some reason\");\n          return thisArgument;\n        }\n\n        // c. If result.[[Value]] is not undefined, throw a TypeError exception.\n        if (!value.mightBeUndefined()) {\n          throw realm.createErrorThrowCompletion(realm.intrinsics.TypeError, \"constructor must return Object\");\n        }\n\n        value.throwIfNotConcrete();\n\n        // 15. Return ? envRec.GetThisBinding().\n        let envRecThisBinding = envRec.GetThisBinding();\n        invariant(envRecThisBinding instanceof ObjectValue);\n        return envRecThisBinding;\n      }\n    } else if (result instanceof AbruptCompletion) {\n      // 14. Else, ReturnIfAbrupt(result).\n      throw result;\n    }\n\n    // 15. Return ? envRec.GetThisBinding().\n    let envRecThisBinding = envRec.GetThisBinding();\n    invariant(envRecThisBinding instanceof ObjectValue);\n    return envRecThisBinding;\n  } finally {\n    realm.endCall();\n  }\n}\n\nexport class FunctionImplementation {\n  FindVarScopedDeclarations(ast_node: BabelNode): Array<BabelNode> {\n    function FindVarScopedDeclarationsFor(ast: BabelNode, level: number) {\n      let statements = [];\n      switch (ast.type) {\n        case \"Program\":\n          statements = ((ast: any): BabelNodeProgram).body;\n          break;\n        case \"BlockStatement\":\n          statements = ((ast: any): BabelNodeBlockStatement).body;\n          break;\n        case \"DoWhileStatement\":\n          statements = [((ast: any): BabelNodeDoWhileStatement).body];\n          break;\n        case \"WhileStatement\":\n          statements = [((ast: any): BabelNodeWhileStatement).body];\n          break;\n        case \"IfStatement\":\n          let astIfStatement: BabelNodeIfStatement = (ast: any);\n          statements = [astIfStatement.consequent, astIfStatement.alternate];\n          break;\n        case \"ForStatement\":\n          let astForStatement: BabelNodeForStatement = (ast: any);\n          statements = [astForStatement.init, astForStatement.body];\n          break;\n        case \"ForInStatement\":\n          let astForInStatement: BabelNodeForInStatement = (ast: any);\n          statements = [astForInStatement.left, astForInStatement.body];\n          break;\n        case \"ForOfStatement\":\n          let astForOfStatement: BabelNodeForOfStatement = (ast: any);\n          statements = [astForOfStatement.left, astForOfStatement.body];\n          break;\n        case \"LabeledStatement\":\n          statements = [((ast: any): BabelNodeLabeledStatement).body];\n          break;\n        case \"WithStatement\":\n          statements = [((ast: any): BabelNodeWithStatement).body];\n          break;\n        case \"SwitchStatement\":\n          for (let switchCase of ((ast: any): BabelNodeSwitchStatement).cases) {\n            statements.push(...switchCase.consequent);\n          }\n          break;\n        case \"TryStatement\":\n          let astTryStatement: BabelNodeTryStatement = (ast: any);\n          statements = [astTryStatement.block];\n          if (astTryStatement.finalizer) statements.push(astTryStatement.finalizer);\n          if (astTryStatement.handler) statements.push(astTryStatement.handler.body);\n          break;\n        case \"VariableDeclaration\":\n          return ((ast: any): BabelNodeVariableDeclaration).kind === \"var\" ? [ast] : [];\n        case \"FunctionDeclaration\":\n          return level < 2 ? [ast] : [];\n        default:\n          return [];\n      }\n\n      let decls = [];\n      for (let statement of statements) {\n        if (statement) {\n          decls = decls.concat(FindVarScopedDeclarationsFor(statement, level + 1));\n        }\n      }\n\n      return decls;\n    }\n    return FindVarScopedDeclarationsFor(ast_node, 0);\n  }\n\n  // ECMA262 9.2.12\n  FunctionDeclarationInstantiation(\n    realm: Realm,\n    func: ECMAScriptSourceFunctionValue,\n    argumentsList: Array<Value>\n  ): EmptyValue {\n    // 1. Let calleeContext be the running execution context.\n    let calleeContext = realm.getRunningContext();\n\n    // 2. Let env be the LexicalEnvironment of calleeContext.\n    let env = calleeContext.lexicalEnvironment;\n\n    // 3. Let envRec be env's EnvironmentRecord.\n    let envRec = env.environmentRecord;\n\n    // 4. Let code be the value of the [[ECMAScriptCode]] internal slot of func.\n    let code = func.$ECMAScriptCode;\n    invariant(code !== undefined);\n\n    // 5. Let strict be the value of the [[Strict]] internal slot of func.\n    let strict = func.$Strict;\n\n    // 6. Let formals be the value of the [[FormalParameters]] internal slot of func.\n    let formals = func.$FormalParameters;\n    invariant(formals !== undefined);\n\n    // 7. Let parameterNames be the BoundNames of formals.\n    let parameterNames = Object.create(null);\n    for (let param of formals) {\n      let paramBindings = t.getBindingIdentifiers(param, true);\n\n      for (let name in paramBindings) {\n        parameterNames[name] = (parameterNames[name] || []).concat(paramBindings[name]);\n      }\n    }\n\n    // 8. If parameterNames has any duplicate entries, let hasDuplicates be true. Otherwise, let hasDuplicates be false.\n    let hasDuplicates = false;\n    for (let name in parameterNames) {\n      let identifiers = parameterNames[name];\n      if (identifiers.length > 1) hasDuplicates = true;\n    }\n    parameterNames = Object.keys(parameterNames);\n\n    // 9. Let simpleParameterList be IsSimpleParameterList of formals.\n    let simpleParameterList = true;\n    for (let param of formals) {\n      if (param.type !== \"Identifier\") {\n        simpleParameterList = false;\n        break;\n      }\n    }\n\n    // 10. Let hasParameterExpressions be ContainsExpression of formals.\n    let hasParameterExpressions = false;\n    invariant(formals !== undefined);\n    for (let param of formals) {\n      if (Environment.ContainsExpression(realm, param)) {\n        hasParameterExpressions = true;\n        break;\n      }\n    }\n\n    // 11. Let varNames be the VarDeclaredNames of code.\n    let varNames = [];\n    traverseFast(code, node => {\n      if (node.type === \"VariableDeclaration\" && ((node: any): BabelNodeVariableDeclaration).kind === \"var\") {\n        varNames = varNames.concat(Object.keys(t.getBindingIdentifiers(node)));\n      }\n\n      if (node.type === \"FunctionExpression\" || node.type === \"FunctionDeclaration\") {\n        return true;\n      }\n\n      return false;\n    });\n\n    // 12. Let varDeclarations be the VarScopedDeclarations of code.\n    let varDeclarations = this.FindVarScopedDeclarations(code);\n\n    // 13. Let lexicalNames be the LexicallyDeclaredNames of code.\n    let lexicalNames = [];\n\n    // 14. Let functionNames be an empty List.\n    let functionNames = [];\n\n    // 15. Let functionsToInitialize be an empty List.\n    let functionsToInitialize = [];\n\n    // 16. For each d in varDeclarations, in reverse list order do\n    for (let d of varDeclarations.reverse()) {\n      // a. If d is neither a VariableDeclaration or a ForBinding, then\n      if (d.type !== \"VariableDeclaration\") {\n        // i. Assert: d is either a FunctionDeclaration or a GeneratorDeclaration.\n        invariant(d.type === \"FunctionDeclaration\" || d.type === \"GeneratorDeclaration\");\n        // ii. Let fn be the sole element of the BoundNames of d.\n        let fn = Environment.BoundNames(realm, d)[0];\n        // iii. If fn is not an element of functionNames, then\n        if (functionNames.indexOf(fn) < 0) {\n          // 1. Insert fn as the first element of functionNames.\n          functionNames.unshift(fn);\n          // 2. NOTE If there are multiple FunctionDeclarations or GeneratorDeclarations for the same name, the last declaration is used.\n          // 3. Insert d as the first element of functionsToInitialize.\n          functionsToInitialize.unshift(d);\n        }\n      }\n    }\n\n    // 17. Let argumentsObjectNeeded be true.\n    let argumentsObjectNeeded = true;\n\n    // 18. If the value of the [[realmMode]] internal slot of func is lexical, then\n    if (func.$ThisMode === \"lexical\") {\n      // a. NOTE Arrow functions never have an arguments objects.\n      // b. Let argumentsObjectNeeded be false.\n      argumentsObjectNeeded = false;\n    } else if (parameterNames.indexOf(\"arguments\") >= 0) {\n      // 19. Else if \"arguments\" is an element of parameterNames, then\n      // a. Let argumentsObjectNeeded be false.\n      argumentsObjectNeeded = false;\n    } else if (hasParameterExpressions === false) {\n      // 20. Else if hasParameterExpressions is false, then\n      // a. If \"arguments\" is an element of functionNames or if \"arguments\" is an element of lexicalNames, then\n      if (functionNames.indexOf(\"arguments\") >= 0 || lexicalNames.indexOf(\"arguments\") >= 0) {\n        // i. Let argumentsObjectNeeded be false.\n        argumentsObjectNeeded = true;\n      }\n    }\n\n    // 21. For each String paramName in parameterNames, do\n    for (let paramName of parameterNames) {\n      // a. Let alreadyDeclared be envRec.HasBinding(paramName).\n      let alreadyDeclared = envRec.HasBinding(paramName);\n\n      // b. NOTE Early errors ensure that duplicate parameter names can only occur in non-strict functions that do not have parameter default values or rest parameters.\n\n      // c. If alreadyDeclared is false, then\n      if (alreadyDeclared === false) {\n        // i. Perform ! envRec.CreateMutableBinding(paramName, false).\n        envRec.CreateMutableBinding(paramName, false);\n\n        // ii. If hasDuplicates is true, then\n        if (hasDuplicates === true) {\n          // 1. Perform ! envRec.InitializeBinding(paramName, undefined).\n          envRec.InitializeBinding(paramName, realm.intrinsics.undefined);\n        }\n      }\n    }\n\n    // 22. If argumentsObjectNeeded is true, then\n    if (argumentsObjectNeeded === true) {\n      let ao;\n\n      // a. If strict is true or if simpleParameterList is false, then\n      if (strict === true || simpleParameterList === false) {\n        // i. Let ao be CreateUnmappedArgumentsObject(argumentsList).\n        ao = Create.CreateUnmappedArgumentsObject(realm, argumentsList);\n      } else {\n        // b. Else,\n        // i. NOTE mapped argument object is only provided for non-strict functions that don't have a rest parameter, any parameter default value initializers, or any destructured parameters.\n        // ii. Let ao be CreateMappedArgumentsObject(func, formals, argumentsList, envRec).\n        invariant(formals !== undefined);\n        ao = Create.CreateMappedArgumentsObject(realm, func, formals, argumentsList, envRec);\n      }\n\n      // c. If strict is true, then\n      if (strict === true) {\n        // i. Perform ! envRec.CreateImmutableBinding(\"arguments\", false).\n        envRec.CreateImmutableBinding(\"arguments\", false);\n      } else {\n        // d. Else,\n        // i. Perform ! envRec.CreateMutableBinding(\"arguments\", false).\n        envRec.CreateMutableBinding(\"arguments\", false);\n      }\n\n      // e. Call envRec.InitializeBinding(\"arguments\", ao).\n      envRec.InitializeBinding(\"arguments\", ao);\n\n      // f. Append \"arguments\" to parameterNames.\n      parameterNames.push(\"arguments\");\n    }\n\n    // 23. Let iteratorRecord be Record {[[Iterator]]: CreateListIterator(argumentsList), [[Done]]: false}.\n    let iteratorRecord = {\n      $Iterator: CreateListIterator(realm, argumentsList),\n      $Done: false,\n    };\n\n    // 24. If hasDuplicates is true, then\n    if (hasDuplicates === true) {\n      // a. Perform ? IteratorBindingInitialization for formals with iteratorRecord and undefined as arguments.\n      invariant(formals !== undefined);\n      Environment.IteratorBindingInitialization(realm, formals, iteratorRecord, strict);\n    } else {\n      // 25. Else,\n      // a. Perform ? IteratorBindingInitialization for formals with iteratorRecord and env as arguments.\n      invariant(formals !== undefined);\n      Environment.IteratorBindingInitialization(realm, formals, iteratorRecord, strict, env);\n    }\n\n    // 26. If hasParameterExpressions is false, then\n    let varEnv, varEnvRec;\n    if (hasParameterExpressions === false) {\n      // a. NOTE Only a single lexical environment is needed for the parameters and top-level vars.\n      // b. Let instantiatedVarNames be a copy of the List parameterNames.\n      let instantiatedVarNames = parameterNames.slice();\n\n      // c. For each n in varNames, do\n      for (let n of varNames) {\n        // i. If n is not an element of instantiatedVarNames, then\n        if (instantiatedVarNames.indexOf(n) < 0) {\n          // 1. Append n to instantiatedVarNames.\n          instantiatedVarNames.push(n);\n\n          // 2. Perform ! envRec.CreateMutableBinding(n, false).\n          envRec.CreateMutableBinding(n, false);\n\n          // 3. Call envRec.InitializeBinding(n, undefined).\n          envRec.InitializeBinding(n, realm.intrinsics.undefined);\n        }\n      }\n\n      // e. Let varEnv be env.\n      varEnv = env;\n\n      // f. Let varEnvRec be envRec.\n      varEnvRec = envRec;\n    } else {\n      // 27. Else,\n      // a. NOTE A separate Environment Record is needed to ensure that closures created by expressions in the formal parameter list do not have visibility of declarations in the function body.\n\n      // b. Let varEnv be NewDeclarativeEnvironment(env).\n      varEnv = Environment.NewDeclarativeEnvironment(realm, env);\n      // At this point we haven't set any context's lexical environment to varEnv (and we might never do so),\n      // so it shouldn't be active\n      realm.activeLexicalEnvironments.delete(varEnv);\n\n      // c. Let varEnvRec be varEnv's EnvironmentRecord.\n      varEnvRec = varEnv.environmentRecord;\n\n      // d. Set the VariableEnvironment of calleeContext to varEnv.\n      calleeContext.variableEnvironment = varEnv;\n\n      // e. Let instantiatedVarNames be a new empty List.\n      let instantiatedVarNames = [];\n\n      // f. For each n in varNames, do\n      for (let n of varNames) {\n        // i. If n is not an element of instantiatedVarNames, then\n        if (instantiatedVarNames.indexOf(n) < 0) {\n          // 1. Append n to instantiatedVarNames.\n          instantiatedVarNames.push(n);\n\n          // 2. Perform ! varEnvRec.CreateMutableBinding(n, false).\n          varEnvRec.CreateMutableBinding(n, false);\n\n          // 3. If n is not an element of parameterNames or if n is an element of functionNames, let initialValue be undefined.\n          let initialValue;\n          if (parameterNames.indexOf(n) < 0 || functionNames.indexOf(n) < 0) {\n            initialValue = realm.intrinsics.undefined;\n          } else {\n            // 4. Else,\n            // a. Let initialValue be ! envRec.GetBindingValue(n, false).\n            initialValue = envRec.GetBindingValue(n, false);\n          }\n\n          // 5. Call varEnvRec.InitializeBinding(n, initialValue).\n          varEnvRec.InitializeBinding(n, initialValue);\n\n          // 6. NOTE vars whose names are the same as a formal parameter, initially have the same value as the corresponding initialized parameter.\n        }\n      }\n    }\n\n    // 28. NOTE: Annex B.3.3.1 adds additional steps at realm point.\n\n    let lexEnv;\n\n    // 29. If strict is false, then\n    if (strict === false) {\n      // a. Let lexEnv be NewDeclarativeEnvironment(varEnv).\n      lexEnv = Environment.NewDeclarativeEnvironment(realm, varEnv);\n\n      // b. NOTE: Non-strict functions use a separate lexical Environment Record for top-level lexical declarations so that a direct eval (see 12.3.4.1) can determine whether any var scoped declarations introduced by the eval code conflict with pre-existing top-level lexically scoped declarations. realm is not needed for strict functions because a strict direct eval always places all declarations into a new Environment Record.\n    } else {\n      // 30. Else, let lexEnv be varEnv.\n      lexEnv = varEnv;\n      // Since we previously removed varEnv, make sure to re-add it when it's used.\n      realm.activeLexicalEnvironments.add(varEnv);\n    }\n\n    // 31. Let lexEnvRec be lexEnv's EnvironmentRecord.\n    let lexEnvRec = lexEnv.environmentRecord;\n\n    // 32. Set the LexicalEnvironment of calleeContext to lexEnv.\n    calleeContext.lexicalEnvironment = lexEnv;\n\n    // 33. Let lexDeclarations be the LexicallyScopedDeclarations of code.\n    let lexDeclarations = [];\n\n    // 34. For each element d in lexDeclarations do\n    for (let d of lexDeclarations) {\n      // a. NOTE A lexically declared name cannot be the same as a function/generator declaration, formal parameter, or a var name. Lexically declared names are only instantiated here but not initialized.\n      // b. For each element dn of the BoundNames of d do\n      for (let dn of Environment.BoundNames(realm, d)) {\n        // i. If IsConstantDeclaration of d is true, then\n        if (d.kind === \"const\") {\n          // 1. Perform ! lexEnvRec.CreateImmutableBinding(dn, true).\n          lexEnvRec.CreateImmutableBinding(dn, true);\n        } else {\n          // ii. Else,\n          // 1. Perform ! lexEnvRec.CreateMutableBinding(dn, false).\n          lexEnvRec.CreateMutableBinding(dn, false);\n        }\n      }\n    }\n\n    // 35. For each parsed grammar phrase f in functionsToInitialize, do\n    for (let f of functionsToInitialize) {\n      // a. Let fn be the sole element of the BoundNames of f.\n      let fn = Environment.BoundNames(realm, f)[0];\n      // b. Let fo be the result of performing InstantiateFunctionObject for f with argument lexEnv.\n      let fo = lexEnv.evaluate(f, strict);\n      invariant(fo instanceof Value);\n      // c. Perform ! varEnvRec.SetMutableBinding(fn, fo, false).\n      varEnvRec.SetMutableBinding(fn, fo, false);\n    }\n\n    // 36. Return NormalCompletion(empty).\n    return realm.intrinsics.empty;\n  }\n\n  // ECMA262 9.2.11\n  SetFunctionName(realm: Realm, F: ObjectValue, _name: PropertyKeyValue | AbstractValue, prefix?: string): boolean {\n    // 1. Assert: F is an extensible object that does not have a name own property.\n    invariant(F.getExtensible(), \"expected object to be extensible and not have a name property\");\n\n    // 2. Assert: Type(name) is either Symbol or String.\n    invariant(\n      typeof _name === \"string\" ||\n        _name instanceof StringValue ||\n        _name instanceof SymbolValue ||\n        _name instanceof AbstractValue,\n      \"expected name to be a string or symbol\"\n    );\n    let name = typeof _name === \"string\" ? new StringValue(realm, _name) : _name;\n\n    // 3. Assert: If prefix was passed, then Type(prefix) is String.\n    invariant(prefix === undefined || typeof prefix === \"string\", \"expected prefix to be a string if passed\");\n\n    // 4. If Type(name) is Symbol, then\n    if (name instanceof SymbolValue) {\n      // a. Let description be name's [[Description]] value.\n      let description = name.$Description;\n\n      // b. If description is undefined, let name be the empty String.\n      if (description === undefined) {\n        name = realm.intrinsics.emptyString;\n      } else {\n        // c. Else, let name be the concatenation of \"[\", description, and \"]\".\n        invariant(description instanceof Value);\n        name = new StringValue(realm, `[${description.throwIfNotConcreteString().value}]`);\n      }\n    }\n\n    // 5. If prefix was passed, then\n    if (prefix) {\n      // a. Let name be the concatenation of prefix, code unit 0x0020 (SPACE), and name.\n      if (name instanceof AbstractValue) {\n        let prefixVal = new StringValue(realm, prefix + \" \");\n        name = AbstractValue.createFromBinaryOp(realm, \"+\", prefixVal, name, name.expressionLocation);\n      } else {\n        name = new StringValue(realm, `${prefix} ${name.value}`);\n      }\n    }\n\n    // 6. Return ! DefinePropertyOrThrow(F, \"name\", PropertyDescriptor{[[Value]]: name, [[Writable]]: false, [[Enumerable]]: false, [[Configurable]]: true}).\n    return Properties.DefinePropertyOrThrow(\n      realm,\n      F,\n      \"name\",\n      new PropertyDescriptor({\n        value: name,\n        enumerable: false,\n        writable: false,\n        configurable: true,\n      })\n    );\n  }\n\n  // ECMA262 9.2.3\n  FunctionInitialize(\n    realm: Realm,\n    F: ECMAScriptSourceFunctionValue,\n    kind: \"normal\" | \"method\" | \"arrow\",\n    ParameterList: Array<BabelNodeLVal>,\n    Body: BabelNodeBlockStatement,\n    Scope: LexicalEnvironment\n  ): ECMAScriptSourceFunctionValue {\n    // Tell the realm to mark any local bindings that are visible to this function as being potentially captured by it.\n    realm.markVisibleLocalBindingsAsPotentiallyCaptured();\n\n    // Note that F is a new object, and we can thus write to internal slots\n    invariant(realm.isNewObject(F));\n\n    // 1. Assert: F is an extensible object that does not have a length own property.\n    invariant(F.getExtensible(), \"expected to be extensible and no length property\");\n\n    // 2. Let len be the ExpectedArgumentCount of ParameterList.\n    let len = 0;\n    for (let FormalParameter of ParameterList) {\n      if (FormalParameter.type === \"AssignmentPattern\") {\n        break;\n      }\n      len += 1;\n    }\n\n    // 3. Perform ! DefinePropertyOrThrow(F, \"length\", PropertyDescriptor{[[Value]]: len, [[Writable]]: false, [[Enumerable]]: false, [[Configurable]]: true}).\n    Properties.DefinePropertyOrThrow(\n      realm,\n      F,\n      \"length\",\n      new PropertyDescriptor({\n        value: new NumberValue(realm, len),\n        writable: false,\n        enumerable: false,\n        configurable: true,\n      })\n    );\n\n    // 4. Let Strict be the value of the [[Strict]] internal slot of F.\n    let Strict = F.$Strict;\n    if (!Strict) {\n      Properties.DefinePropertyOrThrow(\n        realm,\n        F,\n        \"caller\",\n        new PropertyDescriptor({\n          value: new UndefinedValue(realm),\n          writable: true,\n          enumerable: false,\n          configurable: true,\n        })\n      );\n    }\n\n    // 5. Set the [[Environment]] internal slot of F to the value of Scope.\n    F.$Environment = Scope;\n\n    // 6. Set the [[FormalParameters]] internal slot of F to ParameterList. + 7. Set the [[ECMAScriptCode]] internal slot of F to Body.\n    F.initialize(ParameterList, Body);\n\n    // 8. Set the [[ScriptOrModule]] internal slot of F to GetActiveScriptOrModule().\n    F.$ScriptOrModule = Environment.GetActiveScriptOrModule(realm);\n\n    // 9. If kind is Arrow, set the [[realmMode]] internal slot of F to lexical.\n    if (kind === \"arrow\") {\n      F.$ThisMode = \"lexical\";\n    } else if (Strict === true) {\n      // 10. Else if Strict is true, set the [[realmMode]] internal slot of F to strict.\n      F.$ThisMode = \"strict\";\n    } else {\n      // 11. Else set the [[realmMode]] internal slot of F to global.\n      F.$ThisMode = \"global\";\n    }\n\n    // Return F.\n    return F;\n  }\n\n  // ECMA262 9.2.6\n  GeneratorFunctionCreate(\n    realm: Realm,\n    kind: \"normal\" | \"method\",\n    ParameterList: Array<BabelNodeLVal>,\n    Body: BabelNodeBlockStatement,\n    Scope: LexicalEnvironment,\n    Strict: boolean\n  ): ECMAScriptSourceFunctionValue {\n    // 1. Let functionPrototype be the intrinsic object %Generator%.\n    let functionPrototype = realm.intrinsics.Generator;\n\n    // 2. Let F be FunctionAllocate(functionPrototype, Strict, \"generator\").\n    let F = this.FunctionAllocate(realm, functionPrototype, Strict, \"generator\");\n\n    // 3. Return FunctionInitialize(F, kind, ParameterList, Body, Scope).\n    return this.FunctionInitialize(realm, F, kind, ParameterList, Body, Scope);\n  }\n\n  // ECMA262 9.2.7\n  AddRestrictedFunctionProperties(F: FunctionValue, realm: Realm): boolean {\n    // 1. Assert: realm.[[Intrinsics]].[[%ThrowTypeError%]] exists and has been initialized.\n    // 2. Let thrower be realm.[[Intrinsics]].[[%ThrowTypeError%]].\n    let thrower = realm.intrinsics.ThrowTypeError;\n    invariant(thrower);\n\n    let desc = new PropertyDescriptor({\n      get: thrower,\n      set: thrower,\n      enumerable: false,\n      configurable: true,\n    });\n    // 3. Perform ! DefinePropertyOrThrow(F, \"caller\", PropertyDescriptor {[[Get]]: thrower, [[Set]]: thrower, [[Enumerable]]: false, [[Configurable]]: true}).\n    Properties.DefinePropertyOrThrow(realm, F, \"caller\", desc);\n    // 4. Return ! DefinePropertyOrThrow(F, \"arguments\", PropertyDescriptor {[[Get]]: thrower, [[Set]]: thrower, [[Enumerable]]: false, [[Configurable]]: true}).\n    return Properties.DefinePropertyOrThrow(realm, F, \"arguments\", desc);\n  }\n\n  // ECMA262 9.2.1\n  $Call(realm: Realm, F: ECMAScriptFunctionValue, thisArgument: Value, argsList: Array<Value>): Value {\n    return InternalCall(realm, F, thisArgument, argsList, 0);\n  }\n\n  // ECMA262 9.2.2\n  $Construct(\n    realm: Realm,\n    F: ECMAScriptFunctionValue,\n    argumentsList: Array<Value>,\n    newTarget: ObjectValue\n  ): ObjectValue | AbstractObjectValue {\n    return InternalConstruct(realm, F, argumentsList, newTarget, undefined, 0);\n  }\n\n  // ECMA262 9.2.3\n  FunctionAllocate(\n    realm: Realm,\n    functionPrototype: ObjectValue | AbstractObjectValue,\n    strict: boolean,\n    functionKind: \"normal\" | \"non-constructor\" | \"generator\"\n  ): ECMAScriptSourceFunctionValue {\n    // 1. Assert: Type(functionPrototype) is Object.\n    invariant(functionPrototype instanceof ObjectValue, \"expected functionPrototype to be an object\");\n\n    // 2. Assert: functionKind is either \"normal\", \"non-constructor\" or \"generator\".\n    invariant(\n      functionKind === \"normal\" || functionKind === \"non-constructor\" || functionKind === \"generator\",\n      \"invalid functionKind\"\n    );\n\n    // 3. If functionKind is \"normal\", let needsConstruct be true.\n    let needsConstruct;\n    if (functionKind === \"normal\") {\n      needsConstruct = true;\n    } else {\n      // 4. Else, let needsConstruct be false.\n      needsConstruct = false;\n    }\n\n    // 5. If functionKind is \"non-constructor\", let functionKind be \"normal\".\n    if (functionKind === \"non-constructor\") {\n      functionKind = \"normal\";\n    }\n\n    // 6. Let F be a newly created ECMAScript function object with the internal slots listed in Table 27. All of those internal slots are initialized to undefined.\n    let F = new ECMAScriptSourceFunctionValue(realm);\n\n    // 7. Set F's essential internal methods to the default ordinary object definitions specified in 9.1.\n\n    // 8. Set F's [[Call]] internal method to the definition specified in 9.2.1.\n    F.$Call = (thisArgument, argsList) => {\n      return this.$Call(realm, F, thisArgument, argsList);\n    };\n\n    // 9. If needsConstruct is true, then\n    if (needsConstruct === true) {\n      // a. Set F's [[Construct]] internal method to the definition specified in 9.2.2.\n      F.$Construct = (argumentsList, newTarget) => {\n        return this.$Construct(realm, F, argumentsList, newTarget);\n      };\n\n      // b. Set the [[ConstructorKind]] internal slot of F to \"base\".\n      F.$ConstructorKind = \"base\";\n    }\n\n    // 10. Set the [[Strict]] internal slot of F to strict.\n    F.$Strict = strict;\n\n    // 11. Set the [[FunctionKind]] internal slot of F to functionKind.\n    F.$FunctionKind = functionKind;\n\n    // 12. Set the [[Prototype]] internal slot of F to functionPrototype.\n    F.$Prototype = functionPrototype;\n\n    // 13. Set the [[Extensible]] internal slot of F to true.\n    F.setExtensible(true);\n\n    // 14. Set the [[Realm]] internal slot of F to the current Realm Record.\n    F.$Realm = realm;\n\n    // 15. Return F.\n    return F;\n  }\n\n  // ECMA262 9.4.1.3\n  BoundFunctionCreate(\n    realm: Realm,\n    targetFunction: ObjectValue,\n    boundThis: Value,\n    boundArgs: Array<Value>\n  ): ObjectValue {\n    // 1. Assert: Type(targetFunction) is Object.\n    invariant(targetFunction instanceof ObjectValue, \"expected an object\");\n\n    // 2. Let proto be ? targetFunction.[[GetPrototypeOf]]().\n    let proto = targetFunction.$GetPrototypeOf();\n\n    // 3. Let obj be a newly created object.\n    let obj = new BoundFunctionValue(realm);\n\n    // 4. Set obj's essential internal methods to the default ordinary object definitions specified in 9.1.\n\n    // 5. Set the [[Call]] internal method of obj as described in 9.4.1.1.\n    obj.$Call = (thisArgument, argsList) => {\n      return $BoundCall(realm, obj, thisArgument, argsList);\n    };\n\n    // 6. If targetFunction has a [[Construct]] internal method, then\n    if (targetFunction.$Construct) {\n      // a. Set the [[Construct]] internal method of obj as described in 9.4.1.2.\n      obj.$Construct = (thisArgument, argsList) => {\n        return $BoundConstruct(realm, obj, thisArgument, argsList);\n      };\n    }\n\n    // 7. Set the [[Prototype]] internal slot of obj to proto.\n    obj.$Prototype = proto;\n\n    // 8. Set the [[Extensible]] internal slot of obj to true.\n    obj.setExtensible(true);\n\n    // 9. Set the [[BoundTargetFunction]] internal slot of obj to targetFunction.\n    obj.$BoundTargetFunction = targetFunction;\n\n    // 10. Set the [[BoundThis]] internal slot of obj to the value of boundThis.\n    obj.$BoundThis = boundThis;\n\n    // 11. Set the [[BoundArguments]] internal slot of obj to boundArgs.\n    obj.$BoundArguments = boundArgs;\n\n    // 12. Return obj.\n    return obj;\n  }\n\n  // ECMA262 18.2.1.1\n  PerformEval(realm: Realm, x: Value, evalRealm: Realm, strictCaller: boolean, direct: boolean): Value {\n    // 1. Assert: If direct is false, then strictCaller is also false.\n    if (direct === false) invariant(strictCaller === false, \"strictCaller is only allowed on direct eval\");\n\n    // 2. If Type(x) is not String, return x.\n    if (!(x instanceof StringValue)) return x;\n\n    // 3. Let script be the ECMAScript code that is the result of parsing x, interpreted as UTF-16 encoded Unicode text\n    //    as described in 6.1.4, for the goal symbol Script. If the parse fails, throw a SyntaxError exception. If any\n    //    early errors are detected, throw a SyntaxError or a ReferenceError exception, depending on the type of the\n    //    error (but see also clause 16). Parsing and early error detection may be interweaved in an implementation\n    //    dependent manner.\n    let ast = parse(realm, x.value, \"eval\", \"script\");\n    let script = ast.program;\n\n    // 4. If script Contains ScriptBody is false, return undefined.\n    if (!script.body) return realm.intrinsics.undefined;\n\n    // 5. Let body be the ScriptBody of script.\n    let body = t.blockStatement(script.body, script.directives);\n\n    // 6. If strictCaller is true, let strictEval be true.\n    let strictEval;\n    if (strictCaller) {\n      strictEval = true;\n    } else {\n      // 7. Else, let strictEval be IsStrict of script.\n      strictEval = IsStrict(script);\n    }\n\n    // 8. Let ctx be the running execution context. If direct is true, ctx will be the execution context that\n    //    performed the direct eval. If direct is false, ctx will be the execution context for the invocation of\n    //    the eval function.\n    let ctx = realm.getRunningContext();\n\n    // 9. If direct is true, then\n    let lexEnv, varEnv;\n    if (direct) {\n      // a. Let lexEnv be NewDeclarativeEnvironment(ctx's LexicalEnvironment).\n      lexEnv = Environment.NewDeclarativeEnvironment(realm, ctx.lexicalEnvironment);\n\n      // b. Let varEnv be ctx's VariableEnvironment.\n      varEnv = ctx.variableEnvironment;\n    } else {\n      // 10. Else,\n      // a. Let lexEnv be NewDeclarativeEnvironment(evalRealm.[[GlobalEnv]]).\n      lexEnv = Environment.NewDeclarativeEnvironment(realm, evalRealm.$GlobalEnv);\n\n      // b. Let varEnv be evalRealm.[[GlobalEnv]].\n      varEnv = evalRealm.$GlobalEnv;\n    }\n\n    // 11. If strictEval is true, let varEnv be lexEnv.\n    if (strictEval) varEnv = lexEnv;\n\n    // 12. If ctx is not already suspended, suspend ctx.\n    ctx.suspend();\n\n    // 13. Let evalCxt be a new ECMAScript code execution context.\n    let evalCxt = realm.createExecutionContext();\n    evalCxt.isStrict = strictEval;\n\n    // 14. Set the evalCxt's Function to null.\n    evalCxt.setFunction(null);\n\n    // 15. Set the evalCxt's Realm to evalRealm.\n    evalCxt.setRealm(evalRealm);\n\n    // 16. Set the evalCxt's ScriptOrModule to ctx's ScriptOrModule.\n    evalCxt.ScriptOrModule = ctx.ScriptOrModule;\n\n    // 17. Set the evalCxt's VariableEnvironment to varEnv.\n    evalCxt.variableEnvironment = varEnv;\n\n    // 18. Set the evalCxt's LexicalEnvironment to lexEnv.\n    evalCxt.lexicalEnvironment = lexEnv;\n\n    // 19. Push evalCxt on to the execution context stack; evalCxt is now the running execution context.\n    realm.pushContext(evalCxt);\n\n    let result;\n    try {\n      // 20. Let result be EvalDeclarationInstantiation(body, varEnv, lexEnv, strictEval).\n      invariant(varEnv);\n      try {\n        result = this.EvalDeclarationInstantiation(realm, body, varEnv, lexEnv, strictEval);\n      } catch (e) {\n        if (e instanceof AbruptCompletion) {\n          result = e;\n        } else {\n          throw e;\n        }\n      }\n      invariant(result instanceof Value || result instanceof AbruptCompletion);\n\n      // 21. If result.[[Type]] is normal, then\n      if (result instanceof Value) {\n        // Evaluate expressions that passed for directives.\n        if (script.directives) {\n          for (let directive of script.directives) {\n            result = new StringValue(realm, directive.value.value);\n          }\n        }\n\n        // a. Let result be the result of evaluating body.\n        result = this.EvaluateStatements(script.body, result, strictEval, lexEnv, realm);\n      }\n\n      // 22. If result.[[Type]] is normal and result.[[Value]] is empty, then\n      if (result instanceof EmptyValue) {\n        // a. Let result be NormalCompletion(undefined).\n        result = realm.intrinsics.undefined;\n      }\n    } finally {\n      // 23. Suspend evalCxt and remove it from the execution context stack.\n      evalCxt.suspend();\n      realm.popContext(evalCxt);\n      realm.onDestroyScope(evalCxt.lexicalEnvironment);\n    }\n\n    // 24. Resume the context that is now on the top of the execution context stack as the running execution context.\n    invariant(realm.getRunningContext() === ctx);\n    ctx.resume();\n\n    // 25. Return Completion(result).\n    if (result instanceof Value) {\n      return result;\n    } else {\n      invariant(result instanceof AbruptCompletion);\n      throw result;\n    }\n  }\n\n  // Composes realm.savedCompletion with c, clears realm.savedCompletion and return the composition.\n  // Call this only when a join point has been reached.\n  incorporateSavedCompletion(realm: Realm, c: void | Completion | Value): void | Completion | Value {\n    let savedCompletion = realm.savedCompletion;\n    if (savedCompletion !== undefined) {\n      realm.savedCompletion = undefined;\n      realm.pathConditions = savedCompletion.pathConditionsAtCreation;\n      if (c === undefined) c = realm.intrinsics.empty;\n      if (c instanceof Value) c = new SimpleNormalCompletion(c);\n      if (savedCompletion instanceof JoinedNormalAndAbruptCompletions) {\n        let subsequentEffects = realm.getCapturedEffects(c);\n        realm.stopEffectCaptureAndUndoEffects(savedCompletion);\n        let joinedEffects = Join.composeWithEffects(savedCompletion, subsequentEffects);\n        realm.applyEffects(joinedEffects);\n        realm.savedCompletion = savedCompletion.composedWith;\n        if (realm.savedCompletion !== undefined) return this.incorporateSavedCompletion(realm, joinedEffects.result);\n        return joinedEffects.result;\n      }\n      return Join.composeCompletions(savedCompletion, c);\n    }\n    return c;\n  }\n\n  EvaluateStatements(\n    body: Array<BabelNodeStatement>,\n    initialBlockValue: void | Value,\n    strictCode: boolean,\n    blockEnv: LexicalEnvironment,\n    realm: Realm\n  ): Value {\n    let blockValue = initialBlockValue;\n    for (let node of body) {\n      if (node.type !== \"FunctionDeclaration\") {\n        let res = blockEnv.evaluateCompletionDeref(node, strictCode);\n        if (!(res instanceof EmptyValue)) {\n          if (res instanceof AbruptCompletion) throw UpdateEmpty(realm, res, blockValue || realm.intrinsics.empty);\n          invariant(res instanceof Value);\n          blockValue = res;\n        }\n      }\n    }\n\n    // 7. Return blockValue.\n    return blockValue || realm.intrinsics.empty;\n  }\n\n  // ECMA262 9.2.5\n  FunctionCreate(\n    realm: Realm,\n    kind: \"normal\" | \"arrow\" | \"method\",\n    ParameterList: Array<BabelNodeLVal>,\n    Body: BabelNodeBlockStatement,\n    Scope: LexicalEnvironment,\n    Strict: boolean,\n    prototype?: ObjectValue\n  ): ECMAScriptSourceFunctionValue {\n    // 1. If the prototype argument was not passed, then\n    if (!prototype) {\n      // a. Let prototype be the intrinsic object %FunctionPrototype%.\n      prototype = realm.intrinsics.FunctionPrototype;\n    }\n\n    // 2. If kind is not Normal, let allocKind be \"non-constructor\".\n    let allocKind;\n    if (kind !== \"normal\") {\n      allocKind = \"non-constructor\";\n    } else {\n      // 3. Else, let allocKind be \"normal\".\n      allocKind = \"normal\";\n    }\n\n    // 4. Let F be FunctionAllocate(prototype, Strict, allocKind).\n    let F = this.FunctionAllocate(realm, prototype, Strict, allocKind);\n\n    // ECMAScript 2016, section 17:\n    //   \"Every other data property described in clauses 18 through 26 and in Annex B.2 has the attributes { [[Writable]]: true, [[Enumerable]]: false, [[Configurable]]: true } unless otherwise specified.\"\n    // Because we call `AddRestrictedFunctionProperties` on `FunctionPrototype`, accessing property \"arguments\" will raise a `TypeError` by default.\n    // However, in non-strict mode this behavior is not desired, so we will add them as own properties of each `FunctionValue`, in accordance with ECMA 17.\n    // Note: \"arguments\" ***MUST NOT*** be set if the function is in strict mode or is an arrow, method, constructor, or generator function.\n    //   See 16.2 \"Forbidden Extensions\"\n    if (!Strict && kind === \"normal\") {\n      Properties.DefinePropertyOrThrow(\n        realm,\n        F,\n        \"arguments\",\n        new PropertyDescriptor({\n          value: realm.intrinsics.undefined,\n          enumerable: false,\n          writable: true,\n          configurable: true,\n        })\n      );\n    }\n\n    // 5. Return FunctionInitialize(F, kind, ParameterList, Body, Scope).\n    let result = this.FunctionInitialize(realm, F, kind, ParameterList, Body, Scope);\n    invariant(F.pathConditionDuringDeclaration === undefined, \"Function should only have one declaration site\");\n    // Create a new path condition to make the saved condition readonly\n    F.pathConditionDuringDeclaration = realm.pathConditions.isEmpty() ? undefined : realm.pathConditions;\n    if (F.pathConditionDuringDeclaration) invariant(F.pathConditionDuringDeclaration.isReadOnly());\n    return result;\n  }\n\n  // ECMA262 18.2.1.2\n  EvalDeclarationInstantiation(\n    realm: Realm,\n    body: BabelNodeBlockStatement,\n    varEnv: LexicalEnvironment,\n    lexEnv: LexicalEnvironment,\n    strict: boolean\n  ): Value {\n    // 1. Let varNames be the VarDeclaredNames of body.\n    let varNames = [];\n    traverseFast(body, node => {\n      if (node.type === \"VariableDeclaration\" && ((node: any): BabelNodeVariableDeclaration).kind === \"var\") {\n        varNames = varNames.concat(Object.keys(t.getBindingIdentifiers(node)));\n      }\n\n      if (node.type === \"FunctionExpression\" || node.type === \"FunctionDeclaration\") {\n        return true;\n      }\n\n      return false;\n    });\n\n    // 2. Let varDeclarations be the VarScopedDeclarations of body.\n    let varDeclarations = this.FindVarScopedDeclarations(body);\n\n    // 3. Let lexEnvRec be lexEnv's EnvironmentRecord.\n    let lexEnvRec = lexEnv.environmentRecord;\n\n    // 4. Let varEnvRec be varEnv's EnvironmentRecord.\n    let varEnvRec = varEnv.environmentRecord;\n\n    // 5. If strict is false, then\n    if (!strict) {\n      // a. If varEnvRec is a global Environment Record, then\n      if (varEnvRec instanceof GlobalEnvironmentRecord) {\n        // i. For each name in varNames, do\n        for (let name of varNames) {\n          // 1. If varEnvRec.HasLexicalDeclaration(name) is true, throw a SyntaxError exception.\n          if (varEnvRec.HasLexicalDeclaration(name)) {\n            throw realm.createErrorThrowCompletion(\n              realm.intrinsics.SyntaxError,\n              new StringValue(realm, name + \" global object is restricted\")\n            );\n          }\n          // 2. NOTE: eval will not create a global var declaration that would be shadowed by a global lexical declaration.\n        }\n      }\n      // b. Let thisLex be lexEnv.\n      let thisLex = lexEnv;\n      // c. Assert: The following loop will terminate.\n      // d. Repeat while thisLex is not the same as varEnv,\n      while (thisLex !== varEnv) {\n        // i. Let thisEnvRec be thisLex's EnvironmentRecord.\n        let thisEnvRec = thisLex.environmentRecord;\n        // ii. If thisEnvRec is not an object Environment Record, then\n        if (!(thisEnvRec instanceof ObjectEnvironmentRecord)) {\n          // 1. NOTE: The environment of with statements cannot contain any lexical declaration so it doesn't need to be checked for var/let hoisting conflicts.\n          // 2. For each name in varNames, do\n          for (let name of varNames) {\n            // a. If thisEnvRec.HasBinding(name) is true, then\n            if (thisEnvRec.HasBinding(name)) {\n              // i. Throw a SyntaxError exception.\n              throw realm.createErrorThrowCompletion(\n                realm.intrinsics.SyntaxError,\n                name + \" global object is restricted\"\n              );\n              // ii. NOTE: Annex B.3.5 defines alternate semantics for the above step.\n            }\n            // b. NOTE: A direct eval will not hoist var declaration over a like-named lexical declaration.\n          }\n        }\n        // iii. Let thisLex be thisLex's outer environment reference.\n        thisLex = thisLex.parent;\n        invariant(thisLex !== null);\n      }\n    }\n\n    // 6. Let functionsToInitialize be a new empty List.\n    let functionsToInitialize = [];\n\n    // 7. Let declaredFunctionNames be a new empty List.\n    let declaredFunctionNames = [];\n\n    // 8. For each d in varDeclarations, in reverse list order do\n    for (let d of varDeclarations.reverse()) {\n      // a. If d is neither a VariableDeclaration or a ForBinding, then\n      if (d.type !== \"VariableDeclaration\") {\n        // i. Assert: d is either a FunctionDeclaration or a GeneratorDeclaration.\n        invariant(d.type === \"FunctionDeclaration\" || d.type === \"GeneratorDeclaration\");\n        // ii. NOTE If there are multiple FunctionDeclarations for the same name, the last declaration is used.\n        // iii. Let fn be the sole element of the BoundNames of d.\n        let fn = Environment.BoundNames(realm, d)[0];\n        // iv. If fn is not an element of declaredFunctionNames, then\n        if (declaredFunctionNames.indexOf(fn) < 0) {\n          // 1. If varEnvRec is a global Environment Record, then\n          if (varEnvRec instanceof GlobalEnvironmentRecord) {\n            // a. Let fnDefinable be ? varEnvRec.CanDeclareGlobalFunction(fn).\n            let fnDefinable = varEnvRec.CanDeclareGlobalFunction(fn);\n            // b. If fnDefinable is false, throw a TypeError exception.\n            if (!fnDefinable) {\n              throw realm.createErrorThrowCompletion(realm.intrinsics.TypeError, fn + \" is not definable\");\n            }\n          }\n          // 2. Append fn to declaredFunctionNames.\n          declaredFunctionNames.push(fn);\n          // 3. Insert d as the first element of functionsToInitialize.\n          functionsToInitialize.unshift(d);\n        }\n      }\n    }\n\n    // 9. NOTE: Annex B.3.3.3 adds additional steps at this point.\n\n    // 10. Let declaredVarNames be a new empty List.\n    let declaredVarNames = [];\n\n    // 11. For each d in varDeclarations, do\n    for (let d of varDeclarations) {\n      // a. If d is a VariableDeclaration or a ForBinding, then\n      if (d.type === \"VariableDeclaration\") {\n        // i. For each String vn in the BoundNames of d, do\n        for (let vn of Environment.BoundNames(realm, d)) {\n          // 1. If vn is not an element of declaredFunctionNames, then\n          if (declaredFunctionNames.indexOf(vn) < 0) {\n            // a. If varEnvRec is a global Environment Record, then\n            if (varEnvRec instanceof GlobalEnvironmentRecord) {\n              // i. Let vnDefinable be ? varEnvRec.CanDeclareGlobalVar(vn).\n              let vnDefinable = varEnvRec.CanDeclareGlobalVar(vn);\n              // ii. If vnDefinable is false, throw a TypeError exception.\n              if (!vnDefinable) {\n                throw realm.createErrorThrowCompletion(realm.intrinsics.TypeError, vn + \" is not definable\");\n              }\n            }\n            // b. If vn is not an element of declaredVarNames, then\n            if (declaredVarNames.indexOf(vn) < 0) {\n              // i. Append vn to declaredVarNames.\n              declaredVarNames.push(vn);\n            }\n          }\n        }\n      }\n    }\n\n    // 12. NOTE: No abnormal terminations occur after this algorithm step unless varEnvRec is a global Environment Record and the global object is a Proxy exotic object.\n\n    // 13. Let lexDeclarations be the LexicallyScopedDeclarations of body.\n    let lexDeclarations = [];\n    for (let s of body.body) {\n      if (s.type === \"VariableDeclaration\" && s.kind !== \"var\") {\n        lexDeclarations.push(s);\n      }\n    }\n\n    // 14. For each element d in lexDeclarations do\n    for (let d of lexDeclarations) {\n      // a. NOTE Lexically declared names are only instantiated here but not initialized.\n      // b. For each element dn of the BoundNames of d do\n      for (let dn of Environment.BoundNames(realm, d)) {\n        // c. If IsConstantDeclaration of d is true, then\n        if (d.kind === \"const\") {\n          // i. Perform ? lexEnvRec.CreateImmutableBinding(dn, true).\n          lexEnvRec.CreateImmutableBinding(dn, true);\n        } else {\n          // d. Else,\n          // i. Perform ? lexEnvRec.CreateMutableBinding(dn, false).\n          lexEnvRec.CreateMutableBinding(dn, false);\n        }\n      }\n    }\n\n    // 15. For each production f in functionsToInitialize, do\n    for (let f of functionsToInitialize) {\n      // a. Let fn be the sole element of the BoundNames of f.\n      let fn = Environment.BoundNames(realm, f)[0];\n      // b. Let fo be the result of performing InstantiateFunctionObject for f with argument lexEnv.\n      let fo = lexEnv.evaluate(f, strict);\n      invariant(fo instanceof Value);\n      // c. If varEnvRec is a global Environment Record, then\n      if (varEnvRec instanceof GlobalEnvironmentRecord) {\n        // i. Perform ? varEnvRec.CreateGlobalFunctionBinding(fn, fo, true).\n        varEnvRec.CreateGlobalFunctionBinding(fn, fo, true);\n      } else {\n        // d. Else,\n        // i. Let bindingExists be varEnvRec.HasBinding(fn).\n        let bindingExists = varEnvRec.HasBinding(fn);\n        // ii. If bindingExists is false, then\n        if (!bindingExists) {\n          // 1. Let status be ! varEnvRec.CreateMutableBinding(fn, true).\n          varEnvRec.CreateMutableBinding(fn, true);\n          // 2. Assert: status is not an abrupt completion because of validation preceding step 12.\n          // 3. Perform ! varEnvRec.InitializeBinding(fn, fo).\n          varEnvRec.InitializeBinding(fn, fo);\n        } else {\n          // iii. Else,\n          // 1. Perform ! varEnvRec.SetMutableBinding(fn, fo, false).\n          varEnvRec.SetMutableBinding(fn, fo, false);\n        }\n      }\n    }\n\n    // 16. For each String vn in declaredVarNames, in list order do\n    for (let vn of declaredVarNames) {\n      // a. If varEnvRec is a global Environment Record, then\n      if (varEnvRec instanceof GlobalEnvironmentRecord) {\n        // i. Perform ? varEnvRec.CreateGlobalVarBinding(vn, true).\n        varEnvRec.CreateGlobalVarBinding(vn, true);\n      } else {\n        // b. Else,\n        // i. Let bindingExists be varEnvRec.HasBinding(vn).\n        let bindingExists = varEnvRec.HasBinding(vn);\n        // ii. If bindingExists is false, then\n        if (!bindingExists) {\n          // 1. Let status be ! varEnvRec.CreateMutableBinding(vn, true).\n          varEnvRec.CreateMutableBinding(vn, true);\n          // 2. Assert: status is not an abrupt completion because of validation preceding step 12.\n          // 3. Perform ! varEnvRec.InitializeBinding(vn, undefined).\n          varEnvRec.InitializeBinding(vn, realm.intrinsics.undefined);\n        }\n      }\n    }\n\n    // 17. Return NormalCompletion(empty).\n    return realm.intrinsics.empty;\n  }\n\n  // ECMA 9.2.10\n  MakeMethod(realm: Realm, F: ECMAScriptSourceFunctionValue, homeObject: ObjectValue): Value {\n    // Note that F is a new object, and we can thus write to internal slots\n    invariant(realm.isNewObject(F));\n\n    // 1. Assert: F is an ECMAScript function object.\n    invariant(F instanceof ECMAScriptSourceFunctionValue, \"F is an ECMAScript function object.\");\n\n    // 2. Assert: Type(homeObject) is Object.\n    invariant(homeObject instanceof ObjectValue, \"Type(homeObject) is Object.\");\n\n    // 3. Set the [[HomeObject]] internal slot of F to homeObject.\n    F.$HomeObject = homeObject;\n\n    // 4. Return NormalCompletion(undefined).\n    return realm.intrinsics.undefined;\n  }\n\n  // ECMA 14.3.8\n  DefineMethod(\n    realm: Realm,\n    prop: BabelNodeObjectMethod | BabelNodeClassMethod,\n    obj: ObjectValue,\n    env: LexicalEnvironment,\n    strictCode: boolean,\n    functionPrototype?: ObjectValue\n  ): { $Key: PropertyKeyValue, $Closure: ECMAScriptSourceFunctionValue } {\n    // 1. Let propKey be the result of evaluating PropertyName.\n    let propKey = EvalPropertyName(prop, env, realm, strictCode);\n\n    // 2. ReturnIfAbrupt(propKey).\n\n    // 3. If the function code for this MethodDefinition is strict mode code, let strict be true. Otherwise let strict be false.\n    let strict = strictCode || IsStrict(prop.body);\n\n    // 4. Let scope be the running execution context's LexicalEnvironment.\n    let scope = env;\n\n    // 5. If functionPrototype was passed as a parameter, let kind be Normal; otherwise let kind be Method.\n    let kind;\n    if (functionPrototype) {\n      // let kind be Normal;\n      kind = \"normal\";\n    } else {\n      // otherwise let kind be Method.\n      kind = \"method\";\n    }\n\n    // 6. Let closure be FunctionCreate(kind, StrictFormalParameters, FunctionBody, scope, strict). If functionPrototype was passed as a parameter, then pass its value as the prototype optional argument of FunctionCreate.\n    let closure = this.FunctionCreate(realm, kind, prop.params, prop.body, scope, strict, functionPrototype);\n\n    // 7. Perform MakeMethod(closure, object).\n    this.MakeMethod(realm, closure, obj);\n\n    // 8. Return the Record{[[Key]]: propKey, [[Closure]]: closure}.\n    return { $Key: propKey, $Closure: closure };\n  }\n}\n"
  },
  {
    "path": "src/methods/generator.js",
    "content": "/**\n * Copyright (c) 2017-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n/* @flow strict-local */\n\nimport type { Realm } from \"../realm.js\";\nimport { AbruptCompletion } from \"../completions.js\";\nimport { Value, ObjectValue, UndefinedValue } from \"../values/index.js\";\nimport { Create, Properties } from \"../singletons.js\";\nimport invariant from \"../invariant.js\";\nimport type { BabelNodeBlockStatement } from \"@babel/types\";\n\n// ECMA26225.3.3.1\nexport function GeneratorStart(\n  realm: Realm,\n  generator: ObjectValue,\n  generatorBody: BabelNodeBlockStatement\n): UndefinedValue {\n  // Note that generator is a new object, and we can thus write to internal slots\n  invariant(realm.isNewObject(generator));\n\n  // 1. Assert: The value of generator.[[GeneratorState]] is undefined.\n  invariant(\n    generator instanceof ObjectValue && generator.$GeneratorState === undefined,\n    \"The value of generator.[[GeneratorState]] is undefined\"\n  );\n\n  // 2. Let genContext be the running execution context.\n  let genContext = realm.getRunningContext();\n\n  // 3. Set the Generator component of genContext to generator.\n\n  // 4. Set the code evaluation state of genContext such that when evaluation is resumed for that execution context the following steps will be performed:\n  // a. Let result be the result of evaluating generatorBody.\n  // b. Assert: If we return here, the generator either threw an exception or performed either an implicit or explicit return.\n  // c. Remove genContext from the execution context stack and restore the execution context that is at the top of the execution context stack as the running execution context.\n  // d. Set generator.[[GeneratorState]] to \"completed\".\n  // e. Once a generator enters the \"completed\" state it never leaves it and its associated execution context is never resumed. Any execution state associated with generator can be discarded at this point.\n  // f. If result is a normal completion, let resultValue be undefined.\n  // g. Else,\n  // i. If result.[[Type]] is return, let resultValue be result.[[Value]].\n  // ii. Else, return Completion(result).\n  // h. Return CreateIterResultObject(resultValue, true).\n\n  // 5. Set generator.[[GeneratorContext]] to genContext.\n  generator.$GeneratorContext = genContext;\n\n  // 6. Set generator.[[GeneratorState]] to \"suspendedStart\".\n  generator.$GeneratorState = \"suspendedStart\";\n\n  // 7. Return NormalCompletion(undefined).\n  return realm.intrinsics.undefined;\n}\n\n// ECMA26225.3.3.2\nexport function GeneratorValidate(realm: Realm, generator: Value): void | \"suspendedStart\" {\n  // 1. If Type(generator) is not Object, throw a TypeError exception.\n  if (!(generator instanceof ObjectValue)) {\n    throw realm.createErrorThrowCompletion(realm.intrinsics.SyntaxError, \"Type(generator) is not Object\");\n  }\n\n  // 2. If generator does not have a [[GeneratorState]] internal slot, throw a TypeError exception.\n  if (!(\"$GeneratorState\" in generator)) {\n    throw realm.createErrorThrowCompletion(realm.intrinsics.SyntaxError, \"Type(generator) is not Object\");\n  }\n\n  // 3. Assert: generator also has a [[GeneratorContext]] internal slot.\n  invariant(\"$GeneratorContext\" in generator);\n\n  // 4. Let state be generator.[[GeneratorState]].\n  let state = generator.$GeneratorState;\n\n  // 5. If state is \"executing\", throw a TypeError exception.\n  if (state === \"executing\") {\n    throw realm.createErrorThrowCompletion(realm.intrinsics.SyntaxError, \"Type(generator) is not Object\");\n  }\n\n  // 6. Return state.\n  return state;\n}\n\n// ECMA26225.3.3.3\nexport function GeneratorResume(realm: Realm, generator: Value, value: Value): Value {\n  // 1. Let state be ? GeneratorValidate(generator).\n  let state = GeneratorValidate(realm, generator);\n  invariant(generator instanceof ObjectValue);\n\n  // 2. If state is \"completed\", return CreateIterResultObject(undefined, true).\n  if (state === \"completed\") return Create.CreateIterResultObject(realm, realm.intrinsics.undefined, true);\n\n  // 3. Assert: state is either \"suspendedStart\" or \"suspendedYield\".\n  invariant(\n    state === \"suspendedStart\" || state === \"suspendedYield\",\n    \"state is either 'suspendedStart' or 'suspendedYield'\"\n  );\n\n  // 4. Let genContext be generator.[[GeneratorContext]].\n  let genContext = generator.$GeneratorContext;\n  invariant(genContext);\n\n  // 5. Let methodContext be the running execution context.\n  let methodContext = realm.getRunningContext();\n\n  // 6. Suspend methodContext.\n  methodContext.suspend();\n\n  // 7. Set generator.[[GeneratorState]] to \"executing\".\n  Properties.ThrowIfInternalSlotNotWritable(realm, generator, \"$GeneratorState\").$GeneratorState = \"executing\";\n\n  // 8. Push genContext onto the execution context stack; genContext is now the running execution context.\n  realm.pushContext(genContext);\n\n  // 9. Resume the suspended evaluation of genContext using NormalCompletion(value) as the result of the operation that suspended it. Let result be the value returned by the resumed computation.\n  let result = genContext.resume();\n\n  // 10. Assert: When we return here, genContext has already been removed from the execution context stack and methodContext is the currently running execution context.\n  invariant(realm.getRunningContext() === methodContext);\n\n  // 11. Return Completion(result).\n  return result;\n}\n\n// ECMA26225.3.3.4\nexport function GeneratorResumeAbrupt(realm: Realm, generator: Value, abruptCompletion: AbruptCompletion): Value {\n  // 1. Let state be ? GeneratorValidate(generator).\n  // 2. If state is \"suspendedStart\", then\n  // a. Set generator.[[GeneratorState]] to \"completed\".\n  // b. Once a generator enters the \"completed\" state it never leaves it and its associated execution context is never resumed. Any execution state associated with generator can be discarded at this point.\n  // c. Let state be \"completed\".\n  // 3. If state is \"completed\", then\n  // a. If abruptCompletion.[[Type]] is return, then\n  // i. Return CreateIterResultObject(abruptCompletion.[[Value]], true).\n  // b. Return Completion(abruptCompletion).\n  // 4. Assert: state is \"suspendedYield\".\n  // 5. Let genContext be generator.[[GeneratorContext]].\n  // 6. Let methodContext be the running execution context.\n  // 7. Suspend methodContext.\n  // 8. Set generator.[[GeneratorState]] to \"executing\".\n  // 9. Push genContext onto the execution context stack; genContext is now the running execution context.\n  // 10. Resume the suspended evaluation of genContext using abruptCompletion as the result of the operation that suspended it. Let result be the completion record returned by the resumed computation.\n  // 11. Assert: When we return here, genContext has already been removed from the execution context stack and methodContext is the currently running execution context.\n  // 12. Return Completion(result).\n  return realm.intrinsics.undefined;\n}\n\n// ECMA26225.3.3.5\nexport function GeneratorYield(realm: Realm, iterNextObj: ObjectValue): Value {\n  // 1. Assert: iterNextObj is an Object that implements the IteratorResult interface.\n\n  // 2. Let genContext be the running execution context.\n  // 3. Assert: genContext is the execution context of a generator.\n  // 4. Let generator be the value of the Generator component of genContext.\n  // 5. Set generator.[[GeneratorState]] to \"suspendedYield\".\n  // 6. Remove genContext from the execution context stack and restore the execution context that is at the top of the execution context stack as the running execution context.\n  // 7. Set the code evaluation state of genContext such that when evaluation is resumed with a Completion resumptionValue the following steps will be performed:\n  // a.  Return resumptionValue.\n  // b. NOTE: This returns to the evaluation of the YieldExpression production that originally called this abstract operation.\n  // 8. Return NormalCompletion(iterNextObj).\n  return realm.intrinsics.undefined;\n\n  // 9. NOTE: This returns to the evaluation of the operation that had most previously resumed evaluation of genContext.\n}\n"
  },
  {
    "path": "src/methods/get.js",
    "content": "/**\n * Copyright (c) 2017-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n/* @flow */\n\nimport { InfeasiblePathError } from \"../errors.js\";\nimport { construct_empty_effects, type Realm, Effects } from \"../realm.js\";\nimport type { PropertyKeyValue, CallableObjectValue } from \"../types.js\";\nimport {\n  AbstractObjectValue,\n  AbstractValue,\n  ArrayValue,\n  BoundFunctionValue,\n  EmptyValue,\n  NativeFunctionValue,\n  NullValue,\n  NumberValue,\n  ObjectValue,\n  ProxyValue,\n  StringValue,\n  UndefinedValue,\n  Value,\n} from \"../values/index.js\";\nimport { Reference } from \"../environment.js\";\nimport { CompilerDiagnostic, FatalError } from \"../errors.js\";\nimport { SetIntegrityLevel } from \"./integrity.js\";\nimport {\n  Call,\n  HasSomeCompatibleType,\n  IsAccessorDescriptor,\n  IsCallable,\n  IsDataDescriptor,\n  IsPropertyKey,\n} from \"./index.js\";\nimport { Create, Environment, Join, Leak, Path, To } from \"../singletons.js\";\nimport invariant from \"../invariant.js\";\nimport type { BabelNodeTemplateLiteral } from \"@babel/types\";\nimport { createOperationDescriptor } from \"../utils/generator.js\";\nimport { PropertyDescriptor, AbstractJoinedDescriptor } from \"../descriptors.js\";\nimport { IsArrayIndex } from \"./is.js\";\n\n// ECMA262 7.3.22\nexport function GetFunctionRealm(realm: Realm, obj: ObjectValue): Realm {\n  // 1. Assert: obj is a callable object.\n  invariant(IsCallable(realm, obj), \"expected callable object\");\n\n  // ProxyValue moved to realm before\n  // https://github.com/facebook/prepack/pull/1351\n\n  // 4. If obj is a Proxy exotic object, then\n  if (obj instanceof ProxyValue) {\n    // a. If the value of the [[ProxyHandler]] internal slot of obj is null, throw a TypeError exception.\n    if (obj.$ProxyHandler instanceof NullValue) {\n      throw realm.createErrorThrowCompletion(realm.intrinsics.TypeError, \"proxy handler is null\");\n    }\n    invariant(obj.$ProxyTarget instanceof ObjectValue);\n\n    // b. Let proxyTarget be the value of obj's [[ProxyTarget]] internal slot.\n    let proxyTarget = obj.$ProxyTarget;\n\n    // c. Return ? GetFunctionRealm(proxyTarget).\n    return GetFunctionRealm(realm, proxyTarget);\n  }\n\n  // 2. If obj has a [[Realm]] internal slot, then\n  if (obj.$Realm) {\n    // a. Return obj's [[Realm]] internal slot.\n    return obj.$Realm;\n  }\n\n  // 3. If obj is a Bound Function exotic object, then\n  if (obj instanceof BoundFunctionValue) {\n    // a. Let target be obj's [[BoundTargetFunction]] internal slot.\n    let target = obj.$BoundTargetFunction;\n\n    // b. Return ? GetFunctionRealm(target).\n    return GetFunctionRealm(realm, target);\n  }\n\n  // 5. Return the current Realm Record.\n  return realm;\n}\n\n// ECMA262 9.1.8.1\nexport function OrdinaryGet(\n  realm: Realm,\n  O: ObjectValue,\n  P: PropertyKeyValue,\n  Receiver: Value,\n  dataOnly?: boolean\n): Value {\n  // First deal with potential unknown properties.\n  let prop = O.unknownProperty;\n  if (prop !== undefined && prop.descriptor !== undefined && O.$GetOwnProperty(P) === undefined) {\n    let desc = prop.descriptor;\n    invariant(\n      desc instanceof PropertyDescriptor,\n      \"unknown properties are only created with Set and have equal descriptors\"\n    );\n    let val = desc.value;\n    invariant(val instanceof AbstractValue);\n    let propValue;\n    if (P instanceof StringValue) {\n      propValue = P;\n    } else if (typeof P === \"string\") {\n      propValue = new StringValue(realm, P);\n    }\n\n    if (val.kind === \"widened numeric property\") {\n      invariant(O instanceof ArrayValue && ArrayValue.isIntrinsicAndHasWidenedNumericProperty(O));\n      let propName;\n      if (P instanceof StringValue) {\n        propName = P.value;\n      } else {\n        propName = P;\n      }\n      invariant(Receiver instanceof ObjectValue || Receiver instanceof AbstractObjectValue);\n\n      if (IsArrayIndex(realm, P)) {\n        // Deal with aliasing effects\n        invariant(val.args.length === 1);\n        let aliasSet = val.args[0];\n\n        invariant(aliasSet instanceof AbstractValue && aliasSet.kind === \"mayAliasSet\");\n        for (let object of aliasSet.args) {\n          // This explicit handling of aliasing should become unnecessary\n          // when we unify arrays with widened numeric properties. We have effectively\n          // pushed this leaking decision as far out as we possibly can, for now.\n          // and objects with widened properties. TODO #2569.\n          invariant(object instanceof ObjectValue);\n          // TODO: Deal with nested Array.map, in which the following\n          // pessimistic leaking call may fail because object is not tracked\n          // for leaking\n          invariant(realm.createdObjectsTrackedForLeaks !== undefined);\n          invariant(realm.createdObjectsTrackedForLeaks.has(object));\n          Leak.value(realm, object);\n        }\n      }\n\n      return GetFromArrayWithWidenedNumericProperty(realm, Receiver, propName);\n    } else if (!propValue) {\n      AbstractValue.reportIntrospectionError(val, \"abstract computed property name\");\n      throw new FatalError();\n    }\n    return specializeJoin(realm, val, propValue);\n  }\n\n  // 1. Assert: IsPropertyKey(P) is true.\n  invariant(IsPropertyKey(realm, P), \"expected property key\");\n\n  // 2. Let desc be ? O.[[GetOwnProperty]](P).\n  let desc = O.$GetOwnProperty(P);\n  if (desc === undefined || !(desc instanceof AbstractJoinedDescriptor)) return OrdinaryGetHelper();\n\n  // joined descriptors need special treatment\n  let joinCondition = desc.joinCondition;\n  let descriptor1 = desc.descriptor1;\n  let descriptor2 = desc.descriptor2;\n  joinCondition = realm.simplifyAndRefineAbstractCondition(joinCondition);\n  if (!joinCondition.mightNotBeTrue()) {\n    desc = descriptor1;\n    return OrdinaryGetHelper();\n  }\n  if (!joinCondition.mightNotBeFalse()) {\n    desc = desc.descriptor2;\n    return OrdinaryGetHelper();\n  }\n  invariant(joinCondition instanceof AbstractValue);\n  let result1, generator1, modifiedBindings1, modifiedProperties1, createdObjects1, createdAbstracts1;\n  try {\n    desc = descriptor1;\n    ({\n      result: result1,\n      generator: generator1,\n      modifiedBindings: modifiedBindings1,\n      modifiedProperties: modifiedProperties1,\n      createdObjects: createdObjects1,\n      createdAbstracts: createdAbstracts1,\n    } = Path.withCondition(joinCondition, () => {\n      return desc !== undefined\n        ? realm.evaluateForEffects(() => OrdinaryGetHelper(), undefined, \"OrdinaryGet/1\")\n        : construct_empty_effects(realm);\n    }));\n  } catch (e) {\n    if (e instanceof InfeasiblePathError) {\n      // The joinCondition cannot be true in the current path, after all\n      desc = descriptor2;\n      return OrdinaryGetHelper();\n    } else {\n      throw e;\n    }\n  }\n  let result2, generator2, modifiedBindings2, modifiedProperties2, createdObjects2, createdAbstracts2;\n  try {\n    desc = descriptor2;\n    ({\n      result: result2,\n      generator: generator2,\n      modifiedBindings: modifiedBindings2,\n      modifiedProperties: modifiedProperties2,\n      createdObjects: createdObjects2,\n      createdAbstracts: createdAbstracts2,\n    } = Path.withInverseCondition(joinCondition, () => {\n      return desc !== undefined\n        ? realm.evaluateForEffects(() => OrdinaryGetHelper(), undefined, \"OrdinaryGet/2\")\n        : construct_empty_effects(realm);\n    }));\n  } catch (e) {\n    if (e instanceof InfeasiblePathError) {\n      // The joinCondition cannot be false in the current path, after all\n      desc = descriptor1;\n      return OrdinaryGetHelper();\n    } else {\n      throw e;\n    }\n  }\n  // Join the effects, creating an abstract view of what happened, regardless\n  // of the actual value of ownDesc.joinCondition.\n  let joinedEffects = Join.joinEffects(\n    joinCondition,\n    new Effects(result1, generator1, modifiedBindings1, modifiedProperties1, createdObjects1, createdAbstracts1),\n    new Effects(result2, generator2, modifiedBindings2, modifiedProperties2, createdObjects2, createdAbstracts2)\n  );\n  realm.applyEffects(joinedEffects);\n  return realm.returnOrThrowCompletion(joinedEffects.result);\n\n  function OrdinaryGetHelper() {\n    let descValue = !desc\n      ? realm.intrinsics.undefined\n      : desc.value === undefined\n        ? realm.intrinsics.undefined\n        : desc.value;\n    invariant(descValue instanceof Value);\n\n    // 3. If desc is undefined, then\n    if (!desc || descValue.mightHaveBeenDeleted()) {\n      // a. Let parent be ? O.[[GetPrototypeOf]]().\n      let parent = O.$GetPrototypeOf();\n\n      // b. If parent is null, return undefined.\n      if (parent instanceof NullValue) {\n        // Return the property value since it is now known to be the right value\n        // even in the case when it is empty.\n        return descValue;\n      }\n\n      // c. Return ? parent.[[Get]](P, Receiver).\n      if (descValue.mightHaveBeenDeleted() && descValue instanceof AbstractValue) {\n        // We don't know for sure that O.P does not exist.\n        let parentVal = OrdinaryGet(realm, parent.throwIfNotConcreteObject(), P, descValue, true);\n        if (parentVal instanceof UndefinedValue)\n          // even O.P returns undefined it is still the right value.\n          return descValue;\n        // Join with parent value with descValue because the actual value will be\n        // descValue unless it is empty.\n        // Only get the parent value if it does not involve a getter call.\n        // Use a property get for the joined value since it does the check for empty.\n        let cond = AbstractValue.createFromBinaryOp(realm, \"!==\", descValue, realm.intrinsics.empty);\n        return AbstractValue.createFromConditionalOp(realm, cond, descValue, parentVal);\n      }\n      invariant(!desc || descValue instanceof EmptyValue);\n      return parent.$Get(P, Receiver);\n    }\n\n    // 4. If IsDataDescriptor(desc) is true, return desc.[[Value]].\n    if (IsDataDescriptor(realm, desc)) return descValue;\n    if (dataOnly) {\n      invariant(descValue instanceof AbstractValue);\n      AbstractValue.reportIntrospectionError(descValue);\n      throw new FatalError();\n    }\n\n    // 5. Assert: IsAccessorDescriptor(desc) is true.\n    invariant(IsAccessorDescriptor(realm, desc), \"expected accessor descriptor\");\n\n    // 6. Let getter be desc.[[Get]].\n    let getter = desc.get;\n\n    // 7. If getter is undefined, return undefined.\n    if (!getter || getter instanceof UndefinedValue) return realm.intrinsics.undefined;\n\n    // 8. Return ? Call(getter, Receiver).\n    return Call(realm, getter, Receiver);\n  }\n}\n\nfunction isWidenedValue(v: void | Value) {\n  if (!(v instanceof AbstractValue)) return false;\n  if (v.kind === \"widened\" || v.kind === \"widened property\") return true;\n  for (let a of v.args) {\n    if (isWidenedValue(a)) return true;\n  }\n  return false;\n}\n\nconst lengthTemplateSrc = \"(A).length\";\n\nfunction specializeJoin(realm: Realm, absVal: AbstractValue, propName: Value): Value {\n  if (absVal.kind === \"widened property\") {\n    let ob = absVal.args[0];\n    if (propName instanceof StringValue) {\n      let pName = propName.value;\n      let pNumber = +pName;\n      if (pName === pNumber + \"\") propName = new NumberValue(realm, pNumber);\n    }\n    return AbstractValue.createTemporalFromBuildFunction(\n      realm,\n      absVal.getType(),\n      [ob, propName],\n      createOperationDescriptor(\"OBJECT_GET_PARTIAL\"),\n      { skipInvariant: true, isPure: true }\n    );\n  }\n  invariant(absVal.args.length === 3 && absVal.kind === \"conditional\");\n  let generic_cond = absVal.args[0];\n  invariant(generic_cond instanceof AbstractValue);\n  let cond = specializeCond(realm, generic_cond, propName);\n  let arg1 = absVal.args[1];\n  if (arg1 instanceof AbstractValue && arg1.args.length === 3) arg1 = specializeJoin(realm, arg1, propName);\n  let arg2 = absVal.args[2];\n  if (arg2 instanceof AbstractValue) {\n    if (arg2.kind === \"template for prototype member expression\") {\n      let ob = arg2.args[0];\n      arg2 = AbstractValue.createTemporalFromBuildFunction(\n        realm,\n        absVal.getType(),\n        [ob, propName],\n        createOperationDescriptor(\"OBJECT_GET_PARTIAL\"),\n        { skipInvariant: true, isPure: true }\n      );\n    } else if (arg2.args.length === 3) {\n      arg2 = specializeJoin(realm, arg2, propName);\n    }\n  }\n  return AbstractValue.createFromConditionalOp(realm, cond, arg1, arg2, absVal.expressionLocation);\n}\n\nfunction specializeCond(realm: Realm, absVal: AbstractValue, propName: Value): Value {\n  if (absVal.kind === \"template for property name condition\")\n    return AbstractValue.createFromBinaryOp(realm, \"===\", absVal.args[0], propName);\n  return absVal;\n}\n\nexport function OrdinaryGetPartial(\n  realm: Realm,\n  O: ObjectValue,\n  P: AbstractValue | PropertyKeyValue,\n  Receiver: Value\n): Value {\n  if (Receiver instanceof AbstractValue && Receiver.getType() === StringValue && P === \"length\") {\n    let absVal = AbstractValue.createFromTemplate(realm, lengthTemplateSrc, NumberValue, [Receiver]);\n    // This operation is a conditional atemporal\n    // See #2327\n    return AbstractValue.convertToTemporalIfArgsAreTemporal(realm, absVal, [Receiver]);\n  }\n\n  if (!(P instanceof AbstractValue)) return O.$Get(P, Receiver);\n\n  // A string coercion might have side-effects.\n  // TODO #1682: We assume that simple objects mean that they don't have a\n  // side-effectful valueOf and toString but that's not enforced.\n  if (P.mightNotBeString() && P.mightNotBeNumber() && !P.isSimpleObject()) {\n    if (realm.isInPureScope()) {\n      // If we're in pure scope, we can leak the key and keep going.\n      // Coercion can only have effects on anything reachable from the key.\n      Leak.value(realm, P);\n    } else {\n      let error = new CompilerDiagnostic(\n        \"property key might not have a well behaved toString or be a symbol\",\n        realm.currentLocation,\n        \"PP0002\",\n        \"RecoverableError\"\n      );\n      if (realm.handleError(error) !== \"Recover\") {\n        throw new FatalError();\n      }\n    }\n  }\n\n  // We assume that simple objects have no getter/setter properties.\n  if (!O.isSimpleObject() || O.mightBeLeakedObject()) {\n    if (realm.isInPureScope()) {\n      // If we're in pure scope, we can leak the object. Coercion\n      // can only have effects on anything reachable from this object.\n      // We assume that if the receiver is different than this object,\n      // then we only got here because there were no other keys with\n      // this name on other parts of the prototype chain.\n      // TODO #1675: A fix to 1675 needs to take this into account.\n      Leak.value(realm, Receiver);\n      return AbstractValue.createTemporalFromBuildFunction(\n        realm,\n        Value,\n        [Receiver, P],\n        createOperationDescriptor(\"OBJECT_GET_PARTIAL\"),\n        { skipInvariant: true, isPure: true }\n      );\n    } else {\n      let error = new CompilerDiagnostic(\n        \"unknown property access might need to invoke a getter\",\n        realm.currentLocation,\n        \"PP0030\",\n        \"RecoverableError\"\n      );\n      if (realm.handleError(error) !== \"Recover\") {\n        throw new FatalError();\n      }\n    }\n  }\n\n  P = To.ToStringAbstract(realm, P);\n\n  // If all else fails, use this expression\n  // TODO #1675: Check the prototype chain for known properties too.\n  let result;\n  if (O.isPartialObject()) {\n    if (isWidenedValue(P)) {\n      // TODO #1678: Use a snapshot or leak this object.\n      return AbstractValue.createTemporalFromBuildFunction(\n        realm,\n        Value,\n        [O, P],\n        createOperationDescriptor(\"OBJECT_GET_PARTIAL\"),\n        { skipInvariant: true, isPure: true }\n      );\n    }\n    result = AbstractValue.createFromType(realm, Value, \"sentinel member expression\", [O, P]);\n  } else {\n    // This is simple and not partial. Any access that isn't covered by checking against\n    // all its properties, is covered by reading from the prototype.\n    if (O.$Prototype === realm.intrinsics.null) {\n      // If the prototype is null, then the fallback value is undefined.\n      result = realm.intrinsics.undefined;\n    } else {\n      // Otherwise, we read the value dynamically from the prototype chain.\n      result = AbstractValue.createTemporalFromBuildFunction(\n        realm,\n        Value,\n        [O.$Prototype, P],\n        createOperationDescriptor(\"OBJECT_GET_PARTIAL\"),\n        { skipInvariant: true, isPure: true }\n      );\n    }\n  }\n\n  // Get a specialization of the join of all values written to the object\n  // with abstract property names.\n  let prop = O.unknownProperty;\n  if (prop !== undefined) {\n    let desc = prop.descriptor;\n    if (desc !== undefined) {\n      invariant(\n        desc instanceof PropertyDescriptor,\n        \"unknown properties are only created with Set and have equal descriptors\"\n      );\n      let val = desc.value;\n      invariant(val instanceof AbstractValue);\n      if (val.kind === \"widened numeric property\") {\n        invariant(O instanceof ArrayValue && ArrayValue.isIntrinsicAndHasWidenedNumericProperty(O));\n        invariant(Receiver instanceof ObjectValue || Receiver instanceof AbstractObjectValue);\n        return GetFromArrayWithWidenedNumericProperty(realm, Receiver, P instanceof StringValue ? P.value : P);\n      }\n      result = specializeJoin(realm, val, P);\n    }\n  }\n  // Join in all of the other values that were written to the object with\n  // concrete property names.\n  for (let [key, propertyBinding] of O.properties) {\n    let desc = propertyBinding.descriptor;\n    if (desc === undefined) continue; // deleted\n    desc = desc.throwIfNotConcrete(realm); // TODO: Join descriptor values based on condition\n    invariant(desc.value !== undefined); // otherwise this is not simple\n    let val = desc.value;\n    invariant(val instanceof Value);\n    let cond = AbstractValue.createFromBinaryOp(\n      realm,\n      \"===\",\n      P,\n      new StringValue(realm, key),\n      undefined,\n      \"check for known property\"\n    );\n    result = AbstractValue.createFromConditionalOp(realm, cond, val, result);\n  }\n  return result;\n}\n\n// ECMA262 8.3.6\nexport function GetGlobalObject(realm: Realm): ObjectValue | AbstractObjectValue {\n  // 1. Let ctx be the running execution context.\n  let ctx = realm.getRunningContext();\n\n  // 2. Let currentRealm be ctx's Realm.\n  let currentRealm = ctx.realm;\n\n  // 3. Return currentRealm.[[GlobalObject]].\n  return currentRealm.$GlobalObject;\n}\n\n// ECMA262 21.1.3.14.1\nexport function GetSubstitution(\n  realm: Realm,\n  matched: string,\n  str: string,\n  position: number,\n  captures: Array<string | void>,\n  replacement: string\n): string {\n  // 1. Assert: Type(matched) is String.\n  invariant(typeof matched === \"string\", \"expected matched to be a stirng\");\n\n  // 2. Let matchLength be the number of code units in matched.\n  let matchLength = matched.length;\n\n  // 3. Assert: Type(str) is String.\n  invariant(typeof str === \"string\", \"expected matched to be a stirng\");\n\n  // 4. Let stringLength be the number of code units in str.\n  let stringLength = str.length;\n\n  // 5. Assert: position is a nonnegative integer.\n  invariant(position >= 0, \"expected position to be a nonegative integer\");\n\n  // 6. Assert: position ≤ stringLength.\n  invariant(position <= stringLength, \"expected position to be less than string length\");\n\n  // 7. Assert: captures is a possibly empty List of Strings.\n  invariant(Array.isArray(captures), \"expected captures to be an array\");\n\n  // 8. Assert: Type(replacement) is String.\n  invariant(typeof replacement === \"string\", \"expected replacement to be a stirng\");\n\n  // 9. Let tailPos be position + matchLength.\n  let tailPos = position + matchLength;\n\n  // 10. Let m be the number of elements in captures.\n  let m = captures.length;\n\n  // 11. Let result be a String value derived from replacement by copying code unit elements\n  //     from replacement to result while performing replacements as specified in Table 46.\n  //     These $ replacements are done left-to-right, and, once such a replacement is performed,\n  //     the new replacement text is not subject to further replacements.\n  let result = \"\";\n  for (let i = 0; i < replacement.length; ++i) {\n    let ch = replacement.charAt(i);\n    if (ch !== \"$\" || i + 1 >= replacement.length) {\n      result += ch;\n      continue;\n    }\n    let peek = replacement.charAt(i + 1);\n    if (peek === \"&\") {\n      result += matched;\n    } else if (peek === \"$\") {\n      result += \"$\";\n    } else if (peek === \"`\") {\n      result += str.substr(0, position);\n    } else if (peek === \"'\") {\n      result += str.substr(tailPos);\n    } else if (peek >= \"0\" && peek <= \"9\") {\n      let idx = peek.charCodeAt(0) - \"0\".charCodeAt(0);\n      if (i + 2 < replacement.length) {\n        let peek2 = replacement.charAt(i + 2);\n        if (peek2 >= \"0\" && peek2 <= \"9\") {\n          let newIdx = idx * 10 + (peek2.charCodeAt(0) - \"0\".charCodeAt(0));\n          if (newIdx <= m) {\n            idx = newIdx;\n            i += 1;\n          }\n        }\n      }\n      if (idx > 0 && idx <= m) {\n        result += captures[idx - 1] || \"\";\n      } else {\n        result += \"$\" + idx;\n      }\n    } else {\n      result += \"$\" + peek;\n    }\n    i += 1;\n  }\n\n  // 12. Return result.\n  return result;\n}\n\n// ECMA262 7.3.9\nexport function GetMethod(realm: Realm, V: Value, P: PropertyKeyValue): UndefinedValue | CallableObjectValue {\n  // 1. Assert: IsPropertyKey(P) is true.\n  invariant(IsPropertyKey(realm, P), \"expected property key\");\n\n  // 2. Let func be ? GetV(V, P).\n  let func = GetV(realm, V, P);\n\n  // 3. If func is either undefined or null, return undefined.\n  if (HasSomeCompatibleType(func, NullValue, UndefinedValue)) {\n    return realm.intrinsics.undefined;\n  }\n\n  // 4. If IsCallable(func) is false, throw a TypeError exception.\n  if (!IsCallable(realm, func)) {\n    throw realm.createErrorThrowCompletion(realm.intrinsics.TypeError, \"not callable\");\n  }\n\n  // 5. Return func.\n  return ((func: any): CallableObjectValue);\n}\n\n// ECMA262 9.1.14\nexport function GetPrototypeFromConstructor(\n  realm: Realm,\n  constructor: ObjectValue,\n  intrinsicDefaultProto: string\n): ObjectValue | AbstractObjectValue {\n  // 1. Assert: intrinsicDefaultProto is a String value that is this specification's name of an intrinsic\n  //   object. The corresponding object must be an intrinsic that is intended to be used as the [[Prototype]]\n  //   value of an object.\n  invariant(realm.intrinsics[intrinsicDefaultProto], \"not a valid proto ref\");\n\n  // 2. Assert: IsCallable(constructor) is true.\n  invariant(IsCallable(realm, constructor) === true, \"expected constructor to be callable\");\n\n  // 3. Let proto be ? Get(constructor, \"prototype\").\n  let proto = Get(realm, constructor, new StringValue(realm, \"prototype\"));\n\n  // 4. If Type(proto) is not Object, then\n  if (!(proto instanceof ObjectValue) && !(proto instanceof AbstractObjectValue)) {\n    // a. Let realm be ? GetFunctionRealm(constructor).\n    realm = GetFunctionRealm(realm, constructor);\n\n    // b. Let proto be realm's intrinsic object named intrinsicDefaultProto.\n    proto = realm.intrinsics[intrinsicDefaultProto];\n  }\n\n  // 5. Return proto.\n  return proto;\n}\n\n// ECMA262 7.3.1\nexport function Get(realm: Realm, O: ObjectValue | AbstractObjectValue, P: PropertyKeyValue): Value {\n  // 1. Assert: Type(O) is Object.\n  invariant(O instanceof ObjectValue || O instanceof AbstractObjectValue, \"Not an object value\");\n\n  // 2. Assert: IsPropertyKey(P) is true.\n  invariant(IsPropertyKey(realm, P), \"Not a valid property key\");\n\n  // 3. Return ? O.[[Get]](P, O).\n  return O.$Get(P, O);\n}\n\n// ECMA262 7.3.2\nexport function GetV(realm: Realm, V: Value, P: PropertyKeyValue): Value {\n  // 1. Assert: IsPropertyKey(P) is true.\n  invariant(IsPropertyKey(realm, P), \"Not a valid property key\");\n\n  // 2. Let O be ? ToObject(V).\n  let O = To.ToObject(realm, V);\n\n  // 3. Return ? O.[[Get]](P, V).\n  return O.$Get(P, V);\n}\n\n// ECMA262 6.2.3.3\nexport function GetThisValue(realm: Realm, V: Reference): Value {\n  // 1. Assert: IsPropertyReference(V) is true.\n  invariant(Environment.IsPropertyReference(realm, V), \"expected property reference\");\n\n  // 2. If IsSuperReference(V) is true, then\n  if (Environment.IsSuperReference(realm, V)) {\n    invariant(V.thisValue !== undefined);\n    // a. Return the value of the thisValue component of the reference V.\n    return V.thisValue;\n  }\n\n  // 3. Return GetBase(V).\n  let result = Environment.GetBase(realm, V);\n  invariant(result instanceof Value);\n  return result;\n}\n\n// ECMA262 8.3.5\nexport function GetNewTarget(realm: Realm): UndefinedValue | ObjectValue {\n  // 1. Let envRec be GetThisEnvironment( ).\n  let envRec = Environment.GetThisEnvironment(realm);\n\n  // 2. Assert: envRec has a [[NewTarget]] field.\n  if (!(\"$NewTarget\" in envRec)) {\n    // In the spec we should not get here because earlier static checks are supposed to prevent it.\n    // However, we do not have an appropriate place to do this check earlier.\n    throw realm.createErrorThrowCompletion(realm.intrinsics.SyntaxError, \"new.target not allowed here\");\n  }\n\n  // 3. Return envRec.[[NewTarget]].\n  return envRec.$NewTarget || realm.intrinsics.undefined;\n}\n\nexport function GetTemplateObject(realm: Realm, templateLiteral: BabelNodeTemplateLiteral): ObjectValue {\n  // 1. Let rawStrings be TemplateStrings of templateLiteral with argument true.\n  let rawStrings = templateLiteral.quasis.map(quasi => quasi.value.raw);\n\n  // 2. Let realm be the current Realm Record.\n  realm;\n\n  // 3. Let templateRegistry be realm.[[TemplateMap]].\n  let templateRegistry = realm.$TemplateMap;\n\n  // 4. For each element e of templateRegistry, do\n  for (let e of templateRegistry) {\n    let same;\n    if (e.$Strings.length === rawStrings.length) {\n      same = true;\n      for (let i = 0; i < rawStrings.length; ++i) {\n        if (e.$Strings[i] !== rawStrings[i]) {\n          same = false;\n          break;\n        }\n      }\n    } else {\n      same = false;\n    }\n\n    // a. If e.[[Strings]] and rawStrings contain the same values in the same order, then\n    if (same) {\n      // i. Return e.[[Array]].\n      return e.$Array;\n    }\n  }\n\n  // 5. Let cookedStrings be TemplateStrings of templateLiteral with argument false.\n  let cookedStrings = templateLiteral.quasis.map(quasi => quasi.value.cooked);\n\n  // 6. Let count be the number of elements in the List cookedStrings.\n  let count = cookedStrings.length;\n\n  // 7. Let template be ArrayCreate(count).\n  let template = Create.ArrayCreate(realm, count);\n\n  // 8. Let rawObj be ArrayCreate(count).\n  let rawObj = Create.ArrayCreate(realm, count);\n\n  // 9. Let index be 0.\n  let index = 0;\n\n  // 10. Repeat while index < count\n  while (index < count) {\n    // a. Let prop be ! ToString(index).\n    let prop = To.ToString(realm, new NumberValue(realm, index));\n\n    // b. Let cookedValue be the String value cookedStrings[index].\n    let cookedValue = new StringValue(realm, cookedStrings[index]);\n\n    // c. Call template.[[DefineOwnProperty]](prop, PropertyDescriptor{[[Value]]: cookedValue, [[Writable]]: false, [[Enumerable]]: true, [[Configurable]]: false}).\n    template.$DefineOwnProperty(\n      prop,\n      new PropertyDescriptor({\n        value: cookedValue,\n        writable: false,\n        enumerable: true,\n        configurable: false,\n      })\n    );\n\n    // d. Let rawValue be the String value rawStrings[index].\n    let rawValue = new StringValue(realm, rawStrings[index]);\n\n    // e. Call rawObj.[[DefineOwnProperty]](prop, PropertyDescriptor{[[Value]]: rawValue, [[Writable]]: false, [[Enumerable]]: true, [[Configurable]]: false}).\n    rawObj.$DefineOwnProperty(\n      prop,\n      new PropertyDescriptor({\n        value: rawValue,\n        writable: false,\n        enumerable: true,\n        configurable: false,\n      })\n    );\n\n    // f. Let index be index+1.\n    index = index + 1;\n  }\n\n  // 11. Perform SetIntegrityLevel(rawObj, \"frozen\").\n  SetIntegrityLevel(realm, rawObj, \"frozen\");\n\n  // 12. Call template.[[DefineOwnProperty]](\"raw\", PropertyDescriptor{[[Value]]: rawObj, [[Writable]]: false, [[Enumerable]]: false, [[Configurable]]: false}).\n  template.$DefineOwnProperty(\n    \"raw\",\n    new PropertyDescriptor({\n      value: rawObj,\n      writable: false,\n      enumerable: false,\n      configurable: false,\n    })\n  );\n\n  // 13. Perform SetIntegrityLevel(template, \"frozen\").\n  SetIntegrityLevel(realm, template, \"frozen\");\n\n  // 14. Append the Record{[[Strings]]: rawStrings, [[Array]]: template} to templateRegistry.\n  templateRegistry.push({ $Strings: rawStrings, $Array: template });\n\n  // 15. Return template.\n  return template;\n}\n\nexport function GetFromArrayWithWidenedNumericProperty(\n  realm: Realm,\n  arr: AbstractObjectValue | ObjectValue,\n  P: string | Value\n): Value {\n  let proto = arr.$GetPrototypeOf();\n  invariant(proto instanceof ObjectValue && proto === realm.intrinsics.ArrayPrototype);\n  if (typeof P === \"string\") {\n    if (P === \"length\") {\n      return AbstractValue.createTemporalFromBuildFunction(\n        realm,\n        NumberValue,\n        [arr],\n        createOperationDescriptor(\"UNKNOWN_ARRAY_LENGTH\"),\n        { skipInvariant: true, isPure: true }\n      );\n    }\n    let prototypeBinding = proto.properties.get(P);\n    if (prototypeBinding !== undefined) {\n      let descriptor = prototypeBinding.descriptor;\n      // ensure we are accessing a built-in native function\n      if (descriptor instanceof PropertyDescriptor && descriptor.value instanceof NativeFunctionValue) {\n        return descriptor.value;\n      }\n    }\n  }\n  let prop = typeof P === \"string\" ? new StringValue(realm, P) : P;\n  return AbstractValue.createTemporalFromBuildFunction(\n    realm,\n    Value,\n    [arr, prop],\n    createOperationDescriptor(\"UNKNOWN_ARRAY_GET_PARTIAL\"),\n    {\n      skipInvariant: true,\n      isPure: true,\n    }\n  );\n}\n"
  },
  {
    "path": "src/methods/has.js",
    "content": "/**\n * Copyright (c) 2017-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n/* @flow strict-local */\n\nimport { FatalError } from \"../errors.js\";\nimport type { Realm } from \"../realm.js\";\nimport type { PropertyKeyValue } from \"../types.js\";\nimport { IsPropertyKey } from \"./index.js\";\nimport { Value, AbstractValue, ObjectValue, NullValue, AbstractObjectValue } from \"../values/index.js\";\nimport { Properties } from \"../singletons.js\";\nimport invariant from \"../invariant.js\";\nimport type { BabelNodeExpression } from \"@babel/types\";\n\n// 12.2.1.2 Static Semantics: HasName\n// 14.1.9 Static Semantics: HasName\n// 14.2.7 Static Semantics: HasName\n// 14.5.6 Static Semantics: HasName\n// 14.2.7 Static Semantics: HasName\n\nexport function HasName(realm: Realm, ast: BabelNodeExpression): boolean {\n  // 12.2.1.2 Static Semantics: HasName\n  // CoverParenthesizedExpressionAndArrowParameterList\n\n  // 14.2.7 Static Semantics: HasName\n  if (ast.type === \"ArrowFunctionExpression\") return false;\n\n  // 14.1.9 Static Semantics: HasName\n  if (ast.type === \"FunctionExpression\") {\n    // FunctionExpression: function (FormalParameters) {FunctionBody}\n    if (ast.id === null)\n      // 1. Return false.\n      return false;\n    // FunctionExpression: functionBindingIdentifier (FormalParameters) {FunctionBody}\n    if (ast.id !== null)\n      // 2. Return true\n      return true;\n  }\n\n  // 14.5.6 Static Semantics: HasName\n  if (ast.type === \"ClassExpression\") {\n    // ClassExpression : class ClassTail\n    if (ast.id === null)\n      //1. Return false.\n      return false;\n    // ClassExpression : class BindingIdentifier ClassTail\n    if (ast.id !== null)\n      //1. return true;\n      return true;\n  }\n  // 14.4.7 Static Semantics: HasName\n  // GeneratorExpression\n  throw Error(\"Unexpected AST node type  : \" + ast.type);\n}\n\n// ECMA262 7.3.10\nexport function HasProperty(realm: Realm, O: ObjectValue | AbstractObjectValue, P: PropertyKeyValue): boolean {\n  // 1. Assert: Type(O) is Object.\n\n  // 2. Assert: IsPropertyKey(P) is true.\n  invariant(IsPropertyKey(realm, P), \"expected property key\");\n\n  // 3. Return ? O.[[HasProperty]](P).\n  return O.$HasProperty(P);\n}\n\n// ECMA262 7.3.11\nexport function HasOwnProperty(realm: Realm, O: ObjectValue | AbstractObjectValue, P: PropertyKeyValue): boolean {\n  // 1. Assert: Type(O) is Object.\n\n  // 2. Assert: IsPropertyKey(P) is true.\n  invariant(IsPropertyKey(realm, P), \"not a valid property key\");\n\n  // 3. Let desc be ? O.[[GetOwnProperty]](P).\n  let desc = O.$GetOwnProperty(P);\n\n  // 4. If desc is undefined, return false.\n  if (desc === undefined) return false;\n  Properties.ThrowIfMightHaveBeenDeleted(desc);\n\n  // 5. Return true.\n  return true;\n}\n\n// ECMA262 9.1.7.1\nexport function OrdinaryHasProperty(realm: Realm, O: ObjectValue, P: PropertyKeyValue): boolean {\n  // 1. Assert: IsPropertyKey(P) is true.\n  invariant(typeof P === \"string\" || IsPropertyKey(realm, P), \"expected property key\");\n\n  // 2. Let hasOwn be ? O.[[GetOwnProperty]](P).\n  let hasOwn = O.$GetOwnProperty(P);\n\n  // 3. If hasOwn is not undefined, return true.\n  if (hasOwn !== undefined) {\n    Properties.ThrowIfMightHaveBeenDeleted(hasOwn);\n    return true;\n  }\n\n  // 4. Let parent be ? O.[[GetPrototypeOf]]().\n  let parent = O.$GetPrototypeOf();\n\n  // 5. If parent is not null, then\n  if (!(parent instanceof NullValue)) {\n    invariant(parent instanceof ObjectValue);\n\n    // a. Return ? parent.[[HasProperty]](P).\n    return parent.$HasProperty(P);\n  }\n\n  // 6. Return false.\n  return false;\n}\n\n// Checks if the given value is equal to or a subtype of the given type.\n// If the value is an abstract value without precise type information,\n// an introspection error is thrown.\nexport function HasCompatibleType(value: Value, type: typeof Value): boolean {\n  let valueType = value.getType();\n  if (valueType === Value) {\n    invariant(value instanceof AbstractValue);\n    AbstractValue.reportIntrospectionError(value);\n    throw new FatalError();\n  }\n  return Value.isTypeCompatibleWith(valueType, type);\n}\n\nexport function HasSomeCompatibleType(value: Value, ...manyTypes: Array<typeof Value>): boolean {\n  let valueType = value.getType();\n  if (valueType === Value) {\n    invariant(value instanceof AbstractValue);\n    AbstractValue.reportIntrospectionError(value);\n    throw new FatalError();\n  }\n  return manyTypes.some(Value.isTypeCompatibleWith.bind(null, valueType));\n}\n"
  },
  {
    "path": "src/methods/hash.js",
    "content": "/**\n * Copyright (c) 2017-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n/* @flow */\n\nimport type { BabelBinaryOperator, BabelUnaryOperator } from \"@babel/types\";\nimport invariant from \"../invariant.js\";\n\ninterface Hashable {\n  getHash(): number;\n  mightBeString(): boolean;\n  mightBeObject(): boolean;\n}\n\nexport function hashBinary<T: Hashable>(op: BabelBinaryOperator, x: T, y: T): [number, Array<T>] {\n  let xHash = x.getHash();\n  let yHash = y.getHash();\n  if (yHash < xHash) {\n    // Check if the operation is commutative so that we can normalize the arguments on hash value order.\n    let commutative;\n    switch (op) {\n      case \"*\":\n      case \"==\":\n      case \"!=\":\n      case \"===\":\n      case \"!==\":\n        // If both operands might be objects, the operation does not commute because of the possibility\n        // that arbitrary code can run on both operands while converting them, in which case the order of the\n        // operands must be maintained to make sure any side-effects happen in the right order.\n        commutative = !(x.mightBeObject() && y.mightBeObject());\n        break;\n      case \"+\":\n        // As above, but in addition, if one of the operands might be a string the operation does not commute\n        commutative = !(x.mightBeObject() && y.mightBeObject()) && !(x.mightBeString() || y.mightBeString());\n        break;\n      default:\n        // The operation itself is not commutative\n        commutative = false;\n        break;\n    }\n    if (commutative) {\n      [x, y] = [y, x];\n      [xHash, yHash] = [yHash, xHash];\n    }\n  }\n  let hash = (((hashString(op) * 13) ^ xHash) * 13) ^ yHash;\n  return [hash, [x, y]];\n}\n\nexport function hashCall<T: Hashable>(calleeName: string, ...args: Array<T>): [number, Array<T>] {\n  let hash = hashString(calleeName);\n  for (let a of args) hash = (hash * 13) ^ a.getHash();\n  return [hash, args];\n}\n\nexport function hashTernary<T: Hashable>(x: T, y: T, z: T): [number, Array<T>] {\n  let hash = (((x.getHash() * 13) ^ y.getHash()) * 13) ^ z.getHash();\n  return [hash, [x, y, z]];\n}\n\nexport function hashString(value: string): number {\n  let hash = 5381;\n  for (let i = value.length - 1; i >= 0; i--) {\n    hash = (hash * 33) ^ value.charCodeAt(i);\n  }\n  return hash;\n}\n\nexport function hashUnary(op: BabelUnaryOperator, x: Hashable): number {\n  return (hashString(op) * 13) ^ x.getHash();\n}\n\ninterface Equatable { equals(x: any): boolean }\n\nexport class HashSet<T: Equatable & Hashable> {\n  constructor(expectedEntries?: number = 32 * 1024) {\n    let initialSize = 16;\n    expectedEntries *= 2;\n    while (initialSize < expectedEntries) initialSize *= 2;\n    this._entries = new Array(initialSize);\n    this._count = 0;\n  }\n\n  _count: number;\n  _entries: Array<void | T>;\n\n  add(e: T): T {\n    let entries = this._entries;\n    let n = entries.length;\n    let key = e.getHash();\n    let i = key & (n - 1);\n    while (true) {\n      let entry = entries[i];\n      if (entry === undefined) {\n        entries[i] = e;\n        if (++this._count > n / 2) this.expand();\n        return e;\n      } else if (e.equals(entry)) {\n        return entry;\n      }\n      if (++i >= n) i = 0;\n    }\n    invariant(false); // otherwise Flow thinks this method can return undefined\n  }\n\n  expand(): void {\n    let oldEntries = this._entries;\n    let n = oldEntries.length;\n    let m = n * 2;\n    if (m <= 0) return;\n    let entries = new Array(m);\n    for (let i = 0; i < n; i++) {\n      let oldEntry = oldEntries[i];\n      if (oldEntry === undefined) continue;\n      let key = oldEntry.getHash();\n      let j = key & (m - 1);\n      while (true) {\n        let entry = entries[j];\n        if (entry === undefined) {\n          entries[j] = oldEntry;\n          break;\n        }\n        if (++j >= m) j = 0;\n      }\n    }\n    this._entries = entries;\n  }\n}\n"
  },
  {
    "path": "src/methods/index.js",
    "content": "/**\n * Copyright (c) 2017-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n/* @flow strict-local */\n\nexport * from \"./abstract.js\";\nexport * from \"./call.js\";\nexport * from \"./construct.js\";\nexport * from \"./date.js\";\nexport * from \"./get.js\";\nexport * from \"./has.js\";\nexport * from \"./hash.js\";\nexport * from \"./integrity.js\";\nexport * from \"./is.js\";\nexport * from \"./iterator.js\";\nexport * from \"./own.js\";\nexport * from \"./destructuring.js\";\nexport * from \"./regexp.js\";\nexport * from \"./promise.js\";\nexport * from \"./arraybuffer.js\";\n"
  },
  {
    "path": "src/methods/integerindexed.js",
    "content": ""
  },
  {
    "path": "src/methods/integrity.js",
    "content": "/**\n * Copyright (c) 2017-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n/* @flow strict-local */\n\nimport type { Realm } from \"../realm.js\";\nimport { ObjectValue } from \"../values/index.js\";\nimport { IsExtensible, IsDataDescriptor, IsAccessorDescriptor } from \"./index.js\";\nimport { Properties } from \"../singletons.js\";\nimport { FatalError } from \"../errors.js\";\nimport invariant from \"../invariant.js\";\nimport { PropertyDescriptor } from \"../descriptors.js\";\n\ntype IntegrityLevels = \"sealed\" | \"frozen\";\n\n// ECMA262 9.1.4.1\nexport function OrdinaryPreventExtensions(realm: Realm, O: ObjectValue): boolean {\n  if (O.mightBeLeakedObject() && O.getExtensible()) {\n    // todo: emit a diagnostic messsage\n    throw new FatalError();\n  }\n\n  // 1. Set the value of the [[Extensible]] internal slot of O to false.\n  O.setExtensible(false);\n\n  // 2. Return true.\n  return true;\n}\n\n// ECMA262 7.3.14\nexport function SetIntegrityLevel(realm: Realm, O: ObjectValue, level: IntegrityLevels): boolean {\n  // 1. Assert: Type(O) is Object.\n  invariant(O instanceof ObjectValue, \"expected an object\");\n\n  // 2. Assert: level is either \"sealed\" or \"frozen\".\n  invariant(level === \"sealed\" || level === \"frozen\", \"invalid level\");\n\n  // 3. Let status be ? O.[[PreventExtensions]]().\n  let status = O.$PreventExtensions();\n\n  // 4. If status is false, return false.\n  if (status === false) return false;\n\n  // 5. Let keys be ? O.[[OwnPropertyKeys]]().\n  let keys = O.$OwnPropertyKeys();\n\n  // 6. If level is \"sealed\", then\n  if (level === \"sealed\") {\n    // a. Repeat for each element k of keys,\n    for (let k of keys) {\n      // i. Perform ? DefinePropertyOrThrow(O, k, PropertyDescriptor{[[Configurable]]: false}).\n      Properties.DefinePropertyOrThrow(\n        realm,\n        O,\n        k,\n        new PropertyDescriptor({\n          configurable: false,\n        })\n      );\n    }\n  } else if (level === \"frozen\") {\n    // 7. Else level is \"frozen\",\n    // a. Repeat for each element k of keys,\n    for (let k of keys) {\n      // i. Let currentDesc be ? O.[[GetOwnProperty]](k).\n      let currentDesc = O.$GetOwnProperty(k);\n\n      // ii. If currentDesc is not undefined, then\n      if (currentDesc) {\n        Properties.ThrowIfMightHaveBeenDeleted(currentDesc);\n        let desc;\n\n        // 1. If IsAccessorDescriptor(currentDesc) is true, then\n        if (IsAccessorDescriptor(realm, currentDesc)) {\n          // a. Let desc be the PropertyDescriptor{[[Configurable]]: false}.\n          desc = new PropertyDescriptor({ configurable: false });\n        } else {\n          // 2. Else,\n          // b. Let desc be the PropertyDescriptor { [[Configurable]]: false, [[Writable]]: false }.\n          desc = new PropertyDescriptor({ configurable: false, writable: false });\n        }\n\n        // 3. Perform ? DefinePropertyOrThrow(O, k, desc).\n        Properties.DefinePropertyOrThrow(realm, O, k, desc);\n      }\n    }\n  }\n\n  // 8. Return true.\n  return true;\n}\n\n// ECMA262 7.3.15\nexport function TestIntegrityLevel(realm: Realm, O: ObjectValue, level: IntegrityLevels): boolean {\n  // 1. Assert: Type(O) is Object.\n  invariant(O instanceof ObjectValue, \"expected an object\");\n\n  // 2. Assert: level is either \"sealed\" or \"frozen\".\n  invariant(level === \"sealed\" || level === \"frozen\", \"invalid level\");\n\n  // 3. Let status be ? IsExtensible(O).\n  let status = IsExtensible(realm, O);\n\n  // 4. If status is true, return false.\n  if (status === true) return false;\n\n  // 5. NOTE If the object is extensible, none of its properties are examined.\n\n  // 6. Let keys be ? O.[[OwnPropertyKeys]]().\n  let keys = O.$OwnPropertyKeys();\n\n  // 7. Repeat for each element k of keys,\n  for (let k of keys) {\n    // a. Let currentDesc be ? O.[[GetOwnProperty]](k).\n    let currentDesc = O.$GetOwnProperty(k);\n\n    // b. If currentDesc is not undefined, then\n    if (currentDesc) {\n      Properties.ThrowIfMightHaveBeenDeleted(currentDesc);\n      currentDesc = currentDesc.throwIfNotConcrete(realm);\n\n      // i. If currentDesc.[[Configurable]] is true, return false.\n      if (currentDesc.configurable === true) return false;\n\n      // ii. If level is \"frozen\" and IsDataDescriptor(currentDesc) is true, then\n      if (level === \"frozen\" && IsDataDescriptor(realm, currentDesc) === true) {\n        // 1. If currentDesc.[[Writable]] is true, return false.\n        if (currentDesc.writable === true) return false;\n      }\n    }\n  }\n\n  // 8. Return true.\n  return true;\n}\n"
  },
  {
    "path": "src/methods/is.js",
    "content": "/**\n * Copyright (c) 2017-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n/* @flow */\n\nimport { FatalError } from \"../errors.js\";\nimport type { PropertyKeyValue } from \"../types.js\";\nimport type { Realm } from \"../realm.js\";\nimport type { Descriptor } from \"../types.js\";\nimport { Get } from \"./get.js\";\nimport {\n  FunctionValue,\n  NullValue,\n  ProxyValue,\n  ArrayValue,\n  StringValue,\n  SymbolValue,\n  ObjectValue,\n  NumberValue,\n  AbstractValue,\n  AbstractObjectValue,\n} from \"../values/index.js\";\nimport { To } from \"../singletons.js\";\nimport { Value } from \"../values/index.js\";\nimport invariant from \"../invariant.js\";\nimport { HasName, HasCompatibleType } from \"./has.js\";\nimport type { BabelNodeExpression, BabelNodeCallExpression, BabelNodeLVal, BabelNodeClassMethod } from \"@babel/types\";\nimport { PropertyDescriptor } from \"../descriptors.js\";\n\n// ECMA262 22.1.3.1.1\nexport function IsConcatSpreadable(realm: Realm, _O: Value): boolean {\n  let O = _O;\n  // 1. If Type(O) is not Object, return false.\n  if (!O.mightBeObject()) return false;\n  O = O.throwIfNotObject();\n\n  // 2. Let spreadable be ? Get(O, @@isConcatSpreadable).\n  let spreadable = Get(realm, O, realm.intrinsics.SymbolIsConcatSpreadable);\n\n  // 3. If spreadable is not undefined, return ToBoolean(spreadable).\n  if (!spreadable.mightBeUndefined()) return To.ToBooleanPartial(realm, spreadable);\n  spreadable.throwIfNotConcrete();\n\n  // 4. Return ? IsArray(O).\n  return IsArray(realm, O);\n}\n\n// ECMA262 6.2.4.3\nfunction IsGenericDescriptorInternal(realm: Realm, Desc: ?Descriptor): boolean {\n  // 1. If Desc is undefined, return false.\n  if (!Desc) return false;\n\n  // 2. If IsAccessorDescriptor(Desc) and IsDataDescriptor(Desc) are both false, return true.\n  if (!IsAccessorDescriptor(realm, Desc) && !IsDataDescriptor(realm, Desc)) return true;\n\n  // 3. Return false.\n  return false;\n}\n\n// ECMA262 6.2.4.1\nfunction IsAccessorDescriptorInternal(realm: Realm, Desc: ?Descriptor): boolean {\n  // 1. If Desc is undefined, return false.\n  if (!Desc) return false;\n\n  // 2. If both Desc.[[Get]] and Desc.[[Set]] are absent, return false.\n  Desc = Desc.throwIfNotConcrete(realm);\n  if (Desc.get === undefined && Desc.set === undefined) return false;\n\n  // 3. Return true.\n  return true;\n}\n\n// ECMA262 6.2.4.2\nfunction IsDataDescriptorInternal(realm: Realm, Desc: ?Descriptor): boolean {\n  // If Desc is undefined, return false.\n  if (!Desc) return false;\n\n  // If both Desc.[[Value]] and Desc.[[Writable]] are absent, return false.\n  Desc = Desc.throwIfNotConcrete(realm);\n  if (Desc.value === undefined && Desc.writable === undefined) return false;\n\n  // Return true.\n  return true;\n}\n\n// Flow wrappers that provide refinements using Predicate Functions.\n// These wrappers also assert that the type is PropertyDescriptor so that if this returns\n// true, then Flow can refine that the type of Desc as PropertyDescriptor.\n\nexport function IsGenericDescriptor(realm: Realm, Desc: ?Descriptor): boolean %checks {\n  return IsGenericDescriptorInternal(realm, Desc) && Desc instanceof PropertyDescriptor;\n}\n\nexport function IsAccessorDescriptor(realm: Realm, Desc: ?Descriptor): boolean %checks {\n  return IsAccessorDescriptorInternal(realm, Desc) && Desc instanceof PropertyDescriptor;\n}\n\nexport function IsDataDescriptor(realm: Realm, Desc: ?Descriptor): boolean %checks {\n  return IsDataDescriptorInternal(realm, Desc) && Desc instanceof PropertyDescriptor;\n}\n\n// ECMA262 9.1.3.1\nexport function OrdinaryIsExtensible(realm: Realm, O: ObjectValue): boolean {\n  // 1. Return the value of the [[Extensible]] internal slot of O.\n  return O.getExtensible();\n}\n\n// ECMA262 7.2.5\nexport function IsExtensible(realm: Realm, O: ObjectValue | AbstractObjectValue): boolean {\n  // 1. Assert: Type(O) is Object.\n\n  // 2. Return ? O.[[IsExtensible]]().\n  return O.$IsExtensible();\n}\n\n// ECMA262 7.2.3\nexport function IsCallable(realm: Realm, _func: Value): boolean {\n  let func = _func;\n  // 1. If Type(argument) is not Object, return false.\n  if (!func.mightBeObject()) return false;\n  if (HasCompatibleType(func, FunctionValue)) return true;\n  if (func.isSimpleObject()) return false;\n\n  if (func instanceof AbstractObjectValue && !func.values.isTop()) {\n    let result;\n    for (let element of func.values.getElements()) {\n      let isCallable = IsCallable(realm, element);\n      if (result === undefined) result = isCallable;\n      else if (result !== isCallable) func.throwIfNotConcreteObject();\n    }\n    if (result !== undefined) return result;\n  }\n\n  // 2. If argument has a [[Call]] internal method, return true.\n  func = func.throwIfNotConcreteObject();\n  if (func.$Call) return true;\n\n  // 3. Return false.\n  return false;\n}\n\n// ECMA262 7.2.4\nexport function IsConstructor(realm: Realm, _argument: Value): boolean {\n  let argument = _argument;\n  // 1. If Type(argument) is not Object, return false.\n  if (!argument.mightBeObject()) return false;\n\n  // 2. If argument has a [[Construct]] internal method, return true.\n  argument = argument.throwIfNotConcreteObject();\n  if (argument.$Construct) return true;\n\n  // 3. Return false.\n  return false;\n}\n\n// ECMA262 7.2.6\nexport function IsInteger(realm: Realm, argument: number): boolean {\n  // 1. If Type(argument) is not Number, return false.\n  invariant(typeof argument === \"number\", \"Type(argument) is not number\");\n\n  // 2. If argument is NaN, +∞, or -∞, return false.\n  if (isNaN(argument) || argument === +Infinity || argument === -Infinity) return false;\n\n  // 3. If floor(abs(argument)) ≠ abs(argument), return false.\n  if (Math.floor(Math.abs(argument)) !== Math.abs(argument)) return false;\n\n  // 4. Return true.\n  return true;\n}\n\n// ECMA262 7.2.7\nexport function IsPropertyKey(realm: Realm, arg: string | Value): boolean {\n  // We allow native strings to be passed around to avoid constructing a StringValue\n  if (typeof arg === \"string\") return true;\n\n  // 1. If Type(argument) is String, return true.\n  if (arg instanceof StringValue) return true;\n\n  // 2. If Type(argument) is Symbol, return true.\n  if (arg instanceof SymbolValue) return true;\n\n  if (arg instanceof AbstractValue) {\n    AbstractValue.reportIntrospectionError(arg);\n    throw new FatalError();\n  }\n\n  // 3. Return false.\n  return false;\n}\n\n// ECMA262 7.2.2\nexport function IsArray(realm: Realm, argument: Value): boolean {\n  // 1. If Type(argument) is not Object, return false.\n  if (!argument.mightBeObject()) return false;\n\n  // 2. If argument is an Array exotic object, return true.\n  if (argument instanceof ArrayValue || argument === realm.intrinsics.ArrayPrototype) return true;\n\n  // 3. If argument is a Proxy exotic object, then\n  if (argument instanceof ProxyValue) {\n    // a. If the value of the [[ProxyHandler]] internal slot of argument is null, throw a TypeError exception.\n    if (!argument.$ProxyHandler || argument.$ProxyHandler instanceof NullValue) {\n      throw realm.createErrorThrowCompletion(realm.intrinsics.TypeError);\n    }\n\n    // b. Let target be the value of the [[ProxyTarget]] internal slot of argument.\n    let target = argument.$ProxyTarget;\n\n    // c. Return ? IsArray(target).\n    return IsArray(realm, target);\n  }\n\n  // 4. Return false.\n  if (argument instanceof AbstractValue && !argument.isSimpleObject()) argument.throwIfNotConcrete();\n  return false;\n}\n\n// ECMA262 14.6.1\nexport function IsInTailPosition(realm: Realm, node: BabelNodeCallExpression): boolean {\n  // TODO #1008: implement tail calls\n  return false;\n}\n\n// ECMA262 7.2.8\nexport function IsRegExp(realm: Realm, _argument: Value): boolean {\n  let argument = _argument;\n  // 1. If Type(argument) is not Object, return false.\n  if (!argument.mightBeObject()) return false;\n  argument = argument.throwIfNotObject();\n\n  // 2. Let isRegExp be ? Get(argument, @@match).\n  let isRegExp = Get(realm, argument, realm.intrinsics.SymbolMatch);\n\n  // 3. If isRegExp is not undefined, return ToBoolean(isRegExp).\n  if (isRegExp !== undefined) return To.ToBooleanPartial(realm, isRegExp) === true;\n\n  // 4. If argument has a [[RegExpMatcher]] internal slot, return true.\n  if (argument.$RegExpMatcher !== undefined) return true;\n\n  // 5. Return false.\n  return false;\n}\n\n// ECMA262 12.2.1.4 Static Semantics: IsIdentifierRef\n// ECMA262 12.3.1.4 Static Semantics: IsIdentifierRef\nexport function IsIdentifierRef(realm: Realm, node: BabelNodeLVal): boolean {\n  switch (node.type) {\n    // ECMA262 12.2.1.4 Static Semantics: IsIdentifierRef\n    case \"Identifier\":\n      return true;\n    // ECMA262 12.3.1.4 Static Semantics: IsIdentifierRef\n    case \"MemberExpression\":\n      return false;\n    default:\n      throw Error(\"Unexpected AST form : \" + node.type);\n  }\n}\n\n// 12.2.1.3 Static Semantics: IsFunctionDefinition\n// 12.2.1.3 Static Semantics: IsFunctionDefinition\n// 12.13 Binary Logical Operators\n// 12.3.1.2 Static Semantics: IsFunctionDefinition\n// 12.15.2 Static Semantics: IsFunctionDefinition\nexport function IsFunctionDefinition(realm: Realm, node: BabelNodeExpression): boolean {\n  switch (node.type) {\n    // 12.2.1.3 Static Semantics: IsFunctionDefinition\n    case \"ThisExpression\":\n    case \"Identifier\":\n    case \"StringLiteral\":\n    case \"NumericLiteral\":\n    case \"BooleanLiteral\":\n    case \"NullLiteral\":\n    case \"RegExpLiteral\":\n    case \"ArrayExpression\":\n    case \"ObjectExpression\":\n    case \"TemplateLiteral\":\n    case \"ConditionalExpression\":\n      return false;\n    // 12.2.1.3 Static Semantics: IsFunctionDefinition\n    case \"UpdateExpression\":\n      return false;\n    // 12.13 Binary Logical Operators\n    case \"BinaryExpression\":\n    case \"LogicalExpression\":\n      return false;\n    // 12.3.1.2 Static Semantics: IsFunctionDefinition\n    case \"MemberExpression\":\n    case \"CallExpression\":\n    case \"NewExpression\":\n    case \"MetaProperty\":\n    case \"TaggedTemplateExpression\":\n      return false;\n    //12.5.1 Static Semantics: IsFunctionDefinition\n    case \"UnaryExpression\":\n      return false;\n    //12.15.2 Static Semantics: IsFunctionDefinition\n    case \"AssignmentExpression\":\n      return false;\n    //12.16.1 Static Semantics: IsFunctionDefinition\n    case \"SequenceExpression\":\n      return false;\n    case \"ArrowFunctionExpression\":\n    case \"FunctionExpression\":\n      return true;\n    // 14.5.8 Static Semantics: IsFunctionDefinition\n    case \"ClassExpression\":\n      return true;\n    // JSX Extensions: http://facebook.github.io/jsx/\n    case \"JSXElement\":\n      return false;\n    default:\n      throw Error(\"Unexpected AST form : \" + node.type);\n  }\n}\n\n// ECMA262 14.1.10\nexport function IsAnonymousFunctionDefinition(realm: Realm, node: BabelNodeExpression): boolean {\n  // 1. If IsFunctionDefinition of production is false, return false.\n  if (!IsFunctionDefinition(realm, node)) return false;\n\n  // 2. Let hasName be the result of HasName of production.\n  let hasName = HasName(realm, node);\n\n  // 3. If hasName is true, return false.\n  if (hasName === true) return false;\n\n  // 4. Return true.\n  return true;\n}\n\n// ECMA262 9.4.2\nexport function IsArrayIndex(realm: Realm, P: PropertyKeyValue): boolean {\n  let key;\n  if (typeof P === \"string\") {\n    key = P;\n  } else if (P instanceof StringValue) {\n    key = P.value;\n  } else {\n    return false;\n  }\n\n  let i = To.ToUint32(realm, new StringValue(realm, key));\n  return i !== Math.pow(2, 32) - 1 && To.ToString(realm, new NumberValue(realm, i)) === key;\n}\n\n// ECMA262 25.4.1.6\nexport function IsPromise(realm: Realm, _x: Value): boolean {\n  let x = _x;\n  // 1. If Type(x) is not Object, return false.\n  if (!x.mightBeObject()) return false;\n\n  // 2. If x does not have a [[PromiseState]] internal slot, return false.\n  x = x.throwIfNotConcreteObject();\n  if (x.$PromiseState === undefined) return false;\n\n  // 3. Return true.\n  return true;\n}\n\n// ECMA262 24.1.1.2\nexport function IsDetachedBuffer(realm: Realm, arrayBuffer: ObjectValue): boolean {\n  // 1. Assert: Type(arrayBuffer) is Object and it has an [[ArrayBufferData]] internal slot.\n  invariant(arrayBuffer instanceof ObjectValue && \"$ArrayBufferData\" in arrayBuffer);\n\n  // 2. If arrayBuffer's [[ArrayBufferData]] internal slot is null, return true.\n  if (arrayBuffer.$ArrayBufferData === null) return true;\n\n  // 3. Return false.\n  return false;\n}\n\nexport function IsIntrospectionError(realm: Realm, _value: Value): boolean {\n  let value = _value;\n  if (!value.mightBeObject()) return false;\n  value = value.throwIfNotConcreteObject();\n  return value.$GetPrototypeOf() === realm.intrinsics.__IntrospectionErrorPrototype;\n}\n\nexport function IsStatic(classElement: BabelNodeClassMethod): boolean {\n  // $FlowFixMe need to backport static property to BabelNodeClassMethod\n  return classElement.static;\n}\n"
  },
  {
    "path": "src/methods/iterator.js",
    "content": "/**\n * Copyright (c) 2017-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n/* @flow strict-local */\n\nimport type { Realm } from \"../realm.js\";\nimport type { CallableObjectValue } from \"../types.js\";\nimport { Completion, AbruptCompletion, ThrowCompletion } from \"../completions.js\";\nimport { NativeFunctionValue, NumberValue, ObjectValue, StringValue, UndefinedValue, Value } from \"../values/index.js\";\nimport { Call, Get, GetMethod, Invoke } from \"./index.js\";\nimport invariant from \"../invariant.js\";\nimport type { IterationKind } from \"../types.js\";\nimport { SameValue } from \"./abstract.js\";\nimport { Create, To } from \"../singletons.js\";\n\n// ECMA262 7.4.1\nexport function GetIterator(realm: Realm, obj: Value = realm.intrinsics.undefined, _method?: Value): ObjectValue {\n  let method = _method;\n  // 1. If method was not passed, then\n  if (!method) {\n    // a. Let method be ? GetMethod(obj, @@iterator).\n    method = GetMethod(realm, obj, realm.intrinsics.SymbolIterator);\n  }\n\n  // 2. Let iterator be ? Call(method, obj).\n  let iterator = Call(realm, (method: Value), obj);\n\n  // 3. If Type(iterator) is not Object, throw a TypeError exception.\n  if (!(iterator instanceof ObjectValue)) {\n    throw realm.createErrorThrowCompletion(realm.intrinsics.TypeError);\n  }\n\n  // 4. Return iterator.\n  return iterator;\n}\n\n// ECMA262 7.4.5\nexport function IteratorStep(realm: Realm, iterator: Value): false | ObjectValue {\n  // 1. Let result be ? IteratorNext(iterator).\n  let result = IteratorNext(realm, iterator);\n\n  // 2. Let done be ? IteratorComplete(result).\n  let done = IteratorComplete(realm, result);\n\n  // 3. If done is true, return false.\n  if (done) return false;\n\n  // 4. Return result.\n  return result;\n}\n\n// ECMA262 7.4.4\nexport function IteratorValue(realm: Realm, iterResult: ObjectValue): Value {\n  // 1. Assert: Type(iterResult) is Object.\n  invariant(iterResult instanceof ObjectValue, \"expected obj\");\n\n  // 2. Return ? Get(iterResult, \"value\").\n  return Get(realm, iterResult, \"value\");\n}\n\n// ECMA262 7.4.2\nexport function IteratorComplete(realm: Realm, iterResult: ObjectValue): boolean {\n  // 1. Assert: Type(iterResult) is Object.\n  invariant(iterResult instanceof ObjectValue, \"expected obj\");\n\n  // 2. Return ToBoolean(? Get(iterResult, \"done\")).\n  return To.ToBooleanPartial(realm, Get(realm, iterResult, \"done\"));\n}\n\n// ECMA262 7.4.2\nexport function IteratorNext(realm: Realm, iterator: Value, value?: Value): ObjectValue {\n  // 1. If value was not passed, then\n  let result;\n  if (!value) {\n    // a. Let result be ? Invoke(iterator, \"next\", « »).\n    result = Invoke(realm, iterator, \"next\", []);\n  } else {\n    // 2. Else,\n    // a. Let result be ? Invoke(iterator, \"next\", « value »).\n    result = Invoke(realm, iterator, \"next\", [value]);\n  }\n\n  // 3. If Type(result) is not Object, throw a TypeError exception.\n  if (!(result instanceof ObjectValue)) {\n    throw realm.createErrorThrowCompletion(realm.intrinsics.TypeError);\n  }\n\n  // 4. Return result.\n  return result;\n}\n\n// ECMA262 7.4.8\nexport function CreateListIterator(realm: Realm, list: Array<Value>): ObjectValue {\n  // 1. Let iterator be ObjectCreate(%IteratorPrototype%, « [[IteratorNext]], [[IteratedList]], [[ListIteratorNextIndex]] »).\n  let iterator = Create.ObjectCreate(realm, realm.intrinsics.IteratorPrototype, {\n    $IteratorNext: undefined,\n    $IteratedList: undefined,\n    $ListIteratorNextIndex: undefined,\n  });\n\n  // 2. Set iterator's [[IteratedList]] internal slot to list.\n  iterator.$IteratedList = list;\n\n  // 3. Set iterator's [[ListIteratorNextIndex]] internal slot to 0.\n  iterator.$ListIteratorNextIndex = 0;\n\n  // 4. Let next be a new built-in function object as defined in ListIterator next (7.4.8.1).\n  let next = ListIterator_next(realm);\n\n  // 5. Set iterator's [[IteratorNext]] internal slot to next.\n  iterator.$IteratorNext = next;\n\n  // 6. Perform CreateMethodProperty(iterator, \"next\", next).\n  Create.CreateMethodProperty(realm, iterator, new StringValue(realm, \"next\"), next);\n\n  // 7. Return iterator.\n  return iterator;\n}\n\n// ECMA262 7.4.8.1\nfunction ListIterator_next(realm: Realm): NativeFunctionValue {\n  let func = new NativeFunctionValue(realm, undefined, \"next\", 0, context => {\n    invariant(context instanceof ObjectValue);\n\n    // 1. Let O be the this value.\n    let O = context;\n\n    // 2. Let f be the active function object.\n    let f = func;\n\n    // 3. If O does not have a [[IteratorNext]] internal slot, throw a TypeError exception.\n    if (!O.$IteratorNext) {\n      throw realm.createErrorThrowCompletion(\n        realm.intrinsics.TypeError,\n        \"O does not have an [[IteratorNext]] internal slot\"\n      );\n    }\n\n    // 4. Let next be the value of the [[IteratorNext]] internal slot of O.\n    let next = O.$IteratorNext;\n\n    // 5. If SameValue(f, next) is false, throw a TypeError exception.\n    if (!SameValue(realm, f, next)) {\n      throw realm.createErrorThrowCompletion(realm.intrinsics.TypeError);\n    }\n\n    // 6. If O does not have an [[IteratedList]] internal slot, throw a TypeError exception.\n    if (!O.$IteratedList) {\n      throw realm.createErrorThrowCompletion(\n        realm.intrinsics.TypeError,\n        \"O does not have an [[IteratedList]] internal slot\"\n      );\n    }\n\n    // 7. Let list be the value of the [[IteratedList]] internal slot of O.\n    let list = O.$IteratedList;\n\n    invariant(typeof O.$ListIteratorNextIndex === \"number\");\n\n    // 8. Let index be the value of the [[ListIteratorNextIndex]] internal slot of O.\n    // Default to 0 for Flow.\n    let index = O.$ListIteratorNextIndex;\n\n    // 9. Let len be the number of elements of list.\n    let len = list.length;\n\n    // 10. If index ≥ len, then\n    if (index >= len) {\n      // a. Return CreateIterResultObject(undefined, true).\n      return Create.CreateIterResultObject(realm, realm.intrinsics.undefined, true);\n    }\n\n    // 11. Set the value of the [[ListIteratorNextIndex]] internal slot of O to index+1.\n    O.$ListIteratorNextIndex = index + 1;\n\n    // 12. Return CreateIterResultObject(list[index], false).\n    return Create.CreateIterResultObject(realm, list[index], false);\n  });\n\n  return func;\n}\n\n// ECMA262 23.1.5.1\nexport function CreateMapIterator(realm: Realm, map: Value, kind: IterationKind): ObjectValue {\n  // 1. If Type(map) is not Object, throw a TypeError exception.\n  if (!(map instanceof ObjectValue)) {\n    throw realm.createErrorThrowCompletion(realm.intrinsics.TypeError);\n  }\n\n  // 2. If map does not have a [[MapData]] internal slot, throw a TypeError exception.\n  if (!map.$MapData) {\n    throw realm.createErrorThrowCompletion(realm.intrinsics.TypeError);\n  }\n\n  // 3. Let iterator be ObjectCreate(%MapIteratorPrototype%, « [[Map]], [[MapNextIndex]], [[MapIterationKind]] »).\n  let iterator = Create.ObjectCreate(realm, realm.intrinsics.MapIteratorPrototype, {\n    $Map: undefined,\n    $MapNextIndex: undefined,\n    $MapIterationKind: undefined,\n  });\n\n  // 4. Set iterator's [[Map]] internal slot to map.\n  iterator.$Map = map;\n\n  // 5. Set iterator's [[MapNextIndex]] internal slot to 0.\n  iterator.$MapNextIndex = new NumberValue(realm, 0);\n\n  // 6. Set iterator's [[MapIterationKind]] internal slot to kind.\n  iterator.$MapIterationKind = kind;\n\n  // 7. Return iterator.\n  return iterator;\n}\n\n// ECMA262 23.2.5.1\nexport function CreateSetIterator(realm: Realm, set: Value, kind: IterationKind): ObjectValue {\n  // 1. If Type(set) is not Object, throw a TypeError exception.\n  if (!(set instanceof ObjectValue)) {\n    throw realm.createErrorThrowCompletion(realm.intrinsics.TypeError);\n  }\n\n  // 2. If set does not have a [[SetData]] internal slot, throw a TypeError exception.\n  if (!set.$SetData) {\n    throw realm.createErrorThrowCompletion(realm.intrinsics.TypeError);\n  }\n\n  // 3. Let iterator be ObjectCreate(%SetIteratorPrototype%, « [[IteratedSet]], [[SetNextIndex]], [[SetIterationKind]] »).\n  let iterator = Create.ObjectCreate(realm, realm.intrinsics.SetIteratorPrototype, {\n    $IteratedSet: undefined,\n    $SetNextIndex: undefined,\n    $SetIterationKind: undefined,\n  });\n\n  // 4. Set iterator's [[IteratedSet]] internal slot to set.\n  iterator.$IteratedSet = set;\n\n  // 5. Set iterator's [[SetNextIndex]] internal slot to 0.\n  iterator.$SetNextIndex = 0;\n\n  // 6. Set iterator's [[SetIterationKind]] internal slot to kind.\n  iterator.$SetIterationKind = kind;\n\n  // 7. Return iterator.\n  return iterator;\n}\n\n// ECMA262 7.4.6\nexport function IteratorClose(realm: Realm, iterator: ObjectValue, completion: Completion): Completion {\n  // 1. Assert: Type(iterator) is Object.\n  invariant(iterator instanceof ObjectValue, \"expected object\");\n\n  // 2. Assert: completion is a Completion Record.\n  invariant(completion instanceof Completion, \"expected completion record\");\n\n  // 3. Let return be ? GetMethod(iterator, \"return\").\n  let ret = GetMethod(realm, iterator, \"return\");\n\n  // 4. If return is undefined, return Completion(completion).\n  if (ret instanceof UndefinedValue) return completion;\n\n  // 5. Let innerResult be Call(return, iterator, « »).\n  let innerResult;\n  try {\n    innerResult = Call(realm, ret.throwIfNotConcrete(), iterator, []);\n  } catch (error) {\n    if (error instanceof AbruptCompletion) {\n      innerResult = error;\n    } else {\n      throw error;\n    }\n  }\n\n  // 6. If completion.[[Type]] is throw, return Completion(completion).\n  if (completion instanceof ThrowCompletion) return completion;\n\n  // 7. If innerResult.[[Type]] is throw, return Completion(innerResult).\n  if (innerResult instanceof ThrowCompletion) return innerResult;\n\n  // 8. If Type(innerResult.[[Value]]) is not Object, throw a TypeError exception.\n  if (!(innerResult instanceof ObjectValue)) {\n    return realm.createErrorThrowCompletion(realm.intrinsics.TypeError);\n  }\n\n  // 9. Return Completion(completion).\n  return completion;\n}\n\n// ECMA262 22.2.2.1.1\nexport function IterableToList(realm: Realm, items: Value, method: CallableObjectValue): Array<Value> {\n  // 1. Let iterator be ? GetIterator(items, method).\n  let iterator = GetIterator(realm, items, method);\n\n  // 2. Let values be a new empty List.\n  let values = [];\n\n  // 3. Let next be true.\n  let next = true;\n\n  // 4. Repeat, while next is not false\n  while (next !== false) {\n    // a. Let next be ? IteratorStep(iterator).\n    next = IteratorStep(realm, iterator);\n\n    // b. If next is not false, then\n    if (next !== false) {\n      // i. Let nextValue be ? IteratorValue(next).\n      let nextValue = IteratorValue(realm, next);\n\n      // ii. Append nextValue to the end of the List values.\n      values.push(nextValue);\n    }\n  }\n\n  // 5. Return values.\n  return values;\n}\n"
  },
  {
    "path": "src/methods/join.js",
    "content": "/**\n * Copyright (c) 2017-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n/* @flow */\n\nimport type { Binding } from \"../environment.js\";\nimport type { Bindings, BindingEntry, PropertyBindings, CreatedAbstracts, CreatedObjects, Realm } from \"../realm.js\";\nimport { construct_empty_effects, Effects } from \"../realm.js\";\nimport type { Descriptor, PropertyBinding } from \"../types.js\";\nimport {\n  cloneDescriptor,\n  equalDescriptors,\n  PropertyDescriptor,\n  AbstractJoinedDescriptor,\n  InternalSlotDescriptor,\n} from \"../descriptors.js\";\n\nimport {\n  AbruptCompletion,\n  BreakCompletion,\n  Completion,\n  ContinueCompletion,\n  JoinedAbruptCompletions,\n  JoinedNormalAndAbruptCompletions,\n  SimpleNormalCompletion,\n  NormalCompletion,\n  ReturnCompletion,\n  ThrowCompletion,\n} from \"../completions.js\";\nimport { IsDataDescriptor, StrictEqualityComparison } from \"../methods/index.js\";\nimport { Path } from \"../singletons.js\";\nimport { Generator } from \"../utils/generator.js\";\nimport { AbstractValue, ConcreteValue, EmptyValue, Value } from \"../values/index.js\";\n\nimport invariant from \"../invariant.js\";\n\nfunction joinGenerators(joinCondition: AbstractValue, generator1: Generator, generator2: Generator): Generator {\n  let realm = joinCondition.$Realm;\n  let result = new Generator(realm, \"joined\", realm.pathConditions);\n  if (!generator1.empty() || !generator2.empty()) {\n    result.joinGenerators(joinCondition, generator1, generator2);\n  }\n  return result;\n}\n\nfunction joinArrays(\n  realm: Realm,\n  v1: void | Array<Value> | Array<{ $Key: void | Value, $Value: void | Value }>,\n  v2: void | Array<Value> | Array<{ $Key: void | Value, $Value: void | Value }>,\n  getAbstractValue: (void | Value, void | Value) => Value\n): Array<Value> | Array<{ $Key: void | Value, $Value: void | Value }> {\n  let e = (v1 && v1[0]) || (v2 && v2[0]);\n  if (e instanceof Value) return joinArraysOfValues(realm, (v1: any), (v2: any), getAbstractValue);\n  else return joinArrayOfsMapEntries(realm, (v1: any), (v2: any), getAbstractValue);\n}\n\nfunction joinArrayOfsMapEntries(\n  realm: Realm,\n  a1: void | Array<{ $Key: void | Value, $Value: void | Value }>,\n  a2: void | Array<{ $Key: void | Value, $Value: void | Value }>,\n  getAbstractValue: (void | Value, void | Value) => Value\n): Array<{ $Key: void | Value, $Value: void | Value }> {\n  let empty = realm.intrinsics.empty;\n  let n = Math.max((a1 && a1.length) || 0, (a2 && a2.length) || 0);\n  let result = [];\n  for (let i = 0; i < n; i++) {\n    let { $Key: key1, $Value: val1 } = (a1 && a1[i]) || { $Key: empty, $Value: empty };\n    let { $Key: key2, $Value: val2 } = (a2 && a2[i]) || { $Key: empty, $Value: empty };\n    if (key1 === undefined && key2 === undefined) {\n      result[i] = { $Key: undefined, $Value: undefined };\n    } else {\n      let key3 = getAbstractValue(key1, key2);\n      let val3 = getAbstractValue(val1, val2);\n      result[i] = { $Key: key3, $Value: val3 };\n    }\n  }\n  return result;\n}\n\nfunction joinArraysOfValues(\n  realm: Realm,\n  a1: void | Array<Value>,\n  a2: void | Array<Value>,\n  getAbstractValue: (void | Value, void | Value) => Value\n): Array<Value> {\n  let n = Math.max((a1 && a1.length) || 0, (a2 && a2.length) || 0);\n  let result = [];\n  for (let i = 0; i < n; i++) {\n    result[i] = getAbstractValue((a1 && a1[i]) || undefined, (a2 && a2[i]) || undefined);\n  }\n  return result;\n}\n\nexport class JoinImplementation {\n  composeCompletions(leftCompletion: void | Completion | Value, rightCompletion: Completion | Value): Completion {\n    if (leftCompletion instanceof AbruptCompletion) return leftCompletion;\n    if (leftCompletion instanceof JoinedNormalAndAbruptCompletions) {\n      if (rightCompletion instanceof JoinedNormalAndAbruptCompletions) {\n        rightCompletion.composedWith = leftCompletion;\n        rightCompletion.pathConditionsAtCreation = leftCompletion.pathConditionsAtCreation;\n        return rightCompletion;\n      }\n      let c = this.composeCompletions(leftCompletion.consequent, rightCompletion);\n      if (c instanceof Value) c = new SimpleNormalCompletion(c);\n      let a = this.composeCompletions(leftCompletion.alternate, rightCompletion);\n      if (a instanceof Value) a = new SimpleNormalCompletion(a);\n      let joinedCompletion = this.joinCompletions(leftCompletion.joinCondition, c, a);\n      if (joinedCompletion instanceof JoinedNormalAndAbruptCompletions) {\n        joinedCompletion.composedWith = leftCompletion.composedWith;\n        joinedCompletion.pathConditionsAtCreation = leftCompletion.pathConditionsAtCreation;\n        joinedCompletion.savedEffects = leftCompletion.savedEffects;\n      }\n      return joinedCompletion;\n    }\n    if (leftCompletion instanceof Value) leftCompletion = new SimpleNormalCompletion(leftCompletion);\n    if (\n      leftCompletion instanceof Completion &&\n      leftCompletion.value === leftCompletion.value.$Realm.intrinsics.__bottomValue\n    ) {\n      return leftCompletion;\n    }\n    if (rightCompletion instanceof Value) rightCompletion = new SimpleNormalCompletion(rightCompletion);\n    return rightCompletion;\n  }\n\n  composeWithEffects(completion: Completion, normalEffects: Effects): Effects {\n    if (completion instanceof JoinedNormalAndAbruptCompletions) {\n      let selectAbrupt = c => c instanceof AbruptCompletion && c.value !== c.value.$Realm.intrinsics.__bottomValue;\n      let composableCompletions = Completion.makeSelectedCompletionsInfeasibleInCopy(selectAbrupt, completion);\n      let composedNormalCompletion = this.composeCompletions(composableCompletions, normalEffects.result);\n      normalEffects.result = composedNormalCompletion;\n\n      let selectNormal = c =>\n        c instanceof SimpleNormalCompletion && c.value !== c.value.$Realm.intrinsics.__bottomValue;\n      let nonComposableCompletions = Completion.makeSelectedCompletionsInfeasibleInCopy(selectNormal, completion);\n      let nonComposedEffects = construct_empty_effects(completion.value.$Realm, nonComposableCompletions);\n\n      let joinCondition = AbstractValue.createJoinConditionForSelectedCompletions(selectNormal, completion);\n      return this.joinEffects(joinCondition, normalEffects, nonComposedEffects);\n    } else if (completion instanceof AbruptCompletion) {\n      return construct_empty_effects(completion.value.$Realm, completion);\n    } else {\n      return normalEffects;\n    }\n  }\n\n  _collapseSimilarCompletions(joinCondition: AbstractValue, c1: Completion, c2: Completion): void | Completion {\n    let realm = joinCondition.$Realm;\n    let getAbstractValue = (v1: void | Value, v2: void | Value): Value => {\n      if (v1 instanceof EmptyValue) return v2 || realm.intrinsics.undefined;\n      if (v2 instanceof EmptyValue) return v1 || realm.intrinsics.undefined;\n      return AbstractValue.createFromConditionalOp(realm, joinCondition, v1, v2);\n    };\n    if (c1 instanceof BreakCompletion && c2 instanceof BreakCompletion && c1.target === c2.target) {\n      let val = this.joinValues(realm, c1.value, c2.value, getAbstractValue);\n      invariant(val instanceof Value);\n      return new BreakCompletion(val, joinCondition.expressionLocation, c1.target);\n    }\n    if (c1 instanceof ContinueCompletion && c2 instanceof ContinueCompletion && c1.target === c2.target) {\n      return new ContinueCompletion(realm.intrinsics.empty, joinCondition.expressionLocation, c1.target);\n    }\n    if (c1 instanceof ReturnCompletion && c2 instanceof ReturnCompletion) {\n      let val = this.joinValues(realm, c1.value, c2.value, getAbstractValue);\n      invariant(val instanceof Value);\n      return new ReturnCompletion(val, joinCondition.expressionLocation);\n    }\n    if (c1 instanceof ThrowCompletion && c2 instanceof ThrowCompletion) {\n      getAbstractValue = (v1: void | Value, v2: void | Value) => {\n        return AbstractValue.createFromConditionalOp(realm, joinCondition, v1, v2);\n      };\n      let val = this.joinValues(realm, c1.value, c2.value, getAbstractValue);\n      invariant(val instanceof Value);\n      return new ThrowCompletion(val, c1.location);\n    }\n    if (c1 instanceof SimpleNormalCompletion && c2 instanceof SimpleNormalCompletion) {\n      return new SimpleNormalCompletion(getAbstractValue(c1.value, c2.value));\n    }\n    return undefined;\n  }\n\n  joinCompletions(joinCondition: Value, c1: Completion, c2: Completion): Completion {\n    if (!joinCondition.mightNotBeTrue()) return c1;\n    if (!joinCondition.mightNotBeFalse()) return c2;\n    invariant(joinCondition instanceof AbstractValue);\n\n    let c = this._collapseSimilarCompletions(joinCondition, c1, c2);\n    if (c === undefined) {\n      if (c1 instanceof AbruptCompletion && c2 instanceof AbruptCompletion)\n        c = new JoinedAbruptCompletions(joinCondition, c1, c2);\n      else {\n        invariant(c1 instanceof AbruptCompletion || c1 instanceof NormalCompletion);\n        invariant(c2 instanceof AbruptCompletion || c2 instanceof NormalCompletion);\n        c = new JoinedNormalAndAbruptCompletions(joinCondition, c1, c2);\n      }\n    }\n    return c;\n  }\n\n  joinEffects(joinCondition: Value, e1: Effects, e2: Effects): Effects {\n    invariant(e1.canBeApplied);\n    invariant(e2.canBeApplied);\n    if (!joinCondition.mightNotBeTrue()) return e1;\n    if (!joinCondition.mightNotBeFalse()) return e2;\n    invariant(joinCondition instanceof AbstractValue);\n\n    let {\n      result: c1,\n      generator: generator1,\n      modifiedBindings: modifiedBindings1,\n      modifiedProperties: modifiedProperties1,\n      createdObjects: createdObjects1,\n      createdAbstracts: createdAbstracts1,\n    } = e1;\n\n    let {\n      result: c2,\n      generator: generator2,\n      modifiedBindings: modifiedBindings2,\n      modifiedProperties: modifiedProperties2,\n      createdObjects: createdObjects2,\n      createdAbstracts: createdAbstracts2,\n    } = e2;\n\n    let realm = joinCondition.$Realm;\n\n    let c = this.joinCompletions(joinCondition, c1, c2);\n\n    let [modifiedGenerator1, modifiedGenerator2, bindings] = this._joinBindings(\n      joinCondition,\n      generator1,\n      modifiedBindings1,\n      generator2,\n      modifiedBindings2\n    );\n\n    let generator = joinGenerators(joinCondition, modifiedGenerator1, modifiedGenerator2);\n\n    let properties = this.joinPropertyBindings(\n      realm,\n      joinCondition,\n      modifiedProperties1,\n      modifiedProperties2,\n      createdObjects1,\n      createdObjects2,\n      createdAbstracts1,\n      createdAbstracts2\n    );\n    let createdObjects = new Set();\n    createdObjects1.forEach(o => {\n      createdObjects.add(o);\n    });\n    createdObjects2.forEach(o => {\n      createdObjects.add(o);\n    });\n    let createdAbstracts = new Set();\n    createdAbstracts1.forEach(o => {\n      createdAbstracts.add(o);\n    });\n    createdAbstracts2.forEach(o => {\n      createdAbstracts.add(o);\n    });\n\n    return new Effects(c, generator, bindings, properties, createdObjects, createdAbstracts);\n  }\n\n  joinValuesOfSelectedCompletions(\n    selector: Completion => boolean,\n    completion: Completion,\n    keepInfeasiblePaths: boolean = false\n  ): Value {\n    let realm = completion.value.$Realm;\n    let bottom = realm.intrinsics.__bottomValue;\n    if (completion instanceof JoinedAbruptCompletions || completion instanceof JoinedNormalAndAbruptCompletions) {\n      let joinCondition = completion.joinCondition;\n      let c = this.joinValuesOfSelectedCompletions(selector, completion.consequent);\n      let a = this.joinValuesOfSelectedCompletions(selector, completion.alternate);\n      // do some simplification\n      if (c === bottom) {\n        // joinCondition will never be true when this completion is reached\n        if (a instanceof AbstractValue) {\n          a = Path.withInverseCondition(joinCondition, () => {\n            invariant(a instanceof AbstractValue);\n            return realm.simplifyAndRefineAbstractValue(a);\n          });\n        }\n        if (!keepInfeasiblePaths) return a;\n      } else if (a === bottom) {\n        // joinCondition will never be false when this completion is reached\n        if (c instanceof AbstractValue) {\n          c = Path.withCondition(joinCondition, () => {\n            invariant(c instanceof AbstractValue);\n            return realm.simplifyAndRefineAbstractValue(c);\n          });\n        }\n        if (!keepInfeasiblePaths) return c;\n      }\n      let getAbstractValue = (v1: void | Value, v2: void | Value): Value => {\n        if (v1 === bottom) v1 = realm.intrinsics.empty;\n        if (v2 === bottom) v2 = realm.intrinsics.empty;\n        return AbstractValue.createFromConditionalOp(realm, joinCondition, v1, v2);\n      };\n      let jv = this.joinValues(realm, c, a, getAbstractValue);\n      invariant(jv instanceof Value);\n      if (completion instanceof JoinedNormalAndAbruptCompletions && completion.composedWith !== undefined) {\n        let composedWith = completion.composedWith;\n        if (!composedWith.containsSelectedCompletion(selector)) return jv;\n        let cjv = this.joinValuesOfSelectedCompletions(selector, composedWith);\n        joinCondition = AbstractValue.createJoinConditionForSelectedCompletions(selector, composedWith);\n        jv = this.joinValues(realm, jv, cjv, getAbstractValue);\n        invariant(jv instanceof Value);\n      }\n      return jv;\n    }\n    if (selector(completion)) return completion.value;\n    return bottom;\n  }\n\n  // Creates a single map that joins together maps m1 and m2 using the given join\n  // operator. If an entry is present in one map but not the other, the missing\n  // entry is treated as if it were there and its value were undefined.\n  joinMaps<K, V>(m1: Map<K, V>, m2: Map<K, V>, join: (K, void | V, void | V) => V): Map<K, V> {\n    let m3: Map<K, V> = new Map();\n    m1.forEach((val1, key, map1) => {\n      let val2 = m2.get(key);\n      let val3 = join(key, val1, val2);\n      m3.set(key, val3);\n    });\n    m2.forEach((val2, key, map2) => {\n      if (!m1.has(key)) {\n        m3.set(key, join(key, undefined, val2));\n      }\n    });\n    return m3;\n  }\n\n  // Creates a single map that has an key, value pair for the union of the key\n  // sets of m1 and m2. The value of a pair is the join of m1[key] and m2[key]\n  // where the join is defined to be just m1[key] if m1[key] === m2[key] and\n  // and abstract value with expression \"joinCondition ? m1[key] : m2[key]\" if not.\n  _joinBindings(\n    joinCondition: AbstractValue,\n    g1: Generator,\n    m1: Bindings,\n    g2: Generator,\n    m2: Bindings\n  ): [Generator, Generator, Bindings] {\n    let realm = joinCondition.$Realm;\n    let getAbstractValue = (v1: void | Value, v2: void | Value) => {\n      return AbstractValue.createFromConditionalOp(realm, joinCondition, v1, v2, undefined, true, true);\n    };\n    let rewritten1 = false;\n    let rewritten2 = false;\n    let leak = (b: Binding, g: Generator, v: void | Value, rewritten: boolean) => {\n      // just like to what happens in leakBinding, we are going to append a\n      // binding-assignment generator entry; however, we play it safe and don't\n      // mutate the generator; instead, we create a new one that wraps around the old one.\n      if (!rewritten) {\n        let h = new Generator(realm, \"RewrittenToAppendBindingAssignments\", g.pathConditions);\n        if (!g.empty()) h.appendGenerator(g, \"\");\n        g = h;\n        rewritten = true;\n      }\n      if (v !== undefined && v !== realm.intrinsics.undefined) g.emitBindingAssignment(b, v);\n      return [g, rewritten];\n    };\n    let join = (b: Binding, b1: void | BindingEntry, b2: void | BindingEntry) => {\n      let l1 = b1 === undefined ? b.hasLeaked : b1.hasLeaked;\n      let l2 = b2 === undefined ? b.hasLeaked : b2.hasLeaked;\n      let v1 = b1 === undefined ? b.value : b1.value;\n      let v2 = b2 === undefined ? b.value : b2.value;\n      // ensure that if either none or both sides have leaked\n      // note that if one side didn't have a binding entry yet, then there's nothing to actively leak\n      if (!l1 && l2) [g1, rewritten1] = leak(b, g1, v1, rewritten1);\n      else if (l1 && !l2) [g2, rewritten2] = leak(b, g2, v2, rewritten2);\n      let hasLeaked = l1 || l2;\n      // For leaked (and mutable) bindings, the actual value is no longer directly available.\n      // In that case, we reset the value to realm.intrinsics.__leakedValue to prevent any use of the last known value.\n      let value = hasLeaked ? realm.intrinsics.__leakedValue : this.joinValues(realm, v1, v2, getAbstractValue);\n      invariant(value === undefined || value instanceof Value);\n      return { hasLeaked, value };\n    };\n    let joinedBindings = this.joinMaps(m1, m2, join);\n    return [g1, g2, joinedBindings];\n  }\n\n  // If v1 is known and defined and v1 === v2 return v1,\n  // otherwise return getAbstractValue(v1, v2)\n  joinValues(\n    realm: Realm,\n    v1: void | Value | Array<Value> | Array<{ $Key: void | Value, $Value: void | Value }>,\n    v2: void | Value | Array<Value> | Array<{ $Key: void | Value, $Value: void | Value }>,\n    getAbstractValue: (void | Value, void | Value) => Value\n  ): Value | Array<Value> | Array<{ $Key: void | Value, $Value: void | Value }> {\n    if (Array.isArray(v1) || Array.isArray(v2)) {\n      invariant(v1 === undefined || Array.isArray(v1));\n      invariant(v2 === undefined || Array.isArray(v2));\n      return joinArrays(realm, ((v1: any): void | Array<Value>), ((v2: any): void | Array<Value>), getAbstractValue);\n    }\n    invariant(v1 === undefined || v1 instanceof Value);\n    invariant(v2 === undefined || v2 instanceof Value);\n    if (\n      v1 !== undefined &&\n      v2 !== undefined &&\n      !(v1 instanceof AbstractValue) &&\n      !(v2 instanceof AbstractValue) &&\n      StrictEqualityComparison(realm, v1.throwIfNotConcrete(), v2.throwIfNotConcrete())\n    ) {\n      return v1;\n    } else {\n      return getAbstractValue(v1, v2);\n    }\n  }\n\n  joinPropertyBindings(\n    realm: Realm,\n    joinCondition: AbstractValue,\n    m1: PropertyBindings,\n    m2: PropertyBindings,\n    co1: CreatedObjects,\n    co2: CreatedObjects,\n    ca1: CreatedAbstracts,\n    ca2: CreatedAbstracts\n  ): PropertyBindings {\n    let join = (b: PropertyBinding, d1: void | Descriptor, d2: void | Descriptor) => {\n      // If the PropertyBinding object has been freshly allocated do not join\n      if (d1 === undefined) {\n        if (co2.has(b.object)) return d2; // no join\n        if (b.descriptor !== undefined && m1.has(b)) {\n          // property was deleted\n          d1 = cloneDescriptor(b.descriptor.throwIfNotConcrete(realm));\n          invariant(d1 !== undefined);\n          d1.value = realm.intrinsics.empty;\n        } else {\n          // no write to property\n          d1 = b.descriptor; //Get value of property before the split\n        }\n      }\n      if (d2 === undefined) {\n        if (co1.has(b.object)) return d1; // no join\n        if (b.descriptor !== undefined && m2.has(b)) {\n          // property was deleted\n          d2 = cloneDescriptor(b.descriptor.throwIfNotConcrete(realm));\n          invariant(d2 !== undefined);\n          d2.value = realm.intrinsics.empty;\n        } else {\n          // no write to property\n          d2 = b.descriptor; //Get value of property before the split\n        }\n      }\n      return this.joinDescriptors(realm, joinCondition, d1, d2);\n    };\n    return this.joinMaps(m1, m2, join);\n  }\n\n  joinDescriptors(\n    realm: Realm,\n    joinCondition: AbstractValue,\n    d1: void | Descriptor,\n    d2: void | Descriptor\n  ): void | Descriptor {\n    let getAbstractValue = (v1: void | Value, v2: void | Value) => {\n      return AbstractValue.createFromConditionalOp(realm, joinCondition, v1, v2);\n    };\n    let clone_with_abstract_value = (d: Descriptor) => {\n      invariant(d === d1 || d === d2);\n      if (!IsDataDescriptor(realm, d)) {\n        return new AbstractJoinedDescriptor(joinCondition);\n      }\n      let dc;\n      let dcValue;\n      if (d instanceof InternalSlotDescriptor) {\n        dc = new InternalSlotDescriptor(d.value);\n        dcValue = dc.value;\n        if (Array.isArray(dcValue)) {\n          invariant(dcValue.length > 0);\n          let elem0 = dcValue[0];\n          if (elem0 instanceof Value) {\n            dc.value = dcValue.map(e => {\n              return d === d1\n                ? getAbstractValue((e: any), realm.intrinsics.empty)\n                : getAbstractValue(realm.intrinsics.empty, (e: any));\n            });\n          } else {\n            dc.value = dcValue.map(e => {\n              let { $Key: key1, $Value: val1 } = (e: any);\n              let key3 =\n                d === d1\n                  ? getAbstractValue(key1, realm.intrinsics.empty)\n                  : getAbstractValue(realm.intrinsics.empty, key1);\n              let val3 =\n                d === d1\n                  ? getAbstractValue(val1, realm.intrinsics.empty)\n                  : getAbstractValue(realm.intrinsics.empty, val1);\n              return { $Key: key3, $Value: val3 };\n            });\n          }\n        }\n      } else {\n        dc = cloneDescriptor(d.throwIfNotConcrete(realm));\n        invariant(dc !== undefined);\n        dcValue = dc.value;\n      }\n      invariant(dcValue === undefined || dcValue instanceof Value);\n      dc.value =\n        d === d1\n          ? getAbstractValue(dcValue, realm.intrinsics.empty)\n          : getAbstractValue(realm.intrinsics.empty, dcValue);\n      return dc;\n    };\n    if (d1 === undefined) {\n      if (d2 === undefined) return undefined;\n      // d2 is a new property created in only one branch, join with empty\n      let d3 = clone_with_abstract_value(d2);\n      if (d3 instanceof AbstractJoinedDescriptor) d3.descriptor2 = d2;\n      return d3;\n    } else if (d2 === undefined) {\n      invariant(d1 !== undefined);\n      // d1 is a new property created in only one branch, join with empty\n      let d3 = clone_with_abstract_value(d1);\n      if (d3 instanceof AbstractJoinedDescriptor) d3.descriptor1 = d1;\n      return d3;\n    } else {\n      if (\n        d1 instanceof PropertyDescriptor &&\n        d2 instanceof PropertyDescriptor &&\n        equalDescriptors(d1, d2) &&\n        IsDataDescriptor(realm, d1)\n      ) {\n        let dc = cloneDescriptor(d1);\n        invariant(dc !== undefined);\n        let dcValue = this.joinValues(realm, d1.value, d2.value, getAbstractValue);\n        invariant(dcValue instanceof Value);\n        dc.value = dcValue;\n        return dc;\n      }\n      if (d1 instanceof InternalSlotDescriptor && d2 instanceof InternalSlotDescriptor) {\n        return new InternalSlotDescriptor(this.joinValues(realm, d1.value, d2.value, getAbstractValue));\n      }\n      return new AbstractJoinedDescriptor(joinCondition, d1, d2);\n    }\n  }\n\n  mapAndJoin(\n    realm: Realm,\n    values: Set<ConcreteValue>,\n    joinConditionFactory: ConcreteValue => Value,\n    functionToMap: ConcreteValue => Completion | Value\n  ): Value {\n    invariant(values.size > 1);\n    let joinedEffects;\n    for (let val of values) {\n      let condition = joinConditionFactory(val);\n      let effects = realm.evaluateForEffects(\n        () => {\n          invariant(condition instanceof AbstractValue);\n          return Path.withCondition(condition, () => {\n            return functionToMap(val);\n          });\n        },\n        undefined,\n        \"mapAndJoin\"\n      );\n      joinedEffects = joinedEffects === undefined ? effects : this.joinEffects(condition, effects, joinedEffects);\n    }\n    invariant(joinedEffects !== undefined);\n    realm.applyEffects(joinedEffects);\n    return realm.returnOrThrowCompletion(joinedEffects.result);\n  }\n}\n"
  },
  {
    "path": "src/methods/json.js",
    "content": "/**\n * Copyright (c) 2017-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n/* @flow strict-local */\n\nimport type { Realm } from \"../realm.js\";\nimport { Value, ObjectValue, NumberValue, UndefinedValue, StringValue } from \"../values/index.js\";\nimport { Create, To } from \"../singletons.js\";\nimport { Get } from \"./get.js\";\nimport { Call } from \"./call.js\";\nimport { IsArray } from \"./is.js\";\nimport { EnumerableOwnProperties } from \"./own.js\";\nimport type { PropertyKeyValue } from \"../types.js\";\nimport invariant from \"../invariant.js\";\n\n// ECMA262 24.3.1.1\nexport function InternalizeJSONProperty(\n  realm: Realm,\n  reviver: ObjectValue,\n  holder: ObjectValue,\n  name: PropertyKeyValue\n): Value {\n  // 1. Let val be ? Get(holder, name).\n  let val = Get(realm, holder, name);\n  // 2. If Type(val) is Object, then\n  if (val instanceof ObjectValue) {\n    // a. Let isArray be ? IsArray(val).\n    let isArray = IsArray(realm, val);\n\n    // b. If isArray is true, then\n    if (isArray === true) {\n      // i. Set I to 0.\n      let I = 0;\n\n      // ii. Let len be ? ToLength(? Get(val, \"length\")).\n      let len = To.ToLength(realm, Get(realm, val, \"length\"));\n\n      // iii. Repeat while I < len,\n      while (I < len) {\n        // 1. Let newElement be ? InternalizeJSONProperty(val, ! ToString(I)).\n        let newElement = InternalizeJSONProperty(realm, reviver, val, To.ToString(realm, new NumberValue(realm, I)));\n\n        // 2. If newElement is undefined, then\n        if (newElement instanceof UndefinedValue) {\n          // a. Perform ? val.[[Delete]](! ToString(I)).\n          val.$Delete(To.ToString(realm, new NumberValue(realm, I)));\n        } else {\n          // 3. Else,\n          // a. Perform ? CreateDataProperty(val, ! ToString(I), newElement).\n          Create.CreateDataProperty(\n            realm,\n            val,\n            To.ToString(realm, new NumberValue(realm, I)),\n            newElement.throwIfNotConcrete()\n          );\n\n          // b. NOTE This algorithm intentionally does not throw an exception if CreateDataProperty returns false.\n        }\n\n        // 4. Add 1 to I.\n        I += 1;\n      }\n    } else {\n      // c. Else,\n      // i. Let keys be ? EnumerableOwnProperties(val, \"key\").\n      let keys = EnumerableOwnProperties(realm, val, \"key\");\n\n      // ii. For each String P in keys do,\n      for (let P of keys) {\n        invariant(P instanceof StringValue);\n\n        // 1. Let newElement be ? InternalizeJSONProperty(val, P).\n        let newElement = InternalizeJSONProperty(realm, reviver, val, P);\n\n        // 2. If newElement is undefined, then\n        if (newElement instanceof UndefinedValue) {\n          // a. Perform ? val.[[Delete]](P).\n          val.$Delete(P);\n        } else {\n          // 3. Else,\n          // a. Perform ? CreateDataProperty(val, P, newElement).\n          Create.CreateDataProperty(realm, val, P, newElement);\n\n          // b. NOTE This algorithm intentionally does not throw an exception if CreateDataProperty returns false.\n        }\n      }\n    }\n  }\n\n  // 3. Return ? Call(reviver, holder, « name, val »).\n  return Call(realm, reviver, holder, [typeof name === \"string\" ? new StringValue(realm, name) : name, val]);\n}\n"
  },
  {
    "path": "src/methods/own.js",
    "content": "/**\n * Copyright (c) 2017-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n/* @flow */\n\nimport type { PropertyKeyValue } from \"../types.js\";\nimport type { Realm } from \"../realm.js\";\nimport { Get, IsArrayIndex } from \"./index.js\";\nimport { StringValue, ObjectValue, Value, ArrayValue } from \"../values/index.js\";\nimport { Create, Properties, To } from \"../singletons.js\";\n\nimport invariant from \"../invariant.js\";\n\n// ECMA262 19.1.2.8.1\nexport function GetOwnPropertyKeys(realm: Realm, O: Value, Type: Function): ArrayValue {\n  // 1. Let obj be ? ToObject(O).\n  let obj = To.ToObject(realm, O);\n\n  // 2. Let keys be ? obj.[[OwnPropertyKeys]]().\n  let keys = obj.$OwnPropertyKeys();\n\n  // 3. Let nameList be a new empty List.\n  let nameList = [];\n\n  // 4. Repeat for each element nextKey of keys in List order,\n  for (let nextKey of keys) {\n    // a. If Type(nextKey) is Type, then\n    if (nextKey instanceof Type) {\n      // i. Append nextKey as the last element of nameList.\n      nameList.push(nextKey);\n    }\n  }\n\n  // 1. Return CreateArrayFromList(nameList).\n  return Create.CreateArrayFromList(realm, nameList);\n}\n\n// ECMA262 9.1.11.1\nexport function OrdinaryOwnPropertyKeys(\n  realm: Realm,\n  o: ObjectValue,\n  getOwnPropertyKeysEvenIfPartial?: boolean = false\n): Array<PropertyKeyValue> {\n  // 1. Let keys be a new empty List.\n  let keys = [];\n\n  // 2. For each own property key P of O that is an integer index, in ascending numeric index order\n  let properties = Properties.GetOwnPropertyKeysArray(realm, o, false, getOwnPropertyKeysEvenIfPartial);\n  for (let key of properties\n    .filter(x => IsArrayIndex(realm, x))\n    .map(x => parseInt(x, 10))\n    .sort((x, y) => x - y)) {\n    // i. Add P as the last element of keys.\n    keys.push(new StringValue(realm, key + \"\"));\n  }\n\n  // 3. For each own property key P of O that is a String but is not an integer index, in ascending chronological order of property creation\n  for (let key of properties.filter(x => !IsArrayIndex(realm, x))) {\n    // i. Add P as the last element of keys.\n    keys.push(new StringValue(realm, key));\n  }\n\n  // 4. For each own property key P of O that is a Symbol, in ascending chronological order of property creation\n  for (let key of o.symbols.keys()) {\n    // i. Add P as the last element of keys.\n    keys.push(key);\n  }\n\n  // 5. Return keys.\n  return keys;\n}\n\n// ECMA262 7.3.21\nexport function EnumerableOwnProperties(\n  realm: Realm,\n  O: ObjectValue,\n  kind: string,\n  getOwnPropertyKeysEvenIfPartial?: boolean = false\n): Array<Value> {\n  // 1. Assert: Type(O) is Object.\n  invariant(O instanceof ObjectValue, \"expected object\");\n\n  // 2. Let ownKeys be ? O.[[OwnPropertyKeys]]().\n  let ownKeys = O.$OwnPropertyKeys(getOwnPropertyKeysEvenIfPartial);\n\n  // 3. Let properties be a new empty List.\n  let properties = [];\n\n  // 4. Repeat, for each element key of ownKeys in List order\n  for (let key of ownKeys) {\n    // a. If Type(key) is String, then\n    if (key instanceof StringValue) {\n      // i. Let desc be ? O.[[GetOwnProperty]](key).\n      let desc = O.$GetOwnProperty(key);\n\n      // ii. If desc is not undefined and desc.[[Enumerable]] is true, then\n      if (desc && desc.throwIfNotConcrete(realm).enumerable) {\n        Properties.ThrowIfMightHaveBeenDeleted(desc);\n\n        // 1. If kind is \"key\", append key to properties.\n        if (kind === \"key\") {\n          properties.push(key);\n        } else {\n          // 2. Else,\n          // a. Let value be ? Get(O, key).\n          let value = Get(realm, O, key);\n\n          // b. If kind is \"value\", append value to properties.\n          if (kind === \"value\") {\n            properties.push(value);\n          } else {\n            // c. Else,\n            // i. Assert: kind is \"key+value\".\n            invariant(kind === \"key+value\", \"expected kind to be key+value\");\n\n            // ii. Let entry be CreateArrayFromList(« key, value »).\n            let entry = Create.CreateArrayFromList(realm, [key, value]);\n\n            // iii. Append entry to properties.\n            properties.push(entry);\n          }\n        }\n      }\n    }\n  }\n\n  // 5. Order the elements of properties so they are in the same relative order as would be produced by the Iterator that would be returned if the EnumerateObjectProperties internal method was invoked with O.\n\n  // 6. Return properties.\n  return properties;\n}\n"
  },
  {
    "path": "src/methods/promise.js",
    "content": "/**\n * Copyright (c) 2017-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n/* @flow */\n\nimport type { Realm } from \"../realm.js\";\nimport type { ResolvingFunctions, PromiseCapability, PromiseReaction } from \"../types.js\";\nimport { AbruptCompletion } from \"../completions.js\";\nimport {\n  Value,\n  ObjectValue,\n  StringValue,\n  NativeFunctionValue,\n  FunctionValue,\n  type UndefinedValue,\n} from \"../values/index.js\";\nimport { SameValue } from \"./abstract.js\";\nimport { Construct } from \"./construct.js\";\nimport { Get } from \"./get.js\";\nimport { Invoke, Call } from \"./call.js\";\nimport { IsCallable, IsConstructor, IsPromise } from \"./is.js\";\nimport { IteratorStep, IteratorValue } from \"./iterator.js\";\nimport { Create, Properties } from \"../singletons.js\";\nimport invariant from \"../invariant.js\";\n\n// ECMA262 8.4.1\nexport function EnqueueJob(realm: Realm, queueName: string, job: Function, args: Array<any>): void {}\n\n// ECMA262 25.4.1.5\nexport function NewPromiseCapability(realm: Realm, C: Value): PromiseCapability {\n  // 1. If IsConstructor(C) is false, throw a TypeError exception.\n  if (IsConstructor(realm, C) === false) {\n    throw realm.createErrorThrowCompletion(realm.intrinsics.TypeError, \"IsConstructor(C) is false\");\n  }\n  invariant(C instanceof ObjectValue);\n\n  // 2. NOTE C is assumed to be a constructor function that supports the parameter conventions of the Promise constructor (see 25.4.3.1).\n\n  // 3. Let promiseCapability be a new PromiseCapability { [[Promise]]: undefined, [[Resolve]]: undefined, [[Reject]]: undefined }.\n  let promiseCapability = {\n    promise: realm.intrinsics.undefined,\n    resolve: realm.intrinsics.undefined,\n    reject: realm.intrinsics.undefined,\n  };\n\n  // 4. Let executor be a new built-in function object as defined in GetCapabilitiesExecutor Functions (25.4.1.5.1).\n  let executor = new NativeFunctionValue(\n    realm,\n    undefined,\n    undefined,\n    2,\n    (context, [resolve, reject]) => {\n      // 1. Assert: F has a [[Capability]] internal slot whose value is a PromiseCapability Record.\n      invariant(executor.$Capability, \"F has a [[Capability]] internal slot whose value is a PromiseCapability Record\");\n\n      // 2. Let promiseCapability be the value of F's [[Capability]] internal slot.\n      invariant(promiseCapability === executor.$Capability);\n\n      // 3. If promiseCapability.[[Resolve]] is not undefined, throw a TypeError exception.\n      if (!promiseCapability.resolve.mightBeUndefined()) {\n        throw realm.createErrorThrowCompletion(\n          realm.intrinsics.TypeError,\n          \"promiseCapability.[[Resolve]] is not undefined\"\n        );\n      }\n      promiseCapability.resolve.throwIfNotConcrete();\n\n      // 4. If promiseCapability.[[Reject]] is not undefined, throw a TypeError exception.\n      if (!promiseCapability.reject.mightBeUndefined()) {\n        throw realm.createErrorThrowCompletion(\n          realm.intrinsics.TypeError,\n          \"promiseCapability.[[Reject]] is not undefined\"\n        );\n      }\n      promiseCapability.reject.throwIfNotConcrete();\n\n      // 5. Set promiseCapability.[[Resolve]] to resolve.\n      promiseCapability.resolve = resolve;\n\n      // 6. Set promiseCapability.[[Reject]] to reject.\n      promiseCapability.reject = reject;\n\n      // 7. Return undefined.\n      return realm.intrinsics.undefined;\n    },\n    false\n  );\n\n  // 5. Set the [[Capability]] internal slot of executor to promiseCapability.\n  executor.$Capability = promiseCapability;\n\n  // 6. Let promise be ? Construct(C, « executor »).\n  let promise = Construct(realm, C, [executor]).throwIfNotConcreteObject();\n\n  // 7. If IsCallable(promiseCapability.[[Resolve]]) is false, throw a TypeError exception.\n  if (IsCallable(realm, promiseCapability.resolve) === false) {\n    throw realm.createErrorThrowCompletion(\n      realm.intrinsics.TypeError,\n      \"IsCallable(promiseCapability.[[Resolve]]) is false\"\n    );\n  }\n\n  // 8. If IsCallable(promiseCapability.[[Reject]]) is false, throw a TypeError exception.\n  if (IsCallable(realm, promiseCapability.reject) === false) {\n    throw realm.createErrorThrowCompletion(\n      realm.intrinsics.TypeError,\n      \"IsCallable(promiseCapability.[[Reject]]) is false\"\n    );\n  }\n\n  // 9. Set promiseCapability.[[Promise]] to promise.\n  promiseCapability.promise = promise;\n\n  // 10. Return promiseCapability.\n  return promiseCapability;\n}\n\n// ECMA262 25.4.4.1.1j\nfunction createResolveElementFunction(realm) {\n  let resolveElement = new NativeFunctionValue(\n    realm,\n    undefined,\n    undefined,\n    1,\n    (context, [x]) => {\n      // 1. Let alreadyCalled be the value of F's [[AlreadyCalled]] internal slot.\n      let alreadyCalled = resolveElement.$AlreadyCalled;\n      invariant(alreadyCalled);\n\n      // 2. If alreadyCalled.[[Value]] is true, return undefined.\n      if (alreadyCalled.value === true) {\n        return realm.intrinsics.undefined;\n      }\n\n      // 3. Set alreadyCalled.[[Value]] to true.\n      alreadyCalled.value = true;\n\n      // 4. Let index be the value of F's [[Index]] internal slot.\n      let myIndex = resolveElement.$Index;\n      invariant(typeof myIndex === \"number\");\n\n      // 5. Let values be the value of F's [[Values]] internal slot.\n      let values = resolveElement.$Values;\n      invariant(values instanceof Array);\n\n      // 6. Let promiseCapability be the value of F's [[Capabilities]] internal slot.\n      let promiseCapability = resolveElement.$Capabilities;\n      invariant(promiseCapability);\n\n      // 7. Let remainingElementsCount be the value of F's [[RemainingElements]] internal slot.\n      let remainingElementsCount = resolveElement.$RemainingElements;\n      invariant(remainingElementsCount);\n\n      // 8. Set values[index] to x.\n      values[myIndex] = x;\n\n      // 9. Set remainingElementsCount.[[Value]] to remainingElementsCount.[[Value]] - 1.\n      remainingElementsCount.value = remainingElementsCount.value - 1;\n\n      // 10. If remainingElementsCount.[[Value]] is 0, then\n      if (remainingElementsCount.value === 0) {\n        // a. Let valuesArray be CreateArrayFromList(values).\n        let valuesArray = Create.CreateArrayFromList(realm, values);\n\n        // b. Return ? Call(promiseCapability.[[Resolve]], undefined, « valuesArray »).\n        Call(realm, promiseCapability.resolve, realm.intrinsics.undefined, [valuesArray]);\n      }\n\n      // 11. Return undefined.\n      return realm.intrinsics.undefined;\n    },\n    false\n  );\n  return resolveElement;\n}\n\n// ECMA262 25.4.4.1.1\nexport function PerformPromiseAll(\n  realm: Realm,\n  iteratorRecord: { $Iterator: ObjectValue, $Done: boolean },\n  constructor: FunctionValue,\n  resultCapability: PromiseCapability\n): Value {\n  // 1. Assert: constructor is a constructor function.\n  invariant(\n    constructor instanceof FunctionValue && IsConstructor(realm, constructor),\n    \"constructor is a constructor function\"\n  );\n\n  // 2. Assert: resultCapability is a PromiseCapability record.\n  resultCapability;\n\n  // 3. Let values be a new empty List.\n  let values = [];\n\n  // 4. Let remainingElementsCount be a new Record { [[Value]]: 1 }.\n  let remainingElementsCount = { value: 1 };\n\n  // 5. Let index be 0.\n  let index = 0;\n\n  // 6. Repeat\n  while (true) {\n    // a. Let next be IteratorStep(iteratorRecord.[[Iterator]]).\n    let next;\n    try {\n      next = IteratorStep(realm, iteratorRecord.$Iterator);\n    } catch (e) {\n      if (e instanceof AbruptCompletion) {\n        // b. If next is an abrupt completion, set iteratorRecord.[[Done]] to true.\n        iteratorRecord.$Done = true;\n      }\n\n      // c. ReturnIfAbrupt(next).\n      throw e;\n    }\n\n    // d. If next is false, then\n    if (next === false) {\n      // i. Set iteratorRecord.[[Done]] to true.\n      iteratorRecord.$Done = true;\n\n      // ii. Set remainingElementsCount.[[Value]] to remainingElementsCount.[[Value]] - 1.\n      remainingElementsCount.value = remainingElementsCount.value - 1;\n\n      // iii. If remainingElementsCount.[[Value]] is 0, then\n      if (remainingElementsCount.value === 0) {\n        // 1. Let valuesArray be CreateArrayFromList(values).\n        let valuesArray = Create.CreateArrayFromList(realm, values);\n\n        // 2. Perform ? Call(resultCapability.[[Resolve]], undefined, « valuesArray »).\n        Call(realm, resultCapability.resolve, realm.intrinsics.undefined, [valuesArray]);\n      }\n\n      // iv. Return resultCapability.[[Promise]].\n      return resultCapability.promise;\n    }\n\n    // e. Let nextValue be IteratorValue(next).\n    let nextValue;\n    try {\n      nextValue = IteratorValue(realm, next);\n    } catch (e) {\n      if (e instanceof AbruptCompletion) {\n        // f. If nextValue is an abrupt completion, set iteratorRecord.[[Done]] to true.\n        iteratorRecord.$Done = true;\n      }\n\n      // g. ReturnIfAbrupt(nextValue).\n      throw e;\n    }\n\n    // h. Append undefined to values.\n    values.push(realm.intrinsics.undefined);\n\n    // i. Let nextPromise be ? Invoke(constructor, \"resolve\", « nextValue »).\n    let nextPromise = Invoke(realm, constructor, \"resolve\", [nextValue]);\n\n    // j. Let resolveElement be a new built-in function object as defined in Promise.all Resolve Element Functions.\n    let resolveElement = createResolveElementFunction(realm);\n\n    // k. Set the [[AlreadyCalled]] internal slot of resolveElement to a new Record {[[Value]]: false }.\n    resolveElement.$AlreadyCalled = { value: false };\n\n    // l. Set the [[Index]] internal slot of resolveElement to index.\n    resolveElement.$Index = index;\n\n    // m. Set the [[Values]] internal slot of resolveElement to values.\n    resolveElement.$Values = values;\n\n    // n. Set the [[Capabilities]] internal slot of resolveElement to resultCapability.\n    resolveElement.$Capabilities = resultCapability;\n\n    // o. Set the [[RemainingElements]] internal slot of resolveElement to remainingElementsCount.\n    resolveElement.$RemainingElements = remainingElementsCount;\n\n    // p. Set remainingElementsCount.[[Value]] to remainingElementsCount.[[Value]] + 1.\n    remainingElementsCount.value = remainingElementsCount.value + 1;\n\n    // q. Perform ? Invoke(nextPromise, \"then\", « resolveElement, resultCapability.[[Reject]] »).\n    Invoke(realm, nextPromise, \"then\", [resolveElement, resultCapability.reject]);\n\n    // r. Set index to index + 1.\n    index = index + 1;\n  }\n  invariant(false);\n}\n\n// ECMA262 25.4.4.3.1\nexport function PerformPromiseRace(\n  realm: Realm,\n  iteratorRecord: { $Iterator: ObjectValue, $Done: boolean },\n  resultCapability: PromiseCapability,\n  C: ObjectValue\n): ObjectValue {\n  // 1. Assert: constructor is a constructor function.\n  invariant(IsConstructor(realm, C), \"constructor is a constructor function\");\n\n  // 2. Assert: resultCapability is a PromiseCapability Record.\n  resultCapability;\n\n  // 3. Repeat\n  while (true) {\n    // a. Let next be IteratorStep(iteratorRecord.[[Iterator]]).\n    let next;\n    try {\n      next = IteratorStep(realm, iteratorRecord.$Iterator);\n    } catch (e) {\n      if (e instanceof AbruptCompletion) {\n        // b. If next is an abrupt completion, set iteratorRecord.[[Done]] to true.\n        iteratorRecord.$Done = true;\n      }\n\n      // c. ReturnIfAbrupt(next).\n      throw e;\n    }\n\n    // d. If next is false, then\n    if (next === false) {\n      // i. Set iteratorRecord.[[Done]] to true.\n      iteratorRecord.$Done = true;\n\n      // ii. Return resultCapability.[[Promise]].\n      invariant(resultCapability.promise instanceof ObjectValue);\n      return resultCapability.promise;\n    }\n\n    // e. Let nextValue be IteratorValue(next).\n    let nextValue;\n    try {\n      nextValue = IteratorValue(realm, next);\n    } catch (e) {\n      if (e instanceof AbruptCompletion) {\n        // f. If nextValue is an abrupt completion, set iteratorRecord.[[Done]] to true.\n        iteratorRecord.$Done = true;\n      }\n\n      // g. ReturnIfAbrupt(nextValue).\n      throw e;\n    }\n\n    // h. Let nextPromise be ? Invoke(C, \"resolve\", « nextValue »).\n    let nextPromise = Invoke(realm, C, \"resolve\", [nextValue]);\n\n    // i. Perform ? Invoke(nextPromise, \"then\", « resultCapability.[[Resolve]], resultCapability.[[Reject]] »).\n    Invoke(realm, nextPromise, \"then\", [resultCapability.resolve, resultCapability.reject]);\n  }\n  invariant(false);\n}\n\n// ECMA262 25.4.5.3.1\nexport function PerformPromiseThen(\n  realm: Realm,\n  promise: ObjectValue,\n  onFulfilled: Value,\n  onRejected: Value,\n  resultCapability: PromiseCapability\n): ObjectValue {\n  // 1. Assert: IsPromise(promise) is true.\n  invariant(IsPromise(realm, promise), \"IsPromise(promise) is true\");\n\n  // 2. Assert: resultCapability is a PromiseCapability record.\n  resultCapability;\n\n  // 3. If IsCallable(onFulfilled) is false, then\n  if (IsCallable(realm, onFulfilled) === false) {\n    // a. Let onFulfilled be \"Identity\".\n    onFulfilled = new StringValue(realm, \"Identity\");\n  }\n\n  // 4. If IsCallable(onRejected) is false, then\n  if (IsCallable(realm, onRejected)) {\n    // a. Let onRejected be \"Thrower\".\n    onRejected = new StringValue(realm, \"Thrower\");\n  }\n\n  // 5. Let fulfillReaction be the PromiseReaction { [[Capabilities]]: resultCapability, [[Handler]]: onFulfilled }.\n  let fulfillReaction = { capabilities: resultCapability, handler: onFulfilled };\n\n  // 6. Let rejectReaction be the PromiseReaction { [[Capabilities]]: resultCapability, [[Handler]]: onRejected}.\n  let rejectReaction = { capabilities: resultCapability, handler: onRejected };\n\n  // 7. If the value of promise's [[PromiseState]] internal slot is \"pending\", then\n  if (promise.$PromiseState === \"pending\") {\n    // a. Append fulfillReaction as the last element of the List that is the value of promise's [[PromiseFulfillReactions]] internal slot.\n    Properties.ThrowIfInternalSlotNotWritable(realm, promise, \"$PromiseFulfillReactions\");\n    invariant(promise.$PromiseFulfillReactions);\n    promise.$PromiseFulfillReactions.push(fulfillReaction);\n    // b. Append rejectReaction as the last element of the List that is the value of promise's [[PromiseRejectReactions]] internal slot.\n    Properties.ThrowIfInternalSlotNotWritable(realm, promise, \"$PromiseRejectReactions\");\n    invariant(promise.$PromiseRejectReactions);\n    promise.$PromiseRejectReactions.push(rejectReaction);\n  } else if (promise.$PromiseState === \"fulfilled\") {\n    // 8. Else if the value of promise's [[PromiseState]] internal slot is \"fulfilled\", then\n    // a. Let value be the value of promise's [[PromiseResult]] internal slot.\n    let value = promise.$PromiseResult;\n    // b. Perform EnqueueJob(\"PromiseJobs\", PromiseReactionJob, « fulfillReaction, value »).\n    EnqueueJob(realm, \"PromiseJobs\", PromiseReactionJob, [fulfillReaction, value]);\n  } else {\n    // 9. Else,\n    // a. Assert: The value of promise's [[PromiseState]] internal slot is \"rejected\".\n    invariant(promise.$PromiseState === \"rejected\");\n\n    // b. Let reason be the value of promise's [[PromiseResult]] internal slot.\n    let reason = promise.$PromiseResult;\n\n    // c. If the value of promise's [[PromiseIsHandled]] internal slot is false, perform HostPromiseRejectionTracker(promise, \"handle\").\n    if (promise.$PromiseIsHandled === false) HostPromiseRejectionTracker(realm, promise, \"handle\");\n\n    // d. Perform EnqueueJob(\"PromiseJobs\", PromiseReactionJob, « rejectReaction, reason »).\n    EnqueueJob(realm, \"PromiseJobs\", PromiseReactionJob, [rejectReaction, reason]);\n  }\n\n  // 10. Set promise's [[PromiseIsHandled]] internal slot to true.\n  Properties.ThrowIfInternalSlotNotWritable(realm, promise, \"$PromiseIsHandled\").$PromiseIsHandled = true;\n\n  // 11. Return resultCapability.[[Promise]].\n  invariant(resultCapability.promise instanceof ObjectValue);\n  return resultCapability.promise;\n}\n\n// ECMA262 25.4.2.1\nexport function PromiseReactionJob(realm: Realm, reaction: Function, argument: Value): Value {\n  return realm.intrinsics.undefined;\n}\n\n// ECMA262 25.4.1.3.2\nfunction createResolveFunction(realm) {\n  // 2. Let resolve be a new built-in function object as defined in Promise Resolve Functions (25.4.1.3.2).\n  let resolve = new NativeFunctionValue(\n    realm,\n    undefined,\n    undefined,\n    1,\n    (context, [resolution]) => {\n      // 1. Assert: F has a [[Promise]] internal slot whose value is an Object.\n      invariant(resolve.$Promise instanceof ObjectValue, \"F has a [[Promise]] internal slot whose value is an Object\");\n\n      // 2. Let promise be the value of F's [[Promise]] internal slot.\n      let promise = resolve.$Promise;\n\n      // 3. Let alreadyResolved be the value of F's [[AlreadyResolved]] internal slot.\n      let alreadyResolved = resolve.$AlreadyResolved;\n      invariant(alreadyResolved !== undefined);\n\n      // 4. If alreadyResolved.[[Value]] is true, return undefined.\n      if (alreadyResolved.value === true) return realm.intrinsics.undefined;\n\n      // 5. Set alreadyResolved.[[Value]] to true.\n      alreadyResolved.value = true;\n\n      // 6. If SameValue(resolution, promise) is true, then\n      if (SameValue(realm, resolution.throwIfNotConcrete(), promise)) {\n        // a. Let selfResolutionError be a newly created TypeError object.\n        let selfResolutionError = Construct(realm, realm.intrinsics.TypeError, [new StringValue(realm, \"resolve\")]);\n\n        // b. Return RejectPromise(promise, selfResolutionError).\n        return RejectPromise(realm, promise, selfResolutionError);\n      }\n      // 7. If Type(resolution) is not Object, then\n      if (!(resolution instanceof ObjectValue)) {\n        // a. Return FulfillPromise(promise, resolution).\n        return FulfillPromise(realm, promise, resolution);\n      }\n\n      // 8. Let then be Get(resolution, \"then\").\n      let then;\n      try {\n        then = Get(realm, resolution, \"then\");\n      } catch (e) {\n        // 9. If then is an abrupt completion, then\n        if (e instanceof AbruptCompletion) {\n          // a. Return RejectPromise(promise, then.[[Value]]).\n          return RejectPromise(realm, promise, e);\n        } else throw e;\n      }\n\n      // 10. Let thenAction be then.[[Value]].\n      let thenAction = then;\n\n      // 11. If IsCallable(thenAction) is false, then\n      if (IsCallable(realm, thenAction)) {\n        // a. Return FulfillPromise(promise, resolution).\n        return FulfillPromise(realm, promise, resolution);\n      }\n\n      // 12. Perform EnqueueJob(\"PromiseJobs\", PromiseResolveThenableJob, « promise, resolution, thenAction »).\n      EnqueueJob(realm, \"PromiseJobs\", PromiseResolveThenableJob, [promise, resolution, thenAction]);\n\n      // 13. Return undefined.\n      return realm.intrinsics.undefined;\n    },\n    false\n  );\n  return resolve;\n}\n\n// ECMA262 25.4.1.3.1\nfunction createRejectFunction(realm) {\n  // 5. Let reject be a new built-in function object as defined in Promise Reject Functions (25.4.1.3.1).\n  let reject = new NativeFunctionValue(\n    realm,\n    undefined,\n    undefined,\n    1,\n    (context, [reason]) => {\n      // 1. Assert: F has a [[Promise]] internal slot whose value is an Object.\n      invariant(reject.$Promise instanceof ObjectValue, \"F has a [[Promise]] internal slot whose value is an Object\");\n\n      // 2. Let promise be the value of F's [[Promise]] internal slot.\n      let promise = reject.$Promise;\n\n      // 3. Let alreadyResolved be the value of F's [[AlreadyResolved]] internal slot.\n      let alreadyResolved = reject.$AlreadyResolved;\n      invariant(alreadyResolved !== undefined);\n\n      // 4. If alreadyResolved.[[Value]] is true, return undefined.\n      if (alreadyResolved.value === true) return realm.intrinsics.undefined;\n\n      // 5. Set alreadyResolved.[[Value]] to true.\n      alreadyResolved.value = true;\n\n      // 6. Return RejectPromise(promise, reason).\n      return RejectPromise(realm, promise, reason);\n    },\n    false\n  );\n  return reject;\n}\n\n// ECMA262 25.4.1.3\nexport function CreateResolvingFunctions(realm: Realm, promise: ObjectValue): ResolvingFunctions {\n  // 1. Let alreadyResolved be a new Record { [[Value]]: false }.\n  let alreadyResolved = { value: false };\n\n  // 2. Let resolve be a new built-in function object as defined in Promise Resolve Functions (25.4.1.3.2).\n  let resolve = createResolveFunction(realm);\n\n  // 3. Set the [[Promise]] internal slot of resolve to promise.\n  resolve.$Promise = promise;\n\n  // 4. Set the [[AlreadyResolved]] internal slot of resolve to alreadyResolved.\n  resolve.$AlreadyResolved = alreadyResolved;\n\n  // 5. Let reject be a new built-in function object as defined in Promise Reject Functions (25.4.1.3.1).\n  let reject = createRejectFunction(realm);\n\n  // 6. Set the [[Promise]] internal slot of reject to promise.\n  reject.$Promise = promise;\n\n  // 7. Set the [[AlreadyResolved]] internal slot of reject to alreadyResolved.\n  reject.$AlreadyResolved = alreadyResolved;\n\n  // 8. Return a new Record { [[Resolve]]: resolve, [[Reject]]: reject }.\n  return { resolve: resolve, reject: reject };\n}\n\n// ECMA262 25.4.1.4\nexport function FulfillPromise(realm: Realm, promise: ObjectValue, value: Value): Value {\n  // 1. Assert: The value of promise.[[PromiseState]] is \"pending\".\n  invariant(promise.$PromiseState === \"pending\");\n\n  // 2. Let reactions be promise.[[PromiseFulfillReactions]].\n  let reactions = promise.$PromiseFulfillReactions;\n  invariant(reactions);\n\n  // 3. Set promise.[[PromiseResult]] to value.\n  Properties.ThrowIfInternalSlotNotWritable(realm, promise, \"$PromiseResult\").$PromiseResult = value;\n\n  // 4. Set promise.[[PromiseFulfillReactions]] to undefined.\n  Properties.ThrowIfInternalSlotNotWritable(\n    realm,\n    promise,\n    \"$PromiseFulfillReactions\"\n  ).$PromiseFulfillReactions = undefined;\n\n  // 5. Set promise.[[PromiseRejectReactions]] to undefined.\n  Properties.ThrowIfInternalSlotNotWritable(\n    realm,\n    promise,\n    \"$PromiseRejectReactions\"\n  ).$PromiseRejectReactions = undefined;\n\n  // 6. Set promise.[[PromiseState]] to \"fulfilled\".\n  Properties.ThrowIfInternalSlotNotWritable(realm, promise, \"$PromiseState\").$PromiseState = \"fulfilled\";\n\n  // 7. Return TriggerPromiseReactions(reactions, value).\n  return TriggerPromiseReactions(realm, reactions, value);\n}\n\n// ECMA262 25.4.1.7\nexport function RejectPromise(realm: Realm, promise: ObjectValue, reason: Value): Value {\n  // 1. Assert: The value of promise.[[PromiseState]] is \"pending\".\n  invariant(promise.$PromiseState === \"pending\");\n\n  // 2. Let reactions be promise.[[PromiseRejectReactions]].\n  let reactions = promise.$PromiseFulfillReactions;\n  invariant(reactions);\n\n  // 3. Set promise.[[PromiseResult]] to reason.\n  Properties.ThrowIfInternalSlotNotWritable(realm, promise, \"$PromiseResult\").$PromiseResult = reason;\n\n  // 4. Set promise.[[PromiseFulfillReactions]] to undefined.\n  Properties.ThrowIfInternalSlotNotWritable(\n    realm,\n    promise,\n    \"$PromiseFulfillReactions\"\n  ).$PromiseFulfillReactions = undefined;\n\n  // 5. Set promise.[[PromiseRejectReactions]] to undefined.\n  Properties.ThrowIfInternalSlotNotWritable(\n    realm,\n    promise,\n    \"$PromiseRejectReactions\"\n  ).$PromiseRejectReactions = undefined;\n\n  // 6. Set promise.[[PromiseState]] to \"rejected\".\n  Properties.ThrowIfInternalSlotNotWritable(realm, promise, \"$PromiseState\").$PromiseState = \"rejected\";\n\n  // 7. If promise.[[PromiseIsHandled]] is false, perform HostPromiseRejectionTracker(promise, \"reject\").\n  if (promise.$PromiseIsHandled === false) HostPromiseRejectionTracker(realm, promise, \"reject\");\n\n  // 8. Return TriggerPromiseReactions(reactions, reason).\n  return TriggerPromiseReactions(realm, reactions, reason);\n}\n\n// ECMA262 25.4.1.8\nexport function TriggerPromiseReactions(\n  realm: Realm,\n  reactions: Array<PromiseReaction>,\n  argument: Value\n): UndefinedValue {\n  // 1. Repeat for each reaction in reactions, in original insertion order\n  for (let reaction of reactions) {\n    // a. Perform EnqueueJob(\"PromiseJobs\", PromiseReactionJob, « reaction, argument »).\n    EnqueueJob(realm, \"PromiseJobs\", PromiseReactionJob, [reaction, argument]);\n  }\n  // 2. Return undefined.\n  return realm.intrinsics.undefined;\n}\n\n// ECMA262 25.4.1.9\nexport function HostPromiseRejectionTracker(realm: Realm, promise: ObjectValue, operation: \"reject\" | \"handle\"): void {}\n\n// ECMA262 25.4.2.2\nexport function PromiseResolveThenableJob(\n  realm: Realm,\n  promiseToResolve: ObjectValue,\n  thenable: Value,\n  then: Value\n): void {}\n"
  },
  {
    "path": "src/methods/properties.js",
    "content": "/**\n * Copyright (c) 2017-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n/* @flow */\n\nimport { construct_empty_effects, type Realm, Effects } from \"../realm.js\";\nimport type { Descriptor, PropertyBinding, PropertyKeyValue } from \"../types.js\";\nimport {\n  AbstractObjectValue,\n  AbstractValue,\n  ArrayValue,\n  BooleanValue,\n  ConcreteValue,\n  NullValue,\n  NumberValue,\n  ObjectValue,\n  StringValue,\n  SymbolValue,\n  UndefinedValue,\n  PrimitiveValue,\n  Value,\n} from \"../values/index.js\";\nimport { EvalPropertyName } from \"../evaluators/ObjectExpression.js\";\nimport { EnvironmentRecord, Reference } from \"../environment.js\";\nimport { CompilerDiagnostic, FatalError } from \"../errors.js\";\nimport invariant from \"../invariant.js\";\nimport {\n  Call,\n  Get,\n  GetGlobalObject,\n  GetThisValue,\n  HasCompatibleType,\n  HasSomeCompatibleType,\n  IsAccessorDescriptor,\n  IsDataDescriptor,\n  IsGenericDescriptor,\n  IsPropertyKey,\n  MakeConstructor,\n  SameValue,\n  SameValuePartial,\n} from \"./index.js\";\nimport { type BabelNodeObjectMethod, type BabelNodeClassMethod, isValidIdentifier } from \"@babel/types\";\nimport type { LexicalEnvironment } from \"../environment.js\";\nimport { Create, Environment, Functions, Leak, Join, Path, To } from \"../singletons.js\";\nimport IsStrict from \"../utils/strict.js\";\nimport { createOperationDescriptor } from \"../utils/generator.js\";\nimport { TypesDomain, ValuesDomain } from \"../domains/index.js\";\nimport { cloneDescriptor, equalDescriptors, PropertyDescriptor, AbstractJoinedDescriptor } from \"../descriptors.js\";\n\nfunction StringKey(key: PropertyKeyValue): string {\n  if (key instanceof StringValue) key = key.value;\n  if (typeof key !== \"string\") {\n    // The generator currently only supports string keys.\n    throw new FatalError();\n  }\n  return key;\n}\n\nfunction InternalDescriptorPropertyToValue(realm: Realm, value: void | boolean | Value) {\n  if (value === undefined) return realm.intrinsics.undefined;\n  if (typeof value === \"boolean\") return new BooleanValue(realm, value);\n  invariant(value instanceof Value);\n  return value;\n}\n\nfunction InternalGetPropertiesKey(P: PropertyKeyValue): string | SymbolValue | void {\n  if (typeof P === \"string\") {\n    return P;\n  } else if (P instanceof StringValue) {\n    return P.value;\n  } else if (P instanceof SymbolValue) {\n    return P;\n  }\n  // otherwise, undefined\n}\n\nfunction InternalGetPropertiesMap(O: ObjectValue, P: PropertyKeyValue): Map<any, PropertyBinding> {\n  if (typeof P === \"string\" || P instanceof StringValue) {\n    return O.properties;\n  } else if (P instanceof SymbolValue) {\n    return O.symbols;\n  } else {\n    invariant(false);\n  }\n}\n\nfunction InternalSetProperty(realm: Realm, O: ObjectValue, P: PropertyKeyValue, desc: Descriptor) {\n  let map = InternalGetPropertiesMap(O, P);\n  let key = InternalGetPropertiesKey(P);\n  let propertyBinding = map.get(key);\n  if (propertyBinding === undefined) {\n    propertyBinding = { descriptor: undefined, object: O, key: key };\n    map.set(key, propertyBinding);\n  }\n  realm.recordModifiedProperty(propertyBinding);\n  propertyBinding.descriptor = desc;\n}\n\nfunction InternalUpdatedProperty(realm: Realm, O: ObjectValue, P: PropertyKeyValue, oldDesc?: Descriptor) {\n  let generator = realm.generator;\n  if (!generator) return;\n  if (!O.isIntrinsic() && O.temporalAlias === undefined) return;\n  if (P instanceof SymbolValue) return;\n  if (P instanceof StringValue) P = P.value;\n  invariant(!O.mightBeLeakedObject()); // leaked objects are never updated\n  invariant(!O.mightBeFinalObject()); // final objects are never updated\n  invariant(typeof P === \"string\");\n  let propertyBinding = InternalGetPropertiesMap(O, P).get(P);\n  invariant(propertyBinding !== undefined); // The callers ensure this\n  let desc = propertyBinding.descriptor;\n  if (desc === undefined) {\n    // The property is being deleted\n    if (O === realm.$GlobalObject) {\n      generator.emitGlobalDelete(P);\n    } else {\n      generator.emitPropertyDelete(O, P);\n    }\n  } else {\n    desc = desc.throwIfNotConcrete(realm);\n    if (oldDesc === undefined) {\n      // The property is being created\n      if (O === realm.$GlobalObject) {\n        if (IsDataDescriptor(realm, desc)) {\n          let descValue = desc.value || realm.intrinsics.undefined;\n          if (isValidIdentifier(P) && !desc.configurable && desc.enumerable && desc.writable) {\n            generator.emitGlobalDeclaration(P, descValue);\n          } else if (desc.configurable && desc.enumerable && desc.writable) {\n            generator.emitGlobalAssignment(P, descValue);\n          } else {\n            generator.emitDefineProperty(O, P, desc);\n          }\n        } else {\n          generator.emitDefineProperty(O, P, desc);\n        }\n      } else {\n        if (IsDataDescriptor(realm, desc) && desc.configurable && desc.enumerable && desc.writable) {\n          let descValue = desc.value || realm.intrinsics.undefined;\n          generator.emitPropertyAssignment(O, P, descValue);\n        } else {\n          generator.emitDefineProperty(O, P, desc);\n        }\n      }\n    } else {\n      invariant(oldDesc instanceof PropertyDescriptor);\n      // The property is being modified\n      if (equalDescriptors(desc, oldDesc)) {\n        invariant(IsDataDescriptor(realm, desc));\n        let descValue = desc.value || realm.intrinsics.undefined;\n        // only the value is being modified\n        if (O === realm.$GlobalObject) {\n          generator.emitGlobalAssignment(P, descValue);\n        } else {\n          generator.emitPropertyAssignment(O, P, descValue);\n        }\n      } else {\n        generator.emitDefineProperty(O, P, desc, /*isDescChanged*/ true);\n      }\n    }\n  }\n}\n\nfunction leakDescriptor(realm: Realm, desc: Descriptor) {\n  if (desc instanceof AbstractJoinedDescriptor) {\n    if (desc.descriptor1) {\n      leakDescriptor(realm, desc.descriptor1);\n    }\n    if (desc.descriptor2) {\n      leakDescriptor(realm, desc.descriptor2);\n    }\n  }\n  invariant(desc instanceof PropertyDescriptor);\n\n  if (desc.value) {\n    if (desc.value instanceof Value) Leak.value(realm, desc.value);\n    else if (desc.value !== undefined) {\n      for (let val of desc.value) Leak.value(realm, val);\n    }\n  }\n  if (desc.get) {\n    Leak.value(realm, desc.get);\n  }\n  if (desc.set) {\n    Leak.value(realm, desc.set);\n  }\n}\n\n// Determines if an object with parent O may create its own property P.\nfunction parentPermitsChildPropertyCreation(realm: Realm, O: ObjectValue, P: PropertyKeyValue): boolean {\n  if (O.isSimpleObject()) {\n    // Simple object always allow property creation since there are no setters.\n    // Object.prototype is considered simple even though __proto__ is a setter.\n    // TODO: That is probably the incorrect assumption but that is implied everywhere.\n    return true;\n  }\n\n  let ownDesc = O.$GetOwnProperty(P);\n  if (!ownDesc || ownDesc.mightHaveBeenDeleted()) {\n    // O might not object, so first ask its parent\n    let parent = O.$GetPrototypeOf();\n    if (!(parent instanceof NullValue)) {\n      parent = parent.throwIfNotConcreteObject(); //TODO #1016: deal with abstract parents\n      if (!parentPermitsChildPropertyCreation(realm, parent, P)) return false;\n    }\n\n    // Parent is OK, so if O does not object return true\n    if (!ownDesc) return true; // O has no opinion of its ownDesc\n  }\n  invariant(ownDesc !== undefined);\n\n  // O might have a property P and so might object\n  if (IsDataDescriptor(realm, ownDesc)) {\n    if (ownDesc.writable) {\n      // The grand parent does not object so it is OK that parent does not have P\n      // If parent does have P, it is also OK because it is a writable data property\n      return true;\n    }\n  }\n  // If parent does not have property P, this is too pessimistic, but that is\n  // the caller's problem.\n  return false;\n}\n\nfunction ensureIsNotFinal(realm: Realm, O: ObjectValue, P: void | PropertyKeyValue) {\n  if (O.mightNotBeFinalObject()) {\n    return;\n  }\n\n  // We can't continue because this object is already in its final state\n  if (realm.instantRender.enabled) {\n    realm.instantRenderBailout(\n      \"Object mutations that require materialization are currently not supported by InstantRender\",\n      realm.currentLocation\n    );\n  } else {\n    let error = new CompilerDiagnostic(\n      \"Mutating a final object, or an object with unknown properties, after some of those \" +\n        \"properties have already been used, is not supported.\",\n      realm.currentLocation,\n      \"PP0026\",\n      \"FatalError\"\n    );\n    realm.handleError(error);\n    throw new FatalError();\n  }\n}\n\nfunction isWidenedValue(v: void | Value) {\n  if (!(v instanceof AbstractValue)) return false;\n  if (v.kind === \"widened\" || v.kind === \"widened property\") return true;\n  for (let a of v.args) {\n    if (isWidenedValue(a)) return true;\n  }\n  return false;\n}\n\nexport class PropertiesImplementation {\n  // ECMA262 9.1.9.1\n  OrdinarySet(realm: Realm, O: ObjectValue, P: PropertyKeyValue, V: Value, Receiver: Value): boolean {\n    ensureIsNotFinal(realm, O, P);\n    if (!realm.ignoreLeakLogic && O.mightBeLeakedObject()) {\n      // Leaking is transitive, hence writing a value to a leaked object leaks the value\n      Leak.value(realm, V);\n      // The receiver might leak to a getter so if it's not already leaked, we need to leak it.\n      Leak.value(realm, Receiver);\n      if (realm.generator !== undefined) {\n        realm.generator.emitPropertyAssignment(Receiver, StringKey(P), V);\n      }\n      return true;\n    }\n\n    let weakDeletion = V.mightHaveBeenDeleted();\n\n    // 1. Assert: IsPropertyKey(P) is true.\n    invariant(IsPropertyKey(realm, P), \"expected property key\");\n\n    // 2. Let ownDesc be ? O.[[GetOwnProperty]](P).\n    let ownDesc = O.$GetOwnProperty(P);\n\n    // 3. If ownDesc is undefined (or might be), then\n    if (!ownDesc || ownDesc.mightHaveBeenDeleted()) {\n      // a. Let parent be ? O.[[GetPrototypeOf]]().\n      let parent = O.$GetPrototypeOf();\n\n      // b. If parent is not null, then\n      if (!(parent instanceof NullValue)) {\n        parent = parent.throwIfNotConcreteObject(); //TODO #1016: deal with abstract parents\n        if (!ownDesc) {\n          // i. Return ? parent.[[Set]](P, V, Receiver).\n          return parent.$Set(P, V, Receiver);\n        }\n        // But since we don't know if O has its own property P, the parent might\n        // actually have a say. Give up, unless the parent would be OK with it.\n        if (!parentPermitsChildPropertyCreation(realm, parent, P)) {\n          // TODO: Join the effects depending on if the property was deleted or not.\n          let error = new CompilerDiagnostic(\n            \"assignment might or might not invoke a setter\",\n            realm.currentLocation,\n            \"PP0043\",\n            \"RecoverableError\"\n          );\n          if (realm.handleError(error) !== \"Recover\") {\n            throw new FatalError();\n          }\n          // If we recover, we assume that the parent would've been fine creating the property.\n        }\n        // Since the parent is OK with us creating a local property for O\n        // we can carry on as if there were no parent.\n      }\n\n      // i. Let ownDesc be the PropertyDescriptor{[[Value]]: undefined, [[Writable]]: true, [[Enumerable]]: true, [[Configurable]]: true}.\n      if (!ownDesc)\n        ownDesc = new PropertyDescriptor({\n          value: realm.intrinsics.undefined,\n          writable: true,\n          enumerable: true,\n          configurable: true,\n        });\n    }\n\n    // joined descriptors need special treatment\n    if (ownDesc instanceof AbstractJoinedDescriptor) {\n      let joinCondition = ownDesc.joinCondition;\n      let descriptor2 = ownDesc.descriptor2;\n      ownDesc = ownDesc.descriptor1;\n      let e1 = Path.withCondition(joinCondition, () => {\n        return ownDesc !== undefined\n          ? realm.evaluateForEffects(() => new BooleanValue(realm, OrdinarySetHelper()), undefined, \"OrdinarySet/1\")\n          : construct_empty_effects(realm);\n      });\n      let {\n        result: result1,\n        generator: generator1,\n        modifiedBindings: modifiedBindings1,\n        modifiedProperties: modifiedProperties1,\n        createdObjects: createdObjects1,\n        createdAbstracts: createdAbstracts1,\n      } = e1;\n      ownDesc = descriptor2;\n      let e2 = Path.withInverseCondition(joinCondition, () => {\n        return ownDesc !== undefined\n          ? realm.evaluateForEffects(() => new BooleanValue(realm, OrdinarySetHelper()), undefined, \"OrdinarySet/2\")\n          : construct_empty_effects(realm);\n      });\n      let {\n        result: result2,\n        generator: generator2,\n        modifiedBindings: modifiedBindings2,\n        modifiedProperties: modifiedProperties2,\n        createdObjects: createdObjects2,\n        createdAbstracts: createdAbstracts2,\n      } = e2;\n\n      // Join the effects, creating an abstract view of what happened, regardless\n      // of the actual value of ownDesc.joinCondition.\n      let joinedEffects = Join.joinEffects(\n        joinCondition,\n        new Effects(result1, generator1, modifiedBindings1, modifiedProperties1, createdObjects1, createdAbstracts1),\n        new Effects(result2, generator2, modifiedBindings2, modifiedProperties2, createdObjects2, createdAbstracts2)\n      );\n      realm.applyEffects(joinedEffects);\n      return To.ToBooleanPartial(realm, realm.returnOrThrowCompletion(joinedEffects.result));\n    }\n\n    return OrdinarySetHelper();\n\n    function OrdinarySetHelper(): boolean {\n      invariant(ownDesc !== undefined);\n      // 4. If IsDataDescriptor(ownDesc) is true, then\n      if (IsDataDescriptor(realm, ownDesc)) {\n        // a. If ownDesc.[[Writable]] is false, return false.\n        if (!ownDesc.writable && !weakDeletion) {\n          // The write will fail if the property actually exists\n          if (ownDesc.value && ownDesc.value.mightHaveBeenDeleted()) {\n            // But maybe it does not and thus would succeed.\n            // Since we don't know what will happen, give up for now.\n            // TODO: Join the effects depending on if the property was deleted or not.\n            let error = new CompilerDiagnostic(\n              \"assignment might or might not invoke a setter\",\n              realm.currentLocation,\n              \"PP0043\",\n              \"RecoverableError\"\n            );\n            if (realm.handleError(error) !== \"Recover\") {\n              throw new FatalError();\n            }\n            // If we recover we assume that the property was there.\n          }\n          return false;\n        }\n\n        // b. If Type(Receiver) is not Object, return false.\n        if (!Receiver.mightBeObject()) return false;\n        invariant(Receiver instanceof ObjectValue || Receiver instanceof AbstractObjectValue);\n\n        // c. Let existingDescriptor be ? Receiver.[[GetOwnProperty]](P).\n        let existingDescriptor = Receiver.$GetOwnProperty(P);\n        if (existingDescriptor instanceof AbstractJoinedDescriptor) {\n          if (existingDescriptor.descriptor1 === ownDesc) existingDescriptor = ownDesc;\n          else if (existingDescriptor.descriptor2 === ownDesc) existingDescriptor = ownDesc;\n        }\n        let existingDescValue = !existingDescriptor\n          ? realm.intrinsics.undefined\n          : existingDescriptor.value === undefined\n            ? realm.intrinsics.undefined\n            : existingDescriptor.value;\n        invariant(existingDescValue instanceof Value);\n\n        // d. If existingDescriptor is not undefined, then\n        if (existingDescriptor !== undefined) {\n          // i. If IsAccessorDescriptor(existingDescriptor) is true, return false.\n          if (IsAccessorDescriptor(realm, existingDescriptor)) {\n            invariant(\n              !existingDescValue.mightHaveBeenDeleted(),\n              \"should not fail until weak deletes of accessors are suppported\"\n            );\n            return false;\n          }\n\n          // ii. If existingDescriptor.[[Writable]] is false, return false.\n          if (!existingDescriptor.writable && !(weakDeletion && existingDescriptor.configurable)) {\n            // If we are not sure the receiver actually has a property P we can't just return false here.\n            if (existingDescValue.mightHaveBeenDeleted()) {\n              invariant(existingDescValue instanceof AbstractValue);\n              AbstractValue.reportIntrospectionError(existingDescValue);\n              throw new FatalError();\n            }\n            return false;\n          }\n\n          // iii. Let valueDesc be the PropertyDescriptor{[[Value]]: V}.\n          let valueDesc = new PropertyDescriptor({ value: V });\n\n          // iv. Return ? Receiver.[[DefineOwnProperty]](P, valueDesc).\n          if (weakDeletion || existingDescValue.mightHaveBeenDeleted()) {\n            // At this point we are not sure that Receiver actually has a property P.\n            // If, however, it has -> P. If, however, it has, we are sure that its a\n            // data property, and that redefining the property with valueDesc will not\n            // change the attributes of the property, so we can reuse the existing\n            // descriptor.\n            valueDesc = existingDescriptor;\n            valueDesc.throwIfNotConcrete(realm).value = V;\n          }\n          return Receiver.$DefineOwnProperty(P, valueDesc);\n        } else {\n          // e. Else Receiver does not currently have a property P,\n\n          // i. Return ? CreateDataProperty(Receiver, P, V).\n          return Create.CreateDataProperty(realm, Receiver, P, V);\n        }\n      }\n\n      // 5. Assert: IsAccessorDescriptor(ownDesc) is true.\n      invariant(IsAccessorDescriptor(realm, ownDesc), \"expected accessor\");\n\n      // 6. Let setter be ownDesc.[[Set]].\n      let setter = ownDesc.set;\n\n      // 7. If setter is undefined, return false.\n      if (!setter || setter instanceof UndefinedValue) return false;\n\n      // 8. Perform ? Call(setter, Receiver, « V »).\n      Call(realm, setter.throwIfNotConcrete(), Receiver, [V]);\n\n      // 9. Return true.\n      return true;\n    }\n  }\n\n  OrdinarySetPartial(\n    realm: Realm,\n    O: ObjectValue,\n    P: AbstractValue | PropertyKeyValue,\n    V: Value,\n    Receiver: Value\n  ): boolean {\n    if (!(P instanceof AbstractValue)) return O.$Set(P, V, Receiver);\n    let pIsLoopVar = isWidenedValue(P);\n    let pIsNumeric = Value.isTypeCompatibleWith(P.getType(), NumberValue);\n\n    // A string coercion might have side-effects.\n    // TODO #1682: We assume that simple objects mean that they don't have a\n    // side-effectful valueOf and toString but that's not enforced.\n    if (P.mightNotBeString() && P.mightNotBeNumber() && !P.isSimpleObject()) {\n      if (realm.isInPureScope()) {\n        // If we're in pure scope, we can leak the key and keep going.\n        // Coercion can only have effects on anything reachable from the key.\n        Leak.value(realm, P);\n      } else {\n        let error = new CompilerDiagnostic(\n          \"property key might not have a well behaved toString or be a symbol\",\n          realm.currentLocation,\n          \"PP0002\",\n          \"RecoverableError\"\n        );\n        if (realm.handleError(error) !== \"Recover\") {\n          throw new FatalError();\n        }\n      }\n    }\n\n    // We assume that simple objects have no getter/setter properties and\n    // that all properties are writable.\n    if (!O.isSimpleObject()) {\n      if (realm.isInPureScope()) {\n        // If we're in pure scope, we can leak the object and leave an\n        // assignment in place.\n        Leak.value(realm, Receiver);\n        // We also need to leak the value since it might leak to a setter.\n        Leak.value(realm, V);\n        realm.evaluateWithPossibleThrowCompletion(\n          () => {\n            let generator = realm.generator;\n            invariant(generator);\n            invariant(P instanceof AbstractValue);\n            generator.emitPropertyAssignment(Receiver, P, V);\n            return realm.intrinsics.undefined;\n          },\n          TypesDomain.topVal,\n          ValuesDomain.topVal\n        );\n        // The emitted assignment might throw at runtime but if it does, that\n        // is handled by evaluateWithPossibleThrowCompletion. Anything that\n        // happens after this, can assume we didn't throw and therefore,\n        // we return true here.\n        return true;\n      } else {\n        let error = new CompilerDiagnostic(\n          \"unknown property access might need to invoke a setter\",\n          realm.currentLocation,\n          \"PP0030\",\n          \"RecoverableError\"\n        );\n        if (realm.handleError(error) !== \"Recover\") {\n          throw new FatalError();\n        }\n      }\n    }\n\n    // We should never consult the prototype chain for unknown properties.\n    // If it was simple, it would've been an assignment to the receiver.\n    // The only case the Receiver isn't this, if this was a ToObject\n    // coercion from a PrimitiveValue.\n    let abstractOverO = false;\n    if (Receiver instanceof AbstractObjectValue && !Receiver.values.isTop()) {\n      let elements = Receiver.values.getElements();\n      invariant(elements);\n      if (elements.has(O)) {\n        abstractOverO = true;\n      }\n    }\n    invariant(O === Receiver || HasCompatibleType(Receiver, PrimitiveValue) || abstractOverO);\n\n    P = To.ToStringAbstract(realm, P);\n\n    function createTemplate(propName: AbstractValue) {\n      return AbstractValue.createFromBinaryOp(\n        realm,\n        \"===\",\n        propName,\n        new StringValue(realm, \"\"),\n        undefined,\n        \"template for property name condition\"\n      );\n    }\n\n    let prop;\n    if (O.unknownProperty === undefined) {\n      prop = {\n        descriptor: undefined,\n        object: O,\n        key: P,\n      };\n      O.unknownProperty = prop;\n    } else {\n      prop = O.unknownProperty;\n    }\n    realm.recordModifiedProperty(prop);\n    let desc = prop.descriptor;\n    if (desc === undefined) {\n      let newVal = V;\n      if (!(V instanceof UndefinedValue) && !isWidenedValue(P)) {\n        // join V with sentinel, using a property name test as the condition\n        let cond = createTemplate(P);\n        let sentinel = AbstractValue.createFromType(realm, Value, \"template for prototype member expression\", [\n          Receiver,\n          P,\n        ]);\n        newVal = AbstractValue.createFromConditionalOp(realm, cond, V, sentinel);\n      }\n      prop.descriptor = new PropertyDescriptor({\n        writable: true,\n        enumerable: true,\n        configurable: true,\n        value: newVal,\n      });\n    } else {\n      invariant(\n        desc instanceof PropertyDescriptor,\n        \"unknown properties are only created with Set and have equal descriptors\"\n      );\n      // join V with current value of O.unknownProperty. I.e. weak update.\n      let oldVal = desc.value;\n      invariant(oldVal);\n      let newVal = oldVal;\n      if (!(V instanceof UndefinedValue)) {\n        if (isWidenedValue(P)) {\n          newVal = V; // It will be widened later on\n        } else {\n          let cond = createTemplate(P);\n          newVal = AbstractValue.createFromConditionalOp(realm, cond, V, oldVal);\n        }\n      }\n      desc.value = newVal;\n    }\n\n    // Since we don't know the name of the property we are writing to, we also need\n    // to perform weak updates of all of the known properties.\n    // First clear out O.unknownProperty so that helper routines know its OK to update the properties\n    let savedUnknownProperty = O.unknownProperty;\n    O.unknownProperty = undefined;\n    for (let [key, propertyBinding] of O.properties) {\n      if (pIsLoopVar && pIsNumeric) {\n        // Delete numeric properties and don't do weak updates on other properties.\n        if (key !== +key + \"\") continue;\n        O.properties.delete(key);\n        continue;\n      }\n      let oldVal = realm.intrinsics.empty;\n      if (propertyBinding.descriptor) {\n        let d = propertyBinding.descriptor.throwIfNotConcrete(realm);\n        if (d.value) {\n          oldVal = d.value;\n        }\n      }\n      let cond = AbstractValue.createFromBinaryOp(realm, \"===\", P, new StringValue(realm, key));\n      let newVal = AbstractValue.createFromConditionalOp(realm, cond, V, oldVal);\n      this.OrdinarySet(realm, O, key, newVal, Receiver);\n    }\n    O.unknownProperty = savedUnknownProperty;\n\n    return true;\n  }\n\n  // ECMA262 6.2.4.4\n  FromPropertyDescriptor(realm: Realm, Desc: ?Descriptor): Value {\n    // 1. If Desc is undefined, return undefined.\n    if (!Desc) return realm.intrinsics.undefined;\n\n    if (Desc instanceof AbstractJoinedDescriptor) {\n      return AbstractValue.createFromConditionalOp(\n        realm,\n        Desc.joinCondition,\n        this.FromPropertyDescriptor(realm, Desc.descriptor1),\n        this.FromPropertyDescriptor(realm, Desc.descriptor2)\n      );\n    }\n    invariant(Desc instanceof PropertyDescriptor);\n\n    // 2. Let obj be ObjectCreate(%ObjectPrototype%).\n    let obj = Create.ObjectCreate(realm, realm.intrinsics.ObjectPrototype);\n\n    // 3. Assert: obj is an extensible ordinary object with no own properties.\n    invariant(obj.getExtensible(), \"expected an extensible object\");\n    invariant(!obj.properties.size, \"expected an object with no own properties\");\n\n    // 4. If Desc has a [[Value]] field, then\n    let success = true;\n    if (Desc.value !== undefined) {\n      // a. Perform CreateDataProperty(obj, \"value\", Desc.[[Value]]).\n      success = Create.CreateDataProperty(realm, obj, \"value\", Desc.value) && success;\n    }\n\n    // 5. If Desc has a [[Writable]] field, then\n    if (Desc.writable !== undefined) {\n      // a. Perform CreateDataProperty(obj, \"writable\", Desc.[[Writable]]).\n      success = Create.CreateDataProperty(realm, obj, \"writable\", new BooleanValue(realm, Desc.writable)) && success;\n    }\n\n    // 6. If Desc has a [[Get]] field, then\n    if (Desc.get !== undefined) {\n      // a. Perform CreateDataProperty(obj, \"get\", Desc.[[Get]]).\n      success = Create.CreateDataProperty(realm, obj, \"get\", Desc.get) && success;\n    }\n\n    // 7. If Desc has a [[Set]] field, then\n    if (Desc.set !== undefined) {\n      // a. Perform CreateDataProperty(obj, \"set\", Desc.[[Set]]).\n      success = Create.CreateDataProperty(realm, obj, \"set\", Desc.set) && success;\n    }\n\n    // 8. If Desc has an [[Enumerable]] field, then\n    if (Desc.enumerable !== undefined) {\n      // a. Perform CreateDataProperty(obj, \"enumerable\", Desc.[[Enumerable]]).\n      success =\n        Create.CreateDataProperty(realm, obj, \"enumerable\", new BooleanValue(realm, Desc.enumerable)) && success;\n    }\n\n    // 9. If Desc has a [[Configurable]] field, then\n    if (Desc.configurable !== undefined) {\n      // a. Perform CreateDataProperty(obj, \"configurable\", Desc.[[Configurable]]).\n      success =\n        Create.CreateDataProperty(realm, obj, \"configurable\", new BooleanValue(realm, Desc.configurable)) && success;\n    }\n\n    // 10. Assert: all of the above CreateDataProperty operations return true.\n    invariant(success, \"fails to create data property\");\n\n    // 11. Return obj.\n    return obj;\n  }\n\n  //\n  OrdinaryDelete(realm: Realm, O: ObjectValue, P: PropertyKeyValue): boolean {\n    // 1. Assert: IsPropertyKey(P) is true.\n    invariant(IsPropertyKey(realm, P), \"expected a property key\");\n\n    // 2. Let desc be ? O.[[GetOwnProperty]](P).\n    let desc = O.$GetOwnProperty(P);\n\n    // 3. If desc is undefined, return true.\n    if (!desc) {\n      ensureIsNotFinal(realm, O, P);\n      if (!realm.ignoreLeakLogic && O.mightBeLeakedObject()) {\n        if (realm.generator !== undefined) {\n          realm.generator.emitPropertyDelete(O, StringKey(P));\n        }\n      }\n      return true;\n    }\n\n    desc = desc.throwIfNotConcrete(realm);\n\n    // 4. If desc.[[Configurable]] is true, then\n    if (desc.configurable) {\n      ensureIsNotFinal(realm, O, P);\n      if (O.mightBeLeakedObject()) {\n        if (realm.generator !== undefined) {\n          realm.generator.emitPropertyDelete(O, StringKey(P));\n        }\n        return true;\n      }\n\n      // a. Remove the own property with name P from O.\n      let key = InternalGetPropertiesKey(P);\n      let map = InternalGetPropertiesMap(O, P);\n      let propertyBinding = map.get(key);\n      if (propertyBinding === undefined && O.isPartialObject() && O.isSimpleObject()) {\n        let generator = realm.generator;\n        if (generator) {\n          invariant(typeof key === \"string\" || key instanceof SymbolValue);\n          generator.emitPropertyDelete(O, StringKey(key));\n          return true;\n        }\n      }\n      invariant(propertyBinding !== undefined);\n      realm.recordModifiedProperty(propertyBinding);\n      propertyBinding.descriptor = undefined;\n      InternalUpdatedProperty(realm, O, P, desc);\n\n      // b. Return true.\n      return true;\n    }\n\n    // 5. Return false.\n    return false;\n  }\n\n  // ECMA262 7.3.8\n  DeletePropertyOrThrow(realm: Realm, O: ObjectValue, P: PropertyKeyValue): boolean {\n    // 1. Assert: Type(O) is Object.\n    invariant(O instanceof ObjectValue, \"expected an object\");\n\n    // 2. Assert: IsPropertyKey(P) is true.\n    invariant(IsPropertyKey(realm, P), \"expected a property key\");\n\n    // 3. Let success be ? O.[[Delete]](P).\n    let success = O.$Delete(P);\n\n    // 4. If success is false, throw a TypeError exception.\n    if (!success) {\n      throw realm.createErrorThrowCompletion(realm.intrinsics.TypeError, \"couldn't delete property\");\n    }\n\n    // 5. Return success.\n    return success;\n  }\n\n  // ECMA262 6.2.4.6\n  CompletePropertyDescriptor(realm: Realm, _Desc: Descriptor): Descriptor {\n    // 1. Assert: Desc is a Property Descriptor.\n    let Desc = _Desc.throwIfNotConcrete(realm);\n\n    // 2. Let like be Record{[[Value]]: undefined, [[Writable]]: false, [[Get]]: undefined, [[Set]]: undefined, [[Enumerable]]: false, [[Configurable]]: false}.\n    let like = {\n      value: realm.intrinsics.undefined,\n      get: realm.intrinsics.undefined,\n      set: realm.intrinsics.undefined,\n      writable: false,\n      enumerable: false,\n      configurable: false,\n    };\n\n    // 3. If either IsGenericDescriptor(Desc) or IsDataDescriptor(Desc) is true, then\n    if (IsGenericDescriptor(realm, Desc) || IsDataDescriptor(realm, Desc)) {\n      // a. If Desc does not have a [[Value]] field, set Desc.[[Value]] to like.[[Value]].\n      if (Desc.value === undefined) Desc.value = like.value;\n      // b. If Desc does not have a [[Writable]] field, set Desc.[[Writable]] to like.[[Writable]].\n      if (Desc.writable === undefined) Desc.writable = like.writable;\n    } else {\n      // 4. Else,\n      // a. If Desc does not have a [[Get]] field, set Desc.[[Get]] to like.[[Get]].\n      if (Desc.get === undefined) Desc.get = like.get;\n      // b. If Desc does not have a [[Set]] field, set Desc.[[Set]] to like.[[Set]].\n      if (Desc.set === undefined) Desc.set = like.set;\n    }\n\n    // 5. If Desc does not have an [[Enumerable]] field, set Desc.[[Enumerable]] to like.[[Enumerable]].\n    if (Desc.enumerable === undefined) Desc.enumerable = like.enumerable;\n\n    // 6. If Desc does not have a [[Configurable]] field, set Desc.[[Configurable]] to like.[[Configurable]].\n    if (Desc.configurable === undefined) Desc.configurable = like.configurable;\n\n    // 7. Return Desc.\n    return Desc;\n  }\n\n  // ECMA262 9.1.6.2\n  IsCompatiblePropertyDescriptor(realm: Realm, extensible: boolean, Desc: Descriptor, current: ?Descriptor): boolean {\n    // 1. Return ValidateAndApplyPropertyDescriptor(undefined, undefined, Extensible, Desc, Current).\n    return this.ValidateAndApplyPropertyDescriptor(realm, undefined, undefined, extensible, Desc, current);\n  }\n\n  // ECMA262 9.1.6.3\n  ValidateAndApplyPropertyDescriptor(\n    realm: Realm,\n    O: void | ObjectValue,\n    P: void | PropertyKeyValue,\n    extensible: boolean,\n    _Desc: Descriptor,\n    _current: ?Descriptor\n  ): boolean {\n    let Desc = _Desc;\n    let current = _current;\n\n    // 1. Assert: If O is not undefined, then IsPropertyKey(P) is true.\n    if (O !== undefined) {\n      invariant(P !== undefined);\n      invariant(IsPropertyKey(realm, P));\n    }\n\n    if (current instanceof AbstractJoinedDescriptor) {\n      let jc = current.joinCondition;\n      if (Path.implies(jc)) current = current.descriptor1;\n      else if (!AbstractValue.createFromUnaryOp(realm, \"!\", jc, true).mightNotBeTrue()) current = current.descriptor2;\n    }\n\n    // 2. If current is undefined, then\n    if (!current) {\n      // a. If extensible is false, return false.\n      if (!extensible) return false;\n\n      // b. Assert: extensible is true.\n      invariant(extensible === true, \"expected extensible to be true\");\n\n      if (O !== undefined && P !== undefined) {\n        ensureIsNotFinal(realm, O, P);\n        if (!realm.ignoreLeakLogic && O.mightBeLeakedObject()) {\n          leakDescriptor(realm, Desc);\n          if (realm.generator !== undefined) {\n            realm.generator.emitDefineProperty(O, StringKey(P), Desc.throwIfNotConcrete(realm));\n          }\n          return true;\n        }\n      }\n\n      // c. If IsGenericDescriptor(Desc) is true or IsDataDescriptor(Desc) is true, then\n      if (IsGenericDescriptor(realm, Desc) || IsDataDescriptor(realm, Desc)) {\n        // i. If O is not undefined, create an own data property named P of object O whose [[Value]],\n        //    [[Writable]], [[Enumerable]] and [[Configurable]] attribute values are described by Desc. If the\n        //    value of an attribute field of Desc is absent, the attribute of the newly created property is set\n        //    to its default value.\n        if (O !== undefined) {\n          invariant(P !== undefined);\n          InternalSetProperty(\n            realm,\n            O,\n            P,\n            new PropertyDescriptor({\n              value: Desc.value !== undefined ? Desc.value : realm.intrinsics.undefined,\n              writable: Desc.writable !== undefined ? Desc.writable : false,\n              enumerable: Desc.enumerable !== undefined ? Desc.enumerable : false,\n              configurable: Desc.configurable !== undefined ? Desc.configurable : false,\n            })\n          );\n          InternalUpdatedProperty(realm, O, P, undefined);\n        }\n      } else {\n        // d. Else Desc must be an accessor Property Descriptor,\n        // i. If O is not undefined, create an own accessor property named P of object O whose [[Get]],\n        //    [[Set]], [[Enumerable]] and [[Configurable]] attribute values are described by Desc. If the value\n        //    of an attribute field of Desc is absent, the attribute of the newly created property is set to its\n        //    default value.\n        if (O !== undefined) {\n          invariant(P !== undefined);\n          Desc = Desc.throwIfNotConcrete(realm);\n          InternalSetProperty(\n            realm,\n            O,\n            P,\n            new PropertyDescriptor({\n              get: Desc.get !== undefined ? Desc.get : realm.intrinsics.undefined,\n              set: Desc.set !== undefined ? Desc.set : realm.intrinsics.undefined,\n              enumerable: Desc.enumerable !== undefined ? Desc.enumerable : false,\n              configurable: Desc.configurable !== undefined ? Desc.configurable : false,\n            })\n          );\n          InternalUpdatedProperty(realm, O, P, undefined);\n        }\n      }\n\n      // e. Return true.\n      return true;\n    }\n\n    current = current.throwIfNotConcrete(realm);\n    Desc = Desc.throwIfNotConcrete(realm);\n\n    // 3. Return true, if every field in Desc is absent.\n    let allAbsent = true;\n    for (let field in Desc) {\n      if ((Desc: any)[field] !== undefined) {\n        allAbsent = false;\n        break;\n      }\n    }\n    if (allAbsent) return true;\n\n    // 4. Return true, if every field in Desc also occurs in current and the value of every field in Desc is the\n    // same value as the corresponding field in current when compared using the SameValue algorithm.\n    let identical = true;\n    for (let field in Desc) {\n      if ((Desc: any)[field] === undefined) {\n        continue;\n      }\n      if ((current: any)[field] === undefined) {\n        identical = false;\n      } else {\n        let dval = InternalDescriptorPropertyToValue(realm, (Desc: any)[field]);\n        let cval = InternalDescriptorPropertyToValue(realm, (current: any)[field]);\n        if (dval instanceof ConcreteValue && cval instanceof ConcreteValue) identical = SameValue(realm, dval, cval);\n        else {\n          identical = dval === cval;\n          // This might be false now but true at runtime. This does not\n          // matter because the logic for non identical values will still\n          // do the right thing in the cases below that does not blow up\n          // when dealing with an abstract value.\n        }\n      }\n      if (!identical) break;\n    }\n    // Only return here if the assigment is not temporal.\n    if (identical && (O === realm.$GlobalObject || (O !== undefined && !O.isIntrinsic()))) {\n      return true;\n    }\n\n    let mightHaveBeenDeleted = current.value instanceof Value && current.value.mightHaveBeenDeleted();\n\n    // 5. If the [[Configurable]] field of current is false, then\n    if (!current.configurable) {\n      invariant(!mightHaveBeenDeleted, \"a non-configurable property can't be deleted\");\n\n      // a. Return false, if the [[Configurable]] field of Desc is true.\n      if (Desc.configurable) return false;\n\n      // b. Return false, if the [[Enumerable]] field of Desc is present and the [[Enumerable]] fields of current and Desc are the Boolean negation of each other.\n      if (Desc.enumerable !== undefined && Desc.enumerable !== current.enumerable) {\n        return false;\n      }\n    }\n\n    current = current.throwIfNotConcrete(realm);\n    Desc = Desc.throwIfNotConcrete(realm);\n\n    if (O !== undefined && P !== undefined) {\n      ensureIsNotFinal(realm, O, P);\n      if (!realm.ignoreLeakLogic && O.mightBeLeakedObject()) {\n        leakDescriptor(realm, Desc);\n        if (realm.generator !== undefined) {\n          realm.generator.emitDefineProperty(O, StringKey(P), Desc);\n        }\n        return true;\n      }\n    }\n\n    let oldDesc = current;\n    current = cloneDescriptor(current);\n    invariant(current !== undefined);\n\n    // 6. If IsGenericDescriptor(Desc) is true, no further validation is required.\n    if (IsGenericDescriptor(realm, Desc)) {\n    } else if (IsDataDescriptor(realm, current) !== IsDataDescriptor(realm, Desc)) {\n      // 7. Else if IsDataDescriptor(current) and IsDataDescriptor(Desc) have different results, then\n      // a. Return false, if the [[Configurable]] field of current is false.\n      if (!current.configurable) return false;\n\n      // b. If IsDataDescriptor(current) is true, then\n      if (IsDataDescriptor(realm, current)) {\n        // i. If O is not undefined, convert the property named P of object O from a data property to an accessor property.\n        // Preserve the existing values of the converted property's [[Configurable]] and [[Enumerable]] attributes and set the rest of the property's attributes to their default values.\n        if (O !== undefined) {\n          invariant(P !== undefined);\n          current.writable = undefined;\n          current.value = undefined;\n          current.get = realm.intrinsics.undefined;\n          current.set = realm.intrinsics.undefined;\n        }\n      } else {\n        // c. Else,\n        // i. If O is not undefined, convert the property named P of object O from an accessor property to a data property. Preserve the existing values of the converted property's [[Configurable]] and [[Enumerable]] attributes and set the rest of the property's attributes to their default values.\n        if (O !== undefined) {\n          invariant(P !== undefined);\n          current.get = undefined;\n          current.set = undefined;\n          current.writable = false;\n          current.value = realm.intrinsics.undefined;\n        }\n      }\n    } else if (IsDataDescriptor(realm, current) && IsDataDescriptor(realm, Desc)) {\n      // 8. Else if IsDataDescriptor(current) and IsDataDescriptor(Desc) are both true, then\n      // a. If the [[Configurable]] field of current is false, then\n      if (!current.configurable) {\n        // i. Return false, if the [[Writable]] field of current is false and the [[Writable]] field of Desc is true.\n        if (!current.writable && Desc.writable) return false;\n\n        // ii. If the [[Writable]] field of current is false, then\n        if (!current.writable) {\n          // 1. Return false, if the [[Value]] field of Desc is present and SameValue(Desc.[[Value]], current.[[Value]]) is false.\n          let descValue = Desc.value || realm.intrinsics.undefined;\n          invariant(descValue instanceof Value);\n          let currentValue = current.value || realm.intrinsics.undefined;\n          invariant(currentValue instanceof Value);\n          if (Desc.value && !SameValuePartial(realm, descValue, currentValue)) {\n            return false;\n          }\n        }\n      } else {\n        // b. Else the [[Configurable]] field of current is true, so any change is acceptable.\n      }\n    } else {\n      // 9. Else IsAccessorDescriptor(current) and IsAccessorDescriptor(Desc) are both true,\n      // a. If the [[Configurable]] field of current is false, then\n      if (!current.configurable) {\n        // i. Return false, if the [[Set]] field of Desc is present and SameValue(Desc.[[Set]], current.[[Set]]) is false.\n        if (Desc.set && !SameValuePartial(realm, Desc.set, current.set || realm.intrinsics.undefined)) return false;\n\n        // ii. Return false, if the [[Get]] field of Desc is present and SameValue(Desc.[[Get]], current.[[Get]]) is false.\n        if (Desc.get && !SameValuePartial(realm, Desc.get, current.get || realm.intrinsics.undefined)) return false;\n      }\n    }\n\n    if (mightHaveBeenDeleted) {\n      // If the property might have been deleted, we need to ensure that either\n      // the new descriptor overrides any existing values, or always results in\n      // the default value.\n      let unknownEnumerable = Desc.enumerable === undefined && !!current.enumerable;\n      let unknownWritable = Desc.writable === undefined && !!current.writable;\n      if (unknownEnumerable || unknownWritable) {\n        let error = new CompilerDiagnostic(\n          \"unknown descriptor attributes on deleted property\",\n          realm.currentLocation,\n          \"PP0038\",\n          \"RecoverableError\"\n        );\n        if (realm.handleError(error) !== \"Recover\") {\n          throw new FatalError();\n        }\n      }\n    }\n\n    // 10. If O is not undefined, then\n    if (O !== undefined) {\n      invariant(P !== undefined);\n      let key = InternalGetPropertiesKey(P);\n      let map = InternalGetPropertiesMap(O, P);\n      let propertyBinding = map.get(key);\n      if (propertyBinding === undefined) {\n        propertyBinding = { descriptor: undefined, object: O, key: key };\n        realm.recordModifiedProperty(propertyBinding);\n        propertyBinding.descriptor = current;\n        map.set(key, propertyBinding);\n      } else if (propertyBinding.descriptor === undefined) {\n        realm.recordModifiedProperty(propertyBinding);\n        propertyBinding.descriptor = current;\n      } else {\n        realm.recordModifiedProperty(propertyBinding);\n        propertyBinding.descriptor = current;\n      }\n\n      // a. For each field of Desc that is present, set the corresponding attribute of the property named P of\n      //    object O to the value of the field.\n      for (let field in Desc) {\n        if ((Desc: any)[field] !== undefined) {\n          (current: any)[field] = (Desc: any)[field];\n        }\n      }\n      InternalUpdatedProperty(realm, O, P, oldDesc);\n    }\n\n    // 11. Return true.\n    return true;\n  }\n\n  // ECMA262 9.1.6.1\n  OrdinaryDefineOwnProperty(realm: Realm, O: ObjectValue, P: PropertyKeyValue, Desc: Descriptor): boolean {\n    invariant(O instanceof ObjectValue);\n\n    // 1. Let current be ? O.[[GetOwnProperty]](P).\n    let current = O.$GetOwnProperty(P);\n\n    // 2. Let extensible be the value of the [[Extensible]] internal slot of O.\n    let extensible = O.getExtensible();\n\n    // 3. Return ValidateAndApplyPropertyDescriptor(O, P, extensible, Desc, current).\n    return this.ValidateAndApplyPropertyDescriptor(realm, O, P, extensible, Desc, current);\n  }\n\n  // ECMA262 19.1.2.3.1\n  ObjectDefineProperties(realm: Realm, O: Value, Properties: Value): ObjectValue | AbstractObjectValue {\n    // 1. If Type(O) is not Object, throw a TypeError exception.\n    if (O.mightNotBeObject()) {\n      if (O.mightBeObject()) O.throwIfNotConcrete();\n      throw realm.createErrorThrowCompletion(realm.intrinsics.TypeError);\n    }\n    invariant(O instanceof ObjectValue || O instanceof AbstractObjectValue);\n\n    // 2. Let props be ? ToObject(Properties).\n    let props = To.ToObject(realm, Properties);\n\n    // 3. Let keys be ? props.[[OwnPropertyKeys]]().\n    let keys = props.$OwnPropertyKeys();\n\n    // 4. Let descriptors be a new empty List.\n    let descriptors = [];\n\n    // 5. Repeat for each element nextKey of keys in List order,\n    for (let nextKey of keys) {\n      // a. Let propDesc be ? props.[[GetOwnProperty]](nextKey).\n      let propDesc = props.$GetOwnProperty(nextKey);\n\n      // b. If propDesc is not undefined and propDesc.[[Enumerable]] is true, then\n      if (propDesc && propDesc.throwIfNotConcrete(realm).enumerable) {\n        this.ThrowIfMightHaveBeenDeleted(propDesc);\n\n        // i. Let descObj be ? Get(props, nextKey).\n        let descObj = Get(realm, props, nextKey);\n\n        // ii. Let desc be ? ToPropertyDescriptor(descObj).\n        let desc = To.ToPropertyDescriptor(realm, descObj);\n\n        // iii. Append the pair (a two element List) consisting of nextKey and desc to the end of descriptors.\n        descriptors.push([nextKey, desc]);\n      }\n    }\n\n    // 6. For each pair from descriptors in list order,\n    for (let pair of descriptors) {\n      // a. Let P be the first element of pair.\n      let P = pair[0];\n\n      // b. Let desc be the second element of pair.\n      let desc = pair[1];\n\n      // c. Perform ? DefinePropertyOrThrow(O, P, desc).\n      this.DefinePropertyOrThrow(realm, O, P, desc);\n    }\n\n    // 7. Return O.\n    return O;\n  }\n\n  // ECMA262 7.3.3\n  Set(realm: Realm, O: ObjectValue | AbstractObjectValue, P: PropertyKeyValue, V: Value, Throw: boolean): boolean {\n    // 1. Assert: Type(O) is Object.\n\n    // 2. Assert: IsPropertyKey(P) is true.\n    invariant(IsPropertyKey(realm, P), \"expected property key\");\n\n    // 3. Assert: Type(Throw) is Boolean.\n    invariant(typeof Throw === \"boolean\", \"expected boolean\");\n\n    // 4. Let success be ? O.[[Set]](P, V, O).\n    let success = O.$Set(P, V, O);\n\n    // 5. If success is false and Throw is true, throw a TypeError exception.\n    if (success === false && Throw === true) {\n      throw realm.createErrorThrowCompletion(realm.intrinsics.TypeError);\n    }\n\n    // 6. Return success.\n    return success;\n  }\n\n  // ECMA262 7.3.7\n  DefinePropertyOrThrow(\n    realm: Realm,\n    O: ObjectValue | AbstractObjectValue,\n    P: PropertyKeyValue,\n    desc: Descriptor\n  ): boolean {\n    // 1. Assert: Type(O) is Object.\n\n    // 2. Assert: IsPropertyKey(P) is true.\n    invariant(typeof P === \"string\" || IsPropertyKey(realm, P), \"expected property key\");\n\n    // 3. Let success be ? O.[[DefineOwnProperty]](P, desc).\n    let success = O.$DefineOwnProperty(P, desc);\n\n    // 4. If success is false, throw a TypeError exception.\n    if (success === false) {\n      throw realm.createErrorThrowCompletion(realm.intrinsics.TypeError);\n    }\n\n    // 5. Return success.\n    return success;\n  }\n\n  // ECMA262 6.2.3.2\n  PutValue(realm: Realm, V: Value | Reference, W: Value): void | boolean | Value {\n    W = W.promoteEmptyToUndefined();\n    // The following two steps are not necessary as we propagate completions with exceptions.\n    // 1. ReturnIfAbrupt(V).\n    // 2. ReturnIfAbrupt(W).\n\n    // 3. If Type(V) is not Reference, throw a ReferenceError exception.\n    if (!(V instanceof Reference)) {\n      throw realm.createErrorThrowCompletion(realm.intrinsics.ReferenceError, \"can't put a value to a non-reference\");\n    }\n\n    // 4. Let base be GetBase(V).\n    let base = Environment.GetBase(realm, V);\n\n    // 5. If IsUnresolvableReference(V) is true, then\n    if (Environment.IsUnresolvableReference(realm, V)) {\n      // a. If IsStrictReference(V) is true, then\n      if (Environment.IsStrictReference(realm, V)) {\n        // i. Throw a ReferenceError exception.\n        throw realm.createErrorThrowCompletion(realm.intrinsics.ReferenceError);\n      }\n\n      // b. Let globalObj be GetGlobalObject().\n      let globalObj = GetGlobalObject(realm);\n\n      // c. Return ? Set(globalObj, GetReferencedName(V), W, false).\n      return this.Set(realm, globalObj, Environment.GetReferencedName(realm, V), W, false);\n    }\n\n    // 6. Else if IsPropertyReference(V) is true, then\n    if (Environment.IsPropertyReference(realm, V)) {\n      if (base instanceof AbstractValue) {\n        // Ensure that abstract values are coerced to objects. This might yield\n        // an operation that might throw.\n        base = To.ToObject(realm, base);\n      }\n      // a. If HasPrimitiveBase(V) is true, then\n      if (Environment.HasPrimitiveBase(realm, V)) {\n        // i. Assert: In realm case, base will never be null or undefined.\n        invariant(base instanceof Value && !HasSomeCompatibleType(base, UndefinedValue, NullValue));\n\n        // ii. Set base to ToObject(base).\n        base = To.ToObject(realm, base);\n      }\n      invariant(base instanceof ObjectValue || base instanceof AbstractObjectValue);\n\n      // b. Let succeeded be ? base.[[Set]](GetReferencedName(V), W, GetThisValue(V)).\n      let succeeded = base.$SetPartial(Environment.GetReferencedNamePartial(realm, V), W, GetThisValue(realm, V));\n\n      // c. If succeeded is false and IsStrictReference(V) is true, throw a TypeError exception.\n      if (succeeded === false && Environment.IsStrictReference(realm, V)) {\n        throw realm.createErrorThrowCompletion(realm.intrinsics.TypeError);\n      }\n\n      // d. Return.\n      return;\n    }\n\n    // 7. Else base must be an Environment Record,\n    if (base instanceof EnvironmentRecord) {\n      // a. Return ? base.SetMutableBinding(GetReferencedName(V), W, IsStrictReference(V)) (see 8.1.1).\n      let referencedName = Environment.GetReferencedName(realm, V);\n      invariant(typeof referencedName === \"string\");\n      return base.SetMutableBinding(referencedName, W, Environment.IsStrictReference(realm, V));\n    }\n\n    invariant(false);\n  }\n\n  // ECMA262 9.4.2.4\n  ArraySetLength(realm: Realm, A: ArrayValue, _Desc: Descriptor): boolean {\n    let Desc = _Desc.throwIfNotConcrete(realm);\n\n    // 1. If the [[Value]] field of Desc is absent, then\n    let DescValue = Desc.value;\n    if (!DescValue) {\n      // a. Return OrdinaryDefineOwnProperty(A, \"length\", Desc).\n      return this.OrdinaryDefineOwnProperty(realm, A, \"length\", Desc);\n    }\n    invariant(DescValue instanceof Value);\n\n    // 2. Let newLenDesc be a copy of Desc.\n    let newLenDesc = new PropertyDescriptor(Desc);\n\n    // 3. Let newLen be ? ToUint32(Desc.[[Value]]).\n    let newLen = To.ToUint32(realm, DescValue);\n\n    // 4. Let numberLen be ? ToNumber(Desc.[[Value]]).\n    let numberLen = To.ToNumber(realm, DescValue);\n\n    // 5. If newLen ≠ numberLen, throw a RangeError exception.\n    if (newLen !== numberLen) {\n      throw realm.createErrorThrowCompletion(realm.intrinsics.RangeError, \"should be a uint\");\n    }\n\n    // 6. Set newLenDesc.[[Value]] to newLen.\n    newLenDesc.value = new NumberValue(realm, newLen);\n\n    // 7. Let oldLenDesc be OrdinaryGetOwnProperty(A, \"length\").\n    let oldLenDesc = this.OrdinaryGetOwnProperty(realm, A, \"length\");\n\n    // 8. Assert: oldLenDesc will never be undefined or an accessor descriptor because Array objects are created\n    //    with a length data property that cannot be deleted or reconfigured.\n    invariant(\n      oldLenDesc !== undefined && !IsAccessorDescriptor(realm, oldLenDesc),\n      \"cannot be undefined or an accessor descriptor\"\n    );\n    oldLenDesc = oldLenDesc.throwIfNotConcrete(realm);\n\n    // 9. Let oldLen be oldLenDesc.[[Value]].\n    let oldLen = oldLenDesc.value;\n    invariant(oldLen instanceof Value);\n    oldLen = oldLen.throwIfNotConcrete();\n    invariant(oldLen instanceof NumberValue, \"should be a number\");\n    oldLen = (oldLen.value: number);\n\n    // 10. If newLen ≥ oldLen, then\n    if (newLen >= oldLen) {\n      // a. Return OrdinaryDefineOwnProperty(A, \"length\", newLenDesc).\n      return this.OrdinaryDefineOwnProperty(realm, A, \"length\", newLenDesc);\n    }\n\n    // 11. If oldLenDesc.[[Writable]] is false, return false.\n    if (!oldLenDesc.writable) return false;\n\n    // 12. If newLenDesc.[[Writable]] is absent or has the value true, let newWritable be true.\n    let newWritable;\n    if (newLenDesc.writable === undefined || newLenDesc.writable === true) {\n      newWritable = true;\n    } else {\n      // 13. Else,\n      // a. Need to defer setting the [[Writable]] attribute to false in case any elements cannot be deleted.\n\n      // b. Let newWritable be false.\n      newWritable = false;\n\n      // c. Set newLenDesc.[[Writable]] to true.\n      newLenDesc.writable = true;\n    }\n\n    // 14. Let succeeded be ! OrdinaryDefineOwnProperty(A, \"length\", newLenDesc).\n    let succeeded = this.OrdinaryDefineOwnProperty(realm, A, \"length\", newLenDesc);\n\n    // 15. If succeeded is false, return false.\n    if (succeeded === false) return false;\n\n    // Here we diverge from the spec: instead of traversing all indices from\n    // oldLen to newLen, only the indices that are actually present are touched.\n    let oldLenCopy = oldLen;\n    let keys = Array.from(A.properties.keys())\n      .map(x => parseInt(x, 10))\n      .filter(x => newLen <= x && x <= oldLenCopy)\n      .sort()\n      .reverse();\n\n    // 16. While newLen < oldLen repeat,\n    for (let key of keys) {\n      // a. Set oldLen to oldLen - 1.\n      oldLen = key;\n\n      // b. Let deleteSucceeded be ! A.[[Delete]](! ToString(oldLen)).\n      let deleteSucceeded = A.$Delete(oldLen + \"\");\n\n      // c. If deleteSucceeded is false, then\n      if (deleteSucceeded === false) {\n        // i. Set newLenDesc.[[Value]] to oldLen + 1.\n        newLenDesc.value = new NumberValue(realm, oldLen + 1);\n\n        // ii. If newWritable is false, set newLenDesc.[[Writable]] to false.\n        if (newWritable === false) newLenDesc.writable = false;\n\n        // iii. Let succeeded be ! OrdinaryDefineOwnProperty(A, \"length\", newLenDesc).\n        succeeded = this.OrdinaryDefineOwnProperty(realm, A, \"length\", newLenDesc);\n\n        // iv. Return false.\n        return false;\n      }\n    }\n\n    // 17. If newWritable is false, then\n    if (!newWritable) {\n      // a. Return OrdinaryDefineOwnProperty(A, \"length\", PropertyDescriptor{[[Writable]]: false}). This call will always return true.\n      return this.OrdinaryDefineOwnProperty(\n        realm,\n        A,\n        \"length\",\n        new PropertyDescriptor({\n          writable: false,\n        })\n      );\n    }\n\n    // 18. Return true.\n    return true;\n  }\n\n  // ECMA262 9.1.5.1\n  OrdinaryGetOwnProperty(realm: Realm, O: ObjectValue, P: PropertyKeyValue): Descriptor | void {\n    // if the object is leaked and final, then it's still safe to read the value from the object\n    if (!realm.ignoreLeakLogic && O.mightBeLeakedObject()) {\n      if (!O.mightNotBeFinalObject()) {\n        let existingBinding = InternalGetPropertiesMap(O, P).get(InternalGetPropertiesKey(P));\n        if (existingBinding && existingBinding.descriptor) {\n          return existingBinding.descriptor;\n        } else {\n          return undefined;\n        }\n      }\n\n      let propName = P;\n      if (typeof propName === \"string\") {\n        propName = new StringValue(realm, propName);\n      }\n      let absVal = AbstractValue.createTemporalFromBuildFunction(\n        realm,\n        Value,\n        [O._templateFor || O, propName],\n        createOperationDescriptor(\"ABSTRACT_PROPERTY\"),\n        { isPure: true }\n      );\n      // TODO: We can't be sure what the descriptor will be, but the value will be abstract.\n      return new PropertyDescriptor({ configurable: true, enumerable: true, value: absVal, writable: true });\n    }\n\n    // 1. Assert: IsPropertyKey(P) is true.\n    invariant(IsPropertyKey(realm, P), \"expected a property key\");\n\n    // 2. If O does not have an own property with key P, return undefined.\n    let existingBinding = InternalGetPropertiesMap(O, P).get(InternalGetPropertiesKey(P));\n    if (!existingBinding) {\n      if (O.isPartialObject()) {\n        invariant(realm.useAbstractInterpretation); // __makePartial will already have thrown an error if not\n        if (O.isSimpleObject()) {\n          if (P instanceof StringValue) P = P.value;\n          if (typeof P === \"string\") {\n            // In this case it is safe to defer the property access to runtime (at this point in time)\n            let absVal;\n            function createAbstractPropertyValue(type: typeof Value) {\n              invariant(typeof P === \"string\");\n              if (O.isTransitivelySimple()) {\n                return AbstractValue.createFromBuildFunction(\n                  realm,\n                  type,\n                  [O._templateFor || O, new StringValue(realm, P)],\n                  createOperationDescriptor(\"ABSTRACT_PROPERTY\"),\n                  { kind: AbstractValue.makeKind(\"property\", P) }\n                );\n              } else if (realm.generator !== undefined) {\n                return AbstractValue.createTemporalFromBuildFunction(\n                  realm,\n                  type,\n                  [O._templateFor || O, new StringValue(realm, P)],\n                  createOperationDescriptor(\"ABSTRACT_PROPERTY\"),\n                  { skipInvariant: true, isPure: true }\n                );\n              } else {\n                // During environment initialization we'll call Set and DefineOwnProperty\n                // to initialize objects. Since these needs to introspect the descriptor,\n                // we need some kind of value as its placeholder. This value should never\n                // leak to the serialized environment.\n                return AbstractValue.createFromBuildFunction(\n                  realm,\n                  type,\n                  [O._templateFor || O, new StringValue(realm, P)],\n                  createOperationDescriptor(\"ABSTRACT_PROPERTY\"),\n                  { kind: \"environment initialization expression\" }\n                );\n              }\n            }\n            if (O.isTransitivelySimple()) {\n              absVal = createAbstractPropertyValue(ObjectValue);\n              invariant(absVal instanceof AbstractObjectValue);\n              absVal.makeSimple(\"transitive\");\n              absVal = AbstractValue.createAbstractConcreteUnion(realm, absVal, [\n                realm.intrinsics.undefined,\n                realm.intrinsics.null,\n              ]);\n            } else {\n              absVal = createAbstractPropertyValue(Value);\n            }\n            return new PropertyDescriptor({ configurable: true, enumerable: true, value: absVal, writable: true });\n          } else {\n            invariant(P instanceof SymbolValue);\n            // Simple objects don't have symbol properties\n            return undefined;\n          }\n        }\n        AbstractValue.reportIntrospectionError(O, P);\n        throw new FatalError();\n      } else if (\n        realm.invariantLevel >= 2 &&\n        O.isIntrinsic() &&\n        !ArrayValue.isIntrinsicAndHasWidenedNumericProperty(O)\n      ) {\n        let realmGenerator = realm.generator;\n        // TODO: Because global variables are special, checking for missing global object properties doesn't quite work yet.\n        if (\n          realmGenerator &&\n          typeof P === \"string\" &&\n          O !== realm.$GlobalObject &&\n          !realm.hasBindingBeenChecked(O, P)\n        ) {\n          realm.markPropertyAsChecked(O, P);\n          realmGenerator.emitPropertyInvariant(O, P, \"MISSING\");\n        }\n      }\n      return undefined;\n    }\n    realm.callReportPropertyAccess(existingBinding, false);\n    if (!existingBinding.descriptor) {\n      if (realm.invariantLevel >= 2 && O.isIntrinsic()) {\n        let realmGenerator = realm.generator;\n        // TODO: Because global variables are special, checking for missing global object properties doesn't quite work yet.\n        if (\n          realmGenerator &&\n          typeof P === \"string\" &&\n          O !== realm.$GlobalObject &&\n          !realm.hasBindingBeenChecked(O, P)\n        ) {\n          realm.markPropertyAsChecked(O, P);\n          realmGenerator.emitPropertyInvariant(O, P, \"MISSING\");\n        }\n      }\n      return undefined;\n    }\n\n    // 3. Let D be a newly created Property Descriptor with no fields.\n    let D = new PropertyDescriptor({});\n\n    // 4. Let X be O's own property whose key is P.\n    let X = existingBinding.descriptor;\n    invariant(X !== undefined);\n\n    if (X instanceof AbstractJoinedDescriptor) {\n      return new AbstractJoinedDescriptor(X.joinCondition, X.descriptor1, X.descriptor2);\n    }\n    invariant(X instanceof PropertyDescriptor);\n\n    // 5. If X is a data property, then\n    if (IsDataDescriptor(realm, X)) {\n      let value = X.value;\n      if (O.isIntrinsic() && O.isPartialObject()) {\n        if (value instanceof AbstractValue) {\n          let savedUnion;\n          if (value.kind === \"abstractConcreteUnion\") {\n            // TODO: Simplify this code by using helpers from the AbstractValue factory\n            // instead of deriving values directly.\n            savedUnion = value;\n            value = savedUnion.args[0];\n            invariant(value instanceof AbstractValue);\n          }\n          if (value.kind !== \"resolved\") {\n            let realmGenerator = realm.generator;\n            invariant(realmGenerator);\n            invariant(value.operationDescriptor);\n            const functionResultType = value instanceof AbstractObjectValue ? value.functionResultType : undefined;\n            value = realmGenerator.deriveAbstract(value.types, value.values, value.args, value.operationDescriptor, {\n              isPure: true,\n              kind: \"resolved\",\n              // We can't emit the invariant here otherwise it'll assume the AbstractValue's type not the union type\n              skipInvariant: true,\n            });\n            if (savedUnion !== undefined) {\n              invariant(value instanceof AbstractValue);\n              let concreteValues = (savedUnion.args.filter(e => e instanceof ConcreteValue): any);\n              invariant(concreteValues.length === savedUnion.args.length - 1);\n              value = AbstractValue.createAbstractConcreteUnion(realm, value, concreteValues);\n            }\n            if (functionResultType !== undefined) {\n              invariant(value instanceof AbstractObjectValue);\n              value.functionResultType = functionResultType;\n            }\n            if (realm.invariantLevel >= 1 && typeof P === \"string\" && !realm.hasBindingBeenChecked(O, P)) {\n              realm.markPropertyAsChecked(O, P);\n              realmGenerator.emitFullInvariant(O, P, value);\n            }\n            InternalSetProperty(\n              realm,\n              O,\n              P,\n              new PropertyDescriptor({\n                value: value,\n                writable: X.writable !== undefined ? X.writable : false,\n                enumerable: X.enumerable !== undefined ? X.enumerable : false,\n                configurable: X.configurable !== undefined ? X.configurable : false,\n              })\n            );\n          }\n        } else if (realm.invariantLevel >= 1 && value instanceof Value && !(value instanceof AbstractValue)) {\n          let realmGenerator = realm.generator;\n          invariant(realmGenerator);\n          if (typeof P === \"string\" && !realm.hasBindingBeenChecked(O, P)) {\n            realm.markPropertyAsChecked(O, P);\n            realmGenerator.emitFullInvariant(O, P, value);\n          }\n        }\n      } else {\n        // TODO: Because global variables are special, checking for global object properties doesn't quite work yet.\n        if (O !== realm.$GlobalObject && O.isIntrinsic() && realm.invariantLevel >= 2 && value instanceof Value) {\n          let realmGenerator = realm.generator;\n          if (realmGenerator && typeof P === \"string\" && !realm.hasBindingBeenChecked(O, P)) {\n            realm.markPropertyAsChecked(O, P);\n            realmGenerator.emitFullInvariant(O, P, value);\n          }\n        }\n      }\n\n      // a. Set D.[[Value]] to the value of X's [[Value]] attribute.\n      D.value = value;\n\n      // b. Set D.[[Writable]] to the value of X's [[Writable]] attribute.\n      D.writable = X.writable;\n    } else {\n      // 6. Else X is an accessor property,\n      invariant(IsAccessorDescriptor(realm, X), \"expected accessor property\");\n\n      // a. Set D.[[Get]] to the value of X's [[Get]] attribute.\n      D.get = X.get;\n\n      // b. Set D.[[Set]] to the value of X's [[Set]] attribute.\n      D.set = X.set;\n    }\n\n    // 7. Set D.[[Enumerable]] to the value of X's [[Enumerable]] attribute.\n    D.enumerable = X.enumerable;\n\n    // 8. Set D.[[Configurable]] to the value of X's [[Configurable]] attribute.\n    D.configurable = X.configurable;\n\n    // 9. Return D.\n    return D;\n  }\n\n  // ECMA262 9.1.2.1\n  OrdinarySetPrototypeOf(realm: Realm, O: ObjectValue, V: ObjectValue | NullValue): boolean {\n    ensureIsNotFinal(realm, O);\n    if (!realm.ignoreLeakLogic && O.mightBeLeakedObject()) {\n      throw new FatalError();\n    }\n\n    // 1. Assert: Either Type(V) is Object or Type(V) is Null.\n    invariant(V instanceof ObjectValue || V instanceof NullValue);\n\n    // 2. Let extensible be the value of the [[Extensible]] internal slot of O.\n    let extensible = O.getExtensible();\n\n    // 3. Let current be the value of the [[Prototype]] internal slot of O.\n    let current = O.$Prototype;\n\n    // 4. If SameValue(V, current) is true, return true.\n    if (SameValuePartial(realm, V, current)) return true;\n\n    // 5. If extensible is false, return false.\n    if (!extensible) return false;\n\n    // 6. Let p be V.\n    let p = V;\n\n    // 7. Let done be false.\n    let done = false;\n\n    // 8. Repeat while done is false,\n    while (!done) {\n      // a. If p is null, let done be true.\n      if (p instanceof NullValue) {\n        done = true;\n      } else if (SameValuePartial(realm, p, O)) {\n        // b. Else if SameValue(p, O) is true, return false.\n        return false;\n      } else {\n        // c. Else,\n        // If the [[GetPrototypeOf]] internal method of p is not the ordinary object internal method defined in 9.1.1, let done be true.\n        if (!p.usesOrdinaryObjectInternalPrototypeMethods()) {\n          done = true;\n        } else {\n          // ii. Else, let p be the value of p's [[Prototype]] internal slot.\n          p = p.$Prototype;\n          if (p instanceof AbstractObjectValue) {\n            AbstractValue.reportIntrospectionError(p);\n            throw new FatalError();\n          }\n        }\n      }\n    }\n\n    // 9. Set the value of the [[Prototype]] internal slot of O to V.\n    O.$Prototype = V;\n\n    // 10. Return true.\n    return true;\n  }\n\n  // ECMA262 13.7.5.15\n  EnumerateObjectProperties(realm: Realm, O: ObjectValue): ObjectValue {\n    /*global global*/\n    let visited = new global.Set();\n    let obj = O;\n    let keys = O.$OwnPropertyKeys();\n    let index = 0;\n\n    let iterator = new ObjectValue(realm);\n    iterator.defineNativeMethod(\"next\", 0, () => {\n      while (true) {\n        if (index >= keys.length) {\n          let proto = obj.$GetPrototypeOf();\n          if (proto instanceof NullValue) {\n            return Create.CreateIterResultObject(realm, realm.intrinsics.undefined, true);\n          }\n          obj = proto;\n          keys = obj.$OwnPropertyKeys();\n          index = 0;\n        }\n\n        let key = keys[index];\n\n        // Omit symbols.\n        if (!(key instanceof StringValue)) {\n          index += 1;\n          continue;\n        }\n\n        // Omit non-enumerable properties.\n        let desc = obj.$GetOwnProperty(key);\n        if (desc && !desc.throwIfNotConcrete(realm).enumerable) {\n          this.ThrowIfMightHaveBeenDeleted(desc);\n          index += 1;\n          visited.add(key.value);\n          continue;\n        }\n\n        // Omit duplicates.\n        if (visited.has(key.value)) {\n          index += 1;\n          continue;\n        }\n        visited.add(key.value);\n\n        // Yield the key.\n        return Create.CreateIterResultObject(realm, key, false);\n      }\n    });\n    return iterator;\n  }\n\n  ThrowIfMightHaveBeenDeleted(desc: Descriptor): void {\n    if (desc instanceof AbstractJoinedDescriptor) {\n      if (desc.descriptor1) {\n        this.ThrowIfMightHaveBeenDeleted(desc.descriptor1);\n      }\n      if (desc.descriptor2) {\n        this.ThrowIfMightHaveBeenDeleted(desc.descriptor2);\n      }\n    }\n    invariant(desc instanceof PropertyDescriptor, \"internal slots should never assert using this\");\n    let value = desc.value;\n    if (value === undefined) {\n      return;\n    }\n    if (!value.mightHaveBeenDeleted()) return;\n    invariant(value instanceof AbstractValue); // real empty values should never get here\n    let v = value.$Realm.simplifyAndRefineAbstractValue(value);\n    if (!v.mightHaveBeenDeleted()) return;\n    AbstractValue.reportIntrospectionError(value);\n    throw new FatalError();\n  }\n\n  ThrowIfInternalSlotNotWritable<T: ObjectValue>(realm: Realm, object: T, key: string): T {\n    if (!realm.isNewObject(object)) {\n      AbstractValue.reportIntrospectionError(object, key);\n      throw new FatalError();\n    }\n    return object;\n  }\n\n  // ECMA 14.3.9\n  PropertyDefinitionEvaluation(\n    realm: Realm,\n    MethodDefinition: BabelNodeObjectMethod | BabelNodeClassMethod,\n    object: ObjectValue,\n    env: LexicalEnvironment,\n    strictCode: boolean,\n    enumerable: boolean\n  ): boolean {\n    // MethodDefinition : PropertyName ( StrictFormalParameters ) { FunctionBody }\n    if (MethodDefinition.kind === \"method\") {\n      // 1. Let methodDef be DefineMethod of MethodDefinition with argument object.\n      let methodDef = Functions.DefineMethod(realm, MethodDefinition, object, env, strictCode);\n\n      // 2. ReturnIfAbrupt(methodDef).\n\n      // 3. Perform SetFunctionName(methodDef.[[closure]], methodDef.[[key]]).\n      Functions.SetFunctionName(realm, methodDef.$Closure, methodDef.$Key);\n\n      // If the AST name was computed, give the hint to the closure\n      methodDef.$Closure.$HasComputedName = !!MethodDefinition.computed;\n\n      // 4. Let desc be the Property Descriptor{[[Value]]: methodDef.[[closure]], [[Writable]]: true, [[Enumerable]]: enumerable, [[Configurable]]: true}.\n      let desc: Descriptor = new PropertyDescriptor({\n        value: methodDef.$Closure,\n        writable: true,\n        enumerable: enumerable,\n        configurable: true,\n      });\n\n      // 5. Return DefinePropertyOrThrow(object, methodDef.[[key]], desc).\n      return this.DefinePropertyOrThrow(realm, object, methodDef.$Key, desc);\n    } else if (MethodDefinition.kind === \"generator\") {\n      // MethodDefinition : GeneratorMethod\n      // See 14.4.\n      // ECMA 14.4.13\n      // 1. Let propKey be the result of evaluating PropertyName.\n      let propKey = EvalPropertyName(MethodDefinition, env, realm, strictCode);\n\n      // 2. ReturnIfAbrupt(propKey).\n      // 3. If the function code for this GeneratorMethod is strict mode code, let strict be true. Otherwise let strict be false.\n      let strict = strictCode || IsStrict(MethodDefinition.body);\n\n      // 4. Let scope be the running execution context’s LexicalEnvironment.\n      let scope = env;\n\n      // 5. Let closure be GeneratorFunctionCreate(Method, StrictFormalParameters, GeneratorBody, scope, strict).\n      let closure = Functions.GeneratorFunctionCreate(\n        realm,\n        \"method\",\n        MethodDefinition.params,\n        MethodDefinition.body,\n        scope,\n        strict\n      );\n\n      // 6. Perform MakeMethod(closure, object).\n      Functions.MakeMethod(realm, closure, object);\n\n      // 7. Let prototype be ObjectCreate(%GeneratorPrototype%).\n      let prototype = Create.ObjectCreate(realm, realm.intrinsics.GeneratorPrototype);\n      prototype.originalConstructor = closure;\n\n      // 8. Perform MakeConstructor(closure, true, prototype).\n      MakeConstructor(realm, closure, true, prototype);\n\n      // 9. Perform SetFunctionName(closure, propKey).\n      Functions.SetFunctionName(realm, closure, propKey);\n\n      // 10. Let desc be the Property Descriptor{[[Value]]: closure, [[Writable]]: true, [[Enumerable]]: enumerable, [[Configurable]]: true}.\n      let desc: Descriptor = new PropertyDescriptor({\n        value: closure,\n        writable: true,\n        enumerable: enumerable,\n        configurable: true,\n      });\n\n      // 11. Return DefinePropertyOrThrow(object, propKey, desc).\n      return this.DefinePropertyOrThrow(realm, object, propKey, desc);\n    } else if (MethodDefinition.kind === \"get\") {\n      // 1. Let propKey be the result of evaluating PropertyName.\n      let propKey = EvalPropertyName(MethodDefinition, env, realm, strictCode);\n\n      // 2. ReturnIfAbrupt(propKey).\n\n      // 3. If the function code for this MethodDefinition is strict mode code, let strict be true. Otherwise let strict be false.\n      let strict = strictCode || IsStrict(MethodDefinition.body);\n\n      // 4. Let scope be the running execution context's LexicalEnvironment.\n      let scope = env;\n\n      // 5. Let formalParameterList be the production FormalParameters:[empty] .\n      let formalParameterList = [];\n\n      // 6. Let closure be FunctionCreate(Method, formalParameterList, FunctionBody, scope, strict).\n      let closure = Functions.FunctionCreate(\n        realm,\n        \"method\",\n        formalParameterList,\n        MethodDefinition.body,\n        scope,\n        strict\n      );\n\n      // 7. Perform MakeMethod(closure, object).\n      Functions.MakeMethod(realm, closure, object);\n\n      // 8. Perform SetFunctionName(closure, propKey, \"get\").\n      Functions.SetFunctionName(realm, closure, propKey, \"get\");\n\n      // If the AST name was computed, give the hint to the closure\n      closure.$HasComputedName = !!MethodDefinition.computed;\n\n      // 9. Let desc be the PropertyDescriptor{[[Get]]: closure, [[Enumerable]]: enumerable, [[Configurable]]: true}.\n      let desc = new PropertyDescriptor({\n        get: closure,\n        enumerable: true,\n        configurable: true,\n      });\n\n      // 10. Return ? DefinePropertyOrThrow(object, propKey, desc).\n      return this.DefinePropertyOrThrow(realm, object, propKey, desc);\n    } else {\n      invariant(MethodDefinition.kind === \"set\");\n      // 1. Let propKey be the result of evaluating PropertyName.\n      let propKey = EvalPropertyName(MethodDefinition, env, realm, strictCode);\n\n      // 2. ReturnIfAbrupt(propKey).\n\n      // 3. If the function code for this MethodDefinition is strict mode code, let strict be true. Otherwise let strict be false.\n      let strict = strictCode || IsStrict(MethodDefinition.body);\n\n      // 4. Let scope be the running execution context's LexicalEnvironment.\n      let scope = env;\n\n      // 5. Let closure be FunctionCreate(Method, PropertySetParameterList, FunctionBody, scope, strict).\n      let closure = Functions.FunctionCreate(\n        realm,\n        \"method\",\n        MethodDefinition.params,\n        MethodDefinition.body,\n        scope,\n        strict\n      );\n\n      // 6. Perform MakeMethod(closure, object).\n      Functions.MakeMethod(realm, closure, object);\n\n      // 7. Perform SetFunctionName(closure, propKey, \"set\").\n      Functions.SetFunctionName(realm, closure, propKey, \"set\");\n\n      // If the AST name was computed, give the hint to the closure\n      closure.$HasComputedName = !!MethodDefinition.computed;\n\n      // 8. Let desc be the PropertyDescriptor{[[Set]]: closure, [[Enumerable]]: enumerable, [[Configurable]]: true}.\n      let desc = new PropertyDescriptor({\n        set: closure,\n        enumerable: true,\n        configurable: true,\n      });\n\n      // 9. Return ? DefinePropertyOrThrow(object, propKey, desc).\n      return this.DefinePropertyOrThrow(realm, object, propKey, desc);\n    }\n  }\n\n  GetOwnPropertyKeysArray(\n    realm: Realm,\n    O: ObjectValue,\n    allowAbstractKeys: boolean,\n    getOwnPropertyKeysEvenIfPartial: boolean\n  ): Array<string> {\n    if (\n      (O.isPartialObject() && !getOwnPropertyKeysEvenIfPartial) ||\n      O.mightBeLeakedObject() ||\n      O.unknownProperty !== undefined\n    ) {\n      AbstractValue.reportIntrospectionError(O);\n      throw new FatalError();\n    }\n\n    let keyArray = Array.from(O.properties.keys());\n    keyArray = keyArray.filter(x => {\n      let pb = O.properties.get(x);\n      if (!pb || pb.descriptor === undefined) return false;\n      let pv = pb.descriptor.throwIfNotConcrete(realm).value;\n      if (pv === undefined) return true;\n      invariant(pv instanceof Value);\n      if (!pv.mightHaveBeenDeleted()) return true;\n      // The property may or may not be there at runtime.\n      // We can at best return an abstract keys array.\n      // For now, unless the caller has told us that is okay,\n      // just terminate.\n      invariant(pv instanceof AbstractValue);\n      if (allowAbstractKeys) return true;\n      AbstractValue.reportIntrospectionError(pv);\n      throw new FatalError();\n    });\n    realm.callReportObjectGetOwnProperties(O);\n    return keyArray;\n  }\n}\n"
  },
  {
    "path": "src/methods/proxy.js",
    "content": "/**\n * Copyright (c) 2017-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n/* @flow strict-local */\n\nimport type { Realm } from \"../realm.js\";\nimport { ProxyValue, NullValue, ObjectValue, Value, UndefinedValue } from \"../values/index.js\";\nimport { IsCallable } from \"./is.js\";\nimport { GetMethod } from \"./get.js\";\nimport { Construct } from \"./construct.js\";\nimport { Call } from \"./call.js\";\nimport { Create } from \"../singletons.js\";\nimport invariant from \"../invariant.js\";\n\n// ECMA262 9.5.12\nexport function ProxyCall(realm: Realm, O: ProxyValue, thisArgument: Value, argumentsList: Array<Value>): Value {\n  // 1. Let handler be the value of the [[ProxyHandler]] internal slot of O.\n  let handler = O.$ProxyHandler;\n\n  // 2. If handler is null, throw a TypeError exception.\n  if (handler instanceof NullValue) {\n    throw realm.createErrorThrowCompletion(realm.intrinsics.TypeError);\n  }\n\n  // 3. Assert: Type(handler) is Object.\n  invariant(handler instanceof ObjectValue, \"expected an object\");\n\n  // 4. Let target be the value of the [[ProxyTarget]] internal slot of O.\n  let target = O.$ProxyTarget;\n\n  // 5. Let trap be ? GetMethod(handler, \"apply\").\n  let trap = GetMethod(realm, handler, \"apply\");\n\n  // 6. If trap is undefined, then\n  if (trap instanceof UndefinedValue) {\n    // a. Return ? Call(target, thisArgument, argumentsList).\n    return Call(realm, target, thisArgument, argumentsList);\n  }\n\n  // 7. Let argArray be CreateArrayFromList(argumentsList).\n  let argArray = Create.CreateArrayFromList(realm, argumentsList);\n\n  // 8. Return ? Call(trap, handler, « target, thisArgument, argArray »).\n  return Call(realm, trap.throwIfNotConcrete(), handler, [target, thisArgument, argArray]);\n}\n\n// ECMA262 9.5.13\nexport function ProxyConstruct(\n  realm: Realm,\n  O: ProxyValue,\n  argumentsList: Array<Value>,\n  newTarget: ObjectValue\n): ObjectValue {\n  // 1. Let handler be the value of the [[ProxyHandler]] internal slot of O.\n  let handler = O.$ProxyHandler;\n\n  // 2. If handler is null, throw a TypeError exception.\n  if (handler instanceof NullValue) {\n    throw realm.createErrorThrowCompletion(realm.intrinsics.TypeError);\n  }\n\n  // 3. Assert: Type(handler) is Object.\n  invariant(handler instanceof ObjectValue, \"expected an object\");\n\n  // 4. Let target be the value of the [[ProxyTarget]] internal slot of O.\n  let target = O.$ProxyTarget;\n  invariant(target instanceof ObjectValue);\n\n  // 5. Let trap be ? GetMethod(handler, \"construct\").\n  let trap = GetMethod(realm, handler, \"construct\");\n\n  // 6. If trap is undefined, then\n  if (trap instanceof UndefinedValue) {\n    // a. Assert: target has a [[Construct]] internal method.\n    invariant(target.$Construct, \"expected construct method\");\n\n    // b. Return ? Construct(target, argumentsList, newTarget).\n    return Construct(realm, target, argumentsList, newTarget).throwIfNotConcreteObject();\n  }\n\n  // 7. Let argArray be CreateArrayFromList(argumentsList).\n  let argArray = Create.CreateArrayFromList(realm, argumentsList);\n\n  // 8. Let newObj be ? Call(trap, handler, « target, argArray, newTarget »).\n  let newObj = Call(realm, trap.throwIfNotConcrete(), handler, [target, argArray, newTarget]).throwIfNotConcrete();\n\n  // 9. If Type(newObj) is not Object, throw a TypeError exception.\n  if (!(newObj instanceof ObjectValue)) {\n    throw realm.createErrorThrowCompletion(realm.intrinsics.TypeError);\n  }\n\n  // 10. Return newObj.\n  return newObj;\n}\n\n// ECMA262 9.5.14\nexport function ProxyCreate(realm: Realm, _target: Value, _handler: Value): ProxyValue {\n  let handler = _handler;\n  let target = _target.throwIfNotConcrete();\n\n  // 1. If Type(target) is not Object, throw a TypeError exception.\n  if (!(target instanceof ObjectValue)) {\n    throw realm.createErrorThrowCompletion(realm.intrinsics.TypeError);\n  }\n\n  // 2. If target is a Proxy exotic object and the value of the [[ProxyHandler]] internal slot of target is null, throw a TypeError exception.\n  if (target instanceof ProxyValue && (!target.$ProxyHandler || target.$ProxyHandler instanceof NullValue)) {\n    throw realm.createErrorThrowCompletion(realm.intrinsics.TypeError);\n  }\n\n  handler = handler.throwIfNotConcrete();\n  // 3. If Type(handler) is not Object, throw a TypeError exception.\n  if (!(handler instanceof ObjectValue)) {\n    throw realm.createErrorThrowCompletion(realm.intrinsics.TypeError);\n  }\n\n  // 4. If handler is a Proxy exotic object and the value of the [[ProxyHandler]] internal slot of handler is null, throw a TypeError exception.\n  if (handler instanceof ProxyValue && (!handler.$ProxyHandler || handler.$ProxyHandler instanceof NullValue)) {\n    throw realm.createErrorThrowCompletion(realm.intrinsics.TypeError);\n  }\n\n  // 5. Let P be a newly created object.\n  // 6. Set P's essential internal methods (except for [[Call]] and [[Construct]]) to the definitions specified in 9.5.\n  let P = new ProxyValue(realm);\n\n  // 7. If IsCallable(target) is true, then\n  if (IsCallable(realm, target)) {\n    // a. Set the [[Call]] internal method of P as specified in 9.5.12.\n    P.$Call = (thisArgument, argsList) => {\n      return ProxyCall(realm, P, thisArgument, argsList);\n    };\n\n    // b. If target has a [[Construct]] internal method, then\n    if (target.$Construct) {\n      // i. Set the [[Construct]] internal method of P as specified in 9.5.13.\n      P.$Construct = (argumentsList, newTarget) => {\n        return ProxyConstruct(realm, P, argumentsList, newTarget);\n      };\n    }\n  }\n\n  // 8. Set the [[ProxyTarget]] internal slot of P to target.\n  P.$ProxyTarget = target;\n\n  // 9. Set the [[ProxyHandler]] internal slot of P to handler.\n  P.$ProxyHandler = handler;\n\n  // 10. Return P.\n  return P;\n}\n"
  },
  {
    "path": "src/methods/regexp.js",
    "content": "/**\n * Copyright (c) 2017-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n/* @flow */\n\nimport type { Realm } from \"../realm.js\";\nimport invariant from \"../invariant.js\";\nimport { NullValue, NumberValue, ObjectValue, StringValue, UndefinedValue, Value } from \"../values/index.js\";\nimport { Get } from \"./get.js\";\nimport { IsCallable } from \"./is.js\";\nimport { Call } from \"./call.js\";\nimport { HasCompatibleType, HasSomeCompatibleType } from \"./has.js\";\nimport { Create, Properties, To } from \"../singletons.js\";\nimport { PropertyDescriptor } from \"../descriptors.js\";\n\n// ECMA262 21.2.3.2.3\nexport function RegExpCreate(realm: Realm, P: ?Value, F: ?Value): ObjectValue {\n  // 1. Let obj be ? RegExpAlloc(%RegExp%).\n  let obj = RegExpAlloc(realm, realm.intrinsics.RegExp);\n\n  // 2. Return ? RegExpInitialize(obj, P, F).\n  return RegExpInitialize(realm, obj, P, F);\n}\n\n// ECMA262 21.2.3.2.1\nexport function RegExpAlloc(realm: Realm, newTarget: ObjectValue): ObjectValue {\n  // 1. Let obj be ? OrdinaryCreateFromConstructor(newTarget, \"%RegExpPrototype%\", « [[RegExpMatcher]],\n  //    [[OriginalSource]], [[OriginalFlags]] »).\n  let obj = Create.OrdinaryCreateFromConstructor(realm, newTarget, \"RegExpPrototype\", {\n    $RegExpMatcher: undefined, // always initialized to not undefined before use\n    $OriginalSource: undefined, // ditto\n    $OriginalFlags: undefined, // ditto\n  });\n\n  // 2. Perform ! DefinePropertyOrThrow(obj, \"lastIndex\", PropertyDescriptor {[[Writable]]: true,\n  //    [[Enumerable]]: false, [[Configurable]]: false}).\n  Properties.DefinePropertyOrThrow(\n    realm,\n    obj,\n    \"lastIndex\",\n    new PropertyDescriptor({\n      writable: true,\n      enumerable: false,\n      configurable: false,\n    })\n  );\n\n  // 3. Return obj.\n  return obj;\n}\n\n// ECMA262 21.2.3.2.2\nexport function RegExpInitialize(realm: Realm, obj: ObjectValue, pattern: ?Value, flags: ?Value): ObjectValue {\n  // Note that obj is a new object, and we can thus write to internal slots\n  invariant(realm.isNewObject(obj));\n\n  // 1. If pattern is undefined, let P be the empty String.\n  let P;\n  if (!pattern || HasCompatibleType(pattern, UndefinedValue)) {\n    P = \"\";\n  } else {\n    // 2. Else, let P be ? ToString(pattern).\n    P = To.ToStringPartial(realm, pattern);\n  }\n\n  // 3. If flags is undefined, let F be the empty String.\n  let F;\n  if (!flags || HasCompatibleType(flags, UndefinedValue)) {\n    F = \"\";\n  } else {\n    // 4. Else, let F be ? ToString(flags).\n    F = To.ToStringPartial(realm, flags);\n  }\n\n  // 5. If F contains any code unit other than \"g\", \"i\", \"m\", \"u\", or \"y\" or if it contains the same code unit more than once, throw a SyntaxError exception.\n  for (let i = 0; i < F.length; ++i) {\n    if (\"gimuy\".indexOf(F.charAt(i)) < 0) {\n      throw realm.createErrorThrowCompletion(realm.intrinsics.SyntaxError, \"invalid RegExp flag\");\n    }\n    for (let j = i + 1; j < F.length; ++j) {\n      if (F.charAt(i) === F.charAt(j)) {\n        throw realm.createErrorThrowCompletion(realm.intrinsics.SyntaxError, \"duplicate RegExp flag\");\n      }\n    }\n  }\n\n  // 6. If F contains \"u\", let BMP be false; else let BMP be true.\n  let BMP = F.indexOf(\"u\") >= 0 ? false : true;\n\n  // 7. If BMP is true, then\n  if (BMP) {\n    // a. Parse P using the grammars in 21.2.1 and interpreting each of its 16-bit elements as a Unicode BMP\n    //    code point. UTF-16 decoding is not applied to the elements. The goal symbol for the parse is\n    //    Pattern. Throw a SyntaxError exception if P did not conform to the grammar, if any elements of P\n    //    were not matched by the parse, or if any Early Error conditions exist.\n    // b. Let patternCharacters be a List whose elements are the code unit elements of P.\n  } else {\n    // 8. Else,\n    // a. Parse P using the grammars in 21.2.1 and interpreting P as UTF-16 encoded Unicode code points\n    //    (6.1.4). The goal symbol for the parse is Pattern[U]. Throw a SyntaxError exception if P did not\n    //    conform to the grammar, if any elements of P were not matched by the parse, or if any Early Error\n    //    conditions exist.\n    // b. Let patternCharacters be a List whose elements are the code points resulting from applying UTF-16\n    //    decoding to P's sequence of elements.\n  }\n\n  // 9. Set the value of obj's [[OriginalSource]] internal slot to P.\n  obj.$OriginalSource = P;\n\n  // 10. Set the value of obj's [[OriginalFlags]] internal slot to F.\n  obj.$OriginalFlags = F;\n\n  // 11. Set obj's [[RegExpMatcher]] internal slot to the internal procedure that evaluates the above parse of\n  //     P by applying the semantics provided in 21.2.2 using patternCharacters as the pattern's List of\n  //     SourceCharacter values and F as the flag parameters.\n  try {\n    let computedFlags = \"y\";\n    if (F.indexOf(\"i\") >= 0) computedFlags += \"i\";\n    if (F.indexOf(\"u\") >= 0) computedFlags += \"u\";\n    if (F.indexOf(\"m\") >= 0) computedFlags += \"m\";\n    let matcher = new RegExp(P, (computedFlags: any));\n\n    obj.$RegExpMatcher = (S: string, lastIndex: number) => {\n      matcher.lastIndex = lastIndex;\n      let match = matcher.exec(S);\n      if (!match) {\n        return null;\n      }\n      return {\n        endIndex: match.index + match[0].length,\n        captures: match,\n      };\n    };\n  } catch (e) {\n    if (e instanceof SyntaxError) {\n      throw realm.createErrorThrowCompletion(realm.intrinsics.SyntaxError, \"invalid RegExp\");\n    } else throw e;\n  }\n\n  // 12. Perform ? Set(obj, \"lastIndex\", 0, true).\n  Properties.Set(realm, obj, \"lastIndex\", realm.intrinsics.zero, true);\n\n  // 13. Return obj.\n  return obj;\n}\n\n// ECMA262 21.2.5.2.1\nexport function RegExpExec(realm: Realm, R: ObjectValue, S: string): ObjectValue | NullValue {\n  // 1. Assert: Type(R) is Object.\n  invariant(R instanceof ObjectValue, \"Type(R) is Object\");\n\n  // 2. Assert: Type(S) is String.\n  invariant(typeof S === \"string\", \"Type(S) is String\");\n\n  // 3. Let exec be ? Get(R, \"exec\").\n  let exec = Get(realm, R, \"exec\");\n\n  // 4. If IsCallable(exec) is true, then\n  if (IsCallable(realm, exec)) {\n    // a. Let result be ? Call(exec, R, « S »).\n    let result = Call(realm, exec, R, [new StringValue(realm, S)]);\n\n    // b. If Type(result) is neither Object or Null, throw a TypeError exception.\n    if (!HasSomeCompatibleType(result, ObjectValue, NullValue)) {\n      throw realm.createErrorThrowCompletion(realm.intrinsics.TypeError, \"Type(result) is neither Object or Null\");\n    }\n\n    // c. Return result.\n    return ((result.throwIfNotConcrete(): any): ObjectValue | NullValue);\n  }\n\n  // 5. If R does not have a [[RegExpMatcher]] internal slot, throw a TypeError exception.\n  if (R.$RegExpMatcher === undefined) {\n    throw realm.createErrorThrowCompletion(\n      realm.intrinsics.TypeError,\n      \"R does not have a [[RegExpMatcher]] internal slot\"\n    );\n  }\n\n  // 6. Return ? RegExpBuiltinExec(R, S).\n  return RegExpBuiltinExec(realm, R, S);\n}\n\n// ECMA262 21.2.5.2.2\nexport function RegExpBuiltinExec(realm: Realm, R: ObjectValue, S: string): ObjectValue | NullValue {\n  // 1. Assert: R is an initialized RegExp instance.\n  invariant(\n    R.$RegExpMatcher !== undefined && R.$OriginalSource !== undefined && R.$OriginalFlags !== undefined,\n    \"R is an initialized RegExp instance\"\n  );\n\n  // 2. Assert: Type(S) is String.\n  invariant(typeof S === \"string\", \"Type(S) is String\");\n\n  // 3. Let length be the number of code units in S.\n  let length = S.length;\n\n  // 4. Let lastIndex be ? ToLength(? Get(R, \"lastIndex\")).\n  let lastIndex = To.ToLength(realm, Get(realm, R, \"lastIndex\"));\n\n  // 5. Let flags be R.[[OriginalFlags]].\n  let flags = R.$OriginalFlags;\n  invariant(typeof flags === \"string\");\n\n  // 6 .If flags contains \"g\", let global be true, else let global be false.\n  let global = flags.indexOf(\"g\") >= 0 ? true : false;\n\n  // 7. If flags contains \"y\", let sticky be true, else let sticky be false.\n  let sticky = flags.indexOf(\"y\") >= 0 ? true : false;\n\n  // 8. If global is false and sticky is false, let lastIndex be 0.\n  if (global === false && sticky === false) lastIndex = 0;\n\n  // 9. Let matcher be the value of R's [[RegExpMatcher]] internal slot.\n  let matcher = R.$RegExpMatcher;\n  invariant(matcher !== undefined);\n\n  // 10. If flags contains \"u\", let fullUnicode be true, else let fullUnicode be false.\n  let fullUnicode = flags.indexOf(\"u\") >= 0 ? true : false;\n\n  // 11. Let matchSucceeded be false.\n  let matchSucceeded = false;\n\n  let r = null;\n  // 12. Repeat, while matchSucceeded is false\n  while (!matchSucceeded) {\n    // a. If lastIndex > length, then\n    if (lastIndex > length) {\n      // i. Perform ? Set(R, \"lastIndex\", 0, true).\n      Properties.Set(realm, R, \"lastIndex\", realm.intrinsics.zero, true);\n      // ii. Return null.\n      return realm.intrinsics.null;\n    }\n\n    // b. Let r be matcher(S, lastIndex).\n    r = matcher(S, lastIndex);\n\n    // c. If r is failure, then\n    if (r == null) {\n      // i. If sticky is true, then\n      if (sticky) {\n        // 1. Perform ? Set(R, \"lastIndex\", 0, true).\n        Properties.Set(realm, R, \"lastIndex\", realm.intrinsics.zero, true);\n\n        // 2. Return null.\n        return realm.intrinsics.null;\n      }\n      // ii. Let lastIndex be AdvanceStringIndex(S, lastIndex, fullUnicode).\n      lastIndex = AdvanceStringIndex(realm, S, lastIndex, fullUnicode);\n    } else {\n      // d. Else,\n      // i. Assert: r is a State.\n      invariant(r, \"r is a State\");\n\n      // ii. Set matchSucceeded to true.\n      matchSucceeded = true;\n\n      // (not in standard) Let lastIndex be the index of the captures\n      lastIndex = (r.captures: any).index;\n    }\n  }\n  invariant(r != null);\n\n  // 13. Let e be r's endIndex value.\n  let e = r.endIndex;\n\n  // 14. If fullUnicode is true, then\n  if (fullUnicode) {\n    // TODO #1018 a. e is an index into the Input character list, derived from S, matched by matcher. Let eUTF be the smallest index into S that corresponds to the character at element e of Input. If e is greater than or equal to the length of Input, then eUTF is the number of code units in S.\n    // b. Let e be eUTF.\n  }\n\n  // 15. If global is true or sticky is true, then\n  if (global === true || sticky === true) {\n    // a. Perform ? Set(R, \"lastIndex\", e, true).\n    Properties.Set(realm, R, \"lastIndex\", new NumberValue(realm, e), true);\n  }\n\n  // 16. Let n be the length of r's captures List. (This is the same value as 21.2.2.1's NcapturingParens.)\n  let n = r.captures.length - 1;\n\n  // 17. Let A be ArrayCreate(n + 1).\n  let A = Create.ArrayCreate(realm, n + 1);\n\n  // 18. Assert: The value of A's \"length\" property is n + 1.\n  let lengthOfA = Get(realm, A, \"length\").throwIfNotConcrete();\n  invariant(lengthOfA instanceof NumberValue);\n  invariant(lengthOfA.value === n + 1, 'The value of A\\'s \"length\" property is n + 1');\n\n  // 19. Let matchIndex be lastIndex.\n  let matchIndex = lastIndex;\n\n  // 20. Perform ! CreateDataProperty(A, \"index\", matchIndex).\n  Create.CreateDataProperty(realm, A, \"index\", new NumberValue(realm, matchIndex));\n\n  // 21. Perform ! CreateDataProperty(A, \"input\", S).\n  Create.CreateDataProperty(realm, A, \"input\", new StringValue(realm, S));\n\n  // 22. Let matchedSubstr be the matched substring (i.e. the portion of S between offset lastIndex inclusive and offset e exclusive).\n  let matchedSubstr = S.substr(lastIndex, e - lastIndex);\n\n  // 23. Perform ! CreateDataProperty(A, \"0\", matchedSubstr).\n  Create.CreateDataProperty(realm, A, \"0\", new StringValue(realm, matchedSubstr));\n\n  // 24. For each integer i such that i > 0 and i ≤ n\n  for (let i = 1; i <= n; ++i) {\n    // a. Let captureI be ith element of r's captures List.\n    let captureI = r.captures[i];\n\n    let capturedValue;\n    // b. If captureI is undefined, let capturedValue be undefined.\n    if (captureI === undefined) {\n      capturedValue = realm.intrinsics.undefined;\n    } else if (fullUnicode) {\n      // c. Else if fullUnicode is true, then\n      // TODO #1018: i. Assert: captureI is a List of code points.\n      // ii. Let capturedValue be a string whose code units are the UTF16Encoding of the code points of captureI.\n      capturedValue = realm.intrinsics.undefined;\n    } else {\n      // d. Else, fullUnicode is false,\n      // i. Assert: captureI is a List of code units.\n      invariant(typeof captureI === \"string\");\n\n      // ii. Let capturedValue be a string consisting of the code units of captureI.\n      capturedValue = new StringValue(realm, captureI);\n    }\n\n    // e. Perform ! CreateDataProperty(A, ! ToString(i), capturedValue).\n    Create.CreateDataProperty(realm, A, To.ToString(realm, new NumberValue(realm, i)), capturedValue);\n  }\n\n  // 25. Return A.\n  return A;\n}\n\nexport function AdvanceStringIndex(realm: Realm, S: string, index: number, unicode: boolean): number {\n  // 1. Assert: Type(S) is String.\n  invariant(typeof S === \"string\", \"Type(S) is String\");\n\n  // 2. Assert: index is an integer such that 0≤index≤253-1.\n  invariant(index >= 0 && index <= Math.pow(2, 53) - 1, \"index is an integer such that 0≤index≤253-1\");\n\n  // 3. Assert: Type(unicode) is Boolean.\n  invariant(typeof unicode === \"boolean\", \"Type(unicode) is Boolean\");\n\n  // 4. If unicode is false, return index+1.\n  if (unicode === false) return index + 1;\n\n  // 5. Let length be the number of code units in S.\n  let length = S.length;\n\n  // 6. If index+1 ≥ length, return index+1.\n  if (index + 1 >= length) return index + 1;\n\n  // 7. Let first be the code unit value at index index in S.\n  let first = S.charCodeAt(index);\n\n  // 8. If first < 0xD800 or first > 0xDBFF, return index+1.\n  if (first < 0xd800 || first > 0xdbff) return index + 1;\n\n  // 9. Let second be the code unit value at index index+1 in S.\n  let second = S.charCodeAt(index + 1);\n\n  // 10. If second < 0xDC00 or second > 0xDFFF, return index+1.\n  if (second < 0xdc00 || second > 0xdfff) return index + 1;\n\n  // 11. Return index+2.\n  return index + 2;\n}\n\nexport function EscapeRegExpPattern(realm: Realm, P: string, F: string): string {\n  return P.replace(\"/\", \"/\");\n}\n"
  },
  {
    "path": "src/methods/to.js",
    "content": "/**\n * Copyright (c) 2017-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n/* @flow */\n\nimport type { Descriptor, CallableObjectValue } from \"../types.js\";\nimport type { Realm } from \"../realm.js\";\nimport { TypesDomain, ValuesDomain } from \"../domains/index.js\";\nimport { GetMethod, Get } from \"./get.js\";\nimport { Create } from \"../singletons.js\";\nimport { HasProperty } from \"./has.js\";\nimport { Call } from \"./call.js\";\nimport { CompilerDiagnostic, FatalError } from \"../errors.js\";\nimport { IsCallable } from \"./is.js\";\nimport { SameValue, SameValueZero } from \"./abstract.js\";\nimport {\n  AbstractObjectValue,\n  AbstractValue,\n  BooleanValue,\n  ConcreteValue,\n  NullValue,\n  NumberValue,\n  IntegralValue,\n  ObjectValue,\n  PrimitiveValue,\n  StringValue,\n  SymbolValue,\n  UndefinedValue,\n  Value,\n} from \"../values/index.js\";\nimport invariant from \"../invariant.js\";\nimport { createOperationDescriptor } from \"../utils/generator.js\";\nimport { PropertyDescriptor } from \"../descriptors.js\";\n\ntype ElementConvType = {\n  Int8: (Realm, numberOrValue) => number,\n  Int16: (Realm, numberOrValue) => number,\n  Int32: (Realm, numberOrValue) => number,\n  Uint8: (Realm, numberOrValue) => number,\n  Uint16: (Realm, numberOrValue) => number,\n  Uint32: (Realm, numberOrValue) => number,\n  Uint8Clamped: (Realm, numberOrValue) => number,\n};\ntype numberOrValue = number | Value;\n\nfunction modulo(x: number, y: number): number {\n  return x < 0 ? (x % y) + y : x % y;\n}\n\nexport class ToImplementation {\n  constructor() {\n    this.ElementConv = {\n      Int8: this.ToInt8.bind(this),\n      Int16: this.ToInt16.bind(this),\n      Int32: this.ToInt32.bind(this),\n      Uint8: this.ToUint8.bind(this),\n      Uint16: this.ToUint16.bind(this),\n      Uint32: this.ToUint32.bind(this),\n      Uint8Clamped: this.ToUint8Clamp.bind(this),\n    };\n  }\n\n  ElementConv: ElementConvType;\n\n  // ECMA262 7.1.5\n  ToInt32(realm: Realm, argument: numberOrValue): number {\n    // 1. Let number be ? ToNumber(argument).\n    let number = this.ToNumber(realm, argument);\n\n    // 2. If number is NaN, +0, -0, +∞, or -∞, return +0.\n    if (isNaN(number) || number === 0 || !isFinite(number)) return +0;\n\n    // 3. Let int be the mathematical value that is the same sign as number and whose magnitude is floor(abs(number)).\n    let int = number < 0 ? -Math.floor(Math.abs(number)) : Math.floor(Math.abs(number));\n\n    // 4. Let int16bit be int modulo 2^32.\n    let int32bit = modulo(int, Math.pow(2, 32));\n\n    // 5. If int32bit ≥ 2^31, return int32bit - 2^32; otherwise return int32bit.\n    return int32bit >= Math.pow(2, 31) ? int32bit - Math.pow(2, 32) : int32bit;\n  }\n\n  // ECMA262 7.1.6\n  ToUint32(realm: Realm, argument: numberOrValue): number {\n    // 1. Let number be ? ToNumber(argument).\n    let number = this.ToNumber(realm, argument);\n\n    // 2. If number is NaN, +0, -0, +∞, or -∞, return +0.\n    if (isNaN(number) || number === 0 || !isFinite(number)) return +0;\n\n    // 3. Let int be the mathematical value that is the same sign as number and whose magnitude is floor(abs(number)).\n    let int = number < 0 ? -Math.floor(Math.abs(number)) : Math.floor(Math.abs(number));\n\n    // 4. Let int16bit be int modulo 2^32.\n    let int32bit = modulo(int, Math.pow(2, 32));\n\n    // 5. Return int32bit.\n    return int32bit;\n  }\n\n  // ECMA262 7.1.7\n  ToInt16(realm: Realm, argument: numberOrValue): number {\n    // 1. Let number be ? ToNumber(argument).\n    let number = this.ToNumber(realm, argument);\n\n    // 2. If number is NaN, +0, -0, +∞, or -∞, return +0.\n    if (isNaN(number) || number === 0 || !isFinite(number)) return +0;\n\n    // 3. Let int be the mathematical value that is the same sign as number and whose magnitude is floor(abs(number)).\n    let int = number < 0 ? -Math.floor(Math.abs(number)) : Math.floor(Math.abs(number));\n\n    // 4. Let int16bit be int modulo 2^16.\n    let int16bit = modulo(int, Math.pow(2, 16));\n\n    // 5. If int16bit ≥ 2^15, return int16bit - 2^16; otherwise return int16bit.\n    return int16bit >= Math.pow(2, 15) ? int16bit - Math.pow(2, 16) : int16bit;\n  }\n\n  // ECMA262 7.1.8\n  ToUint16(realm: Realm, argument: numberOrValue): number {\n    // 1. Let number be ? ToNumber(argument).\n    let number = this.ToNumber(realm, argument);\n\n    // 2. If number is NaN, +0, -0, +∞, or -∞, return +0.\n    if (isNaN(number) || number === 0 || !isFinite(number)) return +0;\n\n    // 3. Let int be the mathematical value that is the same sign as number and whose magnitude is floor(abs(number)).\n    let int = number < 0 ? -Math.floor(Math.abs(number)) : Math.floor(Math.abs(number));\n\n    // 4. Let int16bit be int modulo 2^16.\n    let int16bit = modulo(int, Math.pow(2, 16));\n\n    // 5. Return int16bit.\n    return int16bit;\n  }\n\n  // ECMA262 7.1.9\n  ToInt8(realm: Realm, argument: numberOrValue): number {\n    // 1. Let number be ? ToNumber(argument).\n    let number = this.ToNumber(realm, argument);\n\n    // 2. If number is NaN, +0, -0, +∞, or -∞, return +0.\n    if (isNaN(number) || number === 0 || !isFinite(number)) return +0;\n\n    // 3. Let int be the mathematical value that is the same sign as number and whose magnitude is floor(abs(number)).\n    let int = number < 0 ? -Math.floor(Math.abs(number)) : Math.floor(Math.abs(number));\n\n    // 4. Let int8bit be int modulo 2^8.\n    let int8bit = modulo(int, Math.pow(2, 8));\n\n    // 5. If int8bit ≥ 2^7, return int8bit - 2^8; otherwise return int8bit.\n    return int8bit >= Math.pow(2, 7) ? int8bit - Math.pow(2, 8) : int8bit;\n  }\n\n  // ECMA262 7.1.10\n  ToUint8(realm: Realm, argument: numberOrValue): number {\n    // 1. Let number be ? ToNumber(argument).\n    let number = this.ToNumber(realm, argument);\n\n    // 2. If number is NaN, +0, -0, +∞, or -∞, return +0.\n    if (isNaN(number) || number === 0 || !isFinite(number)) return +0;\n\n    // 3. Let int be the mathematical value that is the same sign as number and whose magnitude is floor(abs(number)).\n    let int = number < 0 ? -Math.floor(Math.abs(number)) : Math.floor(Math.abs(number));\n\n    // 4. Let int8bit be int modulo 2^8.\n    let int8bit = modulo(int, Math.pow(2, 8));\n\n    // 5. Return int8bit.\n    return int8bit;\n  }\n\n  // ECMA262 7.1.11\n  ToUint8Clamp(realm: Realm, argument: numberOrValue): number {\n    // 1. Let number be ? ToNumber(argument).\n    let number = this.ToNumber(realm, argument);\n\n    // 2. If number is NaN, return +0.\n    if (isNaN(number)) return +0;\n\n    // 3. If number ≤ 0, return +0.\n    if (number <= 0) return +0;\n\n    // 4. If number ≥ 255, return 255.\n    if (number >= 255) return 255;\n\n    // 5. Let f be floor(number).\n    let f = Math.floor(number);\n\n    // 6. If f + 0.5 < number, return f + 1.\n    if (f + 0.5 < number) return f + 1;\n\n    // 7. If number < f + 0.5, return f.\n    if (number < f + 0.5) return f;\n\n    // 8. If f is odd, return f + 1.\n    if (f % 2 === 1) return f + 1;\n\n    // 9. Return f.\n    return f;\n  }\n\n  // ECMA262 19.3.3.1\n  thisBooleanValue(realm: Realm, value: Value): BooleanValue {\n    // 1. If Type(value) is Boolean, return value.\n    if (value instanceof BooleanValue) return value;\n\n    // 2. If Type(value) is Object and value has a [[BooleanData]] internal slot, then\n    if (value instanceof ObjectValue && value.$BooleanData) {\n      const booleanData = value.$BooleanData.throwIfNotConcreteBoolean();\n      // a. Assert: value's [[BooleanData]] internal slot is a Boolean value.\n      invariant(booleanData instanceof BooleanValue, \"expected boolean data internal slot to be a boolean value\");\n\n      // b. Return the value of value's [[BooleanData]] internal slot.\n      return booleanData;\n    }\n\n    value.throwIfNotConcrete();\n\n    // 3. Throw a TypeError exception.\n    throw realm.createErrorThrowCompletion(realm.intrinsics.TypeError);\n  }\n\n  // ECMA262 20.1.3\n  thisNumberValue(realm: Realm, value: Value): NumberValue {\n    // 1. If Type(value) is Number, return value.\n    if (value instanceof NumberValue) return value;\n\n    // 2. If Type(value) is Object and value has a [[NumberData]] internal slot, then\n    if (value instanceof ObjectValue && value.$NumberData) {\n      const numberData = value.$NumberData.throwIfNotConcreteNumber();\n      // a. Assert: value's [[NumberData]] internal slot is a Number value.\n      invariant(numberData instanceof NumberValue, \"expected number data internal slot to be a number value\");\n\n      // b. Return the value of value's [[NumberData]] internal slot.\n      return numberData;\n    }\n\n    value = value.throwIfNotConcrete();\n\n    // 3. Throw a TypeError exception.\n    throw realm.createErrorThrowCompletion(realm.intrinsics.TypeError);\n  }\n\n  // ECMA262 21.1.3\n  thisStringValue(realm: Realm, value: Value): StringValue {\n    // 1. If Type(value) is String, return value.\n    if (value instanceof StringValue) return value;\n\n    // 2. If Type(value) is Object and value has a [[StringData]] internal slot, then\n    if (value instanceof ObjectValue && value.$StringData) {\n      const stringData = value.$StringData.throwIfNotConcreteString();\n      // a. Assert: value's [[StringData]] internal slot is a String value.\n      invariant(stringData instanceof StringValue, \"expected string data internal slot to be a string value\");\n\n      // b. Return the value of value's [[StringData]] internal slot.\n      return stringData;\n    }\n\n    value = value.throwIfNotConcrete();\n\n    // 3. Throw a TypeError exception.\n    throw realm.createErrorThrowCompletion(realm.intrinsics.TypeError);\n  }\n\n  // ECMA262 6.2.4.5\n  ToPropertyDescriptor(realm: Realm, Obj: Value): Descriptor {\n    Obj = Obj.throwIfNotConcrete();\n\n    // 1. If Type(Obj) is not Object, throw a TypeError exception.\n    if (!(Obj instanceof ObjectValue)) {\n      throw realm.createErrorThrowCompletion(realm.intrinsics.TypeError);\n    }\n\n    // 2. Let desc be a new Property Descriptor that initially has no fields.\n    let desc = new PropertyDescriptor({});\n\n    // 3. Let hasEnumerable be ? HasProperty(Obj, \"enumerable\").\n    let hasEnumerable = HasProperty(realm, Obj, \"enumerable\");\n\n    // 4. If hasEnumerable is true, then\n    if (hasEnumerable === true) {\n      // a. Let enum be ToBoolean(? Get(Obj, \"enumerable\")).\n      let enu = this.ToBooleanPartial(realm, Get(realm, Obj, \"enumerable\"));\n\n      // b. Set the [[Enumerable]] field of desc to enum.\n      desc.enumerable = enu === true;\n    }\n\n    // 5. Let hasConfigurable be ? HasProperty(Obj, \"configurable\").\n    let hasConfigurable = HasProperty(realm, Obj, \"configurable\");\n\n    // 6. If hasConfigurable is true, then\n    if (hasConfigurable === true) {\n      // a. Let conf be ToBoolean(? Get(Obj, \"configurable\")).\n      let conf = this.ToBooleanPartial(realm, Get(realm, Obj, \"configurable\"));\n\n      // b. Set the [[Configurable]] field of desc to conf.\n      desc.configurable = conf === true;\n    }\n\n    // 7. Let hasValue be ? HasProperty(Obj, \"value\").\n    let hasValue = HasProperty(realm, Obj, \"value\");\n\n    // 8. If hasValue is true, then\n    if (hasValue === true) {\n      // a. Let value be ? Get(Obj, \"value\").\n      let value = Get(realm, Obj, \"value\");\n\n      // b. Set the [[Value]] field of desc to value.\n      desc.value = value;\n    }\n\n    // 9. Let hasWritable be ? HasProperty(Obj, \"writable\").\n    let hasWritable = HasProperty(realm, Obj, \"writable\");\n\n    // 10. If hasWritable is true, then\n    if (hasWritable === true) {\n      // a. Let writable be ToBoolean(? Get(Obj, \"writable\")).\n      let writable = this.ToBooleanPartial(realm, Get(realm, Obj, \"writable\"));\n\n      // b. Set the [[Writable]] field of desc to writable.\n      desc.writable = writable === true;\n    }\n\n    // 11. Let hasGet be ? HasProperty(Obj, \"get\").\n    let hasGet = HasProperty(realm, Obj, \"get\");\n\n    // 12. If hasGet is true, then\n    if (hasGet === true) {\n      // a. Let getter be ? Get(Obj, \"get\").\n      let getter = Get(realm, Obj, \"get\");\n\n      // b. If IsCallable(getter) is false and getter is not undefined, throw a TypeError exception.\n      if (IsCallable(realm, getter) === false && !getter.mightBeUndefined()) {\n        throw realm.createErrorThrowCompletion(realm.intrinsics.TypeError);\n      }\n      getter.throwIfNotConcrete();\n\n      // c. Set the [[Get]] field of desc to getter.\n      desc.get = ((getter: any): CallableObjectValue | UndefinedValue);\n    }\n\n    // 13. Let hasSet be ? HasProperty(Obj, \"set\").\n    let hasSet = HasProperty(realm, Obj, \"set\");\n\n    // 14. If hasSet is true, then\n    if (hasSet === true) {\n      // a. Let setter be ? Get(Obj, \"set\").\n      let setter = Get(realm, Obj, \"set\");\n\n      // b. If IsCallable(setter) is false and setter is not undefined, throw a TypeError exception.\n      if (IsCallable(realm, setter) === false && !setter.mightBeUndefined()) {\n        throw realm.createErrorThrowCompletion(realm.intrinsics.TypeError);\n      }\n      setter.throwIfNotConcrete();\n\n      // c. Set the [[Set]] field of desc to setter.\n      desc.set = ((setter: any): CallableObjectValue | UndefinedValue);\n    }\n\n    // 15. If either desc.[[Get]] or desc.[[Set]] is present, then\n    if (desc.get || desc.set) {\n      // a. If either desc.[[Value]] or desc.[[Writable]] is present, throw a TypeError exception.\n      if (desc.value !== undefined || desc.writable !== undefined) {\n        throw realm.createErrorThrowCompletion(realm.intrinsics.TypeError);\n      }\n    }\n\n    // 16. Return desc.\n    return desc;\n  }\n\n  // ECMA262 7.1.13\n  ToObject(realm: Realm, arg: Value): ObjectValue | AbstractObjectValue {\n    if (arg instanceof AbstractObjectValue) return arg;\n    if (arg instanceof AbstractValue) {\n      return this._WrapAbstractInObject(realm, arg);\n    }\n    if (arg instanceof UndefinedValue) {\n      throw realm.createErrorThrowCompletion(realm.intrinsics.TypeError);\n    } else if (arg instanceof NullValue) {\n      throw realm.createErrorThrowCompletion(realm.intrinsics.TypeError);\n    } else if (arg instanceof BooleanValue) {\n      let obj = new ObjectValue(realm, realm.intrinsics.BooleanPrototype);\n      obj.$BooleanData = arg;\n      return obj;\n    } else if (arg instanceof NumberValue) {\n      let obj = new ObjectValue(realm, realm.intrinsics.NumberPrototype);\n      obj.$NumberData = arg;\n      return obj;\n    } else if (arg instanceof StringValue) {\n      let obj = Create.StringCreate(realm, arg, realm.intrinsics.StringPrototype);\n      return obj;\n    } else if (arg instanceof SymbolValue) {\n      let obj = new ObjectValue(realm, realm.intrinsics.SymbolPrototype);\n      obj.$SymbolData = arg;\n      return obj;\n    } else if (arg instanceof ObjectValue) {\n      return arg;\n    }\n    invariant(false);\n  }\n\n  _WrapAbstractInObject(realm: Realm, arg: AbstractValue): ObjectValue | AbstractObjectValue {\n    let obj;\n    switch (arg.getType()) {\n      case IntegralValue:\n      case NumberValue:\n        obj = new ObjectValue(realm, realm.intrinsics.NumberPrototype);\n        obj.$NumberData = arg;\n        break;\n\n      case StringValue:\n        obj = new ObjectValue(realm, realm.intrinsics.StringPrototype);\n        obj.$StringData = arg;\n        break;\n\n      case BooleanValue:\n        obj = new ObjectValue(realm, realm.intrinsics.BooleanPrototype);\n        obj.$BooleanData = arg;\n        break;\n\n      case SymbolValue:\n        obj = new ObjectValue(realm, realm.intrinsics.SymbolPrototype);\n        obj.$SymbolData = arg;\n        break;\n\n      case UndefinedValue:\n      case NullValue:\n      case PrimitiveValue:\n        if (arg.mightBeNull() || arg.mightHaveBeenDeleted() || arg.mightBeUndefined())\n          throw realm.createErrorThrowCompletion(realm.intrinsics.TypeError);\n\n      /*eslint-disable */\n      default:\n        /*eslint-enable */\n        if (realm.isInPureScope()) {\n          // will be serialized as Object.assign(serialized_arg)\n          obj = AbstractValue.createFromType(realm, ObjectValue, \"explicit conversion to object\", [arg]);\n          invariant(obj instanceof AbstractObjectValue);\n        } else {\n          obj = arg.throwIfNotConcreteObject();\n        }\n        break;\n    }\n    return obj;\n  }\n\n  // ECMA262 7.1.15\n  ToLength(realm: Realm, argument: numberOrValue): number {\n    // Let len be ? ToInteger(argument).\n    let len = this.ToInteger(realm, argument);\n\n    // If len ≤ +0, return +0.\n    if (len <= 0) return +0;\n\n    // If len is +∞, return 2^53-1.\n    if (len === +Infinity) return Math.pow(2, 53) - 1;\n\n    // Return min(len, 2^53-1).\n    return Math.min(len, Math.pow(2, 53) - 1);\n  }\n\n  // ECMA262 7.1.4\n  ToInteger(realm: Realm, argument: numberOrValue): number {\n    // 1. Let number be ? ToNumber(argument).\n    let number = this.ToNumber(realm, argument);\n\n    // 2. If number is NaN, return +0.\n    if (isNaN(number)) return +0;\n\n    // 3. If number is +0, -0, +∞, or -∞, return number.\n    if (!isFinite(number) || number === 0) return number;\n\n    // 4. Return the number value that is the same sign as number and whose magnitude is floor(abs(number)).\n    return number < 0 ? -Math.floor(Math.abs(number)) : Math.floor(Math.abs(number));\n  }\n\n  // ECMA262 7.1.17\n  ToIndex(realm: Realm, value: number | ConcreteValue): number {\n    let index;\n    // 1. If value is undefined, then\n    if (value instanceof UndefinedValue) {\n      // a. Let index be 0.\n      index = 0;\n    } else {\n      // 2. Else,\n      // a. Let integerIndex be ? ToInteger(value).\n      let integerIndex = this.ToInteger(realm, value);\n\n      // b. If integerIndex < 0, throw a RangeError exception.\n      if (integerIndex < 0) {\n        throw realm.createErrorThrowCompletion(realm.intrinsics.RangeError, \"integerIndex < 0\");\n      }\n\n      // c. Let index be ! ToLength(integerIndex).\n      index = this.ToLength(realm, integerIndex);\n\n      // d. If SameValueZero(integerIndex, index) is false, throw a RangeError exception.\n      if (SameValueZero(realm, new NumberValue(realm, integerIndex), new NumberValue(realm, index)) === false) {\n        throw realm.createErrorThrowCompletion(realm.intrinsics.RangeError, \"integerIndex < 0\");\n      }\n    }\n    // 3. Return index.\n    return index;\n  }\n\n  ToIndexPartial(realm: Realm, value: numberOrValue): number {\n    return this.ToIndex(realm, typeof value === \"number\" ? value : value.throwIfNotConcrete());\n  }\n\n  ToNumber(realm: Realm, val: numberOrValue): number {\n    const num = this.ToNumberOrAbstract(realm, val);\n    if (typeof num !== \"number\") {\n      AbstractValue.reportIntrospectionError(num);\n      throw new FatalError();\n    }\n    return num;\n  }\n\n  // ECMA262 7.1.3\n  ToNumberOrAbstract(realm: Realm, val: numberOrValue | AbstractValue): AbstractValue | number {\n    if (typeof val === \"number\") {\n      return val;\n    } else if (val instanceof AbstractValue) {\n      return val;\n    } else if (val instanceof UndefinedValue) {\n      return NaN;\n    } else if (val instanceof NullValue) {\n      return +0;\n    } else if (val instanceof ObjectValue) {\n      let prim = this.ToPrimitiveOrAbstract(realm, val, \"number\");\n      return this.ToNumberOrAbstract(realm, prim);\n    } else if (val instanceof BooleanValue) {\n      if (val.value === true) {\n        return 1;\n      } else {\n        // `val.value === false`\n        return 0;\n      }\n    } else if (val instanceof NumberValue) {\n      return val.value;\n    } else if (val instanceof StringValue) {\n      return Number(val.value);\n    } else if (val instanceof SymbolValue) {\n      throw realm.createErrorThrowCompletion(realm.intrinsics.TypeError);\n    } else {\n      invariant(false, \"unexpected type of value\");\n    }\n  }\n\n  IsToNumberPure(realm: Realm, val: numberOrValue): boolean {\n    if (val instanceof Value) {\n      if (this.IsToPrimitivePure(realm, val)) {\n        let type = val.getType();\n        return type !== SymbolValue && type !== PrimitiveValue && type !== Value;\n      }\n      return false;\n    }\n    return true;\n  }\n\n  // ECMA262 7.1.1\n  ToPrimitive(realm: Realm, input: ConcreteValue, hint?: \"default\" | \"string\" | \"number\"): PrimitiveValue {\n    return this.ToPrimitiveOrAbstract(realm, input, hint).throwIfNotConcretePrimitive();\n  }\n\n  ToPrimitiveOrAbstract(\n    realm: Realm,\n    input: ConcreteValue,\n    hint?: \"default\" | \"string\" | \"number\"\n  ): AbstractValue | PrimitiveValue {\n    if (input instanceof PrimitiveValue) {\n      return input;\n    }\n\n    // When Type(input) is Object, the following steps are taken\n    invariant(input instanceof ObjectValue, \"expected an object\");\n\n    // 1. If PreferredType was not passed, let hint be \"default\".\n    hint = hint || \"default\";\n\n    // Following two steps are redundant since we just pass string hints.\n    // 2. Else if PreferredType is hint String, let hint be \"string\".\n    // 3. Else PreferredType is hint Number, let hint be \"number\".\n\n    // 4. Let exoticToPrim be ? GetMethod(input, @@toPrimitive).\n    let exoticToPrim = GetMethod(realm, input, realm.intrinsics.SymbolToPrimitive);\n\n    // 5. If exoticToPrim is not undefined, then\n    if (!(exoticToPrim instanceof UndefinedValue)) {\n      // a. Let result be ? Call(exoticToPrim, input, « hint »).\n      let result = Call(realm, exoticToPrim, input, [new StringValue(realm, hint)]);\n\n      // b. If Type(result) is not Object, return result.\n      if (!(result instanceof ObjectValue)) {\n        invariant(result instanceof PrimitiveValue);\n        return result;\n      }\n\n      // c. Throw a TypeError exception.\n      throw realm.createErrorThrowCompletion(realm.intrinsics.TypeError);\n    }\n\n    // 6. If hint is \"default\", let hint be \"number\".\n    if (hint === \"default\") hint = \"number\";\n\n    // 7. Return ? OrdinaryToPrimitive(input, hint).\n    return this.OrdinaryToPrimitiveOrAbstract(realm, input, hint);\n  }\n\n  // Returns result type of ToPrimitive if it is pure (terminates, does not throw exception, does not read or write heap), otherwise undefined.\n  GetToPrimitivePureResultType(realm: Realm, input: Value): void | typeof Value {\n    let type = input.getType();\n    if (input instanceof PrimitiveValue) return type;\n    if (input instanceof AbstractValue && !input.mightBeObject()) return PrimitiveValue;\n    return undefined;\n  }\n\n  IsToPrimitivePure(realm: Realm, input: Value) {\n    return this.GetToPrimitivePureResultType(realm, input) !== undefined;\n  }\n\n  // ECMA262 7.1.1\n  OrdinaryToPrimitive(realm: Realm, input: ObjectValue, hint: \"string\" | \"number\"): PrimitiveValue {\n    return this.OrdinaryToPrimitiveOrAbstract(realm, input, hint).throwIfNotConcretePrimitive();\n  }\n\n  OrdinaryToPrimitiveOrAbstract(\n    realm: Realm,\n    input: ObjectValue,\n    hint: \"string\" | \"number\"\n  ): AbstractValue | PrimitiveValue {\n    let methodNames;\n\n    // 1. Assert: Type(O) is Object.\n    invariant(input instanceof ObjectValue, \"Expected object\");\n\n    // 2. Assert: Type(hint) is String and its value is either \"string\" or \"number\".\n    invariant(hint === \"string\" || hint === \"number\", \"Expected string or number hint\");\n\n    // 3. If hint is \"string\", then\n    if (hint === \"string\") {\n      // a. Let methodNames be « \"toString\", \"valueOf\" ».\n      methodNames = [\"toString\", \"valueOf\"];\n    } else {\n      // 4. Else,\n      // a. Let methodNames be « \"valueOf\", \"toString\" ».\n      methodNames = [\"valueOf\", \"toString\"];\n    }\n\n    // 5. For each name in methodNames in List order, do\n    for (let name of methodNames) {\n      // a. Let method be ? Get(O, name).\n      let method = Get(realm, input, new StringValue(realm, name));\n\n      // b. If IsCallable(method) is true, then\n      if (IsCallable(realm, method)) {\n        // i. Let result be ? Call(method, O).\n        let result = Call(realm, method, input);\n        let resultType = result.getType();\n\n        // ii. If Type(result) is not Object, return result.\n        if (resultType === Value) {\n          invariant(result instanceof AbstractValue);\n          let error = new CompilerDiagnostic(\n            `${name} might return either an object or primitive`,\n            realm.currentLocation,\n            \"PP0028\",\n            \"RecoverableError\"\n          );\n          realm.handleError(error);\n          throw new FatalError();\n        }\n        if (Value.isTypeCompatibleWith(resultType, PrimitiveValue)) {\n          invariant(result instanceof AbstractValue || result instanceof PrimitiveValue);\n          return result;\n        }\n      }\n    }\n\n    // 6. Throw a TypeError exception.\n    throw realm.createErrorThrowCompletion(realm.intrinsics.TypeError, \"can't turn to primitive\");\n  }\n\n  // ECMA262 7.1.12\n  ToString(realm: Realm, val: string | ConcreteValue): string {\n    if (typeof val === \"string\") {\n      return val;\n    } else if (val instanceof StringValue) {\n      return val.value;\n    } else if (val instanceof NumberValue) {\n      return val.value + \"\";\n    } else if (val instanceof UndefinedValue) {\n      return \"undefined\";\n    } else if (val instanceof NullValue) {\n      return \"null\";\n    } else if (val instanceof SymbolValue) {\n      throw realm.createErrorThrowCompletion(realm.intrinsics.TypeError);\n    } else if (val instanceof BooleanValue) {\n      return val.value ? \"true\" : \"false\";\n    } else if (val instanceof ObjectValue) {\n      let primValue = this.ToPrimitive(realm, val, \"string\");\n      return this.ToString(realm, primValue);\n    } else {\n      throw realm.createErrorThrowCompletion(realm.intrinsics.TypeError, \"unknown value type, can't coerce to string\");\n    }\n  }\n\n  IsToStringPure(realm: Realm, input: string | Value): boolean {\n    if (input instanceof Value) {\n      if (this.IsToPrimitivePure(realm, input)) {\n        let type = input.getType();\n        return type !== SymbolValue && type !== PrimitiveValue && type !== Value;\n      }\n    }\n    return true;\n  }\n\n  ToStringPartial(realm: Realm, val: string | Value): string {\n    return this.ToString(realm, typeof val === \"string\" ? val : val.throwIfNotConcrete());\n  }\n\n  ToStringValue(realm: Realm, val: Value): Value {\n    if (val.getType() === StringValue) return val;\n    if (val instanceof ObjectValue) {\n      let primValue = this.ToPrimitiveOrAbstract(realm, val, \"string\");\n      if (primValue.getType() === StringValue) return primValue;\n      return this.ToStringValue(realm, primValue);\n    } else if (val instanceof ConcreteValue) {\n      let str = this.ToString(realm, val);\n      return new StringValue(realm, str);\n    } else if (val instanceof AbstractValue) {\n      return this.ToStringAbstract(realm, val);\n    } else {\n      invariant(false, \"unknown value type, can't coerce to string\");\n    }\n  }\n\n  ToStringAbstract(realm: Realm, value: AbstractValue): AbstractValue {\n    if (value.mightNotBeString()) {\n      let result;\n      // If the property is not a string we need to coerce it.\n      let coerceToString = createOperationDescriptor(\"COERCE_TO_STRING\");\n      if (value.mightBeObject() && !value.isSimpleObject()) {\n        // If this might be a non-simple object, we need to coerce this at a\n        // temporal point since it can have side-effects.\n        // We can't rely on comparison to do it later, even if\n        // it is non-strict comparison since we'll do multiple\n        // comparisons. So we have to be explicit about when this\n        // happens.\n        result = realm.evaluateWithPossibleThrowCompletion(\n          () => AbstractValue.createTemporalFromBuildFunction(realm, StringValue, [value], coerceToString),\n          TypesDomain.topVal,\n          ValuesDomain.topVal\n        );\n      } else {\n        result = AbstractValue.createFromBuildFunction(realm, StringValue, [value], coerceToString);\n      }\n      invariant(result instanceof AbstractValue);\n      return result;\n    }\n    return value;\n  }\n\n  // ECMA262 7.1.2\n  ToBoolean(realm: Realm, val: ConcreteValue): boolean {\n    if (val instanceof BooleanValue) {\n      return val.value;\n    } else if (val instanceof UndefinedValue) {\n      return false;\n    } else if (val instanceof NullValue) {\n      return false;\n    } else if (val instanceof NumberValue) {\n      return val.value !== 0 && !isNaN(val.value);\n    } else if (val instanceof StringValue) {\n      return val.value.length > 0;\n    } else if (val instanceof ObjectValue) {\n      return true;\n    } else if (val instanceof SymbolValue) {\n      return true;\n    } else {\n      invariant(!(val instanceof AbstractValue));\n      throw realm.createErrorThrowCompletion(\n        realm.intrinsics.TypeError,\n        \"unknown value type, can't coerce to a boolean\"\n      );\n    }\n  }\n\n  ToBooleanPartial(realm: Realm, val: Value): boolean {\n    if (!val.mightNotBeObject()) return true;\n    return this.ToBoolean(realm, val.throwIfNotConcrete());\n  }\n\n  // ECMA262 7.1.14\n  ToPropertyKey(realm: Realm, arg: ConcreteValue): SymbolValue | string /* but not StringValue */ {\n    // 1. Let key be ? ToPrimitive(argument, hint String).\n    let key = this.ToPrimitive(realm, arg, \"string\");\n\n    // 2. If Type(key) is Symbol, then\n    if (key instanceof SymbolValue) {\n      // a. Return key.\n      return key;\n    }\n\n    // 3. Return ! ToString(key).\n    return this.ToString(realm, key);\n  }\n\n  ToPropertyKeyPartial(realm: Realm, arg: Value): AbstractValue | SymbolValue | string /* but not StringValue */ {\n    if (arg instanceof ConcreteValue) return this.ToPropertyKey(realm, arg);\n    // if we are in pure scope, we can assume that ToPropertyKey\n    // won't cause side-effects even if it's not simple\n    if (arg.mightNotBeString() && arg.mightNotBeNumber() && !arg.isSimpleObject() && !realm.isInPureScope()) {\n      arg.throwIfNotConcrete();\n    }\n    invariant(arg instanceof AbstractValue);\n    return arg;\n  }\n\n  // ECMA262 7.1.16\n  CanonicalNumericIndexString(realm: Realm, argument: StringValue): number | void {\n    // 1. Assert: Type(argument) is String.\n    invariant(argument instanceof StringValue);\n\n    // 2. If argument is \"-0\", return −0.\n    if (argument.value === \"-0\") return -0;\n\n    // 3. Let n be ToNumber(argument).\n    let n = this.ToNumber(realm, argument);\n\n    // 4. If SameValue(ToString(n), argument) is false, return undefined.\n    if (SameValue(realm, new StringValue(realm, this.ToString(realm, new NumberValue(realm, n))), argument) === false)\n      return undefined;\n\n    // 5. Return n.\n    return n;\n  }\n}\n"
  },
  {
    "path": "src/methods/typedarray.js",
    "content": "/**\n * Copyright (c) 2017-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n/* @flow */\n\nimport type { Realm } from \"../realm.js\";\nimport type { TypedArrayKind } from \"../types.js\";\nimport { FatalError } from \"../errors.js\";\nimport {\n  AbstractValue,\n  AbstractObjectValue,\n  IntegerIndexedExotic,\n  ObjectValue,\n  Value,\n  NumberValue,\n  UndefinedValue,\n} from \"../values/index.js\";\nimport { GetPrototypeFromConstructor } from \"./get.js\";\nimport { AllocateArrayBuffer } from \"./arraybuffer.js\";\nimport { IsDetachedBuffer, IsInteger } from \"./is.js\";\nimport { GetValueFromBuffer, SetValueInBuffer } from \"./arraybuffer.js\";\nimport { Construct, SpeciesConstructor } from \"./construct.js\";\nimport { To } from \"../singletons.js\";\nimport invariant from \"../invariant.js\";\n\nexport const ArrayElementSize = {\n  Float32Array: 4,\n  Float64Array: 8,\n  Int8Array: 1,\n  Int16Array: 2,\n  Int32Array: 4,\n  Uint8Array: 1,\n  Uint16Array: 2,\n  Uint32Array: 4,\n  Uint8ClampedArray: 1,\n};\n\nexport const ArrayElementType = {\n  Float32Array: \"Float32\",\n  Float64Array: \"Float64\",\n  Int8Array: \"Int8\",\n  Int16Array: \"Int16\",\n  Int32Array: \"Int32\",\n  Uint8Array: \"Uint8\",\n  Uint16Array: \"Uint16\",\n  Uint32Array: \"Uint32\",\n  Uint8ClampedArray: \"Uint8Clamped\",\n};\n\n// ECMA262 9.4.5.7\nexport function IntegerIndexedObjectCreate(\n  realm: Realm,\n  prototype: ObjectValue | AbstractObjectValue,\n  internalSlotsList: { [key: string]: void }\n): ObjectValue {\n  // 1. Assert: internalSlotsList contains the names [[ViewedArrayBuffer]], [[ArrayLength]], [[ByteOffset]], and [[TypedArrayName]].\n  invariant(\n    \"$ViewedArrayBuffer\" in internalSlotsList &&\n      \"$ArrayLength\" in internalSlotsList &&\n      \"$ByteOffset\" in internalSlotsList &&\n      \"$TypedArrayName\" in internalSlotsList\n  );\n\n  // 2. Let A be a newly created object with an internal slot for each name in internalSlotsList.\n  let A = new IntegerIndexedExotic(realm);\n  Object.assign(A, internalSlotsList);\n\n  // 3. Set A's essential internal methods to the default ordinary object definitions specified in 9.1.\n  // 4. Set the [[GetOwnProperty]] internal method of A as specified in 9.4.5.1.\n  // 5. Set the [[HasProperty]] internal method of A as specified in 9.4.5.2.\n  // 6. Set the [[DefineOwnProperty]] internal method of A as specified in 9.4.5.3.\n  // 7. Set the [[Get]] internal method of A as specified in 9.4.5.4.\n  // 8. Set the [[Set]] internal method of A as specified in 9.4.5.5.\n  // 9. Set the [[OwnPropertyKeys]] internal method of A as specified in 9.4.5.6.\n\n  // 10. Set A.[[Prototype]] to prototype.\n  A.$Prototype = prototype;\n\n  // 11. Set A.[[Extensible]] to true.\n  A.setExtensible(true);\n\n  // 12. Return A.\n  return A;\n}\n\n// ECMA262 9.4.5.8\nexport function IntegerIndexedElementGet(realm: Realm, O: ObjectValue, index: number): NumberValue | UndefinedValue {\n  // 1. Assert: Type(index) is Number.\n  invariant(typeof index === \"number\", \"Type(index) is Number\");\n\n  // 2. Assert: O is an Object that has [[ViewedArrayBuffer]], [[ArrayLength]], [[ByteOffset]], and [[TypedArrayName]] internal slots.\n  invariant(\n    O instanceof ObjectValue &&\n      O.$ViewedArrayBuffer &&\n      O.$ArrayLength !== undefined &&\n      O.$ByteOffset !== undefined &&\n      O.$TypedArrayName\n  );\n\n  // 3. Let buffer be O.[[ViewedArrayBuffer]].\n  let buffer = O.$ViewedArrayBuffer;\n\n  // 4. If IsDetachedBuffer(buffer) is true, throw a TypeError exception.\n  if (IsDetachedBuffer(realm, buffer) === true) {\n    throw realm.createErrorThrowCompletion(realm.intrinsics.TypeError, \"IsDetachedBuffer(buffer) is true\");\n  }\n\n  // 5. If IsInteger(index) is false, return undefined.\n  if (IsInteger(realm, index) === false) return realm.intrinsics.undefined;\n\n  // 6. If index = -0, return undefined.\n  if (Object.is(index, -0)) return realm.intrinsics.undefined;\n\n  // 7. Let length be O.[[ArrayLength]].\n  let length = O.$ArrayLength;\n  invariant(typeof length === \"number\");\n\n  // 8. If index < 0 or index ≥ length, return undefined.\n  if (index < 0 || index >= length) return realm.intrinsics.undefined;\n\n  // 9. Let offset be O.[[ByteOffset]].\n  let offset = O.$ByteOffset;\n  invariant(typeof offset === \"number\");\n\n  // 10. Let arrayTypeName be the String value of O.[[TypedArrayName]].\n  let arrayTypeName = O.$TypedArrayName;\n  invariant(typeof arrayTypeName === \"string\");\n\n  // 11. Let elementSize be the Number value of the Element Size value specified in Table 50 for arrayTypeName.\n  let elementSize = ArrayElementSize[arrayTypeName];\n\n  // 12. Let indexedPosition be (index × elementSize) + offset.\n  let indexedPosition = index * elementSize + offset;\n\n  // 13. Let elementType be the String value of the Element Type value in Table 50 for arrayTypeName.\n  let elementType = ArrayElementType[arrayTypeName];\n\n  // 14. Return GetValueFromBuffer(buffer, indexedPosition, elementType).\n  return GetValueFromBuffer(realm, buffer, indexedPosition, elementType);\n}\n\n// ECMA262 9.4.5.9\nexport function IntegerIndexedElementSet(realm: Realm, O: ObjectValue, index: number, value: Value): boolean {\n  // 1. Assert: Type(index) is Number.\n  invariant(typeof index === \"number\", \"Type(index) is Number\");\n\n  // 2. Assert: O is an Object that has [[ViewedArrayBuffer]], [[ArrayLength]], [[ByteOffset]], and [[TypedArrayName]] internal slots.\n  invariant(\n    O instanceof ObjectValue &&\n      O.$ViewedArrayBuffer &&\n      O.$ArrayLength !== undefined &&\n      O.$ByteOffset !== undefined &&\n      O.$TypedArrayName\n  );\n\n  // 3. Let numValue be ? ToNumber(value).\n  let numValue = To.ToNumber(realm, value);\n\n  // 4. Let buffer be O.[[ViewedArrayBuffer]].\n  let buffer = O.$ViewedArrayBuffer;\n  invariant(buffer);\n\n  // 5. If IsDetachedBuffer(buffer) is true, throw a TypeError exception.\n  if (IsDetachedBuffer(realm, buffer) === true) {\n    throw realm.createErrorThrowCompletion(realm.intrinsics.TypeError, \"IsDetachedBuffer(buffer) is true\");\n  }\n\n  // 6. If IsInteger(index) is false, return false.\n  if (IsInteger(realm, index) === false) return false;\n\n  // 7. If index = -0, return false.\n  if (Object.is(index, -0)) return false;\n\n  // 8. Let length be O.[[ArrayLength]].\n  let length = O.$ArrayLength;\n  invariant(typeof length === \"number\");\n\n  // 9. If index < 0 or index ≥ length, return false.\n  if (index < 0 || index >= length) return false;\n\n  // 10. Let offset be O.[[ByteOffset]].\n  let offset = O.$ByteOffset;\n  invariant(typeof offset === \"number\");\n\n  // 11. Let arrayTypeName be the String value of O.[[TypedArrayName]].\n  let arrayTypeName = O.$TypedArrayName;\n  invariant(typeof arrayTypeName === \"string\");\n\n  // 12. Let elementSize be the Number value of the Element Size value specified in Table 50 for arrayTypeName.\n  let elementSize = ArrayElementSize[arrayTypeName];\n\n  // 13. Let indexedPosition be (index × elementSize) + offset.\n  let indexedPosition = index * elementSize + offset;\n\n  // 14. Let elementType be the String value of the Element Type value in Table 50 for arrayTypeName.\n  let elementType = ArrayElementType[arrayTypeName];\n\n  // 15. Perform SetValueInBuffer(buffer, indexedPosition, elementType, numValue).\n  SetValueInBuffer(realm, buffer, indexedPosition, elementType, numValue);\n\n  // 16. Return true.\n  return true;\n}\n\n// ECMA262 22.2.3.5.1\nexport function ValidateTypedArray(realm: Realm, O: Value): ObjectValue {\n  O = O.throwIfNotConcrete();\n\n  // 1. If Type(O) is not Object, throw a TypeError exception.\n  if (!(O instanceof ObjectValue)) {\n    throw realm.createErrorThrowCompletion(realm.intrinsics.TypeError, \"Type(O) is not Object\");\n  }\n\n  // 2. If O does not have a [[TypedArrayName]] internal slot, throw a TypeError exception.\n  if (!O.$TypedArrayName) {\n    throw realm.createErrorThrowCompletion(realm.intrinsics.TypeError, \"Type(O) is not Object\");\n  }\n\n  // 3. Assert: O has a [[ViewedArrayBuffer]] internal slot.\n  invariant(O.$ViewedArrayBuffer, \"O has a [[ViewedArrayBuffer]] internal slot\");\n\n  // 4. Let buffer be O.[[ViewedArrayBuffer]].\n  let buffer = O.$ViewedArrayBuffer;\n\n  // 5. If IsDetachedBuffer(buffer) is true, throw a TypeError exception.\n  if (IsDetachedBuffer(realm, buffer) === true) {\n    throw realm.createErrorThrowCompletion(realm.intrinsics.TypeError, \"IsDetachedBuffer(buffer) is true\");\n  }\n\n  // 6. Return buffer.\n  return buffer;\n}\n\n// ECMA262 22.2.4.2.1\nexport function AllocateTypedArray(\n  realm: Realm,\n  constructorName: TypedArrayKind,\n  newTarget: ObjectValue,\n  defaultProto: string,\n  length?: number\n): ObjectValue {\n  // 1. Let proto be ? GetPrototypeFromConstructor(newTarget, defaultProto).\n  let proto = GetPrototypeFromConstructor(realm, newTarget, defaultProto);\n\n  // 2. Let obj be IntegerIndexedObjectCreate(proto, « [[ViewedArrayBuffer]], [[TypedArrayName]], [[ByteLength]], [[ByteOffset]], [[ArrayLength]] »).\n  let obj = IntegerIndexedObjectCreate(realm, proto, {\n    $ViewedArrayBuffer: undefined,\n    $TypedArrayName: undefined,\n    $ByteLength: undefined,\n    $ByteOffset: undefined,\n    $ArrayLength: undefined,\n  });\n\n  // 3. Assert: obj.[[ViewedArrayBuffer]] is undefined.\n  invariant(obj.$ViewedArrayBuffer === undefined);\n\n  // 4. Set obj.[[TypedArrayName]] to constructorName.\n  obj.$TypedArrayName = constructorName;\n\n  // 5. If length was not passed, then\n  if (length === undefined) {\n    // a. Set obj.[[ByteLength]] to 0.\n    obj.$ByteLength = 0;\n\n    // b. Set obj.[[ByteOffset]] to 0.\n    obj.$ByteOffset = 0;\n\n    // c. Set obj.[[ArrayLength]] to 0.\n    obj.$ArrayLength = 0;\n  } else {\n    // 6. Else,\n    // a. Perform ? AllocateTypedArrayBuffer(obj, length).\n    AllocateTypedArrayBuffer(realm, obj, length);\n  }\n\n  // 7. Return obj.\n  return obj;\n}\n\n// ECMA262 22.2.4.2.2\nexport function AllocateTypedArrayBuffer(realm: Realm, O: ObjectValue, length: number): ObjectValue {\n  // Note that O is a new object, and we can thus write to internal slots\n  invariant(realm.isNewObject(O));\n\n  // 1. Assert: O is an Object that has a [[ViewedArrayBuffer]] internal slot.\n  invariant(\n    O instanceof ObjectValue && \"$ViewedArrayBuffer\" in O,\n    \"O is an Object that has a [[ViewedArrayBuffer]] internal slot\"\n  );\n\n  // 2. Assert: O.[[ViewedArrayBuffer]] is undefined.\n  invariant(O.$ViewedArrayBuffer === undefined, \"O.[[ViewedArrayBuffer]] is undefined\");\n\n  // 3. Assert: length ≥ 0.\n  invariant(length >= 0, \"length ≥ 0\");\n\n  // 4. Let constructorName be the String value of O.[[TypedArrayName]].\n  let constructorName = O.$TypedArrayName;\n  invariant(constructorName);\n\n  // 5. Let elementSize be the Element Size value in Table 50 for constructorName.\n  let elementSize = ArrayElementSize[constructorName];\n\n  // 6. Let byteLength be elementSize × length.\n  let byteLength = elementSize * length;\n\n  // 7. Let data be ? AllocateArrayBuffer(%ArrayBuffer%, byteLength).\n  let data = AllocateArrayBuffer(realm, realm.intrinsics.ArrayBuffer, byteLength);\n\n  // 8. Set O.[[ViewedArrayBuffer]] to data.\n  O.$ViewedArrayBuffer = data;\n\n  // 9. Set O.[[ByteLength]] to byteLength.\n  O.$ByteLength = byteLength;\n\n  // 10. Set O.[[ByteOffset]] to 0.\n  O.$ByteOffset = 0;\n\n  // 11. Set O.[[ArrayLength]] to length.\n  O.$ArrayLength = length;\n\n  // 12. Return O.\n  return O;\n}\n\n// ECMA262 22.2.4.6\nexport function TypedArrayCreate(realm: Realm, constructor: ObjectValue, argumentList: Array<Value>): ObjectValue {\n  // 1. Let newTypedArray be ? Construct(constructor, argumentList).\n  let newTypedArray = Construct(realm, constructor, argumentList).throwIfNotConcreteObject();\n\n  // 2. Perform ? ValidateTypedArray(newTypedArray).\n  ValidateTypedArray(realm, newTypedArray);\n\n  // 3. If argumentList is a List of a single Number, then\n  if (argumentList.length === 1 && argumentList[0].mightBeNumber()) {\n    if (argumentList[0].mightNotBeNumber()) {\n      invariant(argumentList[0] instanceof AbstractValue);\n      AbstractValue.reportIntrospectionError(argumentList[0]);\n      throw new FatalError();\n    }\n    // a. If newTypedArray.[[ArrayLength]] < argumentList[0], throw a TypeError exception.\n    invariant(typeof newTypedArray.$ArrayLength === \"number\");\n    if (newTypedArray.$ArrayLength < ((argumentList[0].throwIfNotConcrete(): any): NumberValue).value) {\n      throw realm.createErrorThrowCompletion(\n        realm.intrinsics.TypeError,\n        \"newTypedArray.[[ArrayLength]] < argumentList[0]\"\n      );\n    }\n  }\n\n  // 4. Return newTypedArray.\n  return newTypedArray;\n}\n\n// ECMA262 22.2.4.7\nexport function TypedArraySpeciesCreate(realm: Realm, exemplar: ObjectValue, argumentList: Array<Value>): ObjectValue {\n  // 1. Assert: exemplar is an Object that has a [[TypedArrayName]] internal slot.\n  invariant(exemplar instanceof ObjectValue && typeof exemplar.$TypedArrayName === \"string\");\n\n  // 2. Let defaultConstructor be the intrinsic object listed in column one of Table 50 for exemplar.[[TypedArrayName]].\n  invariant(typeof exemplar.$TypedArrayName === \"string\");\n  let defaultConstructor = {\n    Float32Array: realm.intrinsics.Float32Array,\n    Float64Array: realm.intrinsics.Float64Array,\n    Int8Array: realm.intrinsics.Int8Array,\n    Int16Array: realm.intrinsics.Int16Array,\n    Int32Array: realm.intrinsics.Int32Array,\n    Uint8Array: realm.intrinsics.Uint8Array,\n    Uint16Array: realm.intrinsics.Uint16Array,\n    Uint32Array: realm.intrinsics.Uint32Array,\n    Uint8ClampedArray: realm.intrinsics.Uint8ClampedArray,\n  }[exemplar.$TypedArrayName];\n\n  // 3. Let constructor be ? SpeciesConstructor(exemplar, defaultConstructor).\n  let constructor = SpeciesConstructor(realm, exemplar, defaultConstructor);\n\n  // 4. Return ? TypedArrayCreate(constructor, argumentList).\n  return TypedArrayCreate(realm, constructor, argumentList);\n}\n"
  },
  {
    "path": "src/methods/widen.js",
    "content": "/**\n * Copyright (c) 2017-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n/* @flow */\n\nimport type { Binding } from \"../environment.js\";\nimport { FatalError } from \"../errors.js\";\nimport type {\n  Bindings,\n  BindingEntry,\n  EvaluationResult,\n  PropertyBindings,\n  CreatedAbstracts,\n  CreatedObjects,\n  Realm,\n} from \"../realm.js\";\nimport { Effects } from \"../realm.js\";\nimport type { Descriptor, PropertyBinding } from \"../types.js\";\nimport { cloneDescriptor, equalDescriptors, PropertyDescriptor } from \"../descriptors.js\";\n\nimport { AbruptCompletion, JoinedNormalAndAbruptCompletions, SimpleNormalCompletion } from \"../completions.js\";\nimport { Reference } from \"../environment.js\";\nimport { IsDataDescriptor, StrictEqualityComparison } from \"./index.js\";\nimport { Generator, createOperationDescriptor } from \"../utils/generator.js\";\nimport { AbstractValue, ArrayValue, EmptyValue, Value, StringValue } from \"../values/index.js\";\n\nimport invariant from \"../invariant.js\";\nimport { InternalSlotDescriptor } from \"../descriptors.js\";\n\nexport class WidenImplementation {\n  _widenArrays(\n    realm: Realm,\n    v1: Array<Value> | Array<{ $Key: void | Value, $Value: void | Value }>,\n    v2: Array<Value> | Array<{ $Key: void | Value, $Value: void | Value }>\n  ): Array<Value> | Array<{ $Key: void | Value, $Value: void | Value }> {\n    if (v1[0] instanceof Value) {\n      invariant(v2[0] instanceof Value);\n      return this._widenArraysOfValues(realm, (v1: any), (v2: any));\n    }\n    invariant(!(v2[0] instanceof Value));\n    return this._widenArrayOfsMapEntries(realm, (v1: any), (v2: any));\n  }\n\n  _widenArrayOfsMapEntries(\n    realm: Realm,\n    a1: Array<{ $Key: void | Value, $Value: void | Value }>,\n    a2: Array<{ $Key: void | Value, $Value: void | Value }>\n  ): Array<{ $Key: void | Value, $Value: void | Value }> {\n    let n = Math.max((a1 && a1.length) || 0, (a2 && a2.length) || 0);\n    let result: Array<{ $Key: void | Value, $Value: void | Value }> = [];\n    for (let i = 0; i < n; i++) {\n      let { $Key: key1, $Value: val1 } = a1[i] || { $Key: undefined, $Value: undefined };\n      let { $Key: key2, $Value: val2 } = a2[i] || { $Key: undefined, $Value: undefined };\n      if (key1 === undefined && key2 === undefined) {\n        result[i] = { $Key: undefined, $Value: undefined };\n      } else {\n        if (key1 === undefined) key1 = key2;\n        else if (key2 === undefined) key2 = key1;\n        invariant(key1 !== undefined);\n        invariant(key2 !== undefined);\n        let key3 = this.widenValues(realm, key1, key2);\n        invariant(key3 instanceof Value);\n        if (val1 === undefined && val2 === undefined) {\n          result[i] = { $Key: key3, $Value: undefined };\n        } else {\n          if (val1 === undefined) val1 = val2;\n          else if (val2 === undefined) val2 = val1;\n          invariant(val1 !== undefined);\n          invariant(val2 !== undefined);\n          let val3 = this.widenValues(realm, val1, val2);\n          invariant(val3 === undefined || val3 instanceof Value);\n          result[i] = { $Key: key3, $Value: val3 };\n        }\n      }\n    }\n    return result;\n  }\n\n  _widenArraysOfValues(realm: Realm, a1: Array<Value>, a2: Array<Value>): Array<Value> {\n    let n = Math.max((a1 && a1.length) || 0, (a2 && a2.length) || 0);\n    let result = [];\n    for (let i = 0; i < n; i++) {\n      let wv = this.widenValues(realm, a1[i], a2[i]);\n      invariant(wv === undefined || wv instanceof Value);\n      result[i] = wv;\n    }\n    return result;\n  }\n\n  // Returns a new effects summary that includes both e1 and e2.\n  widenEffects(realm: Realm, e1: Effects, e2: Effects): Effects {\n    let result = this.widenResults(realm, e1.result, e2.result);\n    let bindings = this.widenBindings(realm, e1.modifiedBindings, e2.modifiedBindings);\n    let properties = this.widenPropertyBindings(\n      realm,\n      e1.modifiedProperties,\n      e2.modifiedProperties,\n      e1.createdObjects,\n      e2.createdObjects,\n      e1.createdAbstracts,\n      e2.createdAbstracts\n    );\n    let createdObjects = new Set(); // Top, since the empty set knows nothing. There is no other choice for widen.\n    let createdAbstracts = new Set();\n    let generator = new Generator(realm, \"widen\", realm.pathConditions); // code subject to widening will be generated somewhere else\n    return new Effects(result, generator, bindings, properties, createdObjects, createdAbstracts);\n  }\n\n  widenResults(\n    realm: Realm,\n    result1: EvaluationResult,\n    result2: EvaluationResult\n  ): JoinedNormalAndAbruptCompletions | SimpleNormalCompletion {\n    invariant(!(result1 instanceof Reference || result2 instanceof Reference), \"loop bodies should not result in refs\");\n    invariant(\n      !(result1 instanceof AbruptCompletion || result2 instanceof AbruptCompletion),\n      \"if a loop iteration ends abruptly, there is no need for fixed point computation\"\n    );\n    if (result1 instanceof SimpleNormalCompletion && result2 instanceof SimpleNormalCompletion) {\n      let val = this.widenValues(realm, result1.value, result2.value);\n      invariant(val instanceof Value);\n      return new SimpleNormalCompletion(val);\n    }\n    if (result1 instanceof JoinedNormalAndAbruptCompletions || result2 instanceof JoinedNormalAndAbruptCompletions) {\n      //todo: #1174 figure out how to deal with loops that have embedded conditional exits\n      // widen join pathConditions\n      // widen normal result and Effects\n      // use abrupt part of result2, depend stability to make this safe. See below.\n      throw new FatalError();\n    }\n    invariant(false);\n  }\n\n  widenMaps<K, V>(m1: Map<K, V>, m2: Map<K, V>, widen: (K, void | V, void | V) => V): Map<K, V> {\n    let m3: Map<K, V> = new Map();\n    m1.forEach((val1, key, map1) => {\n      let val2 = m2.get(key);\n      let val3 = widen(key, val1, val2);\n      m3.set(key, val3);\n    });\n    m2.forEach((val2, key, map2) => {\n      if (!m1.has(key)) {\n        m3.set(key, widen(key, undefined, val2));\n      }\n    });\n    return m3;\n  }\n\n  widenBindings(realm: Realm, m1: Bindings, m2: Bindings): Bindings {\n    let widen = (b: Binding, b1: void | BindingEntry, b2: void | BindingEntry) => {\n      let l1 = b1 === undefined ? b.hasLeaked : b1.hasLeaked;\n      let l2 = b2 === undefined ? b.hasLeaked : b2.hasLeaked;\n      let hasLeaked = l1 || l2; // If either has leaked, then this binding has leaked.\n      let v1 = b1 === undefined || b1.value === undefined ? b.value : b1.value;\n      invariant(b2 !== undefined); // Local variables are not going to get deleted as a result of widening\n      let v2 = b2.value;\n      invariant(v2 !== undefined);\n      let result = this.widenValues(realm, v1 || realm.intrinsics.undefined, v2);\n      if (result instanceof AbstractValue && result.kind === \"widened\") {\n        let phiNode = b.phiNode;\n        if (phiNode === undefined) {\n          // Create a temporal location for binding\n          let generator = realm.generator;\n          invariant(generator !== undefined);\n          phiNode = generator.deriveAbstract(\n            result.types,\n            result.values,\n            [b.value || realm.intrinsics.undefined],\n            createOperationDescriptor(\"SINGLE_ARG\"),\n            { skipInvariant: true }\n          );\n          b.phiNode = phiNode;\n        }\n        // Let the widened value be a reference to the phiNode of the binding\n        invariant(phiNode.intrinsicName !== undefined);\n        let phiName = phiNode.intrinsicName;\n        result.intrinsicName = phiName;\n        result.operationDescriptor = createOperationDescriptor(\"WIDENED_IDENTIFIER\", { id: phiName });\n      }\n      invariant(result instanceof Value);\n      return { hasLeaked, value: result };\n    };\n    return this.widenMaps(m1, m2, widen);\n  }\n\n  // Returns an abstract value that includes both v1 and v2 as potential values.\n  widenValues(\n    realm: Realm,\n    v1: Value | Array<Value> | Array<{ $Key: void | Value, $Value: void | Value }>,\n    v2: Value | Array<Value> | Array<{ $Key: void | Value, $Value: void | Value }>\n  ): Value | Array<Value> | Array<{ $Key: void | Value, $Value: void | Value }> {\n    if (Array.isArray(v1) || Array.isArray(v2)) {\n      invariant(Array.isArray(v1));\n      invariant(Array.isArray(v2));\n      return this._widenArrays(realm, ((v1: any): Array<Value>), ((v2: any): Array<Value>));\n    }\n    invariant(v1 instanceof Value);\n    invariant(v2 instanceof Value);\n    if (\n      !(v1 instanceof AbstractValue) &&\n      !(v2 instanceof AbstractValue) &&\n      StrictEqualityComparison(realm, v1.throwIfNotConcrete(), v2.throwIfNotConcrete())\n    ) {\n      return v1; // no need to widen a loop invariant value\n    } else {\n      invariant(v1 && v2);\n      return AbstractValue.createFromWidening(realm, v1, v2);\n    }\n  }\n\n  widenPropertyBindings(\n    realm: Realm,\n    m1: PropertyBindings,\n    m2: PropertyBindings,\n    co1: CreatedObjects,\n    co2: CreatedObjects,\n    ca1: CreatedAbstracts,\n    ca2: CreatedAbstracts\n  ): PropertyBindings {\n    let widen = (b: PropertyBinding, d1: void | Descriptor, d2: void | Descriptor) => {\n      if (d1 === undefined && d2 === undefined) return undefined;\n      // If the PropertyBinding object has been freshly allocated do not widen (that happens in AbstractObjectValue)\n      if (d1 === undefined) {\n        invariant(d2 !== undefined);\n        if (co2.has(b.object)) return d2; // no widen\n        if (b.descriptor !== undefined && m1.has(b)) {\n          // property was present in (n-1)th iteration and deleted in nth iteration\n          d1 = cloneDescriptor(b.descriptor.throwIfNotConcrete(realm));\n          invariant(d1 !== undefined);\n          d1.value = realm.intrinsics.empty;\n        } else {\n          // no write to property in nth iteration, use the value from the (n-1)th iteration\n          d1 = b.descriptor;\n          if (d1 === undefined) {\n            d1 = cloneDescriptor(d2.throwIfNotConcrete(realm));\n            invariant(d1 !== undefined);\n            d1.value = realm.intrinsics.empty;\n          }\n        }\n      }\n      if (d2 === undefined) {\n        if (co1.has(b.object)) return d1; // no widen\n        if (m2.has(b)) {\n          // property was present in nth iteration and deleted in (n+1)th iteration\n          d2 = cloneDescriptor(d1.throwIfNotConcrete(realm));\n          invariant(d2 !== undefined);\n          d2.value = realm.intrinsics.empty;\n        } else {\n          // no write to property in (n+1)th iteration, use the value from the nth iteration\n          d2 = d1;\n        }\n        invariant(d2 !== undefined);\n      }\n      let result = this.widenDescriptors(realm, d1, d2);\n      if (result && result.value instanceof AbstractValue && result.value.kind === \"widened\") {\n        let rval = result.value;\n        let pathNode = b.pathNode;\n        if (pathNode === undefined) {\n          //Since properties already have mutable storage locations associated with them, we do not\n          //need phi nodes. What we need is an abstract value with a operation descriptor that results in a memberExpression\n          //that resolves to the storage location of the property.\n\n          // For now, we only handle loop invariant properties\n          //i.e. properties where the member expresssion does not involve any values written to inside the loop.\n          let key = b.key;\n          if (\n            typeof key === \"string\" ||\n            (key instanceof AbstractValue && !(key.mightNotBeString() && key.mightNotBeNumber()))\n          ) {\n            if (typeof key === \"string\") {\n              pathNode = AbstractValue.createFromWidenedProperty(\n                realm,\n                rval,\n                [b.object, new StringValue(realm, key)],\n                createOperationDescriptor(\"WIDEN_PROPERTY\")\n              );\n            } else {\n              invariant(key instanceof AbstractValue);\n              pathNode = AbstractValue.createFromWidenedProperty(\n                realm,\n                rval,\n                [b.object, key],\n                createOperationDescriptor(\"WIDEN_PROPERTY\")\n              );\n            }\n            // The value of the property at the start of the loop needs to be written to the property\n            // before the loop commences, otherwise the memberExpression will result in an undefined value.\n            let generator = realm.generator;\n            invariant(generator !== undefined);\n            let initVal = (b.descriptor && b.descriptor.throwIfNotConcrete(realm).value) || realm.intrinsics.empty;\n            if (!(initVal instanceof EmptyValue)) {\n              if (key === \"length\" && b.object instanceof ArrayValue) {\n                // do nothing, the array length will already be initialized\n              } else if (typeof key === \"string\") {\n                generator.emitVoidExpression(\n                  rval.types,\n                  rval.values,\n                  [b.object, new StringValue(realm, key), initVal],\n                  createOperationDescriptor(\"WIDEN_PROPERTY_ASSIGNMENT\")\n                );\n              } else {\n                invariant(key instanceof AbstractValue);\n                generator.emitVoidExpression(\n                  rval.types,\n                  rval.values,\n                  [b.object, key, initVal],\n                  createOperationDescriptor(\"WIDEN_PROPERTY_ASSIGNMENT\")\n                );\n              }\n            }\n          } else {\n            throw new FatalError(\"todo: handle the case where key is an abstract value\");\n          }\n          b.pathNode = pathNode;\n        }\n        result.value = pathNode;\n      }\n      return result;\n    };\n    return this.widenMaps(m1, m2, widen);\n  }\n\n  widenDescriptors(realm: Realm, d1: void | Descriptor, d2: Descriptor): void | PropertyDescriptor {\n    d2 = d2.throwIfNotConcrete(realm);\n    if (d1 === undefined) {\n      // d2 is a property written to only in the (n+1)th iteration\n      if (!IsDataDescriptor(realm, d2)) return d2; // accessor properties need not be widened.\n      let dc = cloneDescriptor(d2);\n      invariant(dc !== undefined);\n      let d2value = dc.value;\n      invariant(d2value !== undefined); // because IsDataDescriptor is true for d2/dc\n      let dcValue = this.widenValues(realm, d2value, d2value);\n      invariant(dcValue instanceof Value);\n      dc.value = dcValue;\n      return dc;\n    } else {\n      d1 = d1.throwIfNotConcrete(realm);\n      if (equalDescriptors(d1, d2)) {\n        if (!IsDataDescriptor(realm, d1)) return d1; // identical accessor properties need not be widened.\n        // equalDescriptors plus IsDataDescriptor guarantee that both have value props and if you have a value prop is value is defined.\n        let dc = cloneDescriptor(d1);\n        invariant(dc !== undefined);\n        let d1value = d1.value;\n        invariant(d1value !== undefined);\n        let d2value = d2.value;\n        invariant(d2value !== undefined);\n        let dcValue = this.widenValues(realm, d1value, d2value);\n        invariant(dcValue instanceof Value);\n        dc.value = dcValue;\n        return dc;\n      }\n      //todo: #1174 if we get here, the loop body contains a call to create a property and different iterations\n      // create them differently. That seems beyond what a fixpoint computation can reasonably handle without\n      // losing precision. Report an error here.\n      throw new FatalError();\n    }\n  }\n\n  // If e2 is the result of a loop iteration starting with effects e1 and it has a subset of elements of e1,\n  // then we have reached a fixed point and no further calls to widen are needed. e1/e2 represent a general\n  // summary of the loop, regardless of how many iterations will be performed at runtime.\n  containsEffects(e1: Effects, e2: Effects): boolean {\n    if (!this.containsResults(e1.result, e2.result)) return false;\n    if (!this.containsBindings(e1.modifiedBindings, e2.modifiedBindings)) return false;\n    if (\n      !this.containsPropertyBindings(e1.modifiedProperties, e2.modifiedProperties, e1.createdObjects, e2.createdObjects)\n    )\n      return false;\n    return true;\n  }\n\n  containsResults(result1: EvaluationResult, result2: EvaluationResult): boolean {\n    if (result1 instanceof SimpleNormalCompletion && result2 instanceof SimpleNormalCompletion)\n      return this._containsValues(result1.value, result2.value);\n    return false;\n  }\n\n  containsMap<K, V>(m1: Map<K, V>, m2: Map<K, V>, f: (void | V, void | V) => boolean): boolean {\n    for (const [key1, val1] of m1.entries()) {\n      if (val1 === undefined) continue; // deleted\n      let val2 = m2.get(key1);\n      if (val2 === undefined) continue; // A key that disappears has been widened away into the unknown key\n      if (!f(val1, val2)) return false;\n    }\n    for (const key2 of m2.keys()) {\n      if (!m1.has(key2)) return false;\n    }\n    return true;\n  }\n\n  containsBindings(m1: Bindings, m2: Bindings): boolean {\n    let containsBinding = (b1: void | BindingEntry, b2: void | BindingEntry) => {\n      if (\n        b1 === undefined ||\n        b2 === undefined ||\n        b1.value === undefined ||\n        b2.value === undefined ||\n        !this._containsValues(b1.value, b2.value) ||\n        b1.hasLeaked !== b2.hasLeaked\n      ) {\n        return false;\n      }\n      return true;\n    };\n    return this.containsMap(m1, m2, containsBinding);\n  }\n\n  containsPropertyBindings(\n    m1: PropertyBindings,\n    m2: PropertyBindings,\n    c1: CreatedObjects,\n    c2: CreatedObjects\n  ): boolean {\n    let containsPropertyBinding = (d1: void | Descriptor, d2: void | Descriptor) => {\n      let v1, v2;\n      if (d1 instanceof InternalSlotDescriptor || d2 instanceof InternalSlotDescriptor) {\n        if (d1 !== undefined) {\n          invariant(d1 instanceof InternalSlotDescriptor);\n          v1 = d1.value;\n        }\n        if (d2 !== undefined) {\n          invariant(d2 instanceof InternalSlotDescriptor);\n          v2 = d2.value;\n        }\n      }\n      if (d1 instanceof PropertyDescriptor) {\n        v1 = d1.value;\n      }\n      if (d2 instanceof PropertyDescriptor) {\n        v2 = d2.value;\n      }\n      if (v1 === undefined) {\n        return v2 === undefined;\n      }\n      if (v1 instanceof Value && v2 instanceof Value) return this._containsValues(v1, v2);\n      if (Array.isArray(v1) && Array.isArray(v2)) {\n        return this._containsArray(((v1: any): Array<Value>), ((v2: any): Array<Value>));\n      }\n      return v2 === undefined;\n    };\n    for (const [key1, val1] of m1.entries()) {\n      if (val1 === undefined) continue; // deleted\n      let val2 = m2.get(key1);\n      if (val2 === undefined) continue; // A key that disappears has been widened away into the unknown key\n      if (c1.has(key1.object)) {\n        continue;\n      }\n      if (!containsPropertyBinding(val1, val2)) return false;\n    }\n    for (const key2 of m2.keys()) {\n      if (c2.has(key2.object)) {\n        continue;\n      }\n      if (!m1.has(key2)) return false;\n    }\n    return true;\n  }\n\n  _containsArray(\n    v1: void | Array<Value> | Array<{ $Key: void | Value, $Value: void | Value }>,\n    v2: void | Array<Value> | Array<{ $Key: void | Value, $Value: void | Value }>\n  ): boolean {\n    let e = (v1 && v1[0]) || (v2 && v2[0]);\n    if (e instanceof Value) return this.containsArraysOfValue((v1: any), (v2: any));\n    else return this._containsArrayOfsMapEntries((v1: any), (v2: any));\n  }\n\n  _containsArrayOfsMapEntries(\n    realm: Realm,\n    a1: void | Array<{ $Key: void | Value, $Value: void | Value }>,\n    a2: void | Array<{ $Key: void | Value, $Value: void | Value }>\n  ): boolean {\n    let empty = realm.intrinsics.empty;\n    let n = Math.max((a1 && a1.length) || 0, (a2 && a2.length) || 0);\n    for (let i = 0; i < n; i++) {\n      let { $Key: key1, $Value: val1 } = (a1 && a1[i]) || { $Key: empty, $Value: empty };\n      let { $Key: key2, $Value: val2 } = (a2 && a2[i]) || { $Key: empty, $Value: empty };\n      if (key1 === undefined) {\n        if (key2 !== undefined) return false;\n      } else {\n        if (key1 instanceof Value && key2 instanceof Value && key1.equals(key2)) {\n          if (val1 instanceof Value && val2 instanceof Value && this._containsValues(val1, val2)) continue;\n        }\n        return false;\n      }\n    }\n    return true;\n  }\n\n  containsArraysOfValue(realm: Realm, a1: void | Array<Value>, a2: void | Array<Value>): boolean {\n    let n = Math.max((a1 && a1.length) || 0, (a2 && a2.length) || 0);\n    for (let i = 0; i < n; i++) {\n      let [val1, val2] = [a1 && a1[i], a2 && a2[i]];\n      if (val1 instanceof Value && val2 instanceof Value && !this._containsValues(val1, val2)) return false;\n    }\n    return true;\n  }\n\n  _containsValues(val1: Value, val2: Value) {\n    if (val1 instanceof AbstractValue) {\n      if (\n        !Value.isTypeCompatibleWith(val2.getType(), val1.getType()) &&\n        !Value.isTypeCompatibleWith(val1.getType(), val2.getType())\n      )\n        return false;\n      return val1.values.containsValue(val2);\n    }\n    return val1.equals(val2);\n  }\n}\n"
  },
  {
    "path": "src/options.js",
    "content": "/**\n * Copyright (c) 2017-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n/* @flow strict-local */\n\nimport type { ErrorHandler } from \"./errors.js\";\n\nexport type Compatibility = \"browser\" | \"jsc-600-1-4-17\" | \"mobile\" | \"node-source-maps\" | \"fb-www\" | \"node-react\";\nexport const CompatibilityValues = [\"browser\", \"jsc-600-1-4-17\", \"mobile\", \"node-source-maps\", \"fb-www\", \"node-react\"];\n\nexport type InvariantModeTypes =\n  | \"throw\"\n  | \"console.info\"\n  | \"console.warn\"\n  | \"console.error\"\n  | \"nativeLoggingHook+0\"\n  | \"nativeLoggingHook+1\"\n  | \"nativeLoggingHook+3\"\n  | \"nativeLoggingHook+2\";\nexport const InvariantModeValues = [\n  \"throw\",\n  \"console.info\",\n  \"console.warn\",\n  \"console.error\",\n  \"nativeLoggingHook+0\",\n  \"nativeLoggingHook+1\",\n  \"nativeLoggingHook+2\",\n  \"nativeLoggingHook+3\",\n];\nexport const DiagnosticSeverityValues = [\"FatalError\", \"RecoverableError\", \"Warning\", \"Information\"];\n\nexport type ReactOutputTypes = \"create-element\" | \"jsx\" | \"bytecode\";\nexport const ReactOutputValues = [\"create-element\", \"jsx\", \"bytecode\"];\n\nexport type RealmOptions = {\n  check?: Array<number>,\n  compatibility?: Compatibility,\n  debugNames?: boolean,\n  errorHandler?: ErrorHandler,\n  mathRandomSeed?: string,\n  invariantLevel?: number,\n  invariantMode?: InvariantModeTypes,\n  emitConcreteModel?: boolean,\n  uniqueSuffix?: string,\n  serialize?: boolean,\n  strictlyMonotonicDateNow?: boolean,\n  timeout?: number,\n  maxStackDepth?: number,\n  instantRender?: boolean,\n  reactEnabled?: boolean,\n  reactOutput?: ReactOutputTypes,\n  reactVerbose?: boolean,\n  reactOptimizeNestedFunctions?: boolean,\n  stripFlow?: boolean,\n  abstractValueImpliesMax?: number,\n  arrayNestedOptimizedFunctionsEnabled?: boolean,\n  reactFailOnUnsupportedSideEffects?: boolean,\n  removeModuleFactoryFunctions?: boolean,\n};\n\nexport type SerializerOptions = {\n  lazyObjectsRuntime?: string,\n  delayInitializations?: boolean,\n  modulesToInitialize?: Set<string | number> | \"ALL\",\n  internalDebug?: boolean,\n  debugScopes?: boolean,\n  debugIdentifiers?: Array<string>,\n  logStatistics?: boolean,\n  logModules?: boolean,\n  profile?: boolean,\n  inlineExpressions?: boolean,\n  trace?: boolean,\n  heapGraphFormat?: \"DotLanguage\" | \"VISJS\",\n};\n\nexport const defaultOptions = {};\n"
  },
  {
    "path": "src/prepack-cli.js",
    "content": "/**\n * Copyright (c) 2017-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n/* @flow */\n\n/* eslint-disable no-shadow */\n\nimport { CompilerDiagnostic, type ErrorHandlerResult, FatalError } from \"./errors.js\";\nimport {\n  type Compatibility,\n  CompatibilityValues,\n  type ReactOutputTypes,\n  ReactOutputValues,\n  type InvariantModeTypes,\n  InvariantModeValues,\n  DiagnosticSeverityValues,\n} from \"./options.js\";\nimport { type SerializedResult } from \"./serializer/types.js\";\nimport { TextPrinter } from \"./utils/TextPrinter.js\";\nimport { prepackStdin, prepackFileSync } from \"./prepack-node.js\";\nimport type { BabelNodeSourceLocation } from \"@babel/types\";\nimport fs from \"fs\";\nimport v8 from \"v8\";\nimport { version } from \"../package.json\";\nimport invariant from \"./invariant\";\nimport JSONTokenizer from \"./utils/JSONTokenizer.js\";\nimport type { DebuggerConfigArguments, DebugReproArguments } from \"./types\";\nimport { DebugReproPackager } from \"./utils/DebugReproPackager.js\";\n\n// Prepack helper\ndeclare var __residual: any;\n\nfunction run(\n  Object,\n  Array,\n  console,\n  JSON,\n  process,\n  prepackStdin,\n  prepackFileSync,\n  FatalError,\n  CompatibilityValues,\n  fs\n) {\n  let HELP_STR = `\n    input                    The name of the file to run Prepack over (for web please provide the single js bundle file)\n    --out                    The name of the output file\n    --compatibility          The target environment for Prepack [${CompatibilityValues.map(v => `\"${v}\"`).join(\", \")}]\n    --mathRandomSeed         If you want Prepack to evaluate Math.random() calls, please provide a seed.\n    --srcmapIn               The input sourcemap filename. If present, Prepack will output a sourcemap that maps from\n                             the original file (pre-input sourcemap) to Prepack's output\n    --srcmapOut              The output sourcemap filename.\n    --maxStackDepth          Specify the maximum call stack depth.\n    --timeout                The amount of time in seconds until Prepack should time out.\n    --lazyObjectsRuntime     Enable lazy objects feature and specify the JS runtime that support this feature.\n    --debugNames             Changes the output of Prepack so that for named functions and variables that get emitted into\n                             Prepack's output, the original name is appended as a suffix to Prepack's generated identifier.\n    --modulesToInitialize [ALL | comma separated list | filepath to JSON array of value]\n                             Enable speculative initialization of modules (for the module system Prepack has builtin\n                             knowledge about). Prepack will try to execute the factory functions of the modules you specify.\n    --trace                  Traces the order of module initialization.\n    --check [start[, count]] Check residual functions for diagnostic messages. Do not generate code.\n    --profile                Collect statistics about time and memory usage of the different internal passes\n    --logStatistics          Log statistics to console\n    --statsFile              The name of the output file where statistics will be written to.\n    --heapGraphFilePath      The name of the output file where heap graph will be written to.\n    --dumpIRFilePath         The name of the output file where the intermediate representation will be written to.\n    --removeModuleFactoryFunctions         Forces optimized module factory functions to be removed, even if they are reachable.\n    --inlineExpressions      When generating code, tells prepack to avoid naming expressions when they are only used once,\n                             and instead inline them where they are used.\n    --invariantLevel         0: no invariants (default); 1: checks for abstract values; 2: checks for accessed built-ins; 3: internal consistency\n    --invariantMode          Whether to throw an exception or call a console function to log an invariant violation; default = throw.\n    --emitConcreteModel      Synthesize concrete model values for abstract models(defined by __assumeDataProperty).\n    --version                Output the version number.\n    --reproOnFatalError      Create a zip file with all information needed to reproduce a Prepack run if Prepacking fails with a FatalError.\n    --reproUnconditionally   Create a zip file with all information needed to reproduce a Prepack run, regardless of success of Prepack.\n    --cpuprofile             Create a CPU profile file for the run that can be loaded into the Chrome JavaScript CPU Profile viewer.\n    --debugDiagnosticSeverity  FatalError | RecoverableError | Warning | Information (default = FatalError). Diagnostic level at which debugger will stop.\n    --debugBuckRoot          Root directory that buck assumes when creating sourcemap paths.\n    --warnAsError            Turns all warnings into errors.\n    --diagnosticAsError      A comma-separated list of non-fatal-error PPxxxx diagnostic codes that should get turned into (recoverable) errors.\n    --noDiagnostic           A comma-separated list of non-fatal-error PPxxxx diagnostic codes that should get suppressed.\n  `;\n  let args = Array.from(process.argv);\n  args.splice(0, 2);\n  let inputFilenames = [];\n  let outputFilename;\n  let check: void | Array<number>;\n  let compatibility: Compatibility;\n  let mathRandomSeed;\n  let inputSourceMapFilenames = [];\n  let outputSourceMap;\n  let statsFileName;\n  let maxStackDepth: number;\n  let timeout: number;\n  let debugIdentifiers: void | Array<string>;\n  let lazyObjectsRuntime: string;\n  let heapGraphFilePath: void | string;\n  let dumpIRFilePath: void | string;\n  let debugInFilePath: string;\n  let debugOutFilePath: string;\n  let reactOutput: ReactOutputTypes = \"create-element\";\n  let reproFilePath: void | string;\n  let cpuprofilePath: void | string;\n  let invariantMode: void | InvariantModeTypes;\n  let invariantLevel: void | number;\n  let reproMode: void | \"reproUnconditionally\" | \"reproOnFatalError\";\n  let debugReproPackager: void | DebugReproPackager;\n  // Indicates where to find a zip with prepack runtime. Used in environments where\n  // the `yarn pack` strategy doesn't work.\n  let externalPrepackPath: void | string;\n  let diagnosticAsError: void | Set<string>;\n  let noDiagnostic: void | Set<string>;\n  let warnAsError: void | true;\n  let modulesToInitialize: void | Set<string | number> | \"ALL\";\n  let flags = {\n    trace: false,\n    debugNames: false,\n    emitConcreteModel: false,\n    inlineExpressions: false,\n    removeModuleFactoryFunctions: false,\n    logStatistics: false,\n    logModules: false,\n    delayInitializations: false,\n    internalDebug: false,\n    debugScopes: false,\n    profile: false,\n    instantRender: false,\n    reactEnabled: false,\n  };\n  let reproArguments = [];\n  let reproFileNames = [];\n  let debuggerConfigArgs: DebuggerConfigArguments = {};\n  let debugReproArgs: void | DebugReproArguments;\n  while (args.length) {\n    let arg = args.shift();\n    if (!arg.startsWith(\"--\")) {\n      let inputs = arg.trim().split(/\\s+/g); // Split on all whitespace\n      for (let input of inputs) {\n        inputFilenames.push(input);\n        if (!input.includes(\".map\")) reproFileNames.push(input);\n        // Don't include sourcemaps in reproFiles because they will be captured later on in prepack-node\n      }\n    } else {\n      arg = arg.slice(2);\n      switch (arg) {\n        case \"modulesToInitialize\":\n          let modulesString = args.shift().trim();\n          if (fs.existsSync(modulesString))\n            try {\n              let modulesFileContents = fs.readFileSync(modulesString, \"utf-8\");\n              modulesToInitialize = new Set(JSON.parse(modulesFileContents));\n            } catch (e) {\n              console.error(`Tried reading ${modulesString} as a file, but failed: ${e.message}`);\n            }\n          else modulesToInitialize = modulesString === \"ALL\" ? modulesString : new Set(modulesString.split(\",\"));\n          break;\n        case \"out\":\n          arg = args.shift();\n          outputFilename = arg;\n          // do not include this in reproArguments needed by --repro[OnFatalError/Unconditionally], as path is likely not portable between environments\n          break;\n        case \"compatibility\":\n          arg = args.shift();\n          if (!CompatibilityValues.includes(arg)) {\n            console.error(`Unsupported compatibility: ${arg}`);\n            process.exit(1);\n          }\n          compatibility = (arg: any);\n          reproArguments.push(\"--compatibility\", compatibility);\n          break;\n        case \"mathRandomSeed\":\n          mathRandomSeed = args.shift();\n          reproArguments.push(\"--mathRandomSeed\", mathRandomSeed);\n          break;\n        case \"srcmapIn\":\n          let inputSourceMap = args.shift();\n          inputSourceMapFilenames.push(inputSourceMap);\n          // do not include this in reproArguments needed by --repro[OnFatalError/Unconditionally], as path is likely not portable between environments\n          // Furthermore, this is covered when sourcemaps are discovered in prepack-node\n          break;\n        case \"srcmapOut\":\n          outputSourceMap = args.shift();\n          // do not include this in reproArguments needed by --repro[OnFatalError/Unconditionally], as path is likely not portable between environments\n          break;\n        case \"statsFile\":\n          statsFileName = args.shift();\n          // do not include this in reproArguments needed by --repro[OnFatalError/Unconditionally], as path is likely not portable between environments\n          break;\n        case \"maxStackDepth\":\n          let value = args.shift();\n          if (isNaN(value)) {\n            console.error(\"Stack depth value must be a number\");\n            process.exit(1);\n          }\n          maxStackDepth = parseInt(value, 10);\n          reproArguments.push(\"--maxStackDepth\", maxStackDepth.toString());\n          break;\n        case \"timeout\":\n          let seconds = args.shift();\n          if (isNaN(seconds)) {\n            console.error(\"Timeout must be a number\");\n            process.exit(1);\n          }\n          timeout = parseInt(seconds, 10) * 1000;\n          reproArguments.push(\"--timeout\", timeout.toString());\n          break;\n        case \"debugIdentifiers\":\n          let debugIdentifiersString = args.shift();\n          debugIdentifiers = debugIdentifiersString.split(\",\");\n          reproArguments.push(\"--debugIdentifiers\", debugIdentifiersString);\n          break;\n        case \"diagnosticAsError\":\n          let diagnosticAsErrorString = args.shift();\n          diagnosticAsError = new Set(diagnosticAsErrorString.split(\",\"));\n          reproArguments.push(\"--diagnosticAsError\", diagnosticAsErrorString);\n          break;\n        case \"noDiagnostic\":\n          let noDiagnosticString = args.shift();\n          noDiagnostic = new Set(noDiagnosticString.split(\",\"));\n          reproArguments.push(\"--noDiagnostic\", noDiagnosticString);\n          break;\n        case \"warnAsError\":\n          warnAsError = true;\n          reproArguments.push(\"--warnAsError\");\n          break;\n        case \"check\":\n          let range = args.shift();\n          if (range.startsWith(\"--\")) {\n            args.unshift(range);\n            range = \"0\";\n          }\n          let pair: Array<any> = range.split(\",\");\n          if (pair.length === 1) pair.push(Number.MAX_SAFE_INTEGER);\n          let start = +pair[0];\n          if (start < 0 || !Number.isInteger(start)) {\n            console.error(\"check start offset must be a number\");\n            process.exit(1);\n          }\n          let count = +pair[1];\n          if (count < 0 || !Number.isInteger(count)) {\n            console.error(\"check count must be a number\");\n            process.exit(1);\n          }\n          check = [start, count];\n          reproArguments.push(\"--check\", range);\n          break;\n        case \"debugInFilePath\":\n          debugInFilePath = args.shift();\n          // do not include this in reproArguments needed by --repro[OnFatalError/Unconditionally] as the field is not visable to the user\n          break;\n        case \"debugOutFilePath\":\n          debugOutFilePath = args.shift();\n          // do not include this in reproArguments needed by --repro[OnFatalError/Unconditionally] as the field is not visable to the user\n          break;\n        case \"lazyObjectsRuntime\":\n          lazyObjectsRuntime = args.shift();\n          reproArguments.push(\"--lazyObjectsRuntime\", lazyObjectsRuntime);\n          break;\n        case \"heapGraphFilePath\":\n          heapGraphFilePath = args.shift();\n          // do not include this in reproArguments needed by --repro[OnFatalError/Unconditionally], as path is likely not portable between environments\n          break;\n        case \"dumpIRFilePath\":\n          dumpIRFilePath = args.shift();\n          // do not include this in reproArguments needed by --repro[OnFatalError/Unconditionally], as path is likely not portable between environments\n          break;\n        case \"reactOutput\":\n          arg = args.shift();\n          if (!ReactOutputValues.includes(arg)) {\n            console.error(`Unsupported reactOutput: ${arg}`);\n            process.exit(1);\n          }\n          reactOutput = (arg: any);\n          reproArguments.push(\"--reactOutput\", reactOutput);\n          break;\n        case \"reproOnFatalError\":\n        case \"reproUnconditionally\":\n          debugReproPackager = new DebugReproPackager();\n          reproMode = arg;\n          reproFilePath = args.shift();\n          debugReproArgs = {};\n          debugReproArgs.sourcemaps = [];\n          if (debuggerConfigArgs.buckRoot) debugReproArgs.buckRoot = debuggerConfigArgs.buckRoot;\n          // do not include this in reproArguments needed by --repro[OnFatalError/Unconditionally], as we don't need to create a repro from the repro...\n          break;\n        case \"cpuprofile\":\n          cpuprofilePath = args.shift();\n          // do not include this in reproArguments needed by --repro[OnFatalError/Unconditionally], as path is likely not portable between environments\n          break;\n        case \"invariantMode\":\n          arg = args.shift();\n          if (!InvariantModeValues.includes(arg)) {\n            console.error(`Unsupported invariantMode: ${arg}`);\n            process.exit(1);\n          }\n          invariantMode = (arg: any);\n          reproArguments.push(\"--invariantMode\", invariantMode);\n          break;\n        case \"invariantLevel\":\n          let invariantLevelString = args.shift();\n          if (isNaN(invariantLevelString)) {\n            console.error(\"invariantLevel must be a number\");\n            process.exit(1);\n          }\n          invariantLevel = parseInt(invariantLevelString, 10);\n          reproArguments.push(\"--invariantLevel\", invariantLevel.toString());\n          break;\n        case \"debugDiagnosticSeverity\":\n          arg = args.shift();\n          if (!DiagnosticSeverityValues.includes(arg)) {\n            console.error(`Unsupported debugDiagnosticSeverity: ${arg}`);\n            process.exit(1);\n          }\n          invariant(\n            arg === \"FatalError\" || arg === \"RecoverableError\" || arg === \"Warning\" || arg === \"Information\",\n            `Invalid debugger diagnostic severity: ${arg}`\n          );\n          debuggerConfigArgs.diagnosticSeverity = arg;\n          reproArguments.push(\"--debugDiagnosticSeverity\", arg);\n          break;\n        case \"debugBuckRoot\":\n          let buckRoot = args.shift();\n          debuggerConfigArgs.buckRoot = buckRoot;\n          if (debugReproArgs) debugReproArgs.buckRoot = buckRoot;\n          // Use $(pwd)  instead of argument so repro script can be run from\n          // any computer, not just the one it was generated on.\n          // All sourcefiles are placed directly in the repro, so the repro folder is the buckRoot.\n          reproArguments.push(\"--debugBuckRoot\", \"$(pwd)\");\n          break;\n        case \"externalPrepackPath\":\n          externalPrepackPath = args.shift();\n          break;\n        case \"help\":\n          const options = [\n            \"-- | input.js\",\n            \"--out output.js\",\n            \"--compatibility jsc\",\n            \"--mathRandomSeed seedvalue\",\n            \"--srcmapIn inputMap\",\n            \"--srcmapOut outputMap\",\n            \"--maxStackDepth depthValue\",\n            \"--timeout seconds\",\n            \"--debugIdentifiers id1,id2,...\",\n            \"--check [start[, number]]\",\n            \"--lazyObjectsRuntime lazyObjectsRuntimeName\",\n            \"--heapGraphFilePath heapGraphFilePath\",\n            \"--dumpIRFilePath dumpIRFilePath\",\n            \"--reactOutput \" + ReactOutputValues.join(\" | \"),\n            \"--repro reprofile.zip\",\n            \"--cpuprofile name.cpuprofile\",\n            \"--invariantMode \" + InvariantModeValues.join(\" | \"),\n            \"--warnAsError\",\n            \"--diagnosticAsError PPxxxx,PPyyyy,...\",\n            \"--noDiagnostic PPxxxx,PPyyyy,...\",\n          ];\n          for (let flag of Object.keys(flags)) options.push(`--${flag}`);\n\n          console.log(\"Usage: prepack.js \" + options.map(option => `[ ${option} ]`).join(\" \") + \"\\n\" + HELP_STR);\n          return;\n        case \"version\":\n          console.log(version);\n          return;\n        default:\n          if (arg in flags) {\n            flags[arg] = true;\n            reproArguments.push(\"--\" + arg);\n          } else {\n            console.error(`Unknown option: ${arg}`);\n            process.exit(1);\n          }\n      }\n    }\n  }\n\n  let resolvedOptions = Object.assign(\n    {},\n    {\n      compatibility,\n      mathRandomSeed,\n      inputSourceMapFilenames,\n      errorHandler,\n      sourceMaps: !!outputSourceMap,\n      maxStackDepth,\n      timeout,\n      debugIdentifiers,\n      check,\n      serialize: !check,\n      lazyObjectsRuntime,\n      debugInFilePath,\n      debugOutFilePath,\n      reactOutput,\n      invariantMode,\n      invariantLevel,\n      debuggerConfigArgs,\n      debugReproArgs,\n      modulesToInitialize,\n    },\n    flags\n  );\n  if (heapGraphFilePath !== undefined) resolvedOptions.heapGraphFormat = \"DotLanguage\";\n  if (dumpIRFilePath !== undefined) {\n    resolvedOptions.onExecute = (realm, optimizedFunctions) => {\n      let text = \"\";\n      new TextPrinter(line => {\n        text += line + \"\\n\";\n      }).print(realm, optimizedFunctions);\n      invariant(dumpIRFilePath !== undefined);\n      fs.writeFileSync(dumpIRFilePath, text);\n    };\n  }\n  if (lazyObjectsRuntime !== undefined && (resolvedOptions.delayInitializations || resolvedOptions.inlineExpressions)) {\n    console.error(\"lazy objects feature is incompatible with delayInitializations and inlineExpressions options\");\n    process.exit(1);\n  }\n\n  let compilerDiagnostics: Map<BabelNodeSourceLocation, CompilerDiagnostic> = new Map();\n  let compilerDiagnosticsList: Array<CompilerDiagnostic> = [];\n  function errorHandler(compilerDiagnostic: CompilerDiagnostic): ErrorHandlerResult {\n    if (noDiagnostic !== undefined && noDiagnostic.has(compilerDiagnostic.errorCode)) return \"Recover\";\n    if (\n      (warnAsError && compilerDiagnostic.severity === \"Warning\") ||\n      (diagnosticAsError !== undefined &&\n        diagnosticAsError.has(compilerDiagnostic.errorCode) &&\n        compilerDiagnostic.severity !== \"FatalError\")\n    ) {\n      compilerDiagnostic = new CompilerDiagnostic(\n        compilerDiagnostic.message,\n        compilerDiagnostic.location,\n        compilerDiagnostic.errorCode,\n        \"RecoverableError\",\n        compilerDiagnostic.sourceFilePaths\n      );\n    }\n    if (compilerDiagnostic.location) compilerDiagnostics.set(compilerDiagnostic.location, compilerDiagnostic);\n    else compilerDiagnosticsList.push(compilerDiagnostic);\n    return compilerDiagnostic.severity === \"FatalError\" ? \"Fail\" : \"Recover\";\n  }\n\n  function printDiagnostics(caughtFatalError: boolean, caughtUnexpectedError: boolean = false): boolean {\n    if (compilerDiagnostics.size === 0 && compilerDiagnosticsList.length === 0) {\n      // FatalErrors must have generated at least one CompilerDiagnostic.\n      invariant(!caughtFatalError, \"FatalError must generate at least one CompilerDiagnostic\");\n      return !caughtUnexpectedError;\n    }\n\n    let informations = 0;\n    let warnings = 0;\n    let recoverableErrors = 0;\n    let fatalErrors = 0;\n    let printCompilerDiagnostic = (\n      compilerDiagnostic: CompilerDiagnostic,\n      locString?: string = \"At an unknown location\"\n    ) => {\n      switch (compilerDiagnostic.severity) {\n        case \"Information\":\n          informations++;\n          break;\n        case \"Warning\":\n          warnings++;\n          break;\n        case \"RecoverableError\":\n          recoverableErrors++;\n          break;\n        default:\n          invariant(compilerDiagnostic.severity === \"FatalError\");\n          fatalErrors++;\n          break;\n      }\n      console.error(\n        `${locString} ${compilerDiagnostic.severity} ${compilerDiagnostic.errorCode}: ${compilerDiagnostic.message}` +\n          ` (https://github.com/facebook/prepack/wiki/${compilerDiagnostic.errorCode})`\n      );\n      let callStack = compilerDiagnostic.callStack;\n      if (callStack !== undefined) {\n        let eolPos = callStack.indexOf(\"\\n\");\n        if (eolPos > 0) console.error(callStack.substring(eolPos + 1));\n      }\n    };\n    for (let [loc, compilerDiagnostic] of compilerDiagnostics) {\n      let sourceMessage = \"\";\n      switch (loc.source) {\n        case null:\n        case \"\":\n          sourceMessage = \"In an unknown source file\";\n          break;\n        case \"no-filename-specified\":\n          sourceMessage = \"In stdin\";\n          break;\n        default:\n          invariant(loc !== null && loc.source !== null);\n          sourceMessage = `In input file ${loc.source}`;\n          break;\n      }\n\n      let locString = `${sourceMessage}(${loc.start.line}:${loc.start.column + 1})`;\n      printCompilerDiagnostic(compilerDiagnostic, locString);\n    }\n    for (let compilerDiagnostic of compilerDiagnosticsList) printCompilerDiagnostic(compilerDiagnostic);\n    invariant(informations + warnings + recoverableErrors + fatalErrors > 0);\n    let plural = (count, word) => (count === 1 ? word : `${word}s`);\n    const success = fatalErrors === 0 && recoverableErrors === 0 && !caughtUnexpectedError;\n    console.error(\n      `Prepack ${success ? \"succeeded\" : \"failed\"}, reporting ${[\n        fatalErrors > 0 ? `${fatalErrors} ${plural(fatalErrors, \"fatal error\")}` : undefined,\n        recoverableErrors > 0 ? `${recoverableErrors} ${plural(recoverableErrors, \"recoverable error\")}` : undefined,\n        warnings > 0 ? `${warnings} ${plural(warnings, \"warning\")}` : undefined,\n        informations > 0 ? `${informations} ${plural(informations, \"informational message\")}` : undefined,\n      ]\n        .filter(s => s !== undefined)\n        .join(\", \")}.`\n    );\n\n    return success;\n  }\n\n  let profiler;\n  let success;\n  let debugReproSourceFiles = [];\n  let debugReproSourceMaps = [];\n\n  try {\n    if (cpuprofilePath !== undefined) {\n      try {\n        profiler = require(\"v8-profiler-node8\");\n      } catch (e) {\n        // Profiler optional dependency failed\n        console.error(\"v8-profiler-node8 doesn't work correctly on Windows, see issue #1695\");\n        throw e;\n      }\n      profiler.setSamplingInterval(100); // default is 1000us\n      profiler.startProfiling(\"\");\n    }\n\n    try {\n      if (inputFilenames.length === 0) {\n        prepackStdin(resolvedOptions, processSerializedCode, printDiagnostics);\n        return;\n      }\n      let serialized = prepackFileSync(inputFilenames, resolvedOptions);\n      if (reproMode === \"reproUnconditionally\") {\n        if (serialized.sourceFilePaths) {\n          debugReproSourceFiles = serialized.sourceFilePaths.sourceFiles;\n          debugReproSourceMaps = serialized.sourceFilePaths.sourceMaps;\n        } else {\n          // An input can have no sourcemap/sourcefiles, but we can still package\n          // the input files, prepack runtime, and generate the script.\n          debugReproSourceFiles = [];\n          debugReproSourceMaps = [];\n        }\n      }\n\n      success = printDiagnostics(false);\n      if (resolvedOptions.serialize && serialized) processSerializedCode(serialized);\n    } catch (err) {\n      success = printDiagnostics(err instanceof FatalError, !(err instanceof FatalError));\n      invariant(!success);\n      if (!(err instanceof FatalError)) {\n        // if it is not a FatalError, it means prepack failed, and we should display the Prepack stack trace.\n        console.error(`unexpected ${err}:\\n${err.stack}`);\n      }\n      if (reproMode) {\n        // Get largest list of original sources from all diagnostics.\n        // Must iterate through both because maps are ordered so we can't tell which diagnostic is most recent.\n        let largestLength = 0;\n\n        let allDiagnostics = Array.from(compilerDiagnostics.values()).concat(compilerDiagnosticsList);\n        allDiagnostics.forEach(diagnostic => {\n          if (\n            diagnostic.sourceFilePaths &&\n            diagnostic.sourceFilePaths.sourceFiles &&\n            diagnostic.sourceFilePaths.sourceMaps\n          ) {\n            if (diagnostic.sourceFilePaths.sourceFiles.length > largestLength) {\n              debugReproSourceFiles = diagnostic.sourceFilePaths.sourceFiles;\n              largestLength = diagnostic.sourceFilePaths.sourceFiles.length;\n              debugReproSourceMaps = diagnostic.sourceFilePaths.sourceMaps;\n            }\n          }\n        });\n      }\n    }\n  } finally {\n    if (profiler !== undefined) {\n      let data = profiler.stopProfiling(\"\");\n      let start = Date.now();\n      invariant(cpuprofilePath !== undefined);\n      let stream = fs.createWriteStream(cpuprofilePath);\n      let getNextToken = JSONTokenizer(data);\n      let write = () => {\n        for (let token = getNextToken(); token !== undefined; token = getNextToken()) {\n          if (!stream.write(token)) {\n            stream.once(\"drain\", write);\n            return;\n          }\n        }\n        stream.end();\n        invariant(cpuprofilePath !== undefined);\n        console.log(`Wrote ${cpuprofilePath} in ${Date.now() - start}ms`);\n      };\n      write();\n    }\n  }\n\n  function processSerializedCode(serialized: SerializedResult) {\n    if (serialized.code === \"\") {\n      console.error(\"Prepack returned empty code.\");\n      return;\n    }\n    if (outputFilename) {\n      console.log(`Prepacked source code written to ${outputFilename}.`);\n      fs.writeFileSync(outputFilename, serialized.code);\n    } else {\n      console.log(serialized.code);\n    }\n    if (statsFileName) {\n      let statistics = serialized.statistics;\n      if (statistics === undefined) {\n        return;\n      }\n      let stats = {\n        RealmStatistics: statistics.getRealmStatistics(),\n        SerializerStatistics: statistics.getSerializerStatistics(),\n        TimingStatistics: statistics.projectPerformanceTrackers(\"Time\", pt => pt.time),\n        HeapStatistics: statistics.projectPerformanceTrackers(\"Memory\", pt => pt.memory),\n        MemoryStatistics: v8.getHeapStatistics(),\n      };\n      fs.writeFileSync(statsFileName, JSON.stringify(stats));\n    }\n    if (outputSourceMap) {\n      fs.writeFileSync(outputSourceMap, serialized.map ? JSON.stringify(serialized.map) : \"\");\n    }\n    if (heapGraphFilePath !== undefined) {\n      invariant(serialized.heapGraph);\n      fs.writeFileSync(heapGraphFilePath, serialized.heapGraph);\n    }\n  }\n\n  // If there will be a repro going on, don't exit.\n  // The repro involves an async directory zip, so exiting here will cause the repro\n  // to not complete. Instead, all calls to repro include a flag to indicate\n  // whether or not it should process.exit() upon completion.\n  if (!success && reproMode === undefined) {\n    process.exit(1);\n  } else if ((!success && reproMode === \"reproOnFatalError\") || reproMode === \"reproUnconditionally\") {\n    if (debugReproPackager) {\n      debugReproPackager.generateDebugRepro(\n        !success,\n        debugReproSourceFiles,\n        debugReproSourceMaps,\n        reproFilePath,\n        reproFileNames,\n        reproArguments,\n        externalPrepackPath\n      );\n    } else {\n      console.error(\"Debug Repro Packager was not initialized.\");\n      process.exit(1);\n    }\n  }\n}\n\nif (typeof __residual === \"function\") {\n  // If we're running inside of Prepack. This is the residual function we'll\n  // want to leave untouched in the final program.\n  __residual(\n    \"boolean\",\n    run,\n    Object,\n    Array,\n    console,\n    JSON,\n    process,\n    prepackStdin,\n    prepackFileSync,\n    FatalError,\n    CompatibilityValues,\n    fs\n  );\n} else {\n  run(Object, Array, console, JSON, process, prepackStdin, prepackFileSync, FatalError, CompatibilityValues, fs);\n}\n"
  },
  {
    "path": "src/prepack-node.js",
    "content": "/**\n * Copyright (c) 2017-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n/*\n Prepack API functions that require Node as the execution environment for Prepack.\n */\n\n/* @flow */\nimport { defaultOptions } from \"./options\";\nimport { FatalError } from \"./errors.js\";\nimport { type PrepackOptions } from \"./prepack-options\";\nimport { prepackSources } from \"./prepack-standalone.js\";\nimport { type SourceMap, SourceFileCollection } from \"./types.js\";\nimport { DebugChannel } from \"./debugger/server/channel/DebugChannel.js\";\nimport { FileIOWrapper } from \"./debugger/common/channel/FileIOWrapper.js\";\nimport { type SerializedResult } from \"./serializer/types.js\";\nimport { SerializerStatistics } from \"./serializer/statistics.js\";\n\nimport fs from \"fs\";\nimport path from \"path\";\n\nexport * from \"./prepack-standalone\";\n\nfunction createStatistics(options: PrepackOptions) {\n  let gc = global.gc; // eslint-disable-line no-undef\n  return options.profile !== undefined\n    ? new SerializerStatistics(\n        () => Date.now(),\n        () => {\n          if (gc) gc();\n          return process.memoryUsage().heapUsed;\n        },\n        !!gc\n      )\n    : new SerializerStatistics();\n}\n\nexport function prepackStdin(\n  options: PrepackOptions = defaultOptions,\n  processSerializedCode: SerializedResult => void,\n  printDiagnostics: boolean => boolean\n): void | SerializedResult {\n  let sourceMapFilename =\n    options.inputSourceMapFilenames && options.inputSourceMapFilenames.length > 0\n      ? options.inputSourceMapFilenames[0]\n      : \"\";\n  process.stdin.setEncoding(\"utf8\");\n  process.stdin.resume();\n  process.stdin.on(\"data\", function(code) {\n    fs.readFile(sourceMapFilename, \"utf8\", function(mapErr, sourceMap = \"\") {\n      if (mapErr) {\n        //if no sourcemap was provided we silently ignore\n        if (sourceMapFilename !== \"\") console.warn(`No sourcemap found at ${sourceMapFilename}.`);\n      }\n      let filename = \"no-filename-specified\";\n      let serialized;\n      let success;\n      try {\n        serialized = prepackSources(\n          [{ filePath: filename, fileContents: code, sourceMapContents: sourceMap }],\n          options,\n          createStatistics(options)\n        );\n        processSerializedCode(serialized);\n        success = printDiagnostics(false);\n      } catch (err) {\n        printDiagnostics(err instanceof FatalError);\n        if (!(err instanceof FatalError)) {\n          // if it is not a FatalError, it means prepack failed, and we should display the Prepack stack trace.\n          console.error(err.stack);\n        }\n        success = false;\n      }\n      if (!success) process.exit(1);\n    });\n  });\n}\n\nfunction getSourceMapFilename(filename: string, options: PrepackOptions): [string, boolean] {\n  if (options.inputSourceMapFilenames !== undefined) {\n    // The convention is that the source map has the same basename as the javascript\n    // source file, except that .map is appended. We look for a match with the\n    // supplied source file names.\n    for (let sourceMapFilename of options.inputSourceMapFilenames) {\n      if (path.basename(filename) + \".map\" === path.basename(sourceMapFilename)) {\n        return [sourceMapFilename, true];\n      }\n    }\n  }\n\n  return [filename + \".map\", false];\n}\nexport function prepackFile(\n  filename: string,\n  options: PrepackOptions = defaultOptions,\n  callback: (any, ?{ code: string, map?: SourceMap }) => void,\n  fileErrorHandler?: (err: ?Error) => void\n): void {\n  let [sourceMapFilename] = getSourceMapFilename(filename, options);\n\n  fs.readFile(filename, \"utf8\", function(fileErr, code) {\n    if (fileErr) {\n      if (fileErrorHandler) fileErrorHandler(fileErr);\n      return;\n    }\n    fs.readFile(sourceMapFilename, \"utf8\", function(mapErr, _sourceMap) {\n      let sourceMap = _sourceMap;\n      if (mapErr) {\n        console.warn(`No sourcemap found at ${sourceMapFilename}.`);\n        sourceMap = \"\";\n      }\n      let serialized;\n      try {\n        serialized = prepackSources(\n          [{ filePath: filename, fileContents: code, sourceMapContents: sourceMap }],\n          options,\n          createStatistics(options)\n        );\n      } catch (err) {\n        callback(err, null);\n        return;\n      }\n      callback(null, serialized);\n    });\n  });\n}\n\nfunction getSourceFileCollection(filenames: Array<string>, options: PrepackOptions) {\n  const sourceFiles = filenames.map(filename => {\n    let code = fs.readFileSync(filename, \"utf8\");\n    let sourceMap = \"\";\n    let [sourceMapFilename, matchedSourceMapFilename] = getSourceMapFilename(filename, options);\n\n    try {\n      sourceMap = fs.readFileSync(sourceMapFilename, \"utf8\");\n      if (matchedSourceMapFilename) console.info(`Matching sourcemap found at ${sourceMapFilename}.`);\n    } catch (_e) {\n      if (matchedSourceMapFilename) console.warn(`No sourcemap found at ${sourceMapFilename}.`);\n    }\n    return {\n      filePath: filename,\n      fileContents: code,\n      sourceMapContents: sourceMap,\n      sourceMapFilename: sourceMapFilename,\n    };\n  });\n\n  return new SourceFileCollection(sourceFiles);\n}\n\nexport function prepackFileSync(filenames: Array<string>, options: PrepackOptions = defaultOptions): SerializedResult {\n  let sourceFileCollection = getSourceFileCollection(filenames, options);\n\n  // Filter to not include sourcemaps that weren't found\n  let filterValidSourceMaps = a => a.filter(sf => sf.sourceMapContents !== \"\");\n\n  // The existence of debug[In/Out]FilePath represents the desire to use the debugger.\n  if (options.debugInFilePath !== undefined && options.debugOutFilePath !== undefined) {\n    if (options.debuggerConfigArgs === undefined) options.debuggerConfigArgs = {};\n    let debuggerConfigArgs = options.debuggerConfigArgs;\n\n    let ioWrapper = new FileIOWrapper(false, options.debugInFilePath, options.debugOutFilePath);\n    debuggerConfigArgs.debugChannel = new DebugChannel(ioWrapper);\n    debuggerConfigArgs.sourcemaps = filterValidSourceMaps(sourceFileCollection.toArray());\n  }\n\n  let debugReproArgs = options.debugReproArgs;\n  if (debugReproArgs) debugReproArgs.sourcemaps = filterValidSourceMaps(sourceFileCollection.toArray());\n\n  return prepackSources(sourceFileCollection, options, createStatistics(options));\n}\n"
  },
  {
    "path": "src/prepack-options.js",
    "content": "/**\n * Copyright (c) 2017-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n/* @flow strict-local */\n\nimport type { ErrorHandler } from \"./errors.js\";\nimport type { SerializerOptions, RealmOptions, Compatibility, ReactOutputTypes, InvariantModeTypes } from \"./options\";\nimport { type Realm } from \"./realm.js\";\nimport { type Generator } from \"./utils/generator.js\";\nimport { type FunctionValue } from \"./values/index.js\";\nimport type { DebuggerConfigArguments, DebugReproArguments } from \"./types\";\nimport type { BabelNodeFile } from \"@babel/types\";\n\nexport type PrepackOptions = {|\n  additionalGlobals?: Realm => void,\n  lazyObjectsRuntime?: string,\n  heapGraphFormat?: \"DotLanguage\" | \"VISJS\",\n  compatibility?: Compatibility,\n  debugNames?: boolean,\n  delayInitializations?: boolean,\n  inputSourceMapFilenames?: Array<string>,\n  internalDebug?: boolean,\n  debugScopes?: boolean,\n  debugIdentifiers?: Array<string>,\n  logStatistics?: boolean,\n  logModules?: boolean,\n  mathRandomSeed?: string,\n  errorHandler?: ErrorHandler,\n  invariantLevel?: number,\n  invariantMode?: InvariantModeTypes,\n  emitConcreteModel?: boolean,\n  outputFilename?: string,\n  profile?: boolean,\n  instantRender?: boolean,\n  reactEnabled?: boolean,\n  reactOutput?: ReactOutputTypes,\n  reactVerbose?: boolean,\n  reactOptimizeNestedFunctions?: boolean,\n  serialize?: boolean,\n  check?: Array<number>,\n  inlineExpressions?: boolean,\n  removeModuleFactoryFunctions?: boolean,\n  sourceMaps?: boolean,\n  modulesToInitialize?: Set<string | number> | \"ALL\",\n  statsFile?: string,\n  strictlyMonotonicDateNow?: boolean,\n  stripFlow?: boolean,\n  timeout?: number,\n  trace?: boolean,\n  uniqueSuffix?: string,\n  maxStackDepth?: number,\n  debugInFilePath?: string,\n  debugOutFilePath?: string,\n  abstractValueImpliesMax?: number,\n  debuggerConfigArgs?: DebuggerConfigArguments,\n  debugReproArgs?: DebugReproArguments,\n  onParse?: BabelNodeFile => void,\n  onExecute?: (Realm, Map<FunctionValue, Generator>) => void,\n  arrayNestedOptimizedFunctionsEnabled?: boolean,\n  reactFailOnUnsupportedSideEffects?: boolean,\n|};\n\nexport function getRealmOptions({\n  compatibility = \"browser\",\n  debugNames = false,\n  errorHandler,\n  mathRandomSeed,\n  invariantLevel = 0,\n  invariantMode = \"throw\",\n  emitConcreteModel = false,\n  uniqueSuffix,\n  instantRender,\n  reactEnabled,\n  reactOutput,\n  reactVerbose,\n  reactOptimizeNestedFunctions,\n  serialize = true,\n  check,\n  strictlyMonotonicDateNow,\n  stripFlow,\n  timeout,\n  maxStackDepth,\n  abstractValueImpliesMax,\n  debuggerConfigArgs,\n  debugReproArgs,\n  arrayNestedOptimizedFunctionsEnabled,\n  reactFailOnUnsupportedSideEffects,\n  removeModuleFactoryFunctions,\n}: PrepackOptions): RealmOptions {\n  return {\n    compatibility,\n    debugNames,\n    errorHandler,\n    mathRandomSeed,\n    invariantLevel,\n    invariantMode,\n    emitConcreteModel,\n    uniqueSuffix,\n    instantRender,\n    reactEnabled,\n    reactOutput,\n    reactVerbose,\n    reactOptimizeNestedFunctions,\n    serialize,\n    check,\n    strictlyMonotonicDateNow,\n    stripFlow,\n    timeout,\n    maxStackDepth,\n    abstractValueImpliesMax,\n    debuggerConfigArgs,\n    debugReproArgs,\n    arrayNestedOptimizedFunctionsEnabled,\n    reactFailOnUnsupportedSideEffects,\n    removeModuleFactoryFunctions,\n  };\n}\n\nexport function getSerializerOptions({\n  lazyObjectsRuntime,\n  heapGraphFormat,\n  delayInitializations = false,\n  internalDebug = false,\n  debugScopes = false,\n  debugIdentifiers,\n  logStatistics = false,\n  logModules = false,\n  profile = false,\n  inlineExpressions = false,\n  modulesToInitialize,\n  trace = false,\n}: PrepackOptions): SerializerOptions {\n  let result: SerializerOptions = {\n    delayInitializations,\n    modulesToInitialize,\n    internalDebug,\n    debugScopes,\n    debugIdentifiers,\n    logStatistics,\n    logModules,\n    profile,\n    inlineExpressions,\n    trace,\n  };\n  if (lazyObjectsRuntime !== undefined) {\n    result.lazyObjectsRuntime = lazyObjectsRuntime;\n  }\n  if (heapGraphFormat !== undefined) {\n    result.heapGraphFormat = heapGraphFormat;\n  }\n  return result;\n}\n"
  },
  {
    "path": "src/prepack-standalone.js",
    "content": "/**\n * Copyright (c) 2017-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n/* @flow */\n\n/* APIs for running Prepack for code where a model of the environment is supplied as part of the code. */\n\nimport Serializer from \"./serializer/index.js\";\nimport construct_realm from \"./construct_realm.js\";\nimport initializeGlobals from \"./globals.js\";\nimport { EvaluateDirectCallWithArgList } from \"./methods/index.js\";\nimport { getRealmOptions, getSerializerOptions } from \"./prepack-options\";\nimport { FatalError } from \"./errors.js\";\nimport { SourceFileCollection, type SourceFile } from \"./types.js\";\nimport { AbruptCompletion } from \"./completions.js\";\nimport type { PrepackOptions } from \"./prepack-options\";\nimport { defaultOptions } from \"./options\";\nimport invariant from \"./invariant.js\";\nimport { version } from \"../package.json\";\nimport { type SerializedResult } from \"./serializer/types.js\";\nimport { SerializerStatistics } from \"./serializer/statistics.js\";\nimport { ResidualHeapVisitor } from \"./serializer/ResidualHeapVisitor.js\";\nimport { Modules } from \"./utils/modules.js\";\nimport { Logger } from \"./utils/logger.js\";\nimport { Generator } from \"./utils/generator.js\";\nimport { AbstractObjectValue, AbstractValue, ObjectValue } from \"./values/index.js\";\n\nexport function prepackSources(\n  sourceFileCollection: SourceFileCollection | Array<SourceFile>,\n  options: PrepackOptions = defaultOptions,\n  statistics: SerializerStatistics | void = undefined\n): SerializedResult {\n  if (Array.isArray(sourceFileCollection)) sourceFileCollection = new SourceFileCollection(sourceFileCollection);\n\n  let realmOptions = getRealmOptions(options);\n  realmOptions.errorHandler = options.errorHandler;\n  let realm = construct_realm(\n    realmOptions,\n    options.debuggerConfigArgs,\n    statistics || new SerializerStatistics(),\n    options.debugReproArgs\n  );\n  initializeGlobals(realm);\n  if (typeof options.additionalGlobals === \"function\") {\n    options.additionalGlobals(realm);\n  }\n\n  if (options.check) {\n    realm.generator = new Generator(realm, \"main\", realm.pathConditions);\n    let logger = new Logger(realm, !!options.internalDebug);\n    let modules = new Modules(realm, logger, !!options.logModules);\n    let [result] = realm.$GlobalEnv.executeSources(sourceFileCollection.toArray());\n    if (result instanceof AbruptCompletion) throw result;\n    invariant(options.check);\n    checkResidualFunctions(modules, options.check[0], options.check[1]);\n    return { code: \"\", map: undefined };\n  } else {\n    let serializer = new Serializer(realm, getSerializerOptions(options));\n    let serialized = serializer.init(sourceFileCollection, options.sourceMaps, options.onParse, options.onExecute);\n\n    //Turn off the debugger if there is one\n    if (realm.debuggerInstance) {\n      realm.debuggerInstance.shutdown();\n    }\n\n    if (!serialized) {\n      throw new FatalError(\"serializer failed\");\n    }\n\n    if (realm.debugReproManager) {\n      let localManager = realm.debugReproManager;\n      let sourcePaths = {\n        sourceFiles: localManager.getSourceFilePaths(),\n        sourceMaps: localManager.getSourceMapPaths(),\n      };\n      serialized.sourceFilePaths = sourcePaths;\n    }\n\n    return serialized;\n  }\n}\n\nfunction checkResidualFunctions(modules: Modules, startFunc: number, totalToAnalyze: number) {\n  let realm = modules.realm;\n  let env = realm.$GlobalEnv;\n  realm.$GlobalObject.makeSimple();\n  let errorHandler = realm.errorHandler;\n  if (!errorHandler) errorHandler = (diag, suppressDiagnostics) => realm.handleError(diag);\n  realm.errorHandler = (diag, suppressDiagnostics) => {\n    invariant(errorHandler);\n    if (diag.severity === \"FatalError\") return errorHandler(diag, realm.suppressDiagnostics);\n    else return \"Recover\";\n  };\n  modules.resolveInitializedModules();\n  let residualHeapVisitor = new ResidualHeapVisitor(realm, modules.logger, modules, new Map());\n  residualHeapVisitor.visitRoots();\n  if (modules.logger.hasErrors()) return;\n  let totalFunctions = 0;\n  let nonFatalFunctions = 0;\n  for (let fi of residualHeapVisitor.functionInstances.values()) {\n    totalFunctions++;\n    if (totalFunctions <= startFunc) continue;\n    let fv = fi.functionValue;\n    console.log(\"analyzing: \" + totalFunctions);\n    let thisValue = realm.intrinsics.null;\n    let n = fv.getLength() || 0;\n    let args = [];\n    for (let i = 0; i < n; i++) {\n      let name = \"dummy parameter\";\n      let ob: AbstractObjectValue = (AbstractValue.createFromType(realm, ObjectValue, name): any);\n      ob.makeSimple(\"transitive\");\n      ob.intrinsicName = name;\n      args[i] = ob;\n    }\n    // todo: eventually join these effects, apply them to the global state and iterate to a fixed point\n    try {\n      realm.evaluateForEffectsInGlobalEnv(() =>\n        EvaluateDirectCallWithArgList(modules.realm, true, env, fv, fv, thisValue, args)\n      );\n      nonFatalFunctions++;\n    } catch (e) {}\n    if (totalFunctions >= startFunc + totalToAnalyze) break;\n  }\n  console.log(\n    `Analyzed ${totalToAnalyze} functions starting at ${startFunc} of which ${nonFatalFunctions} did not have fatal errors.`\n  );\n}\n\nexport const prepackVersion = version;\n"
  },
  {
    "path": "src/react/ReactElementSet.js",
    "content": "/**\n * Copyright (c) 2017-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n/* @flow */\n\nimport { Realm } from \"../realm.js\";\nimport { ObjectValue, Value } from \"../values/index.js\";\nimport invariant from \"../invariant.js\";\nimport { ReactEquivalenceSet } from \"./ReactEquivalenceSet.js\";\n\nexport class ReactElementSet {\n  constructor(realm: Realm, reactEquivalenceSet: ReactEquivalenceSet) {\n    this.realm = realm;\n    this.reactEquivalenceSet = reactEquivalenceSet;\n  }\n  realm: Realm;\n  reactEquivalenceSet: ReactEquivalenceSet;\n\n  add(reactElement: ObjectValue, visitedValues: Set<Value> | void): ObjectValue {\n    if (!visitedValues) visitedValues = new Set();\n    let reactEquivalenceSet = this.reactEquivalenceSet;\n    let currentMap = reactEquivalenceSet.reactElementRoot;\n\n    // type\n    currentMap = reactEquivalenceSet.getKey(\"type\", currentMap, visitedValues);\n    let result = reactEquivalenceSet.getEquivalentPropertyValue(reactElement, \"type\", currentMap, visitedValues);\n    currentMap = result.map;\n    // key\n    currentMap = reactEquivalenceSet.getKey(\"key\", currentMap, visitedValues);\n    result = reactEquivalenceSet.getEquivalentPropertyValue(reactElement, \"key\", currentMap, visitedValues);\n    currentMap = result.map;\n    // ref\n    currentMap = reactEquivalenceSet.getKey(\"ref\", currentMap, visitedValues);\n    result = reactEquivalenceSet.getEquivalentPropertyValue(reactElement, \"ref\", currentMap, visitedValues);\n    currentMap = result.map;\n    // props\n    currentMap = reactEquivalenceSet.getKey(\"props\", currentMap, visitedValues);\n    result = reactEquivalenceSet.getEquivalentPropertyValue(reactElement, \"props\", currentMap, visitedValues);\n\n    if (result.value === null) {\n      result.value = reactElement;\n    }\n    invariant(result.value instanceof ObjectValue);\n    return result.value;\n  }\n}\n"
  },
  {
    "path": "src/react/ReactEquivalenceSet.js",
    "content": "/**\n * Copyright (c) 2017-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n/* @flow */\n\nimport { Realm } from \"../realm.js\";\nimport {\n  AbstractObjectValue,\n  AbstractValue,\n  ArrayValue,\n  FunctionValue,\n  NumberValue,\n  ObjectValue,\n  StringValue,\n  SymbolValue,\n  Value,\n} from \"../values/index.js\";\nimport invariant from \"../invariant.js\";\nimport { hardModifyReactObjectPropertyBinding, isReactElement, isReactPropsObject, getProperty } from \"./utils.js\";\nimport { ResidualReactElementVisitor } from \"../serializer/ResidualReactElementVisitor.js\";\n\nexport type ReactSetValueMapKey = Value | number | string;\nexport type ReactSetValueMap = Map<ReactSetValueMapKey, ReactSetNode>;\n\nexport type ReactSetKeyMapKey = string | number | Symbol | SymbolValue;\nexport type ReactSetKeyMap = Map<ReactSetKeyMapKey, ReactSetValueMap>;\n\nexport type ReactSetNode = {\n  map: ReactSetKeyMap,\n  value: ObjectValue | ArrayValue | null,\n};\n\nexport const temporalAliasSymbol = Symbol(\"temporalAlias\");\n\n// ReactEquivalenceSet keeps records around of the values\n// of ReactElement/JSX nodes so we can return the same immutable values\n// where possible, i.e. <div /> === <div />\n//\n// Rather than uses hashes, this class uses linked Maps to track equality of objects.\n// It does this by recursively iterating through objects, by their properties/symbols and using\n// each property key as a map, and then from that map, each value as a map. The value\n// then links to the subsequent property/symbol in the object. This approach ensures insertion\n// is maintained through all objects.\nexport class ReactEquivalenceSet {\n  constructor(realm: Realm, residualReactElementVisitor: ResidualReactElementVisitor) {\n    this.realm = realm;\n    this.residualReactElementVisitor = residualReactElementVisitor;\n    this.objectRoot = new Map();\n    this.arrayRoot = new Map();\n    this.reactElementRoot = new Map();\n    this.reactPropsRoot = new Map();\n    this.temporalAliasRoot = new Map();\n  }\n  realm: Realm;\n  objectRoot: ReactSetKeyMap;\n  arrayRoot: ReactSetKeyMap;\n  reactElementRoot: ReactSetKeyMap;\n  reactPropsRoot: ReactSetKeyMap;\n  temporalAliasRoot: ReactSetKeyMap;\n  residualReactElementVisitor: ResidualReactElementVisitor;\n\n  _createNode(): ReactSetNode {\n    return {\n      map: new Map(),\n      value: null,\n    };\n  }\n\n  getKey(key: ReactSetKeyMapKey, map: ReactSetKeyMap, visitedValues: Set<Value>): ReactSetValueMap {\n    if (!map.has(key)) {\n      map.set(key, new Map());\n    }\n    return ((map.get(key): any): ReactSetValueMap);\n  }\n\n  _getValue(val: ReactSetValueMapKey, map: ReactSetValueMap, visitedValues: Set<Value>): ReactSetNode {\n    if (val instanceof StringValue || val instanceof NumberValue) {\n      val = val.value;\n    } else if (val instanceof AbstractValue) {\n      val = this.residualReactElementVisitor.residualHeapVisitor.equivalenceSet.add(val);\n    } else if (val instanceof ArrayValue) {\n      val = this._getArrayValue(val, visitedValues);\n    } else if (val instanceof ObjectValue && !(val instanceof FunctionValue)) {\n      val = this._getObjectValue(val, visitedValues);\n    }\n    if (!map.has(val)) {\n      map.set(val, this._createNode());\n    }\n    return ((map.get(val): any): ReactSetNode);\n  }\n\n  // for objects: [key/symbol] -> [key/symbol]... as nodes\n  _getObjectValue(object: ObjectValue, visitedValues: Set<Value>): ObjectValue {\n    if (visitedValues.has(object)) return object;\n    visitedValues.add(object);\n\n    if (isReactElement(object)) {\n      return this.residualReactElementVisitor.reactElementEquivalenceSet.add(object);\n    }\n    let currentMap = this.objectRoot;\n    let result;\n\n    for (let [propName] of object.properties) {\n      currentMap = this.getKey(propName, currentMap, visitedValues);\n      result = this.getEquivalentPropertyValue(object, propName, currentMap, visitedValues);\n      currentMap = result.map;\n    }\n    for (let [symbol] of object.symbols) {\n      currentMap = this.getKey(symbol, currentMap, visitedValues);\n      let prop = getProperty(this.realm, object, symbol);\n      result = this._getValue(prop, currentMap, visitedValues);\n      currentMap = result.map;\n    }\n    let temporalAlias = object.temporalAlias;\n\n    if (temporalAlias !== undefined) {\n      currentMap = this.getKey(temporalAliasSymbol, currentMap, visitedValues);\n      result = this.getTemporalAliasValue(temporalAlias, currentMap, visitedValues);\n    }\n\n    if (result === undefined) {\n      // If we have a temporalAlias, we can never return an empty object\n      if (temporalAlias === undefined && this.realm.react.emptyObject !== undefined) {\n        return this.realm.react.emptyObject;\n      }\n      return object;\n    }\n    if (result.value === null) {\n      result.value = object;\n    }\n    return result.value;\n  }\n\n  _getTemporalValue(temporalAlias: AbstractObjectValue, visitedValues: Set<Value>): AbstractObjectValue {\n    // Check to ensure the temporal alias is definitely declared in the current scope\n    if (!this.residualReactElementVisitor.wasTemporalAliasDeclaredInCurrentScope(temporalAlias)) {\n      return temporalAlias;\n    }\n    let temporalOperationEntry = this.realm.getTemporalOperationEntryFromDerivedValue(temporalAlias);\n\n    if (temporalOperationEntry === undefined) {\n      return temporalAlias;\n    }\n    let temporalArgs = temporalOperationEntry.args;\n    if (temporalArgs.length === 0) {\n      return temporalAlias;\n    }\n    let currentMap = this.temporalAliasRoot;\n    let result;\n\n    for (let i = 0; i < temporalArgs.length; i++) {\n      let arg = temporalArgs[i];\n      let equivalenceArg;\n      if (arg instanceof ObjectValue && arg.temporalAlias === temporalAlias) {\n        continue;\n      }\n      if (arg instanceof ObjectValue && isReactElement(arg)) {\n        equivalenceArg = this.residualReactElementVisitor.reactElementEquivalenceSet.add(arg);\n\n        if (arg !== equivalenceArg) {\n          temporalArgs[i] = equivalenceArg;\n        }\n      } else if (arg instanceof AbstractObjectValue && !arg.values.isTop() && arg.kind !== \"conditional\") {\n        // Might be a temporal, so let's check\n        let childTemporalOperationEntry = this.realm.getTemporalOperationEntryFromDerivedValue(arg);\n\n        if (childTemporalOperationEntry !== undefined) {\n          equivalenceArg = this._getTemporalValue(arg, visitedValues);\n          invariant(equivalenceArg instanceof AbstractObjectValue);\n\n          if (equivalenceArg !== arg) {\n            temporalArgs[i] = equivalenceArg;\n          }\n        }\n      } else if (arg instanceof AbstractValue) {\n        equivalenceArg = this.residualReactElementVisitor.residualHeapVisitor.equivalenceSet.add(arg);\n\n        if (arg !== equivalenceArg) {\n          temporalArgs[i] = equivalenceArg;\n        }\n      }\n      currentMap = this.getKey(i, (currentMap: any), visitedValues);\n      invariant(arg instanceof Value && (equivalenceArg instanceof Value || equivalenceArg === undefined));\n      result = this._getValue(equivalenceArg || arg, currentMap, visitedValues);\n      currentMap = result.map;\n    }\n    invariant(result !== undefined);\n    if (result.value === null) {\n      result.value = temporalAlias;\n    }\n    // Check to ensure the equivalent temporal alias is definitely declared in the current scope\n    if (!this.residualReactElementVisitor.wasTemporalAliasDeclaredInCurrentScope(result.value)) {\n      result.value = temporalAlias;\n      return temporalAlias;\n    }\n    return result.value;\n  }\n\n  getTemporalAliasValue(\n    temporalAlias: AbstractObjectValue,\n    map: ReactSetValueMap,\n    visitedValues: Set<Value>\n  ): ReactSetNode {\n    let result = this._getTemporalValue(temporalAlias, visitedValues);\n\n    invariant(result instanceof AbstractObjectValue);\n    if (!map.has(result)) {\n      map.set(result, this._createNode());\n    }\n    return ((map.get(result): any): ReactSetNode);\n  }\n\n  // for arrays: [length] -> ([length] is numeric) -> [0] -> [1] -> [2]... as nodes\n  _getArrayValue(array: ArrayValue, visitedValues: Set<Value>): ArrayValue {\n    if (visitedValues.has(array)) return array;\n    if (array.intrinsicName) return array;\n    visitedValues.add(array);\n    let currentMap = this.arrayRoot;\n    currentMap = this.getKey(\"length\", currentMap, visitedValues);\n    let result = this.getEquivalentPropertyValue(array, \"length\", currentMap, visitedValues);\n    currentMap = result.map;\n\n    let lengthValue = getProperty(this.realm, array, \"length\");\n    // If we have a numeric lenth that is not abstract, then also check all the array elements\n    if (lengthValue instanceof NumberValue) {\n      invariant(lengthValue instanceof NumberValue);\n      let length = lengthValue.value;\n\n      for (let i = 0; i < length; i++) {\n        currentMap = this.getKey(i, currentMap, visitedValues);\n        result = this.getEquivalentPropertyValue(array, \"\" + i, currentMap, visitedValues);\n        currentMap = result.map;\n      }\n    }\n    if (result === undefined) {\n      if (this.realm.react.emptyArray !== undefined) {\n        return this.realm.react.emptyArray;\n      }\n      return array;\n    }\n    if (result.value === null) {\n      result.value = array;\n    }\n    invariant(result.value instanceof ArrayValue);\n    return result.value;\n  }\n\n  getEquivalentPropertyValue(\n    object: ObjectValue,\n    propName: string,\n    map: ReactSetValueMap,\n    visitedValues: Set<Value>\n  ): ReactSetNode {\n    let prop = getProperty(this.realm, object, propName);\n    let isFinal = object.mightBeFinalObject();\n    let equivalentProp;\n\n    if (prop instanceof ObjectValue && isReactElement(prop)) {\n      equivalentProp = this.residualReactElementVisitor.reactElementEquivalenceSet.add(prop);\n    } else if (prop instanceof ObjectValue && isReactPropsObject(prop)) {\n      equivalentProp = this.residualReactElementVisitor.reactPropsEquivalenceSet.add(prop);\n    } else if (prop instanceof AbstractValue) {\n      equivalentProp = this.residualReactElementVisitor.residualHeapVisitor.equivalenceSet.add(prop);\n    }\n\n    if (equivalentProp !== undefined) {\n      if (prop !== equivalentProp && isFinal) {\n        hardModifyReactObjectPropertyBinding(this.realm, object, propName, equivalentProp);\n      }\n      if (!map.has(equivalentProp)) {\n        map.set(equivalentProp, this._createNode());\n      }\n      return ((map.get(equivalentProp): any): ReactSetNode);\n    } else {\n      return this._getValue(prop, map, visitedValues);\n    }\n  }\n}\n"
  },
  {
    "path": "src/react/ReactPropsSet.js",
    "content": "/**\n * Copyright (c) 2017-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n/* @flow */\n\nimport { Realm } from \"../realm.js\";\nimport { ObjectValue, Value } from \"../values/index.js\";\nimport invariant from \"../invariant.js\";\nimport { ReactEquivalenceSet, temporalAliasSymbol } from \"./ReactEquivalenceSet.js\";\n\nexport class ReactPropsSet {\n  constructor(realm: Realm, reactEquivalenceSet: ReactEquivalenceSet) {\n    this.realm = realm;\n    this.reactEquivalenceSet = reactEquivalenceSet;\n  }\n  realm: Realm;\n  reactEquivalenceSet: ReactEquivalenceSet;\n\n  add(props: ObjectValue, visitedValues: Set<Value> | void): ObjectValue {\n    if (!visitedValues) visitedValues = new Set();\n    let reactEquivalenceSet = this.reactEquivalenceSet;\n    let currentMap = reactEquivalenceSet.reactPropsRoot;\n    let result;\n\n    for (let [propName] of props.properties) {\n      currentMap = reactEquivalenceSet.getKey(propName, currentMap, visitedValues);\n      result = reactEquivalenceSet.getEquivalentPropertyValue(props, propName, currentMap, visitedValues);\n      currentMap = result.map;\n    }\n    let temporalAlias = props.temporalAlias;\n\n    if (temporalAlias !== undefined) {\n      currentMap = reactEquivalenceSet.getKey(temporalAliasSymbol, currentMap, visitedValues);\n      result = reactEquivalenceSet.getTemporalAliasValue(temporalAlias, currentMap, visitedValues);\n      currentMap = result.map;\n    }\n\n    if (result === undefined) {\n      // If we have a temporalAlias, we can never return an empty object\n      if (temporalAlias === undefined && this.realm.react.emptyObject !== undefined) {\n        return this.realm.react.emptyObject;\n      }\n      return props;\n    }\n    if (result.value === null) {\n      result.value = props;\n    }\n    invariant(result.value instanceof ObjectValue);\n    return result.value;\n  }\n}\n"
  },
  {
    "path": "src/react/branching.js",
    "content": "/**\n * Copyright (c) 2017-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n/* @flow strict-local */\n\nimport { Realm } from \"../realm.js\";\nimport {\n  AbstractObjectValue,\n  AbstractValue,\n  ArrayValue,\n  BooleanValue,\n  NullValue,\n  NumberValue,\n  ObjectValue,\n  StringValue,\n  UndefinedValue,\n  Value,\n} from \"../values/index.js\";\nimport invariant from \"../invariant.js\";\nimport { ValuesDomain } from \"../domains/index.js\";\nimport {\n  cloneReactElement,\n  isReactElement,\n  addKeyToReactElement,\n  forEachArrayValue,\n  getProperty,\n  mapArrayValue,\n} from \"./utils.js\";\nimport { ExpectedBailOut } from \"./errors.js\";\nimport { createOperationDescriptor } from \"../utils/generator.js\";\n\n// Branch status is used for when Prepack returns an abstract value from a render\n// that results in a conditional path occuring. This can be problematic for reconcilation\n// as the reconciler then needs to understand if this is the start of a new branch, or if\n// it's actually deep into an existing branch. If it's a new branch, we need to apply\n// keys to the root JSX element so that it keeps it identity (because we're folding trees).\n// Furthermore, we also need to bail-out of folding class components where they have lifecycle\n// events, as we can't merge lifecycles of mutliple trees when branched reliably\nexport type BranchStatusEnum = \"ROOT\" | \"NO_BRANCH\" | \"NEW_BRANCH\" | \"BRANCH\";\n\n// This function aims to determine if we need to add keys to the ReactElements\n// of the returned conditional abstract value branches. It does this by first\n// checking the parent branch nodes (these were use to render both respective branches)\n// for any cases where ReactElement types on host components mismatch.\n// Note: this implementation is not fully sound and is likely missing support\n// for all React reconcilation cases for handling of keys, see issue #1131\n\nexport function getValueWithBranchingLogicApplied(\n  realm: Realm,\n  parentX: Value,\n  parentY: Value,\n  value: AbstractValue\n): Value {\n  let needsKeys = false;\n\n  // we check the inlined value and see if the component types match\n  const searchAndFlagMatchingComponentTypes = (x, y, xTypeParent, yTypeParent) => {\n    // The returned value is the result of getting the \"render\" from a component.\n    // We need to search the value returned to see if the nodes need keys adding to them.\n\n    // 1. If we have <X? /> and <Y? />, then check if their\n    // types are the same, if they are the same and the parent types\n    // are not the same as then we need to add keys\n    if (x instanceof ObjectValue && isReactElement(x) && y instanceof ObjectValue && isReactElement(y)) {\n      let xType = getProperty(realm, x, \"type\");\n      let yType = getProperty(realm, y, \"type\");\n\n      if (xType.equals(yType) && !xTypeParent.equals(xType) && !yTypeParent.equals(yType)) {\n        needsKeys = true;\n      }\n    } else if (x instanceof ArrayValue) {\n      // If we have x: []\n      // Go  through the elements of array x\n      forEachArrayValue(realm, x, (xElem, index) => {\n        let yElem = y;\n        // And if we also have y: [], with a given element from x\n        // search element of y at the same index from x.\n        // If y is not an array, then continue but use x: [] against y\n        if (y instanceof ArrayValue) {\n          yElem = getProperty(realm, y, index + \"\");\n        }\n        searchAndFlagMatchingComponentTypes(xElem, yElem, xTypeParent, yTypeParent);\n      });\n    } else if (y instanceof ArrayValue) {\n      // If we have y: []\n      // Go  through the elements of array y\n      forEachArrayValue(realm, y, (yElem, index) => {\n        let xElem = x;\n        // And if we also have x: [], with a given element from y\n        // search element of x at the same index from y.\n        // If x is not an array, then continue but use y: [] against x\n        if (x instanceof ArrayValue) {\n          xElem = getProperty(realm, x, index + \"\");\n        }\n        searchAndFlagMatchingComponentTypes(xElem, yElem, xTypeParent, yTypeParent);\n      });\n    } else if (x instanceof AbstractValue && x.kind === \"conditional\") {\n      // if x is a conditional value like \"a ? b : c\",\n      // then recusrively check b and c agaginst that y\n      let [, consequentVal, alternateVal] = x.args;\n\n      searchAndFlagMatchingComponentTypes(consequentVal, y, xTypeParent, yTypeParent);\n      searchAndFlagMatchingComponentTypes(alternateVal, y, xTypeParent, yTypeParent);\n    } else if (y instanceof AbstractValue && y.kind === \"conditional\") {\n      // if y is a conditional value like \"a ? b : c\",\n      // then recusrively check b and c agaginst that x\n      let [, consequentVal, alternateVal] = y.args;\n\n      searchAndFlagMatchingComponentTypes(x, consequentVal, xTypeParent, yTypeParent);\n      searchAndFlagMatchingComponentTypes(x, alternateVal, xTypeParent, yTypeParent);\n    }\n  };\n\n  // we first check our \"parent\" value, that was used to get the inlined value\n  const searchAndFlagMismatchingNonHostTypes = (x: Value, y: Value, arrayDepth: number): void => {\n    if (x instanceof ObjectValue && isReactElement(x) && y instanceof ObjectValue && isReactElement(y)) {\n      let xType = getProperty(realm, x, \"type\");\n      let yType = getProperty(realm, y, \"type\");\n\n      if (xType instanceof StringValue && yType instanceof StringValue) {\n        let xProps = getProperty(realm, x, \"props\");\n        let yProps = getProperty(realm, y, \"props\");\n        if (xProps instanceof ObjectValue && yProps instanceof ObjectValue) {\n          let xChildren = getProperty(realm, xProps, \"children\");\n          let yChildren = getProperty(realm, yProps, \"children\");\n\n          if (xChildren instanceof Value && yChildren instanceof Value) {\n            searchAndFlagMismatchingNonHostTypes(xChildren, yChildren, arrayDepth);\n          }\n        }\n      } else if (!xType.equals(yType)) {\n        let [, xVal, yVal] = value.args;\n        searchAndFlagMatchingComponentTypes(xVal, yVal, xType, yType);\n      }\n    } else if (\n      ArrayValue.isIntrinsicAndHasWidenedNumericProperty(x) ||\n      ArrayValue.isIntrinsicAndHasWidenedNumericProperty(y)\n    ) {\n      // If either case is an array with wideneded properties, we do not know\n      // the contents of the array, so we cannot add keys\n    } else if (x instanceof ArrayValue && arrayDepth === 0) {\n      forEachArrayValue(realm, x, (xElem, index) => {\n        let yElem;\n        if (y instanceof ArrayValue) {\n          // handle the case of [x].equals([y])\n          yElem = getProperty(realm, y, index + \"\");\n        } else if (index === 0) {\n          // handle the case of [x].equals(y)\n          yElem = y;\n        }\n\n        if (xElem instanceof Value && yElem instanceof Value) {\n          searchAndFlagMismatchingNonHostTypes(xElem, yElem, arrayDepth + 1);\n        }\n      });\n    } else if (y instanceof ArrayValue && arrayDepth === 0) {\n      forEachArrayValue(realm, y, (yElem, index) => {\n        let xElem;\n        if (x instanceof ArrayValue) {\n          // handle the case of [y].equals([x]\n          xElem = getProperty(realm, x, index + \"\");\n        } else if (index === 0) {\n          // handle the case of [y].equals(x)\n          xElem = x;\n        }\n\n        if (xElem instanceof Value && yElem instanceof Value) {\n          searchAndFlagMismatchingNonHostTypes(xElem, yElem, arrayDepth + 1);\n        }\n      });\n    }\n  };\n\n  searchAndFlagMismatchingNonHostTypes(parentX, parentY, 0);\n\n  if (needsKeys) {\n    return applyBranchedLogicValue(realm, value, false);\n  }\n  return value;\n}\n\n// When we apply branching logic, it means to add keys to all ReactElement nodes\n// we encounter, thus returning new ReactElements with the keys on them\nfunction applyBranchedLogicValue(realm: Realm, value: Value, inBranch: boolean): Value {\n  if (\n    value instanceof StringValue ||\n    value instanceof NumberValue ||\n    value instanceof BooleanValue ||\n    value instanceof NullValue ||\n    value instanceof UndefinedValue\n  ) {\n    // terminal values\n  } else if (value instanceof ObjectValue && isReactElement(value)) {\n    if (inBranch) {\n      return wrapReactElementInBranchOrReturnValue(realm, addKeyToReactElement(realm, value));\n    } else {\n      return addKeyToReactElement(realm, value);\n    }\n  } else if (value instanceof ArrayValue) {\n    let newArray = mapArrayValue(realm, value, elementValue => applyBranchedLogicValue(realm, elementValue, inBranch));\n    newArray.makeFinal();\n    return newArray;\n  } else if (value instanceof AbstractValue && value.kind === \"conditional\") {\n    let [condValue, consequentVal, alternateVal] = value.args;\n    invariant(condValue instanceof AbstractValue);\n\n    return realm.evaluateWithAbstractConditional(\n      condValue,\n      () => {\n        return realm.evaluateForEffects(\n          () => applyBranchedLogicValue(realm, consequentVal, true),\n          null,\n          \"applyBranchedLogicValue consequent\"\n        );\n      },\n      () => {\n        return realm.evaluateForEffects(\n          () => applyBranchedLogicValue(realm, alternateVal, true),\n          null,\n          \"applyBranchedLogicValue alternate\"\n        );\n      }\n    );\n  } else if (value instanceof AbstractValue && (value.kind === \"||\" || value.kind === \"&&\")) {\n    invariant(false, \"applyBranchedLogicValue encounterted a logical expression (|| or &&), this should never occur\");\n  } else {\n    throw new ExpectedBailOut(\"Unsupported value encountered when applying branched logic to values\");\n  }\n  return value;\n}\n\n// when a ReactElement is resolved in a conditional branch we\n// can improve runtime performance by ensuring that the ReactElement\n// is only created lazily in that specific branch and referenced\n// from then on. To do this we create a temporal abstract value\n// and set its kind to \"branched ReactElement\" so we properly track\n// the original ReactElement. If we don't have a ReactElement,\n// return the original value\nexport function wrapReactElementInBranchOrReturnValue(realm: Realm, value: Value): Value {\n  if (value instanceof ObjectValue && isReactElement(value)) {\n    let temporal = AbstractValue.createTemporalFromBuildFunction(\n      realm,\n      ObjectValue,\n      [cloneReactElement(realm, value, false)],\n      createOperationDescriptor(\"SINGLE_ARG\"),\n      { isPure: true, skipInvariant: true }\n    );\n    invariant(temporal instanceof AbstractObjectValue);\n    temporal.values = new ValuesDomain(value);\n    value.temporalAlias = temporal;\n  }\n  return value;\n}\n"
  },
  {
    "path": "src/react/components.js",
    "content": "/**\n * Copyright (c) 2017-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n/* @flow */\n\nimport { Realm } from \"../realm.js\";\nimport {\n  AbstractValue,\n  BoundFunctionValue,\n  ECMAScriptSourceFunctionValue,\n  ObjectValue,\n  AbstractObjectValue,\n  SymbolValue,\n  NativeFunctionValue,\n  ECMAScriptFunctionValue,\n  Value,\n} from \"../values/index.js\";\nimport * as t from \"@babel/types\";\nimport type { BabelNodeIdentifier } from \"@babel/types\";\nimport {\n  flagPropsWithNoPartialKeyOrRef,\n  getProperty,\n  getValueFromFunctionCall,\n  hardModifyReactObjectPropertyBinding,\n  valueIsClassComponent,\n} from \"./utils.js\";\nimport { ExpectedBailOut, SimpleClassBailOut } from \"./errors.js\";\nimport { Get, Construct } from \"../methods/index.js\";\nimport { Properties } from \"../singletons.js\";\nimport invariant from \"../invariant.js\";\nimport traverse from \"@babel/traverse\";\nimport type { ClassComponentMetadata, ReactComponentTreeConfig } from \"../types.js\";\nimport type { ReactEvaluatedNode } from \"../serializer/types.js\";\nimport { FatalError } from \"../errors.js\";\nimport { type ComponentModel, ShapeInformation } from \"../utils/ShapeInformation.js\";\nimport { PropertyDescriptor } from \"../descriptors.js\";\n\nconst lifecycleMethods = new Set([\n  \"componentWillUnmount\",\n  \"componentDidMount\",\n  \"componentWillMount\",\n  \"componentDidUpdate\",\n  \"componentWillUpdate\",\n  \"componentDidCatch\",\n  \"componentWillReceiveProps\",\n]);\n\nconst whitelistedProperties = new Set([\"props\", \"context\", \"refs\", \"setState\"]);\n\nexport function getInitialProps(\n  realm: Realm,\n  componentType: ECMAScriptSourceFunctionValue | BoundFunctionValue | null,\n  { modelString }: ReactComponentTreeConfig\n): AbstractObjectValue {\n  let componentModel = modelString !== undefined ? (JSON.parse(modelString): ComponentModel) : undefined;\n  let shape = ShapeInformation.createForReactComponentProps(componentModel);\n  let propsName = null;\n  if (componentType !== null) {\n    if (valueIsClassComponent(realm, componentType)) {\n      propsName = \"this.props\";\n    } else {\n      let formalParameters;\n      if (componentType instanceof BoundFunctionValue) {\n        invariant(componentType.$BoundTargetFunction instanceof ECMAScriptSourceFunctionValue);\n        formalParameters = componentType.$BoundTargetFunction.$FormalParameters;\n      } else {\n        formalParameters = componentType.$FormalParameters;\n      }\n      // otherwise it's a functional component, where the first paramater of the function is \"props\" (if it exists)\n      if (formalParameters.length > 0) {\n        let firstParam = formalParameters[0];\n        if (t.isIdentifier(firstParam)) {\n          propsName = ((firstParam: any): BabelNodeIdentifier).name;\n        }\n      }\n    }\n  }\n  let abstractPropsObject = AbstractValue.createAbstractObject(realm, propsName || \"props\", shape);\n  invariant(abstractPropsObject instanceof AbstractObjectValue);\n  flagPropsWithNoPartialKeyOrRef(realm, abstractPropsObject);\n  abstractPropsObject.makeFinal();\n  return abstractPropsObject;\n}\n\nexport function getInitialContext(\n  realm: Realm,\n  componentType: ECMAScriptSourceFunctionValue | BoundFunctionValue\n): AbstractObjectValue {\n  let contextName = null;\n  if (valueIsClassComponent(realm, componentType)) {\n    // it's a class component, so we need to check the type on for context of the component prototype\n    let superTypeParameters = componentType.$SuperTypeParameters;\n    contextName = \"this.context\";\n\n    if (superTypeParameters !== undefined) {\n      throw new ExpectedBailOut(\"context on class components not yet supported\");\n    }\n  } else {\n    let formalParameters;\n    if (componentType instanceof BoundFunctionValue) {\n      invariant(componentType.$BoundTargetFunction instanceof ECMAScriptSourceFunctionValue);\n      formalParameters = componentType.$BoundTargetFunction.$FormalParameters;\n    } else {\n      formalParameters = componentType.$FormalParameters;\n    }\n    // otherwise it's a functional component, where the second paramater of the function is \"context\" (if it exists)\n    if (formalParameters.length > 1) {\n      let secondParam = formalParameters[1];\n      if (t.isIdentifier(secondParam)) {\n        contextName = ((secondParam: any): BabelNodeIdentifier).name;\n      }\n    }\n  }\n  let value = AbstractValue.createAbstractObject(realm, contextName || \"context\");\n  return value;\n}\n\nfunction visitClassMethodAstForThisUsage(realm: Realm, method: ECMAScriptSourceFunctionValue): void {\n  let formalParameters = method.$FormalParameters;\n  let code = method.$ECMAScriptCode;\n\n  traverse(\n    t.file(t.program([t.expressionStatement(t.functionExpression(null, formalParameters, code))])),\n    {\n      ThisExpression(path) {\n        let parentNode = path.parentPath.node;\n\n        if (!t.isMemberExpression(parentNode)) {\n          throw new SimpleClassBailOut(`possible leakage of independent \"this\" reference found`);\n        }\n      },\n    },\n    null,\n    {}\n  );\n}\n\nexport function createSimpleClassInstance(\n  realm: Realm,\n  componentType: ECMAScriptSourceFunctionValue | BoundFunctionValue,\n  props: ObjectValue | AbstractValue,\n  context: ObjectValue | AbstractValue\n): AbstractObjectValue {\n  let componentPrototype = Get(realm, componentType, \"prototype\");\n  invariant(componentPrototype instanceof ObjectValue);\n  // create an instance object and disable serialization as we don't want to output the internals we set below\n  let instance = new ObjectValue(realm, componentPrototype, \"this\", true);\n  let allowedPropertyAccess = new Set([\"props\", \"context\"]);\n  for (let [name] of componentPrototype.properties) {\n    if (lifecycleMethods.has(name)) {\n      // this error will result in the simple class falling back to a complex class\n      throw new SimpleClassBailOut(\"lifecycle methods are not supported on simple classes\");\n    } else if (name !== \"constructor\") {\n      allowedPropertyAccess.add(name);\n      let method = Get(realm, componentPrototype, name);\n      if (method instanceof ECMAScriptSourceFunctionValue) {\n        visitClassMethodAstForThisUsage(realm, method);\n      }\n      Properties.Set(realm, instance, name, method, true);\n    }\n  }\n  // assign props\n  Properties.Set(realm, instance, \"props\", props, true);\n  // assign context\n  Properties.Set(realm, instance, \"context\", context, true);\n  // as this object is simple, we want to check if any access to anything other than\n  // \"this.props\" or \"this.context\" or methods on the class occur\n  let $GetOwnProperty = instance.$GetOwnProperty;\n  instance.$GetOwnProperty = P => {\n    if (!allowedPropertyAccess.has(P)) {\n      // this error will result in the simple class falling back to a complex class\n      throw new SimpleClassBailOut(\"access to basic class instance properties is not supported on simple classes\");\n    }\n    return $GetOwnProperty.call(instance, P);\n  };\n  // enable serialization to support simple instance variables properties\n  instance.refuseSerialization = false;\n  // return the instance\n  return instance;\n}\n\nfunction deeplyApplyInstancePrototypeProperties(\n  realm: Realm,\n  instance: ObjectValue,\n  componentPrototype: ObjectValue,\n  classMetadata: ClassComponentMetadata\n) {\n  let { instanceProperties, instanceSymbols } = classMetadata;\n  let proto = componentPrototype.$Prototype;\n\n  if (proto instanceof ObjectValue && proto !== realm.intrinsics.ObjectPrototype) {\n    deeplyApplyInstancePrototypeProperties(realm, instance, proto, classMetadata);\n  }\n\n  for (let [name] of componentPrototype.properties) {\n    // ensure we don't set properties that were defined on the instance\n    if (name !== \"constructor\" && !instanceProperties.has(name)) {\n      Properties.Set(realm, instance, name, Get(realm, componentPrototype, name), true);\n    }\n  }\n  for (let [symbol] of componentPrototype.symbols) {\n    // ensure we don't set symbols that were defined on the instance\n    if (!instanceSymbols.has(symbol)) {\n      Properties.Set(realm, instance, symbol, Get(realm, componentPrototype, symbol), true);\n    }\n  }\n}\n\nexport function createClassInstanceForFirstRenderOnly(\n  realm: Realm,\n  componentType: ECMAScriptSourceFunctionValue | BoundFunctionValue,\n  props: ObjectValue | AbstractValue,\n  context: ObjectValue | AbstractValue,\n  evaluatedNode: ReactEvaluatedNode\n): ObjectValue {\n  let instance = getValueFromFunctionCall(realm, componentType, realm.intrinsics.undefined, [props, context], true);\n  let objectAssign = Get(realm, realm.intrinsics.Object, \"assign\");\n  invariant(objectAssign instanceof ECMAScriptFunctionValue);\n  let objectAssignCall = objectAssign.$Call;\n  invariant(objectAssignCall !== undefined);\n\n  invariant(instance instanceof ObjectValue);\n  instance.refuseSerialization = true;\n  // assign props\n  Properties.Set(realm, instance, \"props\", props, true);\n  // assign context\n  Properties.Set(realm, instance, \"context\", context, true);\n  let state = Get(realm, instance, \"state\");\n  if (state instanceof AbstractObjectValue || state instanceof ObjectValue) {\n    state.makeFinal();\n  }\n  // assign a mocked setState\n  let setState = new NativeFunctionValue(realm, undefined, `setState`, 1, (_context, [stateToUpdate, callback]) => {\n    invariant(instance instanceof ObjectValue);\n    let prevState = Get(realm, instance, \"state\");\n    invariant(prevState instanceof ObjectValue);\n\n    if (stateToUpdate instanceof ECMAScriptSourceFunctionValue && stateToUpdate.$Call) {\n      stateToUpdate = stateToUpdate.$Call(instance, [prevState]);\n    }\n    if (stateToUpdate instanceof ObjectValue) {\n      let newState = new ObjectValue(realm, realm.intrinsics.ObjectPrototype);\n      objectAssignCall(realm.intrinsics.undefined, [newState, prevState]);\n      newState.makeFinal();\n\n      for (let [key, binding] of stateToUpdate.properties) {\n        if (binding && binding.descriptor) {\n          invariant(binding.descriptor instanceof PropertyDescriptor);\n          if (binding.descriptor.enumerable) {\n            let value = getProperty(realm, stateToUpdate, key);\n            hardModifyReactObjectPropertyBinding(realm, newState, key, value);\n          }\n        }\n      }\n\n      Properties.Set(realm, instance, \"state\", newState, true);\n    }\n    if (callback instanceof ECMAScriptSourceFunctionValue && callback.$Call) {\n      callback.$Call(instance, []);\n    }\n    return realm.intrinsics.undefined;\n  });\n  setState.intrinsicName = \"(function() {})\";\n  Properties.Set(realm, instance, \"setState\", setState, true);\n\n  instance.refuseSerialization = false;\n  return instance;\n}\n\nexport function createClassInstance(\n  realm: Realm,\n  componentType: ECMAScriptSourceFunctionValue | BoundFunctionValue,\n  props: ObjectValue | AbstractValue,\n  context: ObjectValue | AbstractValue,\n  classMetadata: ClassComponentMetadata\n): AbstractObjectValue {\n  let componentPrototype = Get(realm, componentType, \"prototype\");\n  invariant(componentPrototype instanceof ObjectValue);\n  // create an instance object and disable serialization as we don't want to output the internals we set below\n  let instance = new ObjectValue(realm, componentPrototype, \"this\", true);\n  deeplyApplyInstancePrototypeProperties(realm, instance, componentPrototype, classMetadata);\n\n  // assign refs\n  Properties.Set(realm, instance, \"refs\", AbstractValue.createAbstractObject(realm, \"this.refs\"), true);\n  // assign props\n  Properties.Set(realm, instance, \"props\", props, true);\n  // assign context\n  Properties.Set(realm, instance, \"context\", context, true);\n  // enable serialization to support simple instance variables properties\n  instance.refuseSerialization = false;\n  // return the instance in an abstract object\n  let value = AbstractValue.createAbstractObject(realm, \"this\", instance);\n  invariant(value instanceof AbstractObjectValue);\n  return value;\n}\n\nexport function evaluateClassConstructor(\n  realm: Realm,\n  constructorFunc: ECMAScriptSourceFunctionValue | BoundFunctionValue,\n  props: ObjectValue | AbstractValue | AbstractObjectValue,\n  context: ObjectValue | AbstractObjectValue\n): { instanceProperties: Set<string>, instanceSymbols: Set<SymbolValue> } {\n  let instanceProperties = new Set();\n  let instanceSymbols = new Set();\n\n  const funcCall = () =>\n    realm.evaluateForEffects(\n      () => {\n        let instance = Construct(realm, constructorFunc, [props, context]);\n        invariant(instance instanceof ObjectValue);\n        for (let [propertyName] of instance.properties) {\n          if (!whitelistedProperties.has(propertyName)) {\n            instanceProperties.add(propertyName);\n          }\n        }\n        for (let [symbol] of instance.symbols) {\n          instanceSymbols.add(symbol);\n        }\n        return instance;\n      },\n      /*state*/ null,\n      `react component constructor: ${constructorFunc.getName()}`\n    );\n\n  if (realm.isInPureScope()) {\n    funcCall();\n  } else {\n    realm.evaluateWithPureScope(funcCall);\n  }\n\n  return {\n    instanceProperties,\n    instanceSymbols,\n  };\n}\n\nexport function applyGetDerivedStateFromProps(\n  realm: Realm,\n  getDerivedStateFromProps: ECMAScriptSourceFunctionValue,\n  instance: ObjectValue,\n  props: ObjectValue | AbstractValue | AbstractObjectValue\n): void {\n  let prevState = Get(realm, instance, \"state\");\n  let getDerivedStateFromPropsCall = getDerivedStateFromProps.$Call;\n  invariant(getDerivedStateFromPropsCall !== undefined);\n  let partialState = getDerivedStateFromPropsCall(realm.intrinsics.null, [props, prevState]);\n\n  const deriveState = state => {\n    let objectAssign = Get(realm, realm.intrinsics.Object, \"assign\");\n    invariant(objectAssign instanceof ECMAScriptFunctionValue);\n    let objectAssignCall = objectAssign.$Call;\n    invariant(objectAssignCall !== undefined);\n\n    if (state instanceof AbstractValue && !(state instanceof AbstractObjectValue)) {\n      const kind = state.kind;\n\n      if (kind === \"conditional\") {\n        let condition = state.args[0];\n        let a = deriveState(state.args[1]);\n        let b = deriveState(state.args[2]);\n        invariant(condition instanceof AbstractValue);\n        if (a === null && b === null) {\n          return null;\n        } else if (a === null) {\n          invariant(b instanceof Value);\n          return AbstractValue.createFromConditionalOp(realm, condition, realm.intrinsics.false, b);\n        } else if (b === null) {\n          invariant(a instanceof Value);\n          return AbstractValue.createFromConditionalOp(realm, condition, a, realm.intrinsics.false);\n        } else {\n          invariant(a instanceof Value);\n          invariant(b instanceof Value);\n          return AbstractValue.createFromConditionalOp(realm, condition, a, b);\n        }\n      } else if (kind === \"||\" || kind === \"&&\") {\n        let a = deriveState(state.args[0]);\n        let b = deriveState(state.args[1]);\n        if (b === null) {\n          invariant(a instanceof Value);\n          return AbstractValue.createFromLogicalOp(realm, kind, a, realm.intrinsics.false);\n        } else {\n          invariant(a instanceof Value);\n          invariant(b instanceof Value);\n          return AbstractValue.createFromLogicalOp(realm, kind, a, b);\n        }\n      } else {\n        invariant(state.args !== undefined, \"TODO: unknown abstract value passed to deriveState\");\n        // as the value is completely abstract, we need to add a bunch of\n        // operations to be emitted to ensure we do the right thing at runtime\n        let a = AbstractValue.createFromBinaryOp(realm, \"!==\", state, realm.intrinsics.null);\n        let b = AbstractValue.createFromBinaryOp(realm, \"!==\", state, realm.intrinsics.undefined);\n        let c = AbstractValue.createFromLogicalOp(realm, \"&&\", a, b);\n        invariant(c instanceof AbstractValue);\n        let newState = new ObjectValue(realm, realm.intrinsics.ObjectPrototype);\n        let preludeGenerator = realm.preludeGenerator;\n        invariant(preludeGenerator !== undefined);\n        // we cannot use the standard Object.assign as partial state\n        // is not simple. however, given getDerivedStateFromProps is\n        // meant to be pure, we can assume that there are no getters on\n        // the partial abstract state\n        AbstractValue.createTemporalObjectAssign(realm, newState, [prevState, state]);\n        newState.makeSimple();\n        newState.makePartial();\n        newState.makeFinal();\n        let conditional = AbstractValue.createFromLogicalOp(realm, \"&&\", c, newState);\n        return conditional;\n      }\n    } else if (state !== realm.intrinsics.null && state !== realm.intrinsics.undefined) {\n      let newState = new ObjectValue(realm, realm.intrinsics.ObjectPrototype);\n      try {\n        objectAssignCall(realm.intrinsics.undefined, [newState, prevState, state]);\n      } catch (e) {\n        if (realm.isInPureScope() && e instanceof FatalError) {\n          let preludeGenerator = realm.preludeGenerator;\n          invariant(preludeGenerator !== undefined);\n          AbstractValue.createTemporalObjectAssign(realm, newState, [prevState, state]);\n          newState.makeSimple();\n          newState.makePartial();\n          return newState;\n        }\n        throw e;\n      }\n      newState.makeFinal();\n      return newState;\n    } else {\n      return null;\n    }\n  };\n\n  let newState = deriveState(partialState);\n  if (newState !== null) {\n    if (newState instanceof AbstractValue) {\n      newState = AbstractValue.createFromLogicalOp(realm, \"||\", newState, prevState);\n    }\n    invariant(newState instanceof Value);\n    Properties.Set(realm, instance, \"state\", newState, true);\n  }\n}\n"
  },
  {
    "path": "src/react/elements.js",
    "content": "/**\n * Copyright (c) 2017-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n/* @flow */\n\nimport type { Realm } from \"../realm.js\";\nimport { ValuesDomain } from \"../domains/index.js\";\nimport {\n  AbstractValue,\n  AbstractObjectValue,\n  ArrayValue,\n  NullValue,\n  NumberValue,\n  ObjectValue,\n  Value,\n} from \"../values/index.js\";\nimport { Create } from \"../singletons.js\";\nimport invariant from \"../invariant.js\";\nimport { Get } from \"../methods/index.js\";\nimport {\n  applyObjectAssignConfigsForReactElement,\n  createInternalReactElement,\n  flagPropsWithNoPartialKeyOrRef,\n  flattenChildren,\n  getMaxLength,\n  hardModifyReactObjectPropertyBinding,\n  getProperty,\n  hasNoPartialKeyOrRef,\n} from \"./utils.js\";\nimport { computeBinary } from \"../evaluators/BinaryExpression.js\";\nimport { CompilerDiagnostic, FatalError } from \"../errors.js\";\nimport { createOperationDescriptor } from \"../utils/generator.js\";\nimport { PropertyDescriptor } from \"../descriptors.js\";\n\nfunction createPropsObject(\n  realm: Realm,\n  type: Value,\n  config: ObjectValue | AbstractObjectValue,\n  children: void | Value\n): { key: Value, ref: Value, props: ObjectValue } {\n  // If we're in \"rendering\" a React component tree, we should have an active reconciler\n  let activeReconciler = realm.react.activeReconciler;\n  let firstRenderOnly = activeReconciler !== undefined ? activeReconciler.componentTreeConfig.firstRenderOnly : false;\n  let defaultProps =\n    type instanceof ObjectValue || type instanceof AbstractObjectValue\n      ? Get(realm, type, \"defaultProps\")\n      : realm.intrinsics.undefined;\n\n  let props = Create.ObjectCreate(realm, realm.intrinsics.ObjectPrototype);\n  props.makeFinal();\n  realm.react.reactProps.add(props);\n\n  let key = realm.intrinsics.null;\n  let ref = realm.intrinsics.null;\n\n  if (!hasNoPartialKeyOrRef(realm, config)) {\n    // if either are abstract, this will impact the reconcilation process\n    // and ultimately prevent us from folding ReactElements properly\n    let diagnostic = new CompilerDiagnostic(\n      `unable to evaluate \"key\" and \"ref\" on a ReactElement due to an abstract config passed to createElement`,\n      realm.currentLocation,\n      \"PP0025\",\n      \"FatalError\"\n    );\n    realm.handleError(diagnostic);\n    if (realm.handleError(diagnostic) === \"Fail\") throw new FatalError();\n  }\n\n  let possibleKey = Get(realm, config, \"key\");\n  if (possibleKey !== realm.intrinsics.null && possibleKey !== realm.intrinsics.undefined) {\n    // if the config has been marked as having no partial key or ref and the possible key\n    // is abstract, yet the config doesn't have a key property, then the key can remain null\n    let keyNotNeeded =\n      hasNoPartialKeyOrRef(realm, config) &&\n      possibleKey instanceof AbstractValue &&\n      config instanceof ObjectValue &&\n      !config.properties.has(\"key\");\n\n    if (!keyNotNeeded) {\n      key = computeBinary(realm, \"+\", realm.intrinsics.emptyString, possibleKey);\n    }\n  }\n\n  let possibleRef = Get(realm, config, \"ref\");\n  if (possibleRef !== realm.intrinsics.null && possibleRef !== realm.intrinsics.undefined && !firstRenderOnly) {\n    // if the config has been marked as having no partial key or ref and the possible ref\n    // is abstract, yet the config doesn't have a ref property, then the ref can remain null\n    let refNotNeeded =\n      hasNoPartialKeyOrRef(realm, config) &&\n      possibleRef instanceof AbstractValue &&\n      config instanceof ObjectValue &&\n      !config.properties.has(\"ref\");\n\n    if (!refNotNeeded) {\n      ref = possibleRef;\n    }\n  }\n\n  const setProp = (name: string, value: Value): void => {\n    if (name !== \"__self\" && name !== \"__source\" && name !== \"key\" && name !== \"ref\") {\n      invariant(props instanceof ObjectValue);\n      hardModifyReactObjectPropertyBinding(realm, props, name, value);\n    }\n  };\n\n  const applyProperties = () => {\n    if (config instanceof ObjectValue) {\n      for (let [propKey, binding] of config.properties) {\n        if (binding && binding.descriptor) {\n          invariant(binding.descriptor instanceof PropertyDescriptor);\n          if (binding.descriptor.enumerable) {\n            setProp(propKey, Get(realm, config, propKey));\n          }\n        }\n      }\n    }\n  };\n\n  if (\n    (config instanceof AbstractObjectValue && config.isPartialObject()) ||\n    (config instanceof ObjectValue && config.isPartialObject() && config.isSimpleObject())\n  ) {\n    // create a new props object that will be the target of the Object.assign\n    props = Create.ObjectCreate(realm, realm.intrinsics.ObjectPrototype);\n    realm.react.reactProps.add(props);\n\n    applyObjectAssignConfigsForReactElement(realm, props, [config]);\n    props.makeFinal();\n\n    if (children !== undefined) {\n      hardModifyReactObjectPropertyBinding(realm, props, \"children\", children);\n    }\n    // handle default props on a partial/abstract config\n    if (defaultProps !== realm.intrinsics.undefined) {\n      let defaultPropsEvaluated = 0;\n\n      // first see if we can apply all the defaultProps without needing the helper\n      if (defaultProps instanceof ObjectValue && !defaultProps.isPartialObject()) {\n        for (let [propName, binding] of defaultProps.properties) {\n          if (binding.descriptor !== undefined) {\n            invariant(binding.descriptor instanceof PropertyDescriptor);\n            if (binding.descriptor.value !== realm.intrinsics.undefined) {\n              // see if we have this on our props object\n              let propBinding = props.properties.get(propName);\n              // if the binding exists and value is abstract, it might be undefined\n              // so in that case we need the helper, otherwise we can continue\n              if (\n                propBinding !== undefined &&\n                !(\n                  propBinding.descriptor instanceof PropertyDescriptor &&\n                  propBinding.descriptor.value instanceof AbstractValue\n                )\n              ) {\n                defaultPropsEvaluated++;\n                // if the value we have is undefined, we can apply the defaultProp\n                if (propBinding.descriptor) {\n                  invariant(propBinding.descriptor instanceof PropertyDescriptor);\n                  if (propBinding.descriptor.value === realm.intrinsics.undefined)\n                    hardModifyReactObjectPropertyBinding(realm, props, propName, Get(realm, defaultProps, propName));\n                }\n              }\n            }\n          }\n        }\n      }\n      // if defaultPropsEvaluated === the amount of properties defaultProps has, then we've successfully\n      // ensured all the defaultProps have already been dealt with, so we don't need the helper\n      if (\n        !(defaultProps instanceof ObjectValue) ||\n        (defaultProps.isPartialObject() || defaultPropsEvaluated !== defaultProps.properties.size)\n      ) {\n        props.makePartial();\n        props.makeSimple();\n        // if the props has any properties that are \"undefined\", we need to make them abstract\n        // as the helper function applies defaultProps on values that are undefined or do not\n        // exist\n        for (let [propName, binding] of props.properties) {\n          if (binding.descriptor !== undefined) {\n            invariant(binding.descriptor instanceof PropertyDescriptor);\n            if (binding.descriptor.value === realm.intrinsics.undefined) {\n              invariant(defaultProps instanceof AbstractObjectValue || defaultProps instanceof ObjectValue);\n              hardModifyReactObjectPropertyBinding(realm, props, propName, Get(realm, defaultProps, propName));\n            }\n          }\n        }\n        // if we have children and they are abstract, they might be undefined at runtime\n        if (children !== undefined && children instanceof AbstractValue) {\n          // children === undefined ? defaultProps.children : children;\n          let condition = AbstractValue.createFromBinaryOp(realm, \"===\", children, realm.intrinsics.undefined);\n          invariant(defaultProps instanceof AbstractObjectValue || defaultProps instanceof ObjectValue);\n          let conditionalChildren = AbstractValue.createFromConditionalOp(\n            realm,\n            condition,\n            Get(realm, defaultProps, \"children\"),\n            children\n          );\n          hardModifyReactObjectPropertyBinding(realm, props, \"children\", conditionalChildren);\n        }\n        let defaultPropsHelper = realm.react.defaultPropsHelper;\n        invariant(defaultPropsHelper !== undefined);\n        let snapshot = props.getSnapshot();\n        props.temporalAlias = snapshot;\n        let temporalArgs = [defaultPropsHelper, snapshot, defaultProps];\n        let temporalTo = AbstractValue.createTemporalFromBuildFunction(\n          realm,\n          ObjectValue,\n          temporalArgs,\n          createOperationDescriptor(\"REACT_DEFAULT_PROPS_HELPER\"),\n          { skipInvariant: true, mutatesOnly: [snapshot] }\n        );\n        invariant(temporalTo instanceof AbstractObjectValue);\n        if (props instanceof AbstractObjectValue) {\n          temporalTo.values = props.values;\n        } else {\n          invariant(props instanceof ObjectValue);\n          temporalTo.values = new ValuesDomain(props);\n        }\n        props.temporalAlias = temporalTo;\n      }\n    }\n  } else {\n    applyProperties();\n\n    if (children !== undefined) {\n      setProp(\"children\", children);\n    }\n    if (defaultProps instanceof AbstractObjectValue || defaultProps.isPartialObject()) {\n      invariant(false, \"TODO: we need to eventually support this\");\n    } else if (defaultProps instanceof ObjectValue) {\n      for (let [propKey, binding] of defaultProps.properties) {\n        if (binding && binding.descriptor) {\n          invariant(binding.descriptor instanceof PropertyDescriptor);\n          if (binding.descriptor.enumerable && Get(realm, props, propKey) === realm.intrinsics.undefined) {\n            setProp(propKey, Get(realm, defaultProps, propKey));\n          }\n        }\n      }\n    }\n  }\n  invariant(props instanceof ObjectValue);\n  // We know the props has no keys because if it did it would have thrown above\n  // so we can remove them the props we create.\n  flagPropsWithNoPartialKeyOrRef(realm, props);\n  return { key, props, ref };\n}\n\nfunction splitReactElementsByConditionalType(\n  realm: Realm,\n  condValue: AbstractValue,\n  consequentVal: Value,\n  alternateVal: Value,\n  config: ObjectValue | AbstractObjectValue,\n  children: void | Value\n): Value {\n  return realm.evaluateWithAbstractConditional(\n    condValue,\n    () => {\n      return realm.evaluateForEffects(\n        () => createReactElement(realm, consequentVal, config, children),\n        null,\n        \"splitReactElementsByConditionalType consequent\"\n      );\n    },\n    () => {\n      return realm.evaluateForEffects(\n        () => createReactElement(realm, alternateVal, config, children),\n        null,\n        \"splitReactElementsByConditionalType alternate\"\n      );\n    }\n  );\n}\n\nfunction splitReactElementsByConditionalConfig(\n  realm: Realm,\n  condValue: AbstractValue,\n  consequentVal: ObjectValue | AbstractObjectValue,\n  alternateVal: ObjectValue | AbstractObjectValue,\n  type: Value,\n  children: void | Value\n): Value {\n  return realm.evaluateWithAbstractConditional(\n    condValue,\n    () => {\n      return realm.evaluateForEffects(\n        () => createReactElement(realm, type, consequentVal, children),\n        null,\n        \"splitReactElementsByConditionalConfig consequent\"\n      );\n    },\n    () => {\n      return realm.evaluateForEffects(\n        () => createReactElement(realm, type, alternateVal, children),\n        null,\n        \"splitReactElementsByConditionalConfig alternate\"\n      );\n    }\n  );\n}\n\nexport function cloneReactElement(\n  realm: Realm,\n  reactElement: ObjectValue,\n  config: ObjectValue | AbstractObjectValue | NullValue,\n  children: void | Value\n): ObjectValue {\n  let props = Create.ObjectCreate(realm, realm.intrinsics.ObjectPrototype);\n  realm.react.reactProps.add(props);\n\n  const setProp = (name: string, value: Value): void => {\n    if (name !== \"__self\" && name !== \"__source\" && name !== \"key\" && name !== \"ref\") {\n      invariant(props instanceof ObjectValue);\n      hardModifyReactObjectPropertyBinding(realm, props, name, value);\n    }\n  };\n\n  let elementProps = getProperty(realm, reactElement, \"props\");\n  applyObjectAssignConfigsForReactElement(realm, props, [elementProps, config]);\n  props.makeFinal();\n\n  let key = getProperty(realm, reactElement, \"key\");\n  let ref = getProperty(realm, reactElement, \"ref\");\n  let type = getProperty(realm, reactElement, \"type\");\n\n  if (!(config instanceof NullValue)) {\n    let possibleKey = Get(realm, config, \"key\");\n    if (possibleKey !== realm.intrinsics.null && possibleKey !== realm.intrinsics.undefined) {\n      // if the config has been marked as having no partial key or ref and the possible key\n      // is abstract, yet the config doesn't have a key property, then the key can remain null\n      let keyNotNeeded =\n        hasNoPartialKeyOrRef(realm, config) &&\n        possibleKey instanceof AbstractValue &&\n        config instanceof ObjectValue &&\n        !config.properties.has(\"key\");\n\n      if (!keyNotNeeded) {\n        key = computeBinary(realm, \"+\", realm.intrinsics.emptyString, possibleKey);\n      }\n    }\n\n    let possibleRef = Get(realm, config, \"ref\");\n    if (possibleRef !== realm.intrinsics.null && possibleRef !== realm.intrinsics.undefined) {\n      // if the config has been marked as having no partial key or ref and the possible ref\n      // is abstract, yet the config doesn't have a ref property, then the ref can remain null\n      let refNotNeeded =\n        hasNoPartialKeyOrRef(realm, config) &&\n        possibleRef instanceof AbstractValue &&\n        config instanceof ObjectValue &&\n        !config.properties.has(\"ref\");\n\n      if (!refNotNeeded) {\n        ref = possibleRef;\n      }\n    }\n    let defaultProps =\n      type instanceof ObjectValue || type instanceof AbstractObjectValue\n        ? Get(realm, type, \"defaultProps\")\n        : realm.intrinsics.undefined;\n\n    if (defaultProps instanceof ObjectValue) {\n      for (let [propKey, binding] of defaultProps.properties) {\n        if (binding && binding.descriptor) {\n          invariant(binding.descriptor instanceof PropertyDescriptor);\n          if (binding.descriptor.enumerable && Get(realm, props, propKey) === realm.intrinsics.undefined) {\n            setProp(propKey, Get(realm, defaultProps, propKey));\n          }\n        }\n      }\n    } else if (defaultProps instanceof AbstractObjectValue) {\n      invariant(false, \"TODO: we need to eventually support this\");\n    }\n  }\n\n  if (children !== undefined) {\n    hardModifyReactObjectPropertyBinding(realm, props, \"children\", children);\n  } else {\n    invariant(elementProps instanceof ObjectValue);\n    let elementChildren = getProperty(realm, elementProps, \"children\");\n    hardModifyReactObjectPropertyBinding(realm, props, \"children\", elementChildren);\n  }\n\n  return createInternalReactElement(realm, type, key, ref, props);\n}\n\nexport function createReactElement(\n  realm: Realm,\n  type: Value,\n  config: ObjectValue | AbstractObjectValue,\n  children: void | Value\n): Value {\n  if (type instanceof AbstractValue && type.kind === \"conditional\") {\n    let [condValue, consequentVal, alternateVal] = type.args;\n    invariant(condValue instanceof AbstractValue);\n    return splitReactElementsByConditionalType(realm, condValue, consequentVal, alternateVal, config, children);\n  } else if (config instanceof AbstractObjectValue && config.kind === \"conditional\") {\n    let [condValue, consequentVal, alternateVal] = config.args;\n    invariant(condValue instanceof AbstractValue);\n    invariant(consequentVal instanceof ObjectValue || consequentVal instanceof AbstractObjectValue);\n    invariant(alternateVal instanceof ObjectValue || alternateVal instanceof AbstractObjectValue);\n    return splitReactElementsByConditionalConfig(realm, condValue, consequentVal, alternateVal, type, children);\n  }\n  let { key, props, ref } = createPropsObject(realm, type, config, children);\n  return createInternalReactElement(realm, type, key, ref, props);\n}\n\n// Wraps a React element in a `<React.Fragment key={keyValue}>` so that we can\n// add a key without mutating or cloning the element.\nexport function wrapReactElementWithKeyedFragment(realm: Realm, keyValue: Value, reactElement: Value): Value {\n  const react = realm.fbLibraries.react;\n  invariant(react instanceof ObjectValue);\n  const reactFragment = getProperty(realm, react, \"Fragment\");\n  const fragmentConfigValue = Create.ObjectCreate(realm, realm.intrinsics.ObjectPrototype);\n  Create.CreateDataPropertyOrThrow(realm, fragmentConfigValue, \"key\", keyValue);\n  let fragmentChildrenValue = Create.ArrayCreate(realm, 1);\n  Create.CreateDataPropertyOrThrow(realm, fragmentChildrenValue, \"0\", reactElement);\n  fragmentChildrenValue = flattenChildren(realm, fragmentChildrenValue, true);\n  return createReactElement(realm, reactFragment, fragmentConfigValue, fragmentChildrenValue);\n}\n\ntype ElementTraversalVisitor = {\n  visitType: (typeValue: Value) => void,\n  visitKey: (keyValue: Value) => void,\n  visitRef: (keyValue: Value) => void,\n  visitAbstractOrPartialProps: (propsValue: AbstractValue | ObjectValue) => void,\n  visitConcreteProps: (propsValue: ObjectValue) => void,\n  visitChildNode: (childValue: Value) => void,\n};\n\nexport function traverseReactElement(\n  realm: Realm,\n  reactElement: ObjectValue,\n  traversalVisitor: ElementTraversalVisitor\n): void {\n  let typeValue = getProperty(realm, reactElement, \"type\");\n  traversalVisitor.visitType(typeValue);\n\n  let keyValue = getProperty(realm, reactElement, \"key\");\n  if (keyValue !== realm.intrinsics.null && keyValue !== realm.intrinsics.undefined) {\n    traversalVisitor.visitKey(keyValue);\n  }\n\n  let refValue = getProperty(realm, reactElement, \"ref\");\n  if (refValue !== realm.intrinsics.null && refValue !== realm.intrinsics.undefined) {\n    traversalVisitor.visitRef(refValue);\n  }\n\n  const loopArrayElements = (childrenValue: ArrayValue, length: number): void => {\n    for (let i = 0; i < length; i++) {\n      let child = getProperty(realm, childrenValue, \"\" + i);\n      traversalVisitor.visitChildNode(child);\n    }\n  };\n\n  const handleChildren = () => {\n    // handle children\n    invariant(propsValue instanceof ObjectValue);\n    if (propsValue.properties.has(\"children\")) {\n      let childrenValue = getProperty(realm, propsValue, \"children\");\n      if (childrenValue !== realm.intrinsics.undefined && childrenValue !== realm.intrinsics.null) {\n        if (childrenValue instanceof ArrayValue && !childrenValue.intrinsicName) {\n          let childrenLength = getProperty(realm, childrenValue, \"length\");\n          if (childrenLength instanceof NumberValue) {\n            loopArrayElements(childrenValue, childrenLength.value);\n          } else if (childrenLength instanceof AbstractValue && childrenLength.kind === \"conditional\") {\n            loopArrayElements(childrenValue, getMaxLength(childrenLength, 0));\n          } else {\n            invariant(false, \"TODO: support other types of array length value\");\n          }\n        } else {\n          traversalVisitor.visitChildNode(childrenValue);\n        }\n      }\n    }\n  };\n\n  let propsValue = getProperty(realm, reactElement, \"props\");\n  if (propsValue instanceof AbstractValue) {\n    // visit object, as it's going to be spread\n    traversalVisitor.visitAbstractOrPartialProps(propsValue);\n  } else if (propsValue instanceof ObjectValue) {\n    if (propsValue.isPartialObject()) {\n      traversalVisitor.visitAbstractOrPartialProps(propsValue);\n      handleChildren();\n    } else {\n      traversalVisitor.visitConcreteProps(propsValue);\n      handleChildren();\n    }\n  }\n}\n"
  },
  {
    "path": "src/react/errors.js",
    "content": "/**\n * Copyright (c) 2017-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n/* @flow strict-local */\n\nimport { type ReactEvaluatedNode } from \"../serializer/types.js\";\nimport { FatalError } from \"../errors.js\";\n\n// ExpectedBailOut is like an error, that gets thrown during the reconcilation phase\n// allowing the reconcilation to continue on other branches of the tree, the message\n// given to ExpectedBailOut will be assigned to the value.$BailOutReason property and serialized\n// as a comment in the output source to give the user hints as to what they need to do\n// to fix the bail-out case\nexport class ExpectedBailOut extends Error {}\n\n// SimpleClassBailOuts only occur when a simple class instance is created and used\n// bailing out here will result in a complex class instance being created after\n// and an alternative complex class component route being used\nexport class SimpleClassBailOut extends Error {}\n\n// When the reconciler detectes a side-effect in pure evaluation, it throws one\n// of these errors. This will fall straight through the the wrapping React\n// component render try/catch, which will then throw an appropiate\n// ReconcilerFatalError along with information on the React component stack\nexport class UnsupportedSideEffect extends Error {}\n\n// NewComponentTreeBranch only occur when a complex class is found in a\n// component tree and the reconciler can no longer fold the component of that branch\nexport class NewComponentTreeBranch extends Error {\n  constructor(evaluatedNode: ReactEvaluatedNode) {\n    super();\n    this.evaluatedNode = evaluatedNode;\n  }\n  evaluatedNode: ReactEvaluatedNode;\n}\n\nexport class DoNotOptimize extends Error {}\n\n// Used when an entire React component tree has failed to optimize\n// this means there is a programming bug in the application that is\n// being Prepacked\nexport class ReconcilerFatalError extends FatalError {\n  constructor(message: string, evaluatedNode: ReactEvaluatedNode) {\n    super(message);\n    evaluatedNode.status = \"FATAL\";\n    evaluatedNode.message = message;\n    this.evaluatedNode = evaluatedNode;\n    // used for assertions in tests\n    this.__isReconcilerFatalError = true;\n  }\n  evaluatedNode: ReactEvaluatedNode;\n  __isReconcilerFatalError: boolean;\n}\n"
  },
  {
    "path": "src/react/experimental-server-rendering/dom-config.js",
    "content": "/**\n * Copyright (c) 2017-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n/* @flow */\n\n// Warning: This code is experimental and might not fully work. There is no guarantee\n// that it is up-to-date with the current react-dom/server logic and there may also be\n// security holes in the string escaping because of this.\n\nimport type { Realm } from \"../../realm.js\";\nimport {\n  AbstractValue,\n  BooleanValue,\n  FunctionValue,\n  NumberValue,\n  StringValue,\n  SymbolValue,\n  Value,\n} from \"../../values/index.js\";\nimport invariant from \"../../invariant.js\";\n\ntype PropertyType = 0 | 1 | 2 | 3 | 4 | 5 | 6;\ntype PropertyInfo = {|\n  +acceptsBooleans: boolean,\n  +attributeName: string,\n  +attributeNamespace: string | null,\n  +mustUseProperty: boolean,\n  +propertyName: string,\n  +type: PropertyType,\n|};\n\nexport const STYLE = \"style\";\nexport const RESERVED_PROPS: Set<string> = new Set([\n  \"children\",\n  \"dangerouslySetInnerHTML\",\n  \"suppressContentEditableWarning\",\n  \"suppressHydrationWarning\",\n]);\nexport const omittedCloseTags: Set<string> = new Set([\n  \"area\",\n  \"base\",\n  \"br\",\n  \"col\",\n  \"embed\",\n  \"hr\",\n  \"img\",\n  \"input\",\n  \"keygen\",\n  \"link\",\n  \"meta\",\n  \"param\",\n  \"source\",\n  \"track\",\n  \"wbr\",\n]);\nexport const newlineEatingTags = {\n  listing: true,\n  pre: true,\n  textarea: true,\n};\nexport const isUnitlessNumber = {\n  animationIterationCount: true,\n  borderImageOutset: true,\n  borderImageSlice: true,\n  borderImageWidth: true,\n  boxFlex: true,\n  boxFlexGroup: true,\n  boxOrdinalGroup: true,\n  columnCount: true,\n  columns: true,\n  flex: true,\n  flexGrow: true,\n  flexPositive: true,\n  flexShrink: true,\n  flexNegative: true,\n  flexOrder: true,\n  gridRow: true,\n  gridRowEnd: true,\n  gridRowSpan: true,\n  gridRowStart: true,\n  gridColumn: true,\n  gridColumnEnd: true,\n  gridColumnSpan: true,\n  gridColumnStart: true,\n  fontWeight: true,\n  lineClamp: true,\n  lineHeight: true,\n  opacity: true,\n  order: true,\n  orphans: true,\n  tabSize: true,\n  widows: true,\n  zIndex: true,\n  zoom: true,\n\n  // SVG-related properties\n  fillOpacity: true,\n  floodOpacity: true,\n  stopOpacity: true,\n  strokeDasharray: true,\n  strokeDashoffset: true,\n  strokeMiterlimit: true,\n  strokeOpacity: true,\n  strokeWidth: true,\n};\nconst prefixes = [\"Webkit\", \"ms\", \"Moz\", \"O\"];\nexport const ROOT_ATTRIBUTE_NAME = \"data-reactroot\";\n/* eslint-disable max-len */\nexport const ATTRIBUTE_NAME_START_CHAR =\n  \":A-Z_a-z\\\\u00C0-\\\\u00D6\\\\u00D8-\\\\u00F6\\\\u00F8-\\\\u02FF\\\\u0370-\\\\u037D\\\\u037F-\\\\u1FFF\\\\u200C-\\\\u200D\\\\u2070-\\\\u218F\\\\u2C00-\\\\u2FEF\\\\u3001-\\\\uD7FF\\\\uF900-\\\\uFDCF\\\\uFDF0-\\\\uFFFD\";\nexport const ATTRIBUTE_NAME_CHAR = ATTRIBUTE_NAME_START_CHAR + \"\\\\-.0-9\\\\u00B7\\\\u0300-\\\\u036F\\\\u203F-\\\\u2040\";\nexport const VALID_ATTRIBUTE_NAME_REGEX = new RegExp(\n  \"^[\" + ATTRIBUTE_NAME_START_CHAR + \"][\" + ATTRIBUTE_NAME_CHAR + \"]*$\"\n);\n\nfunction prefixKey(prefix, key) {\n  return prefix + key.charAt(0).toUpperCase() + key.substring(1);\n}\n\nObject.keys(isUnitlessNumber).forEach(function(prop) {\n  prefixes.forEach(function(prefix) {\n    isUnitlessNumber[prefixKey(prefix, prop)] = isUnitlessNumber[prop];\n  });\n});\n\nexport const RESERVED = 0;\nexport const STRING = 1;\nexport const BOOLEANISH_STRING = 2;\nexport const BOOLEAN = 3;\nexport const OVERLOADED_BOOLEAN = 4;\nexport const NUMERIC = 5;\nexport const POSITIVE_NUMERIC = 6;\n\nconst properties = {};\n\nfunction PropertyInfoRecord(\n  name: string,\n  type: PropertyType,\n  mustUseProperty: boolean,\n  attributeName: string,\n  attributeNamespace: string | null\n) {\n  this.acceptsBooleans = type === BOOLEANISH_STRING || type === BOOLEAN || type === OVERLOADED_BOOLEAN;\n  this.attributeName = attributeName;\n  this.attributeNamespace = attributeNamespace;\n  this.mustUseProperty = mustUseProperty;\n  this.propertyName = name;\n  this.type = type;\n}\n\n[[\"acceptCharset\", \"accept-charset\"], [\"className\", \"class\"], [\"htmlFor\", \"for\"], [\"httpEquiv\", \"http-equiv\"]].forEach(\n  ([name, attributeName]) => {\n    properties[name] = new PropertyInfoRecord(name, STRING, false, attributeName, null);\n  }\n);\n\n[\n  \"children\",\n  \"dangerouslySetInnerHTML\",\n  \"defaultValue\",\n  \"defaultChecked\",\n  \"innerHTML\",\n  \"suppressContentEditableWarning\",\n  \"suppressHydrationWarning\",\n  \"style\",\n].forEach(name => {\n  properties[name] = new PropertyInfoRecord(name, RESERVED, false, name, null);\n});\n\n[\"contentEditable\", \"draggable\", \"spellCheck\", \"value\"].forEach(name => {\n  properties[name] = new PropertyInfoRecord(name, BOOLEANISH_STRING, false, name.toLowerCase(), null);\n});\n\n[\"autoReverse\", \"externalResourcesRequired\", \"preserveAlpha\"].forEach(name => {\n  properties[name] = new PropertyInfoRecord(name, BOOLEANISH_STRING, false, name, null);\n});\n\n[\n  \"allowFullScreen\",\n  \"async\",\n  \"autoFocus\",\n  \"autoPlay\",\n  \"controls\",\n  \"default\",\n  \"defer\",\n  \"disabled\",\n  \"formNoValidate\",\n  \"hidden\",\n  \"loop\",\n  \"noModule\",\n  \"noValidate\",\n  \"open\",\n  \"playsInline\",\n  \"readOnly\",\n  \"required\",\n  \"reversed\",\n  \"scoped\",\n  \"seamless\",\n  \"itemScope\",\n].forEach(name => {\n  properties[name] = new PropertyInfoRecord(name, BOOLEAN, false, name.toLowerCase(), null);\n});\n\n[\"checked\", \"multiple\", \"muted\", \"selected\"].forEach(name => {\n  properties[name] = new PropertyInfoRecord(name, BOOLEAN, true, name.toLowerCase(), null);\n});\n\n[\"capture\", \"download\"].forEach(name => {\n  properties[name] = new PropertyInfoRecord(name, OVERLOADED_BOOLEAN, false, name.toLowerCase(), null);\n});\n\n[\"cols\", \"rows\", \"size\", \"span\"].forEach(name => {\n  properties[name] = new PropertyInfoRecord(name, POSITIVE_NUMERIC, false, name.toLowerCase(), null);\n});\n\n[\"rowSpan\", \"start\"].forEach(name => {\n  properties[name] = new PropertyInfoRecord(name, NUMERIC, false, name.toLowerCase(), null);\n});\n\nconst CAMELIZE = /[\\-\\:]([a-z])/g;\nconst capitalize = token => token[1].toUpperCase();\n\n[\n  \"accent-height\",\n  \"alignment-baseline\",\n  \"arabic-form\",\n  \"baseline-shift\",\n  \"cap-height\",\n  \"clip-path\",\n  \"clip-rule\",\n  \"color-interpolation\",\n  \"color-interpolation-filters\",\n  \"color-profile\",\n  \"color-rendering\",\n  \"dominant-baseline\",\n  \"enable-background\",\n  \"fill-opacity\",\n  \"fill-rule\",\n  \"flood-color\",\n  \"flood-opacity\",\n  \"font-family\",\n  \"font-size\",\n  \"font-size-adjust\",\n  \"font-stretch\",\n  \"font-style\",\n  \"font-variant\",\n  \"font-weight\",\n  \"glyph-name\",\n  \"glyph-orientation-horizontal\",\n  \"glyph-orientation-vertical\",\n  \"horiz-adv-x\",\n  \"horiz-origin-x\",\n  \"image-rendering\",\n  \"letter-spacing\",\n  \"lighting-color\",\n  \"marker-end\",\n  \"marker-mid\",\n  \"marker-start\",\n  \"overline-position\",\n  \"overline-thickness\",\n  \"paint-order\",\n  \"panose-1\",\n  \"pointer-events\",\n  \"rendering-intent\",\n  \"shape-rendering\",\n  \"stop-color\",\n  \"stop-opacity\",\n  \"strikethrough-position\",\n  \"strikethrough-thickness\",\n  \"stroke-dasharray\",\n  \"stroke-dashoffset\",\n  \"stroke-linecap\",\n  \"stroke-linejoin\",\n  \"stroke-miterlimit\",\n  \"stroke-opacity\",\n  \"stroke-width\",\n  \"text-anchor\",\n  \"text-decoration\",\n  \"text-rendering\",\n  \"underline-position\",\n  \"underline-thickness\",\n  \"unicode-bidi\",\n  \"unicode-range\",\n  \"units-per-em\",\n  \"v-alphabetic\",\n  \"v-hanging\",\n  \"v-ideographic\",\n  \"v-mathematical\",\n  \"vector-effect\",\n  \"vert-adv-y\",\n  \"vert-origin-x\",\n  \"vert-origin-y\",\n  \"word-spacing\",\n  \"writing-mode\",\n  \"xmlns:xlink\",\n  \"x-height\",\n].forEach(attributeName => {\n  const name = attributeName.replace(CAMELIZE, capitalize);\n  properties[name] = new PropertyInfoRecord(name, STRING, false, attributeName, null);\n});\n\n[\"xlink:actuate\", \"xlink:arcrole\", \"xlink:href\", \"xlink:role\", \"xlink:show\", \"xlink:title\", \"xlink:type\"].forEach(\n  attributeName => {\n    const name = attributeName.replace(CAMELIZE, capitalize);\n    properties[name] = new PropertyInfoRecord(name, STRING, false, attributeName, \"http://www.w3.org/1999/xlink\");\n  }\n);\n\n[\"xml:base\", \"xml:lang\", \"xml:space\"].forEach(attributeName => {\n  const name = attributeName.replace(CAMELIZE, capitalize);\n  properties[name] = new PropertyInfoRecord(name, STRING, false, attributeName, \"http://www.w3.org/XML/1998/namespace\");\n});\n\nproperties.tabIndex = new PropertyInfoRecord(\"tabIndex\", STRING, false, \"tabindex\", null);\n\nexport function getPropertyInfo(name: string): PropertyInfo | null {\n  return properties.hasOwnProperty(name) ? properties[name] : null;\n}\n\nconst illegalAttributeNameCache = {};\nconst validatedAttributeNameCache = {};\n\nexport function isAttributeNameSafe(attributeName: string): boolean {\n  if (validatedAttributeNameCache.hasOwnProperty(attributeName)) {\n    return true;\n  }\n  if (illegalAttributeNameCache.hasOwnProperty(attributeName)) {\n    return false;\n  }\n  if (VALID_ATTRIBUTE_NAME_REGEX.test(attributeName)) {\n    validatedAttributeNameCache[attributeName] = true;\n    return true;\n  }\n  illegalAttributeNameCache[attributeName] = true;\n  return false;\n}\n\nfunction shouldRemoveAttributeWithWarning(\n  name: string,\n  value: Value,\n  propertyInfo: PropertyInfo | null,\n  isCustomComponentTag: boolean\n): boolean {\n  if (propertyInfo !== null && propertyInfo.type === RESERVED) {\n    return false;\n  }\n  if (value instanceof FunctionValue || value instanceof SymbolValue) {\n    return true;\n  } else if (value instanceof BooleanValue) {\n    if (isCustomComponentTag) {\n      return false;\n    }\n    if (propertyInfo !== null) {\n      return !propertyInfo.acceptsBooleans;\n    } else {\n      const prefix = name.toLowerCase().slice(0, 5);\n      return prefix !== \"data-\" && prefix !== \"aria-\";\n    }\n  } else if (value instanceof AbstractValue) {\n    invariant(false, \"TODO\");\n  }\n  return false;\n}\n\nexport function shouldRemoveAttribute(\n  realm: Realm,\n  name: string,\n  value: Value,\n  propertyInfo: PropertyInfo | null,\n  isCustomComponentTag: boolean\n): boolean {\n  if (value === realm.intrinsics.null || value === realm.intrinsics.undefined) {\n    return true;\n  }\n  if (shouldRemoveAttributeWithWarning(name, value, propertyInfo, isCustomComponentTag)) {\n    return true;\n  }\n  if (isCustomComponentTag) {\n    return false;\n  }\n  if (propertyInfo !== null) {\n    switch (propertyInfo.type) {\n      case BOOLEAN:\n        if (value instanceof BooleanValue) {\n          return !value.value;\n        }\n        return invariant(false, \"TODO\");\n      case OVERLOADED_BOOLEAN:\n        if (value instanceof BooleanValue) {\n          return value.value === false;\n        }\n        return invariant(false, \"TODO\");\n      case NUMERIC:\n        if (value instanceof NumberValue || value instanceof StringValue) {\n          return isNaN(value.value);\n        }\n        return invariant(false, \"TODO\");\n      case POSITIVE_NUMERIC:\n        if (value instanceof NumberValue || value instanceof StringValue) {\n          return isNaN(value.value) || (value.value: any) < 1;\n        }\n        return invariant(false, \"TODO\");\n      default:\n        return false;\n    }\n  }\n  return false;\n}\n\nexport function shouldIgnoreAttribute(\n  name: string,\n  propertyInfo: PropertyInfo | null,\n  isCustomComponentTag: boolean\n): boolean {\n  if (propertyInfo !== null) {\n    return propertyInfo.type === RESERVED;\n  }\n  if (isCustomComponentTag) {\n    return false;\n  }\n  if (name.length > 2 && (name[0] === \"o\" || name[0] === \"O\") && (name[1] === \"n\" || name[1] === \"N\")) {\n    return true;\n  }\n  return false;\n}\n"
  },
  {
    "path": "src/react/experimental-server-rendering/rendering.js",
    "content": "/**\n * Copyright (c) 2017-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n/* @flow */\n\n// Warning: This code is experimental and might not fully work. There is no guarantee\n// that it is up-to-date with the current react-dom/server logic and there may also be\n// security holes in the string escaping because of this.\n\nimport type { Realm } from \"../../realm.js\";\nimport { ReactStatistics } from \"../../serializer/types.js\";\nimport { SimpleNormalCompletion } from \"../../completions.js\";\nimport {\n  AbstractObjectValue,\n  AbstractValue,\n  ArrayValue,\n  BooleanValue,\n  ECMAScriptSourceFunctionValue,\n  NullValue,\n  NumberValue,\n  ObjectValue,\n  StringValue,\n  SymbolValue,\n  Value,\n  UndefinedValue,\n} from \"../../values/index.js\";\nimport { Reconciler } from \"../reconcilation.js\";\nimport {\n  applyObjectAssignConfigsForReactElement,\n  createReactEvaluatedNode,\n  forEachArrayValue,\n  getComponentName,\n  getProperty,\n  getReactSymbol,\n  isReactElement,\n} from \"../utils.js\";\nimport * as t from \"@babel/types\";\nimport invariant from \"../../invariant.js\";\nimport {\n  convertValueToNode,\n  createArrayHelper,\n  createHtmlEscapeHelper,\n  createMarkupForRoot,\n  escapeHtml,\n  getNonChildrenInnerMarkup,\n  quoteAttributeValueForBrowser,\n  isCustomComponent,\n  normalizeNode,\n} from \"./utils.js\";\nimport {\n  BOOLEAN,\n  getPropertyInfo,\n  isAttributeNameSafe,\n  isUnitlessNumber,\n  newlineEatingTags,\n  omittedCloseTags,\n  OVERLOADED_BOOLEAN,\n  RESERVED_PROPS,\n  shouldIgnoreAttribute,\n  shouldRemoveAttribute,\n  STYLE,\n} from \"./dom-config.js\";\n// $FlowFixMe: flow complains that this isn't a module but it is, and it seems to load fine\nimport hyphenateStyleName from \"fbjs/lib/hyphenateStyleName\";\nimport { Properties, To } from \"../../singletons.js\";\nimport { createOperationDescriptor } from \"../../utils/generator.js\";\n\nexport type ReactNode = Array<ReactNode> | string | AbstractValue | ArrayValue;\n\nfunction renderValueWithHelper(realm: Realm, value: Value, helper: ECMAScriptSourceFunctionValue): AbstractValue {\n  // given we know nothing of this value, we need to escape the contents of it at runtime\n  let val = AbstractValue.createFromBuildFunction(\n    realm,\n    Value,\n    [helper, value],\n    createOperationDescriptor(\"REACT_SSR_RENDER_VALUE_HELPER\")\n  );\n  invariant(val instanceof AbstractValue);\n  return val;\n}\n\nfunction dangerousStyleValue(realm: Realm, name: string, value: Value, isCustomProperty: boolean): string {\n  let isEmpty =\n    value === realm.intrinsics.null ||\n    value === realm.intrinsics.undefined ||\n    value instanceof BooleanValue ||\n    (value instanceof StringValue && value.value === \"\");\n  if (isEmpty) {\n    return \"\";\n  }\n\n  if (\n    !isCustomProperty &&\n    value instanceof NumberValue &&\n    value.value !== 0 &&\n    !(isUnitlessNumber.hasOwnProperty(name) && isUnitlessNumber[name])\n  ) {\n    return value.value + \"px\";\n  }\n\n  if (value instanceof StringValue || value instanceof NumberValue) {\n    return (\"\" + value.value).trim();\n  } else {\n    invariant(false, \"TODO\");\n  }\n}\n\nexport function createMarkupForCustomAttribute(realm: Realm, name: string, value: Value): ReactNode {\n  if (!isAttributeNameSafe(name) || value == null) {\n    return \"\";\n  }\n  if (value instanceof StringValue || value instanceof NumberValue) {\n    return name + \"=\" + quoteAttributeValueForBrowser(value.value + \"\");\n  } else {\n    invariant(false, \"TODO\");\n  }\n}\n\nfunction createMarkupForProperty(\n  realm: Realm,\n  name: string,\n  value: Value,\n  htmlEscapeHelper: ECMAScriptSourceFunctionValue\n): ReactNode {\n  const propertyInfo = getPropertyInfo(name);\n  if (name !== \"style\" && shouldIgnoreAttribute(name, propertyInfo, false)) {\n    return \"\";\n  }\n  if (shouldRemoveAttribute(realm, name, value, propertyInfo, false)) {\n    return \"\";\n  }\n  if (propertyInfo !== null) {\n    const attributeName = propertyInfo.attributeName;\n    const { type } = propertyInfo;\n    if (type === BOOLEAN || (type === OVERLOADED_BOOLEAN && value === true)) {\n      return attributeName + '=\"\"';\n    } else if (value instanceof StringValue || value instanceof NumberValue || value instanceof BooleanValue) {\n      // $FlowFixMe: Flow complains about booleans being converted to strings, which is the intention\n      return attributeName + \"=\" + quoteAttributeValueForBrowser(value.value + \"\");\n    } else if (value instanceof AbstractValue) {\n      return ([attributeName + \"=\", renderValueWithHelper(realm, value, htmlEscapeHelper)]: Array<ReactNode>);\n    }\n  } else if (value instanceof StringValue || value instanceof NumberValue || value instanceof BooleanValue) {\n    // $FlowFixMe: Flow complains about booleans being converted to strings, which is the intention\n    return name + \"=\" + quoteAttributeValueForBrowser(value.value + \"\");\n  } else if (value instanceof AbstractValue) {\n    return ([name + '=\"', renderValueWithHelper(realm, value, htmlEscapeHelper), '\"']: Array<ReactNode>);\n  }\n  invariant(false, \"TODO\");\n}\n\nfunction createMarkupForStyles(realm: Realm, styles: Value): Value {\n  let serialized = ([]: Array<ReactNode>);\n  let delimiter = \"\";\n\n  if (styles instanceof ObjectValue && !styles.isPartialObject()) {\n    for (let [styleName, binding] of styles.properties) {\n      if (binding.descriptor !== undefined) {\n        let isCustomProperty = styleName.indexOf(\"--\") === 0;\n        let styleValue = getProperty(realm, styles, styleName);\n\n        if (styleValue !== realm.intrinsics.null && styleValue !== realm.intrinsics.undefined) {\n          serialized.push(delimiter + hyphenateStyleName(styleName) + \":\");\n          serialized.push(dangerousStyleValue(realm, styleName, styleValue, isCustomProperty));\n          delimiter = \";\";\n        }\n      }\n    }\n  }\n  if (serialized.length > 0) {\n    return renderReactNode(realm, serialized);\n  }\n  return realm.intrinsics.null;\n}\n\nfunction createOpenTagMarkup(\n  realm: Realm,\n  tagVerbatim: string,\n  tagLowercase: string,\n  propsValue: ObjectValue | AbstractObjectValue,\n  namespace: string,\n  makeStaticMarkup: boolean,\n  isRootElement: boolean,\n  htmlEscapeHelper: ECMAScriptSourceFunctionValue\n): Array<ReactNode> {\n  let ret = [\"<\" + tagVerbatim];\n\n  if (propsValue instanceof ObjectValue && !propsValue.isPartialObject()) {\n    for (let [propName, binding] of propsValue.properties) {\n      if (binding.descriptor !== undefined) {\n        let propValue = getProperty(realm, propsValue, propName);\n        if (propValue === realm.intrinsics.null || propValue === realm.intrinsics.undefined) {\n          continue;\n        }\n        if (propName === STYLE) {\n          propValue = createMarkupForStyles(realm, propValue);\n        }\n        let markup;\n\n        if (isCustomComponent(realm, tagLowercase, propsValue)) {\n          if (!RESERVED_PROPS.has(propName)) {\n            markup = createMarkupForCustomAttribute(realm, propName, propValue);\n          }\n        } else {\n          markup = createMarkupForProperty(realm, propName, propValue, htmlEscapeHelper);\n        }\n        if (Array.isArray(markup)) {\n          ret.push(\" \", ...markup);\n        } else if (typeof markup === \"string\" && markup !== \"\") {\n          ret.push(\" \" + markup);\n        } else if (markup) {\n          ret.push(\" \", markup);\n        }\n      }\n    }\n  } else {\n    invariant(false, \"TODO\");\n  }\n\n  // For static pages, no need to put React ID and checksum. Saves lots of\n  // bytes.\n  if (makeStaticMarkup) {\n    return ret;\n  }\n\n  if (isRootElement) {\n    ret.push(\" \" + createMarkupForRoot());\n  }\n  return ret;\n}\n\nfunction renderReactNode(realm: Realm, reactNode: ReactNode): StringValue | AbstractValue {\n  let normalizedNode = normalizeNode(realm, reactNode);\n  if (typeof normalizedNode === \"string\") {\n    return new StringValue(realm, normalizedNode);\n  } else if (normalizedNode instanceof AbstractValue) {\n    return normalizedNode;\n  }\n  invariant(Array.isArray(normalizedNode));\n  let args = [];\n  let quasis = [];\n  let lastWasAbstract = false;\n  for (let element of normalizedNode) {\n    if (typeof element === \"string\") {\n      lastWasAbstract = false;\n      quasis.push(t.templateElement({ raw: element, cooked: element }));\n    } else {\n      if (lastWasAbstract) {\n        quasis.push(t.templateElement({ raw: \"\", cooked: \"\" }));\n      }\n      lastWasAbstract = true;\n      invariant(element instanceof Value);\n      args.push(element);\n    }\n  }\n  let val = AbstractValue.createFromBuildFunction(\n    realm,\n    StringValue,\n    args,\n    createOperationDescriptor(\"REACT_SSR_TEMPLATE_LITERAL\", { quasis })\n  );\n  invariant(val instanceof AbstractValue);\n  return val;\n}\n\nclass ReactDOMServerRenderer {\n  constructor(realm: Realm, makeStaticMarkup: boolean) {\n    this.realm = realm;\n    this.makeStaticMarkup = makeStaticMarkup;\n    this.previousWasTextNode = false;\n    this.htmlEscapeHelper = createHtmlEscapeHelper(realm);\n    this.arrayHelper = createArrayHelper(realm);\n  }\n  realm: Realm;\n  makeStaticMarkup: boolean;\n  previousWasTextNode: boolean;\n  htmlEscapeHelper: ECMAScriptSourceFunctionValue;\n  arrayHelper: ECMAScriptSourceFunctionValue;\n\n  render(value: Value, namespace: string = \"html\", depth: number = 0): StringValue | AbstractValue {\n    let rootReactNode = this._renderValue(value, namespace, depth);\n    return renderReactNode(this.realm, rootReactNode);\n  }\n\n  _renderText(value: StringValue | NumberValue): string {\n    let text = value.value + \"\";\n\n    if (text === \"\") {\n      return \"\";\n    }\n    if (this.makeStaticMarkup) {\n      return escapeHtml(text);\n    }\n    if (this.previousWasTextNode) {\n      return \"<!-- -->\" + escapeHtml(text);\n    }\n    this.previousWasTextNode = true;\n    return escapeHtml(text);\n  }\n\n  _renderAbstractConditionalValue(\n    condValue: AbstractValue,\n    consequentVal: Value,\n    alternateVal: Value,\n    namespace: string,\n    depth: number\n  ): ReactNode {\n    let val = this.realm.evaluateWithAbstractConditional(\n      condValue,\n      () => {\n        return this.realm.evaluateForEffects(\n          () => this.render(consequentVal, namespace, depth),\n          null,\n          \"_renderAbstractConditionalValue consequent\"\n        );\n      },\n      () => {\n        return this.realm.evaluateForEffects(\n          () => this.render(alternateVal, namespace, depth),\n          null,\n          \"_renderAbstractConditionalValue consequent\"\n        );\n      }\n    );\n    return convertValueToNode(val);\n  }\n\n  _renderAbstractValue(value: AbstractValue, namespace: string, depth: number): ReactNode {\n    if (value.kind === \"conditional\") {\n      let [condValue, consequentVal, alternateVal] = value.args;\n      invariant(condValue instanceof AbstractValue);\n      return this._renderAbstractConditionalValue(condValue, consequentVal, alternateVal, namespace, depth);\n    } else {\n      return renderValueWithHelper(this.realm, value, this.htmlEscapeHelper);\n    }\n  }\n\n  _renderArrayValue(arrayValue: ArrayValue, namespace: string, depth: number): Array<ReactNode> | ReactNode {\n    invariant(this.realm.isInPureScope());\n    if (ArrayValue.isIntrinsicAndHasWidenedNumericProperty(arrayValue)) {\n      let nestedOptimizedFunctionEffects = arrayValue.nestedOptimizedFunctionEffects;\n\n      if (nestedOptimizedFunctionEffects !== undefined) {\n        for (let [func, effects] of nestedOptimizedFunctionEffects) {\n          let funcCall = () => {\n            let result = effects.result;\n            this.realm.applyEffects(effects);\n            if (result instanceof SimpleNormalCompletion) {\n              result = result.value;\n            }\n            invariant(result instanceof Value);\n            return this.render(result, namespace, depth);\n          };\n\n          let resolvedEffects;\n          resolvedEffects = this.realm.evaluateFunctionForPureEffects(\n            func,\n            funcCall,\n            /*state*/ null,\n            `react SSR resolve nested optimized closure`,\n            () => {\n              invariant(false, \"SSR _renderArrayValue side-effect should have been caught in main React reconciler\");\n            }\n          );\n          nestedOptimizedFunctionEffects.set(func, resolvedEffects);\n          this.realm.collectedNestedOptimizedFunctionEffects.set(func, resolvedEffects);\n        }\n        return renderValueWithHelper(this.realm, arrayValue, this.arrayHelper);\n      }\n    }\n    let elements = [];\n    forEachArrayValue(this.realm, arrayValue, elementValue => {\n      let renderedElement = this._renderValue(elementValue, namespace, depth);\n      if (Array.isArray(renderedElement)) {\n        elements.push(...renderedElement);\n      } else {\n        elements.push(renderedElement);\n      }\n    });\n    // $FlowFixMe: flow gets confused here\n    return elements;\n  }\n\n  _renderReactElement(reactElement: ObjectValue, namespace: string, depth: number): Array<ReactNode> {\n    let typeValue = getProperty(this.realm, reactElement, \"type\");\n    let propsValue = getProperty(this.realm, reactElement, \"props\");\n\n    invariant(propsValue instanceof AbstractObjectValue || propsValue instanceof ObjectValue);\n    if (typeValue instanceof StringValue) {\n      let type = typeValue.value;\n      let tag = type.toLowerCase();\n\n      if (tag === \"input\") {\n        let defaultValueProp = getProperty(this.realm, propsValue, \"defaultValue\");\n        let defaultCheckedProp = getProperty(this.realm, propsValue, \"defaultChecked\");\n        let valueProp = getProperty(this.realm, propsValue, \"value\");\n        let checkedProp = getProperty(this.realm, propsValue, \"checked\");\n\n        let newProps = new ObjectValue(this.realm, this.realm.intrinsics.ObjectPrototype);\n        Properties.Set(this.realm, newProps, \"type\", this.realm.intrinsics.undefined, true);\n\n        let inputProps = new ObjectValue(this.realm, this.realm.intrinsics.ObjectPrototype);\n        Properties.Set(this.realm, inputProps, \"defaultChecked\", this.realm.intrinsics.undefined, true);\n        Properties.Set(this.realm, inputProps, \"defaultValue\", this.realm.intrinsics.undefined, true);\n        Properties.Set(\n          this.realm,\n          inputProps,\n          \"value\",\n          valueProp !== this.realm.intrinsics.null ? valueProp : defaultValueProp,\n          true\n        );\n        Properties.Set(\n          this.realm,\n          inputProps,\n          \"checked\",\n          checkedProp !== this.realm.intrinsics.null ? checkedProp : defaultCheckedProp,\n          true\n        );\n        applyObjectAssignConfigsForReactElement(this.realm, newProps, [propsValue, inputProps]);\n        propsValue = newProps;\n      } else if (tag === \"textarea\") {\n        let initialValue = getProperty(this.realm, propsValue, \"value\");\n\n        if (initialValue === this.realm.intrinsics.null) {\n          invariant(false, \"TODO\");\n        }\n\n        let newProps = new ObjectValue(this.realm, this.realm.intrinsics.ObjectPrototype);\n        let textareaProps = new ObjectValue(this.realm, this.realm.intrinsics.ObjectPrototype);\n        Properties.Set(this.realm, textareaProps, \"value\", this.realm.intrinsics.undefined, true);\n        Properties.Set(this.realm, textareaProps, \"children\", initialValue, true);\n        applyObjectAssignConfigsForReactElement(this.realm, newProps, [propsValue, textareaProps]);\n        propsValue = newProps;\n      } else if (tag === \"select\") {\n        invariant(false, \"TODO\");\n      } else if (tag === \"option\") {\n        invariant(false, \"TODO\");\n      }\n      let out = createOpenTagMarkup(\n        this.realm,\n        type,\n        tag,\n        propsValue,\n        namespace,\n        this.makeStaticMarkup,\n        depth === 0,\n        this.htmlEscapeHelper\n      );\n      let footer = \"\";\n\n      if (omittedCloseTags.has(tag)) {\n        out.push(\"/>\");\n      } else {\n        out.push(\">\");\n        footer = \"</\" + type + \">\";\n      }\n      let innerMarkup = getNonChildrenInnerMarkup(this.realm, propsValue);\n      if (innerMarkup instanceof StringValue) {\n        if (newlineEatingTags[tag] && innerMarkup.value.charAt(0) === \"\\n\") {\n          out.push(\"\\n\");\n        }\n        out.push(innerMarkup.value);\n      } else if (innerMarkup instanceof ObjectValue) {\n        invariant(false, \"TODO\");\n      } else {\n        this.previousWasTextNode = false;\n        let childrenValue = getProperty(this.realm, propsValue, \"children\");\n        let childrenOut = this._renderValue(childrenValue, namespace, depth + 1);\n\n        if (Array.isArray(childrenOut)) {\n          out.push(...childrenOut);\n        } else {\n          out.push(childrenOut);\n        }\n      }\n      out.push(footer);\n      this.previousWasTextNode = false;\n      return out;\n    } else if (typeValue instanceof SymbolValue && typeValue === getReactSymbol(\"react.fragment\", this.realm)) {\n      let childrenValue = getProperty(this.realm, propsValue, \"children\");\n      let childrenOut = this._renderValue(childrenValue, namespace, depth + 1);\n      let out = [];\n\n      if (Array.isArray(childrenOut)) {\n        out.push(...childrenOut);\n      } else {\n        out.push(childrenOut);\n      }\n      this.previousWasTextNode = false;\n      return out;\n    } else {\n      invariant(false, \"TODO\");\n    }\n  }\n\n  _renderValue(value: Value, namespace: string, depth: number): ReactNode {\n    if (value instanceof StringValue || value instanceof NumberValue) {\n      return this._renderText(value);\n    } else if (value instanceof ObjectValue && isReactElement(value)) {\n      return this._renderReactElement(value, namespace, depth);\n    } else if (value instanceof AbstractValue) {\n      return this._renderAbstractValue(value, namespace, depth);\n    } else if (value instanceof ArrayValue) {\n      return this._renderArrayValue(value, namespace, depth);\n    } else if (value instanceof BooleanValue || value instanceof UndefinedValue || value instanceof NullValue) {\n      return \"\";\n    }\n    invariant(false, \"TODO\");\n  }\n}\n\nexport function renderToString(\n  realm: Realm,\n  reactElement: ObjectValue,\n  staticMarkup: boolean\n): StringValue | AbstractValue {\n  let reactStatistics = new ReactStatistics();\n  let alreadyEvaluated = new Map();\n  let reconciler = new Reconciler(\n    realm,\n    { firstRenderOnly: true, isRoot: true, modelString: undefined },\n    alreadyEvaluated,\n    reactStatistics\n  );\n  let typeValue = getProperty(realm, reactElement, \"type\");\n  let propsValue = getProperty(realm, reactElement, \"props\");\n  let evaluatedRootNode = createReactEvaluatedNode(\"ROOT\", getComponentName(realm, typeValue));\n  invariant(typeValue instanceof ECMAScriptSourceFunctionValue);\n  if (propsValue instanceof AbstractValue && !(propsValue instanceof AbstractObjectValue)) {\n    propsValue = To.ToObject(realm, propsValue);\n  }\n  invariant(propsValue instanceof ObjectValue || propsValue instanceof AbstractObjectValue);\n  let effects = reconciler.resolveReactComponentTree(typeValue, propsValue, null, evaluatedRootNode);\n\n  invariant(realm.generator);\n  // create a single regex used for the escape functions\n  // by hoisting it, it gets cached by the VM JITs\n  realm.generator.emitStatement([], createOperationDescriptor(\"REACT_SSR_REGEX_CONSTANT\"));\n  invariant(realm.generator);\n  realm.generator.emitStatement([], createOperationDescriptor(\"REACT_SSR_PREV_TEXT_NODE\"));\n  invariant(effects);\n  realm.applyEffects(effects);\n  invariant(effects.result instanceof SimpleNormalCompletion);\n  let serverRenderer = new ReactDOMServerRenderer(realm, staticMarkup);\n  let renderValue = serverRenderer.render(effects.result.value);\n  return renderValue;\n}\n"
  },
  {
    "path": "src/react/experimental-server-rendering/utils.js",
    "content": "/**\n * Copyright (c) 2017-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n/* @flow */\n\n// Warning: This code is experimental and might not fully work. There is no guarantee\n// that is up-to-date with the curent react-dom/server logic and there may also be\n// security holes in the string escaping because of this.\n\nimport type { Realm } from \"../../realm.js\";\nimport { parseExpression } from \"@babel/parser\";\nimport {\n  AbstractObjectValue,\n  AbstractValue,\n  ECMAScriptSourceFunctionValue,\n  NumberValue,\n  ObjectValue,\n  StringValue,\n  Value,\n} from \"../../values/index.js\";\nimport { getProperty } from \"../utils.js\";\nimport invariant from \"../../invariant.js\";\nimport type { ReactNode } from \"./rendering.js\";\nimport { ROOT_ATTRIBUTE_NAME } from \"./dom-config.js\";\n\nconst matchHtmlRegExp = /[\"'&<>]/;\n\nexport function createMarkupForRoot(): string {\n  return ROOT_ATTRIBUTE_NAME + '=\"\"';\n}\n\nexport function isCustomComponent(\n  realm: Realm,\n  tagName: string,\n  propsValue: ObjectValue | AbstractObjectValue\n): boolean {\n  if (tagName.indexOf(\"-\") === -1) {\n    let is = getProperty(realm, propsValue, \"is\");\n    return is instanceof StringValue;\n  }\n  switch (tagName) {\n    case \"annotation-xml\":\n    case \"color-profile\":\n    case \"font-face\":\n    case \"font-face-src\":\n    case \"font-face-uri\":\n    case \"font-face-format\":\n    case \"font-face-name\":\n    case \"missing-glyph\":\n      return false;\n    default:\n      return true;\n  }\n}\n\n// $FlowFixMe: we don't want to provides types here as we inject this function into source\nexport function escapeHtml(string): string {\n  if (typeof string === \"boolean\" || typeof string === \"number\") {\n    return \"\" + string;\n  }\n  let str = \"\" + string;\n  let match = matchHtmlRegExp.exec(str);\n\n  if (!match) {\n    return str;\n  }\n\n  let escape;\n  let html = \"\";\n  let index = 0;\n  let lastIndex = 0;\n\n  for (index = match.index; index < str.length; index++) {\n    switch (str.charCodeAt(index)) {\n      case 34:\n        escape = \"&quot;\";\n        break;\n      case 38:\n        escape = \"&amp;\";\n        break;\n      case 39:\n        escape = \"&#x27;\";\n        break;\n      case 60:\n        escape = \"&lt;\";\n        break;\n      case 62:\n        escape = \"&gt;\";\n        break;\n      default:\n        continue;\n    }\n\n    if (lastIndex !== index) {\n      html += str.substring(lastIndex, index);\n    }\n\n    lastIndex = index + 1;\n    html += escape;\n  }\n\n  return lastIndex !== index ? html + str.substring(lastIndex, index) : html;\n}\n\nexport function normalizeNode(realm: Realm, reactNode: ReactNode): ReactNode {\n  if (Array.isArray(reactNode)) {\n    let newReactNode;\n\n    for (let element of reactNode) {\n      if (typeof element === \"string\") {\n        if (newReactNode === undefined) {\n          newReactNode = element;\n        } else if (typeof newReactNode === \"string\") {\n          newReactNode += element;\n        } else {\n          let lastNode = newReactNode[newReactNode.length - 1];\n          if (typeof lastNode === \"string\") {\n            newReactNode[newReactNode.length - 1] += element;\n          } else {\n            newReactNode.push(element);\n          }\n        }\n      } else if (newReactNode === undefined) {\n        newReactNode = ([element]: Array<ReactNode>);\n      } else if (typeof newReactNode === \"string\") {\n        newReactNode = ([newReactNode, element]: Array<ReactNode>);\n      } else {\n        newReactNode.push(element);\n      }\n    }\n    invariant(newReactNode !== undefined);\n    return newReactNode;\n  } else if (typeof reactNode === \"string\" || reactNode instanceof AbstractValue) {\n    return reactNode;\n  }\n  invariant(false, \"TODO\");\n}\n\nexport function convertValueToNode(value: Value): ReactNode {\n  if (value instanceof AbstractValue) {\n    return value;\n  } else if (value instanceof StringValue || value instanceof NumberValue) {\n    return value.value + \"\";\n  }\n  invariant(false, \"TODO\");\n}\n\nexport function createHtmlEscapeHelper(realm: Realm): ECMAScriptSourceFunctionValue {\n  let escapeHelperAst = parseExpression(escapeHtml.toString(), { plugins: [\"flow\"] });\n  let helper = new ECMAScriptSourceFunctionValue(realm);\n  helper.initialize(escapeHelperAst.params, escapeHelperAst.body);\n  return helper;\n}\n\nexport function createArrayHelper(realm: Realm): ECMAScriptSourceFunctionValue {\n  let arrayHelper = `\n    function arrayHelper(array) {\n      let length = array.length;\n      let i = 0;\n      let str = \"\";\n      let item;\n\n      while (i < length) {\n        item = array[i++];\n        if (previousWasTextNode === true) {\n          str += \"<!-- -->\" + item;\n        } else {\n          str += item;\n        }\n        previousWasTextNode = item[0] !== \"<\";\n      }\n      return str;\n    }\n  `;\n\n  let escapeHelperAst = parseExpression(arrayHelper, { plugins: [\"flow\"] });\n  let helper = new ECMAScriptSourceFunctionValue(realm);\n  helper.initialize(escapeHelperAst.params, escapeHelperAst.body);\n  return helper;\n}\n\nexport function getNonChildrenInnerMarkup(\n  realm: Realm,\n  propsValue: ObjectValue | AbstractObjectValue\n): ReactNode | null {\n  let innerHTML = getProperty(realm, propsValue, \"dangerouslySetInnerHTML\");\n\n  if (innerHTML instanceof ObjectValue) {\n    let _html = getProperty(realm, innerHTML, \"dangerouslySetInnerHTML\");\n\n    if (_html instanceof StringValue) {\n      return _html.value;\n    }\n  } else {\n    let content = getProperty(realm, propsValue, \"children\");\n\n    if (content instanceof StringValue || content instanceof NumberValue) {\n      return escapeHtml(content.value);\n    }\n  }\n  return null;\n}\n\nexport function quoteAttributeValueForBrowser(value: string): string {\n  return '\"' + escapeHtml(value) + '\"';\n}\n"
  },
  {
    "path": "src/react/hoisting.js",
    "content": "/**\n * Copyright (c) 2017-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n/* @flow */\n\nimport { Realm } from \"../realm.js\";\nimport {\n  AbstractValue,\n  ArrayValue,\n  BooleanValue,\n  ECMAScriptSourceFunctionValue,\n  FunctionValue,\n  NumberValue,\n  ObjectValue,\n  SymbolValue,\n  StringValue,\n  Value,\n} from \"../values/index.js\";\nimport { Get } from \"../methods/index.js\";\nimport invariant from \"../invariant.js\";\nimport { isReactElement, getProperty } from \"./utils.js\";\nimport { ResidualHeapVisitor } from \"../serializer/ResidualHeapVisitor.js\";\n\n// a nested object of a React Element should be hoisted where all its properties are known\n// at evaluation time to be safe to hoist (because of the heuristics of a React render)\nfunction canHoistObject(\n  realm: Realm,\n  object: ObjectValue,\n  residualHeapVisitor: ResidualHeapVisitor,\n  visitedValues: Set<Value>\n): boolean {\n  if (isReactElement(object)) {\n    return canHoistReactElement(realm, object, residualHeapVisitor, visitedValues);\n  }\n  for (let [propName] of object.properties) {\n    let prop = Get(realm, object, propName);\n    if (!canHoistValue(realm, prop, residualHeapVisitor, visitedValues)) {\n      return false;\n    }\n  }\n  for (let [symbol] of object.symbols) {\n    let prop = Get(realm, object, symbol);\n    if (!canHoistValue(realm, prop, residualHeapVisitor, visitedValues)) {\n      return false;\n    }\n  }\n  return true;\n}\n\nfunction canHoistArray(\n  realm: Realm,\n  array: ArrayValue,\n  residualHeapVisitor: ResidualHeapVisitor,\n  visitedValues: Set<Value>\n): boolean {\n  if (array.intrinsicName) return false;\n  let lengthValue = Get(realm, array, \"length\");\n  if (!canHoistValue(realm, lengthValue, residualHeapVisitor, visitedValues)) {\n    return false;\n  }\n  if (lengthValue instanceof NumberValue) {\n    let length = lengthValue.value;\n    for (let i = 0; i < length; i++) {\n      let element = Get(realm, array, \"\" + i);\n\n      if (!canHoistValue(realm, element, residualHeapVisitor, visitedValues)) {\n        return false;\n      }\n    }\n  }\n  return true;\n}\n\nexport function canHoistFunction(\n  realm: Realm,\n  func: FunctionValue,\n  residualHeapVisitor?: ResidualHeapVisitor,\n  visitedValues: Set<Value>\n): boolean {\n  if (realm.react.hoistableFunctions.has(func)) {\n    // cast because Flow thinks that we may have set a value to be something other than a boolean?\n    return ((realm.react.hoistableFunctions.get(func): any): boolean);\n  }\n  if (residualHeapVisitor === undefined) {\n    return false;\n  }\n  // get the function instance\n  let functionInstance = residualHeapVisitor.functionInstances.get(func);\n  // we can safely hoist the function if the residual bindings hoistable too\n  if (functionInstance !== undefined) {\n    invariant(functionInstance.residualFunctionBindings instanceof Map);\n    let residualBindings = functionInstance.residualFunctionBindings;\n    for (let [, { declarativeEnvironmentRecord, value }] of residualBindings) {\n      // if declarativeEnvironmentRecord is null, it's likely a global binding\n      // so we can assume that we can still hoist this function\n      if (declarativeEnvironmentRecord !== null) {\n        if (value === undefined) {\n          return false;\n        }\n        invariant(value instanceof Value);\n        if (!canHoistValue(realm, value, residualHeapVisitor, visitedValues)) {\n          return false;\n        }\n      }\n    }\n    if (func instanceof ECMAScriptSourceFunctionValue) {\n      let code = func.$ECMAScriptCode;\n      let functionInfos = residualHeapVisitor.functionInfos.get(code);\n      if (functionInfos && functionInfos.unbound.size > 0) {\n        return false;\n      }\n    }\n    realm.react.hoistableFunctions.set(func, true);\n    return true;\n  }\n  realm.react.hoistableFunctions.set(func, false);\n  return false;\n}\n\nfunction canHoistAbstract(realm: Realm, abstract: AbstractValue, residualHeapVisitor: ResidualHeapVisitor): boolean {\n  // TODO #1687: add abstract value hoisting\n  return false;\n}\n\nfunction isPrimitive(realm: Realm, value: Value) {\n  return (\n    value instanceof StringValue ||\n    value instanceof NumberValue ||\n    value instanceof SymbolValue ||\n    value instanceof BooleanValue ||\n    value === realm.intrinsics.null ||\n    value === realm.intrinsics.undefined\n  );\n}\n\nfunction canHoistValue(\n  realm: Realm,\n  value: Value,\n  residualHeapVisitor: ResidualHeapVisitor,\n  visitedValues: Set<Value>\n): boolean {\n  if (visitedValues.has(value)) {\n    // If there is a cycle, bail out.\n    // TODO: is there some way to *not* bail out in this case?\n    // Currently if we don't, the output is broken.\n    return false;\n  }\n  visitedValues.add(value);\n  let canHoist = false;\n\n  if (value instanceof ArrayValue) {\n    canHoist = canHoistArray(realm, value, residualHeapVisitor, visitedValues);\n  } else if (value instanceof FunctionValue) {\n    canHoist = canHoistFunction(realm, value, residualHeapVisitor, visitedValues);\n  } else if (value instanceof ObjectValue) {\n    canHoist = canHoistObject(realm, value, residualHeapVisitor, visitedValues);\n  } else if (value instanceof AbstractValue) {\n    canHoist = canHoistAbstract(realm, value, residualHeapVisitor);\n  } else if (isPrimitive) {\n    canHoist = true;\n  }\n  visitedValues.delete(value);\n  return canHoist;\n}\n\nexport function canHoistReactElement(\n  realm: Realm,\n  reactElement: ObjectValue,\n  residualHeapVisitor?: ResidualHeapVisitor,\n  visitedValues?: Set<Value> | void\n): boolean {\n  if (realm.react.hoistableReactElements.has(reactElement)) {\n    // cast because Flow thinks that we may have set a value to be something other than a boolean?\n    return ((realm.react.hoistableReactElements.get(reactElement): any): boolean);\n  }\n  if (residualHeapVisitor === undefined) {\n    return false;\n  }\n  let type = getProperty(realm, reactElement, \"type\");\n  let ref = getProperty(realm, reactElement, \"ref\");\n  let key = getProperty(realm, reactElement, \"key\");\n  let props = getProperty(realm, reactElement, \"props\");\n\n  if (visitedValues === undefined) {\n    visitedValues = new Set();\n    visitedValues.add(reactElement);\n  }\n  if (\n    canHoistValue(realm, type, residualHeapVisitor, visitedValues) &&\n    // we can't hoist string \"refs\" or if they're abstract, as they might be abstract strings\n    !(ref instanceof String || ref instanceof AbstractValue) &&\n    canHoistValue(realm, ref, residualHeapVisitor, visitedValues) &&\n    canHoistValue(realm, key, residualHeapVisitor, visitedValues) &&\n    !props.isPartialObject() &&\n    canHoistValue(realm, props, residualHeapVisitor, visitedValues)\n  ) {\n    realm.react.hoistableReactElements.set(reactElement, true);\n    return true;\n  }\n  realm.react.hoistableReactElements.set(reactElement, false);\n  return false;\n}\n\nexport function determineIfReactElementCanBeHoisted(\n  realm: Realm,\n  reactElement: ObjectValue,\n  residualHeapVisitor: ResidualHeapVisitor\n): void {\n  canHoistReactElement(realm, reactElement, residualHeapVisitor);\n}\n"
  },
  {
    "path": "src/react/jsx.js",
    "content": "/**\n * Copyright (c) 2017-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n/* @flow */\n\nimport * as t from \"@babel/types\";\nimport type {\n  BabelNodeExpression,\n  BabelNodeJSXMemberExpression,\n  BabelNodeJSXIdentifier,\n  BabelNodeIdentifier,\n  BabelNodeMemberExpression,\n  BabelNodeStringLiteral,\n} from \"@babel/types\";\nimport invariant from \"../invariant.js\";\nimport { isReactComponent } from \"./utils.js\";\n\nexport function convertExpressionToJSXIdentifier(\n  expr: BabelNodeExpression,\n  isRoot: boolean\n): BabelNodeJSXMemberExpression | BabelNodeJSXIdentifier {\n  switch (expr.type) {\n    case \"ThisExpression\":\n      invariant(isRoot === false, `invalid conversion of root expression to JSXIdentifier for ThisExpression`);\n      return t.jSXIdentifier(\"this\");\n    case \"Identifier\":\n      let name = expr.name;\n      invariant(\n        // ensure the 1st character of the string is uppercase\n        // for a component unless it is not the root\n        isRoot === false || isReactComponent(name),\n        \"invalid JSXIdentifer from Identifier, Identifier name must be uppercase\"\n      );\n      return t.jSXIdentifier(name);\n    case \"StringLiteral\":\n      let value = expr.value;\n      invariant(\n        // ensure the 1st character of the string is lowercase\n        // otherwise it will appear as a component\n        value.length > 0 && value[0] === value[0].toLowerCase(),\n        \"invalid JSXIdentifer from string, strings must be lowercase\"\n      );\n      return t.jSXIdentifier(value);\n    case \"MemberExpression\":\n      invariant(expr.computed === false, \"Cannot inline computed expressions in JSX type.\");\n      return t.jSXMemberExpression(\n        convertExpressionToJSXIdentifier(expr.object, false),\n        ((convertExpressionToJSXIdentifier(expr.property, false): any): BabelNodeJSXIdentifier)\n      );\n    default:\n      invariant(false, \"Invalid JSX type\");\n  }\n}\n\nexport function convertJSXExpressionToIdentifier(\n  expr: BabelNodeExpression\n): BabelNodeMemberExpression | BabelNodeIdentifier {\n  switch (expr.type) {\n    case \"JSXIdentifier\":\n      return t.identifier(expr.name);\n    case \"JSXMemberExpression\":\n      return t.memberExpression(\n        convertJSXExpressionToIdentifier(expr.object),\n        (convertJSXExpressionToIdentifier(expr.property): any)\n      );\n    default:\n      invariant(false, \"Invalid JSX type\");\n  }\n}\n\nexport function convertKeyValueToJSXAttribute(key: string, expr: BabelNodeExpression): BabelNode {\n  let wrapInContainer = true;\n\n  if (expr && t.isStringLiteral(expr) && typeof expr.value === \"string\") {\n    let value = expr.value;\n    wrapInContainer = value.includes('\"') || value.includes(\"'\");\n  }\n  return t.jSXAttribute(\n    t.jSXIdentifier(key),\n    wrapInContainer ? t.jSXExpressionContainer(expr) : ((expr: any): BabelNodeStringLiteral)\n  );\n}\n"
  },
  {
    "path": "src/react/optimizing.js",
    "content": "/**\n * Copyright (c) 2017-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n/* @flow strict-local */\n\nimport { type Effects, Realm } from \"../realm.js\";\nimport {\n  AbstractValue,\n  ECMAScriptSourceFunctionValue,\n  ObjectValue,\n  BoundFunctionValue,\n  FunctionValue,\n} from \"../values/index.js\";\nimport { createAdditionalEffects } from \"../serializer/utils.js\";\nimport {\n  convertFunctionalComponentToComplexClassComponent,\n  convertSimpleClassComponentToFunctionalComponent,\n  createNoopFunction,\n  createReactEvaluatedNode,\n  getComponentName,\n  getComponentTypeFromRootValue,\n  normalizeFunctionalComponentParamaters,\n  valueIsClassComponent,\n} from \"./utils.js\";\nimport {\n  type WriteEffects,\n  type ReactEvaluatedNode,\n  ReactStatistics,\n  type AdditionalFunctionTransform,\n} from \"../serializer/types.js\";\nimport { Reconciler, type ComponentTreeState } from \"./reconcilation.js\";\nimport { ReconcilerFatalError } from \"./errors.js\";\nimport { Properties } from \"../singletons.js\";\nimport { Get } from \"../methods/index.js\";\nimport invariant from \"../invariant.js\";\nimport type { ReactComponentTreeConfig } from \"../types.js\";\nimport { Logger } from \"../utils/logger.js\";\n\nfunction writeEffectsKeyOfComponentValue(\n  realm: Realm,\n  componentType: ECMAScriptSourceFunctionValue | BoundFunctionValue,\n  componentTreeState: ComponentTreeState,\n  transforms: Array<AdditionalFunctionTransform>\n): FunctionValue {\n  if (valueIsClassComponent(realm, componentType)) {\n    if (componentTreeState.status === \"SIMPLE\") {\n      // if the root component was a class and is now simple, we can convert it from a class\n      // component to a functional component\n      if (componentType instanceof BoundFunctionValue) {\n        let targetFunction = componentType.$BoundTargetFunction;\n        invariant(targetFunction instanceof ECMAScriptSourceFunctionValue);\n        convertSimpleClassComponentToFunctionalComponent(realm, targetFunction, transforms);\n        normalizeFunctionalComponentParamaters(targetFunction);\n        return targetFunction;\n      } else {\n        convertSimpleClassComponentToFunctionalComponent(realm, componentType, transforms);\n        normalizeFunctionalComponentParamaters(componentType);\n        return componentType;\n      }\n    } else {\n      let prototype = Get(realm, componentType, \"prototype\");\n      invariant(prototype instanceof ObjectValue);\n      let renderMethod = Get(realm, prototype, \"render\");\n      invariant(renderMethod instanceof ECMAScriptSourceFunctionValue);\n      return renderMethod;\n    }\n  } else {\n    if (componentTreeState.status === \"COMPLEX\") {\n      convertFunctionalComponentToComplexClassComponent(\n        realm,\n        componentType,\n        componentTreeState.componentType,\n        transforms\n      );\n      let prototype = Get(realm, componentType, \"prototype\");\n      invariant(prototype instanceof ObjectValue);\n      let renderMethod = Get(realm, prototype, \"render\");\n      invariant(renderMethod instanceof ECMAScriptSourceFunctionValue);\n      return renderMethod;\n    } else {\n      if (componentType instanceof BoundFunctionValue) {\n        let targetFunction = componentType.$BoundTargetFunction;\n        invariant(targetFunction instanceof ECMAScriptSourceFunctionValue);\n        normalizeFunctionalComponentParamaters(targetFunction);\n        return targetFunction;\n      } else {\n        normalizeFunctionalComponentParamaters(componentType);\n        return componentType;\n      }\n    }\n  }\n}\n\nfunction applyWriteEffectsForOptimizedComponent(\n  realm: Realm,\n  componentType: ECMAScriptSourceFunctionValue | BoundFunctionValue,\n  _effects: Effects,\n  componentTreeState: ComponentTreeState,\n  evaluatedNode: ReactEvaluatedNode,\n  writeEffects: WriteEffects,\n  preEvaluationComponentToWriteEffectFunction: Map<FunctionValue, FunctionValue>,\n  parentOptimizedFunction: FunctionValue | void\n): void {\n  let effects = _effects;\n  let transforms = [];\n  let writeEffectsKey = writeEffectsKeyOfComponentValue(realm, componentType, componentTreeState, transforms);\n  // NB: Must be done here because its required by cAE\n  preEvaluationComponentToWriteEffectFunction.set(componentType, writeEffectsKey);\n  let additionalFunctionEffects = createAdditionalEffects(\n    realm,\n    effects,\n    false,\n    \"ReactAdditionalFunctionEffects\",\n    writeEffectsKey,\n    parentOptimizedFunction,\n    transforms\n  );\n  if (additionalFunctionEffects === null) {\n    throw new ReconcilerFatalError(\n      `Failed to optimize React component tree for \"${evaluatedNode.name}\" due to an unsupported completion`,\n      evaluatedNode\n    );\n  }\n  effects = additionalFunctionEffects.effects;\n  let value = effects.result;\n\n  if (value === realm.intrinsics.undefined) {\n    // if we get undefined, then this component tree failed and a message was already logged\n    // in the reconciler\n    return;\n  }\n  writeEffects.set(writeEffectsKey, additionalFunctionEffects);\n  // apply contextTypes for legacy context\n  if (componentTreeState.contextTypes.size > 0) {\n    let contextTypes = new ObjectValue(realm, realm.intrinsics.ObjectPrototype);\n    let noOpFunc = createNoopFunction(realm);\n    for (let key of componentTreeState.contextTypes) {\n      Properties.Set(realm, contextTypes, key, noOpFunc, true);\n    }\n    Properties.Set(realm, componentType, \"contextTypes\", contextTypes, true);\n  }\n}\n\nfunction optimizeReactComponentTreeBranches(\n  realm: Realm,\n  reconciler: Reconciler,\n  writeEffects: WriteEffects,\n  logger: Logger,\n  alreadyEvaluated: Map<ECMAScriptSourceFunctionValue | BoundFunctionValue, ReactEvaluatedNode>,\n  preEvaluationComponentToWriteEffectFunction: Map<FunctionValue, FunctionValue>\n): void {\n  if (realm.react.verbose && reconciler.branchedComponentTrees.length > 0) {\n    logger.logInformation(`  Evaluating React component tree branches...`);\n  }\n  // for now we just use abstract props/context, in the future we'll create a new branch with a new component\n  // that used the props/context. It will extend the original component and only have a render method\n  for (let { rootValue: branchRootValue, evaluatedNode } of reconciler.branchedComponentTrees) {\n    let branchComponentType = getComponentTypeFromRootValue(realm, branchRootValue);\n    if (branchComponentType === null) {\n      evaluatedNode.status = \"UNKNOWN_TYPE\";\n      continue;\n    }\n    if (alreadyEvaluated.has(branchComponentType)) {\n      return;\n    }\n    alreadyEvaluated.set(branchComponentType, evaluatedNode);\n    reconciler.clearComponentTreeState();\n    if (realm.react.verbose) {\n      logger.logInformation(`    Evaluating ${evaluatedNode.name} (branch)`);\n    }\n    let parentOptimizedFunction = realm.currentOptimizedFunction;\n    let branchEffects = realm.withNewOptimizedFunction(\n      () => reconciler.resolveReactComponentTree(branchComponentType, null, null, evaluatedNode),\n      branchComponentType\n    );\n\n    if (realm.react.verbose) {\n      logger.logInformation(`    ✔ ${evaluatedNode.name} (branch)`);\n    }\n    let branchComponentTreeState = reconciler.componentTreeState;\n\n    applyWriteEffectsForOptimizedComponent(\n      realm,\n      branchComponentType,\n      branchEffects,\n      branchComponentTreeState,\n      evaluatedNode,\n      writeEffects,\n      preEvaluationComponentToWriteEffectFunction,\n      parentOptimizedFunction\n    );\n  }\n}\n\nexport function optimizeReactComponentTreeRoot(\n  realm: Realm,\n  componentRoot: ECMAScriptSourceFunctionValue | BoundFunctionValue | AbstractValue,\n  config: ReactComponentTreeConfig,\n  writeEffects: WriteEffects,\n  logger: Logger,\n  statistics: ReactStatistics,\n  alreadyEvaluated: Map<ECMAScriptSourceFunctionValue | BoundFunctionValue, ReactEvaluatedNode>,\n  preEvaluationComponentToWriteEffectFunction: Map<FunctionValue, FunctionValue>\n): void {\n  let reconciler = new Reconciler(realm, config, alreadyEvaluated, statistics, logger);\n  let componentType = getComponentTypeFromRootValue(realm, componentRoot);\n  if (componentType === null) {\n    return;\n  }\n  if (alreadyEvaluated.has(componentType)) {\n    return;\n  }\n  let evaluatedRootNode = createReactEvaluatedNode(\"ROOT\", getComponentName(realm, componentType));\n  statistics.evaluatedRootNodes.push(evaluatedRootNode);\n  alreadyEvaluated.set(componentType, evaluatedRootNode);\n  if (realm.react.verbose) {\n    logger.logInformation(`  Evaluating ${evaluatedRootNode.name} (root)`);\n  }\n  let parentOptimizedFunction = realm.currentOptimizedFunction;\n  let componentTreeEffects = realm.withNewOptimizedFunction(\n    () => reconciler.resolveReactComponentTree(componentType, null, null, evaluatedRootNode),\n    componentType\n  );\n  if (realm.react.verbose) {\n    logger.logInformation(`  ✔ ${evaluatedRootNode.name} (root)`);\n  }\n\n  applyWriteEffectsForOptimizedComponent(\n    realm,\n    componentType,\n    componentTreeEffects,\n    reconciler.componentTreeState,\n    evaluatedRootNode,\n    writeEffects,\n    preEvaluationComponentToWriteEffectFunction,\n    parentOptimizedFunction\n  );\n  let startingComponentTreeBranches = 0;\n  do {\n    startingComponentTreeBranches = reconciler.branchedComponentTrees.length;\n    optimizeReactComponentTreeBranches(\n      realm,\n      reconciler,\n      writeEffects,\n      logger,\n      alreadyEvaluated,\n      preEvaluationComponentToWriteEffectFunction\n    );\n  } while (startingComponentTreeBranches !== reconciler.branchedComponentTrees.length);\n}\n"
  },
  {
    "path": "src/react/reconcilation.js",
    "content": "/**\n * Copyright (c) 2017-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n/* @flow */\n\nimport { Realm, type Effects } from \"../realm.js\";\nimport {\n  AbstractObjectValue,\n  AbstractValue,\n  ArrayValue,\n  BooleanValue,\n  BoundFunctionValue,\n  ECMAScriptSourceFunctionValue,\n  NullValue,\n  NumberValue,\n  ObjectValue,\n  StringValue,\n  SymbolValue,\n  Value,\n  UndefinedValue,\n} from \"../values/index.js\";\nimport { ReactStatistics, type ReactEvaluatedNode } from \"../serializer/types.js\";\nimport {\n  cloneReactElement,\n  cloneProps,\n  createReactEvaluatedNode,\n  doNotOptimizeComponent,\n  flattenChildren,\n  hardModifyReactObjectPropertyBinding,\n  getComponentName,\n  getComponentTypeFromRootValue,\n  getProperty,\n  getReactSymbol,\n  getValueFromFunctionCall,\n  isReactElement,\n  mapArrayValue,\n  valueIsClassComponent,\n  valueIsFactoryClassComponent,\n  valueIsKnownReactAbstraction,\n  valueIsLegacyCreateClassComponent,\n} from \"./utils.js\";\nimport { Get } from \"../methods/index.js\";\nimport invariant from \"../invariant.js\";\nimport { Leak, Properties, Utils } from \"../singletons.js\";\nimport { FatalError, NestedOptimizedFunctionSideEffect } from \"../errors.js\";\nimport {\n  type BranchStatusEnum,\n  getValueWithBranchingLogicApplied,\n  wrapReactElementInBranchOrReturnValue,\n} from \"./branching.js\";\nimport { AbruptCompletion, SimpleNormalCompletion } from \"../completions.js\";\nimport {\n  getInitialProps,\n  getInitialContext,\n  createClassInstance,\n  createSimpleClassInstance,\n  evaluateClassConstructor,\n  createClassInstanceForFirstRenderOnly,\n  applyGetDerivedStateFromProps,\n} from \"./components.js\";\nimport {\n  DoNotOptimize,\n  ExpectedBailOut,\n  NewComponentTreeBranch,\n  ReconcilerFatalError,\n  SimpleClassBailOut,\n  UnsupportedSideEffect,\n} from \"./errors.js\";\nimport { wrapReactElementWithKeyedFragment } from \"./elements.js\";\nimport { Logger } from \"../utils/logger.js\";\nimport type { ClassComponentMetadata, ReactComponentTreeConfig, ReactHint } from \"../types.js\";\nimport { handleReportedSideEffect } from \"../serializer/utils.js\";\nimport { createOperationDescriptor } from \"../utils/generator.js\";\nimport { PropertyDescriptor } from \"../descriptors.js\";\n\ntype ComponentResolutionStrategy =\n  | \"NORMAL\"\n  | \"FRAGMENT\"\n  | \"RELAY_QUERY_RENDERER\"\n  | \"CONTEXT_PROVIDER\"\n  | \"CONTEXT_CONSUMER\"\n  | \"FORWARD_REF\";\n\nexport type OptimizedClosure = {\n  evaluatedNode: ReactEvaluatedNode,\n  func: ECMAScriptSourceFunctionValue | BoundFunctionValue,\n  nestedEffects: Array<Effects>,\n  componentType: Value | null,\n  context: ObjectValue | AbstractObjectValue | null,\n};\n\nexport type BranchReactComponentTree = {\n  context: ObjectValue | AbstractObjectValue | null,\n  evaluatedNode: ReactEvaluatedNode,\n  props: ObjectValue | AbstractObjectValue | null,\n  rootValue: ECMAScriptSourceFunctionValue | AbstractValue,\n};\n\nexport type ComponentTreeState = {\n  componentType: void | ECMAScriptSourceFunctionValue | BoundFunctionValue,\n  contextTypes: Set<string>,\n  deadEnds: number,\n  status: \"SIMPLE\" | \"COMPLEX\",\n  contextNodeReferences: Map<ObjectValue | AbstractObjectValue, number>,\n};\n\nfunction setContextCurrentValue(contextObject: ObjectValue | AbstractObjectValue, value: Value): void {\n  if (contextObject instanceof AbstractObjectValue && !contextObject.values.isTop()) {\n    let elements = contextObject.values.getElements();\n    if (elements && elements.size === 1) {\n      for (let element of elements) {\n        invariant(element instanceof ObjectValue);\n        contextObject = element;\n      }\n    } else {\n      invariant(false, \"TODO: deal with multiple possible context objects\");\n    }\n  }\n  if (!(contextObject instanceof ObjectValue)) {\n    throw new ExpectedBailOut(\"cannot set currentValue on an abstract context consumer\");\n  }\n  let binding = contextObject.properties.get(\"currentValue\");\n\n  if (binding && binding.descriptor) {\n    invariant(binding.descriptor instanceof PropertyDescriptor);\n    binding.descriptor.value = value;\n  } else {\n    invariant(false, \"setContextCurrentValue failed to set the currentValue\");\n  }\n}\n\nfunction throwUnsupportedSideEffectError(msg: string) {\n  throw new UnsupportedSideEffect(msg);\n}\n\nexport class Reconciler {\n  constructor(\n    realm: Realm,\n    componentTreeConfig: ReactComponentTreeConfig,\n    alreadyEvaluated: Map<ECMAScriptSourceFunctionValue | BoundFunctionValue, ReactEvaluatedNode>,\n    statistics: ReactStatistics,\n    logger?: Logger\n  ) {\n    this.realm = realm;\n    this.statistics = statistics;\n    this.logger = logger;\n    this.componentTreeConfig = componentTreeConfig;\n    this.componentTreeState = this._createComponentTreeState();\n    this.alreadyEvaluated = alreadyEvaluated;\n    this.branchedComponentTrees = [];\n  }\n\n  realm: Realm;\n  statistics: ReactStatistics;\n  logger: void | Logger;\n  componentTreeState: ComponentTreeState;\n  alreadyEvaluated: Map<ECMAScriptSourceFunctionValue | BoundFunctionValue, ReactEvaluatedNode>;\n  componentTreeConfig: ReactComponentTreeConfig;\n  currentEffectsStack: Array<Effects>;\n  branchedComponentTrees: Array<BranchReactComponentTree>;\n\n  resolveReactComponentTree(\n    componentType: ECMAScriptSourceFunctionValue | BoundFunctionValue,\n    props: ObjectValue | AbstractObjectValue | null,\n    context: ObjectValue | AbstractObjectValue | null,\n    evaluatedRootNode: ReactEvaluatedNode\n  ): Effects {\n    const resolveComponentTree = () => {\n      try {\n        let initialProps = props || getInitialProps(this.realm, componentType, this.componentTreeConfig);\n        let initialContext = context || getInitialContext(this.realm, componentType);\n        let { result } = this._resolveComponent(componentType, initialProps, initialContext, \"ROOT\", evaluatedRootNode);\n        this.statistics.optimizedTrees++;\n        return result;\n      } catch (error) {\n        if (error instanceof AbruptCompletion) throw error;\n        this._handleComponentTreeRootFailure(error, evaluatedRootNode);\n        // flow belives we can get here, when it should never be possible\n        invariant(false, \"resolveReactComponentTree error not handled correctly\");\n      }\n    };\n    const funcCall = () =>\n      this.realm.evaluateFunctionForPureEffects(\n        componentType,\n        resolveComponentTree,\n        /*state*/ null,\n        `react component: ${getComponentName(this.realm, componentType)}`,\n        (sideEffectType, binding, expressionLocation) => {\n          if (this.realm.react.failOnUnsupportedSideEffects) {\n            handleReportedSideEffect(throwUnsupportedSideEffectError, sideEffectType, binding, expressionLocation);\n          }\n        }\n      );\n\n    let effects;\n    try {\n      this.realm.react.activeReconciler = this;\n      effects = this.realm.wrapInGlobalEnv(\n        () => (this.realm.isInPureScope() ? funcCall() : this.realm.evaluateWithPureScope(funcCall))\n      );\n    } catch (e) {\n      this._handleComponentTreeRootFailure(e, evaluatedRootNode);\n    } finally {\n      this.realm.react.activeReconciler = undefined;\n    }\n    invariant(effects !== undefined);\n    return effects;\n  }\n\n  clearComponentTreeState(): void {\n    this.componentTreeState = this._createComponentTreeState();\n  }\n\n  _queueNewComponentTree(\n    rootValue: Value,\n    evaluatedNode: ReactEvaluatedNode,\n    props?: ObjectValue | AbstractObjectValue | null = null,\n    context?: ObjectValue | AbstractObjectValue | null = null\n  ): void {\n    if (rootValue instanceof SymbolValue) {\n      return;\n    }\n    invariant(rootValue instanceof ECMAScriptSourceFunctionValue || rootValue instanceof AbstractValue);\n    this.componentTreeState.deadEnds++;\n    let componentType = getComponentTypeFromRootValue(this.realm, rootValue);\n    if (componentType !== null && !this.alreadyEvaluated.has(componentType)) {\n      this.branchedComponentTrees.push({\n        context,\n        evaluatedNode,\n        props,\n        rootValue,\n      });\n    }\n  }\n\n  _resolveComplexClassComponent(\n    componentType: ECMAScriptSourceFunctionValue | BoundFunctionValue,\n    props: ObjectValue | AbstractObjectValue,\n    context: ObjectValue | AbstractObjectValue,\n    classMetadata: ClassComponentMetadata,\n    branchStatus: BranchStatusEnum,\n    evaluatedNode: ReactEvaluatedNode\n  ): Value {\n    if (branchStatus !== \"ROOT\") {\n      // if the tree is simple and we're not in a branch, we can make this tree complex\n      // and make this complex component the root\n      let evaluatedComplexNode = this.alreadyEvaluated.get(componentType);\n      if (\n        branchStatus === \"NO_BRANCH\" &&\n        this.componentTreeState.status === \"SIMPLE\" &&\n        evaluatedComplexNode &&\n        evaluatedComplexNode.status !== \"RENDER_PROPS\"\n      ) {\n        this.componentTreeState.componentType = componentType;\n      } else {\n        this._queueNewComponentTree(componentType, evaluatedNode);\n        evaluatedNode.status = \"NEW_TREE\";\n        throw new NewComponentTreeBranch(evaluatedNode);\n      }\n    }\n    this.componentTreeState.status = \"COMPLEX\";\n    // create a new instance of this React class component\n    let instance = createClassInstance(this.realm, componentType, props, context, classMetadata);\n    // get the \"render\" method off the instance\n    let renderMethod = Get(this.realm, instance, \"render\");\n    invariant(renderMethod instanceof ECMAScriptSourceFunctionValue);\n    // the render method doesn't have any arguments, so we just assign the context of \"this\" to be the instance\n    return getValueFromFunctionCall(this.realm, renderMethod, instance, []);\n  }\n\n  _resolveSimpleClassComponent(\n    componentType: ECMAScriptSourceFunctionValue | BoundFunctionValue,\n    props: ObjectValue | AbstractObjectValue,\n    context: ObjectValue | AbstractObjectValue,\n    branchStatus: BranchStatusEnum,\n    evaluatedNode: ReactEvaluatedNode\n  ): Value {\n    // create a new simple instance of this React class component\n    let instance = createSimpleClassInstance(this.realm, componentType, props, context);\n    // get the \"render\" method off the instance\n    let renderMethod = Get(this.realm, instance, \"render\");\n    invariant(renderMethod instanceof ECMAScriptSourceFunctionValue);\n    // the render method doesn't have any arguments, so we just assign the context of \"this\" to be the instance\n    return getValueFromFunctionCall(this.realm, renderMethod, instance, []);\n  }\n\n  _resolveFunctionalComponent(\n    componentType: ECMAScriptSourceFunctionValue | BoundFunctionValue,\n    props: ObjectValue | AbstractObjectValue,\n    context: ObjectValue | AbstractObjectValue,\n    evaluatedNode: ReactEvaluatedNode\n  ) {\n    return getValueFromFunctionCall(this.realm, componentType, this.realm.intrinsics.undefined, [props, context]);\n  }\n\n  _getClassComponentMetadata(\n    componentType: ECMAScriptSourceFunctionValue | BoundFunctionValue,\n    props: ObjectValue | AbstractObjectValue,\n    context: ObjectValue | AbstractObjectValue\n  ): ClassComponentMetadata {\n    if (this.realm.react.classComponentMetadata.has(componentType)) {\n      let classMetadata = this.realm.react.classComponentMetadata.get(componentType);\n      invariant(classMetadata);\n      return classMetadata;\n    }\n    // get all this assignments in the constructor\n    let classMetadata = evaluateClassConstructor(this.realm, componentType, props, context);\n    this.realm.react.classComponentMetadata.set(componentType, classMetadata);\n    return classMetadata;\n  }\n\n  _resolveContextProviderComponent(\n    componentType: Value,\n    reactElement: ObjectValue,\n    context: ObjectValue | AbstractObjectValue,\n    branchStatus: BranchStatusEnum,\n    evaluatedNode: ReactEvaluatedNode\n  ): Value {\n    let typeValue = getProperty(this.realm, reactElement, \"type\");\n    let propsValue = getProperty(this.realm, reactElement, \"props\");\n\n    let evaluatedChildNode = createReactEvaluatedNode(\"NORMAL\", \"Context.Provider\");\n    evaluatedNode.children.push(evaluatedChildNode);\n    this.statistics.componentsEvaluated++;\n    invariant(typeValue instanceof ObjectValue || typeValue instanceof AbstractObjectValue);\n    const contextConsumer = getProperty(this.realm, typeValue, \"context\");\n    invariant(contextConsumer instanceof ObjectValue || contextConsumer instanceof AbstractObjectValue);\n    let lastValueProp = getProperty(this.realm, contextConsumer, \"currentValue\");\n    this._incremementReferenceForContextNode(contextConsumer);\n\n    let valueProp;\n    // if we have a value prop, set it\n    if (propsValue instanceof ObjectValue || propsValue instanceof AbstractObjectValue) {\n      valueProp = Get(this.realm, propsValue, \"value\");\n      setContextCurrentValue(contextConsumer, valueProp);\n    }\n    if (propsValue instanceof ObjectValue) {\n      // if the value is abstract, we need to keep the render prop as unless\n      // we are in firstRenderOnly mode, where we can just inline the abstract value\n      if (!(valueProp instanceof AbstractValue) || this.componentTreeConfig.firstRenderOnly) {\n        let resolvedReactElement = this._resolveReactElementHostChildren(\n          componentType,\n          reactElement,\n          context,\n          branchStatus,\n          evaluatedChildNode\n        );\n        let resolvedPropsValue = getProperty(this.realm, resolvedReactElement, \"props\");\n        invariant(resolvedPropsValue instanceof ObjectValue || resolvedPropsValue instanceof AbstractObjectValue);\n        invariant(lastValueProp instanceof Value);\n        setContextCurrentValue(contextConsumer, lastValueProp);\n        this._decremementReferenceForContextNode(contextConsumer);\n        // if we no dead ends, we know the rest of the tree and can safely remove the provider\n        if (this.componentTreeState.deadEnds === 0) {\n          let childrenValue = Get(this.realm, resolvedPropsValue, \"children\");\n          evaluatedChildNode.status = \"INLINED\";\n          this.statistics.inlinedComponents++;\n          return childrenValue;\n        }\n        return resolvedReactElement;\n      }\n    }\n    let children = this._resolveReactElementHostChildren(\n      componentType,\n      reactElement,\n      context,\n      branchStatus,\n      evaluatedChildNode\n    );\n    setContextCurrentValue(contextConsumer, lastValueProp);\n    this._decremementReferenceForContextNode(contextConsumer);\n    return children;\n  }\n\n  _decremementReferenceForContextNode(contextNode: ObjectValue | AbstractObjectValue): void {\n    let references = this.componentTreeState.contextNodeReferences.get(contextNode);\n    if (!references) {\n      references = 0;\n    } else {\n      references--;\n    }\n    this.componentTreeState.contextNodeReferences.set(contextNode, references);\n  }\n\n  _incremementReferenceForContextNode(contextNode: ObjectValue | AbstractObjectValue): void {\n    let references = this.componentTreeState.contextNodeReferences.get(contextNode);\n    if (!references) {\n      references = 1;\n    } else {\n      references++;\n    }\n    this.componentTreeState.contextNodeReferences.set(contextNode, references);\n  }\n\n  _isContextValueKnown(contextNode: ObjectValue | AbstractObjectValue): boolean {\n    if (this.componentTreeConfig.isRoot) {\n      return true;\n    }\n    if (this.componentTreeState.contextNodeReferences.has(contextNode)) {\n      let references = this.componentTreeState.contextNodeReferences.get(contextNode);\n      if (!references) {\n        return false;\n      }\n      return references > 0;\n    }\n    return false;\n  }\n\n  _resolveContextConsumerComponent(\n    componentType: Value,\n    reactElement: ObjectValue,\n    context: ObjectValue | AbstractObjectValue,\n    branchStatus: BranchStatusEnum,\n    evaluatedNode: ReactEvaluatedNode\n  ): Value | void {\n    let typeValue = getProperty(this.realm, reactElement, \"type\");\n    let propsValue = getProperty(this.realm, reactElement, \"props\");\n    let evaluatedChildNode = createReactEvaluatedNode(\"RENDER_PROPS\", \"Context.Consumer\");\n    evaluatedNode.children.push(evaluatedChildNode);\n\n    if (propsValue instanceof ObjectValue || propsValue instanceof AbstractObjectValue) {\n      // get the \"render\" prop child off the instance\n      if (propsValue instanceof ObjectValue && propsValue.properties.has(\"children\")) {\n        let renderProp = getProperty(this.realm, propsValue, \"children\");\n\n        this._findReactComponentTrees(\n          propsValue,\n          evaluatedChildNode,\n          \"NORMAL_FUNCTIONS\",\n          componentType,\n          context,\n          branchStatus\n        );\n        if (renderProp instanceof ECMAScriptSourceFunctionValue) {\n          if (typeValue instanceof ObjectValue || typeValue instanceof AbstractObjectValue) {\n            // make sure this context is in our tree\n            if (this._isContextValueKnown(typeValue)) {\n              let valueProp = Get(this.realm, typeValue, \"currentValue\");\n              // if the value is abstract, we need to keep the render prop as unless\n              // we are in firstRenderOnly mode, where we can just inline the abstract value\n              if (!(valueProp instanceof AbstractValue) || this.componentTreeConfig.firstRenderOnly) {\n                let result = getValueFromFunctionCall(this.realm, renderProp, this.realm.intrinsics.undefined, [\n                  valueProp,\n                ]);\n                this.statistics.inlinedComponents++;\n                this.statistics.componentsEvaluated++;\n                evaluatedChildNode.status = \"INLINED\";\n                return this._resolveDeeply(componentType, result, context, branchStatus, evaluatedNode);\n              }\n            }\n          }\n          this._evaluateNestedOptimizedFunctionAndStoreEffects(\n            componentType,\n            context,\n            branchStatus,\n            evaluatedChildNode,\n            renderProp\n          );\n          return;\n        } else {\n          this._findReactComponentTrees(\n            renderProp,\n            evaluatedChildNode,\n            \"NESTED_CLOSURES\",\n            componentType,\n            context,\n            branchStatus\n          );\n        }\n      }\n    }\n    this.componentTreeState.deadEnds++;\n    return;\n  }\n\n  _resolveForwardRefComponent(\n    componentType: Value,\n    reactElement: ObjectValue,\n    context: ObjectValue | AbstractObjectValue,\n    branchStatus: BranchStatusEnum,\n    evaluatedNode: ReactEvaluatedNode\n  ): Value | void {\n    let typeValue = getProperty(this.realm, reactElement, \"type\");\n    let propsValue = getProperty(this.realm, reactElement, \"props\");\n    let refValue = getProperty(this.realm, reactElement, \"ref\");\n    invariant(typeValue instanceof AbstractObjectValue || typeValue instanceof ObjectValue);\n    let forwardedComponent = getProperty(this.realm, typeValue, \"render\");\n    let evaluatedChildNode = createReactEvaluatedNode(\"FORWARD_REF\", getComponentName(this.realm, forwardedComponent));\n    evaluatedNode.children.push(evaluatedChildNode);\n    invariant(\n      forwardedComponent instanceof ECMAScriptSourceFunctionValue || forwardedComponent instanceof BoundFunctionValue,\n      \"expect React.forwardRef() to be passed function value\"\n    );\n    let value = getValueFromFunctionCall(this.realm, forwardedComponent, this.realm.intrinsics.undefined, [\n      propsValue,\n      refValue,\n    ]);\n    return this._resolveDeeply(componentType, value, context, branchStatus, evaluatedChildNode);\n  }\n\n  _resolveRelayQueryRendererComponent(\n    componentType: Value,\n    reactElement: ObjectValue,\n    context: ObjectValue | AbstractObjectValue,\n    branchStatus: BranchStatusEnum,\n    evaluatedNode: ReactEvaluatedNode\n  ): Value | void {\n    let typeValue = getProperty(this.realm, reactElement, \"type\");\n    let propsValue = getProperty(this.realm, reactElement, \"props\");\n\n    let evaluatedChildNode = createReactEvaluatedNode(\"RENDER_PROPS\", getComponentName(this.realm, typeValue));\n    evaluatedNode.children.push(evaluatedChildNode);\n\n    if (propsValue instanceof ObjectValue || propsValue instanceof AbstractObjectValue) {\n      // get the \"render\" prop\n      if (propsValue instanceof ObjectValue && propsValue.properties.has(\"render\")) {\n        let renderProp = getProperty(this.realm, propsValue, \"render\");\n\n        if (renderProp instanceof ECMAScriptSourceFunctionValue) {\n          this._evaluateNestedOptimizedFunctionAndStoreEffects(\n            componentType,\n            context,\n            branchStatus,\n            evaluatedChildNode,\n            renderProp\n          );\n        } else if (renderProp instanceof AbstractValue) {\n          this._findReactComponentTrees(\n            renderProp,\n            evaluatedChildNode,\n            \"NESTED_CLOSURES\",\n            componentType,\n            context,\n            branchStatus\n          );\n        }\n      }\n      this._findReactComponentTrees(\n        propsValue,\n        evaluatedChildNode,\n        \"NORMAL_FUNCTIONS\",\n        componentType,\n        context,\n        branchStatus\n      );\n      return;\n    }\n    // this is the worst case, we were unable to find the render prop function\n    // and won't be able to find any further components to evaluate as trees\n    // because of that\n    this.componentTreeState.deadEnds++;\n  }\n\n  _resolveClassComponent(\n    componentType: ECMAScriptSourceFunctionValue | BoundFunctionValue,\n    props: ObjectValue | AbstractObjectValue,\n    context: ObjectValue | AbstractObjectValue,\n    branchStatus: BranchStatusEnum,\n    evaluatedNode: ReactEvaluatedNode\n  ): Value {\n    let value;\n\n    let classMetadata = this._getClassComponentMetadata(componentType, props, context);\n    let { instanceProperties, instanceSymbols } = classMetadata;\n\n    // if there were no this assignments we can try and render it as a simple class component\n    if (instanceProperties.size === 0 && instanceSymbols.size === 0) {\n      // We first need to know what type of class component we're dealing with.\n      // A \"simple\" class component is defined as:\n      //\n      // - having only a \"render\" method\n      // - having no lifecycle events\n      // - having no state\n      // - having no instance variables\n      //\n      // the only things a class component should be able to access on \"this\" are:\n      // - this.props\n      // - this.context\n      // - this._someRenderMethodX() etc\n      //\n      // Otherwise, the class component is a \"complex\" one.\n      // To begin with, we don't know what type of component it is, so we try and render it as if it were\n      // a simple component using the above heuristics. If an error occurs during this process, we assume\n      // that the class wasn't simple, then try again with the \"complex\" heuristics.\n      try {\n        value = this._resolveSimpleClassComponent(componentType, props, context, branchStatus, evaluatedNode);\n      } catch (error) {\n        // if we get back a SimpleClassBailOut error, we know that this class component\n        // wasn't a simple one and is likely to be a complex class component instead\n        if (error instanceof SimpleClassBailOut) {\n          // the component was not simple, so we continue with complex case\n        } else {\n          // else we rethrow the error\n          throw error;\n        }\n      }\n    }\n    // handle the complex class component if there is not value\n    if (value === undefined) {\n      value = this._resolveComplexClassComponent(\n        componentType,\n        props,\n        context,\n        classMetadata,\n        branchStatus,\n        evaluatedNode\n      );\n    }\n    return value;\n  }\n\n  _resolveClassComponentForFirstRenderOnly(\n    componentType: ECMAScriptSourceFunctionValue | BoundFunctionValue,\n    props: ObjectValue | AbstractObjectValue,\n    context: ObjectValue | AbstractObjectValue,\n    branchStatus: BranchStatusEnum,\n    evaluatedNode: ReactEvaluatedNode\n  ): Value {\n    // create a new simple instance of this React class component\n    let instance = createClassInstanceForFirstRenderOnly(this.realm, componentType, props, context, evaluatedNode);\n    let getDerivedStateFromProps = Get(this.realm, componentType, \"getDerivedStateFromProps\");\n    let getSnapshotBeforeUpdate = Get(this.realm, instance, \"getSnapshotBeforeUpdate\");\n\n    // if either getDerivedStateFromProps or getSnapshotBeforeUpdate exist, then\n    // we don't try and execute componentWillMount and UNSAFE_componentWillMount\n    if (\n      getDerivedStateFromProps !== this.realm.intrinsics.undefined ||\n      getSnapshotBeforeUpdate !== this.realm.intrinsics.undefined\n    ) {\n      if (getDerivedStateFromProps instanceof ECMAScriptSourceFunctionValue && getDerivedStateFromProps.$Call) {\n        applyGetDerivedStateFromProps(this.realm, getDerivedStateFromProps, instance, props);\n      }\n    } else {\n      // get the \"componentWillMount\" and \"render\" methods off the instance\n      let componentWillMount = Get(this.realm, instance, \"componentWillMount\");\n\n      if (componentWillMount instanceof ECMAScriptSourceFunctionValue && componentWillMount.$Call) {\n        componentWillMount.$Call(instance, []);\n      }\n      let unsafeComponentWillMount = Get(this.realm, instance, \"UNSAFE_componentWillMount\");\n\n      if (unsafeComponentWillMount instanceof ECMAScriptSourceFunctionValue && unsafeComponentWillMount.$Call) {\n        unsafeComponentWillMount.$Call(instance, []);\n      }\n    }\n    let renderMethod = Get(this.realm, instance, \"render\");\n\n    invariant(renderMethod instanceof ECMAScriptSourceFunctionValue);\n    return getValueFromFunctionCall(this.realm, renderMethod, instance, []);\n  }\n\n  _resolveRelayContainer(\n    reactHint: ReactHint,\n    props: ObjectValue | AbstractObjectValue,\n    context: ObjectValue | AbstractObjectValue,\n    branchStatus: BranchStatusEnum,\n    evaluatedNode: ReactEvaluatedNode\n  ) {\n    evaluatedNode.status = \"INLINED\";\n    evaluatedNode.message = \"RelayContainer\";\n    invariant(reactHint.firstRenderValue instanceof Value);\n    // for better serialization, ensure context has the right abstract properties defined\n    if (getProperty(this.realm, context, \"relay\") === this.realm.intrinsics.undefined) {\n      let abstractRelayContext = AbstractValue.createAbstractObject(this.realm, \"context.relay\");\n      let abstractRelayEnvironment = AbstractValue.createAbstractObject(this.realm, \"context.relay.environment\");\n      let abstractRelayInternal = AbstractValue.createAbstractObject(\n        this.realm,\n        \"context.relay.environment.unstable_internal\"\n      );\n      Properties.Set(this.realm, context, \"relay\", abstractRelayContext, true);\n      Properties.Set(this.realm, abstractRelayContext, \"environment\", abstractRelayEnvironment, true);\n      Properties.Set(this.realm, abstractRelayEnvironment, \"unstable_internal\", abstractRelayInternal, true);\n    }\n    // add contextType to this component\n    this.componentTreeState.contextTypes.add(\"relay\");\n    return this._resolveComponent(reactHint.firstRenderValue, props, context, branchStatus, evaluatedNode);\n  }\n\n  _resolveComponent(\n    componentType: Value,\n    props: ObjectValue | AbstractObjectValue,\n    context: ObjectValue | AbstractObjectValue,\n    branchStatus: BranchStatusEnum,\n    evaluatedNode: ReactEvaluatedNode\n  ) {\n    if (doNotOptimizeComponent(this.realm, componentType)) {\n      throw new DoNotOptimize(\"__reactCompilerDoNotOptimize flag detected\");\n    }\n    this.statistics.componentsEvaluated++;\n    if (valueIsKnownReactAbstraction(this.realm, componentType)) {\n      invariant(componentType instanceof AbstractValue);\n      let reactHint = this.realm.react.abstractHints.get(componentType);\n\n      invariant(reactHint);\n      if (\n        typeof reactHint !== \"string\" &&\n        reactHint.object === this.realm.fbLibraries.reactRelay &&\n        this.componentTreeConfig.firstRenderOnly\n      ) {\n        return this._resolveRelayContainer(reactHint, props, context, branchStatus, evaluatedNode);\n      }\n      this._queueNewComponentTree(componentType, evaluatedNode);\n      evaluatedNode.status = \"NEW_TREE\";\n      evaluatedNode.message = \"RelayContainer\";\n      throw new NewComponentTreeBranch(evaluatedNode);\n    }\n    invariant(componentType instanceof ECMAScriptSourceFunctionValue || componentType instanceof BoundFunctionValue);\n    let value;\n    let childContext = context;\n\n    // first we check if it's a legacy class component\n    if (valueIsLegacyCreateClassComponent(this.realm, componentType)) {\n      throw new ExpectedBailOut(\"components created with create-react-class are not supported\");\n    } else if (valueIsClassComponent(this.realm, componentType)) {\n      if (this.componentTreeConfig.firstRenderOnly) {\n        value = this._resolveClassComponentForFirstRenderOnly(\n          componentType,\n          props,\n          context,\n          branchStatus,\n          evaluatedNode\n        );\n      } else {\n        value = this._resolveClassComponent(componentType, props, context, branchStatus, evaluatedNode);\n      }\n    } else {\n      value = this._resolveFunctionalComponent(componentType, props, context, evaluatedNode);\n      if (valueIsFactoryClassComponent(this.realm, value)) {\n        invariant(value instanceof ObjectValue);\n        if (branchStatus !== \"ROOT\") {\n          throw new ExpectedBailOut(\"non-root factory class components are not suppoted\");\n        } else {\n          // TODO support factory components\n          return {\n            result: value,\n            childContext,\n          };\n        }\n      }\n    }\n    invariant(value !== undefined);\n    return {\n      result: this._resolveDeeply(\n        componentType,\n        value,\n        context,\n        branchStatus === \"ROOT\" ? \"NO_BRANCH\" : branchStatus,\n        evaluatedNode\n      ),\n      childContext,\n    };\n  }\n\n  _createComponentTreeState(): ComponentTreeState {\n    return {\n      componentType: undefined,\n      contextTypes: new Set(),\n      deadEnds: 0,\n      status: \"SIMPLE\",\n      contextNodeReferences: new Map(),\n    };\n  }\n\n  _getComponentResolutionStrategy(value: Value): ComponentResolutionStrategy {\n    // check if it's a ReactRelay.QueryRenderer\n    if (this.realm.fbLibraries.reactRelay !== undefined) {\n      let QueryRenderer = getProperty(this.realm, this.realm.fbLibraries.reactRelay, \"QueryRenderer\");\n      if (value === QueryRenderer) {\n        return \"RELAY_QUERY_RENDERER\";\n      }\n    }\n    if (value === getReactSymbol(\"react.fragment\", this.realm)) {\n      return \"FRAGMENT\";\n    }\n    if ((value instanceof ObjectValue || value instanceof AbstractObjectValue) && value.kind !== \"conditional\") {\n      let $$typeof = getProperty(this.realm, value, \"$$typeof\");\n\n      if ($$typeof === getReactSymbol(\"react.context\", this.realm)) {\n        return \"CONTEXT_CONSUMER\";\n      }\n      if ($$typeof === getReactSymbol(\"react.provider\", this.realm)) {\n        return \"CONTEXT_PROVIDER\";\n      }\n      if ($$typeof === getReactSymbol(\"react.forward_ref\", this.realm)) {\n        return \"FORWARD_REF\";\n      }\n    }\n    return \"NORMAL\";\n  }\n\n  _resolveReactDomPortal(\n    createPortalNode: AbstractValue,\n    args: Array<Value>,\n    componentType: Value,\n    context: ObjectValue | AbstractObjectValue,\n    branchStatus: BranchStatusEnum,\n    evaluatedNode: ReactEvaluatedNode\n  ) {\n    let [reactPortalValue, domNodeValue] = args;\n    let evaluatedChildNode = createReactEvaluatedNode(\"INLINED\", \"ReactDOM.createPortal\");\n    let resolvedReactPortalValue = this._resolveDeeply(\n      componentType,\n      reactPortalValue,\n      context,\n      branchStatus,\n      evaluatedChildNode\n    );\n    evaluatedNode.children.push(evaluatedChildNode);\n    if (resolvedReactPortalValue !== reactPortalValue) {\n      this.statistics.inlinedComponents++;\n      let reactDomValue = this.realm.fbLibraries.reactDom;\n      invariant(reactDomValue instanceof ObjectValue);\n      let reactDomPortalFunc = getProperty(this.realm, reactDomValue, \"createPortal\");\n      return AbstractValue.createTemporalFromBuildFunction(\n        this.realm,\n        ObjectValue,\n        [reactDomPortalFunc, resolvedReactPortalValue, domNodeValue],\n        createOperationDescriptor(\"REACT_TEMPORAL_FUNC\"),\n        { skipInvariant: true, isPure: true }\n      );\n    }\n    return createPortalNode;\n  }\n\n  _resolveAbstractConditionalValue(\n    componentType: Value,\n    condValue: AbstractValue,\n    consequentVal: Value,\n    alternateVal: Value,\n    context: ObjectValue | AbstractObjectValue,\n    evaluatedNode: ReactEvaluatedNode\n  ) {\n    let value = this.realm.evaluateWithAbstractConditional(\n      condValue,\n      () => {\n        return this.realm.evaluateForEffects(\n          () =>\n            wrapReactElementInBranchOrReturnValue(\n              this.realm,\n              this._resolveDeeply(componentType, consequentVal, context, \"NEW_BRANCH\", evaluatedNode)\n            ),\n          null,\n          \"_resolveAbstractConditionalValue consequent\"\n        );\n      },\n      () => {\n        return this.realm.evaluateForEffects(\n          () =>\n            wrapReactElementInBranchOrReturnValue(\n              this.realm,\n              this._resolveDeeply(componentType, alternateVal, context, \"NEW_BRANCH\", evaluatedNode)\n            ),\n          null,\n          \"_resolveAbstractConditionalValue alternate\"\n        );\n      }\n    );\n    if (value instanceof AbstractValue && value.kind === \"conditional\") {\n      return getValueWithBranchingLogicApplied(this.realm, consequentVal, alternateVal, value);\n    }\n    return value;\n  }\n\n  _resolveAbstractLogicalValue(\n    componentType: Value,\n    value: AbstractValue,\n    context: ObjectValue | AbstractObjectValue,\n    evaluatedNode: ReactEvaluatedNode\n  ) {\n    let [leftValue, rightValue] = value.args;\n    let operator = value.kind;\n\n    invariant(leftValue instanceof AbstractValue);\n    if (operator === \"||\") {\n      return this._resolveAbstractConditionalValue(\n        componentType,\n        leftValue,\n        leftValue,\n        rightValue,\n        context,\n        evaluatedNode\n      );\n    } else {\n      return this._resolveAbstractConditionalValue(\n        componentType,\n        leftValue,\n        rightValue,\n        leftValue,\n        context,\n        evaluatedNode\n      );\n    }\n  }\n\n  _resolveAbstractValue(\n    componentType: Value,\n    value: AbstractValue,\n    context: ObjectValue | AbstractObjectValue,\n    branchStatus: BranchStatusEnum,\n    evaluatedNode: ReactEvaluatedNode\n  ): Value {\n    invariant(this.realm.generator);\n    // TODO investigate what other kinds than \"conditional\" might be safe to deeply resolve\n    if (value.kind === \"conditional\") {\n      let [condValue, consequentVal, alternateVal] = value.args;\n      invariant(condValue instanceof AbstractValue);\n      return this._resolveAbstractConditionalValue(\n        componentType,\n        condValue,\n        consequentVal,\n        alternateVal,\n        context,\n        evaluatedNode\n      );\n    } else if (value.kind === \"||\" || value.kind === \"&&\") {\n      return this._resolveAbstractLogicalValue(componentType, value, context, evaluatedNode);\n    } else {\n      if (value instanceof AbstractValue && this.realm.react.abstractHints.has(value)) {\n        let reactHint = this.realm.react.abstractHints.get(value);\n\n        invariant(reactHint !== undefined);\n        if (reactHint.object === this.realm.fbLibraries.reactDom && reactHint.propertyName === \"createPortal\") {\n          return this._resolveReactDomPortal(\n            value,\n            reactHint.args,\n            componentType,\n            context,\n            branchStatus,\n            evaluatedNode\n          );\n        }\n      }\n      this.componentTreeState.deadEnds++;\n    }\n    return value;\n  }\n\n  _resolveUnknownComponentType(\n    componentType: Value,\n    reactElement: ObjectValue,\n    context: ObjectValue | AbstractObjectValue,\n    branchStatus: BranchStatusEnum,\n    evaluatedNode: ReactEvaluatedNode\n  ): ObjectValue {\n    let typeValue = getProperty(this.realm, reactElement, \"type\");\n    let propsValue = getProperty(this.realm, reactElement, \"props\");\n\n    this._findReactComponentTrees(propsValue, evaluatedNode, \"NORMAL_FUNCTIONS\", componentType, context, branchStatus);\n    if (typeValue instanceof AbstractValue) {\n      this._findReactComponentTrees(\n        typeValue,\n        evaluatedNode,\n        \"FUNCTIONAL_COMPONENTS\",\n        componentType,\n        context,\n        branchStatus\n      );\n      return reactElement;\n    } else {\n      let evaluatedChildNode = createReactEvaluatedNode(\"BAIL-OUT\", getComponentName(this.realm, typeValue));\n      evaluatedNode.children.push(evaluatedChildNode);\n      let bailOutMessage = `type on <Component /> was not a ECMAScriptSourceFunctionValue`;\n      evaluatedChildNode.message = bailOutMessage;\n      this._assignBailOutMessage(reactElement, bailOutMessage);\n      this.componentTreeState.deadEnds++;\n      return reactElement;\n    }\n  }\n\n  _resolveReactElementBadRef(\n    componentType: Value,\n    reactElement: ObjectValue,\n    context: ObjectValue | AbstractObjectValue,\n    branchStatus: BranchStatusEnum,\n    evaluatedNode: ReactEvaluatedNode\n  ): ObjectValue {\n    let typeValue = getProperty(this.realm, reactElement, \"type\");\n    let propsValue = getProperty(this.realm, reactElement, \"props\");\n\n    let evaluatedChildNode = createReactEvaluatedNode(\"BAIL-OUT\", getComponentName(this.realm, typeValue));\n    evaluatedNode.children.push(evaluatedChildNode);\n    let bailOutMessage = `refs are not supported on <Components />`;\n    evaluatedChildNode.message = bailOutMessage;\n\n    this._queueNewComponentTree(typeValue, evaluatedChildNode);\n    this._findReactComponentTrees(propsValue, evaluatedNode, \"NORMAL_FUNCTIONS\", componentType, context, branchStatus);\n    this._assignBailOutMessage(reactElement, bailOutMessage);\n    return reactElement;\n  }\n\n  _resolveReactElementUndefinedRender(\n    componentType: Value,\n    reactElement: ObjectValue,\n    context: ObjectValue | AbstractObjectValue,\n    branchStatus: BranchStatusEnum,\n    evaluatedNode: ReactEvaluatedNode\n  ): ObjectValue {\n    let typeValue = getProperty(this.realm, reactElement, \"type\");\n    let propsValue = getProperty(this.realm, reactElement, \"props\");\n\n    let evaluatedChildNode = createReactEvaluatedNode(\"BAIL-OUT\", getComponentName(this.realm, typeValue));\n    evaluatedNode.children.push(evaluatedChildNode);\n    let bailOutMessage = `undefined was returned from render`;\n    evaluatedChildNode.message = bailOutMessage;\n\n    this._assignBailOutMessage(reactElement, bailOutMessage);\n    this._findReactComponentTrees(propsValue, evaluatedNode, \"NORMAL_FUNCTIONS\", componentType, context, branchStatus);\n    return reactElement;\n  }\n\n  _resolveReactElementHostChildren(\n    componentType: Value,\n    reactElement: ObjectValue,\n    context: ObjectValue | AbstractObjectValue,\n    branchStatus: BranchStatusEnum,\n    evaluatedNode: ReactEvaluatedNode\n  ): ObjectValue {\n    let propsValue = getProperty(this.realm, reactElement, \"props\");\n    // terminal host component. Start evaluating its children.\n    if (propsValue instanceof ObjectValue && propsValue.properties.has(\"children\")) {\n      let childrenValue = Get(this.realm, propsValue, \"children\");\n\n      if (childrenValue instanceof Value) {\n        let resolvedChildren = this._resolveDeeply(\n          componentType,\n          childrenValue,\n          context,\n          branchStatus,\n          evaluatedNode,\n          false\n        );\n        // we can optimize further and flatten arrays on non-composite components\n        if (resolvedChildren instanceof ArrayValue && !resolvedChildren.intrinsicName) {\n          resolvedChildren = flattenChildren(this.realm, resolvedChildren, true);\n        }\n        if (resolvedChildren !== childrenValue) {\n          let newProps = cloneProps(this.realm, propsValue, resolvedChildren);\n\n          // This is safe to do as we clone a new ReactElement as part of reconcilation\n          // so we will never be mutating an object used by something else. Furthermore,\n          // the ReactElement is \"immutable\" so it can never change and only React controls\n          // this object.\n          hardModifyReactObjectPropertyBinding(this.realm, reactElement, \"props\", newProps);\n        }\n      }\n    }\n    return reactElement;\n  }\n\n  _resolveFragmentComponent(\n    componentType: Value,\n    reactElement: ObjectValue,\n    context: ObjectValue | AbstractObjectValue,\n    branchStatus: BranchStatusEnum,\n    evaluatedNode: ReactEvaluatedNode\n  ): ObjectValue {\n    this.statistics.componentsEvaluated++;\n    if (this.componentTreeConfig.firstRenderOnly) {\n      let evaluatedChildNode = createReactEvaluatedNode(\"INLINED\", \"React.Fragment\");\n      evaluatedNode.children.push(evaluatedChildNode);\n      this.statistics.inlinedComponents++;\n      let children = this._resolveReactElementHostChildren(\n        componentType,\n        reactElement,\n        context,\n        branchStatus,\n        evaluatedChildNode\n      );\n      return children;\n    } else {\n      let evaluatedChildNode = createReactEvaluatedNode(\"NORMAL\", \"React.Fragment\");\n      evaluatedNode.children.push(evaluatedChildNode);\n      return this._resolveReactElementHostChildren(\n        componentType,\n        reactElement,\n        context,\n        branchStatus,\n        evaluatedChildNode\n      );\n    }\n  }\n\n  _resolveReactElement(\n    componentType: Value,\n    reactElement: ObjectValue,\n    context: ObjectValue | AbstractObjectValue,\n    branchStatus: BranchStatusEnum,\n    evaluatedNode: ReactEvaluatedNode,\n    needsKey?: boolean\n  ) {\n    // We create a clone of the ReactElement to be safe. This is because the same\n    // ReactElement might be a temporal referenced in other effects and also it allows us to\n    // easily mutate and swap the props of the ReactElement with the optimized version with\n    // resolved/inlined children.\n    // Note: We used to sanitize out props for firstRender here, we now do this during serialization.\n    reactElement = cloneReactElement(this.realm, reactElement, false);\n    let typeValue = getProperty(this.realm, reactElement, \"type\");\n    let propsValue = getProperty(this.realm, reactElement, \"props\");\n    let refValue = getProperty(this.realm, reactElement, \"ref\");\n    let keyValue = getProperty(this.realm, reactElement, \"key\");\n\n    invariant(\n      !(typeValue instanceof AbstractValue && typeValue.kind === \"conditional\"),\n      `the reconciler should never encounter a ReactElement \"type\" that is conditional abstract value`\n    );\n    invariant(\n      !(propsValue instanceof AbstractValue && propsValue.kind === \"conditional\"),\n      `the reconciler should never encounter a ReactElement \"props\" that is conditional abstract value`\n    );\n\n    if (typeValue instanceof StringValue) {\n      return this._resolveReactElementHostChildren(componentType, reactElement, context, branchStatus, evaluatedNode);\n    }\n    if (!(propsValue instanceof ObjectValue || propsValue instanceof AbstractObjectValue)) {\n      this._assignBailOutMessage(\n        reactElement,\n        `props on <Component /> was not not an ObjectValue or an AbstractObjectValue`\n      );\n      return reactElement;\n    }\n\n    let componentResolutionStrategy = this._getComponentResolutionStrategy(typeValue);\n\n    // We do not support \"ref\" on <Component /> ReactElements, unless it's a forwarded ref\n    // or we are firstRenderOnly mode (in which case, we ignore the ref)\n    if (\n      !this.componentTreeConfig.firstRenderOnly &&\n      !(refValue instanceof NullValue) &&\n      componentResolutionStrategy !== \"FORWARD_REF\" &&\n      // If we have an abstract value, it might mean a bad ref, but we will have\n      // already thrown a FatalError in the createElement implementation by this\n      // point, so if we're here, then the FatalError has been recovered explicitly\n      !(refValue instanceof AbstractValue)\n    ) {\n      this._resolveReactElementBadRef(componentType, reactElement, context, branchStatus, evaluatedNode);\n    }\n\n    try {\n      let result;\n\n      switch (componentResolutionStrategy) {\n        case \"NORMAL\": {\n          if (\n            !(\n              typeValue instanceof ECMAScriptSourceFunctionValue ||\n              typeValue instanceof BoundFunctionValue ||\n              valueIsKnownReactAbstraction(this.realm, typeValue)\n            )\n          ) {\n            return this._resolveUnknownComponentType(componentType, reactElement, context, branchStatus, evaluatedNode);\n          }\n          let evaluatedChildNode = createReactEvaluatedNode(\"INLINED\", getComponentName(this.realm, typeValue));\n          let render = this._resolveComponent(\n            typeValue,\n            propsValue,\n            context,\n            branchStatus === \"NEW_BRANCH\" ? \"BRANCH\" : branchStatus,\n            evaluatedChildNode\n          );\n          if (this.logger !== undefined && this.realm.react.verbose && evaluatedChildNode.status === \"INLINED\") {\n            this.logger.logInformation(`    ✔ ${evaluatedChildNode.name} (inlined)`);\n          }\n          evaluatedNode.children.push(evaluatedChildNode);\n          result = render.result;\n          this.statistics.inlinedComponents++;\n          break;\n        }\n        case \"FRAGMENT\": {\n          result = this._resolveFragmentComponent(componentType, reactElement, context, branchStatus, evaluatedNode);\n          break;\n        }\n        case \"RELAY_QUERY_RENDERER\": {\n          invariant(typeValue instanceof AbstractObjectValue);\n          result = this._resolveRelayQueryRendererComponent(\n            componentType,\n            reactElement,\n            context,\n            branchStatus,\n            evaluatedNode\n          );\n          break;\n        }\n        case \"CONTEXT_PROVIDER\": {\n          result = this._resolveContextProviderComponent(\n            componentType,\n            reactElement,\n            context,\n            branchStatus,\n            evaluatedNode\n          );\n          break;\n        }\n        case \"CONTEXT_CONSUMER\": {\n          result = this._resolveContextConsumerComponent(\n            componentType,\n            reactElement,\n            context,\n            branchStatus,\n            evaluatedNode\n          );\n          break;\n        }\n        case \"FORWARD_REF\": {\n          result = this._resolveForwardRefComponent(componentType, reactElement, context, branchStatus, evaluatedNode);\n          break;\n        }\n        default:\n          invariant(false, \"unsupported component resolution strategy\");\n      }\n\n      if (result === undefined) {\n        result = reactElement;\n      }\n\n      if (result instanceof UndefinedValue) {\n        return this._resolveReactElementUndefinedRender(\n          componentType,\n          reactElement,\n          context,\n          branchStatus,\n          evaluatedNode\n        );\n      }\n\n      // If we have a new result and we might have a key value then wrap our inlined result in a\n      // `<React.Fragment key={keyValue}>` so that we may maintain the key.\n      if (!this.componentTreeConfig.firstRenderOnly && needsKey && keyValue.mightNotBeNull()) {\n        result = wrapReactElementWithKeyedFragment(this.realm, keyValue, result);\n      }\n\n      return result;\n    } catch (error) {\n      if (error instanceof AbruptCompletion) throw error;\n      return this._resolveComponentResolutionFailure(\n        componentType,\n        error,\n        reactElement,\n        context,\n        evaluatedNode,\n        branchStatus\n      );\n    }\n  }\n\n  _handleComponentTreeRootFailure(error: Error, evaluatedRootNode: ReactEvaluatedNode): void {\n    if (error.name === \"Invariant Violation\") {\n      throw error;\n    } else if (error instanceof ReconcilerFatalError) {\n      throw new ReconcilerFatalError(error.message, evaluatedRootNode);\n    } else if (error instanceof UnsupportedSideEffect || error instanceof DoNotOptimize) {\n      throw new ReconcilerFatalError(\n        `Failed to render React component root \"${evaluatedRootNode.name}\" due to ${error.message}`,\n        evaluatedRootNode\n      );\n    }\n    let message;\n    if (error instanceof ExpectedBailOut) {\n      message = `Failed to optimize React component tree for \"${evaluatedRootNode.name}\" due to an expected bail-out: ${\n        error.message\n      }`;\n    } else if (error instanceof FatalError) {\n      message = `Failed to optimize React component tree for \"${\n        evaluatedRootNode.name\n      }\" due to a fatal error during evaluation: ${error.message}`;\n    } else {\n      // if we don't know what the error is, then best to rethrow\n      throw error;\n    }\n    throw new ReconcilerFatalError(message, evaluatedRootNode);\n  }\n\n  _resolveComponentResolutionFailure(\n    componentType: Value,\n    error: Error,\n    reactElement: ObjectValue,\n    context: ObjectValue | AbstractObjectValue,\n    evaluatedNode: ReactEvaluatedNode,\n    branchStatus: BranchStatusEnum\n  ): Value {\n    if (error.name === \"Invariant Violation\") {\n      throw error;\n    } else if (error instanceof ReconcilerFatalError) {\n      throw error;\n    } else if (error instanceof UnsupportedSideEffect) {\n      throw new ReconcilerFatalError(\n        `Failed to render React component \"${evaluatedNode.name}\" due to ${error.message}`,\n        evaluatedNode\n      );\n    } else if (error instanceof DoNotOptimize) {\n      return reactElement;\n    }\n    let typeValue = getProperty(this.realm, reactElement, \"type\");\n    let propsValue = getProperty(this.realm, reactElement, \"props\");\n    // assign a bail out message\n    if (error instanceof NewComponentTreeBranch) {\n      this._findReactComponentTrees(\n        propsValue,\n        evaluatedNode,\n        \"NORMAL_FUNCTIONS\",\n        componentType,\n        context,\n        branchStatus\n      );\n      evaluatedNode.children.push(error.evaluatedNode);\n      // NO-OP (we don't queue a newComponentTree as this was already done)\n    } else {\n      let evaluatedChildNode = createReactEvaluatedNode(\"BAIL-OUT\", getComponentName(this.realm, typeValue));\n      if (this.logger !== undefined && this.realm.react.verbose) {\n        this.logger.logInformation(`    ✖ ${evaluatedChildNode.name} (bail-out)`);\n      }\n      evaluatedNode.children.push(evaluatedChildNode);\n      this._queueNewComponentTree(typeValue, evaluatedChildNode);\n      this._findReactComponentTrees(\n        propsValue,\n        evaluatedNode,\n        \"NORMAL_FUNCTIONS\",\n        componentType,\n        context,\n        branchStatus\n      );\n      if (error instanceof ExpectedBailOut) {\n        evaluatedChildNode.message = error.message;\n        this._assignBailOutMessage(reactElement, error.message);\n      } else if (error instanceof FatalError) {\n        let message = \"evaluation failed\";\n        evaluatedChildNode.message = message;\n        this._assignBailOutMessage(reactElement, message);\n      } else {\n        evaluatedChildNode.message = `unknown error`;\n        throw error;\n      }\n    }\n    // a child component bailed out during component folding, so return the function value and continue\n    return reactElement;\n  }\n\n  _resolveDeeply(\n    componentType: Value,\n    value: Value,\n    context: ObjectValue | AbstractObjectValue,\n    branchStatus: BranchStatusEnum,\n    evaluatedNode: ReactEvaluatedNode,\n    needsKey?: boolean\n  ): Value {\n    if (\n      value instanceof StringValue ||\n      value instanceof NumberValue ||\n      value instanceof BooleanValue ||\n      value instanceof NullValue ||\n      value instanceof UndefinedValue\n    ) {\n      // terminal values\n      return value;\n    }\n    invariant(\n      !(value instanceof ObjectValue) || value._isFinal !== undefined,\n      `An object value was detected during React reconcilation without its bindings properly applied`\n    );\n    if (value instanceof AbstractValue) {\n      return this._resolveAbstractValue(componentType, value, context, branchStatus, evaluatedNode);\n    } else if (value instanceof ArrayValue) {\n      // TODO investigate what about other iterables type objects\n      return this._resolveArray(componentType, value, context, branchStatus, evaluatedNode, needsKey);\n    } else if (value instanceof ObjectValue && isReactElement(value)) {\n      return this._resolveReactElement(componentType, value, context, branchStatus, evaluatedNode, needsKey);\n    }\n    // This value is not a valid return value of a render, but given we might be\n    // in a \"&&\"\" condition, it may never result in a runtime error. Still, if it does\n    // result in a runtime error, it would have been the same error before compilation.\n    // See issue #2497 for more context.\n    return value;\n  }\n\n  _assignBailOutMessage(reactElement: ObjectValue, message: string): void {\n    // $BailOutReason is a field on ObjectValue that allows us to specify a message\n    // that gets serialized as a comment node during the ReactElement serialization stage\n    message = `Bail-out: ${message}`;\n    if (reactElement.$BailOutReason !== undefined) {\n      // merge bail out messages if one already exists\n      reactElement.$BailOutReason += `, ${message}`;\n    } else {\n      reactElement.$BailOutReason = message;\n    }\n  }\n\n  _resolveArray(\n    componentType: Value,\n    arrayValue: ArrayValue,\n    context: ObjectValue | AbstractObjectValue,\n    branchStatus: BranchStatusEnum,\n    evaluatedNode: ReactEvaluatedNode,\n    needsKey?: boolean\n  ): ArrayValue {\n    invariant(this.realm.isInPureScope());\n    if (ArrayValue.isIntrinsicAndHasWidenedNumericProperty(arrayValue)) {\n      let nestedOptimizedFunctionEffects = arrayValue.nestedOptimizedFunctionEffects;\n\n      if (nestedOptimizedFunctionEffects !== undefined) {\n        for (let [func, effects] of nestedOptimizedFunctionEffects) {\n          let funcCall = () => {\n            let result = effects.result;\n            this.realm.applyEffects(effects);\n            if (result instanceof SimpleNormalCompletion) {\n              result = result.value;\n            } else {\n              invariant(false, \"TODO support other types of completion\");\n            }\n            invariant(result instanceof Value);\n            return this._resolveDeeply(componentType, result, context, branchStatus, evaluatedNode, needsKey);\n          };\n\n          let resolvedEffects = this.realm.evaluateFunctionForPureEffects(\n            func,\n            funcCall,\n            /*state*/ null,\n            `react resolve nested optimized closure`,\n            (sideEffectType, binding, expressionLocation) =>\n              handleReportedSideEffect(throwUnsupportedSideEffectError, sideEffectType, binding, expressionLocation)\n          );\n          this.statistics.optimizedNestedClosures++;\n          nestedOptimizedFunctionEffects.set(func, resolvedEffects);\n          this.realm.collectedNestedOptimizedFunctionEffects.set(func, resolvedEffects);\n        }\n      }\n      return arrayValue;\n    }\n    if (needsKey !== false) needsKey = true;\n    let children = mapArrayValue(this.realm, arrayValue, elementValue =>\n      this._resolveDeeply(componentType, elementValue, context, \"NEW_BRANCH\", evaluatedNode, needsKey)\n    );\n    children.makeFinal();\n    return children;\n  }\n\n  _findReactComponentTrees(\n    value: Value,\n    evaluatedNode: ReactEvaluatedNode,\n    treatFunctionsAs: \"NORMAL_FUNCTIONS\" | \"NESTED_CLOSURES\" | \"FUNCTIONAL_COMPONENTS\",\n    componentType?: Value,\n    context?: ObjectValue | AbstractObjectValue,\n    branchStatus: BranchStatusEnum\n  ): void {\n    if (value instanceof AbstractValue) {\n      if (value.args.length > 0) {\n        for (let arg of value.args) {\n          this._findReactComponentTrees(arg, evaluatedNode, treatFunctionsAs, componentType, context, branchStatus);\n        }\n      } else {\n        this.componentTreeState.deadEnds++;\n      }\n    } else if (valueIsKnownReactAbstraction(this.realm, value)) {\n      let evaluatedChildNode = createReactEvaluatedNode(\"NEW_TREE\", getComponentName(this.realm, value));\n      evaluatedNode.children.push(evaluatedChildNode);\n      this._queueNewComponentTree(value, evaluatedChildNode);\n    } else if (value instanceof ECMAScriptSourceFunctionValue || value instanceof BoundFunctionValue) {\n      if (valueIsClassComponent(this.realm, value) || treatFunctionsAs === \"FUNCTIONAL_COMPONENTS\") {\n        let evaluatedChildNode = createReactEvaluatedNode(\"NEW_TREE\", getComponentName(this.realm, value));\n        evaluatedNode.children.push(evaluatedChildNode);\n        this._queueNewComponentTree(value, evaluatedChildNode);\n      } else if (treatFunctionsAs === \"NESTED_CLOSURES\") {\n        invariant(componentType && context);\n        let evaluatedChildNode = createReactEvaluatedNode(\"RENDER_PROPS\", getComponentName(this.realm, value));\n        this._evaluateNestedOptimizedFunctionAndStoreEffects(\n          componentType,\n          context,\n          branchStatus,\n          evaluatedChildNode,\n          value\n        );\n      }\n    } else if (value instanceof ObjectValue) {\n      if (isReactElement(value)) {\n        let typeValue = getProperty(this.realm, value, \"type\");\n        let ref = getProperty(this.realm, value, \"ref\");\n        let props = getProperty(this.realm, value, \"props\");\n\n        if (valueIsKnownReactAbstraction(this.realm, typeValue) || typeValue instanceof ECMAScriptSourceFunctionValue) {\n          let evaluatedChildNode = createReactEvaluatedNode(\"NEW_TREE\", getComponentName(this.realm, typeValue));\n          evaluatedNode.children.push(evaluatedChildNode);\n          this._queueNewComponentTree(typeValue, evaluatedChildNode);\n        }\n        this._findReactComponentTrees(ref, evaluatedNode, treatFunctionsAs, componentType, context, branchStatus);\n        this._findReactComponentTrees(props, evaluatedNode, treatFunctionsAs, componentType, context, branchStatus);\n      } else {\n        for (let [propName, binding] of value.properties) {\n          if (binding && binding.descriptor) {\n            invariant(binding.descriptor instanceof PropertyDescriptor);\n            if (binding.descriptor.enumerable) {\n              this._findReactComponentTrees(\n                getProperty(this.realm, value, propName),\n                evaluatedNode,\n                treatFunctionsAs,\n                componentType,\n                context,\n                branchStatus\n              );\n            }\n          }\n        }\n      }\n    }\n  }\n\n  _evaluateNestedOptimizedFunctionAndStoreEffects(\n    componentType: Value,\n    context: ObjectValue | AbstractObjectValue,\n    branchStatus: BranchStatusEnum,\n    evaluatedNode: ReactEvaluatedNode,\n    func: ECMAScriptSourceFunctionValue | BoundFunctionValue,\n    thisValue?: Value = this.realm.intrinsics.undefined\n  ): void {\n    if (!this.realm.react.optimizeNestedFunctions) {\n      return;\n    }\n    let funcToModel = func;\n    if (func instanceof BoundFunctionValue) {\n      funcToModel = func.$BoundTargetFunction;\n      thisValue = func.$BoundThis;\n    }\n    invariant(this.realm.isInPureScope());\n    invariant(funcToModel instanceof ECMAScriptSourceFunctionValue);\n    let funcCall = Utils.createModelledFunctionCall(this.realm, funcToModel, undefined, thisValue);\n    // We take the modelled function and wrap it in a pure evaluation so we can check for\n    // side-effects that occur when evaluating the function. If there are side-effects, then\n    // we don't try and optimize the nested function.\n    let effects;\n    try {\n      effects = this.realm.evaluateFunctionForPureEffects(\n        func,\n        () => {\n          let result = funcCall();\n          return this._resolveDeeply(componentType, result, context, branchStatus, evaluatedNode, false);\n        },\n        null,\n        \"React nestedOptimizedFunction\",\n        () => {\n          throw new NestedOptimizedFunctionSideEffect();\n        }\n      );\n    } catch (e) {\n      // If the nested optimized function had side-effects, we need to fallback to\n      // the default behaviour and leak the nested functions so any bindings\n      // within the function properly leak and materialize.\n      if (e instanceof NestedOptimizedFunctionSideEffect) {\n        Leak.value(this.realm, func);\n        return;\n      }\n      throw e;\n    }\n    this.statistics.optimizedNestedClosures++;\n    this.realm.collectedNestedOptimizedFunctionEffects.set(funcToModel, effects);\n  }\n}\n"
  },
  {
    "path": "src/react/utils.js",
    "content": "/**\n * Copyright (c) 2017-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n/* @flow */\n\nimport { Realm } from \"../realm.js\";\nimport { AbruptCompletion, SimpleNormalCompletion } from \"../completions.js\";\nimport type { BabelNode, BabelNodeJSXIdentifier } from \"@babel/types\";\nimport { parseExpression } from \"@babel/parser\";\nimport {\n  AbstractObjectValue,\n  AbstractValue,\n  ArrayValue,\n  BooleanValue,\n  BoundFunctionValue,\n  ECMAScriptFunctionValue,\n  ECMAScriptSourceFunctionValue,\n  EmptyValue,\n  FunctionValue,\n  NumberValue,\n  ObjectValue,\n  StringValue,\n  SymbolValue,\n  UndefinedValue,\n  Value,\n} from \"../values/index.js\";\nimport { TemporalObjectAssignEntry } from \"../utils/generator.js\";\nimport type { Descriptor, ReactComponentTreeConfig, ReactHint, PropertyBinding } from \"../types.js\";\nimport { Get, IsDataDescriptor } from \"../methods/index.js\";\nimport { computeBinary } from \"../evaluators/BinaryExpression.js\";\nimport type { AdditionalFunctionTransform, ReactEvaluatedNode } from \"../serializer/types.js\";\nimport invariant from \"../invariant.js\";\nimport { Create, Properties, To } from \"../singletons.js\";\nimport traverse from \"@babel/traverse\";\nimport * as t from \"@babel/types\";\nimport type { BabelNodeStatement } from \"@babel/types\";\nimport { CompilerDiagnostic, FatalError } from \"../errors.js\";\nimport { cloneDescriptor, PropertyDescriptor } from \"../descriptors.js\";\n\nexport type ReactSymbolTypes =\n  | \"react.element\"\n  | \"react.context\"\n  | \"react.provider\"\n  | \"react.fragment\"\n  | \"react.portal\"\n  | \"react.return\"\n  | \"react.call\"\n  | \"react.forward_ref\";\n\nexport function isReactElement(val: Value): boolean {\n  if (!(val instanceof ObjectValue)) {\n    return false;\n  }\n  let realm = val.$Realm;\n  if (!realm.react.enabled) {\n    return false;\n  }\n  if (realm.react.reactElements.has(val)) {\n    return true;\n  }\n  if (!val.properties.has(\"type\") || !val.properties.has(\"props\") || !val.properties.has(\"$$typeof\")) {\n    return false;\n  }\n  let $$typeof = getProperty(realm, val, \"$$typeof\");\n  let globalObject = realm.$GlobalObject;\n  let globalSymbolValue = getProperty(realm, globalObject, \"Symbol\");\n\n  if (globalSymbolValue === realm.intrinsics.undefined) {\n    if ($$typeof instanceof NumberValue) {\n      return $$typeof.value === 0xeac7;\n    }\n  } else if ($$typeof instanceof SymbolValue) {\n    let symbolFromRegistry = realm.globalSymbolRegistry.find(e => e.$Symbol === $$typeof);\n    let _isReactElement = symbolFromRegistry !== undefined && symbolFromRegistry.$Key === \"react.element\";\n    if (_isReactElement) {\n      // If we get there, it means the ReactElement was created in manual user-space\n      realm.react.reactElements.set(val, { createdDuringReconcilation: false, firstRenderOnly: false });\n      return true;\n    }\n  }\n  return false;\n}\n\nexport function isReactPropsObject(val: Value): boolean {\n  if (!(val instanceof ObjectValue)) {\n    return false;\n  }\n  let realm = val.$Realm;\n  if (!realm.react.enabled) {\n    return false;\n  }\n  if (realm.react.reactProps.has(val)) {\n    return true;\n  }\n  return false;\n}\n\nexport function getReactSymbol(symbolKey: ReactSymbolTypes, realm: Realm): SymbolValue {\n  let reactSymbol = realm.react.symbols.get(symbolKey);\n  if (reactSymbol !== undefined) {\n    return reactSymbol;\n  }\n  let SymbolFor = realm.intrinsics.Symbol.properties.get(\"for\");\n  if (SymbolFor !== undefined) {\n    let SymbolForDescriptor = SymbolFor.descriptor;\n\n    if (SymbolForDescriptor !== undefined) {\n      invariant(SymbolForDescriptor instanceof PropertyDescriptor);\n      let SymbolForValue = SymbolForDescriptor.value;\n      if (SymbolForValue instanceof ObjectValue && typeof SymbolForValue.$Call === \"function\") {\n        reactSymbol = SymbolForValue.$Call(realm.intrinsics.Symbol, [new StringValue(realm, symbolKey)]);\n        invariant(reactSymbol instanceof SymbolValue);\n        realm.react.symbols.set(symbolKey, reactSymbol);\n      }\n    }\n  }\n  invariant(reactSymbol instanceof SymbolValue, `Symbol(\"${symbolKey}\") could not be found in realm`);\n  return reactSymbol;\n}\n\nexport function isTagName(ast: BabelNode): boolean {\n  return ast.type === \"JSXIdentifier\" && /^[a-z]|\\-/.test(((ast: any): BabelNodeJSXIdentifier).name);\n}\n\nexport function isReactComponent(name: string): boolean {\n  return name.length > 0 && name[0] === name[0].toUpperCase();\n}\n\nexport function valueIsClassComponent(realm: Realm, value: Value): boolean {\n  if (!(value instanceof FunctionValue)) {\n    return false;\n  }\n  let prototype = Get(realm, value, \"prototype\");\n\n  if (prototype instanceof ObjectValue) {\n    return To.ToBooleanPartial(realm, Get(realm, prototype, \"isReactComponent\"));\n  }\n  return false;\n}\n\nexport function valueIsKnownReactAbstraction(realm: Realm, value: Value): boolean {\n  return value instanceof AbstractObjectValue && realm.react.abstractHints.has(value);\n}\n\n// logger isn't typed otherwise it will increase flow cycle length :()\nexport function valueIsReactLibraryObject(realm: Realm, value: ObjectValue, logger: any): boolean {\n  if (realm.fbLibraries.react === value) {\n    return true;\n  }\n  // we check that the object is the React or React-like library by checking for\n  // core properties that should exist on it\n  let reactVersion = logger.tryQuery(() => Get(realm, value, \"version\"), undefined);\n  if (!(reactVersion instanceof StringValue)) {\n    return false;\n  }\n  let reactCreateElement = logger.tryQuery(() => Get(realm, value, \"createElement\"), undefined);\n  if (!(reactCreateElement instanceof FunctionValue)) {\n    return false;\n  }\n  let reactCloneElement = logger.tryQuery(() => Get(realm, value, \"cloneElement\"), undefined);\n  if (!(reactCloneElement instanceof FunctionValue)) {\n    return false;\n  }\n  let reactIsValidElement = logger.tryQuery(() => Get(realm, value, \"isValidElement\"), undefined);\n  if (!(reactIsValidElement instanceof FunctionValue)) {\n    return false;\n  }\n  let reactComponent = logger.tryQuery(() => Get(realm, value, \"Component\"), undefined);\n  if (!(reactComponent instanceof FunctionValue)) {\n    return false;\n  }\n  let reactChildren = logger.tryQuery(() => Get(realm, value, \"Children\"), undefined);\n  if (!(reactChildren instanceof ObjectValue)) {\n    return false;\n  }\n  return false;\n}\n\nexport function valueIsLegacyCreateClassComponent(realm: Realm, value: Value): boolean {\n  if (!(value instanceof FunctionValue)) {\n    return false;\n  }\n  let prototype = Get(realm, value, \"prototype\");\n\n  if (prototype instanceof ObjectValue) {\n    return prototype.properties.has(\"__reactAutoBindPairs\");\n  }\n  return false;\n}\n\nexport function valueIsFactoryClassComponent(realm: Realm, value: Value): boolean {\n  if (value instanceof ObjectValue && !ArrayValue.isIntrinsicAndHasWidenedNumericProperty(value)) {\n    return To.ToBooleanPartial(realm, Get(realm, value, \"render\"));\n  }\n  return false;\n}\n\nexport function addKeyToReactElement(realm: Realm, reactElement: ObjectValue): ObjectValue {\n  let typeValue = getProperty(realm, reactElement, \"type\");\n  let refValue = getProperty(realm, reactElement, \"ref\");\n  let propsValue = getProperty(realm, reactElement, \"props\");\n  // we need to apply a key when we're branched\n  let currentKeyValue = getProperty(realm, reactElement, \"key\") || realm.intrinsics.null;\n  let uniqueKey = getUniqueReactElementKey(\"\", realm.react.usedReactElementKeys);\n  let newKeyValue = new StringValue(realm, uniqueKey);\n  if (currentKeyValue !== realm.intrinsics.null) {\n    newKeyValue = computeBinary(realm, \"+\", currentKeyValue, newKeyValue);\n  }\n  invariant(propsValue instanceof ObjectValue);\n  return createInternalReactElement(realm, typeValue, newKeyValue, refValue, propsValue);\n}\n// we create a unique key for each JSXElement to prevent collisions\n// otherwise React will detect a missing/conflicting key at runtime and\n// this can break the reconcilation of JSXElements in arrays\nexport function getUniqueReactElementKey(index?: string, usedReactElementKeys: Set<string>): string {\n  let key;\n  do {\n    key = Math.random()\n      .toString(36)\n      .replace(/[^a-z]+/g, \"\")\n      .substring(0, 2);\n  } while (usedReactElementKeys.has(key));\n  usedReactElementKeys.add(key);\n  if (index !== undefined) {\n    return `${key}${index}`;\n  }\n  return key;\n}\n\n// a helper function to loop over ArrayValues\nexport function forEachArrayValue(\n  realm: Realm,\n  array: ArrayValue,\n  mapFunc: (element: Value, index: number) => void\n): void {\n  let lengthValue = Get(realm, array, \"length\");\n  let isConditionalLength = lengthValue instanceof AbstractValue && lengthValue.kind === \"conditional\";\n  let length;\n  if (isConditionalLength) {\n    length = getMaxLength(lengthValue, 0);\n  } else {\n    invariant(lengthValue instanceof NumberValue, \"TODO: support other types of array length value\");\n    length = lengthValue.value;\n  }\n  for (let i = 0; i < length; i++) {\n    let elementProperty = array.properties.get(\"\" + i);\n    let elementPropertyDescriptor = elementProperty && elementProperty.descriptor;\n    if (elementPropertyDescriptor) {\n      invariant(elementPropertyDescriptor instanceof PropertyDescriptor);\n      let elementValue = elementPropertyDescriptor.value;\n      // If we are in an array with conditional length, the element might be a conditional join\n      // of the same type as the length of the array\n      if (isConditionalLength && elementValue instanceof AbstractValue && elementValue.kind === \"conditional\") {\n        invariant(lengthValue instanceof AbstractValue);\n        let lengthCondition = lengthValue.args[0];\n        let elementCondition = elementValue.args[0];\n        // If they are the same condition\n        invariant(lengthCondition.equals(elementCondition), \"TODO: support cases where the condition is not the same\");\n      }\n      invariant(elementValue instanceof Value);\n      mapFunc(elementValue, i);\n    }\n  }\n}\n\nexport function mapArrayValue(\n  realm: Realm,\n  array: ArrayValue,\n  mapFunc: (element: Value, descriptor: Descriptor) => Value\n): ArrayValue {\n  let returnTheNewArray = false;\n  let newArray;\n\n  const mapArray = (lengthValue: NumberValue): void => {\n    let length = lengthValue.value;\n\n    for (let i = 0; i < length; i++) {\n      let elementProperty = array.properties.get(\"\" + i);\n      let elementPropertyDescriptor = elementProperty && elementProperty.descriptor;\n      if (elementPropertyDescriptor) {\n        invariant(elementPropertyDescriptor instanceof PropertyDescriptor);\n        let elementValue = elementPropertyDescriptor.value;\n        if (elementValue instanceof Value) {\n          let newElement = mapFunc(elementValue, elementPropertyDescriptor);\n          if (newElement !== elementValue) {\n            returnTheNewArray = true;\n          }\n          Create.CreateDataPropertyOrThrow(realm, newArray, \"\" + i, newElement);\n          continue;\n        }\n      }\n      Create.CreateDataPropertyOrThrow(realm, newArray, \"\" + i, realm.intrinsics.undefined);\n    }\n  };\n\n  let lengthValue = Get(realm, array, \"length\");\n  if (lengthValue instanceof AbstractValue && lengthValue.kind === \"conditional\") {\n    returnTheNewArray = true;\n    let [condValue, consequentVal, alternateVal] = lengthValue.args;\n    newArray = Create.ArrayCreate(realm, 0);\n    realm.evaluateWithAbstractConditional(\n      condValue,\n      () => {\n        return realm.evaluateForEffects(\n          () => {\n            invariant(consequentVal instanceof NumberValue);\n            mapArray(consequentVal);\n            return realm.intrinsics.undefined;\n          },\n          null,\n          \"mapArrayValue consequent\"\n        );\n      },\n      () => {\n        return realm.evaluateForEffects(\n          () => {\n            invariant(alternateVal instanceof NumberValue);\n            mapArray(alternateVal);\n            return realm.intrinsics.undefined;\n          },\n          null,\n          \"mapArrayValue alternate\"\n        );\n      }\n    );\n  } else if (lengthValue instanceof NumberValue) {\n    newArray = Create.ArrayCreate(realm, lengthValue.value);\n    mapArray(lengthValue);\n  } else {\n    invariant(false, \"TODO: support other types of array length value\");\n  }\n  return returnTheNewArray ? newArray : array;\n}\n\nfunction GetDescriptorForProperty(value: ObjectValue, propertyName: string): ?Descriptor {\n  let object = value.properties.get(propertyName);\n  invariant(object);\n  return object.descriptor;\n}\n\nexport function convertSimpleClassComponentToFunctionalComponent(\n  realm: Realm,\n  complexComponentType: ECMAScriptSourceFunctionValue,\n  transforms: Array<AdditionalFunctionTransform>\n): void {\n  let prototype = complexComponentType.properties.get(\"prototype\");\n  invariant(prototype);\n  invariant(prototype.descriptor instanceof PropertyDescriptor);\n  prototype.descriptor.configurable = true;\n  Properties.DeletePropertyOrThrow(realm, complexComponentType, \"prototype\");\n\n  // change the function kind\n  complexComponentType.$FunctionKind = \"normal\";\n  // set the prototype back to an object\n  complexComponentType.$Prototype = realm.intrinsics.FunctionPrototype;\n  // give the function the functional components params\n  complexComponentType.$FormalParameters = [t.identifier(\"props\"), t.identifier(\"context\")];\n  // add a transform to occur after the additional function has serialized the body of the class\n  transforms.push((body: Array<BabelNodeStatement>) => {\n    // as this was a class before and is now a functional component, we need to replace\n    // this.props and this.context to props and context, via the function arugments\n    let funcNode = t.functionExpression(null, [], t.blockStatement(body));\n\n    traverse(\n      t.file(t.program([t.expressionStatement(funcNode)])),\n      {\n        \"Identifier|ThisExpression\"(path) {\n          let node = path.node;\n          if ((t.isIdentifier(node) && node.name === \"this\") || t.isThisExpression(node)) {\n            let parentPath = path.parentPath;\n            let parentNode = parentPath.node;\n\n            if (t.isMemberExpression(parentNode)) {\n              // remove the \"this\" from the member\n              parentPath.replaceWith(parentNode.property);\n            } else {\n              throw new FatalError(\n                `conversion of a simple class component to functional component failed due to \"this\" not being replaced`\n              );\n            }\n          }\n        },\n      },\n      undefined,\n      {},\n      undefined\n    );\n    traverse.cache.clear();\n  });\n}\n\nfunction createBinding(descriptor: void | Descriptor, key: string | SymbolValue, object: ObjectValue) {\n  return {\n    descriptor,\n    key,\n    object,\n  };\n}\n\nfunction cloneProperties(realm: Realm, properties: Map<string, any>, object: ObjectValue): Map<string, any> {\n  let newProperties = new Map();\n  for (let [propertyName, { descriptor }] of properties) {\n    newProperties.set(\n      propertyName,\n      createBinding(cloneDescriptor(descriptor.throwIfNotConcrete(realm)), propertyName, object)\n    );\n  }\n  return newProperties;\n}\n\nfunction cloneSymbols(realm: Realm, symbols: Map<SymbolValue, any>, object: ObjectValue): Map<SymbolValue, any> {\n  let newSymbols = new Map();\n  for (let [symbol, { descriptor }] of symbols) {\n    newSymbols.set(symbol, createBinding(cloneDescriptor(descriptor.throwIfNotConcrete(realm)), symbol, object));\n  }\n  return newSymbols;\n}\n\nfunction cloneValue(\n  realm: Realm,\n  originalValue: Value,\n  _prototype: null | ObjectValue,\n  copyToObject?: ObjectValue\n): Value {\n  if (originalValue instanceof FunctionValue) {\n    return cloneFunction(realm, originalValue, _prototype, copyToObject);\n  }\n  invariant(false, \"TODO: add support to cloneValue() for more value types\");\n}\n\nfunction cloneFunction(\n  realm: Realm,\n  originalValue: Value,\n  _prototype: null | ObjectValue,\n  copyToObject?: ObjectValue\n): FunctionValue {\n  let newValue;\n  if (originalValue instanceof ECMAScriptSourceFunctionValue) {\n    newValue = copyToObject || new ECMAScriptSourceFunctionValue(realm, originalValue.intrinsicName);\n    invariant(newValue instanceof ECMAScriptSourceFunctionValue);\n    // $FlowFixMe: complains about Object.assign\n    Object.assign(newValue, originalValue);\n    let properties = cloneProperties(realm, originalValue.properties, newValue);\n    newValue.properties = properties;\n    let symbols = cloneSymbols(realm, originalValue.symbols, newValue);\n    newValue.symbols = symbols;\n\n    // handle home object + prototype\n    let originalPrototype = originalValue.$HomeObject;\n    invariant(originalPrototype instanceof ObjectValue);\n    let prototype = _prototype || clonePrototype(realm, originalPrototype);\n    newValue.$HomeObject = prototype;\n    if (originalPrototype.properties.has(\"constructor\")) {\n      Properties.Set(realm, prototype, \"constructor\", newValue, false);\n    }\n    if (originalValue.properties.has(\"prototype\")) {\n      Properties.Set(realm, newValue, \"prototype\", prototype, false);\n    }\n  }\n  invariant(newValue instanceof FunctionValue, \"TODO: add support to cloneValue() for more function types\");\n  return newValue;\n}\n\nfunction clonePrototype(realm: Realm, prototype: Value): ObjectValue {\n  invariant(prototype instanceof ObjectValue);\n  let newPrototype = new ObjectValue(realm, realm.intrinsics.ObjectPrototype, prototype.intrinsicName);\n\n  Object.assign(newPrototype, prototype);\n  for (let [propertyName] of prototype.properties) {\n    if (propertyName !== \"constructor\") {\n      let originalValue = Get(realm, prototype, propertyName);\n      let newValue = cloneValue(realm, originalValue, prototype);\n      Properties.Set(realm, newPrototype, propertyName, newValue, false);\n    }\n  }\n  for (let [symbol] of prototype.symbols) {\n    let originalValue = Get(realm, prototype, symbol);\n    let newValue = cloneValue(realm, originalValue, prototype);\n    Properties.Set(realm, newPrototype, symbol, newValue, false);\n  }\n  return newPrototype;\n}\n\nconst skipFunctionProperties = new Set([\"length\", \"prototype\", \"arguments\", \"name\", \"caller\"]);\n\nexport function convertFunctionalComponentToComplexClassComponent(\n  realm: Realm,\n  functionalComponentType: ECMAScriptSourceFunctionValue | BoundFunctionValue,\n  complexComponentType: void | ECMAScriptSourceFunctionValue | BoundFunctionValue,\n  transforms: Array<AdditionalFunctionTransform>\n): void {\n  invariant(\n    complexComponentType instanceof ECMAScriptSourceFunctionValue || complexComponentType instanceof BoundFunctionValue\n  );\n  // get all properties on the functional component that were added in user-code\n  // we add defaultProps as undefined, as merging a class component's defaultProps on to\n  // a differnet component isn't right, we can discard defaultProps instead via folding\n  // we also don't want propTypes from the class component, so we remove that too\n  let userCodePropertiesToAdd: Map<string, PropertyBinding> = new Map([\n    [\"defaultProps\", createBinding(undefined, \"defaultProps\", functionalComponentType)],\n    [\"propTypes\", createBinding(undefined, \"propTypes\", functionalComponentType)],\n  ]);\n  let userCodeSymbolsToAdd: Map<SymbolValue, PropertyBinding> = new Map();\n\n  for (let [propertyName, binding] of functionalComponentType.properties) {\n    if (!skipFunctionProperties.has(propertyName)) {\n      userCodePropertiesToAdd.set(propertyName, binding);\n    }\n  }\n  for (let [symbol, binding] of functionalComponentType.symbols) {\n    userCodeSymbolsToAdd.set(symbol, binding);\n  }\n\n  cloneValue(realm, complexComponentType, null, functionalComponentType);\n  // then copy back and properties that were on the original functional component\n  // ensuring we overwrite any existing ones\n  for (let [propertyName, binding] of userCodePropertiesToAdd) {\n    functionalComponentType.properties.set(propertyName, binding);\n  }\n  for (let [symbol, binding] of userCodeSymbolsToAdd) {\n    functionalComponentType.symbols.set(symbol, binding);\n  }\n  // add a transform to occur after the additional function has serialized the body of the class\n  transforms.push((body: Array<BabelNodeStatement>) => {\n    // as we've converted a functional component to a complex one, we are going to have issues with\n    // \"props\" and \"context\" references, as they're now going to be \"this.props\" and \"this.context\".\n    // we simply need a to add to vars to beginning of the body to get around this\n    // if they're not used, any DCE tool post-Prepack (GCC or Uglify) will remove them\n    body.unshift(\n      t.variableDeclaration(\"var\", [\n        t.variableDeclarator(t.identifier(\"props\"), t.memberExpression(t.thisExpression(), t.identifier(\"props\"))),\n        t.variableDeclarator(t.identifier(\"context\"), t.memberExpression(t.thisExpression(), t.identifier(\"context\"))),\n      ])\n    );\n  });\n}\n\nexport function normalizeFunctionalComponentParamaters(func: ECMAScriptSourceFunctionValue): void {\n  // fix the length as we may change the arguments\n  let lengthProperty = GetDescriptorForProperty(func, \"length\");\n  invariant(lengthProperty instanceof PropertyDescriptor);\n  lengthProperty.writable = false;\n  lengthProperty.enumerable = false;\n  lengthProperty.configurable = true;\n  func.$FormalParameters = func.$FormalParameters.map((param, i) => {\n    if (i === 0) {\n      return t.isIdentifier(param) ? param : t.identifier(\"props\");\n    } else {\n      return t.isIdentifier(param) ? param : t.identifier(\"context\");\n    }\n  });\n  if (func.$FormalParameters.length === 1) {\n    func.$FormalParameters.push(t.identifier(\"context\"));\n  }\n  // ensure the length value is set to the correct value after\n  // we've made mutations to the arguments of this function\n  let lengthValue = lengthProperty.value;\n  invariant(lengthValue instanceof NumberValue);\n  lengthValue.value = func.$FormalParameters.length;\n}\n\nexport function createReactHintObject(\n  object: ObjectValue,\n  propertyName: string,\n  args: Array<Value>,\n  firstRenderValue: Value\n): ReactHint {\n  return {\n    firstRenderValue,\n    object,\n    propertyName,\n    args,\n  };\n}\n\nexport function getComponentTypeFromRootValue(\n  realm: Realm,\n  value: Value\n): ECMAScriptSourceFunctionValue | BoundFunctionValue | null {\n  let _valueIsKnownReactAbstraction = valueIsKnownReactAbstraction(realm, value);\n  if (\n    !(\n      value instanceof ECMAScriptSourceFunctionValue ||\n      value instanceof BoundFunctionValue ||\n      _valueIsKnownReactAbstraction\n    )\n  ) {\n    return null;\n  }\n  if (_valueIsKnownReactAbstraction) {\n    invariant(value instanceof AbstractValue);\n    let reactHint = realm.react.abstractHints.get(value);\n\n    invariant(reactHint);\n    if (typeof reactHint !== \"string\" && reactHint.object === realm.fbLibraries.reactRelay) {\n      switch (reactHint.propertyName) {\n        case \"createFragmentContainer\":\n        case \"createPaginationContainer\":\n        case \"createRefetchContainer\":\n          invariant(Array.isArray(reactHint.args));\n          // componentType is the 1st argument of a ReactRelay container\n          let componentType = reactHint.args[0];\n          invariant(\n            componentType instanceof ECMAScriptSourceFunctionValue || componentType instanceof BoundFunctionValue\n          );\n          return componentType;\n        default:\n          invariant(\n            false,\n            `unsupported known React abstraction - ReactRelay property \"${reactHint.propertyName}\" not supported`\n          );\n      }\n    }\n    invariant(false, \"unsupported known React abstraction\");\n  } else {\n    invariant(value instanceof ECMAScriptSourceFunctionValue || value instanceof BoundFunctionValue);\n    return value;\n  }\n}\n\nexport function flagPropsWithNoPartialKeyOrRef(realm: Realm, props: ObjectValue | AbstractObjectValue): void {\n  realm.react.propsWithNoPartialKeyOrRef.add(props);\n}\n\nexport function hasNoPartialKeyOrRef(realm: Realm, props: ObjectValue | AbstractObjectValue): boolean {\n  if (realm.react.propsWithNoPartialKeyOrRef.has(props)) {\n    return true;\n  }\n  if (props instanceof ObjectValue && !props.isPartialObject()) {\n    return true;\n  }\n  if (props instanceof AbstractObjectValue) {\n    if (props.values.isTop()) {\n      return false;\n    }\n    let elements = props.values.getElements();\n    for (let element of elements) {\n      invariant(element instanceof ObjectValue);\n      let wasSafe = hasNoPartialKeyOrRef(realm, element);\n      if (!wasSafe) {\n        return false;\n      }\n    }\n    return true;\n  }\n  if (props instanceof ObjectValue && props.properties.has(\"key\") && props.properties.has(\"ref\")) {\n    return true;\n  }\n  return false;\n}\n\nexport function getMaxLength(value: Value, maxLength: number): number {\n  if (value instanceof NumberValue) {\n    if (value.value > maxLength) {\n      return value.value;\n    } else {\n      return maxLength;\n    }\n  } else if (value instanceof AbstractValue && value.kind === \"conditional\") {\n    let [, consequentVal, alternateVal] = value.args;\n    let consequentMaxVal = getMaxLength(consequentVal, maxLength);\n    let alternateMaxVal = getMaxLength(alternateVal, maxLength);\n    if (consequentMaxVal > maxLength && consequentMaxVal >= alternateMaxVal) {\n      return consequentMaxVal;\n    } else if (alternateMaxVal > maxLength && alternateMaxVal >= consequentMaxVal) {\n      return alternateMaxVal;\n    }\n    return maxLength;\n  }\n  invariant(false, \"TODO: support other types of array length value\");\n}\n\nfunction recursivelyFlattenArray(realm: Realm, array, targetArray: ArrayValue, noHoles: boolean): void {\n  forEachArrayValue(realm, array, _item => {\n    let element = _item;\n    if (element instanceof ArrayValue && !element.intrinsicName) {\n      recursivelyFlattenArray(realm, element, targetArray, noHoles);\n    } else {\n      let lengthValue = Get(realm, targetArray, \"length\");\n      invariant(lengthValue instanceof NumberValue);\n      if (noHoles && element instanceof EmptyValue) {\n        // We skip holely elements\n        return;\n      } else if (noHoles && element instanceof AbstractValue && element.kind === \"conditional\") {\n        let [condValue, consequentVal, alternateVal] = element.args;\n        invariant(condValue instanceof AbstractValue);\n        let consquentIsHolely = consequentVal instanceof EmptyValue;\n        let alternateIsHolely = alternateVal instanceof EmptyValue;\n\n        if (consquentIsHolely && alternateIsHolely) {\n          // We skip holely elements\n          return;\n        }\n        if (consquentIsHolely) {\n          element = AbstractValue.createFromLogicalOp(\n            realm,\n            \"&&\",\n            AbstractValue.createFromUnaryOp(realm, \"!\", condValue),\n            alternateVal\n          );\n        }\n        if (alternateIsHolely) {\n          element = AbstractValue.createFromLogicalOp(realm, \"&&\", condValue, consequentVal);\n        }\n      }\n      Properties.Set(realm, targetArray, \"\" + lengthValue.value, element, true);\n    }\n  });\n}\n\nexport function flattenChildren(realm: Realm, array: ArrayValue, noHoles: boolean): ArrayValue {\n  let flattenedChildren = Create.ArrayCreate(realm, 0);\n  recursivelyFlattenArray(realm, array, flattenedChildren, noHoles);\n  flattenedChildren.makeFinal();\n  return flattenedChildren;\n}\n\n// This function is mainly use to get internal properties\n// on objects that we know are safe to access internally\n// such as ReactElements. Getting properties here does\n// not emit change to modified bindings and is intended\n// for only internal usage – not for user-land code\nexport function getProperty(\n  realm: Realm,\n  object: ObjectValue | AbstractObjectValue,\n  property: string | SymbolValue\n): Value {\n  if (object instanceof AbstractObjectValue) {\n    if (object.values.isTop()) {\n      return realm.intrinsics.undefined;\n    }\n    let elements = object.values.getElements();\n    invariant(elements.size === 1, \"TODO: deal with multiple elements\");\n    for (let element of elements) {\n      invariant(element instanceof ObjectValue, \"TODO: deal with object set templates\");\n      object = element;\n    }\n    invariant(object instanceof ObjectValue);\n  }\n  let binding;\n  if (typeof property === \"string\") {\n    binding = object.properties.get(property);\n  } else {\n    binding = object.symbols.get(property);\n  }\n  if (!binding) {\n    return realm.intrinsics.undefined;\n  }\n  let descriptor = binding.descriptor;\n\n  if (!descriptor) {\n    return realm.intrinsics.undefined;\n  }\n  invariant(descriptor instanceof PropertyDescriptor);\n  let value = descriptor.value;\n  if (value === undefined) {\n    AbstractValue.reportIntrospectionError(object, `react/utils/getProperty unsupported getter/setter property`);\n    throw new FatalError();\n  }\n  invariant(value instanceof Value, `react/utils/getProperty should not be called on internal properties`);\n  return value;\n}\n\nexport function createReactEvaluatedNode(\n  status:\n    | \"ROOT\"\n    | \"NEW_TREE\"\n    | \"INLINED\"\n    | \"BAIL-OUT\"\n    | \"FATAL\"\n    | \"UNKNOWN_TYPE\"\n    | \"RENDER_PROPS\"\n    | \"FORWARD_REF\"\n    | \"NORMAL\",\n  name: string\n): ReactEvaluatedNode {\n  return {\n    children: [],\n    message: \"\",\n    name,\n    status,\n  };\n}\n\nexport function getComponentName(realm: Realm, componentType: Value): string {\n  if (componentType instanceof SymbolValue && componentType === getReactSymbol(\"react.fragment\", realm)) {\n    return \"React.Fragment\";\n  } else if (componentType instanceof SymbolValue) {\n    return \"unknown symbol\";\n  }\n  // $FlowFixMe: this code is fine, Flow thinks that coponentType is bound to string...\n  if (isReactComponent(componentType)) {\n    return \"ReactElement\";\n  }\n  if (componentType === realm.intrinsics.undefined || componentType === realm.intrinsics.null) {\n    return \"no name\";\n  }\n  invariant(\n    componentType instanceof ECMAScriptSourceFunctionValue ||\n      componentType instanceof BoundFunctionValue ||\n      componentType instanceof AbstractObjectValue ||\n      componentType instanceof AbstractValue ||\n      componentType instanceof ObjectValue\n  );\n  let boundText = componentType instanceof BoundFunctionValue ? \"bound \" : \"\";\n\n  if (componentType.__originalName) {\n    return boundText + componentType.__originalName;\n  }\n  if (realm.fbLibraries.reactRelay !== undefined) {\n    if (componentType === Get(realm, realm.fbLibraries.reactRelay, \"QueryRenderer\")) {\n      return boundText + \"QueryRenderer\";\n    }\n  }\n  if (componentType instanceof ECMAScriptSourceFunctionValue && componentType.$Prototype !== undefined) {\n    let name = Get(realm, componentType, \"name\");\n\n    if (name instanceof StringValue) {\n      return boundText + name.value;\n    }\n  }\n  if (componentType instanceof ObjectValue) {\n    let $$typeof = getProperty(realm, componentType, \"$$typeof\");\n\n    if ($$typeof === getReactSymbol(\"react.forward_ref\", realm)) {\n      return \"forwarded ref\";\n    }\n  }\n  if (componentType instanceof FunctionValue) {\n    return boundText + \"anonymous\";\n  }\n  return \"unknown\";\n}\n\nexport function convertConfigObjectToReactComponentTreeConfig(\n  realm: Realm,\n  config: ObjectValue | UndefinedValue\n): ReactComponentTreeConfig {\n  // defaults\n  let firstRenderOnly = false;\n  let isRoot = false;\n  let modelString;\n\n  if (!(config instanceof UndefinedValue)) {\n    for (let [key] of config.properties) {\n      let propValue = getProperty(realm, config, key);\n      if (propValue instanceof StringValue || propValue instanceof NumberValue || propValue instanceof BooleanValue) {\n        let value = propValue.value;\n\n        if (typeof value === \"boolean\") {\n          // boolean options\n          if (key === \"firstRenderOnly\") {\n            firstRenderOnly = value;\n          } else if (key === \"isRoot\") {\n            isRoot = value;\n          }\n        } else if (typeof value === \"string\") {\n          try {\n            // result here is ignored as the main point here is to\n            // check and produce error\n            JSON.parse(value);\n          } catch (e) {\n            let componentModelError = new CompilerDiagnostic(\n              \"Failed to parse model for component\",\n              realm.currentLocation,\n              \"PP1008\",\n              \"FatalError\"\n            );\n            if (realm.handleError(componentModelError) !== \"Recover\") {\n              throw new FatalError();\n            }\n          }\n          // string options\n          if (key === \"model\") {\n            modelString = value;\n          }\n        }\n      } else {\n        let diagnostic = new CompilerDiagnostic(\n          \"__optimizeReactComponentTree(rootComponent, config) has been called with invalid arguments\",\n          realm.currentLocation,\n          \"PP0024\",\n          \"FatalError\"\n        );\n        realm.handleError(diagnostic);\n        if (realm.handleError(diagnostic) === \"Fail\") throw new FatalError();\n      }\n    }\n  }\n  return {\n    firstRenderOnly,\n    isRoot,\n    modelString,\n  };\n}\n\nexport function getValueFromFunctionCall(\n  realm: Realm,\n  func: ECMAScriptSourceFunctionValue | BoundFunctionValue,\n  funcThis: ObjectValue | AbstractObjectValue | UndefinedValue,\n  args: Array<Value>,\n  isConstructor?: boolean = false\n): Value {\n  invariant(func.$Call, \"Expected function to be a FunctionValue with $Call method\");\n  let funcCall = func.$Call;\n  let newCall = func.$Construct;\n  let completion;\n  try {\n    let value;\n    if (isConstructor) {\n      invariant(newCall);\n      value = newCall(args, func);\n    } else {\n      value = funcCall(funcThis, args);\n    }\n    completion = new SimpleNormalCompletion(value);\n  } catch (error) {\n    if (error instanceof AbruptCompletion) {\n      completion = error;\n    } else {\n      throw error;\n    }\n  }\n  return realm.returnOrThrowCompletion(completion);\n}\n\nfunction isEventProp(name: string): boolean {\n  return name.length > 2 && name[0].toLowerCase() === \"o\" && name[1].toLowerCase() === \"n\";\n}\n\nexport function createNoopFunction(realm: Realm): ECMAScriptSourceFunctionValue {\n  if (realm.react.noopFunction !== undefined) {\n    return realm.react.noopFunction;\n  }\n  let noOpFunc = new ECMAScriptSourceFunctionValue(realm);\n  noOpFunc.initialize([], t.blockStatement([]));\n  realm.react.noopFunction = noOpFunc;\n  return noOpFunc;\n}\n\nexport function doNotOptimizeComponent(realm: Realm, componentType: Value): boolean {\n  if (componentType instanceof ObjectValue) {\n    let doNotOptimize = Get(realm, componentType, \"__reactCompilerDoNotOptimize\");\n\n    if (doNotOptimize instanceof BooleanValue) {\n      return doNotOptimize.value;\n    }\n  }\n  return false;\n}\n\nexport function createDefaultPropsHelper(realm: Realm): ECMAScriptSourceFunctionValue {\n  let defaultPropsHelper = `\n    function defaultPropsHelper(props, defaultProps) {\n      for (var propName in defaultProps) {\n        if (props[propName] === undefined) {\n          props[propName] = defaultProps[propName];\n        }\n      }\n      return props;\n    }\n  `;\n\n  let escapeHelperAst = parseExpression(defaultPropsHelper, { plugins: [\"flow\"] });\n  let helper = new ECMAScriptSourceFunctionValue(realm);\n  helper.initialize(escapeHelperAst.params, escapeHelperAst.body);\n  return helper;\n}\n\nexport function createInternalReactElement(\n  realm: Realm,\n  type: Value,\n  key: Value,\n  ref: Value,\n  props: ObjectValue\n): ObjectValue {\n  let obj = Create.ObjectCreate(realm, realm.intrinsics.ObjectPrototype);\n\n  // Sanity check the type is not conditional\n  if (type instanceof AbstractValue && type.kind === \"conditional\") {\n    invariant(false, \"createInternalReactElement should never encounter a conditional type\");\n  }\n\n  Create.CreateDataPropertyOrThrow(realm, obj, \"$$typeof\", getReactSymbol(\"react.element\", realm));\n  Create.CreateDataPropertyOrThrow(realm, obj, \"type\", type);\n  Create.CreateDataPropertyOrThrow(realm, obj, \"key\", key);\n  Create.CreateDataPropertyOrThrow(realm, obj, \"ref\", ref);\n  Create.CreateDataPropertyOrThrow(realm, obj, \"props\", props);\n  Create.CreateDataPropertyOrThrow(realm, obj, \"_owner\", realm.intrinsics.null);\n  obj.makeFinal();\n  // If we're in \"rendering\" a React component tree, we should have an active reconciler\n  let activeReconciler = realm.react.activeReconciler;\n  let createdDuringReconcilation = activeReconciler !== undefined;\n  let firstRenderOnly = createdDuringReconcilation ? activeReconciler.componentTreeConfig.firstRenderOnly : false;\n\n  realm.react.reactElements.set(obj, { createdDuringReconcilation, firstRenderOnly });\n  // Sanity check to ensure no bugs have crept in\n  invariant(\n    realm.react.reactProps.has(props) && props.mightBeFinalObject(),\n    \"React props object is not correctly setup\"\n  );\n  return obj;\n}\n\nfunction applyClonedTemporalAlias(realm: Realm, props: ObjectValue, clonedProps: ObjectValue): void {\n  let temporalAlias = props.temporalAlias;\n  invariant(temporalAlias !== undefined);\n  if (temporalAlias.kind === \"conditional\") {\n    // Leave in for now, we should deal with this later, but there might\n    // be a better option.\n    invariant(false, \"TODO applyClonedTemporalAlias conditional\");\n  }\n  let temporalOperationEntry = realm.getTemporalOperationEntryFromDerivedValue(temporalAlias);\n  if (!(temporalOperationEntry instanceof TemporalObjectAssignEntry)) {\n    invariant(false, \"TODO nont TemporalObjectAssignEntry\");\n  }\n  invariant(temporalOperationEntry !== undefined);\n  let temporalArgs = temporalOperationEntry.args;\n  // replace the original props with the cloned one\n  let [to, ...sources] = temporalArgs.map(arg => (arg === props ? clonedProps : arg));\n\n  invariant(to instanceof ObjectValue || to instanceof AbstractObjectValue);\n  AbstractValue.createTemporalObjectAssign(realm, to, sources);\n}\n\nexport function cloneProps(realm: Realm, props: ObjectValue, newChildren?: Value): ObjectValue {\n  let clonedProps = new ObjectValue(realm, realm.intrinsics.ObjectPrototype);\n\n  for (let [propName, binding] of props.properties) {\n    if (binding && binding.descriptor) {\n      invariant(binding.descriptor instanceof PropertyDescriptor);\n      if (binding.descriptor.enumerable) {\n        if (newChildren !== undefined && propName === \"children\") {\n          Properties.Set(realm, clonedProps, propName, newChildren, true);\n        } else {\n          Properties.Set(realm, clonedProps, propName, getProperty(realm, props, propName), true);\n        }\n      }\n    }\n  }\n\n  if (props.isPartialObject()) {\n    clonedProps.makePartial();\n  }\n  if (props.isSimpleObject()) {\n    clonedProps.makeSimple();\n  }\n  if (realm.react.propsWithNoPartialKeyOrRef.has(props)) {\n    flagPropsWithNoPartialKeyOrRef(realm, clonedProps);\n  }\n  if (props.temporalAlias !== undefined) {\n    applyClonedTemporalAlias(realm, props, clonedProps);\n  }\n  clonedProps.makeFinal();\n  realm.react.reactProps.add(clonedProps);\n  return clonedProps;\n}\n\nexport function applyObjectAssignConfigsForReactElement(realm: Realm, to: ObjectValue, sources: Array<Value>): void {\n  // Get the global Object.assign\n  let globalObj = Get(realm, realm.$GlobalObject, \"Object\");\n  invariant(globalObj instanceof ObjectValue);\n  let objAssign = Get(realm, globalObj, \"assign\");\n  invariant(objAssign instanceof ECMAScriptFunctionValue);\n  let objectAssignCall = objAssign.$Call;\n  invariant(objectAssignCall !== undefined);\n\n  // Use the existing internal Prepack Object.assign model\n  objectAssignCall(realm.intrinsics.undefined, [to, ...sources]);\n}\n\n// In firstRenderOnly mode, we strip off onEventHanlders and any props\n// that are functions as they are not required for init render.\nexport function canExcludeReactElementObjectProperty(\n  realm: Realm,\n  reactElement: ObjectValue,\n  name: string,\n  value: Value\n): boolean {\n  let reactElementData = realm.react.reactElements.get(reactElement);\n  invariant(reactElementData !== undefined);\n  let { firstRenderOnly } = reactElementData;\n  let isHostComponent = getProperty(realm, reactElement, \"type\") instanceof StringValue;\n  return firstRenderOnly && isHostComponent && (isEventProp(name) || value instanceof FunctionValue);\n}\n\nexport function cloneReactElement(realm: Realm, reactElement: ObjectValue, shouldCloneProps: boolean): ObjectValue {\n  let typeValue = getProperty(realm, reactElement, \"type\");\n  let keyValue = getProperty(realm, reactElement, \"key\");\n  let refValue = getProperty(realm, reactElement, \"ref\");\n  let propsValue = getProperty(realm, reactElement, \"props\");\n\n  invariant(propsValue instanceof ObjectValue);\n  if (shouldCloneProps) {\n    propsValue = cloneProps(realm, propsValue);\n  }\n  return createInternalReactElement(realm, typeValue, keyValue, refValue, propsValue);\n}\n\n// This function changes an object's property value by changing it's binding\n// and descriptor, thus bypassing the binding detection system. This is a\n// dangerous function and should only be used on objects created by React.\n// It's primary use is to update ReactElement / React props properties\n// during the visitor equivalence stage as an optimization feature.\n// It will invariant if used on objects that are not final.\nexport function hardModifyReactObjectPropertyBinding(\n  realm: Realm,\n  object: ObjectValue,\n  propName: string,\n  value: Value\n): void {\n  invariant(\n    object.mightBeFinalObject() && !object.mightNotBeFinalObject(),\n    \"hardModifyReactObjectPropertyBinding can only be used on final objects!\"\n  );\n  let binding = object.properties.get(propName);\n  if (binding === undefined) {\n    binding = {\n      object,\n      descriptor: new PropertyDescriptor({\n        configurable: true,\n        enumerable: true,\n        value: undefined,\n        writable: true,\n      }),\n      key: propName,\n    };\n  }\n  let descriptor = binding.descriptor;\n  invariant(descriptor instanceof PropertyDescriptor && IsDataDescriptor(realm, descriptor));\n  let newDescriptor = new PropertyDescriptor(descriptor);\n  newDescriptor.value = value;\n  let newBinding = Object.assign({}, binding, {\n    descriptor: newDescriptor,\n  });\n  object.properties.set(propName, newBinding);\n}\n"
  },
  {
    "path": "src/realm.js",
    "content": "/**\n * Copyright (c) 2017-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n/* @flow */\n\nimport type {\n  ArgModel,\n  ClassComponentMetadata,\n  ConsoleMethodTypes,\n  DebugReproManagerType,\n  DebugServerType,\n  Descriptor,\n  DisplayResult,\n  Intrinsics,\n  PathConditions,\n  PropertyBinding,\n  ReactHint,\n} from \"./types.js\";\nimport { RealmStatistics } from \"./statistics.js\";\nimport {\n  CompilerDiagnostic,\n  type ErrorHandlerResult,\n  type ErrorHandler,\n  FatalError,\n  InfeasiblePathError,\n} from \"./errors.js\";\nimport {\n  AbstractObjectValue,\n  AbstractValue,\n  ArrayValue,\n  BoundFunctionValue,\n  ConcreteValue,\n  ECMAScriptSourceFunctionValue,\n  FunctionValue,\n  NativeFunctionValue,\n  ObjectValue,\n  ProxyValue,\n  StringValue,\n  SymbolValue,\n  UndefinedValue,\n  Value,\n} from \"./values/index.js\";\nimport { TypesDomain, ValuesDomain } from \"./domains/index.js\";\nimport {\n  LexicalEnvironment,\n  Reference,\n  GlobalEnvironmentRecord,\n  FunctionEnvironmentRecord,\n  DeclarativeEnvironmentRecord,\n} from \"./environment.js\";\nimport type { Binding } from \"./environment.js\";\nimport { Construct } from \"./methods/index.js\";\nimport {\n  AbruptCompletion,\n  Completion,\n  JoinedAbruptCompletions,\n  JoinedNormalAndAbruptCompletions,\n  NormalCompletion,\n  SimpleNormalCompletion,\n  ThrowCompletion,\n} from \"./completions.js\";\nimport type { Compatibility, RealmOptions, ReactOutputTypes, InvariantModeTypes } from \"./options.js\";\nimport invariant from \"./invariant.js\";\nimport seedrandom from \"seedrandom\";\nimport { createOperationDescriptor, Generator, type TemporalOperationEntry } from \"./utils/generator.js\";\nimport { PreludeGenerator } from \"./utils/PreludeGenerator.js\";\nimport {\n  createPathConditions,\n  Environment,\n  Functions,\n  Join,\n  Path,\n  Properties,\n  To,\n  Utils,\n  Widen,\n} from \"./singletons.js\";\nimport type { ReactSymbolTypes } from \"./react/utils.js\";\nimport {\n  cloneDescriptor,\n  AbstractJoinedDescriptor,\n  InternalSlotDescriptor,\n  PropertyDescriptor,\n} from \"./descriptors.js\";\nimport type { BabelNode, BabelNodeSourceLocation, BabelNodeLVal } from \"@babel/types\";\nexport type BindingEntry = { hasLeaked: boolean, value: void | Value };\nexport type Bindings = Map<Binding, BindingEntry>;\nexport type EvaluationResult = Completion | Reference;\nexport type PropertyBindings = Map<PropertyBinding, void | Descriptor>;\n\nexport type CreatedObjects = Set<ObjectValue>;\nexport type CreatedAbstracts = Set<AbstractValue>;\n\nexport type SideEffectType = \"MODIFIED_BINDING\" | \"MODIFIED_PROPERTY\" | \"MODIFIED_GLOBAL\";\n\nexport type SideEffectCallback = (\n  sideEffectType: SideEffectType,\n  binding: void | Binding | PropertyBinding,\n  expressionLocation: any\n) => void;\n\nlet effects_uid = 0;\n\nexport class Effects {\n  constructor(\n    result: Completion,\n    generator: Generator,\n    bindings: Bindings,\n    propertyBindings: PropertyBindings,\n    createdObjects: CreatedObjects,\n    createdAbstracts: CreatedAbstracts\n  ) {\n    this.result = result;\n    this.generator = generator;\n    this.modifiedBindings = bindings;\n    this.modifiedProperties = propertyBindings;\n    this.createdObjects = createdObjects;\n    this.createdAbstracts = createdAbstracts;\n\n    this.canBeApplied = true;\n    this._id = effects_uid++;\n  }\n\n  result: Completion;\n  generator: Generator;\n  modifiedBindings: Bindings;\n  modifiedProperties: PropertyBindings;\n  createdObjects: CreatedObjects;\n  createdAbstracts: CreatedAbstracts;\n  canBeApplied: boolean;\n  _id: number;\n\n  shallowCloneWithResult(result: Completion): Effects {\n    return new Effects(\n      result,\n      this.generator,\n      this.modifiedBindings,\n      this.modifiedProperties,\n      this.createdObjects,\n      this.createdAbstracts\n    );\n  }\n\n  toDisplayString(): string {\n    return Utils.jsonToDisplayString(this, 10);\n  }\n\n  toDisplayJson(depth: number = 1): DisplayResult {\n    if (depth <= 0) return `Effects ${this._id}`;\n    return Utils.verboseToDisplayJson(this, depth);\n  }\n}\n\nexport class Tracer {\n  beginEvaluateForEffects(state: any): void {}\n  endEvaluateForEffects(state: any, effects: void | Effects): void {}\n  detourCall(\n    F: FunctionValue,\n    thisArgument: void | Value,\n    argumentsList: Array<Value>,\n    newTarget: void | ObjectValue,\n    performCall: () => Value\n  ): void | Value {}\n  beforeCall(\n    F: FunctionValue,\n    thisArgument: void | Value,\n    argumentsList: Array<Value>,\n    newTarget: void | ObjectValue\n  ): void {}\n  afterCall(\n    F: FunctionValue,\n    thisArgument: void | Value,\n    argumentsList: Array<Value>,\n    newTarget: void | ObjectValue,\n    result: void | Reference | Value | AbruptCompletion\n  ): void {}\n  beginOptimizingFunction(optimizedFunctionId: number, functionValue: FunctionValue): void {}\n  endOptimizingFunction(optimizedFunctionId: number): void {}\n}\n\nexport class ExecutionContext {\n  function: ?FunctionValue;\n  caller: ?ExecutionContext;\n  loc: ?BabelNodeSourceLocation;\n  ScriptOrModule: any;\n  realm: Realm;\n  variableEnvironment: LexicalEnvironment;\n  lexicalEnvironment: LexicalEnvironment;\n  isReadOnly: boolean;\n  isStrict: boolean;\n\n  setCaller(context: ExecutionContext): void {\n    this.caller = context;\n  }\n\n  setFunction(F: null | FunctionValue): void {\n    if (F instanceof ECMAScriptSourceFunctionValue) this.isStrict = F.$Strict;\n    this.function = F;\n  }\n\n  setLocation(loc: null | BabelNodeSourceLocation): void {\n    if (!loc) return;\n    this.loc = loc;\n  }\n\n  setRealm(realm: Realm): void {\n    this.realm = realm;\n  }\n\n  /*\n   Read-only envs disallow:\n   - creating bindings in their scope\n   - creating or modifying objects when they are current running context\n  */\n  setReadOnly(value: boolean): boolean {\n    let oldReadOnly = this.isReadOnly;\n    if (this.variableEnvironment) this.variableEnvironment.environmentRecord.isReadOnly = value;\n    if (this.lexicalEnvironment) this.lexicalEnvironment.environmentRecord.isReadOnly = value;\n    this.isReadOnly = value;\n    return oldReadOnly;\n  }\n\n  suspend(): void {\n    // TODO #712: suspend\n  }\n\n  resume(): Value {\n    // TODO #712: resume\n    return this.realm.intrinsics.undefined;\n  }\n}\n\nexport function construct_empty_effects(\n  realm: Realm,\n  c: Completion = new SimpleNormalCompletion(realm.intrinsics.empty)\n): Effects {\n  return new Effects(\n    c,\n    new Generator(realm, \"construct_empty_effects\", realm.pathConditions),\n    new Map(),\n    new Map(),\n    new Set(),\n    new Set()\n  );\n}\n\nexport class Realm {\n  constructor(opts: RealmOptions, statistics: RealmStatistics) {\n    this.statistics = statistics;\n    this.isReadOnly = false;\n    this.useAbstractInterpretation = opts.serialize === true || Array.isArray(opts.check);\n    this.ignoreLeakLogic = false;\n    this.isInPureTryStatement = false;\n    if (opts.mathRandomSeed !== undefined) {\n      this.mathRandomGenerator = seedrandom(opts.mathRandomSeed);\n    }\n    this.strictlyMonotonicDateNow = !!opts.strictlyMonotonicDateNow;\n\n    // 0 = disabled\n    this.abstractValueImpliesMax = opts.abstractValueImpliesMax !== undefined ? opts.abstractValueImpliesMax : 0;\n    this.abstractValueImpliesCounter = 0;\n    this.inSimplificationPath = false;\n\n    this.timeout = opts.timeout;\n    if (this.timeout !== undefined) {\n      // We'll call Date.now for every this.timeoutCounterThreshold'th AST node.\n      // The threshold is there to reduce the cost of the surprisingly expensive Date.now call.\n      this.timeoutCounter = this.timeoutCounterThreshold = 1024;\n    }\n\n    this.start = Date.now();\n    this.compatibility = opts.compatibility !== undefined ? opts.compatibility : \"browser\";\n    this.remainingCalls = opts.maxStackDepth || 112;\n    this.invariantLevel = opts.invariantLevel || 0;\n    this.invariantMode = opts.invariantMode || \"throw\";\n    this.emitConcreteModel = !!opts.emitConcreteModel;\n\n    this.$TemplateMap = [];\n    this.pathConditions = createPathConditions();\n\n    if (this.useAbstractInterpretation) {\n      this.preludeGenerator = new PreludeGenerator(opts.debugNames, opts.uniqueSuffix);\n      ObjectValue.setupTrackedPropertyAccessors(ObjectValue.trackedPropertyNames);\n      ObjectValue.setupTrackedPropertyAccessors(NativeFunctionValue.trackedPropertyNames);\n      ObjectValue.setupTrackedPropertyAccessors(ProxyValue.trackedPropertyNames);\n    }\n\n    this.collectedNestedOptimizedFunctionEffects = new Map();\n    this.moduleFactoryFunctionsToRemove = new Map();\n    this.tracers = [];\n\n    // These get initialized in construct_realm to avoid the dependency\n    this.intrinsics = ({}: any);\n    this.$GlobalObject = (({}: any): ObjectValue);\n    this.evaluators = (Object.create(null): any);\n    this.$GlobalEnv = ((undefined: any): LexicalEnvironment);\n\n    this.derivedIds = new Map();\n    this.temporalEntryArgToEntries = new Map();\n    this.temporalEntryCounter = 0;\n\n    this.instantRender = {\n      enabled: opts.instantRender || false,\n    };\n\n    this.react = {\n      abstractHints: new WeakMap(),\n      activeReconciler: undefined,\n      classComponentMetadata: new Map(),\n      currentOwner: undefined,\n      defaultPropsHelper: undefined,\n      emptyArray: undefined,\n      emptyObject: undefined,\n      enabled: opts.reactEnabled || false,\n      failOnUnsupportedSideEffects: opts.reactFailOnUnsupportedSideEffects === false ? false : true,\n      hoistableFunctions: new WeakMap(),\n      hoistableReactElements: new WeakMap(),\n      noopFunction: undefined,\n      optimizeNestedFunctions: opts.reactOptimizeNestedFunctions || false,\n      output: opts.reactOutput || \"create-element\",\n      propsWithNoPartialKeyOrRef: new WeakSet(),\n      reactElements: new WeakMap(),\n      reactElementStringTypeReferences: new Map(),\n      reactProps: new WeakSet(),\n      symbols: new Map(),\n      usedReactElementKeys: new Set(),\n      verbose: opts.reactVerbose || false,\n    };\n\n    this.alreadyDescribedLocations = new WeakMap();\n    this.stripFlow = opts.stripFlow || false;\n\n    this.fbLibraries = {\n      other: new Map(),\n      react: undefined,\n      reactDom: undefined,\n      reactDomServer: undefined,\n      reactNative: undefined,\n      reactRelay: undefined,\n    };\n\n    this.errorHandler = opts.errorHandler;\n\n    this.globalSymbolRegistry = [];\n    this.activeLexicalEnvironments = new Set();\n    this._abstractValuesDefined = new Set(); // A set of nameStrings to ensure abstract values have unique names\n    this.debugNames = opts.debugNames;\n    this._checkedObjectIds = new Map();\n    this.optimizedFunctions = new Map();\n    this.arrayNestedOptimizedFunctionsEnabled =\n      opts.arrayNestedOptimizedFunctionsEnabled || opts.instantRender || false;\n    this.removeModuleFactoryFunctions = opts.removeModuleFactoryFunctions || false;\n  }\n\n  statistics: RealmStatistics;\n  start: number;\n  isReadOnly: boolean;\n  isStrict: boolean;\n  useAbstractInterpretation: boolean;\n  debugNames: void | boolean;\n  isInPureTryStatement: boolean; // TODO(1264): Remove this once we implement proper exception handling in abstract calls.\n  timeout: void | number;\n  mathRandomGenerator: void | (() => number);\n  strictlyMonotonicDateNow: boolean;\n  remainingCalls: number;\n  invariantLevel: number;\n  invariantMode: InvariantModeTypes;\n  ignoreLeakLogic: boolean;\n  emitConcreteModel: boolean;\n\n  abstractValueImpliesMax: number;\n  abstractValueImpliesCounter: number;\n  impliesCounterOverflowed: boolean;\n  inSimplificationPath: boolean;\n\n  modifiedBindings: void | Bindings;\n  modifiedProperties: void | PropertyBindings;\n  createdObjects: void | CreatedObjects;\n  createdObjectsTrackedForLeaks: void | CreatedObjects;\n  createdAbstracts: void | CreatedAbstracts;\n  reportObjectGetOwnProperties: void | ((ObjectValue | AbstractObjectValue) => void);\n  reportPropertyAccess: void | ((PropertyBinding, boolean) => void);\n  savedCompletion: void | JoinedNormalAndAbruptCompletions;\n\n  activeLexicalEnvironments: Set<LexicalEnvironment>;\n\n  // A set of abstract conditions that are known to be true in the current execution path.\n  // For example, the abstract condition of an if statement is known to be true inside its true branch.\n  pathConditions: PathConditions;\n\n  currentLocation: ?BabelNodeSourceLocation;\n  nextContextLocation: ?BabelNodeSourceLocation;\n  contextStack: Array<ExecutionContext> = [];\n  $GlobalEnv: LexicalEnvironment;\n  intrinsics: Intrinsics;\n\n  derivedIds: Map<string, TemporalOperationEntry>;\n  temporalEntryArgToEntries: Map<Value, Set<TemporalOperationEntry>>;\n  temporalEntryCounter: number;\n\n  instantRender: {\n    enabled: boolean,\n  };\n  react: {\n    // reactHints are generated to help improve the effeciency of the React reconciler when\n    // operating on a tree of React components. We can use reactHint to mark AbstractValues\n    // with extra data that helps us traverse through the tree that would otherwise not be possible\n    // (for example, when we use Relay's React containers with \"fb-www\" – which are AbstractObjectValues,\n    // we need to know what React component was passed to this AbstractObjectValue so we can visit it next)\n    abstractHints: WeakMap<AbstractValue | ObjectValue, ReactHint>,\n    activeReconciler: any, // inentionally \"any\", importing the React reconciler class increases Flow's cylic count\n    classComponentMetadata: Map<ECMAScriptSourceFunctionValue | BoundFunctionValue, ClassComponentMetadata>,\n    currentOwner?: ObjectValue,\n    defaultPropsHelper?: ECMAScriptSourceFunctionValue,\n    emptyArray: void | ArrayValue,\n    emptyObject: void | ObjectValue,\n    enabled: boolean,\n    failOnUnsupportedSideEffects: boolean,\n    hoistableFunctions: WeakMap<FunctionValue, boolean>,\n    hoistableReactElements: WeakMap<ObjectValue, boolean>,\n    noopFunction: void | ECMAScriptSourceFunctionValue,\n    optimizeNestedFunctions: boolean,\n    output?: ReactOutputTypes,\n    propsWithNoPartialKeyOrRef: WeakSet<ObjectValue | AbstractObjectValue>,\n    reactElements: WeakMap<ObjectValue, { createdDuringReconcilation: boolean, firstRenderOnly: boolean }>,\n    reactElementStringTypeReferences: Map<string, AbstractValue>,\n    reactProps: WeakSet<ObjectValue>,\n    symbols: Map<ReactSymbolTypes, SymbolValue>,\n    usedReactElementKeys: Set<string>,\n    verbose: boolean,\n  };\n  alreadyDescribedLocations: WeakMap<FunctionValue | BabelNodeSourceLocation, string | void>;\n  stripFlow: boolean;\n\n  fbLibraries: {\n    other: Map<string, AbstractValue>,\n    react: void | ObjectValue,\n    reactDom: void | ObjectValue,\n    reactDomServer: void | ObjectValue,\n    reactNative: void | ObjectValue,\n    reactRelay: void | ObjectValue,\n  };\n\n  $GlobalObject: ObjectValue | AbstractObjectValue;\n  compatibility: Compatibility;\n\n  $TemplateMap: Array<{ $Strings: Array<string>, $Array: ObjectValue }>;\n\n  generator: void | Generator;\n  preludeGenerator: void | PreludeGenerator;\n  timeoutCounter: number;\n  timeoutCounterThreshold: number;\n  evaluators: {\n    [key: string]: (\n      ast: BabelNode,\n      strictCode: boolean,\n      env: LexicalEnvironment,\n      realm: Realm,\n      metadata?: any\n    ) => Value | Reference,\n  };\n  simplifyAndRefineAbstractValue: AbstractValue => Value;\n  simplifyAndRefineAbstractCondition: AbstractValue => Value;\n\n  collectedNestedOptimizedFunctionEffects: Map<ECMAScriptSourceFunctionValue, Effects>;\n  removeModuleFactoryFunctions: boolean;\n  moduleFactoryFunctionsToRemove: Map<number, string>;\n  tracers: Array<Tracer>;\n\n  MOBILE_JSC_VERSION = \"jsc-600-1-4-17\";\n\n  errorHandler: ?ErrorHandler;\n  suppressDiagnostics = false;\n  objectCount = 0;\n  symbolCount = 867501803871088;\n  // Unique tag for identifying function body ast node. It is neeeded\n  // instead of ast node itself because we may perform ast tree deep clone\n  // during serialization which changes the ast identity.\n  functionBodyUniqueTagSeed = 1;\n\n  globalSymbolRegistry: Array<{ $Key: string, $Symbol: SymbolValue }>;\n\n  debuggerInstance: DebugServerType | void;\n  debugReproManager: DebugReproManagerType | void;\n\n  nextGeneratorId: number = 0;\n  _abstractValuesDefined: Set<string>;\n  _checkedObjectIds: Map<ObjectValue | AbstractObjectValue, number>;\n\n  optimizedFunctions: Map<FunctionValue | AbstractValue, ArgModel | void>;\n  arrayNestedOptimizedFunctionsEnabled: boolean;\n  currentOptimizedFunction: FunctionValue | void;\n\n  eagerlyRequireModuleDependencies: void | boolean;\n\n  // to force flow to type the annotations\n  isCompatibleWith(compatibility: Compatibility): boolean {\n    return compatibility === this.compatibility;\n  }\n\n  // Checks if there is a let binding at global scope with the given name\n  // returning it if so\n  getGlobalLetBinding(key: string): void | Value {\n    let globrec = this.$GlobalEnv.environmentRecord;\n    // GlobalEnv should have a GlobalEnvironmentRecord\n    invariant(globrec instanceof GlobalEnvironmentRecord);\n    let dclrec = globrec.$DeclarativeRecord;\n\n    try {\n      return dclrec.HasBinding(key) ? dclrec.GetBindingValue(key, false) : undefined;\n    } catch (e) {\n      if (e instanceof FatalError) return undefined;\n      throw e;\n    }\n  }\n\n  /*\n   Read only realms disallow:\n   - using console.log\n   - creating bindings in any existing scopes\n   - modifying object properties in any existing scopes\n   Setting a realm read-only sets all contained environments to read-only, but\n   all new environments (e.g. new ExecutionContexts) will be writeable.\n   */\n  setReadOnly(readOnlyValue: boolean): boolean {\n    let oldReadOnly = this.isReadOnly;\n    this.isReadOnly = readOnlyValue;\n    this.$GlobalEnv.environmentRecord.isReadOnly = readOnlyValue;\n    this.contextStack.forEach(ctx => {\n      ctx.setReadOnly(readOnlyValue);\n    });\n    return oldReadOnly;\n  }\n\n  testTimeout(): void {\n    let timeout = this.timeout;\n    if (timeout !== undefined && !--this.timeoutCounter) {\n      this.timeoutCounter = this.timeoutCounterThreshold;\n      let total = Date.now() - this.start;\n      if (total > timeout) {\n        let error = new CompilerDiagnostic(\n          `total time has exceeded the timeout time: ${timeout}`,\n          this.currentLocation,\n          \"PP0036\",\n          \"FatalError\"\n        );\n        this.handleError(error);\n        throw new FatalError(\"Timed out\");\n      }\n    }\n  }\n\n  hasRunningContext(): boolean {\n    return this.contextStack.length !== 0;\n  }\n\n  getRunningContext(): ExecutionContext {\n    let context = this.contextStack[this.contextStack.length - 1];\n    invariant(context, \"There's no running execution context\");\n    return context;\n  }\n\n  clearBlockBindings(modifiedBindings: void | Bindings, environmentRecord: DeclarativeEnvironmentRecord): void {\n    if (modifiedBindings === undefined) return;\n    for (let b of modifiedBindings.keys()) {\n      if (b.mightHaveBeenCaptured) continue;\n      if (environmentRecord.bindings[b.name] && environmentRecord.bindings[b.name] === b) modifiedBindings.delete(b);\n    }\n  }\n\n  // Call when a scope falls out of scope and should be destroyed.\n  // Clears the Bindings corresponding to the disappearing Scope from ModifiedBindings\n  onDestroyScope(lexicalEnvironment: LexicalEnvironment): void {\n    invariant(this.activeLexicalEnvironments.has(lexicalEnvironment));\n    let modifiedBindings = this.modifiedBindings;\n    if (modifiedBindings) {\n      // Don't undo things to global scope because it's needed past its destruction point (for serialization)\n      let environmentRecord = lexicalEnvironment.environmentRecord;\n      if (environmentRecord instanceof DeclarativeEnvironmentRecord) {\n        this.clearBlockBindings(modifiedBindings, environmentRecord);\n      }\n    }\n\n    // Ensures if we call onDestroyScope too early, there will be a failure.\n    this.activeLexicalEnvironments.delete(lexicalEnvironment);\n    lexicalEnvironment.destroy();\n  }\n\n  startCall() {\n    if (this.remainingCalls === 0) {\n      let error = new CompilerDiagnostic(\"Maximum stack depth exceeded\", this.currentLocation, \"PP0045\", \"FatalError\");\n      this.handleError(error);\n      throw new FatalError();\n    }\n    this.remainingCalls--;\n  }\n\n  endCall() {\n    this.remainingCalls++;\n  }\n\n  pushContext(context: ExecutionContext): void {\n    this.contextStack.push(context);\n  }\n\n  markVisibleLocalBindingsAsPotentiallyCaptured(): void {\n    let context = this.getRunningContext();\n    if (context.function === undefined) return;\n    let lexEnv = context.lexicalEnvironment;\n    while (lexEnv != null) {\n      let envRec = lexEnv.environmentRecord;\n      if (envRec instanceof DeclarativeEnvironmentRecord) {\n        let bindings = envRec.bindings;\n        for (let name in bindings) {\n          let binding = bindings[name];\n          binding.mightHaveBeenCaptured = true;\n        }\n      }\n      lexEnv = lexEnv.parent;\n    }\n  }\n\n  clearFunctionBindings(modifiedBindings: void | Bindings, funcVal: FunctionValue): void {\n    if (modifiedBindings === undefined) return;\n    for (let b of modifiedBindings.keys()) {\n      if (b.mightHaveBeenCaptured) continue;\n      if (b.environment instanceof FunctionEnvironmentRecord && b.environment.$FunctionObject === funcVal)\n        modifiedBindings.delete(b);\n    }\n  }\n\n  popContext(context: ExecutionContext): void {\n    let funcVal = context.function;\n    if (funcVal) {\n      this.clearFunctionBindings(this.modifiedBindings, funcVal);\n    }\n    let c = this.contextStack.pop();\n    invariant(c === context);\n  }\n\n  wrapInGlobalEnv<T>(callback: () => T): T {\n    let context = new ExecutionContext();\n    context.isStrict = this.isStrict;\n    context.lexicalEnvironment = this.$GlobalEnv;\n    context.variableEnvironment = this.$GlobalEnv;\n    context.realm = this;\n\n    this.pushContext(context);\n    try {\n      return callback();\n    } finally {\n      this.popContext(context);\n    }\n  }\n\n  assignToGlobal(name: BabelNodeLVal, value: Value): void {\n    this.wrapInGlobalEnv(() => this.$GlobalEnv.assignToGlobal(name, value));\n  }\n\n  deleteGlobalBinding(name: string): void {\n    this.$GlobalEnv.environmentRecord.DeleteBinding(name);\n  }\n\n  neverCheckProperty(object: ObjectValue | AbstractObjectValue, P: string): boolean {\n    return (\n      P.startsWith(\"__\") ||\n      (object === this.$GlobalObject && P === \"global\") ||\n      (object.intrinsicName !== undefined && object.intrinsicName.startsWith(\"__\"))\n    );\n  }\n\n  _getCheckedBindings(): ObjectValue {\n    let globalObject = this.$GlobalObject;\n    invariant(globalObject instanceof ObjectValue);\n    let binding = globalObject.properties.get(\"__checkedBindings\");\n    invariant(binding !== undefined);\n    let checkedBindingsObject = binding.descriptor && binding.descriptor.throwIfNotConcrete(this).value;\n    invariant(checkedBindingsObject instanceof ObjectValue);\n    return checkedBindingsObject;\n  }\n\n  markPropertyAsChecked(object: ObjectValue | AbstractObjectValue, P: string): void {\n    invariant(!this.neverCheckProperty(object, P));\n    let objectId = this._checkedObjectIds.get(object);\n    if (objectId === undefined) this._checkedObjectIds.set(object, (objectId = this._checkedObjectIds.size));\n    let id = `__propertyHasBeenChecked__${objectId}:${P}`;\n    let checkedBindings = this._getCheckedBindings();\n    checkedBindings.$Set(id, this.intrinsics.true, checkedBindings);\n  }\n\n  hasBindingBeenChecked(object: ObjectValue | AbstractObjectValue, P: string): void | boolean {\n    if (this.neverCheckProperty(object, P)) return true;\n    let objectId = this._checkedObjectIds.get(object);\n    if (objectId === undefined) return false;\n    let id = `__propertyHasBeenChecked__${objectId}:${P}`;\n    let binding = this._getCheckedBindings().properties.get(id);\n    if (binding === undefined) return false;\n    let value = binding.descriptor && binding.descriptor.throwIfNotConcrete(this).value;\n    return value instanceof Value && !value.mightNotBeTrue();\n  }\n\n  // Evaluate a context as if it won't have any side-effects outside of any objects\n  // that it created itself. This promises that any abstract functions inside of it\n  // also won't have effects on any objects or bindings that weren't created in this\n  // call.\n  evaluateWithPureScope<T>(f: () => T): T {\n    invariant(\n      this.createdObjectsTrackedForLeaks === undefined,\n      \"evaluateWithPureScope cannot have nested evalautePure scopes\"\n    );\n    let saved_createdObjectsTrackedForLeaks = this.createdObjectsTrackedForLeaks;\n    this.createdObjectsTrackedForLeaks = new Set();\n    try {\n      return f();\n    } finally {\n      if (saved_createdObjectsTrackedForLeaks === undefined) {\n        this.createdObjectsTrackedForLeaks = undefined;\n      } else {\n        this.createdObjectsTrackedForLeaks = saved_createdObjectsTrackedForLeaks;\n      }\n    }\n  }\n\n  isInPureScope(): boolean {\n    return !!this.createdObjectsTrackedForLeaks;\n  }\n\n  evaluateWithoutLeakLogic(f: () => Value): Value {\n    invariant(!this.ignoreLeakLogic, \"Nesting evaluateWithoutLeakLogic() calls is not supported.\");\n    this.ignoreLeakLogic = true;\n    try {\n      return f();\n    } finally {\n      this.ignoreLeakLogic = false;\n    }\n  }\n\n  // Evaluate some code that might generate temporal values knowing that it might end in an abrupt\n  // completion. We only need to support ThrowCompletion for now but this can be expanded to support other\n  // abrupt completions.\n  evaluateWithPossibleThrowCompletion(f: () => Value, thrownTypes: TypesDomain, thrownValues: ValuesDomain): Value {\n    // The cases when we need this are only when we might invoke unknown code such as abstract\n    // funtions, getters, custom coercion etc. It is possible we can use this in other cases\n    // where something might throw a built-in error but can never issue arbitrary code such as\n    // calling something that might not be a function. For now we only use it in pure functions.\n    invariant(this.isInPureScope(), \"only abstract abrupt completion in pure functions\");\n\n    // TODO(1264): We should create a new generator for this scope and wrap it in a try/catch.\n    // We could use the outcome of that as the join condition for a JoinedNormalAndAbruptCompletions.\n    // We should then compose that with the saved completion and move on to the normal route.\n    // Currently we just issue a recoverable error instead if this might matter.\n    let value = f();\n    if (this.isInPureTryStatement) {\n      let diag = new CompilerDiagnostic(\n        \"Possible throw inside try/catch is not yet supported\",\n        this.currentLocation,\n        \"PP0021\",\n        \"RecoverableError\"\n      );\n      if (this.handleError(diag) !== \"Recover\") throw new FatalError();\n    }\n    return value;\n  }\n\n  // Evaluate the given ast in a sandbox and return the evaluation results\n  // in the form of a completion, a code generator, a map of changed variable\n  // bindings and a map of changed property bindings.\n  evaluateNodeForEffects(\n    ast: BabelNode,\n    strictCode: boolean,\n    env: LexicalEnvironment,\n    state?: any,\n    generatorName?: string = \"evaluateNodeForEffects\"\n  ): Effects {\n    return this.evaluateForEffects(() => env.evaluateCompletionDeref(ast, strictCode), state, generatorName);\n  }\n\n  evaluateForEffectsInGlobalEnv(\n    func: () => Value,\n    state?: any,\n    generatorName?: string = \"evaluateForEffectsInGlobalEnv\"\n  ): Effects {\n    return this.wrapInGlobalEnv(() => this.evaluateForEffects(func, state, generatorName));\n  }\n\n  evaluateFunctionForPureEffectsInGlobalEnv(\n    func: FunctionValue,\n    f: () => Value,\n    sideEffectCallback: SideEffectCallback,\n    state?: any,\n    generatorName?: string = \"evaluateFunctionForPureEffectsInGlobalEnv\"\n  ): Effects {\n    return this.wrapInGlobalEnv(() =>\n      this.evaluateFunctionForPureEffects(func, f, state, generatorName, sideEffectCallback)\n    );\n  }\n\n  // NB: does not apply generators because there's no way to cleanly revert them.\n  // func should not return undefined\n  withEffectsAppliedInGlobalEnv<T>(func: Effects => T, effects: Effects): T {\n    let result: T;\n    this.evaluateForEffectsInGlobalEnv(() => {\n      try {\n        this.applyEffects(effects, \"\", false);\n        result = func(effects);\n        return this.intrinsics.undefined;\n      } finally {\n        this.restoreBindings(effects.modifiedBindings);\n        this.restoreProperties(effects.modifiedProperties);\n        invariant(!effects.canBeApplied);\n        effects.canBeApplied = true;\n      }\n    });\n    invariant(result !== undefined, \"If we get here, func must have returned undefined.\");\n    return result;\n  }\n\n  withNewOptimizedFunction<T>(func: () => T, optimizedFunction: FunctionValue): T {\n    let result: T;\n    let previousOptimizedFunction = this.currentOptimizedFunction;\n    this.currentOptimizedFunction = optimizedFunction;\n    try {\n      result = func();\n    } finally {\n      this.currentOptimizedFunction = previousOptimizedFunction;\n    }\n    return result;\n  }\n\n  evaluateNodeForEffectsInGlobalEnv(node: BabelNode, state?: any, generatorName?: string): Effects {\n    return this.wrapInGlobalEnv(() => this.evaluateNodeForEffects(node, false, this.$GlobalEnv, state, generatorName));\n  }\n\n  // Use this to evaluate code for internal purposes, so that the tracked state does not get polluted\n  evaluateWithoutEffects<T>(f: () => T): T {\n    // Save old state and set up undefined state\n    let savedGenerator = this.generator;\n    let savedBindings = this.modifiedBindings;\n    let savedProperties = this.modifiedProperties;\n    let savedCreatedObjects = this.createdObjects;\n    let saved_completion = this.savedCompletion;\n    try {\n      this.generator = new Generator(this, \"evaluateIgnoringEffects\", this.pathConditions);\n      this.modifiedBindings = undefined;\n      this.modifiedProperties = undefined;\n      this.createdObjects = undefined;\n      this.savedCompletion = undefined;\n      return f();\n    } finally {\n      this.generator = savedGenerator;\n      this.modifiedBindings = savedBindings;\n      this.modifiedProperties = savedProperties;\n      this.createdObjects = savedCreatedObjects;\n      this.savedCompletion = saved_completion;\n    }\n  }\n\n  evaluateFunctionForPureEffects(\n    func: FunctionValue,\n    f: () => Completion | Value,\n    state: any,\n    generatorName: string,\n    sideEffectCallback: SideEffectCallback\n  ): Effects {\n    let effects = this.evaluateForEffects(f, state, generatorName);\n    Utils.reportSideEffectsFromEffects(this, effects, func, sideEffectCallback);\n    return effects;\n  }\n\n  evaluateForEffects(f: () => Completion | Value, state: any, generatorName: string): Effects {\n    // Save old state and set up empty state\n    let [savedBindings, savedProperties] = this.getAndResetModifiedMaps();\n    let saved_generator = this.generator;\n    let saved_createdObjects = this.createdObjects;\n    let saved_createdAbstracts = this.createdAbstracts;\n    let saved_completion = this.savedCompletion;\n    let saved_abstractValuesDefined = this._abstractValuesDefined;\n    this.generator = new Generator(this, generatorName, this.pathConditions);\n    this.createdObjects = new Set();\n    this.createdAbstracts = new Set();\n    this.savedCompletion = undefined; // while in this call, we only explore the normal path.\n    this._abstractValuesDefined = new Set(saved_abstractValuesDefined);\n\n    let result;\n    try {\n      for (let t1 of this.tracers) t1.beginEvaluateForEffects(state);\n\n      let c;\n      try {\n        try {\n          c = f();\n          if (c instanceof Reference) c = Environment.GetValue(this, c);\n          else if (c instanceof SimpleNormalCompletion) c = c.value;\n        } catch (e) {\n          if (e instanceof AbruptCompletion) c = e;\n          else throw e;\n        }\n        // This is a join point for any normal completions inside realm.savedCompletion\n        c = Functions.incorporateSavedCompletion(this, c);\n        invariant(c !== undefined);\n\n        invariant(this.generator !== undefined);\n        invariant(this.modifiedBindings !== undefined);\n        invariant(this.modifiedProperties !== undefined);\n        invariant(this.createdObjects !== undefined);\n        let astGenerator = this.generator;\n        let astBindings = this.modifiedBindings;\n        let astProperties = this.modifiedProperties;\n        let astCreatedObjects = this.createdObjects;\n        let astCreatedAbstracts = this.createdAbstracts;\n\n        /* TODO #1615: The following invariant should hold.\n\n        // Check invariant that modified bindings to not refer to environment record belonging to\n        // newly created closure objects.\n        for (let binding of astBindings.keys())\n          if (binding.environment instanceof FunctionEnvironmentRecord)\n            invariant(!astCreatedObjects.has(binding.environment.$FunctionObject));\n        */\n\n        // Return the captured state changes and evaluation result\n        if (c instanceof Value) c = new SimpleNormalCompletion(c);\n        invariant(astCreatedAbstracts !== undefined);\n        result = new Effects(c, astGenerator, astBindings, astProperties, astCreatedObjects, astCreatedAbstracts);\n        return result;\n      } finally {\n        // Roll back the state changes\n        if (result !== undefined) {\n          this.restoreBindings(result.modifiedBindings);\n          this.restoreProperties(result.modifiedProperties);\n        } else {\n          this.restoreBindings(this.modifiedBindings);\n          this.restoreProperties(this.modifiedProperties);\n          let completion = this.savedCompletion;\n          while (completion !== undefined) {\n            const { savedEffects } = completion;\n            if (savedEffects !== undefined) {\n              this.restoreBindings(savedEffects.modifiedBindings);\n              this.restoreProperties(savedEffects.modifiedProperties);\n            }\n            completion = completion.composedWith;\n          }\n        }\n        this.generator = saved_generator;\n        this.modifiedBindings = savedBindings;\n        this.modifiedProperties = savedProperties;\n        this.createdObjects = saved_createdObjects;\n        this.createdAbstracts = saved_createdAbstracts;\n        this.savedCompletion = saved_completion;\n        this._abstractValuesDefined = saved_abstractValuesDefined;\n      }\n    } finally {\n      for (let t2 of this.tracers) t2.endEvaluateForEffects(state, result);\n    }\n  }\n\n  evaluateWithUndo(f: () => Value, defaultValue: Value = this.intrinsics.undefined): Value {\n    if (!this.useAbstractInterpretation) return f();\n    let oldErrorHandler = this.errorHandler;\n    this.errorHandler = d => {\n      if (d.severity === \"Information\" || d.severity === \"Warning\") return \"Recover\";\n      return \"Fail\";\n    };\n    try {\n      let effects = this.evaluateForEffects(\n        () => {\n          try {\n            return f();\n          } catch (e) {\n            if (e instanceof Completion) {\n              return defaultValue;\n            } else if (e instanceof FatalError) {\n              return defaultValue;\n            } else {\n              throw e;\n            }\n          }\n        },\n        undefined,\n        \"evaluateWithUndo\"\n      );\n      return effects.result instanceof SimpleNormalCompletion ? effects.result.value : defaultValue;\n    } finally {\n      this.errorHandler = oldErrorHandler;\n    }\n  }\n\n  evaluateWithUndoForDiagnostic(f: () => Value): CompilerDiagnostic | Value {\n    if (!this.useAbstractInterpretation) return f();\n    let savedHandler = this.errorHandler;\n    let diagnostic;\n    try {\n      this.errorHandler = d => {\n        diagnostic = d;\n        return \"Fail\";\n      };\n      let effects = this.evaluateForEffects(f, undefined, \"evaluateWithUndoForDiagnostic\");\n      this.applyEffects(effects);\n      let resultVal = effects.result;\n      if (resultVal instanceof AbruptCompletion) throw resultVal;\n      return resultVal.value;\n    } catch (e) {\n      if (diagnostic !== undefined) return diagnostic;\n      throw e;\n    } finally {\n      this.errorHandler = savedHandler;\n    }\n  }\n\n  evaluateForFixpointEffects(iteration: () => [Value, EvaluationResult]): void | [Effects, Effects, AbstractValue] {\n    try {\n      let test;\n      let f = () => {\n        let result;\n        [test, result] = iteration();\n        if (!(test instanceof AbstractValue)) throw new FatalError(\"loop terminates before fixed point\");\n        invariant(result instanceof Completion);\n        return result;\n      };\n      let effects1 = this.evaluateForEffects(f, undefined, \"evaluateForFixpointEffects/1\");\n      while (true) {\n        this.restoreBindings(effects1.modifiedBindings);\n        this.restoreProperties(effects1.modifiedProperties);\n        let effects2 = this.evaluateForEffects(f, undefined, \"evaluateForFixpointEffects/2\");\n        this.restoreBindings(effects1.modifiedBindings);\n        this.restoreProperties(effects1.modifiedProperties);\n        if (Widen.containsEffects(effects1, effects2)) {\n          // effects1 includes every value present in effects2, so doing another iteration using effects2 will not\n          // result in any more values being added to abstract domains and hence a fixpoint has been reached.\n          // Generate code using effects2 because its expressions have not been widened away.\n          const e2 = effects2;\n          this._applyPropertiesToNewlyCreatedObjects(e2.modifiedProperties, e2.createdObjects);\n          this._emitPropertyAssignments(e2.generator, e2.modifiedProperties, e2.createdObjects);\n          this._emitLocalAssignments(e2.generator, e2.modifiedBindings, e2.createdObjects);\n          invariant(test instanceof AbstractValue);\n          let cond = e2.generator.deriveAbstract(\n            test.types,\n            test.values,\n            [test],\n            createOperationDescriptor(\"SINGLE_ARG\"),\n            { skipInvariant: true }\n          );\n          return [effects1, effects2, cond];\n        }\n        effects1 = Widen.widenEffects(this, effects1, effects2);\n      }\n    } catch (e) {\n      if (e instanceof FatalError) return undefined;\n      throw e;\n    }\n  }\n\n  evaluateWithAbstractConditional(\n    condValue: Value,\n    consequentEffectsFunc: () => Effects,\n    alternateEffectsFunc: () => Effects\n  ): Value {\n    let effects;\n    if (Path.implies(condValue)) {\n      effects = consequentEffectsFunc();\n    } else if (Path.impliesNot(condValue)) {\n      effects = alternateEffectsFunc();\n    } else {\n      // Join effects\n      let effects1;\n      try {\n        effects1 = Path.withCondition(condValue, consequentEffectsFunc);\n      } catch (e) {\n        if (!(e instanceof InfeasiblePathError)) throw e;\n      }\n\n      let effects2;\n      try {\n        effects2 = Path.withInverseCondition(condValue, alternateEffectsFunc);\n      } catch (e) {\n        if (!(e instanceof InfeasiblePathError)) throw e;\n      }\n\n      if (effects1 === undefined || effects2 === undefined) {\n        if (effects1 === undefined && effects2 === undefined) throw new InfeasiblePathError();\n        effects = effects1 || effects2;\n        invariant(effects !== undefined);\n      } else {\n        // Join the effects, creating an abstract view of what happened, regardless\n        // of the actual value of condValue.\n        effects = Join.joinEffects(condValue, effects1, effects2);\n      }\n    }\n    this.applyEffects(effects);\n\n    return condValue.$Realm.returnOrThrowCompletion(effects.result);\n  }\n\n  _applyPropertiesToNewlyCreatedObjects(\n    modifiedProperties: void | PropertyBindings,\n    newlyCreatedObjects: CreatedObjects\n  ): void {\n    if (modifiedProperties === undefined) return;\n    modifiedProperties.forEach((desc, propertyBinding, m) => {\n      if (newlyCreatedObjects.has(propertyBinding.object)) {\n        propertyBinding.descriptor = desc;\n      }\n    });\n  }\n\n  // populate the loop body generator with assignments that will update the phiNodes\n  _emitLocalAssignments(gen: Generator, bindings: Bindings, newlyCreatedObjects: CreatedObjects): void {\n    let tvalFor: Map<any, AbstractValue> = new Map();\n    bindings.forEach((binding, key, map) => {\n      let val = binding.value;\n      if (val instanceof AbstractValue) {\n        invariant(val.operationDescriptor !== undefined);\n        let tval = gen.deriveAbstract(val.types, val.values, [val], createOperationDescriptor(\"SINGLE_ARG\"));\n        tvalFor.set(key, tval);\n      }\n    });\n    bindings.forEach((binding, key, map) => {\n      let val = binding.value;\n      if (val instanceof AbstractValue) {\n        let phiNode = key.phiNode;\n        let tval = tvalFor.get(key);\n        invariant(tval !== undefined);\n        gen.emitStatement([tval], createOperationDescriptor(\"LOCAL_ASSIGNMENT\", { value: phiNode }));\n      }\n\n      if (val instanceof ObjectValue && newlyCreatedObjects.has(val)) {\n        let phiNode = key.phiNode;\n        gen.emitStatement([val], createOperationDescriptor(\"LOCAL_ASSIGNMENT\", { value: phiNode }));\n      }\n    });\n  }\n\n  // populate the loop body generator with assignments that will update properties modified inside the loop\n  _emitPropertyAssignments(gen: Generator, pbindings: PropertyBindings, newlyCreatedObjects: CreatedObjects): void {\n    let tvalFor: Map<any, AbstractValue> = new Map();\n    pbindings.forEach((val, key, map) => {\n      if (newlyCreatedObjects.has(key.object) || key.object.refuseSerialization) {\n        return;\n      }\n      let value = val && val.throwIfNotConcrete(this).value;\n      if (value instanceof AbstractValue) {\n        invariant(value.operationDescriptor !== undefined);\n        let tval = gen.deriveAbstract(\n          value.types,\n          value.values,\n          [key.object, value],\n          createOperationDescriptor(\"LOGICAL_PROPERTY_ASSIGNMENT\", { propertyBinding: key, value }),\n          {\n            skipInvariant: true,\n          }\n        );\n        tvalFor.set(key, tval);\n      }\n    });\n    pbindings.forEach((val, key, map) => {\n      if (newlyCreatedObjects.has(key.object) || key.object.refuseSerialization) {\n        return;\n      }\n      let path = key.pathNode;\n      let tval = tvalFor.get(key);\n      invariant(val !== undefined);\n      let value = val.throwIfNotConcrete(this).value;\n      invariant(value instanceof Value);\n      let keyKey = key.key;\n      if (typeof keyKey === \"string\") {\n        if (path !== undefined) {\n          gen.emitStatement(\n            [key.object, tval || value, this.intrinsics.empty, new StringValue(this, keyKey)],\n            createOperationDescriptor(\"CONDITIONAL_PROPERTY_ASSIGNMENT\", { path, value })\n          );\n        } else {\n          // RH value was not widened, so it must have been a constant. We don't need to assign that inside the loop.\n          // Note, however, that if the LH side is a property of an intrinsic object, then an assignment will\n          // have been emitted to the generator.\n        }\n      } else {\n        // TODO: What if keyKey is undefined?\n        invariant(keyKey instanceof Value);\n        gen.emitStatement(\n          [key.object, keyKey, tval || value, this.intrinsics.empty],\n          createOperationDescriptor(\"PROPERTY_ASSIGNMENT\", { path })\n        );\n      }\n    });\n  }\n\n  returnOrThrowCompletion(completion: Completion | Value): Value {\n    if (completion instanceof Value) completion = new SimpleNormalCompletion(completion);\n    if (completion instanceof AbruptCompletion) {\n      let c = Functions.incorporateSavedCompletion(this, completion);\n      invariant(c instanceof Completion);\n      completion = c;\n    }\n    let cc = this.composeWithSavedCompletion(completion);\n    if (cc instanceof AbruptCompletion) throw cc;\n    return cc.value;\n  }\n\n  composeWithSavedCompletion(completion: Completion): Completion {\n    if (this.savedCompletion === undefined) {\n      if (completion instanceof JoinedNormalAndAbruptCompletions) {\n        this.savedCompletion = completion;\n        this.pushPathConditionsLeadingToNormalCompletions(completion);\n        this.captureEffects(completion);\n      }\n      return completion;\n    } else {\n      let cc = Join.composeCompletions(this.savedCompletion, completion);\n      if (cc instanceof JoinedNormalAndAbruptCompletions) {\n        this.savedCompletion = cc;\n        this.pushPathConditionsLeadingToNormalCompletions(completion);\n        if (cc.savedEffects === undefined) this.captureEffects(cc);\n      } else {\n        this.savedCompletion = undefined;\n      }\n      return cc;\n    }\n  }\n\n  pushPathConditionsLeadingToNormalCompletions(completion: Completion): void {\n    let realm = this;\n    let bottomValue = realm.intrinsics.__bottomValue;\n    // Note that if a completion of type CompletionType has a value is that is bottom, that completion is unreachable\n    // and pushing its corresponding path condition would cause an InfeasiblePathError to be thrown.\n    if (completion instanceof JoinedNormalAndAbruptCompletions && completion.composedWith !== undefined)\n      this.pushPathConditionsLeadingToNormalCompletions(completion.composedWith);\n    if (completion instanceof JoinedAbruptCompletions || completion instanceof JoinedNormalAndAbruptCompletions) {\n      let jc = completion.joinCondition;\n      if (completion.consequent.value === bottomValue || allPathsAreOfType(AbruptCompletion, completion.consequent)) {\n        if (completion.alternate.value === bottomValue || allPathsAreOfType(AbruptCompletion, completion.alternate))\n          return;\n        Path.pushInverseAndRefine(completion.joinCondition);\n        this.pushPathConditionsLeadingToNormalCompletions(completion.alternate);\n      } else if (\n        completion.alternate.value === bottomValue ||\n        allPathsAreOfType(AbruptCompletion, completion.alternate)\n      ) {\n        if (completion.consequent.value === bottomValue) return;\n        Path.pushAndRefine(completion.joinCondition);\n        this.pushPathConditionsLeadingToNormalCompletions(completion.consequent);\n      } else if (allPathsAreOfType(NormalCompletion, completion.consequent)) {\n        if (!allPathsAreOfType(NormalCompletion, completion.alternate)) {\n          let alternatePC = getNormalPathConditions(completion.alternate);\n          let disjunct = AbstractValue.createFromLogicalOp(realm, \"||\", jc, alternatePC, undefined, true, true);\n          Path.pushAndRefine(disjunct);\n        }\n      } else if (allPathsAreOfType(NormalCompletion, completion.alternate)) {\n        let consequentPC = getNormalPathConditions(completion.consequent);\n        let inverse = AbstractValue.createFromUnaryOp(realm, \"!\", jc, true, undefined, true, true);\n        let disjunct = AbstractValue.createFromLogicalOp(realm, \"||\", inverse, consequentPC, undefined, true, true);\n        Path.pushAndRefine(disjunct);\n      } else {\n        let cpc = AbstractValue.createFromLogicalOp(\n          realm,\n          \"&&\",\n          jc,\n          getNormalPathConditions(completion.consequent),\n          undefined,\n          true,\n          true\n        );\n        let ijc = AbstractValue.createFromUnaryOp(realm, \"!\", jc, true, undefined, true, true);\n        let apc = AbstractValue.createFromLogicalOp(\n          realm,\n          \"&&\",\n          ijc,\n          getNormalPathConditions(completion.alternate),\n          undefined,\n          true,\n          true\n        );\n        let disjunct = AbstractValue.createFromLogicalOp(realm, \"||\", cpc, apc, undefined, true, true);\n        Path.pushAndRefine(disjunct);\n      }\n    }\n    return;\n\n    function allPathsAreOfType(CompletionType: typeof Completion, c: Completion): boolean {\n      if (c instanceof JoinedNormalAndAbruptCompletions) {\n        if (c.composedWith !== undefined && !allPathsAreOfType(CompletionType, c.composedWith)) return false;\n        return allPathsAreOfType(CompletionType, c.consequent) && allPathsAreOfType(CompletionType, c.alternate);\n      } else if (c instanceof JoinedAbruptCompletions) {\n        return allPathsAreOfType(CompletionType, c.consequent) && allPathsAreOfType(CompletionType, c.alternate);\n      } else {\n        return c instanceof CompletionType;\n      }\n    }\n\n    function getNormalPathConditions(c: Completion): Value {\n      let pathCondToComposeWith;\n      if (c instanceof JoinedNormalAndAbruptCompletions && c.composedWith !== undefined)\n        pathCondToComposeWith = getNormalPathConditions(c.composedWith);\n      if (!(c instanceof JoinedAbruptCompletions || c instanceof JoinedNormalAndAbruptCompletions)) {\n        return c instanceof AbruptCompletion ? realm.intrinsics.false : realm.intrinsics.true;\n      }\n      let pathCond;\n      if (c.consequent.value === bottomValue || allPathsAreOfType(AbruptCompletion, c.consequent)) {\n        if (!allPathsAreOfType(AbruptCompletion, c.alternate)) {\n          let inverse = AbstractValue.createFromUnaryOp(realm, \"!\", c.joinCondition, true, undefined, true, true);\n          if (allPathsAreOfType(NormalCompletion, c.alternate)) pathCond = inverse;\n          else\n            pathCond = AbstractValue.createFromLogicalOp(\n              realm,\n              \"&&\",\n              inverse,\n              getNormalPathConditions(c.alternate),\n              undefined,\n              true,\n              true\n            );\n        }\n      } else if (c.alternate.value === bottomValue || allPathsAreOfType(AbruptCompletion, c.alternate)) {\n        if (!allPathsAreOfType(AbruptCompletion, c.consequent)) {\n          if (allPathsAreOfType(NormalCompletion, c.consequent)) {\n            pathCond = c.joinCondition;\n          } else {\n            let jc = c.joinCondition;\n            pathCond = AbstractValue.createFromLogicalOp(\n              realm,\n              \"&&\",\n              jc,\n              getNormalPathConditions(c.consequent),\n              undefined,\n              true,\n              true\n            );\n          }\n        }\n      } else {\n        let jc = c.joinCondition;\n        let consequentPC = AbstractValue.createFromLogicalOp(\n          realm,\n          \"&&\",\n          jc,\n          getNormalPathConditions(c.consequent),\n          undefined,\n          true,\n          true\n        );\n        let ijc = AbstractValue.createFromUnaryOp(realm, \"!\", jc, true, undefined, true, true);\n        let alternatePC = AbstractValue.createFromLogicalOp(\n          realm,\n          \"&&\",\n          ijc,\n          getNormalPathConditions(c.alternate),\n          undefined,\n          true,\n          true\n        );\n        pathCond = AbstractValue.createFromLogicalOp(realm, \"||\", consequentPC, alternatePC, undefined, true, true);\n      }\n      if (pathCondToComposeWith === undefined && pathCond === undefined) return realm.intrinsics.false;\n      if (pathCondToComposeWith === undefined) {\n        invariant(pathCond !== undefined);\n        return pathCond;\n      }\n      if (pathCond === undefined) return pathCondToComposeWith;\n      return AbstractValue.createFromLogicalOp(realm, \"&&\", pathCondToComposeWith, pathCond, undefined, true, true);\n    }\n  }\n\n  captureEffects(completion: JoinedNormalAndAbruptCompletions): void {\n    invariant(completion.savedEffects === undefined);\n    completion.savedEffects = new Effects(\n      new SimpleNormalCompletion(this.intrinsics.undefined),\n      (this.generator: any),\n      (this.modifiedBindings: any),\n      (this.modifiedProperties: any),\n      (this.createdObjects: any),\n      (this.createdAbstracts: any)\n    );\n    this.generator = new Generator(this, \"captured\", this.pathConditions);\n    this.modifiedBindings = new Map();\n    this.modifiedProperties = new Map();\n    this.createdObjects = new Set();\n    this.createdAbstracts = new Set();\n  }\n\n  getCapturedEffects(v?: Completion | Value = this.intrinsics.undefined): Effects {\n    invariant(this.generator !== undefined);\n    invariant(this.modifiedBindings !== undefined);\n    invariant(this.modifiedProperties !== undefined);\n    invariant(this.createdObjects !== undefined);\n    invariant(this.createdAbstracts !== undefined);\n    return new Effects(\n      v instanceof Completion ? v : new SimpleNormalCompletion(v),\n      this.generator,\n      this.modifiedBindings,\n      this.modifiedProperties,\n      this.createdObjects,\n      this.createdAbstracts\n    );\n  }\n\n  stopEffectCaptureAndUndoEffects(completion: JoinedNormalAndAbruptCompletions): void {\n    // Roll back the state changes\n    this.restoreBindings(this.modifiedBindings);\n    this.restoreProperties(this.modifiedProperties);\n\n    // Restore saved state\n    if (completion.savedEffects !== undefined) {\n      const savedEffects = completion.savedEffects;\n      completion.savedEffects = undefined;\n      this.generator = savedEffects.generator;\n      this.modifiedBindings = savedEffects.modifiedBindings;\n      this.modifiedProperties = savedEffects.modifiedProperties;\n      this.createdObjects = savedEffects.createdObjects;\n      this.createdAbstracts = savedEffects.createdAbstracts;\n    } else {\n      invariant(false);\n    }\n  }\n\n  // Apply the given effects to the global state\n  applyEffects(effects: Effects, leadingComment: string = \"\", appendGenerator: boolean = true): void {\n    invariant(\n      effects.canBeApplied,\n      \"Effects have been applied and not properly reverted. It is not safe to apply them a second time.\"\n    );\n    effects.canBeApplied = false;\n    let { generator, modifiedBindings, modifiedProperties, createdObjects, createdAbstracts } = effects;\n\n    // Add generated code for property modifications\n    if (appendGenerator) this.appendGenerator(generator, leadingComment);\n\n    // Restore modifiedBindings\n    this.restoreBindings(modifiedBindings);\n    this.restoreProperties(modifiedProperties);\n\n    // track modifiedBindings\n    let realmModifiedBindings = this.modifiedBindings;\n    if (realmModifiedBindings !== undefined) {\n      modifiedBindings.forEach((val, key, m) => {\n        invariant(realmModifiedBindings !== undefined);\n        if (!realmModifiedBindings.has(key)) {\n          realmModifiedBindings.set(key, val);\n        }\n      });\n    }\n    let realmModifiedProperties = this.modifiedProperties;\n    if (realmModifiedProperties !== undefined) {\n      modifiedProperties.forEach((desc, propertyBinding, m) => {\n        invariant(realmModifiedProperties !== undefined);\n        if (!realmModifiedProperties.has(propertyBinding)) {\n          realmModifiedProperties.set(propertyBinding, desc);\n        }\n      });\n    }\n\n    // add created objects\n    if (createdObjects.size > 0) {\n      let realmCreatedObjects = this.createdObjects;\n      if (realmCreatedObjects === undefined) this.createdObjects = new Set(createdObjects);\n      else {\n        createdObjects.forEach((ob, a) => {\n          invariant(realmCreatedObjects !== undefined);\n          realmCreatedObjects.add(ob);\n        });\n      }\n    }\n\n    // add created abstracts\n    if (createdAbstracts.size > 0) {\n      let realmCreatedAbstracts = this.createdAbstracts;\n      if (realmCreatedAbstracts === undefined) this.createdAbstracts = new Set(createdAbstracts);\n      else {\n        createdAbstracts.forEach((ob, a) => {\n          invariant(realmCreatedAbstracts !== undefined);\n          realmCreatedAbstracts.add(ob);\n        });\n      }\n    }\n  }\n\n  outputToConsole(method: ConsoleMethodTypes, args: Array<string | ConcreteValue>): void {\n    if (this.isReadOnly) {\n      // This only happens during speculative execution and is reported elsewhere\n      throw new FatalError(\"Trying to create console output in read-only realm\");\n    }\n    if (this.useAbstractInterpretation) {\n      invariant(this.generator !== undefined);\n      this.generator.emitConsoleLog(method, args);\n    } else {\n      // $FlowFixMe: Flow doesn't have type data for all the console methods yet\n      console[method](getString(this, args));\n    }\n\n    function getString(realm: Realm, values: Array<string | ConcreteValue>) {\n      let res = \"\";\n      while (values.length) {\n        let next = values.shift();\n        let nextString = To.ToString(realm, next);\n        res += nextString;\n      }\n      return res;\n    }\n  }\n\n  // Record the current value of binding in this.modifiedBindings unless\n  // there is already an entry for binding.\n  recordModifiedBinding(binding: Binding, value?: Value): Binding {\n    if (binding.environment.isReadOnly) {\n      // This only happens during speculative execution and is reported elsewhere\n      throw new FatalError(\"Trying to modify a binding in read-only realm\");\n    }\n\n    if (this.modifiedBindings !== undefined && !this.modifiedBindings.has(binding)) {\n      this.modifiedBindings.set(binding, {\n        hasLeaked: binding.hasLeaked,\n        value: binding.value,\n      });\n    }\n    return binding;\n  }\n\n  callReportObjectGetOwnProperties(ob: ObjectValue | AbstractObjectValue): void {\n    if (this.reportObjectGetOwnProperties !== undefined) {\n      this.reportObjectGetOwnProperties(ob);\n    }\n  }\n\n  callReportPropertyAccess(binding: PropertyBinding, isWrite: boolean): void {\n    if (this.reportPropertyAccess !== undefined) {\n      this.reportPropertyAccess(binding, isWrite);\n    }\n  }\n\n  // Record the current value of binding in this.modifiedProperties unless\n  // there is already an entry for binding.\n  recordModifiedProperty(binding: void | PropertyBinding): void {\n    if (binding === undefined) return;\n    if (this.isReadOnly && (this.getRunningContext().isReadOnly || !this.isNewObject(binding.object))) {\n      // This only happens during speculative execution and is reported elsewhere\n      throw new FatalError(\"Trying to modify a property in read-only realm\");\n    }\n    this.callReportPropertyAccess(binding, true);\n    if (this.modifiedProperties !== undefined && !this.modifiedProperties.has(binding)) {\n      let clone;\n      let desc = binding.descriptor;\n      if (desc === undefined) {\n        clone = undefined;\n      } else if (desc instanceof AbstractJoinedDescriptor) {\n        clone = new AbstractJoinedDescriptor(desc.joinCondition, desc.descriptor1, desc.descriptor2);\n      } else if (desc instanceof PropertyDescriptor) {\n        clone = cloneDescriptor(desc);\n      } else if (desc instanceof InternalSlotDescriptor) {\n        clone = new InternalSlotDescriptor(desc.value);\n      } else {\n        invariant(false, \"unknown descriptor\");\n      }\n      this.modifiedProperties.set(binding, clone);\n    }\n  }\n\n  isNewObject(object: AbstractObjectValue | ObjectValue): boolean {\n    if (object instanceof AbstractObjectValue) return false;\n    return this.createdObjects === undefined || this.createdObjects.has(object);\n  }\n\n  recordNewObject(object: ObjectValue): void {\n    if (this.createdObjects !== undefined) {\n      this.createdObjects.add(object);\n    }\n    if (this.createdObjectsTrackedForLeaks !== undefined) {\n      this.createdObjectsTrackedForLeaks.add(object);\n    }\n  }\n\n  recordNewAbstract(abstract: AbstractValue): void {\n    if (this.createdAbstracts !== undefined) {\n      this.createdAbstracts.add(abstract);\n    }\n  }\n\n  // Returns the current values of modifiedBindings and modifiedProperties\n  // and then assigns new empty maps to them.\n  getAndResetModifiedMaps(): [void | Bindings, void | PropertyBindings] {\n    let result = [this.modifiedBindings, this.modifiedProperties];\n    this.modifiedBindings = new Map();\n    this.modifiedProperties = new Map();\n    return result;\n  }\n\n  // Restores each Binding in the given map to the value it\n  // had when it was entered into the map and updates the map to record\n  // the value the Binding had just before the call to this method.\n  restoreBindings(modifiedBindings: void | Bindings) {\n    if (modifiedBindings === undefined) return;\n    modifiedBindings.forEach(({ hasLeaked, value }, binding, m) => {\n      let l = binding.hasLeaked;\n      let v = binding.value;\n      binding.hasLeaked = hasLeaked;\n      binding.value = value;\n      m.set(binding, { hasLeaked: l, value: v });\n    });\n  }\n\n  // Restores each PropertyBinding in the given map to the value it\n  // had when it was entered into the map and updates the map to record\n  // the value the Binding had just before the call to this method.\n  restoreProperties(modifiedProperties: void | PropertyBindings): void {\n    if (modifiedProperties === undefined) return;\n    modifiedProperties.forEach((desc, propertyBinding, m) => {\n      let d = propertyBinding.descriptor;\n      propertyBinding.descriptor = desc;\n      m.set(propertyBinding, d);\n    });\n  }\n\n  // Provide the realm with maps in which to track modifications.\n  // A map can be set to undefined if no tracking is required.\n  setModifiedMaps(modifiedBindings: void | Bindings, modifiedProperties: void | PropertyBindings): void {\n    this.modifiedBindings = modifiedBindings;\n    this.modifiedProperties = modifiedProperties;\n  }\n\n  rebuildObjectProperty(object: Value, key: string, propertyValue: Value, path: string): void {\n    if (!(propertyValue instanceof AbstractValue)) return;\n    if (propertyValue.kind === \"abstractConcreteUnion\") {\n      invariant(propertyValue.args.length >= 2);\n      let absVal = propertyValue.args[0];\n      invariant(absVal instanceof AbstractValue);\n      propertyValue = absVal;\n    }\n    if (!propertyValue.isIntrinsic()) {\n      propertyValue.intrinsicName = `${path}.${key}`;\n      propertyValue.kind = \"rebuiltProperty\";\n      propertyValue.args = [object, new StringValue(this, key)];\n      propertyValue.operationDescriptor = createOperationDescriptor(\"REBUILT_OBJECT\");\n      let intrinsicName = propertyValue.intrinsicName;\n      invariant(intrinsicName !== undefined);\n      this.rebuildNestedProperties(propertyValue, intrinsicName);\n    }\n  }\n\n  rebuildNestedProperties(abstractValue: AbstractValue | UndefinedValue, path: string): void {\n    if (!(abstractValue instanceof AbstractObjectValue)) return;\n    if (abstractValue.values.isTop()) return;\n    let template = abstractValue.getTemplate();\n    invariant(!template.intrinsicName || template.intrinsicName === path);\n    template.intrinsicName = path;\n    template.intrinsicNameGenerated = true;\n    for (let [key, binding] of template.properties) {\n      if (binding === undefined || binding.descriptor === undefined) continue; // deleted\n      invariant(binding.descriptor !== undefined);\n      let desc = binding.descriptor.throwIfNotConcrete(this);\n      let value = desc.value;\n      Properties.ThrowIfMightHaveBeenDeleted(desc);\n      if (value === undefined) {\n        AbstractValue.reportIntrospectionError(abstractValue, key);\n        throw new FatalError();\n      }\n      invariant(value instanceof Value);\n      this.rebuildObjectProperty(abstractValue, key, value, path);\n    }\n  }\n\n  createExecutionContext(): ExecutionContext {\n    let context = new ExecutionContext();\n    let loc = this.nextContextLocation;\n    if (loc) {\n      context.setLocation(loc);\n      this.nextContextLocation = null;\n    }\n    return context;\n  }\n\n  setNextExecutionContextLocation(loc: ?BabelNodeSourceLocation): ?BabelNodeSourceLocation {\n    let previousValue = this.nextContextLocation;\n    this.nextContextLocation = loc;\n    return previousValue;\n  }\n\n  /* Since it makes strong assumptions, Instant Render is likely to have a large\n  number of unsupported scenarios. We group all associated compiler diagnostics here. */\n  instantRenderBailout(message: string, loc: ?BabelNodeSourceLocation) {\n    if (loc === undefined) loc = this.currentLocation;\n    let error = new CompilerDiagnostic(message, loc, \"PP0039\", \"RecoverableError\");\n    if (this.handleError(error) === \"Fail\") throw new FatalError();\n  }\n\n  reportIntrospectionError(message?: void | string | StringValue): void {\n    if (message === undefined) message = \"\";\n    if (typeof message === \"string\") message = new StringValue(this, message);\n    invariant(message instanceof StringValue);\n    this.nextContextLocation = this.currentLocation;\n    let error = new CompilerDiagnostic(message.value, this.currentLocation, \"PP0001\", \"FatalError\");\n    this.handleError(error);\n  }\n\n  createErrorThrowCompletion(type: NativeFunctionValue, message?: void | string | StringValue): ThrowCompletion {\n    invariant(type !== this.intrinsics.__IntrospectionError);\n    if (message === undefined) message = \"\";\n    if (typeof message === \"string\") message = new StringValue(this, message);\n    invariant(message instanceof StringValue);\n    this.nextContextLocation = this.currentLocation;\n    return new ThrowCompletion(Construct(this, type, [message]), this.currentLocation);\n  }\n\n  appendGenerator(generator: Generator, leadingComment: string = \"\"): void {\n    let realmGenerator = this.generator;\n    if (realmGenerator === undefined) {\n      invariant(generator.empty());\n      return;\n    }\n    realmGenerator.appendGenerator(generator, leadingComment);\n  }\n\n  // This function gets the evaluated effects with a collection of\n  // prior nested affects applied (and their canBeApplied flag reset)\n  // We can safely do this as we've wrapped the effects in evaluated\n  // effects, meaning all the effects applied to Realm get restored\n  evaluateForEffectsWithPriorEffects(\n    priorEffects: Array<Effects>,\n    f: () => AbruptCompletion | Value,\n    generatorName: string\n  ): Effects {\n    return this.evaluateForEffects(\n      () => {\n        for (let priorEffect of priorEffects) this.applyEffects(priorEffect);\n        try {\n          return f();\n        } finally {\n          for (let priorEffect of priorEffects) {\n            invariant(!priorEffect.canBeApplied);\n            priorEffect.canBeApplied = true;\n          }\n        }\n      },\n      undefined,\n      generatorName\n    );\n  }\n\n  evaluateWithIncreasedMaxStackDepth<T>(increaseRemainingCallsBy: number, f: () => T): T {\n    invariant(increaseRemainingCallsBy > 0);\n    this.remainingCalls += increaseRemainingCallsBy;\n    try {\n      return f();\n    } finally {\n      this.remainingCalls -= increaseRemainingCallsBy;\n    }\n  }\n\n  // Pass the error to the realm's error-handler\n  // Return value indicates whether the caller should try to recover from the error or not.\n  handleError(diagnostic: CompilerDiagnostic): ErrorHandlerResult {\n    if (!diagnostic.callStack && this.contextStack.length > 0) {\n      let error = this.evaluateWithIncreasedMaxStackDepth(1, () =>\n        this.evaluateWithoutEffects(() => Construct(this, this.intrinsics.Error).throwIfNotConcreteObject())\n      );\n      let stack = error._SafeGetDataPropertyValue(\"stack\");\n      if (stack instanceof StringValue) diagnostic.callStack = stack.value;\n    }\n\n    // If debugger is attached, give it a first crack so that it can\n    // stop execution for debugging before PP exits.\n    if (this.debuggerInstance && this.debuggerInstance.shouldStopForSeverity(diagnostic.severity)) {\n      this.debuggerInstance.handlePrepackError(diagnostic);\n    }\n\n    // If we're creating a DebugRepro, attach the sourceFile names to the error that is returned.\n    if (this.debugReproManager !== undefined) {\n      let manager = this.debugReproManager;\n      let sourcePaths = {\n        sourceFiles: manager.getSourceFilePaths(),\n        sourceMaps: manager.getSourceMapPaths(),\n      };\n      diagnostic.sourceFilePaths = sourcePaths;\n    }\n\n    // Default behaviour is to bail on the first error\n    let errorHandler = this.errorHandler;\n    if (!errorHandler) {\n      let msg = `${diagnostic.errorCode}: ${diagnostic.message}`;\n      if (diagnostic.location) {\n        let loc_start = diagnostic.location.start;\n        let loc_end = diagnostic.location.end;\n        msg += ` at ${loc_start.line}:${loc_start.column} to ${loc_end.line}:${loc_end.column}`;\n      }\n      switch (diagnostic.severity) {\n        case \"Information\":\n          console.log(`Info: ${msg}`);\n          console.log(diagnostic.callStack);\n          return \"Recover\";\n        case \"Warning\":\n          console.warn(`Warn: ${msg}`);\n          console.warn(diagnostic.callStack);\n          return \"Recover\";\n        case \"RecoverableError\":\n          console.error(`Error: ${msg}`);\n          console.error(diagnostic.callStack);\n          return \"Fail\";\n        case \"FatalError\":\n          console.error(`Fatal Error: ${msg}`);\n          console.error(diagnostic.callStack);\n          return \"Fail\";\n        default:\n          invariant(false, \"Unexpected error type\");\n      }\n    }\n    return errorHandler(diagnostic, this.suppressDiagnostics);\n  }\n\n  saveNameString(nameString: string): void {\n    this._abstractValuesDefined.add(nameString);\n  }\n\n  isNameStringUnique(nameString: string): boolean {\n    return !this._abstractValuesDefined.has(nameString);\n  }\n\n  getTemporalOperationEntryFromDerivedValue(value: Value): void | TemporalOperationEntry {\n    let name = value.intrinsicName;\n    if (!name) {\n      return undefined;\n    }\n    let temporalOperationEntry = value.$Realm.derivedIds.get(name);\n    return temporalOperationEntry;\n  }\n\n  getTemporalGeneratorEntriesReferencingArg(arg: AbstractValue | ObjectValue): void | Set<TemporalOperationEntry> {\n    return this.temporalEntryArgToEntries.get(arg);\n  }\n\n  saveTemporalGeneratorEntryArgs(temporalOperationEntry: TemporalOperationEntry): void {\n    let args = temporalOperationEntry.args;\n    for (let arg of args) {\n      let temporalEntries = this.temporalEntryArgToEntries.get(arg);\n\n      if (temporalEntries === undefined) {\n        temporalEntries = new Set();\n        this.temporalEntryArgToEntries.set(arg, temporalEntries);\n      }\n      temporalEntries.add(temporalOperationEntry);\n    }\n  }\n}\n"
  },
  {
    "path": "src/repl-cli.js",
    "content": "/**\n * Copyright (c) 2017-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n/* @flow */\n\nimport { Realm, ExecutionContext } from \"./realm.js\";\nimport { FatalError } from \"./errors.js\";\nimport { Get } from \"./methods/index.js\";\nimport { InstanceofOperator } from \"./methods/index.js\";\nimport { AbruptCompletion, ThrowCompletion } from \"./completions.js\";\nimport { Value, ObjectValue } from \"./values/index.js\";\nimport { To } from \"./singletons.js\";\nimport construct_realm from \"./construct_realm.js\";\nimport initializeGlobals from \"./globals.js\";\nimport repl from \"repl\";\n\nfunction serialize(realm: Realm, res: Value | AbruptCompletion): any {\n  if (res && res instanceof Value) {\n    return res.serialize();\n  }\n\n  if (res && res instanceof ThrowCompletion) {\n    let context = new ExecutionContext();\n    realm.pushContext(context);\n    let err;\n    try {\n      let value = res.value;\n      if (value instanceof ObjectValue && InstanceofOperator(realm, value, realm.intrinsics.Error)) {\n        err = new FatalError(To.ToStringPartial(realm, Get(realm, value, \"message\")));\n        err.stack = To.ToStringPartial(realm, Get(realm, value, \"stack\"));\n      } else {\n        err = new FatalError(To.ToStringPartial(realm, value));\n      }\n    } finally {\n      realm.popContext(context);\n    }\n    return err;\n  }\n\n  return res;\n}\n\nlet realm = construct_realm({\n  reactEnabled: true,\n  reactOutput: \"jsx\",\n});\ninitializeGlobals(realm);\n\nrepl.start({\n  prompt: \"> \",\n  input: process.stdin,\n  output: process.stdout,\n  eval(code, context, filename, callback) {\n    try {\n      let res = realm.$GlobalEnv.execute(code, \"repl\");\n      res = serialize(realm, res);\n      if (res instanceof Error) {\n        callback(res);\n      } else {\n        callback(null, res);\n      }\n    } catch (err) {\n      console.error(err);\n      callback(err);\n    }\n  },\n});\n"
  },
  {
    "path": "src/serializer/Emitter.js",
    "content": "/**\n * Copyright (c) 2017-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n/* @flow */\n\nimport {\n  AbstractValue,\n  BoundFunctionValue,\n  FunctionValue,\n  ObjectValue,\n  ProxyValue,\n  SymbolValue,\n  Value,\n} from \"../values/index.js\";\nimport type { BabelNodeStatement } from \"@babel/types\";\nimport type { SerializedBody } from \"./types.js\";\nimport { Generator, type TemporalOperationEntry } from \"../utils/generator.js\";\nimport invariant from \"../invariant.js\";\nimport { BodyReference } from \"./types.js\";\nimport { ResidualFunctions } from \"./ResidualFunctions.js\";\nimport { getProperty } from \"../react/utils.js\";\n\n// Type used to configure callbacks from the dependenciesVisitor of the Emitter.\ntype EmitterDependenciesVisitorCallbacks<T> = {\n  // Callback invoked whenever an \"active\" dependency is visited, i.e. a dependency which is in the process of being emitted.\n  // A return value that is not undefined indicates that the visitor should stop, and return the value as the overall result.\n  onActive?: Value => void | T,\n  // Callback invoked whenever a dependency is visited that is a FunctionValue.\n  // A return value that is not undefined indicates that the visitor should stop, and return the value as the overall result.\n  onFunction?: FunctionValue => void | T,\n  // Callback invoked whenever a dependency is visited that is an abstract value with an identifier.\n  // A return value that is not undefined indicates that the visitor should stop, and return the value as the overall result.\n  onAbstractValueWithIdentifier?: AbstractValue => void | T,\n  // Callback invoked whenever a dependency is visited that is an intrinsic object that was derived\n  // A return value that is not undefined indicates that the visitor should stop, and return the value as the overall result.\n  onIntrinsicDerivedObject?: ObjectValue => void | T,\n};\n\n// The emitter keeps track of a stack of what's currently being emitted.\n// There are two kinds of interesting dependencies the emitter is dealing with:\n// 1. Value dependencies:\n//    If an emission task depends on the result of another emission task which\n//    is still currently being emitted, then the emission task must be performed later,\n//    once the dependency is available.\n//    To this end, the emitter maintains the `_activeValues` and `_waitingForValues` datastructures.\n// 2. Generator dependencies:\n//    For each generator, there's a corresponding \"body\", i.e. a stream of babel statements\n//    that the emitter is appending to.\n//    There's always a \"current\" body that is currently being emitted to.\n//    There's also a distinguished `mainBody` to which all statements get directly or indirectly appended.\n//    If there are multiple generators/bodies involved, then they form a stack.\n//    Nested bodies are usually composed into an instruction emitted to the outer body.\n//    For example, two nested generators may yield the then and else-branch of an `if` statement.\n//    When an emission is supposed to target a body that is the current body, i.e. when it sits\n//    lower on the stack, then the emission task gets delayed until the next emission task on\n//    the lower body entry is finished.\n//    To this end, the emitter maintains the `_activeGeneratorStack` and `_waitingForBodies` datastructures.\nexport class Emitter {\n  constructor(\n    residualFunctions: ResidualFunctions,\n    referencedDeclaredValues: Map<Value, void | FunctionValue>,\n    conditionalFeasibility: Map<AbstractValue, { t: boolean, f: boolean }>,\n    derivedIds: Map<string, TemporalOperationEntry>\n  ) {\n    this._mainBody = { type: \"MainGenerator\", parentBody: undefined, entries: [], done: false };\n    this._waitingForValues = new Map();\n    this._waitingForBodies = new Map();\n    this._body = this._mainBody;\n    this._residualFunctions = residualFunctions;\n    this._activeStack = [];\n    this._activeValues = new Set();\n    this._activeGeneratorStack = [this._mainBody];\n    this._finalized = false;\n    let mustWaitForValue = (val: AbstractValue | ObjectValue) => {\n      if (this.cannotDeclare()) return false;\n      if (this.hasBeenDeclared(val)) return false;\n      let activeOptimizedFunction = this.getActiveOptimizedFunction();\n      if (activeOptimizedFunction === undefined) return true;\n      let optimizedFunctionWhereValueWasDeclared = referencedDeclaredValues.get(val);\n      return optimizedFunctionWhereValueWasDeclared === activeOptimizedFunction;\n    };\n    this._getReasonToWaitForDependenciesCallbacks = {\n      onActive: val => val, // cyclic dependency; we need to wait until this value has finished emitting\n      onFunction: val => {\n        // Functions are currently handled in a special way --- they are all defined ahead of time. Thus, we never have to wait for functions.\n        this._residualFunctions.addFunctionUsage(val, this.getBodyReference());\n        return undefined;\n      },\n      onAbstractValueWithIdentifier: val =>\n        derivedIds.has(val.getIdentifier()) && mustWaitForValue(val) ? val : undefined,\n      onIntrinsicDerivedObject: val => (mustWaitForValue(val) ? val : undefined),\n    };\n    this._conditionalFeasibility = conditionalFeasibility;\n  }\n\n  _finalized: boolean;\n  _activeStack: Array<string | Generator | Value>;\n  _activeValues: Set<Value>;\n  _activeGeneratorStack: Array<SerializedBody>; // Contains all the active generator bodies in stack order.\n  _residualFunctions: ResidualFunctions;\n  _waitingForValues: Map<Value, Array<{ body: SerializedBody, dependencies: Array<Value>, func: () => void }>>;\n  _waitingForBodies: Map<SerializedBody, Array<{ dependencies: Array<Value>, func: () => void }>>;\n  _body: SerializedBody;\n  _mainBody: SerializedBody;\n  _getReasonToWaitForDependenciesCallbacks: EmitterDependenciesVisitorCallbacks<Value>;\n  _conditionalFeasibility: Map<AbstractValue, { t: boolean, f: boolean }>;\n\n  // Begin to emit something. Such sessions can be nested.\n  // The dependency indicates what is being emitted; until this emission ends, other parties might have to wait for the dependency.\n  // The targetBody is a wrapper that holds the sequence of statements that are going to be emitted.\n  // If isChild, then we are starting a new emitting session as a branch off the previously active emitting session.\n  beginEmitting(\n    dependency: string | Generator | Value,\n    targetBody: SerializedBody,\n    isChild: boolean = false\n  ): SerializedBody {\n    invariant(!this._finalized);\n    invariant((targetBody.type === \"OptimizedFunction\") === !!targetBody.optimizedFunction);\n    this._activeStack.push(dependency);\n    if (dependency instanceof Value) {\n      invariant(!this._activeValues.has(dependency));\n      this._activeValues.add(dependency);\n    } else if (dependency instanceof Generator) {\n      invariant(!this._activeGeneratorStack.includes(targetBody));\n      this._activeGeneratorStack.push(targetBody);\n    }\n    if (isChild) {\n      targetBody.parentBody = this._body;\n      targetBody.nestingLevel = (this._body.nestingLevel || 0) + 1;\n    }\n    let oldBody = this._body;\n    this._body = targetBody;\n    return oldBody;\n  }\n  emit(statement: BabelNodeStatement): void {\n    invariant(!this._finalized);\n    this._body.entries.push(statement);\n    this._processCurrentBody();\n  }\n  finalizeCurrentBody(): void {\n    invariant(!this._finalized);\n    this._processCurrentBody();\n  }\n  // End to emit something. The parameters dependency and isChild must match a previous call to beginEmitting.\n  // oldBody should be the value returned by the previous matching beginEmitting call.\n  // valuesToProcess is filled with values that have been newly declared since the last corresponding beginEmitting call;\n  // other values not yet have been emitted as they might be waiting for valuesToProcess;\n  // processValues(valuesToProcess) should be called once the returned body has been embedded in the outer context.\n  endEmitting(\n    dependency: string | Generator | Value,\n    oldBody: SerializedBody,\n    valuesToProcess: void | Set<AbstractValue | ObjectValue>,\n    isChild: boolean = false\n  ): SerializedBody {\n    invariant(!this._finalized);\n    let lastDependency = this._activeStack.pop();\n    invariant(dependency === lastDependency);\n    if (dependency instanceof Value) {\n      invariant(this._activeValues.has(dependency));\n      this._activeValues.delete(dependency);\n      this._processValue(dependency);\n    } else if (dependency instanceof Generator) {\n      invariant(this._isEmittingActiveGenerator());\n      this._activeGeneratorStack.pop();\n    }\n    let lastBody = this._body;\n    this._body = oldBody;\n    if (isChild) {\n      invariant(lastBody.parentBody === oldBody);\n      invariant((lastBody.nestingLevel || 0) > 0);\n      invariant(!lastBody.done);\n      lastBody.done = true;\n      // When we are done processing a body, we can propogate all declared abstract values\n      // to its parent, possibly unlocking further processing...\n      if (lastBody.declaredValues) {\n        let anyPropagated = true;\n        for (let b = lastBody; b.done && b.parentBody !== undefined && anyPropagated; b = b.parentBody) {\n          anyPropagated = false;\n          let parentDeclaredValues = b.parentBody.declaredValues;\n          if (parentDeclaredValues === undefined) b.parentBody.declaredValues = parentDeclaredValues = new Map();\n          invariant(b.declaredValues);\n          for (let [key, value] of b.declaredValues) {\n            if (!parentDeclaredValues.has(key)) {\n              parentDeclaredValues.set(key, value);\n              if (valuesToProcess !== undefined) valuesToProcess.add(key);\n              anyPropagated = true;\n            }\n          }\n        }\n      }\n    }\n\n    return lastBody;\n  }\n  processValues(valuesToProcess: Set<AbstractValue | ObjectValue>): void {\n    for (let value of valuesToProcess) this._processValue(value);\n  }\n  finalize(): void {\n    invariant(!this._finalized);\n    invariant(this._activeGeneratorStack.length === 1);\n    invariant(this._activeGeneratorStack[0] === this._body);\n    invariant(this._body === this._mainBody);\n    this._processCurrentBody();\n    this._activeGeneratorStack.pop();\n    this._finalized = true;\n    invariant(this._waitingForBodies.size === 0);\n    invariant(this._waitingForValues.size === 0);\n    invariant(this._activeStack.length === 0);\n    invariant(this._activeValues.size === 0);\n    invariant(this._activeGeneratorStack.length === 0);\n  }\n  /**\n   * Emitter is emitting in two modes:\n   * 1. Emitting to entries in current active generator\n   * 2. Emitting to body of another scope(generator or residual function)\n   * This function checks the first condition above.\n   */\n  _isEmittingActiveGenerator(): boolean {\n    invariant(this._activeGeneratorStack.length > 0);\n    return this._activeGeneratorStack[this._activeGeneratorStack.length - 1] === this._body;\n  }\n  _isGeneratorBody(body: SerializedBody): boolean {\n    return body.type === \"MainGenerator\" || body.type === \"Generator\" || body.type === \"OptimizedFunction\";\n  }\n  _processCurrentBody(): void {\n    if (!this._isEmittingActiveGenerator() || this._body.processing) {\n      return;\n    }\n    let a = this._waitingForBodies.get(this._body);\n    if (a === undefined) return;\n    this._body.processing = true;\n    while (a.length > 0) {\n      let { dependencies, func } = a.shift();\n      this.emitNowOrAfterWaitingForDependencies(dependencies, func, this._body);\n    }\n    this._waitingForBodies.delete(this._body);\n    this._body.processing = false;\n  }\n  _processValue(value: Value): void {\n    let a = this._waitingForValues.get(value);\n    if (a === undefined) return;\n    let currentBody = this._body;\n    while (a.length > 0) {\n      let { body, dependencies, func } = a.shift();\n      // If body is not generator body no need to wait for it.\n      if (this._isGeneratorBody(body) && body !== currentBody) {\n        this._emitAfterWaitingForGeneratorBody(body, dependencies, func);\n      } else {\n        this.emitNowOrAfterWaitingForDependencies(dependencies, func, body);\n      }\n    }\n    this._waitingForValues.delete(value);\n  }\n\n  // Find the first ancestor in input generator body stack that is in current active stack.\n  // It can always find one because the bottom one in the stack is the main generator.\n  _getFirstAncestorGeneratorWithActiveBody(bodyStack: Array<SerializedBody>): SerializedBody {\n    const activeBody = bodyStack\n      .slice()\n      .reverse()\n      .find(body => this._activeGeneratorStack.includes(body));\n    invariant(activeBody);\n    return activeBody;\n  }\n\n  // Serialization of a statement related to a value MUST be delayed if\n  // the creation of the value's identity requires the availability of either:\n  // 1. a value that is also currently being serialized\n  //    (tracked by `_activeValues`).\n  // 2. a time-dependent value that is declared by some generator entry\n  //    that has not yet been processed\n  //    (tracked by `declaredValues` in bodies)\n  getReasonToWaitForDependencies(dependencies: Value | Array<Value>): void | Value {\n    return this.dependenciesVisitor(dependencies, this._getReasonToWaitForDependenciesCallbacks);\n  }\n\n  // Visitor of dependencies that require delaying serialization\n  dependenciesVisitor<T>(\n    dependencies: Value | Array<Value>,\n    callbacks: EmitterDependenciesVisitorCallbacks<T>\n  ): void | T {\n    invariant(!this._finalized);\n\n    let result;\n    let recurse = value => this.dependenciesVisitor(value, callbacks);\n\n    if (Array.isArray(dependencies)) {\n      let values = ((dependencies: any): Array<Value>);\n      for (let value of values) {\n        result = recurse(value);\n        if (result !== undefined) return result;\n      }\n      return undefined;\n    }\n\n    let val = ((dependencies: any): Value);\n    if (this._activeValues.has(val)) {\n      // If a value is active and it's a function, then we still shouldn't wait on it.\n      if (val instanceof FunctionValue && !(val instanceof BoundFunctionValue)) {\n        // We ran into a function value.\n        result = callbacks.onFunction ? callbacks.onFunction(val) : undefined;\n        return result;\n      }\n      // We ran into a cyclic dependency, where the value we are dependending on is still in the process of being emitted.\n      result = callbacks.onActive ? callbacks.onActive(val) : undefined;\n      if (result !== undefined) return result;\n    }\n\n    if (val instanceof BoundFunctionValue) {\n      result = recurse(val.$BoundTargetFunction);\n      if (result !== undefined) return result;\n      result = recurse(val.$BoundThis);\n      if (result !== undefined) return result;\n      result = recurse(val.$BoundArguments);\n      if (result !== undefined) return result;\n    } else if (val instanceof FunctionValue) {\n      // We ran into a function value.\n      result = callbacks.onFunction ? callbacks.onFunction(val) : undefined;\n      if (result !== undefined) return result;\n    } else if (val instanceof AbstractValue) {\n      if (val.hasIdentifier()) {\n        // We ran into an abstract value that might have to be declared.\n        result = callbacks.onAbstractValueWithIdentifier ? callbacks.onAbstractValueWithIdentifier(val) : undefined;\n        if (result !== undefined) return result;\n      }\n      let argsToRecurse;\n      if (val.kind === \"conditional\") {\n        let cf = this._conditionalFeasibility.get(val);\n        invariant(cf !== undefined);\n        argsToRecurse = [];\n        if (cf.t && cf.f) argsToRecurse.push(val.args[0]);\n        if (cf.t) argsToRecurse.push(val.args[1]);\n        if (cf.f) argsToRecurse.push(val.args[2]);\n      } else argsToRecurse = val.args;\n      result = recurse(argsToRecurse);\n      if (result !== undefined) return result;\n    } else if (val instanceof ProxyValue) {\n      result = recurse(val.$ProxyTarget);\n      if (result !== undefined) return result;\n      result = recurse(val.$ProxyHandler);\n      if (result !== undefined) return result;\n    } else if (val instanceof SymbolValue) {\n      if (val.$Description instanceof Value) {\n        result = recurse(val.$Description);\n        if (result !== undefined) return result;\n      }\n    } else if (val instanceof ObjectValue && ObjectValue.isIntrinsicDerivedObject(val)) {\n      result = callbacks.onIntrinsicDerivedObject ? callbacks.onIntrinsicDerivedObject(val) : undefined;\n      if (result !== undefined) return result;\n    } else if (val instanceof ObjectValue) {\n      let kind = val.getKind();\n      switch (kind) {\n        case \"Object\":\n          let proto = val.$Prototype;\n          if (\n            proto instanceof ObjectValue &&\n            // if this is falsy, prototype chain might be cyclic\n            proto.usesOrdinaryObjectInternalPrototypeMethods()\n          ) {\n            result = recurse(val.$Prototype);\n            if (result !== undefined) return result;\n          }\n          break;\n        case \"Date\":\n          invariant(val.$DateValue !== undefined);\n          result = recurse(val.$DateValue);\n          if (result !== undefined) return result;\n          break;\n        case \"ReactElement\":\n          let realm = val.$Realm;\n          let type = getProperty(realm, val, \"type\");\n          let props = getProperty(realm, val, \"props\");\n          let key = getProperty(realm, val, \"key\");\n          let ref = getProperty(realm, val, \"ref\");\n          result = recurse(type);\n          if (result !== undefined) return result;\n          result = recurse(props);\n          if (result !== undefined) return result;\n          result = recurse(key);\n          if (result !== undefined) return result;\n          result = recurse(ref);\n          if (result !== undefined) return result;\n          break;\n        default:\n          break;\n      }\n    }\n\n    return undefined;\n  }\n\n  // Wait for a known-to-be active value if a condition is met.\n  getReasonToWaitForActiveValue(value: Value, condition: boolean): void | Value {\n    invariant(!this._finalized);\n    invariant(this._activeValues.has(value));\n    return condition ? value : undefined;\n  }\n  emitAfterWaiting(\n    delayReason: void | Value | SerializedBody,\n    dependencies: Array<Value>,\n    func: () => void,\n    targetBody: SerializedBody\n  ): void {\n    if (delayReason === undefined && this._isGeneratorBody(targetBody)) {\n      delayReason = targetBody;\n    }\n\n    if (delayReason === undefined || delayReason === this._body) {\n      if (targetBody === this._body) {\n        // Emit into current body.\n        func();\n      } else {\n        invariant(!this._isGeneratorBody(targetBody));\n        // TODO: Check if effects really don't matter here,\n        // since we are going to emit something in an out-of-band body\n        // that might depend on applied effects.\n        const oldBody = this.beginEmitting(targetBody.type, targetBody);\n        func();\n        this.endEmitting(targetBody.type, oldBody);\n      }\n    } else {\n      invariant(delayReason !== undefined);\n      if (delayReason instanceof Value) {\n        this._emitAfterWaitingForValue(delayReason, dependencies, targetBody, func);\n      } else if (this._isGeneratorBody(delayReason)) {\n        // delayReason is a generator body.\n        this._emitAfterWaitingForGeneratorBody(delayReason, dependencies, func);\n      } else {\n        // Unknown delay reason.\n        invariant(false);\n      }\n    }\n  }\n  _emitAfterWaitingForValue(\n    reason: Value,\n    dependencies: Array<Value>,\n    targetBody: SerializedBody,\n    func: () => void\n  ): void {\n    invariant(!this._finalized);\n    invariant(!(reason instanceof AbstractValue && this.hasBeenDeclared(reason)) || this._activeValues.has(reason));\n    let a = this._waitingForValues.get(reason);\n    if (a === undefined) this._waitingForValues.set(reason, (a = []));\n    a.push({ body: targetBody, dependencies, func });\n  }\n  _emitAfterWaitingForGeneratorBody(reason: SerializedBody, dependencies: Array<Value>, func: () => void): void {\n    invariant(this._isGeneratorBody(reason));\n    invariant(!this._finalized);\n    invariant(this._activeGeneratorStack.includes(reason));\n    let b = this._waitingForBodies.get(reason);\n    if (b === undefined) {\n      this._waitingForBodies.set(reason, (b = []));\n    }\n    b.push({ dependencies, func });\n  }\n  emitNowOrAfterWaitingForDependencies(dependencies: Array<Value>, func: () => void, targetBody: SerializedBody): void {\n    this.emitAfterWaiting(this.getReasonToWaitForDependencies(dependencies), dependencies, func, targetBody);\n  }\n  declare(value: AbstractValue | ObjectValue): void {\n    invariant(!this._finalized);\n    invariant(!this._activeValues.has(value));\n    invariant(value instanceof ObjectValue || value.hasIdentifier());\n    invariant(this._isEmittingActiveGenerator());\n    invariant(!this.cannotDeclare());\n    invariant(!this._body.done);\n    if (this._body.declaredValues === undefined) this._body.declaredValues = new Map();\n    this._body.declaredValues.set(value, this._body);\n    this._processValue(value);\n  }\n  getActiveOptimizedFunction(): void | FunctionValue {\n    // Whether we are directly or indirectly emitting to an optimized function\n    for (let b = this._body; b !== undefined; b = b.parentBody)\n      if (b.type === \"OptimizedFunction\") return b.optimizedFunction;\n    return undefined;\n  }\n  cannotDeclare(): boolean {\n    // Bodies of the following types will never contain any (temporal) abstract value declarations.\n    return this._body.type === \"DelayInitializations\" || this._body.type === \"LazyObjectInitializer\";\n  }\n  hasBeenDeclared(value: AbstractValue | ObjectValue): boolean {\n    return this.getDeclarationBody(value) !== undefined;\n  }\n  getDeclarationBody(value: AbstractValue | ObjectValue): void | SerializedBody {\n    for (let b = this._body; b !== undefined; b = b.parentBody) {\n      if (b.declaredValues !== undefined && b.declaredValues.has(value)) {\n        return b;\n      }\n    }\n    return undefined;\n  }\n  declaredCount(): number {\n    let declaredValues = this._body.declaredValues;\n    return declaredValues === undefined ? 0 : declaredValues.size;\n  }\n  getBody(): SerializedBody {\n    return this._body;\n  }\n  isCurrentBodyOffspringOf(targetBody: SerializedBody): boolean {\n    let currentBody = this._body;\n    while (currentBody !== undefined) {\n      if (currentBody === targetBody) {\n        return true;\n      }\n      currentBody = currentBody.parentBody;\n    }\n    return false;\n  }\n  getBodyReference(): BodyReference {\n    invariant(!this._finalized);\n    return new BodyReference(this._body, this._body.entries.length);\n  }\n}\n"
  },
  {
    "path": "src/serializer/GeneratorTree.js",
    "content": "/**\n * Copyright (c) 2017-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n/* @flow strict-local */\n\nimport invariant from \"../invariant.js\";\nimport { FunctionValue, ObjectValue } from \"../values/index.js\";\nimport { Generator } from \"../utils/generator.js\";\n\n// This class maintains a tree containing all generators known so far,\n// and information about the most specific generator that created any\n// particular object.\n// New sub-trees are added in chunks, at the beginning for the global generator,\n// and every time the visitor handles another additional function.\nexport class GeneratorTree {\n  parents: Map<Generator, Generator | FunctionValue | \"GLOBAL\">;\n  createdObjects: Map<ObjectValue, Generator>;\n\n  constructor() {\n    this.parents = new Map();\n    this.createdObjects = new Map();\n  }\n\n  getParent(generator: Generator): Generator | FunctionValue | \"GLOBAL\" {\n    let parent = this.parents.get(generator);\n    invariant(parent !== undefined);\n    return parent;\n  }\n\n  getCreator(value: ObjectValue): Generator | void {\n    return this.createdObjects.get(value);\n  }\n\n  add(parent: FunctionValue | \"GLOBAL\", generator: Generator): void {\n    this._add(parent, generator);\n  }\n\n  _add(parent: Generator | FunctionValue | \"GLOBAL\", generator: Generator): void {\n    invariant(!this.parents.has(generator));\n    this.parents.set(generator, parent);\n    let effects = generator.effectsToApply;\n    if (effects !== undefined) {\n      invariant(parent instanceof FunctionValue);\n      for (let createdObject of effects.createdObjects) {\n        let isValidPreviousCreator = previousCreator => {\n          // It's okay if we don't know about any previous creator.\n          if (previousCreator === undefined) return true;\n\n          // If we already recorded a newly-created object, then we must have done so for our parent\n          if (previousCreator === parent) return true;\n\n          // Since we are dealing with a DAG, and not a tree, we might have already the current generator as the creator\n          if (previousCreator === generator) return true;\n\n          // TODO: There's something else going on that is not yet understood.\n          // Fix the return value once #1901 is understood and landed.\n          return true; // false\n        };\n\n        invariant(isValidPreviousCreator(this.createdObjects.get(createdObject)));\n\n        // Update the created objects mapping to the most specific generator\n        this.createdObjects.set(createdObject, generator);\n      }\n    }\n\n    for (let dependency of generator.getDependencies()) this._add(generator, dependency);\n  }\n}\n"
  },
  {
    "path": "src/serializer/LazyObjectsSerializer.js",
    "content": "/**\n * Copyright (c) 2017-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n/* @flow strict-local */\n\nimport { Realm } from \"../realm.js\";\nimport { FunctionValue, Value, ObjectValue } from \"../values/index.js\";\nimport * as t from \"@babel/types\";\nimport type { BabelNodeExpression, BabelNodeStatement, BabelNodeIdentifier, BabelNodeSwitchCase } from \"@babel/types\";\nimport type { SerializedBody, AdditionalFunctionEffects, ResidualHeapInfo } from \"./types.js\";\nimport type { SerializerOptions } from \"../options.js\";\nimport invariant from \"../invariant.js\";\nimport { Logger } from \"../utils/logger.js\";\nimport { Modules } from \"../utils/modules.js\";\nimport { HeapInspector } from \"../utils/HeapInspector.js\";\nimport { ResidualHeapValueIdentifiers } from \"./ResidualHeapValueIdentifiers.js\";\nimport { ResidualHeapSerializer } from \"./ResidualHeapSerializer.js\";\nimport { getOrDefault } from \"./utils.js\";\nimport type { ResidualOptimizedFunctions } from \"./ResidualOptimizedFunctions\";\nimport type { Referentializer } from \"./Referentializer.js\";\nimport { GeneratorTree } from \"./GeneratorTree.js\";\n\nconst LAZY_OBJECTS_SERIALIZER_BODY_TYPE = \"LazyObjectInitializer\";\n\n/**\n * Serialize objects in lazy mode by leveraging the JS runtime that support this feature.\n * Objects are serialized into two parts:\n * 1. All lazy objects are created via lightweight LazyObjectsRuntime.createLazyObject() call.\n * 2. Lazy objects' property assignments are delayed in a callback function which is registered with the runtime.\n *    lazy objects runtime will execute this callback to hydrate the lazy objects.\n *\n * Currently only the raw objects are taking part in the lazy objects feature.\n * TODO: support for other objects, like array, regex etc...\n */\nexport class LazyObjectsSerializer extends ResidualHeapSerializer {\n  constructor(\n    realm: Realm,\n    logger: Logger,\n    modules: Modules,\n    residualHeapValueIdentifiers: ResidualHeapValueIdentifiers,\n    residualHeapInspector: HeapInspector,\n    residualHeapInfo: ResidualHeapInfo,\n    options: SerializerOptions,\n    additionalFunctionValuesAndEffects: Map<FunctionValue, AdditionalFunctionEffects>,\n    referentializer: Referentializer,\n    generatorTree: GeneratorTree,\n    residualOptimizedFunctions: ResidualOptimizedFunctions\n  ) {\n    super(\n      realm,\n      logger,\n      modules,\n      residualHeapValueIdentifiers,\n      residualHeapInspector,\n      residualHeapInfo,\n      options,\n      additionalFunctionValuesAndEffects,\n      referentializer,\n      generatorTree,\n      residualOptimizedFunctions\n    );\n\n    this._lazyObjectIdSeed = 1;\n    this._valueLazyIds = new Map();\n    this._lazyObjectInitializers = new Map();\n    this._callbackLazyObjectParam = t.identifier(\"obj\");\n    invariant(this._options.lazyObjectsRuntime != null);\n    this._lazyObjectJSRuntimeName = t.identifier(this._options.lazyObjectsRuntime);\n    this._initializationCallbackName = t.identifier(\"__initializerCallback\");\n  }\n\n  _lazyObjectIdSeed: number;\n  _valueLazyIds: Map<ObjectValue, number>;\n  // Holds object's lazy initializer bodies.\n  // These bodies will be combined into a well-known callback after generator serialization is done and registered with the runtime.\n  _lazyObjectInitializers: Map<ObjectValue, SerializedBody>;\n\n  _lazyObjectJSRuntimeName: BabelNodeIdentifier;\n  _callbackLazyObjectParam: BabelNodeIdentifier;\n  _initializationCallbackName: BabelNodeIdentifier;\n\n  _getValueLazyId(obj: ObjectValue): number {\n    return getOrDefault(this._valueLazyIds, obj, () => this._lazyObjectIdSeed++);\n  }\n\n  // TODO: change to use _getTarget() to get the lazy objects initializer body.\n  _serializeLazyObjectInitializer(\n    obj: ObjectValue,\n    emitIntegrityCommand: void | (SerializedBody => void)\n  ): SerializedBody {\n    const initializerBody = {\n      type: LAZY_OBJECTS_SERIALIZER_BODY_TYPE,\n      parentBody: undefined,\n      entries: [],\n      done: false,\n    };\n    let oldBody = this.emitter.beginEmitting(LAZY_OBJECTS_SERIALIZER_BODY_TYPE, initializerBody);\n    this._emitObjectProperties(obj);\n    if (emitIntegrityCommand !== undefined) emitIntegrityCommand(this.emitter.getBody());\n    this.emitter.endEmitting(LAZY_OBJECTS_SERIALIZER_BODY_TYPE, oldBody);\n    return initializerBody;\n  }\n\n  _serializeLazyObjectInitializerSwitchCase(obj: ObjectValue, initializer: SerializedBody): BabelNodeSwitchCase {\n    // TODO: only serialize this switch case if the initializer(property assignment) is not empty.\n    const caseBody = initializer.entries.concat(t.breakStatement());\n    const lazyId = this._getValueLazyId(obj);\n    return t.switchCase(t.numericLiteral(lazyId), caseBody);\n  }\n\n  _serializeInitializationCallback(): BabelNodeStatement {\n    const body = [];\n\n    const switchCases = [];\n    for (const [obj, initializer] of this._lazyObjectInitializers) {\n      switchCases.push(this._serializeLazyObjectInitializerSwitchCase(obj, initializer));\n    }\n    // Default case.\n    switchCases.push(\n      t.switchCase(null, [\n        t.throwStatement(t.newExpression(t.identifier(\"Error\"), [t.stringLiteral(\"Unknown lazy id\")])),\n      ])\n    );\n\n    const selector = t.identifier(\"id\");\n    body.push(t.switchStatement(selector, switchCases));\n\n    const params = [this._callbackLazyObjectParam, selector];\n    const initializerCallbackFunction = t.functionExpression(null, params, t.blockStatement(body));\n    // TODO: use NameGenerator.\n    return t.variableDeclaration(\"var\", [\n      t.variableDeclarator(this._initializationCallbackName, initializerCallbackFunction),\n    ]);\n  }\n\n  _serializeRegisterInitializationCallback(): BabelNodeStatement {\n    return t.expressionStatement(\n      t.callExpression(t.memberExpression(this._lazyObjectJSRuntimeName, t.identifier(\"setLazyObjectInitializer\")), [\n        this._initializationCallbackName,\n      ])\n    );\n  }\n\n  _serializeCreateLazyObject(obj: ObjectValue): BabelNodeExpression {\n    const lazyId = this._getValueLazyId(obj);\n    return t.callExpression(\n      t.memberExpression(this._lazyObjectJSRuntimeName, t.identifier(\"createLazyObject\"), /*computed*/ false),\n      [t.numericLiteral(lazyId)]\n    );\n  }\n\n  /**\n   * Check if the object currently being emitted is lazy object(inside _lazyObjectInitializers map) and\n   * that its emitting body is the offspring of this lazy object's initializer body.\n   * This is needed because for \"lazy1.p = lazy2\" case,\n   * we need to replace \"lazy1\" with \"obj\" but not for \"lazy2\".\n   * The offspring checking is needed because object may be emitting in a \"ConditionalAssignmentBranch\" of\n   * lazy object's initializer body.\n   */\n  _isEmittingIntoLazyObjectInitializerBody(obj: ObjectValue): boolean {\n    const objLazyBody = this._lazyObjectInitializers.get(obj);\n    return objLazyBody !== undefined && this.emitter.isCurrentBodyOffspringOf(objLazyBody);\n  }\n\n  // Override default behavior.\n  // Inside lazy objects callback, the lazy object identifier needs to be replaced with the\n  // parameter passed from the runtime.\n  getSerializeObjectIdentifier(val: Value): BabelNodeIdentifier {\n    return val instanceof ObjectValue && this._isEmittingIntoLazyObjectInitializerBody(val)\n      ? this._callbackLazyObjectParam\n      : super.getSerializeObjectIdentifier(val);\n  }\n\n  // Override default serializer with lazy mode.\n  serializeValueRawObject(\n    obj: ObjectValue,\n    skipPrototype: boolean,\n    emitIntegrityCommand: void | (SerializedBody => void)\n  ): BabelNodeExpression {\n    if (obj.temporalAlias !== undefined) return super.serializeValueRawObject(obj, skipPrototype, emitIntegrityCommand);\n    this._lazyObjectInitializers.set(obj, this._serializeLazyObjectInitializer(obj, emitIntegrityCommand));\n    return this._serializeCreateLazyObject(obj);\n  }\n\n  // Override.\n  // Serialize the initialization callback and its registration in prelude if there are object being lazied.\n  postGeneratorSerialization(): void {\n    if (this._lazyObjectInitializers.size > 0) {\n      // Insert initialization callback at the end of prelude code.\n      this.prelude.push(this._serializeInitializationCallback());\n      this.prelude.push(this._serializeRegisterInitializationCallback());\n    }\n  }\n}\n"
  },
  {
    "path": "src/serializer/LoggingTracer.js",
    "content": "/**\n * Copyright (c) 2017-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n/* @flow */\n\nimport { Reference } from \"../environment.js\";\nimport { Realm, Tracer } from \"../realm.js\";\nimport type { Effects } from \"../realm.js\";\nimport { Get } from \"../methods/index.js\";\nimport { ThrowCompletion, AbruptCompletion } from \"../completions.js\";\nimport {\n  FunctionValue,\n  Value,\n  NumberValue,\n  BooleanValue,\n  StringValue,\n  UndefinedValue,\n  NullValue,\n  ObjectValue,\n  AbstractValue,\n} from \"../values/index.js\";\nimport { To } from \"../singletons.js\";\nimport invariant from \"../invariant.js\";\nimport { stringOfLocation } from \"../utils/babelhelpers.js\";\n\nfunction describeValue(realm: Realm, v: Value): string {\n  if (v instanceof NumberValue || v instanceof BooleanValue) return v.value.toString();\n  if (v instanceof UndefinedValue) return \"undefined\";\n  if (v instanceof NullValue) return \"null\";\n  if (v instanceof StringValue) return JSON.stringify(v.value);\n  if (v instanceof FunctionValue) return To.ToStringPartial(realm, Get(realm, v, \"name\")) || \"(anonymous function)\";\n  if (v instanceof ObjectValue) return \"(some object)\";\n  if (v instanceof AbstractValue) return \"(some abstract value)\";\n  invariant(false);\n}\n\nexport class LoggingTracer extends Tracer {\n  constructor(realm: Realm) {\n    super();\n    this.realm = realm;\n    this.nesting = [];\n  }\n\n  realm: Realm;\n  nesting: Array<string>;\n\n  log(message: string): void {\n    console.log(`[calls] ${this.nesting.map(_ => \"  \").join(\"\")}${message}`);\n  }\n\n  beginEvaluateForEffects(state: any): void {\n    this.log(`>evaluate for effects`);\n    this.nesting.push(\"(evaluate for effects)\");\n  }\n\n  endEvaluateForEffects(state: any, effects: void | Effects): void {\n    let name = this.nesting.pop();\n    invariant(name === \"(evaluate for effects)\");\n    this.log(`<evaluate for effects`);\n  }\n\n  beforeCall(\n    F: FunctionValue,\n    thisArgument: void | Value,\n    argumentsList: Array<Value>,\n    newTarget: void | ObjectValue\n  ): void {\n    let realm = this.realm;\n    let name = describeValue(realm, F);\n    this.log(`>${name}(${argumentsList.map(v => describeValue(realm, v)).join(\", \")})`);\n    this.nesting.push(name);\n  }\n\n  afterCall(\n    F: FunctionValue,\n    thisArgument: void | Value,\n    argumentsList: Array<Value>,\n    newTarget: void | ObjectValue,\n    result: void | Reference | Value | AbruptCompletion\n  ): void {\n    let name = this.nesting.pop();\n    this.log(`<${name}${result instanceof ThrowCompletion ? \": error\" : \"\"}`);\n  }\n\n  beginOptimizingFunction(optimizedFunctionId: number, functionValue: FunctionValue): void {\n    this.log(\n      `>Starting Optimized Function ${optimizedFunctionId} ${\n        functionValue.intrinsicName ? functionValue.intrinsicName : \"[unknown name]\"\n      } ${functionValue.expressionLocation ? stringOfLocation(functionValue.expressionLocation) : \"\"}`\n    );\n  }\n\n  endOptimizingFunction(optimizedFunctionId: number): void {\n    this.log(`<Ending Optimized Function ${optimizedFunctionId}`);\n  }\n}\n"
  },
  {
    "path": "src/serializer/Referentializer.js",
    "content": "/**\n * Copyright (c) 2017-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n/* @flow */\n\nimport { DeclarativeEnvironmentRecord } from \"../environment.js\";\nimport type { SerializerOptions } from \"../options.js\";\nimport * as t from \"@babel/types\";\nimport generate from \"@babel/generator\";\nimport type { BabelNodeStatement, BabelNodeExpression, BabelNodeIdentifier } from \"@babel/types\";\nimport { NameGenerator } from \"../utils/NameGenerator\";\nimport invariant from \"../invariant.js\";\nimport type { ResidualFunctionBinding, ScopeBinding, FunctionInstance } from \"./types.js\";\nimport type { ReferentializationScope, Scope } from \"./types.js\";\nimport { SerializerStatistics } from \"./statistics.js\";\nimport { getOrDefault } from \"./utils.js\";\nimport { Realm } from \"../realm.js\";\nimport type { ResidualOptimizedFunctions } from \"./ResidualOptimizedFunctions\";\n\ntype ReferentializationState = {|\n  capturedScopeInstanceIdx: number,\n  capturedScopesArray: BabelNodeIdentifier,\n  capturedScopeAccessFunctionId: BabelNodeIdentifier,\n  serializedScopes: Map<DeclarativeEnvironmentRecord, ScopeBinding>,\n|};\n\n/*\n * This class helps fixup names in residual functions for variables that these\n * functions capture from parent scopes.\n * For each ReferentializationScope it creates a _get_scope_binding function\n * that contains the initialization for all of that scope's FunctionInstances\n * which will contain a switch statement with all the initializations.\n */\nexport class Referentializer {\n  constructor(\n    realm: Realm,\n    options: SerializerOptions,\n    scopeNameGenerator: NameGenerator,\n    scopeBindingNameGenerator: NameGenerator,\n    leakedNameGenerator: NameGenerator,\n    residualOptimizedFunctions: ResidualOptimizedFunctions\n  ) {\n    this._options = options;\n    this.scopeNameGenerator = scopeNameGenerator;\n    this.scopeBindingNameGenerator = scopeBindingNameGenerator;\n\n    this.referentializationState = new Map();\n    this._leakedNameGenerator = leakedNameGenerator;\n    this.realm = realm;\n\n    this._residualOptimizedFunctions = residualOptimizedFunctions;\n  }\n\n  _options: SerializerOptions;\n  scopeNameGenerator: NameGenerator;\n  scopeBindingNameGenerator: NameGenerator;\n  realm: Realm;\n\n  _newCapturedScopeInstanceIdx: number;\n  referentializationState: Map<ReferentializationScope, ReferentializationState>;\n  _leakedNameGenerator: NameGenerator;\n  _residualOptimizedFunctions: ResidualOptimizedFunctions;\n\n  getStatistics(): SerializerStatistics {\n    invariant(this.realm.statistics instanceof SerializerStatistics, \"serialization requires SerializerStatistics\");\n    return this.realm.statistics;\n  }\n\n  _createReferentializationState(): ReferentializationState {\n    return {\n      capturedScopeInstanceIdx: 0,\n      capturedScopesArray: t.identifier(this.scopeNameGenerator.generate(\"main\")),\n      capturedScopeAccessFunctionId: t.identifier(this.scopeBindingNameGenerator.generate(\"get_scope_binding\")),\n      serializedScopes: new Map(),\n    };\n  }\n\n  _getReferentializationState(referentializationScope: ReferentializationScope): ReferentializationState {\n    return getOrDefault(\n      this.referentializationState,\n      referentializationScope,\n      this._createReferentializationState.bind(this)\n    );\n  }\n\n  createLeakedIds(referentializationScope: ReferentializationScope): Array<BabelNodeStatement> {\n    const leakedIds = [];\n    const serializedScopes = this._getReferentializationState(referentializationScope).serializedScopes;\n    for (const scopeBinding of serializedScopes.values()) leakedIds.push(...scopeBinding.leakedIds);\n    if (leakedIds.length === 0) return [];\n    return [t.variableDeclaration(\"var\", leakedIds.map(id => t.variableDeclarator(id)))];\n  }\n\n  createCapturedScopesPrelude(referentializationScope: ReferentializationScope): Array<BabelNodeStatement> {\n    let accessFunctionDeclaration = this._createCaptureScopeAccessFunction(referentializationScope);\n    if (accessFunctionDeclaration === undefined) return [];\n    return [accessFunctionDeclaration, this._createCapturedScopesArrayInitialization(referentializationScope)];\n  }\n\n  // Generate a shared function for accessing captured scope bindings.\n  // TODO: skip generating this function if the captured scope is not shared by multiple residual functions.\n  _createCaptureScopeAccessFunction(referentializationScope: ReferentializationScope): void | BabelNodeStatement {\n    // One switch case for one scope.\n    const cases = [];\n    const serializedScopes = this._getReferentializationState(referentializationScope).serializedScopes;\n    type InitializationCase = {|\n      scopeIDs: Array<number>,\n      value: BabelNodeExpression,\n    |};\n    const initializationCases: Map<string, InitializationCase> = new Map();\n    for (const scopeBinding of serializedScopes.values()) {\n      if (scopeBinding.initializationValues.length === 0) continue;\n      const expr = t.arrayExpression((scopeBinding.initializationValues: any));\n      const key = generate(expr, {}, \"\").code;\n      if (!initializationCases.has(key)) {\n        initializationCases.set(key, {\n          scopeIDs: [scopeBinding.id],\n          value: expr,\n        });\n      } else {\n        const ic = initializationCases.get(key);\n        invariant(ic);\n        ic.scopeIDs.push(scopeBinding.id);\n      }\n    }\n    if (initializationCases.size === 0) return undefined;\n\n    const body = [];\n    const selectorParam = t.identifier(\"__selector\");\n    const captured = t.identifier(\"__captured\");\n    const capturedScopesArray = this._getReferentializationState(referentializationScope).capturedScopesArray;\n    const selectorExpression = t.memberExpression(capturedScopesArray, selectorParam, /*Indexer syntax*/ true);\n    for (const ic of initializationCases.values()) {\n      ic.scopeIDs.forEach((id, i) => {\n        let consequent: Array<BabelNodeStatement> = [];\n        if (i === ic.scopeIDs.length - 1) {\n          consequent = [t.expressionStatement(t.assignmentExpression(\"=\", captured, ic.value)), t.breakStatement()];\n        }\n        cases.push(t.switchCase(t.numericLiteral(id), consequent));\n      });\n    }\n    // Default case.\n    if (this.realm.invariantLevel >= 1) {\n      cases.push(\n        t.switchCase(null, [\n          t.throwStatement(t.newExpression(t.identifier(\"Error\"), [t.stringLiteral(\"Unknown scope selector\")])),\n        ])\n      );\n    }\n\n    body.push(t.variableDeclaration(\"var\", [t.variableDeclarator(captured)]));\n    body.push(t.switchStatement(selectorParam, cases));\n    body.push(t.expressionStatement(t.assignmentExpression(\"=\", selectorExpression, captured)));\n    body.push(t.returnStatement(captured));\n    const factoryFunction = t.functionExpression(null, [selectorParam], t.blockStatement(body));\n    const accessFunctionId = this._getReferentializationState(referentializationScope).capturedScopeAccessFunctionId;\n    return t.variableDeclaration(\"var\", [t.variableDeclarator(accessFunctionId, factoryFunction)]);\n  }\n\n  _getReferentializationScope(residualBinding: ResidualFunctionBinding): ReferentializationScope {\n    if (residualBinding.potentialReferentializationScopes.has(\"GLOBAL\")) return \"GLOBAL\";\n    if (residualBinding.potentialReferentializationScopes.size > 1) {\n      // Here we know potentialReferentializationScopes cannot contain \"GLOBAL\"; Set<FunctionValue> is\n      // compatible with Set<FunctionValue | Generator>\n      let scopes = ((residualBinding.potentialReferentializationScopes: any): Set<Scope>);\n      let parentOptimizedFunction = this._residualOptimizedFunctions.tryGetOutermostOptimizedFunction(scopes);\n      return parentOptimizedFunction || \"GLOBAL\";\n    }\n    for (let scope of residualBinding.potentialReferentializationScopes) return scope;\n    invariant(false);\n  }\n\n  _getSerializedBindingScopeInstance(residualBinding: ResidualFunctionBinding): ScopeBinding {\n    let declarativeEnvironmentRecord = residualBinding.declarativeEnvironmentRecord;\n    invariant(declarativeEnvironmentRecord);\n\n    let referentializationScope = this._getReferentializationScope(residualBinding);\n\n    // figure out if this is accessed only from additional functions\n    let refState: ReferentializationState = this._getReferentializationState(referentializationScope);\n    let scope = refState.serializedScopes.get(declarativeEnvironmentRecord);\n    if (!scope) {\n      scope = {\n        name: this.scopeNameGenerator.generate(),\n        id: refState.capturedScopeInstanceIdx++,\n        initializationValues: [],\n        leakedIds: [],\n        referentializationScope,\n      };\n      refState.serializedScopes.set(declarativeEnvironmentRecord, scope);\n    }\n\n    invariant(scope.referentializationScope === referentializationScope);\n    invariant(!residualBinding.scope || residualBinding.scope === scope);\n    residualBinding.scope = scope;\n    return scope;\n  }\n\n  getReferentializedScopeInitialization(\n    scope: ScopeBinding,\n    scopeName: BabelNodeExpression\n  ): Array<BabelNodeStatement> {\n    const capturedScope = scope.capturedScope;\n    invariant(capturedScope);\n    const state = this._getReferentializationState(scope.referentializationScope);\n    const funcName = state.capturedScopeAccessFunctionId;\n    const scopeArray = state.capturedScopesArray;\n    // First get scope array entry and check if it's already initialized.\n    // Only if not yet, then call the initialization function.\n    const init = t.logicalExpression(\n      \"||\",\n      t.memberExpression(scopeArray, scopeName, true),\n      t.callExpression(funcName, [scopeName])\n    );\n    return [t.variableDeclaration(\"var\", [t.variableDeclarator(t.identifier(capturedScope), init)])];\n  }\n\n  referentializeLeakedBinding(residualBinding: ResidualFunctionBinding): void {\n    invariant(residualBinding.hasLeaked);\n    // When simpleClosures is enabled, then space for captured mutable bindings is allocated upfront.\n    let serializedBindingId = t.identifier(this._leakedNameGenerator.generate(residualBinding.name));\n    let scope = this._getSerializedBindingScopeInstance(residualBinding);\n    scope.leakedIds.push(serializedBindingId);\n    residualBinding.serializedValue = residualBinding.serializedUnscopedLocation = serializedBindingId;\n\n    this.getStatistics().referentialized++;\n  }\n\n  referentializeModifiedBinding(residualBinding: ResidualFunctionBinding): void {\n    invariant(residualBinding.modified);\n\n    // Space for captured mutable bindings is allocated lazily.\n    let scope = this._getSerializedBindingScopeInstance(residualBinding);\n    let capturedScope = \"__captured\" + scope.name;\n    // Save the serialized value for initialization at the top of\n    // the factory.\n    // This can serialize more variables than are necessary to execute\n    // the function because every function serializes every\n    // modified variable of its parent scope. In some cases it could be\n    // an improvement to split these variables into multiple\n    // scopes.\n    const variableIndexInScope = scope.initializationValues.length;\n    const indexExpression = t.numericLiteral(variableIndexInScope);\n    invariant(residualBinding.serializedValue);\n    scope.initializationValues.push(residualBinding.serializedValue);\n    scope.capturedScope = capturedScope;\n\n    // Replace binding usage with scope references\n\n    // The rewritten .serializedValue refers to a local capturedScope variable\n    // which is only accessible from within residual functions where code\n    // to create this variable is emitted.\n    residualBinding.serializedValue = t.memberExpression(\n      t.identifier(capturedScope),\n      indexExpression,\n      true // Array style access.\n    );\n\n    // .serializedUnscopedLocation is initialized with a more general expressions\n    // that can be used outside of residual functions.\n    // TODO: Creating these expressions just in case looks expensive. Measure, and potentially only create lazily.\n    const state = this._getReferentializationState(scope.referentializationScope);\n    const funcName = state.capturedScopeAccessFunctionId;\n    const scopeArray = state.capturedScopesArray;\n    // First get scope array entry and check if it's already initialized.\n    // Only if not yet, then call the initialization function.\n    const scopeName = t.numericLiteral(scope.id);\n    const capturedScopeExpression = t.logicalExpression(\n      \"||\",\n      t.memberExpression(scopeArray, scopeName, true),\n      t.callExpression(funcName, [scopeName])\n    );\n    residualBinding.serializedUnscopedLocation = t.memberExpression(\n      capturedScopeExpression,\n      indexExpression,\n      true // Array style access.\n    );\n\n    this.getStatistics().referentialized++;\n  }\n\n  // Cleans all scopes between passes of the serializer\n  cleanInstance(instance: FunctionInstance): void {\n    instance.initializationStatements = [];\n    for (let b of ((instance: any): FunctionInstance).residualFunctionBindings.values()) {\n      let binding = ((b: any): ResidualFunctionBinding);\n      if (binding.referentialized && binding.declarativeEnvironmentRecord) {\n        let declarativeEnvironmentRecord = binding.declarativeEnvironmentRecord;\n        let referentializationScope = this._getReferentializationScope(binding);\n\n        let refState = this.referentializationState.get(referentializationScope);\n        if (refState) {\n          let scope = refState.serializedScopes.get(declarativeEnvironmentRecord);\n          if (scope) {\n            scope.initializationValues = [];\n            scope.leakedIds = [];\n          }\n        }\n      }\n      delete binding.serializedValue;\n    }\n  }\n\n  referentialize(instance: FunctionInstance): void {\n    let residualBindings = instance.residualFunctionBindings;\n\n    for (let residualBinding of residualBindings.values()) {\n      if (residualBinding === undefined) continue;\n      if (residualBinding.modified) {\n        // Initialize captured scope at function call instead of globally\n        if (!residualBinding.declarativeEnvironmentRecord) residualBinding.referentialized = true;\n        if (!residualBinding.referentialized) {\n          if (!residualBinding.hasLeaked) this._getSerializedBindingScopeInstance(residualBinding);\n          residualBinding.referentialized = true;\n        }\n\n        invariant(residualBinding.referentialized);\n        if (residualBinding.declarativeEnvironmentRecord && residualBinding.scope) {\n          instance.scopeInstances.set(residualBinding.scope.name, residualBinding.scope);\n        }\n      }\n    }\n  }\n\n  _createCapturedScopesArrayInitialization(referentializationScope: ReferentializationScope): BabelNodeStatement {\n    return t.variableDeclaration(\"var\", [\n      t.variableDeclarator(\n        this._getReferentializationState(referentializationScope).capturedScopesArray,\n        t.newExpression(t.identifier(\"Array\"), [\n          t.numericLiteral(this._getReferentializationState(referentializationScope).capturedScopeInstanceIdx),\n        ])\n      ),\n    ]);\n  }\n}\n"
  },
  {
    "path": "src/serializer/ResidualFunctionInitializers.js",
    "content": "/**\n * Copyright (c) 2017-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n/* @flow strict-local */\n\nimport { FunctionValue, Value } from \"../values/index.js\";\nimport * as t from \"@babel/types\";\nimport type { BabelNodeStatement } from \"@babel/types\";\nimport { NameGenerator } from \"../utils/NameGenerator.js\";\nimport traverseFast from \"../utils/traverse-fast.js\";\nimport invariant from \"../invariant.js\";\nimport { voidExpression, nullExpression } from \"../utils/babelhelpers.js\";\nimport type { LocationService, SerializedBody } from \"./types.js\";\nimport { factorifyObjects } from \"./factorify.js\";\n\n// This class manages information about values\n// which are only referenced by residual functions,\n// and it provides the ability to generate initialization code for those values that\n// can be placed into the residual functions.\nexport class ResidualFunctionInitializers {\n  constructor(locationService: LocationService) {\n    this.functionInitializerInfos = new Map();\n    this.initializers = new Map();\n    this.sharedInitializers = new Map();\n    this.locationService = locationService;\n  }\n\n  // ownId: uid of the FunctionValue, initializer ids are strings of sorted lists of FunctionValues referencing the value\n  functionInitializerInfos: Map<FunctionValue, { ownId: string, initializerIds: Set<string> }>;\n  initializers: Map<string, { id: string, order: number, body: SerializedBody, values: Array<Value> }>;\n  sharedInitializers: Map<string, BabelNodeStatement>;\n  locationService: LocationService;\n\n  registerValueOnlyReferencedByResidualFunctions(functionValues: Array<FunctionValue>, val: Value): SerializedBody {\n    invariant(functionValues.length >= 1);\n    let infos = [];\n    for (let functionValue of functionValues) {\n      let info = this.functionInitializerInfos.get(functionValue);\n      if (info === undefined)\n        this.functionInitializerInfos.set(\n          functionValue,\n          (info = { ownId: this.functionInitializerInfos.size.toString(), initializerIds: new Set() })\n        );\n      infos.push(info);\n    }\n    let id = infos\n      .map(info => info.ownId)\n      .sort()\n      .join();\n    for (let info of infos) info.initializerIds.add(id);\n    let initializer = this.initializers.get(id);\n    if (initializer === undefined)\n      this.initializers.set(\n        id,\n        (initializer = {\n          id,\n          order: infos.length,\n          values: [],\n          body: { type: \"DelayInitializations\", parentBody: undefined, entries: [], done: false },\n        })\n      );\n    initializer.values.push(val);\n    return initializer.body;\n  }\n\n  scrubFunctionInitializers(): void {\n    // Deleting trivial entries in order to avoid creating empty initialization functions that serve no purpose.\n    for (let initializer of this.initializers.values())\n      if (initializer.body.entries.length === 0) this.initializers.delete(initializer.id);\n    for (let [functionValue, info] of this.functionInitializerInfos) {\n      for (let id of info.initializerIds) {\n        let initializer = this.initializers.get(id);\n        if (initializer === undefined) {\n          info.initializerIds.delete(id);\n        }\n      }\n      if (info.initializerIds.size === 0) this.functionInitializerInfos.delete(functionValue);\n    }\n  }\n\n  _conditionalInitialization(\n    containingAdditionalFunction: void | FunctionValue,\n    initializedValues: Array<Value>,\n    initializationStatements: Array<BabelNodeStatement>\n  ): BabelNodeStatement {\n    if (initializationStatements.length === 1 && t.isIfStatement(initializationStatements[0])) {\n      return initializationStatements[0];\n    }\n\n    // We have some initialization code, and it should only get executed once,\n    // so we are going to guard it.\n    // First, let's see if one of the initialized values is guaranteed to not\n    // be undefined after initialization. In that case, we can use that state-change\n    // to figure out if initialization needs to run.\n    let location;\n    for (let value of initializedValues) {\n      // function declarations get hoisted, so let's not use their initialization state as a marker\n      if (!value.mightBeUndefined() && !(value instanceof FunctionValue)) {\n        location = this.locationService.getLocation(value);\n        if (location !== undefined) break;\n      }\n    }\n    if (location === undefined) {\n      // Second, if we didn't find a non-undefined value, let's make one up.\n      // It will transition from `undefined` to `null`.\n      location = this.locationService.createLocation(containingAdditionalFunction);\n      initializationStatements.unshift(t.expressionStatement(t.assignmentExpression(\"=\", location, nullExpression)));\n    }\n    return t.ifStatement(\n      t.binaryExpression(\"===\", location, voidExpression),\n      t.blockStatement(initializationStatements)\n    );\n  }\n\n  hasInitializerStatement(functionValue: FunctionValue): boolean {\n    return !!this.functionInitializerInfos.get(functionValue);\n  }\n\n  factorifyInitializers(nameGenerator: NameGenerator): void {\n    for (const initializer of this.initializers.values()) {\n      factorifyObjects(initializer.body.entries, nameGenerator);\n    }\n  }\n\n  getInitializerStatement(functionValue: FunctionValue): void | BabelNodeStatement {\n    let initializerInfo = this.functionInitializerInfos.get(functionValue);\n    if (initializerInfo === undefined) return undefined;\n    let containingAdditionalFunction = this.locationService.getContainingAdditionalFunction(functionValue);\n\n    invariant(initializerInfo.initializerIds.size > 0);\n    let ownInitializer = this.initializers.get(initializerInfo.ownId);\n    let initializedValues;\n    let initializationStatements = [];\n    let initializers = [];\n    for (let initializerId of initializerInfo.initializerIds) {\n      let initializer = this.initializers.get(initializerId);\n      invariant(initializer !== undefined);\n      invariant(initializer.body.entries.length > 0);\n      initializers.push(initializer);\n    }\n    // Sorting initializers by the number of scopes they are required by.\n    // Note that the scope sets form a lattice, and this sorting effectively\n    // ensures that value initializers that depend on other value initializers\n    // get called in the right order.\n    initializers.sort((i, j) => j.order - i.order);\n    for (let initializer of initializers) {\n      if (initializerInfo.initializerIds.size === 1 || initializer === ownInitializer) {\n        initializedValues = initializer.values;\n      }\n      if (initializer === ownInitializer) {\n        initializationStatements = initializationStatements.concat(initializer.body.entries);\n      } else {\n        let ast = this.sharedInitializers.get(initializer.id);\n        if (ast === undefined) {\n          ast = this._conditionalInitialization(\n            containingAdditionalFunction,\n            initializer.values,\n            initializer.body.entries\n          );\n          // We inline compact initializers, as calling a function would introduce too much\n          // overhead. To determine if an initializer is compact, we count the number of\n          // nodes in the AST, and check if it exceeds a certain threshold.\n          // TODO #885: Study in more detail which threshold is the best compromise in terms of\n          // code size and performance.\n          let count = 0;\n          traverseFast(t.file(t.program([ast])), node => {\n            count++;\n            return false;\n          });\n          if (count > 24) {\n            let id = this.locationService.createFunction(containingAdditionalFunction, [ast]);\n            ast = t.expressionStatement(t.callExpression(id, []));\n          }\n          this.sharedInitializers.set(initializer.id, ast);\n        }\n        initializationStatements.push(ast);\n      }\n    }\n\n    return this._conditionalInitialization(\n      containingAdditionalFunction,\n      initializedValues || [],\n      initializationStatements\n    );\n  }\n}\n"
  },
  {
    "path": "src/serializer/ResidualFunctionInstantiator.js",
    "content": "/**\n * Copyright (c) 2017-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n/* @flow */\n\nimport * as t from \"@babel/types\";\nimport { convertExpressionToJSXIdentifier } from \"../react/jsx\";\nimport type Value from \"../values/Value.js\";\nimport type {\n  BabelNodeBinaryExpression,\n  BabelNodeCallExpression,\n  BabelNodeFunctionExpression,\n  BabelNodeExpression,\n  BabelNodeClassMethod,\n  BabelNodeArrowFunctionExpression,\n  BabelNodeWhileStatement,\n  BabelNodeJSXIdentifier,\n  BabelNodeJSXMemberExpression,\n  BabelNodeConditionalExpression,\n  BabelNodeIfStatement,\n  BabelNodeLogicalExpression,\n  BabelNodeBooleanLiteral,\n  BabelNodeNumericLiteral,\n  BabelNodeStringLiteral,\n  BabelNodeUnaryExpression,\n  BabelNodeClassExpression,\n  BabelNodeObjectExpression,\n  BabelNodeArrayExpression,\n  BabelNodeSpreadElement,\n  BabelNodeLabeledStatement,\n} from \"@babel/types\";\nimport type { FunctionBodyAstNode } from \"../types.js\";\nimport type { FactoryFunctionInfo } from \"./types.js\";\nimport { nullExpression } from \"../utils/babelhelpers\";\n\nfunction canShareFunctionBody(duplicateFunctionInfo: FactoryFunctionInfo): boolean {\n  if (duplicateFunctionInfo.anyContainingAdditionalFunction) {\n    // If the function is referenced by an optimized function,\n    // it may get emitted within that optimized function,\n    // and then the function name is not generally available in arbitrary other code\n    // where we'd like to replace the body with a reference to the extracted function body.\n    // TODO: Revisit interplay of factory function concept, scope concept, and optimized functions.\n    return false;\n  }\n\n  // Only share function when:\n  // 1. it does not access any free variables.\n  // 2. it does not use \"this\".\n  const { unbound, modified, usesThis } = duplicateFunctionInfo.functionInfo;\n  return unbound.size === 0 && modified.size === 0 && !usesThis;\n}\n\nexport type Truthiness = void | boolean; // undefined means unknown\n\nexport type Replacement = {\n  node: BabelNodeExpression,\n  truthiness: Truthiness,\n};\n\nexport function getReplacement(node: BabelNodeExpression, value: void | Value): Replacement {\n  let truthiness;\n  if (value !== undefined)\n    if (!value.mightNotBeFalse()) truthiness = false;\n    else if (!value.mightNotBeTrue()) truthiness = true;\n  return { node, truthiness };\n}\n\nexport function isPure(node: BabelNodeExpression | BabelNodeSpreadElement): boolean {\n  switch (node.type) {\n    case \"NullLiteral\":\n    case \"BooleanLiteral\":\n    case \"StringLiteral\":\n    case \"NumericLiteral\":\n      return true;\n    case \"UnaryExpression\":\n    case \"SpreadElement\":\n      let unaryExpression = ((node: any): BabelNodeUnaryExpression | BabelNodeSpreadElement);\n      return isPure(unaryExpression.argument);\n    case \"BinaryExpression\":\n    case \"LogicalExpression\":\n      let binaryExpression = ((node: any): BabelNodeLogicalExpression | BabelNodeBinaryExpression);\n      return isPure(binaryExpression.left) && isPure(binaryExpression.right);\n    default:\n      return false;\n  }\n}\n\n// This class instantiates residual functions by replacing certain nodes,\n// i.e. bindings to captured scopes that need to get renamed to variable ids.\n// The original nodes are never mutated; instead, nodes are cloned as needed.\n// Along the way, some trivial code optimizations are performed as well.\nexport class ResidualFunctionInstantiator<\n  T: BabelNodeClassMethod | BabelNodeFunctionExpression | BabelNodeArrowFunctionExpression\n> {\n  factoryFunctionInfos: Map<number, FactoryFunctionInfo>;\n  factoryFunctionsToRemove: Map<number, string>;\n  identifierReplacements: Map<BabelNodeIdentifier, Replacement>;\n  callReplacements: Map<BabelNodeCallExpression, Replacement>;\n  root: T;\n\n  constructor(\n    factoryFunctionInfos: Map<number, FactoryFunctionInfo>,\n    factoryFunctionsToRemove: Map<number, string>,\n    identifierReplacements: Map<BabelNodeIdentifier, Replacement>,\n    callReplacements: Map<BabelNodeCallExpression, Replacement>,\n    root: T\n  ) {\n    this.factoryFunctionInfos = factoryFunctionInfos;\n    this.factoryFunctionsToRemove = factoryFunctionsToRemove;\n    this.identifierReplacements = identifierReplacements;\n    this.callReplacements = callReplacements;\n    this.root = root;\n  }\n\n  instantiate(): T {\n    return ((this._replace(this.root): any): T);\n  }\n\n  _getLiteralTruthiness(node: BabelNodeExpression): Truthiness {\n    switch (node.type) {\n      case \"BooleanLiteral\":\n      case \"NumericLiteral\":\n      case \"StringLiteral\":\n        return !!((node: any): BabelNodeBooleanLiteral | BabelNodeNumericLiteral | BabelNodeStringLiteral).value;\n      case \"Identifier\": {\n        let replacement = this.identifierReplacements.get(node);\n        if (replacement !== undefined) return replacement.truthiness;\n        return undefined;\n      }\n      case \"CallExpression\": {\n        let replacement = this.callReplacements.get(node);\n        if (replacement !== undefined) return replacement.truthiness;\n        return undefined;\n      }\n      case \"FunctionExpression\":\n      case \"ArrowFunctionExpression\":\n      case \"RegExpLiteral\":\n        return true;\n      case \"ClassExpression\":\n        let classExpression = ((node: any): BabelNodeClassExpression);\n        return classExpression.superClass === null && classExpression.body.body.length === 0 ? true : undefined;\n      case \"ObjectExpression\":\n        let objectExpression = ((node: any): BabelNodeObjectExpression);\n        return objectExpression.properties.every(property => isPure(property.key) && isPure(property.value))\n          ? true\n          : undefined;\n      case \"ArrayExpression\":\n        let arrayExpression = ((node: any): BabelNodeArrayExpression);\n        return arrayExpression.elements.every(element => element === undefined || isPure(element)) ? true : undefined;\n      case \"NullLiteral\":\n        return false;\n      case \"UnaryExpression\":\n        let unaryExpression = ((node: any): BabelNodeUnaryExpression);\n        return unaryExpression.operator === \"void\" && isPure(unaryExpression.argument) ? false : undefined;\n      default:\n        return undefined;\n    }\n  }\n\n  _replaceIdentifier(node: BabelNodeIdentifier): BabelNode {\n    let replacement = this.identifierReplacements.get(node);\n    if (replacement !== undefined) return replacement.node;\n    return node; // nothing else to replace in an identifier\n  }\n\n  _replaceJSXIdentifier(node: BabelNodeJSXIdentifier | BabelNodeJSXMemberExpression): BabelNode {\n    let replacement = this.identifierReplacements.get(node);\n    if (replacement !== undefined) return convertExpressionToJSXIdentifier(replacement.node, true);\n    return node; // nothing else to replace in an identifier\n  }\n\n  _replaceLabeledStatement(node: BabelNodeLabeledStatement): BabelNode {\n    // intentionally ignore embedded identifier\n    let newBody = this._replace(node.body);\n    if (newBody !== node.body) {\n      let res = Object.assign({}, node);\n      res.body = newBody;\n      return res;\n    }\n    return node; // nothing else to replace in a labeled statement\n  }\n\n  _replaceCallExpression(node: BabelNodeCallExpression): BabelNode {\n    let replacement = this.callReplacements.get(node);\n    if (replacement !== undefined) return replacement.node;\n    return this._replaceFallback(node);\n  }\n\n  _replaceFunctionExpression(node: BabelNodeFunctionExpression): BabelNode {\n    // Our goal is replacing duplicate nested function so skip root residual function itself.\n    if (this.root !== node) {\n      const functionExpression: BabelNodeFunctionExpression = node;\n      const functionTag = ((functionExpression.body: any): FunctionBodyAstNode).uniqueOrderedTag;\n      // Un-interpreted nested function?\n      if (functionTag !== undefined) {\n        // Un-interpreted nested function.\n\n        const duplicateFunctionInfo = this.factoryFunctionInfos.get(functionTag);\n        if (duplicateFunctionInfo && canShareFunctionBody(duplicateFunctionInfo)) {\n          const { factoryId } = duplicateFunctionInfo;\n          return t.callExpression(t.memberExpression(factoryId, t.identifier(\"bind\")), [nullExpression]);\n        }\n\n        if (this.factoryFunctionsToRemove.has(functionTag)) {\n          let newFunctionExpression = Object.assign({}, node);\n          newFunctionExpression.body = t.blockStatement([\n            t.throwStatement(\n              t.newExpression(t.identifier(\"Error\"), [t.stringLiteral(\"Function was specialized out by Prepack\")])\n            ),\n          ]);\n          return newFunctionExpression;\n        }\n      }\n    }\n\n    return this._replaceFallback(node);\n  }\n\n  _replaceIfStatement(node: BabelNodeIfStatement): BabelNode {\n    let testTruthiness = this._getLiteralTruthiness(node.test);\n    if (testTruthiness === true) {\n      // Strictly speaking this is not safe: Annex B.3.4 allows FunctionDeclarations as the body of IfStatements in sloppy mode,\n      // which have weird hoisting behavior: `console.log(typeof f); if (true) function f(){} console.log(typeof f)` will print 'undefined', 'function', but\n      // `console.log(typeof f); function f(){} console.log(typeof f)` will print 'function', 'function'.\n      // However, Babylon can't parse these, so it doesn't come up.\n      return this._replace(node.consequent);\n    } else if (testTruthiness === false) {\n      if (node.alternate !== null) {\n        return this._replace(node.alternate);\n      } else {\n        return t.emptyStatement();\n      }\n    }\n\n    return this._replaceFallback(node);\n  }\n\n  _replaceConditionalExpression(node: BabelNodeConditionalExpression): BabelNode {\n    let testTruthiness = this._getLiteralTruthiness(node.test);\n    if (testTruthiness !== undefined) {\n      return testTruthiness ? this._replace(node.consequent) : this._replace(node.alternate);\n    }\n\n    return this._replaceFallback(node);\n  }\n\n  _replaceLogicalExpression(node: BabelNodeLogicalExpression): BabelNode {\n    let leftTruthiness = this._getLiteralTruthiness(node.left);\n    if (node.operator === \"&&\" && leftTruthiness !== undefined) {\n      return leftTruthiness ? this._replace(node.right) : this._replace(node.left);\n    } else if (node.operator === \"||\" && leftTruthiness !== undefined) {\n      return leftTruthiness ? this._replace(node.left) : this._replace(node.right);\n    }\n\n    return this._replaceFallback(node);\n  }\n\n  _replaceWhileStatement(node: BabelNodeWhileStatement): BabelNode {\n    let testTruthiness = this._getLiteralTruthiness(node.test);\n    if (testTruthiness === false) {\n      return t.emptyStatement();\n    }\n\n    return this._replaceFallback(node);\n  }\n\n  _replaceFallback(node: BabelNode): BabelNode {\n    let newNode;\n    for (let key in node) {\n      let subNode = (node: any)[key];\n      if (!subNode) continue;\n      let newSubNode;\n      if (Array.isArray(subNode)) {\n        let newArray;\n        for (let i = 0; i < subNode.length; i++) {\n          let elementNode = subNode[i];\n          if (!elementNode) continue;\n          let newElementNode = this._replace(elementNode);\n          if (newElementNode !== elementNode) {\n            if (newArray === undefined) newArray = subNode.slice(0);\n            newArray[i] = newElementNode;\n          }\n        }\n        if (newArray === undefined) continue;\n        newSubNode = newArray;\n      } else if (subNode.type) {\n        newSubNode = this._replace(subNode);\n        if (newSubNode === subNode) continue;\n      } else continue;\n\n      if (newNode === undefined) newNode = Object.assign({}, node);\n      newNode[key] = newSubNode;\n    }\n    return newNode || node;\n  }\n\n  _replace(node: BabelNode): BabelNode {\n    switch (node.type) {\n      case \"Identifier\":\n        return this._replaceIdentifier(node);\n      case \"LabeledStatement\":\n        return this._replaceLabeledStatement(node);\n      case \"BreakStatement\":\n      case \"ContinueStatement\":\n        return node;\n      case \"JSXIdentifier\":\n      case \"JSXMemberExpressions\":\n        return this._replaceJSXIdentifier(node);\n      case \"CallExpression\":\n        return this._replaceCallExpression(node);\n      case \"FunctionExpression\":\n        return this._replaceFunctionExpression(node);\n      case \"IfStatement\":\n        return this._replaceIfStatement(node);\n      case \"ConditionalExpression\":\n        return this._replaceConditionalExpression(node);\n      case \"LogicalExpression\":\n        return this._replaceLogicalExpression(node);\n      case \"WhileStatement\":\n        return this._replaceWhileStatement(node);\n      default:\n        return this._replaceFallback(node);\n    }\n  }\n}\n"
  },
  {
    "path": "src/serializer/ResidualFunctions.js",
    "content": "/**\n * Copyright (c) 2017-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n/* @flow */\n\nimport { FatalError } from \"../errors.js\";\nimport { Realm } from \"../realm.js\";\nimport { FunctionValue, ECMAScriptSourceFunctionValue, ObjectValue } from \"../values/index.js\";\nimport type { SerializerOptions } from \"../options.js\";\nimport * as t from \"@babel/types\";\nimport type {\n  BabelNodeCallExpression,\n  BabelNodeClassMethod,\n  BabelNodeClassExpression,\n  BabelNodeExpression,\n  BabelNodeStatement,\n  BabelNodeIdentifier,\n  BabelNodeBlockStatement,\n  BabelNodeLVal,\n  BabelNodeSpreadElement,\n  BabelNodeFunctionExpression,\n  BabelNodeArrowFunctionExpression,\n} from \"@babel/types\";\nimport type { FunctionBodyAstNode } from \"../types.js\";\nimport type { NameGenerator } from \"../utils/NameGenerator.js\";\nimport invariant from \"../invariant.js\";\nimport type {\n  ResidualFunctionBinding,\n  FunctionInfo,\n  FactoryFunctionInfo,\n  FunctionInstance,\n  AdditionalFunctionInfo,\n} from \"./types.js\";\nimport { BodyReference, AreSameResidualBinding } from \"./types.js\";\nimport { SerializerStatistics } from \"./statistics.js\";\nimport { ResidualFunctionInstantiator, type Replacement, getReplacement } from \"./ResidualFunctionInstantiator.js\";\nimport { Modules } from \"../utils/modules.js\";\nimport { ResidualFunctionInitializers } from \"./ResidualFunctionInitializers.js\";\nimport { nullExpression } from \"../utils/babelhelpers.js\";\nimport type { LocationService, ClassMethodInstance } from \"./types.js\";\nimport { Referentializer } from \"./Referentializer.js\";\nimport { getOrDefault } from \"./utils.js\";\n\ntype ResidualFunctionsResult = {\n  unstrictFunctionBodies: Array<BabelNodeFunctionExpression | BabelNodeArrowFunctionExpression>,\n  strictFunctionBodies: Array<BabelNodeFunctionExpression | BabelNodeArrowFunctionExpression>,\n};\n\nexport class ResidualFunctions {\n  constructor(\n    realm: Realm,\n    options: SerializerOptions,\n    modules: Modules,\n    requireReturns: Map<number | string, Replacement>,\n    locationService: LocationService,\n    prelude: Array<BabelNodeStatement>,\n    factoryNameGenerator: NameGenerator,\n    residualFunctionInfos: Map<BabelNodeBlockStatement, FunctionInfo>,\n    residualFunctionInstances: Map<FunctionValue, FunctionInstance>,\n    residualClassMethodInstances: Map<FunctionValue, ClassMethodInstance>,\n    additionalFunctionValueInfos: Map<FunctionValue, AdditionalFunctionInfo>,\n    additionalFunctionValueNestedFunctions: Set<FunctionValue>,\n    referentializer: Referentializer\n  ) {\n    this.realm = realm;\n    this.modules = modules;\n    this.requireReturns = requireReturns;\n    this.locationService = locationService;\n    this.prelude = prelude;\n    this.factoryNameGenerator = factoryNameGenerator;\n    this.functionPrototypes = new Map();\n    this.firstFunctionUsages = new Map();\n    this.functions = new Map();\n    this.classes = new Map();\n    this.functionInstances = [];\n    this.residualFunctionInitializers = new ResidualFunctionInitializers(locationService);\n    this.residualFunctionInfos = residualFunctionInfos;\n    this.residualFunctionInstances = residualFunctionInstances;\n    this.residualClassMethodInstances = residualClassMethodInstances;\n    this.additionalFunctionValueInfos = additionalFunctionValueInfos;\n    this.referentializer = referentializer;\n    for (let instance of residualFunctionInstances.values()) {\n      invariant(instance !== undefined);\n      if (!additionalFunctionValueInfos.has(instance.functionValue)) this.addFunctionInstance(instance);\n    }\n    this.additionalFunctionValueNestedFunctions = additionalFunctionValueNestedFunctions;\n    this.additionalFunctionPreludes = new Map();\n    for (let functionValue of additionalFunctionValueInfos.keys()) {\n      this.additionalFunctionPreludes.set(functionValue, []);\n    }\n  }\n\n  realm: Realm;\n  modules: Modules;\n  requireReturns: Map<number | string, Replacement>;\n  locationService: LocationService;\n  prelude: Array<BabelNodeStatement>;\n  factoryNameGenerator: NameGenerator;\n  functionPrototypes: Map<FunctionValue, BabelNodeIdentifier>;\n  firstFunctionUsages: Map<FunctionValue, BodyReference>;\n  functions: Map<BabelNodeBlockStatement, Array<FunctionInstance>>;\n  classes: Map<ObjectValue, BabelNodeClassExpression>;\n  functionInstances: Array<FunctionInstance>;\n  residualFunctionInitializers: ResidualFunctionInitializers;\n  residualFunctionInfos: Map<BabelNodeBlockStatement, FunctionInfo>;\n  residualFunctionInstances: Map<FunctionValue, FunctionInstance>;\n  residualClassMethodInstances: Map<FunctionValue, ClassMethodInstance>;\n  additionalFunctionValueInfos: Map<FunctionValue, AdditionalFunctionInfo>;\n  additionalFunctionValueNestedFunctions: Set<FunctionValue>;\n  referentializer: Referentializer;\n  additionalFunctionPreludes: Map<FunctionValue, Array<BabelNodeStatement>>;\n\n  getStatistics(): SerializerStatistics {\n    invariant(this.realm.statistics instanceof SerializerStatistics, \"serialization requires SerializerStatistics\");\n    return this.realm.statistics;\n  }\n\n  addFunctionInstance(instance: FunctionInstance): void {\n    this.functionInstances.push(instance);\n    let code = instance.functionValue.$ECMAScriptCode;\n    invariant(code != null);\n    getOrDefault(this.functions, code, () => []).push(instance);\n  }\n\n  setFunctionPrototype(constructor: FunctionValue, prototypeId: BabelNodeIdentifier): void {\n    this.functionPrototypes.set(constructor, prototypeId);\n  }\n\n  addFunctionUsage(val: FunctionValue, bodyReference: BodyReference): void {\n    if (!this.firstFunctionUsages.has(val)) this.firstFunctionUsages.set(val, bodyReference);\n  }\n\n  _shouldUseFactoryFunction(funcBody: BabelNodeBlockStatement, instances: Array<FunctionInstance>): boolean {\n    invariant(instances.length > 0);\n    function shouldInlineFunction(): boolean {\n      if (instances[0].scopeInstances.size > 0) return false;\n      let shouldInline = true;\n      if (funcBody.start && funcBody.end) {\n        let bodySize = funcBody.end - funcBody.start;\n        shouldInline = bodySize <= 30;\n      }\n      return shouldInline;\n    }\n    let functionInfo = this.residualFunctionInfos.get(funcBody);\n    invariant(functionInfo);\n    let { usesArguments } = functionInfo;\n    let hasAnyLeakedIds = false;\n    for (const instance of instances)\n      for (const scope of instance.scopeInstances.values()) if (scope.leakedIds.length > 0) hasAnyLeakedIds = true;\n    return !shouldInlineFunction() && instances.length > 1 && !usesArguments && !hasAnyLeakedIds;\n  }\n\n  _getIdentifierReplacements(\n    funcBody: BabelNodeBlockStatement,\n    residualFunctionBindings: Map<string, ResidualFunctionBinding>\n  ): Map<BabelNodeIdentifier, Replacement> {\n    let functionInfo = this.residualFunctionInfos.get(funcBody);\n    invariant(functionInfo);\n    let { unbound } = functionInfo;\n    let res = new Map();\n    for (let [name, nodes] of unbound) {\n      let residualFunctionBinding = residualFunctionBindings.get(name);\n      if (residualFunctionBinding === undefined) continue;\n\n      // Let's skip bindings that are referring to\n      // 1) something global (without an environment record), and\n      // 2) have not been assigned a value (which would mean that they have a var/let binding and Prepack will take the liberty to rename them).\n      if (\n        residualFunctionBinding.declarativeEnvironmentRecord === null &&\n        residualFunctionBinding.value === undefined\n      ) {\n        continue;\n      }\n\n      let serializedValue = residualFunctionBinding.serializedValue;\n      invariant(serializedValue !== undefined);\n      let replacement = getReplacement(\n        serializedValue,\n        residualFunctionBinding.referentialized ? undefined : residualFunctionBinding.value\n      );\n      for (let node of nodes) res.set(node, replacement);\n    }\n    return res;\n  }\n\n  _getCallReplacements(funcBody: BabelNodeBlockStatement): Map<BabelNode, Replacement> {\n    let functionInfo = this.residualFunctionInfos.get(funcBody);\n    invariant(functionInfo);\n    let { requireCalls, modified } = functionInfo;\n    let res = new Map();\n    for (let [callNode, moduleId] of requireCalls) {\n      this.getStatistics().requireCalls++;\n      if (modified.has(callNode.callee.name)) continue;\n\n      let replacement = this.requireReturns.get(\"\" + moduleId);\n      if (replacement !== undefined) {\n        this.getStatistics().requireCallsReplaced++;\n        res.set(callNode, replacement);\n      }\n    }\n    return res;\n  }\n\n  // Note: this function takes linear time. Please do not call it inside loop.\n  _hasRewrittenFunctionInstance(\n    rewrittenAdditionalFunctions: Map<FunctionValue, Array<BabelNodeStatement>>,\n    instances: Array<FunctionInstance>\n  ): boolean {\n    return instances.find(instance => rewrittenAdditionalFunctions.has(instance.functionValue)) !== undefined;\n  }\n\n  _generateFactoryFunctionInfos(\n    rewrittenAdditionalFunctions: Map<FunctionValue, Array<BabelNodeStatement>>\n  ): Map<number, FactoryFunctionInfo> {\n    const factoryFunctionInfos = new Map();\n    for (const [functionBody, instances] of this.functions) {\n      invariant(instances.length > 0);\n\n      let factoryId;\n      const suffix = instances[0].functionValue.__originalName || this.realm.debugNames ? \"factoryFunction\" : \"\";\n      if (this._shouldUseFactoryFunction(functionBody, instances)) {\n        // Rewritten function should never use factory function.\n        invariant(!this._hasRewrittenFunctionInstance(rewrittenAdditionalFunctions, instances));\n        factoryId = t.identifier(this.factoryNameGenerator.generate(suffix));\n      } else {\n        // For inline function body case, use the first function as the factory function.\n        factoryId = this.locationService.getLocation(instances[0].functionValue);\n      }\n\n      const functionUniqueTag = ((functionBody: any): FunctionBodyAstNode).uniqueOrderedTag;\n      invariant(functionUniqueTag);\n\n      const functionInfo = this.residualFunctionInfos.get(functionBody);\n      invariant(functionInfo);\n      let anyContainingAdditionalFunction = !instances.every(\n        instance => instance.containingAdditionalFunction === undefined\n      );\n      factoryFunctionInfos.set(functionUniqueTag, { factoryId, functionInfo, anyContainingAdditionalFunction });\n    }\n    return factoryFunctionInfos;\n  }\n\n  // Preserve residual functions' ordering based on its ast dfs traversal order.\n  // This is necessary to prevent unexpected code locality issues.\n  _sortFunctionByOriginalOrdering(functionEntries: Array<[BabelNodeBlockStatement, Array<FunctionInstance>]>): void {\n    functionEntries.sort((funcA, funcB) => {\n      const funcAUniqueTag = ((funcA[0]: any): FunctionBodyAstNode).uniqueOrderedTag;\n      invariant(funcAUniqueTag);\n\n      const funcBUniqueTag = ((funcB[0]: any): FunctionBodyAstNode).uniqueOrderedTag;\n      invariant(funcBUniqueTag);\n      return funcAUniqueTag - funcBUniqueTag;\n    });\n  }\n\n  _createFunctionExpression(\n    params: Array<BabelNodeLVal>,\n    body: BabelNodeBlockStatement,\n    isLexical: boolean\n  ): BabelNodeFunctionExpression | BabelNodeArrowFunctionExpression {\n    // Additional statements might be inserted at the beginning of the body, so we clone it.\n    body = ((Object.assign({}, body): any): BabelNodeBlockStatement);\n    return isLexical ? t.arrowFunctionExpression(params, body) : t.functionExpression(null, params, body);\n  }\n\n  spliceFunctions(\n    rewrittenAdditionalFunctions: Map<FunctionValue, Array<BabelNodeStatement>>\n  ): ResidualFunctionsResult {\n    this.residualFunctionInitializers.scrubFunctionInitializers();\n\n    let functionBodies = new Map();\n    // these need to get spliced in at the end\n    let additionalFunctionModifiedBindingsSegment: Map<FunctionValue, Array<BabelNodeStatement>> = new Map();\n    let getModifiedBindingsSegment = additionalFunction =>\n      getOrDefault(additionalFunctionModifiedBindingsSegment, additionalFunction, () => []);\n    let getFunctionBody = (instance: FunctionInstance): Array<BabelNodeStatement> =>\n      getOrDefault(functionBodies, instance, () => []);\n    let getPrelude = (instance: FunctionInstance): Array<BabelNodeStatement> => {\n      let additionalFunction = instance.containingAdditionalFunction;\n      let b;\n      if (additionalFunction !== undefined) {\n        b = this.additionalFunctionPreludes.get(additionalFunction);\n        invariant(b !== undefined);\n      } else {\n        b = this.prelude;\n      }\n      return b;\n    };\n\n    let functionEntries: Array<[BabelNodeBlockStatement, Array<FunctionInstance>]> = Array.from(\n      this.functions.entries()\n    );\n    this._sortFunctionByOriginalOrdering(functionEntries);\n    this.getStatistics().functions = functionEntries.length;\n    let unstrictFunctionBodies: Array<BabelNodeFunctionExpression | BabelNodeArrowFunctionExpression> = [];\n    let strictFunctionBodies: Array<BabelNodeFunctionExpression | BabelNodeArrowFunctionExpression> = [];\n    let registerFunctionStrictness = (\n      node:\n        | BabelNodeFunctionExpression\n        | BabelNodeArrowFunctionExpression\n        | BabelNodeClassMethod\n        | BabelNodeClassExpression,\n      strict: boolean\n    ) => {\n      if (t.isFunctionExpression(node) || t.isArrowFunctionExpression(node)) {\n        (strict ? strictFunctionBodies : unstrictFunctionBodies).push(\n          ((node: any): BabelNodeFunctionExpression | BabelNodeArrowFunctionExpression)\n        );\n      }\n    };\n    let funcNodes: Map<FunctionValue, BabelNodeFunctionExpression> = new Map();\n    let defineFunction = (\n      instance: FunctionInstance,\n      funcId: BabelNodeIdentifier,\n      funcOrClassNode:\n        | BabelNodeCallExpression\n        | BabelNodeFunctionExpression\n        | BabelNodeArrowFunctionExpression\n        | BabelNodeClassExpression\n    ) => {\n      let { functionValue } = instance;\n\n      if (instance.initializationStatements.length > 0) {\n        // always add initialization statements to insertion point\n        let initializationBody = getFunctionBody(instance);\n        Array.prototype.push.apply(initializationBody, instance.initializationStatements);\n      }\n\n      let body;\n      if (t.isFunctionExpression(funcOrClassNode)) {\n        funcNodes.set(functionValue, ((funcOrClassNode: any): BabelNodeFunctionExpression));\n        body = getPrelude(instance);\n      } else {\n        invariant(\n          t.isCallExpression(funcOrClassNode) ||\n            t.isClassExpression(funcOrClassNode) ||\n            t.isArrowFunctionExpression(funcOrClassNode)\n        ); // .bind call\n        body = getFunctionBody(instance);\n      }\n      body.push(t.variableDeclaration(\"var\", [t.variableDeclarator(funcId, funcOrClassNode)]));\n      let prototypeId = this.functionPrototypes.get(functionValue);\n      if (prototypeId !== undefined) {\n        let id = this.locationService.getLocation(functionValue);\n        invariant(id !== undefined);\n        body.push(\n          t.variableDeclaration(\"var\", [\n            t.variableDeclarator(prototypeId, t.memberExpression(id, t.identifier(\"prototype\"))),\n          ])\n        );\n      }\n    };\n\n    // Emit code for ModifiedBindings for additional functions\n    for (let [funcValue, funcInfo] of this.additionalFunctionValueInfos) {\n      let scopes = new Set();\n      for (let [, residualBinding] of funcInfo.modifiedBindings) {\n        let scope = residualBinding.scope;\n        if (scope === undefined || scopes.has(scope)) continue;\n        scopes.add(scope);\n\n        invariant(residualBinding.referentialized);\n\n        // Find the proper prelude to emit to (global vs additional function's prelude)\n        let bodySegment = getModifiedBindingsSegment(funcValue);\n\n        // binding has been referentialized, so setup the scope to be able to\n        // access bindings from other __captured_scopes initializers\n        if (scope.referentializationScope !== funcValue) {\n          let init = this.referentializer.getReferentializedScopeInitialization(scope, t.numericLiteral(scope.id));\n          // flow forces me to do this\n          Array.prototype.push.apply(bodySegment, init);\n        }\n      }\n    }\n\n    // Process Additional Functions\n    for (let [funcValue, additionalFunctionInfo] of this.additionalFunctionValueInfos.entries()) {\n      let { instance } = additionalFunctionInfo;\n      let functionValue = ((funcValue: any): ECMAScriptSourceFunctionValue);\n      let params = functionValue.$FormalParameters;\n      let isLexical = functionValue.$ThisMode === \"lexical\";\n      invariant(params !== undefined);\n\n      let rewrittenBody = rewrittenAdditionalFunctions.get(funcValue);\n      invariant(rewrittenBody);\n\n      // rewritten functions shouldn't have references fixed up because the body,\n      // consists of serialized code. For simplicity we emit their instances in a naive way\n      let functionBody = t.blockStatement(rewrittenBody);\n      let funcOrClassNode;\n\n      if (this.residualClassMethodInstances.has(funcValue)) {\n        let classMethodInstance = this.residualClassMethodInstances.get(funcValue);\n        invariant(classMethodInstance);\n        let {\n          methodType,\n          classMethodKeyNode,\n          classSuperNode,\n          classMethodComputed,\n          classPrototype,\n          classMethodIsStatic,\n        } = classMethodInstance;\n\n        let isConstructor = methodType === \"constructor\";\n        invariant(classPrototype instanceof ObjectValue);\n        invariant(classMethodKeyNode && (t.isExpression(classMethodKeyNode) || t.isIdentifier(classMethodKeyNode)));\n        // we use the classPrototype as the key to get the class expression ast node\n        funcOrClassNode = this._getOrCreateClassNode(classPrototype);\n        let classMethod = t.classMethod(\n          methodType,\n          classMethodKeyNode,\n          params,\n          functionBody,\n          classMethodComputed,\n          classMethodIsStatic\n        );\n        // add the class method to the class expression node body\n        if (isConstructor) {\n          funcOrClassNode.body.body.unshift(classMethod);\n        } else {\n          funcOrClassNode.body.body.push(classMethod);\n        }\n        // we only return the funcOrClassNode if this is the constructor\n        if (!isConstructor) {\n          continue;\n        }\n        // handle the class super\n        if (classSuperNode !== undefined) {\n          funcOrClassNode.superClass = classSuperNode;\n        }\n      } else {\n        funcOrClassNode = isLexical\n          ? t.arrowFunctionExpression(params, functionBody)\n          : t.functionExpression(null, params, functionBody);\n      }\n      let id = this.locationService.getLocation(funcValue);\n      invariant(id !== undefined);\n\n      registerFunctionStrictness(\n        funcOrClassNode,\n        funcValue instanceof ECMAScriptSourceFunctionValue && funcValue.$Strict\n      );\n      defineFunction(instance, id, funcOrClassNode);\n    }\n\n    // Process normal functions\n    const factoryFunctionInfos = this._generateFactoryFunctionInfos(rewrittenAdditionalFunctions);\n    for (let [funcBody, instances] of functionEntries) {\n      let functionInfo = this.residualFunctionInfos.get(funcBody);\n      invariant(functionInfo);\n      let { unbound, usesThis } = functionInfo;\n      let params = instances[0].functionValue.$FormalParameters;\n      invariant(params !== undefined);\n\n      // Split instances into normal or nested in an additional function\n      let normalInstances = [];\n      let additionalFunctionNestedInstances = [];\n      for (let instance of instances) {\n        if (this.additionalFunctionValueNestedFunctions.has(instance.functionValue))\n          additionalFunctionNestedInstances.push(instance);\n        else normalInstances.push(instance);\n      }\n\n      let naiveProcessInstances = instancesToSplice => {\n        this.getStatistics().functionClones += instancesToSplice.length;\n\n        for (let instance of instancesToSplice) {\n          let { functionValue, residualFunctionBindings, scopeInstances } = instance;\n          let funcOrClassNode;\n\n          if (this.residualClassMethodInstances.has(functionValue)) {\n            let classMethodInstance = this.residualClassMethodInstances.get(functionValue);\n            invariant(classMethodInstance);\n            let {\n              classSuperNode,\n              classMethodKeyNode,\n              methodType,\n              classMethodComputed,\n              classPrototype,\n              classMethodIsStatic,\n            } = classMethodInstance;\n\n            let isConstructor = methodType === \"constructor\";\n            invariant(classPrototype instanceof ObjectValue);\n            invariant(classMethodKeyNode);\n            invariant(t.isExpression(classMethodKeyNode) || t.isIdentifier(classMethodKeyNode));\n            // we use the classPrototype as the key to get the class expression ast node\n            funcOrClassNode = this._getOrCreateClassNode(classPrototype);\n            // if we are dealing with a constructor, don't serialize it if the original\n            // had an empty user-land constructor (because we create a constructor behind the scenes for them)\n            let hasEmptyConstructor = !!functionValue.$HasEmptyConstructor;\n            if (!isConstructor || (isConstructor && !hasEmptyConstructor)) {\n              let methodParams = params.slice();\n              let classMethod = new ResidualFunctionInstantiator(\n                factoryFunctionInfos,\n                this.realm.moduleFactoryFunctionsToRemove,\n                this._getIdentifierReplacements(funcBody, residualFunctionBindings),\n                this._getCallReplacements(funcBody),\n                t.classMethod(\n                  methodType,\n                  classMethodKeyNode,\n                  methodParams,\n                  funcBody,\n                  classMethodComputed,\n                  classMethodIsStatic\n                )\n              ).instantiate();\n\n              // add the class method to the class expression node body\n              if (isConstructor) {\n                funcOrClassNode.body.body.unshift(classMethod);\n              } else {\n                funcOrClassNode.body.body.push(classMethod);\n              }\n            }\n            // we only return the funcOrClassNode if this is the constructor\n            if (!isConstructor) {\n              continue;\n            }\n            // handle the class super\n            if (classSuperNode !== undefined) {\n              funcOrClassNode.superClass = classSuperNode;\n            }\n          } else {\n            let isLexical = instance.functionValue.$ThisMode === \"lexical\";\n            funcOrClassNode = new ResidualFunctionInstantiator(\n              factoryFunctionInfos,\n              this.realm.moduleFactoryFunctionsToRemove,\n              this._getIdentifierReplacements(funcBody, residualFunctionBindings),\n              this._getCallReplacements(funcBody),\n              this._createFunctionExpression(params, funcBody, isLexical)\n            ).instantiate();\n\n            let scopeInitialization = [];\n            for (let scope of scopeInstances.values()) {\n              scopeInitialization = scopeInitialization.concat(\n                this.referentializer.getReferentializedScopeInitialization(scope, t.numericLiteral(scope.id))\n              );\n            }\n\n            if (scopeInitialization.length > 0) {\n              let funcOrClassNodeBody = ((funcOrClassNode.body: any): BabelNodeBlockStatement);\n              invariant(t.isBlockStatement(funcOrClassNodeBody));\n              funcOrClassNodeBody.body = scopeInitialization.concat(funcOrClassNodeBody.body);\n            }\n          }\n          let id = this.locationService.getLocation(functionValue);\n          invariant(id !== undefined);\n\n          registerFunctionStrictness(funcOrClassNode, functionValue.$Strict);\n          invariant(id !== undefined);\n          invariant(funcOrClassNode !== undefined);\n          defineFunction(instance, id, funcOrClassNode);\n        }\n      };\n\n      if (additionalFunctionNestedInstances.length > 0) naiveProcessInstances(additionalFunctionNestedInstances);\n      if (normalInstances.length > 0 && !this._shouldUseFactoryFunction(funcBody, normalInstances)) {\n        naiveProcessInstances(normalInstances);\n        this.getStatistics().functionClones--;\n      } else if (normalInstances.length > 0) {\n        const functionUniqueTag = ((funcBody: any): FunctionBodyAstNode).uniqueOrderedTag;\n        invariant(functionUniqueTag);\n        const factoryInfo = factoryFunctionInfos.get(functionUniqueTag);\n        invariant(factoryInfo);\n        const { factoryId } = factoryInfo;\n\n        // filter included variables to only include those that are different\n        let factoryNames: Array<string> = [];\n        let sameResidualBindings = new Map();\n        for (let name of unbound.keys()) {\n          let isDifferent = false;\n          let lastBinding;\n\n          let firstBinding = normalInstances[0].residualFunctionBindings.get(name);\n          invariant(firstBinding);\n          if (firstBinding.modified) {\n            // Must modify for traversal\n            sameResidualBindings.set(name, firstBinding);\n            continue;\n          }\n\n          for (let { residualFunctionBindings } of normalInstances) {\n            let residualBinding = residualFunctionBindings.get(name);\n\n            invariant(residualBinding);\n            invariant(!residualBinding.modified);\n            if (!lastBinding) {\n              lastBinding = residualBinding;\n            } else if (!AreSameResidualBinding(this.realm, residualBinding, lastBinding)) {\n              isDifferent = true;\n              break;\n            }\n          }\n\n          if (isDifferent) {\n            factoryNames.push(name);\n          } else {\n            invariant(lastBinding);\n            sameResidualBindings.set(name, lastBinding);\n          }\n        }\n\n        let factoryParams: Array<BabelNodeLVal> = [];\n        for (let key of factoryNames) {\n          factoryParams.push(t.identifier(key));\n        }\n\n        let scopeInitialization = [];\n        for (let [scopeName, scope] of normalInstances[0].scopeInstances) {\n          let scopeNameId = t.identifier(scopeName);\n          factoryParams.push(scopeNameId);\n          scopeInitialization = scopeInitialization.concat(\n            this.referentializer.getReferentializedScopeInitialization(scope, scopeNameId)\n          );\n        }\n\n        factoryParams = factoryParams.concat(params).slice();\n        let factoryNode = new ResidualFunctionInstantiator(\n          factoryFunctionInfos,\n          this.realm.moduleFactoryFunctionsToRemove,\n          this._getIdentifierReplacements(funcBody, sameResidualBindings),\n          this._getCallReplacements(funcBody),\n          this._createFunctionExpression(factoryParams, funcBody, false)\n        ).instantiate();\n\n        if (scopeInitialization.length > 0) {\n          let factoryNodeBody = ((factoryNode.body: any): BabelNodeBlockStatement);\n          invariant(t.isBlockStatement(factoryNodeBody));\n          factoryNodeBody.body = scopeInitialization.concat(factoryNodeBody.body);\n        }\n\n        // factory functions do not depend on any nested generator scope, so they go to the prelude\n        let factoryDeclaration = t.variableDeclaration(\"var\", [t.variableDeclarator(factoryId, factoryNode)]);\n        this.prelude.push(factoryDeclaration);\n\n        registerFunctionStrictness(factoryNode, normalInstances[0].functionValue.$Strict);\n\n        for (let instance of normalInstances) {\n          let { functionValue, residualFunctionBindings, insertionPoint } = instance;\n          let functionId = this.locationService.getLocation(functionValue);\n          invariant(functionId !== undefined);\n          let hasFunctionArg = false;\n          let flatArgs: Array<BabelNodeExpression> = factoryNames.map(name => {\n            let residualBinding = residualFunctionBindings.get(name);\n            invariant(residualBinding);\n            let serializedValue = residualBinding.serializedValue;\n            hasFunctionArg =\n              hasFunctionArg || (residualBinding.value && residualBinding.value instanceof FunctionValue);\n            invariant(serializedValue);\n            return serializedValue;\n          });\n          let hasAnyLeakedIds = false;\n          for (const scope of instance.scopeInstances.values()) {\n            flatArgs.push(t.numericLiteral(scope.id));\n            if (scope.leakedIds.length > 0) hasAnyLeakedIds = true;\n          }\n          let funcNode;\n          let firstUsage = this.firstFunctionUsages.get(functionValue);\n          // todo: why can this be undefined?\n          invariant(insertionPoint !== undefined);\n\n          let cannotBind =\n            this.residualFunctionInitializers.hasInitializerStatement(functionValue) ||\n            usesThis ||\n            hasFunctionArg ||\n            (firstUsage === undefined || !firstUsage.isNotEarlierThan(insertionPoint)) ||\n            this.functionPrototypes.get(functionValue) !== undefined ||\n            hasAnyLeakedIds;\n\n          // TODO 2589: Code size reduction opportunity: bring back .bind calls\n          cannotBind = true;\n\n          if (cannotBind) {\n            // The same free variables in shared instances may refer to objects with different initialization values\n            // so a stub forward function is needed during delay initializations.\n\n            let callArgs: Array<BabelNodeExpression | BabelNodeSpreadElement> = [t.thisExpression()];\n            for (let flatArg of flatArgs) callArgs.push(flatArg);\n            for (let param of params) {\n              if (param.type !== \"Identifier\") {\n                throw new FatalError(\"TODO: do not know how to deal with non-Identifier parameters\");\n              }\n              callArgs.push(((param: any): BabelNodeIdentifier));\n            }\n\n            let callee = t.memberExpression(factoryId, t.identifier(\"call\"));\n\n            let childBody = t.blockStatement([t.returnStatement(t.callExpression(callee, callArgs))]);\n\n            funcNode = t.functionExpression(null, params, childBody);\n            registerFunctionStrictness(funcNode, functionValue.$Strict);\n          } else {\n            funcNode = t.callExpression(\n              t.memberExpression(factoryId, t.identifier(\"bind\")),\n              [nullExpression].concat(flatArgs)\n            );\n          }\n\n          defineFunction(instance, functionId, funcNode);\n        }\n      }\n    }\n\n    for (let referentializationScope of this.referentializer.referentializationState.keys()) {\n      let prelude;\n      // Get the prelude for this additional function value\n      if (referentializationScope !== \"GLOBAL\") {\n        let additionalFunction = referentializationScope;\n        prelude = this.additionalFunctionPreludes.get(additionalFunction);\n        invariant(prelude !== undefined);\n      } else {\n        prelude = this.prelude;\n      }\n      prelude.unshift(\n        ...this.referentializer.createCapturedScopesPrelude(referentializationScope),\n        ...this.referentializer.createLeakedIds(referentializationScope)\n      );\n    }\n\n    for (let instance of this.functionInstances.reverse()) {\n      let functionBody = functionBodies.get(instance);\n      if (functionBody !== undefined) {\n        let insertionPoint = instance.insertionPoint;\n        invariant(insertionPoint instanceof BodyReference);\n        // v8 seems to do something clever with array splicing, so this potentially\n        // expensive operations seems to be actually cheap.\n        insertionPoint.body.entries.splice(insertionPoint.index, 0, ...functionBody);\n      }\n    }\n\n    // Inject initializer code for indexed vars into functions (for delay initializations)\n    for (let [functionValue, funcNode] of funcNodes) {\n      let initializerStatement = this.residualFunctionInitializers.getInitializerStatement(functionValue);\n      if (initializerStatement !== undefined) {\n        invariant(t.isFunctionExpression(funcNode));\n        let blockStatement: BabelNodeBlockStatement = ((funcNode: any): BabelNodeFunctionExpression).body;\n        blockStatement.body.unshift(initializerStatement);\n      }\n    }\n\n    for (let [additionalFunction, body] of Array.from(rewrittenAdditionalFunctions.entries()).reverse()) {\n      let additionalFunctionInfo = this.additionalFunctionValueInfos.get(additionalFunction);\n      invariant(additionalFunctionInfo);\n      // Modified bindings initializers of optimized function\n      let bodySegment = additionalFunctionModifiedBindingsSegment.get(additionalFunction);\n      // initializers from Referentialization\n      let initializationStatements = getFunctionBody(additionalFunctionInfo.instance);\n      let prelude = this.additionalFunctionPreludes.get(additionalFunction);\n      invariant(prelude !== undefined);\n      let insertionPoint = additionalFunctionInfo.instance.insertionPoint;\n      invariant(insertionPoint);\n      // TODO: I think this inserts things in the wrong place\n      insertionPoint.body.entries.splice(insertionPoint.index, 0, ...initializationStatements);\n      if (bodySegment) body.unshift(...bodySegment);\n      body.unshift(...prelude);\n    }\n\n    return { unstrictFunctionBodies, strictFunctionBodies };\n  }\n  _getOrCreateClassNode(classPrototype: ObjectValue): BabelNodeClassExpression {\n    if (!this.classes.has(classPrototype)) {\n      let funcOrClassNode = t.classExpression(null, null, t.classBody([]), []);\n      this.classes.set(classPrototype, funcOrClassNode);\n      return funcOrClassNode;\n    } else {\n      let funcOrClassNode = this.classes.get(classPrototype);\n      invariant(funcOrClassNode && t.isClassExpression(funcOrClassNode));\n      return funcOrClassNode;\n    }\n  }\n}\n"
  },
  {
    "path": "src/serializer/ResidualHeapGraphGenerator.js",
    "content": "/**\n * Copyright (c) 2017-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n/* @flow strict-local */\n\nimport type { Logger } from \"../utils/logger.js\";\nimport type { Modules } from \"../utils/modules.js\";\nimport type { Realm } from \"../realm.js\";\nimport type { ObjectRefCount, AdditionalFunctionEffects } from \"./types.js\";\nimport type { ResidualHeapValueIdentifiers } from \"./ResidualHeapValueIdentifiers\";\n\nimport invariant from \"../invariant.js\";\nimport {\n  Value,\n  EmptyValue,\n  FunctionValue,\n  AbstractValue,\n  SymbolValue,\n  ProxyValue,\n  ObjectValue,\n} from \"../values/index.js\";\nimport { HeapInspector } from \"../utils/HeapInspector.js\";\nimport { ResidualHeapVisitor } from \"./ResidualHeapVisitor.js\";\n\ntype Edge = {\n  fromId: number,\n  toId: number,\n};\n\n/**\n * Generate a visualizable objects graph for Prepack heap.\n */\nexport class ResidualHeapGraphGenerator extends ResidualHeapVisitor {\n  constructor(\n    realm: Realm,\n    logger: Logger,\n    modules: Modules,\n    additionalFunctionValuesAndEffects: Map<FunctionValue, AdditionalFunctionEffects>,\n    valueIdentifiers: ResidualHeapValueIdentifiers,\n    valueToEdgeRecord: Map<Value, ObjectRefCount>\n  ) {\n    super(realm, logger, modules, additionalFunctionValuesAndEffects);\n    this._valueToEdgeRecord = valueToEdgeRecord;\n    this._valueIdentifiers = valueIdentifiers;\n    this._visitedValues = new Set();\n    this._valueIds = new Map();\n    this._idSeed = 0;\n    this._path = [];\n    this._edges = [];\n  }\n\n  _valueIdentifiers: ResidualHeapValueIdentifiers;\n  _valueToEdgeRecord: Map<Value, ObjectRefCount>;\n  _valueIds: Map<Value, number>;\n  _idSeed: number;\n  _visitedValues: Set<Value>;\n  _path: Array<Value>; // Contains the path of nodes from root to current visiting node.\n  _edges: Array<Edge>;\n\n  // Override.\n  preProcessValue(val: Value): boolean {\n    if (this._shouldIgnore(val)) {\n      return true;\n    }\n    this._updateEdge(val);\n\n    if (this._visitedValues.has(val)) {\n      return false; // Already visited.\n    }\n    this._visitedValues.add(val);\n    return true;\n  }\n\n  // Override.\n  postProcessValue(val: Value): void {\n    if (this._shouldIgnore(val)) {\n      return;\n    }\n    invariant(this._path.length > 0);\n    this._path.pop();\n  }\n\n  _getValueId(val: Value): number {\n    let id = this._valueIds.get(val);\n    if (id === undefined) {\n      this._valueIds.set(val, ++this._idSeed);\n      id = this._idSeed;\n    }\n    return id;\n  }\n\n  _shouldIgnore(val: Value): boolean {\n    return val instanceof EmptyValue || val.isIntrinsic() || HeapInspector.isLeaf(val);\n  }\n\n  _updateEdge(val: Value): void {\n    if (this._path.length > 0) {\n      const parent = this._path[this._path.length - 1];\n      this._edges.push({ fromId: this._getValueId(parent), toId: this._getValueId(val) });\n    }\n    this._path.push(val);\n  }\n\n  _getValueLabel(val: Value): string {\n    // TODO: does not use ref count yet, figure out how to best visualize it later.\n    const serializedId = this._valueIdentifiers.getIdentifier(val);\n    invariant(serializedId);\n    return val.__originalName !== undefined ? `${serializedId.name}(${val.__originalName})` : serializedId.name;\n  }\n\n  _generateDotGraphData(nodes: Set<Value>, edges: Array<Edge>): string {\n    let content = \"digraph{\\n\";\n    for (const val of nodes) {\n      const nodeId = this._getValueId(val);\n      content += `  node${nodeId} [shape=${this._getValueShape(val)} label=${this._getValueLabel(val)}];\\n`;\n    }\n    for (const edge of edges) {\n      content += `  node${edge.fromId} -> node${edge.toId};\\n`;\n    }\n    content += \"}\";\n    return content;\n  }\n\n  _generateVisJSGraphData(nodes: Set<Value>, edges: Array<Edge>): string {\n    let nodesData = [];\n    let edgesData = [];\n\n    for (let node of nodes) {\n      const nodeId = this._getValueId(node);\n      let nodeData = {\n        id: `${nodeId}`,\n        label: this._getValueLabel(node),\n        shape: this._getValueShape(node),\n        color: this._getValueColor(node),\n      };\n      nodesData.push(nodeData);\n    }\n\n    for (let [index, edge] of edges.entries()) {\n      let edgeData = {\n        id: index,\n        from: `${edge.fromId}`,\n        to: `${edge.toId}`,\n        arrows: \"to\",\n      };\n      edgesData.push(edgeData);\n    }\n\n    let graphData = {\n      nodes: nodesData,\n      edges: edgesData,\n    };\n    return JSON.stringify(graphData);\n  }\n\n  // TODO: find a way to comment the meaning of shape => value mapping in final graph language.\n  _getValueShape(val: Value): string {\n    let shape = null;\n    if (val instanceof FunctionValue) {\n      shape = \"circle\";\n    } else if (val instanceof AbstractValue) {\n      shape = \"diamond\";\n    } else if (val instanceof ProxyValue) {\n      shape = \"triangle\";\n    } else if (val instanceof SymbolValue) {\n      shape = \"star\";\n    } else if (val instanceof ObjectValue) {\n      shape = \"box\";\n    } else {\n      shape = \"ellipse\";\n    }\n    return shape;\n  }\n\n  // TODO: find a way to comment the meaning of shape => value mapping in final graph language.\n  _getValueColor(val: Value): string {\n    let shape = null;\n    if (val instanceof FunctionValue) {\n      shape = \"red\";\n    } else if (val instanceof AbstractValue) {\n      shape = \"green\";\n    } else if (val instanceof ProxyValue) {\n      shape = \"orange\";\n    } else if (val instanceof SymbolValue) {\n      shape = \"yellow\";\n    } else if (val instanceof ObjectValue) {\n      shape = \"#3BB9FF\"; // light blue\n    } else {\n      shape = \"grey\";\n    }\n    return shape;\n  }\n\n  generateResult(heapGraphFormat: \"DotLanguage\" | \"VISJS\"): string {\n    return heapGraphFormat === \"DotLanguage\"\n      ? this._generateDotGraphData(this._visitedValues, this._edges)\n      : this._generateVisJSGraphData(this._visitedValues, this._edges);\n  }\n}\n"
  },
  {
    "path": "src/serializer/ResidualHeapRefCounter.js",
    "content": "/**\n * Copyright (c) 2017-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n/* @flow strict-local */\n\nimport type { Logger } from \"../utils/logger.js\";\nimport type { Modules } from \"../utils/modules.js\";\nimport type { Realm } from \"../realm.js\";\nimport type { ObjectRefCount, AdditionalFunctionEffects } from \"./types.js\";\n\nimport invariant from \"../invariant.js\";\nimport { Value, EmptyValue, FunctionValue } from \"../values/index.js\";\nimport { HeapInspector } from \"../utils/HeapInspector.js\";\nimport { ResidualHeapVisitor } from \"./ResidualHeapVisitor.js\";\n\n/**\n * Record residual heap object's incoming and outgoing reference counts.\n */\nexport class ResidualHeapRefCounter extends ResidualHeapVisitor {\n  constructor(\n    realm: Realm,\n    logger: Logger,\n    modules: Modules,\n    additionalFunctionValuesAndEffects: Map<FunctionValue, AdditionalFunctionEffects>\n  ) {\n    super(realm, logger, modules, additionalFunctionValuesAndEffects);\n    this._valueToEdgeRecord = new Map();\n    this._path = [];\n  }\n\n  _valueToEdgeRecord: Map<Value, ObjectRefCount>;\n  _path: Array<Value>; // Contains the path of nodes from root to current visiting node.\n\n  getResult(): Map<Value, ObjectRefCount> {\n    return this._valueToEdgeRecord;\n  }\n\n  _shouldIgnore(val: Value): boolean {\n    return val instanceof EmptyValue || val.isIntrinsic() || HeapInspector.isLeaf(val);\n  }\n\n  preProcessValue(val: Value): boolean {\n    if (this._shouldIgnore(val)) {\n      return false;\n    }\n\n    if (this._path.length > 0) {\n      this._updateParentOutgoingEdgeCount();\n    }\n    this._path.push(val);\n\n    return this._updateValueIncomingEdgeCount(val);\n  }\n\n  _updateParentOutgoingEdgeCount(): void {\n    const parent = this._path[this._path.length - 1];\n    const edgeRecord = this._valueToEdgeRecord.get(parent);\n    invariant(edgeRecord);\n    ++edgeRecord.outGoing;\n  }\n\n  _updateValueIncomingEdgeCount(val: Value): boolean {\n    let edgeRecord = this._valueToEdgeRecord.get(val);\n    if (edgeRecord === undefined) {\n      this._valueToEdgeRecord.set(val, {\n        inComing: 1,\n        outGoing: 0,\n      });\n      return true;\n    } else {\n      ++edgeRecord.inComing;\n      return false; // visited node, skip its children.\n    }\n  }\n\n  // Override.\n  postProcessValue(val: Value): void {\n    if (this._shouldIgnore(val)) {\n      return;\n    }\n    invariant(this._path.length > 0);\n    this._path.pop();\n  }\n\n  // Override.\n  visitRoots(): void {\n    super.visitRoots();\n    invariant(this._path.length === 0, \"Path should be balanced empty after traversal.\");\n  }\n}\n"
  },
  {
    "path": "src/serializer/ResidualHeapSerializer.js",
    "content": "/**\n * Copyright (c) 2017-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n/* @flow */\n\nimport { Realm } from \"../realm.js\";\nimport type { Descriptor, PropertyBinding } from \"../types.js\";\nimport { IsArray, Get } from \"../methods/index.js\";\nimport {\n  AbstractValue,\n  BooleanValue,\n  BoundFunctionValue,\n  ECMAScriptSourceFunctionValue,\n  EmptyValue,\n  FunctionValue,\n  NativeFunctionValue,\n  NumberValue,\n  ObjectValue,\n  ProxyValue,\n  StringValue,\n  SymbolValue,\n  Value,\n  UndefinedValue,\n} from \"../values/index.js\";\nimport * as t from \"@babel/types\";\nimport type {\n  BabelNodeExpression,\n  BabelNodeStatement,\n  BabelNodeIdentifier,\n  BabelNodeBlockStatement,\n  BabelNodeLVal,\n  BabelNodeMemberExpression,\n  BabelNodeSpreadElement,\n  BabelVariableKind,\n  BabelNodeFile,\n  BabelNodeFunctionExpression,\n} from \"@babel/types\";\nimport { Generator } from \"../utils/generator.js\";\nimport { PreludeGenerator } from \"../utils/PreludeGenerator.js\";\nimport { NameGenerator } from \"../utils/NameGenerator.js\";\nimport type { SerializationContext } from \"../utils/generator.js\";\nimport invariant from \"../invariant.js\";\nimport type {\n  ResidualFunctionBinding,\n  FunctionInfo,\n  FunctionInstance,\n  AdditionalFunctionInfo,\n  SerializedBody,\n  ClassMethodInstance,\n  AdditionalFunctionEffects,\n} from \"./types.js\";\nimport type { SerializerOptions } from \"../options.js\";\nimport { type Scope, BodyReference, type ResidualHeapInfo } from \"./types.js\";\nimport { SerializerStatistics } from \"./statistics.js\";\nimport { Logger } from \"../utils/logger.js\";\nimport { Modules } from \"../utils/modules.js\";\nimport { HeapInspector } from \"../utils/HeapInspector.js\";\nimport { ResidualFunctions } from \"./ResidualFunctions.js\";\nimport { factorifyObjects } from \"./factorify.js\";\nimport { voidExpression, emptyExpression, constructorExpression, protoExpression } from \"../utils/babelhelpers.js\";\nimport { Emitter } from \"./Emitter.js\";\nimport { ResidualHeapValueIdentifiers } from \"./ResidualHeapValueIdentifiers.js\";\nimport {\n  commonAncestorOf,\n  getSuggestedArrayLiteralLength,\n  withDescriptorValue,\n  ClassPropertiesToIgnore,\n  canIgnoreClassLengthProperty,\n  getObjectPrototypeMetadata,\n} from \"./utils.js\";\nimport { CompilerDiagnostic, FatalError } from \"../errors.js\";\nimport { canHoistFunction } from \"../react/hoisting.js\";\nimport { To } from \"../singletons.js\";\nimport { ResidualReactElementSerializer } from \"./ResidualReactElementSerializer.js\";\nimport type { Binding } from \"../environment.js\";\nimport { GlobalEnvironmentRecord, DeclarativeEnvironmentRecord } from \"../environment.js\";\nimport type { Referentializer } from \"./Referentializer.js\";\nimport { GeneratorTree } from \"./GeneratorTree.js\";\nimport { type Replacement, getReplacement } from \"./ResidualFunctionInstantiator.js\";\nimport { describeValue } from \"../utils.js\";\nimport { getAsPropertyNameExpression } from \"../utils/babelhelpers.js\";\nimport { ResidualOperationSerializer } from \"./ResidualOperationSerializer.js\";\nimport { PropertyDescriptor, AbstractJoinedDescriptor } from \"../descriptors.js\";\nimport type { ResidualOptimizedFunctions } from \"./ResidualOptimizedFunctions\";\n\nfunction commentStatement(text: string) {\n  let s = t.emptyStatement();\n  s.leadingComments = [({ type: \"BlockComment\", value: text }: any)];\n  return s;\n}\n\nclass CountingSemaphore {\n  count: number;\n  action: () => void;\n  constructor(action: () => void, initialCount: number = 1) {\n    invariant(initialCount >= 1);\n    this.count = initialCount;\n    this.action = action;\n  }\n  acquireOne() {\n    this.count++;\n  }\n  releaseOne() {\n    invariant(this.count > 0);\n    if (--this.count === 0) this.action();\n  }\n}\n\nexport class ResidualHeapSerializer {\n  constructor(\n    realm: Realm,\n    logger: Logger,\n    modules: Modules,\n    residualHeapValueIdentifiers: ResidualHeapValueIdentifiers,\n    residualHeapInspector: HeapInspector,\n    residualHeapInfo: ResidualHeapInfo,\n    options: SerializerOptions,\n    additionalFunctionValuesAndEffects: Map<FunctionValue, AdditionalFunctionEffects>,\n    referentializer: Referentializer,\n    generatorTree: GeneratorTree,\n    residualOptimizedFunctions: ResidualOptimizedFunctions\n  ) {\n    this.realm = realm;\n    this.logger = logger;\n    this.modules = modules;\n    this.residualHeapValueIdentifiers = residualHeapValueIdentifiers;\n    this.referentializer = referentializer;\n    this._residualOptimizedFunctions = residualOptimizedFunctions;\n\n    let realmGenerator = this.realm.generator;\n    invariant(realmGenerator);\n    this.generator = realmGenerator;\n    let realmPreludeGenerator = this.realm.preludeGenerator;\n    invariant(realmPreludeGenerator);\n    this.preludeGenerator = realmPreludeGenerator;\n    this.residualOperationSerializer = new ResidualOperationSerializer(realm, realmPreludeGenerator);\n\n    this.prelude = [];\n    this._descriptors = new Map();\n    this.needsEmptyVar = false;\n    this.needsAuxiliaryConstructor = false;\n    this.descriptorNameGenerator = this.preludeGenerator.createNameGenerator(\"$$\");\n    this.factoryNameGenerator = this.preludeGenerator.createNameGenerator(\"$_\");\n    this.intrinsicNameGenerator = this.preludeGenerator.createNameGenerator(\"$i_\");\n    this.functionNameGenerator = this.preludeGenerator.createNameGenerator(\"$f_\");\n    this.initializeConditionNameGenerator = this.preludeGenerator.createNameGenerator(\"_initialized\");\n    this.initializerNameGenerator = this.preludeGenerator.createNameGenerator(\"__init_\");\n    this.requireReturns = new Map();\n    this.serializedValues = new Set();\n    this._serializedValueWithIdentifiers = new Set();\n    this.additionalFunctionValueNestedFunctions = new Set();\n    this.residualReactElementSerializer = new ResidualReactElementSerializer(\n      this.realm,\n      this,\n      residualOptimizedFunctions\n    );\n    this.residualFunctions = new ResidualFunctions(\n      this.realm,\n      options,\n      this.modules,\n      this.requireReturns,\n      {\n        getContainingAdditionalFunction: functionValue => {\n          let instance = this.residualFunctionInstances.get(functionValue);\n          invariant(instance !== undefined);\n          return instance.containingAdditionalFunction;\n        },\n        getLocation: value => this.getSerializeObjectIdentifier(value),\n        createLocation: containingAdditionalFunction => {\n          let location = t.identifier(this.initializeConditionNameGenerator.generate());\n          let declar = t.variableDeclaration(\"var\", [t.variableDeclarator(location)]);\n          this.getPrelude(containingAdditionalFunction).push(declar);\n          return location;\n        },\n        createFunction: (containingAdditionalFunction, statements) => {\n          let id = t.identifier(this.initializerNameGenerator.generate());\n          this.getPrelude(containingAdditionalFunction).push(\n            t.functionDeclaration(id, [], t.blockStatement(statements))\n          );\n          return id;\n        },\n      },\n      this.prelude,\n      this.factoryNameGenerator,\n      residualHeapInfo.functionInfos,\n      residualHeapInfo.functionInstances,\n      residualHeapInfo.classMethodInstances,\n      residualHeapInfo.additionalFunctionValueInfos,\n      this.additionalFunctionValueNestedFunctions,\n      referentializer\n    );\n    this.emitter = new Emitter(\n      this.residualFunctions,\n      residualHeapInfo.referencedDeclaredValues,\n      residualHeapInfo.conditionalFeasibility,\n      this.realm.derivedIds\n    );\n    this.mainBody = this.emitter.getBody();\n    this.residualHeapInspector = residualHeapInspector;\n    this.residualValues = residualHeapInfo.values;\n    this.residualFunctionInstances = residualHeapInfo.functionInstances;\n    this.residualClassMethodInstances = residualHeapInfo.classMethodInstances;\n    this.residualFunctionInfos = residualHeapInfo.functionInfos;\n    this._options = options;\n    this.referencedDeclaredValues = residualHeapInfo.referencedDeclaredValues;\n    this.activeGeneratorBodies = new Map();\n    this.additionalFunctionValuesAndEffects = additionalFunctionValuesAndEffects;\n    this.additionalFunctionValueInfos = residualHeapInfo.additionalFunctionValueInfos;\n    this.rewrittenAdditionalFunctions = new Map();\n    this.declarativeEnvironmentRecordsBindings = residualHeapInfo.declarativeEnvironmentRecordsBindings;\n    this.globalBindings = residualHeapInfo.globalBindings;\n    this.generatorTree = generatorTree;\n    this.conditionalFeasibility = residualHeapInfo.conditionalFeasibility;\n    this.additionalFunctionGenerators = new Map();\n    this.declaredGlobalLets = new Map();\n    this._objectSemaphores = new Map();\n    this.additionalGeneratorRoots = residualHeapInfo.additionalGeneratorRoots;\n    let environment = realm.$GlobalEnv.environmentRecord;\n    invariant(environment instanceof GlobalEnvironmentRecord);\n    this.globalEnvironmentRecord = environment;\n  }\n\n  emitter: Emitter;\n  functions: Map<BabelNodeBlockStatement, Array<FunctionInstance>>;\n  functionInstances: Array<FunctionInstance>;\n  prelude: Array<BabelNodeStatement>;\n  body: Array<BabelNodeStatement>;\n  mainBody: SerializedBody;\n  realm: Realm;\n  residualOperationSerializer: ResidualOperationSerializer;\n  preludeGenerator: PreludeGenerator;\n  generator: Generator;\n  _descriptors: Map<string, BabelNodeIdentifier>;\n  needsEmptyVar: boolean;\n  needsAuxiliaryConstructor: boolean;\n  descriptorNameGenerator: NameGenerator;\n  factoryNameGenerator: NameGenerator;\n  intrinsicNameGenerator: NameGenerator;\n  functionNameGenerator: NameGenerator;\n  initializeConditionNameGenerator: NameGenerator;\n  initializerNameGenerator: NameGenerator;\n  logger: Logger;\n  modules: Modules;\n  residualHeapValueIdentifiers: ResidualHeapValueIdentifiers;\n  requireReturns: Map<number | string, Replacement>;\n  residualHeapInspector: HeapInspector;\n  residualValues: Map<Value, Set<Scope>>;\n  residualFunctionInstances: Map<FunctionValue, FunctionInstance>;\n  residualClassMethodInstances: Map<FunctionValue, ClassMethodInstance>;\n  residualFunctionInfos: Map<BabelNodeBlockStatement, FunctionInfo>;\n  serializedValues: Set<Value>;\n  _serializedValueWithIdentifiers: Set<Value>;\n  residualFunctions: ResidualFunctions;\n  _options: SerializerOptions;\n  referencedDeclaredValues: Map<Value, void | FunctionValue>;\n  activeGeneratorBodies: Map<Generator, SerializedBody>;\n  additionalFunctionValuesAndEffects: Map<FunctionValue, AdditionalFunctionEffects>;\n  additionalFunctionValueInfos: Map<FunctionValue, AdditionalFunctionInfo>;\n  rewrittenAdditionalFunctions: Map<FunctionValue, Array<BabelNodeStatement>>;\n  declarativeEnvironmentRecordsBindings: Map<DeclarativeEnvironmentRecord, Map<string, ResidualFunctionBinding>>;\n  globalBindings: Map<string, ResidualFunctionBinding>;\n  residualReactElementSerializer: ResidualReactElementSerializer;\n  referentializer: Referentializer;\n  additionalFunctionGenerators: Map<FunctionValue, Generator>;\n  _residualOptimizedFunctions: ResidualOptimizedFunctions;\n\n  // function values nested in additional functions can't delay initializations\n  // TODO: revisit this and fix additional functions to be capable of delaying initializations\n  additionalFunctionValueNestedFunctions: Set<FunctionValue>;\n\n  generatorTree: GeneratorTree;\n  conditionalFeasibility: Map<AbstractValue, { t: boolean, f: boolean }>;\n  additionalGeneratorRoots: Map<Generator, Set<ObjectValue>>;\n\n  declaredGlobalLets: Map<string, Value>;\n  globalEnvironmentRecord: GlobalEnvironmentRecord;\n\n  getStatistics(): SerializerStatistics {\n    invariant(this.realm.statistics instanceof SerializerStatistics, \"serialization requires SerializerStatistics\");\n    return this.realm.statistics;\n  }\n\n  _objectSemaphores: Map<ObjectValue, CountingSemaphore>;\n\n  _acquireOneObjectSemaphore(object: ObjectValue): void | CountingSemaphore {\n    let semaphore = this._objectSemaphores.get(object);\n    if (semaphore !== undefined) semaphore.acquireOne();\n    return semaphore;\n  }\n\n  // Configures all mutable aspects of an object, in particular:\n  // symbols, properties, prototype.\n  // For every created object that corresponds to a value,\n  // this function should be invoked once.\n  // Thus, as a side effect, we gather statistics here on all emitted objects.\n  _emitObjectProperties(\n    obj: ObjectValue,\n    properties: Map<string, PropertyBinding> = obj.properties,\n    objectPrototypeAlreadyEstablished: boolean = false,\n    cleanupDummyProperties: ?Set<string>,\n    skipPrototype: boolean = false\n  ): void {\n    //inject symbols\n    for (let [symbol, propertyBinding] of obj.symbols) {\n      invariant(propertyBinding);\n      let desc = propertyBinding.descriptor;\n      if (desc === undefined) continue; //deleted\n      let semaphore = this._acquireOneObjectSemaphore(obj);\n      this.emitter.emitNowOrAfterWaitingForDependencies(\n        this._getDescriptorValues(desc).concat([symbol, obj]),\n        () => {\n          invariant(desc !== undefined);\n          this._emitProperty(obj, symbol, desc);\n          if (semaphore !== undefined) semaphore.releaseOne();\n        },\n        this.emitter.getBody()\n      );\n    }\n\n    // TODO #2259: Make deduplication in the face of leaking work for custom accessors\n    let isCertainlyLeaked = !obj.mightNotBeLeakedObject();\n    let shouldDropAsAssignedProp = (descriptor: Descriptor | void) =>\n      isCertainlyLeaked &&\n      (descriptor instanceof PropertyDescriptor && (descriptor.get === undefined && descriptor.set === undefined));\n\n    // inject properties\n    for (let [key, propertyBinding] of properties) {\n      invariant(propertyBinding);\n\n      if (propertyBinding.pathNode !== undefined) continue; // Property is assigned to inside loop\n      let desc = propertyBinding.descriptor;\n\n      if (shouldDropAsAssignedProp(desc)) continue;\n\n      if (desc === undefined) continue; //deleted\n      if (this.residualHeapInspector.canIgnoreProperty(obj, key)) continue;\n      invariant(desc !== undefined);\n      let semaphore = this._acquireOneObjectSemaphore(obj);\n      let body = this.emitter.getBody();\n      this.emitter.emitNowOrAfterWaitingForDependencies(\n        this._getDescriptorValues(desc).concat(obj),\n        () => {\n          invariant(desc !== undefined);\n          this._emitProperty(obj, key, desc, cleanupDummyProperties != null && cleanupDummyProperties.has(key));\n          if (semaphore !== undefined) semaphore.releaseOne();\n        },\n        body\n      );\n    }\n\n    // inject properties with computed names\n    if (obj.unknownProperty !== undefined) {\n      let desc = obj.unknownProperty.descriptor;\n      if (desc !== undefined) {\n        let semaphore = this._acquireOneObjectSemaphore(obj);\n        this.emitter.emitNowOrAfterWaitingForDependencies(\n          this._getNestedValuesFromAbstractDescriptor(desc, [obj]),\n          () => {\n            this._emitPropertiesWithComputedNamesDescriptor(obj, desc);\n            if (semaphore !== undefined) semaphore.releaseOne();\n          },\n          this.emitter.getBody()\n        );\n      }\n    }\n\n    // prototype\n    if (!skipPrototype) {\n      this._emitObjectPrototype(obj, objectPrototypeAlreadyEstablished);\n      if (obj instanceof FunctionValue) this._emitConstructorPrototype(obj);\n    }\n\n    this.getStatistics().objects++;\n    this.getStatistics().objectProperties += obj.properties.size;\n  }\n\n  _emitObjectPrototype(obj: ObjectValue, objectPrototypeAlreadyEstablished: boolean): void {\n    let kind = obj.getKind();\n    let proto = obj.$Prototype;\n    if (objectPrototypeAlreadyEstablished) {\n      if (this.realm.invariantLevel >= 3) {\n        this.emitter.emitNowOrAfterWaitingForDependencies(\n          [proto, obj],\n          () => {\n            invariant(proto);\n            let serializedProto = this.serializeValue(proto);\n            let uid = this.getSerializeObjectIdentifier(obj);\n            const fetchedPrototype =\n              this.realm.isCompatibleWith(this.realm.MOBILE_JSC_VERSION) || this.realm.isCompatibleWith(\"mobile\")\n                ? t.memberExpression(uid, protoExpression)\n                : t.callExpression(this.preludeGenerator.memoizeReference(\"Object.getPrototypeOf\"), [uid]);\n            let condition = t.binaryExpression(\"!==\", fetchedPrototype, serializedProto);\n            let consequent = this.residualOperationSerializer.getErrorStatement(\n              t.stringLiteral(\"unexpected prototype\")\n            );\n            this.emitter.emit(t.ifStatement(condition, consequent));\n          },\n          this.emitter.getBody()\n        );\n      }\n      return;\n    }\n    if (proto === this.realm.intrinsics[kind + \"Prototype\"]) return;\n\n    let semaphore = this._acquireOneObjectSemaphore(obj);\n    this.emitter.emitNowOrAfterWaitingForDependencies(\n      [proto, obj],\n      () => {\n        invariant(proto);\n        let serializedProto = this.serializeValue(proto);\n        let uid = this.getSerializeObjectIdentifier(obj);\n        if (!this.realm.isCompatibleWith(this.realm.MOBILE_JSC_VERSION) && !this.realm.isCompatibleWith(\"mobile\"))\n          this.emitter.emit(\n            t.expressionStatement(\n              t.callExpression(this.preludeGenerator.memoizeReference(\"Object.setPrototypeOf\"), [uid, serializedProto])\n            )\n          );\n        else {\n          this.emitter.emit(\n            t.expressionStatement(\n              t.assignmentExpression(\"=\", t.memberExpression(uid, protoExpression), serializedProto)\n            )\n          );\n        }\n        if (semaphore !== undefined) semaphore.releaseOne();\n      },\n      this.emitter.getBody()\n    );\n  }\n\n  _emitConstructorPrototype(func: FunctionValue): void {\n    // If the original prototype object was mutated,\n    // request its serialization here as this might be observable by\n    // residual code.\n    let prototype = HeapInspector.getPropertyValue(func, \"prototype\");\n    if (prototype instanceof ObjectValue && this.residualValues.has(prototype)) {\n      this.emitter.emitNowOrAfterWaitingForDependencies(\n        [prototype],\n        () => {\n          invariant(prototype instanceof Value);\n          this.serializeValue(prototype);\n        },\n        this.emitter.getBody()\n      );\n    }\n  }\n\n  _getNestedValuesFromAbstractDescriptor(desc: void | Descriptor, values: Array<Value>): Array<Value> {\n    if (desc === undefined) return values;\n    if (desc instanceof PropertyDescriptor) {\n      let val = desc.value;\n      invariant(val instanceof AbstractValue);\n      return this._getNestedValuesFromAbstract(val, values);\n    } else if (desc instanceof AbstractJoinedDescriptor) {\n      values.push(desc.joinCondition);\n      this._getNestedValuesFromAbstractDescriptor(desc.descriptor1, values);\n      this._getNestedValuesFromAbstractDescriptor(desc.descriptor2, values);\n      return values;\n    } else {\n      invariant(false, \"unknown descriptor\");\n    }\n  }\n\n  _getNestedValuesFromAbstract(absVal: AbstractValue, values: Array<Value>): Array<Value> {\n    if (absVal.kind === \"widened property\") return values;\n    if (absVal.kind === \"template for prototype member expression\") return values;\n    invariant(absVal.args.length === 3);\n    let cond = absVal.args[0];\n    invariant(cond instanceof AbstractValue);\n    if (cond.kind === \"template for property name condition\") {\n      let P = cond.args[0];\n      values.push(P);\n      let V = absVal.args[1];\n      values.push(V);\n      let W = absVal.args[2];\n      if (W instanceof AbstractValue) this._getNestedValuesFromAbstract(W, values);\n      else values.push(W);\n    } else {\n      // conditional assignment\n      values.push(cond);\n      let consequent = absVal.args[1];\n      if (consequent instanceof AbstractValue) {\n        this._getNestedValuesFromAbstract(consequent, values);\n      } else {\n        values.push(consequent);\n      }\n      let alternate = absVal.args[2];\n      if (alternate instanceof AbstractValue) {\n        this._getNestedValuesFromAbstract(alternate, values);\n      } else {\n        values.push(alternate);\n      }\n    }\n    return values;\n  }\n\n  _emitPropertiesWithComputedNamesDescriptor(obj: ObjectValue, desc: void | Descriptor): void {\n    if (desc === undefined) return;\n    if (desc instanceof PropertyDescriptor) {\n      let val = desc.value;\n      invariant(val instanceof AbstractValue);\n      this._emitPropertiesWithComputedNames(obj, val);\n    } else if (desc instanceof AbstractJoinedDescriptor) {\n      let serializedCond = this.serializeValue(desc.joinCondition);\n\n      let valuesToProcess = new Set();\n      let consequentStatement;\n      let alternateStatement;\n\n      if (desc.descriptor1) {\n        let oldBody = this.emitter.beginEmitting(\n          \"consequent\",\n          {\n            type: \"ConditionalAssignmentBranch\",\n            parentBody: undefined,\n            entries: [],\n            done: false,\n          },\n          /*isChild*/ true\n        );\n        this._emitPropertiesWithComputedNamesDescriptor(obj, desc.descriptor1);\n        let consequentBody = this.emitter.endEmitting(\"consequent\", oldBody, valuesToProcess, /*isChild*/ true);\n        consequentStatement = t.blockStatement(consequentBody.entries);\n      }\n      if (desc.descriptor2) {\n        let oldBody = this.emitter.beginEmitting(\n          \"alternate\",\n          {\n            type: \"ConditionalAssignmentBranch\",\n            parentBody: undefined,\n            entries: [],\n            done: false,\n          },\n          /*isChild*/ true\n        );\n        this._emitPropertiesWithComputedNamesDescriptor(obj, desc.descriptor2);\n        let alternateBody = this.emitter.endEmitting(\"alternate\", oldBody, valuesToProcess, /*isChild*/ true);\n        alternateStatement = t.blockStatement(alternateBody.entries);\n      }\n      if (consequentStatement) {\n        this.emitter.emit(t.ifStatement(serializedCond, consequentStatement, alternateStatement));\n      } else if (alternateStatement) {\n        this.emitter.emit(t.ifStatement(t.unaryExpression(\"!\", serializedCond), alternateStatement));\n      }\n      this.emitter.processValues(valuesToProcess);\n    } else {\n      invariant(false, \"unknown descriptor\");\n    }\n  }\n\n  _emitPropertiesWithComputedNames(obj: ObjectValue, absVal: AbstractValue): void {\n    if (absVal.kind === \"widened property\") return;\n    if (absVal.kind === \"template for prototype member expression\") return;\n    invariant(absVal.args.length === 3);\n    let cond = absVal.args[0];\n    invariant(cond instanceof AbstractValue);\n    if (cond.kind === \"template for property name condition\") {\n      let P = cond.args[0];\n      invariant(P instanceof AbstractValue);\n      let V = absVal.args[1];\n      let earlier_props = absVal.args[2];\n      if (earlier_props instanceof AbstractValue) this._emitPropertiesWithComputedNames(obj, earlier_props);\n      let uid = this.getSerializeObjectIdentifier(obj);\n      let serializedP = this.serializeValue(P);\n      let serializedV = this.serializeValue(V);\n      this.emitter.emit(\n        t.expressionStatement(t.assignmentExpression(\"=\", t.memberExpression(uid, serializedP, true), serializedV))\n      );\n    } else {\n      // conditional assignment\n      let serializedCond = this.serializeValue(cond);\n      let consequent = absVal.args[1];\n      let valuesToProcess = new Set();\n      let consequentStatement;\n      let alternateStatement;\n\n      if (consequent instanceof AbstractValue) {\n        let oldBody = this.emitter.beginEmitting(\n          \"consequent\",\n          {\n            type: \"ConditionalAssignmentBranch\",\n            parentBody: undefined,\n            entries: [],\n            done: false,\n          },\n          /*isChild*/ true\n        );\n        this._emitPropertiesWithComputedNames(obj, consequent);\n        let consequentBody = this.emitter.endEmitting(\"consequent\", oldBody, valuesToProcess, /*isChild*/ true);\n        consequentStatement = t.blockStatement(consequentBody.entries);\n      }\n      let alternate = absVal.args[2];\n      if (alternate instanceof AbstractValue) {\n        let oldBody = this.emitter.beginEmitting(\n          \"alternate\",\n          {\n            type: \"ConditionalAssignmentBranch\",\n            parentBody: undefined,\n            entries: [],\n            done: false,\n          },\n          /*isChild*/ true\n        );\n        this._emitPropertiesWithComputedNames(obj, alternate);\n        let alternateBody = this.emitter.endEmitting(\"alternate\", oldBody, valuesToProcess, /*isChild*/ true);\n        alternateStatement = t.blockStatement(alternateBody.entries);\n      }\n      if (consequentStatement) {\n        this.emitter.emit(t.ifStatement(serializedCond, consequentStatement, alternateStatement));\n      } else if (alternateStatement) {\n        this.emitter.emit(t.ifStatement(t.unaryExpression(\"!\", serializedCond), alternateStatement));\n      }\n      this.emitter.processValues(valuesToProcess);\n    }\n  }\n\n  // Overridable.\n  getSerializeObjectIdentifier(val: Value): BabelNodeIdentifier {\n    return this.residualHeapValueIdentifiers.getIdentifierAndIncrementReferenceCount(val);\n  }\n\n  _emitProperty(\n    val: ObjectValue,\n    key: string | SymbolValue | AbstractValue,\n    desc: Descriptor | void,\n    deleteIfMightHaveBeenDeleted: boolean = false\n  ): void {\n    // Location for the property to be assigned to\n    let locationFunction = () => {\n      let serializedKey =\n        key instanceof SymbolValue || key instanceof AbstractValue\n          ? this.serializeValue(key)\n          : getAsPropertyNameExpression(key);\n      let computed = key instanceof SymbolValue || key instanceof AbstractValue || !t.isIdentifier(serializedKey);\n      return t.memberExpression(this.getSerializeObjectIdentifier(val), serializedKey, computed);\n    };\n    if (desc === undefined) {\n      this._deleteProperty(locationFunction());\n    } else {\n      this.emitter.emit(this.emitDefinePropertyBody(deleteIfMightHaveBeenDeleted, locationFunction, val, key, desc));\n    }\n  }\n\n  emitDefinePropertyBody(\n    deleteIfMightHaveBeenDeleted: boolean,\n    locationFunction: void | (() => BabelNodeLVal),\n    val: ObjectValue,\n    key: string | SymbolValue | AbstractValue,\n    desc: Descriptor\n  ): BabelNodeStatement {\n    if (desc instanceof AbstractJoinedDescriptor) {\n      let cond = this.serializeValue(desc.joinCondition);\n      invariant(cond !== undefined);\n      let trueBody;\n      let falseBody;\n      if (desc.descriptor1)\n        trueBody = this.emitDefinePropertyBody(\n          deleteIfMightHaveBeenDeleted,\n          locationFunction,\n          val,\n          key,\n          desc.descriptor1\n        );\n      if (desc.descriptor2)\n        falseBody = this.emitDefinePropertyBody(\n          deleteIfMightHaveBeenDeleted,\n          locationFunction,\n          val,\n          key,\n          desc.descriptor2\n        );\n      if (trueBody && falseBody) return t.ifStatement(cond, trueBody, falseBody);\n      if (trueBody) return t.ifStatement(cond, trueBody);\n      if (falseBody) return t.ifStatement(t.unaryExpression(\"!\", cond), falseBody);\n      invariant(false);\n    }\n    invariant(desc instanceof PropertyDescriptor);\n    if (locationFunction !== undefined && this._canEmbedProperty(val, key, desc)) {\n      let descValue = desc.value;\n      invariant(descValue instanceof Value);\n      invariant(!this.emitter.getReasonToWaitForDependencies([descValue, val]), \"precondition of _emitProperty\");\n      let mightHaveBeenDeleted = descValue.mightHaveBeenDeleted();\n      // The only case we do not need to remove the dummy property is array index property.\n      return this._getPropertyAssignmentStatement(\n        locationFunction(),\n        descValue,\n        mightHaveBeenDeleted,\n        deleteIfMightHaveBeenDeleted\n      );\n    }\n    let body = [];\n    let descProps = [];\n    let boolKeys = [\"enumerable\", \"configurable\"];\n    let valKeys = [];\n\n    if (!desc.get && !desc.set) {\n      boolKeys.push(\"writable\");\n      valKeys.push(\"value\");\n    } else {\n      valKeys.push(\"set\", \"get\");\n    }\n\n    let descriptorsKey = [];\n    for (let boolKey of boolKeys) {\n      if ((desc: any)[boolKey] !== undefined) {\n        let b: boolean = (desc: any)[boolKey];\n        invariant(b !== undefined);\n        descProps.push(t.objectProperty(t.identifier(boolKey), t.booleanLiteral(b)));\n        descriptorsKey.push(`${boolKey}:${b.toString()}`);\n      }\n    }\n\n    descriptorsKey = descriptorsKey.join(\",\");\n    let descriptorId = this._descriptors.get(descriptorsKey);\n    if (descriptorId === undefined) {\n      descriptorId = t.identifier(this.descriptorNameGenerator.generate(descriptorsKey));\n      let declar = t.variableDeclaration(\"var\", [t.variableDeclarator(descriptorId, t.objectExpression(descProps))]);\n      // The descriptors are used across all scopes, and thus must be declared in the prelude.\n      this.prelude.push(declar);\n      this._descriptors.set(descriptorsKey, descriptorId);\n    }\n    invariant(descriptorId !== undefined);\n\n    for (let descKey of valKeys) {\n      if ((desc: any)[descKey] !== undefined) {\n        let descValue: Value = (desc: any)[descKey];\n        invariant(descValue instanceof Value);\n        if (descValue instanceof UndefinedValue) {\n          this.serializeValue(descValue);\n          continue;\n        }\n        invariant(!this.emitter.getReasonToWaitForDependencies([descValue]), \"precondition of _emitProperty\");\n        body.push(\n          t.assignmentExpression(\n            \"=\",\n            t.memberExpression(descriptorId, t.identifier(descKey)),\n            this.serializeValue(descValue)\n          )\n        );\n      }\n    }\n    let serializedKey =\n      key instanceof SymbolValue || key instanceof AbstractValue\n        ? this.serializeValue(key)\n        : getAsPropertyNameExpression(key, /*canBeIdentifier*/ false);\n    invariant(!this.emitter.getReasonToWaitForDependencies([val]), \"precondition of _emitProperty\");\n    body.push(\n      t.callExpression(this.preludeGenerator.memoizeReference(\"Object.defineProperty\"), [\n        this.getSerializeObjectIdentifier(val),\n        serializedKey,\n        descriptorId,\n      ])\n    );\n    return t.expressionStatement(t.sequenceExpression(body));\n  }\n\n  _serializeDeclarativeEnvironmentRecordBinding(residualFunctionBinding: ResidualFunctionBinding): void {\n    if (!residualFunctionBinding.serializedValue) {\n      let value = residualFunctionBinding.value;\n      invariant(residualFunctionBinding.declarativeEnvironmentRecord);\n\n      if (residualFunctionBinding.hasLeaked) {\n        this.referentializer.referentializeLeakedBinding(residualFunctionBinding);\n      } else {\n        residualFunctionBinding.serializedValue =\n          value !== undefined && value !== this.realm.intrinsics.__leakedValue\n            ? this.serializeValue(value)\n            : voidExpression;\n        if (residualFunctionBinding.modified) {\n          this.referentializer.referentializeModifiedBinding(residualFunctionBinding);\n        }\n      }\n\n      if (value !== undefined && value.mightBeObject()) {\n        // Increment ref count one more time to ensure that this object will be assigned a unique id.\n        // This ensures that only once instance is created across all possible residual function invocations.\n        this.residualHeapValueIdentifiers.incrementReferenceCount(value);\n      }\n    }\n  }\n\n  // Augments an initial set of generators with all generators from\n  // which any of a given set of function values is referenced.\n  _getReferencingGenerators(\n    initialGenerators: Array<Generator>,\n    functionValues: Array<FunctionValue>,\n    referencingOnlyOptimizedFunction: void | FunctionValue\n  ): Array<Generator> {\n    let result = new Set(initialGenerators);\n    let activeFunctions = functionValues.slice();\n    let visitedFunctions = new Set();\n\n    while (activeFunctions.length > 0) {\n      let f = activeFunctions.pop();\n      if (visitedFunctions.has(f)) continue;\n      visitedFunctions.add(f);\n\n      if (f === referencingOnlyOptimizedFunction) {\n        let g = this.additionalFunctionGenerators.get(f);\n        invariant(g !== undefined);\n        result.add(g);\n      } else {\n        let scopes = this.residualValues.get(f);\n        invariant(scopes);\n        for (let scope of scopes)\n          if (scope instanceof FunctionValue) {\n            activeFunctions.push(scope);\n          } else {\n            invariant(scope instanceof Generator);\n            result.add(scope);\n          }\n      }\n    }\n    return Array.from(result);\n  }\n\n  _getActiveBodyOfGenerator(generator: Generator): void | SerializedBody {\n    return generator === this.generator ? this.mainBody : this.activeGeneratorBodies.get(generator);\n  }\n\n  // Determine whether initialization code for a value should go into the main body, or a more specific initialization body.\n  _getTarget(\n    val: Value,\n    trace?: true\n  ): {\n    body: SerializedBody,\n    usedOnlyByResidualFunctions?: true,\n    optimizedFunctionRoot?: void | FunctionValue,\n    commonAncestor?: Scope,\n    description?: string,\n  } {\n    let scopes = this.residualValues.get(val);\n    invariant(scopes !== undefined, \"value must have been visited\");\n\n    // All relevant values were visited in at least one scope.\n    invariant(scopes.size >= 1);\n    if (trace) this._logScopes(scopes);\n\n    // If a value is used in more than one scope, prevent inlining as it might be an additional root with a particular creation scope\n    if (scopes.size > 1) this.residualHeapValueIdentifiers.incrementReferenceCount(val);\n\n    // First, let's figure out from which function and generator scopes this value is referenced.\n    let functionValues = [];\n    let generators = [];\n    for (let scope of scopes) {\n      if (scope instanceof FunctionValue) {\n        functionValues.push(scope);\n      } else {\n        invariant(scope instanceof Generator, \"scope must be either function value or generator\");\n        generators.push(scope);\n      }\n    }\n\n    let optimizedFunctionRoot = this._residualOptimizedFunctions.tryGetOptimizedFunctionRoot(val);\n    if (generators.length === 0) {\n      // This value is only referenced from residual functions.\n      if (\n        this._options.delayInitializations &&\n        (optimizedFunctionRoot === undefined || !functionValues.includes(optimizedFunctionRoot))\n      ) {\n        // We can delay the initialization, and move it into a conditional code block in the residual functions!\n        let body = this.residualFunctions.residualFunctionInitializers.registerValueOnlyReferencedByResidualFunctions(\n          functionValues,\n          val\n        );\n\n        return {\n          body,\n          usedOnlyByResidualFunctions: true,\n          optimizedFunctionRoot,\n          description: \"delay_initializer\",\n        };\n      }\n    }\n\n    if (trace) console.log(`  has optimized function root? ${optimizedFunctionRoot !== undefined ? \"yes\" : \"no\"}`);\n\n    // flatten all function values into the scopes that use them\n    generators = this._getReferencingGenerators(generators, functionValues, optimizedFunctionRoot);\n\n    if (optimizedFunctionRoot === undefined) {\n      // Remove all generators rooted in optimized functions,\n      // since we know that there's at least one root that's not in an optimized function\n      // which requires the value to be emitted outside of the optimized function.\n      generators = generators.filter(generator => {\n        let s = generator;\n        while (s instanceof Generator) {\n          s = this.generatorTree.getParent(s);\n        }\n        return s === \"GLOBAL\";\n      });\n      if (generators.length === 0) {\n        // This means that the value was referenced by multiple optimized functions (but not by global code itself),\n        // and thus it must have existed at the end of global code execution.\n        // TODO: Emit to the end, not somewhere in the middle of the mainBody.\n\n        if (trace) console.log(`  no filtered generators`);\n        // TODO #2426: Revisit for nested optimized functions\n        return { body: this.mainBody };\n      }\n    }\n\n    const getGeneratorParent = g => {\n      let s = this.generatorTree.getParent(g);\n      return s instanceof Generator ? s : undefined;\n    };\n    // This value is referenced from more than one generator.\n    // Let's find the body associated with their common ancestor.\n    let commonAncestor = Array.from(generators).reduce(\n      (x, y) => commonAncestorOf(x, y, getGeneratorParent),\n      generators[0]\n    );\n    // In the case where we have no common ancestor but we have an optimized function reference,\n    // we can attempt to use the generator of the single optimized function\n    if (commonAncestor === undefined && optimizedFunctionRoot !== undefined) {\n      commonAncestor = this.additionalFunctionGenerators.get(optimizedFunctionRoot);\n    }\n    invariant(commonAncestor !== undefined, \"there must always be a common generator ancestor\");\n    if (trace) console.log(`  common ancestor: ${commonAncestor.getName()}`);\n\n    let body;\n    while (true) {\n      body = this._getActiveBodyOfGenerator(commonAncestor);\n      if (body !== undefined) break;\n      commonAncestor = getGeneratorParent(commonAncestor);\n      invariant(commonAncestor !== undefined, \"there must always be an active body for the common generator ancestor\");\n    }\n\n    // So we have a (common ancestor) body now.\n    invariant(body !== undefined, \"there must always be an active body\");\n\n    // However, there's a potential problem: That body might belong to a generator\n    // which has nested generators that are currently being processed (they are not \"done\" yet).\n    // This becomes a problem when the value for which we are trying to determine the target body\n    // depends on other values which are only declared in such not-yet-done nested generator!\n    // So we find all such not-yet-done bodies here, and pick a most nested one\n    // which is related to one of the scopes this value is used by.\n    let notYetDoneBodies = new Set();\n    this.emitter.dependenciesVisitor(val, {\n      onIntrinsicDerivedObject: dependency => {\n        if (trace) {\n          console.log(`  depending on intrinsic derived object and an identifier ${dependency.intrinsicName || \"?\"}`);\n        }\n        invariant(\n          optimizedFunctionRoot === undefined || !!this.emitter.getActiveOptimizedFunction(),\n          \"optimized function inconsistency\"\n        );\n        let declarationBody = this.emitter.getDeclarationBody(dependency);\n        if (declarationBody !== undefined) {\n          if (trace) console.log(`    has declaration body`);\n          for (let b = declarationBody; b !== undefined; b = b.parentBody) {\n            if (notYetDoneBodies.has(b)) break;\n            notYetDoneBodies.add(b);\n          }\n        }\n      },\n      onAbstractValueWithIdentifier: dependency => {\n        if (trace) console.log(`  depending on abstract value with identifier ${dependency.intrinsicName || \"?\"}`);\n        invariant(\n          optimizedFunctionRoot === undefined || !!this.emitter.getActiveOptimizedFunction(),\n          \"optimized function inconsistency\"\n        );\n        let declarationBody = this.emitter.getDeclarationBody(dependency);\n        if (declarationBody !== undefined) {\n          if (trace) console.log(`    has declaration body`);\n          for (let b = declarationBody; b !== undefined; b = b.parentBody) {\n            if (notYetDoneBodies.has(b)) break;\n            notYetDoneBodies.add(b);\n          }\n        }\n      },\n    });\n    if (trace) console.log(`  got ${notYetDoneBodies.size} not yet done bodies`);\n    for (let s of generators)\n      for (let g = s; g !== undefined; g = getGeneratorParent(g)) {\n        let scopeBody = this._getActiveBodyOfGenerator(g);\n        if (\n          scopeBody !== undefined &&\n          (scopeBody.nestingLevel || 0) > (body.nestingLevel || 0) &&\n          notYetDoneBodies.has(scopeBody)\n        ) {\n          // TODO: If there are multiple such scopeBody's, why is it okay to pick an arbitrary one?\n          body = scopeBody;\n          break;\n        }\n      }\n\n    return { body, commonAncestor };\n  }\n\n  _getValueDebugName(val: Value): string {\n    let name;\n    if (val instanceof FunctionValue) {\n      name = val.getName();\n    } else {\n      const id = this.residualHeapValueIdentifiers.getIdentifier(val);\n      invariant(id);\n      name = id.name;\n    }\n    return name;\n  }\n\n  _getResidualFunctionBinding(binding: Binding): void | ResidualFunctionBinding {\n    let environment = binding.environment;\n    if (environment === this.globalEnvironmentRecord.$DeclarativeRecord) environment = this.globalEnvironmentRecord;\n\n    if (environment === this.globalEnvironmentRecord) {\n      return this.globalBindings.get(binding.name);\n    }\n\n    invariant(environment instanceof DeclarativeEnvironmentRecord, \"only declarative environments have bindings\");\n    let residualFunctionBindings = this.declarativeEnvironmentRecordsBindings.get(environment);\n    if (residualFunctionBindings === undefined) return undefined;\n    return residualFunctionBindings.get(binding.name);\n  }\n\n  serializeBinding(binding: Binding): BabelNodeIdentifier | BabelNodeMemberExpression {\n    let residualBinding = this._getResidualFunctionBinding(binding);\n    invariant(residualBinding !== undefined, \"any referenced residual binding should have been visited\");\n\n    this._serializeDeclarativeEnvironmentRecordBinding(residualBinding);\n\n    let location = residualBinding.serializedUnscopedLocation;\n    invariant(location !== undefined);\n    return location;\n  }\n\n  getPrelude(optimizedFunction: void | FunctionValue): Array<BabelNodeStatement> {\n    if (optimizedFunction !== undefined) {\n      let body = this.residualFunctions.additionalFunctionPreludes.get(optimizedFunction);\n      invariant(body !== undefined);\n      return body;\n    } else {\n      return this.prelude;\n    }\n  }\n\n  _declare(\n    emittingToResidualFunction: boolean,\n    optimizedFunctionRoot: void | FunctionValue,\n    bindingType: BabelVariableKind,\n    id: BabelNodeLVal,\n    init: BabelNodeExpression\n  ): void {\n    if (emittingToResidualFunction) {\n      let declar = t.variableDeclaration(bindingType, [t.variableDeclarator(id)]);\n      this.getPrelude(optimizedFunctionRoot).push(declar);\n      let assignment = t.expressionStatement(t.assignmentExpression(\"=\", id, init));\n      this.emitter.emit(assignment);\n    } else {\n      let declar = t.variableDeclaration(bindingType, [t.variableDeclarator(id, init)]);\n      this.emitter.emit(declar);\n    }\n  }\n\n  serializeValue(val: Value, referenceOnly?: boolean, bindingType?: BabelVariableKind): BabelNodeExpression {\n    invariant(!(val instanceof ObjectValue && val.refuseSerialization));\n    if (val instanceof AbstractValue) {\n      if (val.kind === \"widened\") {\n        this.serializedValues.add(val);\n        let name = val.intrinsicName;\n        invariant(name !== undefined);\n        return t.identifier(name);\n      } else if (val.kind === \"widened property\") {\n        this.serializedValues.add(val);\n        return this._serializeAbstractValueHelper(val);\n      }\n    }\n\n    // make sure we're not serializing a class method here\n    if (val instanceof ECMAScriptSourceFunctionValue && this.residualClassMethodInstances.has(val)) {\n      let classMethodInstance = this.residualClassMethodInstances.get(val);\n      invariant(classMethodInstance);\n      // anything other than a class constructor should never go through serializeValue()\n      // so we need to log a nice error message to the user\n      if (classMethodInstance.methodType !== \"constructor\") {\n        let error = new CompilerDiagnostic(\n          \"a class method incorrectly went through the serializeValue() code path\",\n          val.$ECMAScriptCode.loc,\n          \"PP0022\",\n          \"FatalError\"\n        );\n        this.realm.handleError(error);\n        throw new FatalError();\n      }\n    }\n\n    if (this._serializedValueWithIdentifiers.has(val)) {\n      return this.getSerializeObjectIdentifier(val);\n    }\n\n    this.serializedValues.add(val);\n    if (!referenceOnly && HeapInspector.isLeaf(val)) {\n      let res = this._serializeValue(val);\n      invariant(res !== undefined);\n      return res;\n    }\n    this._serializedValueWithIdentifiers.add(val);\n\n    let target = this._getTarget(val);\n    let oldBody = this.emitter.beginEmitting(val, target.body);\n    let init = this._serializeValue(val);\n\n    let id = this.residualHeapValueIdentifiers.getIdentifier(val);\n    if (this._options.debugIdentifiers !== undefined && this._options.debugIdentifiers.includes(id.name)) {\n      console.log(`Tracing value with identifier ${id.name} (${val.constructor.name}) targetting ${target.body.type}`);\n      this._getTarget(val, true);\n    }\n    let result = id;\n    this.residualHeapValueIdentifiers.incrementReferenceCount(val);\n\n    if (this.residualHeapValueIdentifiers.needsIdentifier(val)) {\n      if (init) {\n        if (this._options.debugScopes) {\n          let scopes = this.residualValues.get(val);\n          invariant(scopes !== undefined);\n          const scopeList = Array.from(scopes)\n            .map(s => `\"${s.getName()}\"`)\n            .join(\",\");\n          let comment = `${this._getValueDebugName(val)} referenced from scopes [${scopeList}]`;\n          if (target.commonAncestor !== undefined)\n            comment = `${comment} with common ancestor: ${target.commonAncestor.getName()}`;\n          if (target.description !== undefined) comment = `${comment} => ${target.description} `;\n          this.emitter.emit(commentStatement(comment));\n        }\n        if (init !== id) {\n          this._declare(\n            !!target.usedOnlyByResidualFunctions,\n            target.optimizedFunctionRoot,\n            bindingType || \"var\",\n            id,\n            init\n          );\n        }\n        this.getStatistics().valueIds++;\n        if (target.usedOnlyByResidualFunctions) this.getStatistics().delayedValues++;\n      }\n    } else {\n      if (init) {\n        this.residualHeapValueIdentifiers.deleteIdentifier(val);\n        result = init;\n        this.getStatistics().valuesInlined++;\n      }\n    }\n\n    this.emitter.endEmitting(val, oldBody);\n    return result;\n  }\n\n  _serializeValueIntrinsic(val: Value): BabelNodeExpression {\n    let intrinsicName = val.intrinsicName;\n    invariant(intrinsicName);\n    if (val instanceof ObjectValue && val.intrinsicNameGenerated) {\n      // The intrinsic was generated at a particular point in time.\n      return this.preludeGenerator.convertStringToMember(intrinsicName);\n    } else {\n      // The intrinsic conceptually exists ahead of time.\n      invariant(\n        this.emitter.getBody().type === \"MainGenerator\" ||\n          this.emitter.getBody().type === \"OptimizedFunction\" ||\n          this.emitter.getBody().type === \"DelayInitializations\"\n      );\n      return this.preludeGenerator.memoizeReference(intrinsicName);\n    }\n  }\n\n  _getDescriptorValues(desc: void | Descriptor): Array<Value> {\n    if (desc === undefined) {\n      return [];\n    } else if (desc instanceof PropertyDescriptor) {\n      invariant(desc.value === undefined || desc.value instanceof Value);\n      if (desc.value !== undefined) return [desc.value];\n      invariant(desc.get !== undefined);\n      invariant(desc.set !== undefined);\n      return [desc.get, desc.set];\n    } else if (desc instanceof AbstractJoinedDescriptor) {\n      return [\n        desc.joinCondition,\n        ...this._getDescriptorValues(desc.descriptor1),\n        ...this._getDescriptorValues(desc.descriptor2),\n      ];\n    } else {\n      invariant(false, \"unknown descriptor\");\n    }\n  }\n\n  _deleteProperty(location: BabelNodeLVal): void {\n    invariant(location.type === \"MemberExpression\");\n    this.emitter.emit(\n      t.expressionStatement(t.unaryExpression(\"delete\", ((location: any): BabelNodeMemberExpression), true))\n    );\n  }\n\n  _assignProperty(\n    location: BabelNodeLVal,\n    value: Value,\n    mightHaveBeenDeleted: boolean,\n    deleteIfMightHaveBeenDeleted: boolean = false\n  ): void {\n    this.emitter.emit(\n      this._getPropertyAssignmentStatement(location, value, mightHaveBeenDeleted, deleteIfMightHaveBeenDeleted)\n    );\n  }\n\n  _getPropertyAssignmentStatement(\n    location: BabelNodeLVal,\n    value: Value,\n    mightHaveBeenDeleted: boolean,\n    deleteIfMightHaveBeenDeleted: boolean = false\n  ): BabelNodeStatement {\n    if (mightHaveBeenDeleted) {\n      invariant(value.mightHaveBeenDeleted());\n\n      // We always need to serialize this value in order to keep the invariants happy,\n      // as the visitor hasn't been taught about the following peephole optimization.\n      let serializedValue = this.serializeValue(value);\n\n      // Let's find the relevant value taking into account conditions implied by path conditions\n      while (value instanceof AbstractValue && value.kind === \"conditional\") {\n        let cf = this.conditionalFeasibility.get(value);\n        invariant(cf !== undefined);\n        if (cf.t && cf.f) break;\n        if (cf.t) value = value.args[1];\n        else {\n          invariant(cf.f);\n          value = value.args[2];\n        }\n      }\n      if (value instanceof EmptyValue) {\n        return t.expressionStatement(t.unaryExpression(\"delete\", ((location: any): BabelNodeMemberExpression), true));\n      } else if (value.mightHaveBeenDeleted()) {\n        // Let's try for a little peephole optimization, if __empty is a branch of a conditional, and the other side cannot be __empty\n        let condition;\n        if (value instanceof AbstractValue && value.kind === \"conditional\") {\n          let [c, x, y] = value.args;\n          if (x instanceof EmptyValue && !y.mightHaveBeenDeleted()) {\n            if (c instanceof AbstractValue && c.kind === \"!\") condition = this.serializeValue(c.args[0]);\n            else condition = t.unaryExpression(\"!\", this.serializeValue(c));\n            serializedValue = this.serializeValue(y);\n          } else if (y instanceof EmptyValue && !x.mightHaveBeenDeleted()) {\n            condition = this.serializeValue(c);\n            serializedValue = this.serializeValue(x);\n          }\n        }\n        if (condition === undefined) {\n          condition = t.binaryExpression(\"!==\", serializedValue, this._serializeEmptyValue());\n        }\n        let assignment = t.expressionStatement(t.assignmentExpression(\"=\", location, serializedValue));\n        let deletion = null;\n        if (deleteIfMightHaveBeenDeleted) {\n          invariant(location.type === \"MemberExpression\");\n          deletion = t.expressionStatement(\n            t.unaryExpression(\"delete\", ((location: any): BabelNodeMemberExpression), true)\n          );\n        }\n        return t.ifStatement(condition, assignment, deletion);\n      }\n    }\n\n    return t.expressionStatement(t.assignmentExpression(\"=\", location, this.serializeValue(value)));\n  }\n\n  _serializeArrayIndexProperties(\n    array: ObjectValue,\n    indexPropertyLength: number,\n    remainingProperties: Map<string, PropertyBinding>\n  ): Array<null | BabelNodeExpression | BabelNodeSpreadElement> {\n    let elems = [];\n    for (let i = 0; i < indexPropertyLength; i++) {\n      let key = i + \"\";\n      let propertyBinding = remainingProperties.get(key);\n      let elem = null;\n      // \"propertyBinding === undefined\" means array has a hole in the middle.\n      if (propertyBinding !== undefined) {\n        let descriptor = propertyBinding.descriptor;\n        // \"descriptor === undefined\" means this array item has been deleted.\n        invariant(descriptor === undefined || descriptor instanceof PropertyDescriptor);\n        if (\n          descriptor !== undefined &&\n          descriptor.value !== undefined &&\n          this._canEmbedProperty(array, key, descriptor)\n        ) {\n          let elemVal = descriptor.value;\n          invariant(elemVal instanceof Value);\n          let mightHaveBeenDeleted = elemVal.mightHaveBeenDeleted();\n          let instantRenderMode = this.realm.instantRender.enabled;\n\n          let delayReason;\n          /* In Instant Render mode, deleted indices are initialized\n          to the __empty built-in */\n          if (instantRenderMode) {\n            if (this.emitter.getReasonToWaitForDependencies(elemVal)) {\n              this.realm.instantRenderBailout(\n                \"InstantRender does not yet support cyclical arrays or objects\",\n                array.expressionLocation\n              );\n            }\n            delayReason = undefined;\n          } else {\n            delayReason =\n              this.emitter.getReasonToWaitForDependencies(elemVal) ||\n              this.emitter.getReasonToWaitForActiveValue(array, mightHaveBeenDeleted);\n          }\n          if (!delayReason) {\n            elem = this.serializeValue(elemVal);\n            remainingProperties.delete(key);\n          }\n        }\n      }\n      elems.push(elem);\n    }\n    return elems;\n  }\n\n  _serializeArrayLengthIfNeeded(\n    val: ObjectValue,\n    numberOfIndexProperties: number,\n    remainingProperties: Map<string, PropertyBinding>\n  ): void {\n    const realm = this.realm;\n    let lenProperty;\n    if (val.mightBeLeakedObject()) {\n      lenProperty = this.realm.evaluateWithoutLeakLogic(() => Get(realm, val, \"length\"));\n    } else {\n      lenProperty = Get(realm, val, \"length\");\n    }\n    // Need to serialize length property if:\n    // 1. array length is abstract.\n    // 2. array length is concrete, but different from number of index properties\n    //  we put into initialization list.\n    if (lenProperty instanceof AbstractValue || To.ToLength(realm, lenProperty) !== numberOfIndexProperties) {\n      if (!(lenProperty instanceof AbstractValue) || lenProperty.kind !== \"widened property\") {\n        let semaphore = this._acquireOneObjectSemaphore(val);\n        this.emitter.emitNowOrAfterWaitingForDependencies(\n          [val, lenProperty],\n          () => {\n            this._assignProperty(\n              t.memberExpression(this.getSerializeObjectIdentifier(val), t.identifier(\"length\")),\n              lenProperty,\n              false /*mightHaveBeenDeleted*/\n            );\n            if (semaphore !== undefined) semaphore.releaseOne();\n          },\n          this.emitter.getBody()\n        );\n      }\n      remainingProperties.delete(\"length\");\n    }\n  }\n\n  _serializeValueArray(val: ObjectValue): BabelNodeExpression {\n    let remainingProperties = new Map(val.properties);\n\n    let [unconditionalLength, assignmentNotNeeded] = getSuggestedArrayLiteralLength(this.realm, val);\n    // Use the unconditional serialized index properties as array initialization list.\n    const initProperties = this._serializeArrayIndexProperties(val, unconditionalLength, remainingProperties);\n    if (!assignmentNotNeeded) this._serializeArrayLengthIfNeeded(val, unconditionalLength, remainingProperties);\n    this._emitObjectProperties(val, remainingProperties);\n    return t.arrayExpression(initProperties);\n  }\n\n  _serializeValueMap(val: ObjectValue): BabelNodeExpression {\n    let kind = val.getKind();\n    let elems = [];\n\n    let entries;\n    let omitDeadEntries;\n\n    if (kind === \"Map\") {\n      entries = val.$MapData;\n      omitDeadEntries = false;\n    } else {\n      invariant(kind === \"WeakMap\");\n      entries = val.$WeakMapData;\n      omitDeadEntries = true;\n    }\n    invariant(entries !== undefined);\n    let len = entries.length;\n    let mapConstructorDoesntTakeArguments = this.realm.isCompatibleWith(this.realm.MOBILE_JSC_VERSION);\n\n    for (let i = 0; i < len; i++) {\n      let entry = entries[i];\n      let key = entry.$Key;\n      let value = entry.$Value;\n      if (key === undefined || value === undefined || (omitDeadEntries && !this.residualValues.has(key))) continue;\n      let mightHaveBeenDeleted = key.mightHaveBeenDeleted();\n      let delayReason =\n        this.emitter.getReasonToWaitForDependencies(key) ||\n        this.emitter.getReasonToWaitForDependencies(value) ||\n        this.emitter.getReasonToWaitForActiveValue(val, mightHaveBeenDeleted || mapConstructorDoesntTakeArguments);\n      if (delayReason) {\n        this.emitter.emitAfterWaiting(\n          delayReason,\n          [key, value, val],\n          () => {\n            invariant(key !== undefined);\n            invariant(value !== undefined);\n            this.emitter.emit(\n              t.expressionStatement(\n                t.callExpression(\n                  t.memberExpression(\n                    this.residualHeapValueIdentifiers.getIdentifierAndIncrementReferenceCount(val),\n                    t.identifier(\"set\")\n                  ),\n                  [this.serializeValue(key), this.serializeValue(value)]\n                )\n              )\n            );\n          },\n          this.emitter.getBody()\n        );\n      } else {\n        let serializedKey = this.serializeValue(key);\n        let serializedValue = this.serializeValue(value);\n        let elem = t.arrayExpression([serializedKey, serializedValue]);\n        elems.push(elem);\n      }\n    }\n\n    this._emitObjectProperties(val);\n    let args = elems.length > 0 ? [t.arrayExpression(elems)] : [];\n    return t.newExpression(this.preludeGenerator.memoizeReference(kind), args);\n  }\n\n  _serializeValueSet(val: ObjectValue): BabelNodeExpression {\n    let kind = val.getKind();\n    let elems = [];\n\n    let entries;\n    let omitDeadEntries;\n\n    if (kind === \"Set\") {\n      entries = val.$SetData;\n      omitDeadEntries = false;\n    } else {\n      invariant(kind === \"WeakSet\");\n      entries = val.$WeakSetData;\n      omitDeadEntries = true;\n    }\n\n    invariant(entries !== undefined);\n    let len = entries.length;\n    let setConstructorDoesntTakeArguments = this.realm.isCompatibleWith(this.realm.MOBILE_JSC_VERSION);\n\n    for (let i = 0; i < len; i++) {\n      let entry = entries[i];\n      if (entry === undefined || (omitDeadEntries && !this.residualValues.has(entry))) continue;\n      let mightHaveBeenDeleted = entry.mightHaveBeenDeleted();\n      let delayReason =\n        this.emitter.getReasonToWaitForDependencies(entry) ||\n        this.emitter.getReasonToWaitForActiveValue(val, mightHaveBeenDeleted || setConstructorDoesntTakeArguments);\n      if (delayReason) {\n        this.emitter.emitAfterWaiting(\n          delayReason,\n          [entry, val],\n          () => {\n            invariant(entry !== undefined);\n            this.emitter.emit(\n              t.expressionStatement(\n                t.callExpression(\n                  t.memberExpression(\n                    this.residualHeapValueIdentifiers.getIdentifierAndIncrementReferenceCount(val),\n                    t.identifier(\"add\")\n                  ),\n                  [this.serializeValue(entry)]\n                )\n              )\n            );\n          },\n          this.emitter.getBody()\n        );\n      } else {\n        let elem = this.serializeValue(entry);\n        elems.push(elem);\n      }\n    }\n\n    this._emitObjectProperties(val);\n    let args = elems.length > 0 ? [t.arrayExpression(elems)] : [];\n    return t.newExpression(this.preludeGenerator.memoizeReference(kind), args);\n  }\n\n  _serializeValueTypedArrayOrDataView(val: ObjectValue): BabelNodeExpression {\n    let buf = val.$ViewedArrayBuffer;\n    invariant(buf !== undefined);\n    let outlinedArrayBuffer = this.serializeValue(buf, true);\n    this._emitObjectProperties(val);\n    return t.newExpression(this.preludeGenerator.memoizeReference(val.getKind()), [outlinedArrayBuffer]);\n  }\n\n  _serializeValueArrayBuffer(val: ObjectValue): BabelNodeExpression {\n    let elems = [];\n\n    let len = val.$ArrayBufferByteLength;\n    let db = val.$ArrayBufferData;\n    invariant(len !== undefined);\n    invariant(db);\n    let allzero = true;\n    for (let i = 0; i < len; i++) {\n      if (db[i] !== 0) {\n        allzero = false;\n      }\n      let elem = t.numericLiteral(db[i]);\n      elems.push(elem);\n    }\n\n    this._emitObjectProperties(val);\n    if (allzero) {\n      // if they're all zero, just emit the array buffer constructor\n      return t.newExpression(this.preludeGenerator.memoizeReference(val.getKind()), [t.numericLiteral(len)]);\n    } else {\n      // initialize from a byte array otherwise\n      let arrayValue = t.arrayExpression(elems);\n      let consExpr = t.newExpression(this.preludeGenerator.memoizeReference(\"Uint8Array\"), [arrayValue]);\n      // access the Uint8Array.buffer property to extract the created buffer\n      return t.memberExpression(consExpr, t.identifier(\"buffer\"));\n    }\n  }\n\n  _serializeValueFunction(val: FunctionValue): void | BabelNodeExpression {\n    if (val instanceof BoundFunctionValue) {\n      this._emitObjectProperties(val);\n      return t.callExpression(\n        t.memberExpression(this.serializeValue(val.$BoundTargetFunction), t.identifier(\"bind\")),\n        [].concat(\n          this.serializeValue(val.$BoundThis),\n          val.$BoundArguments.map((boundArg, i) => this.serializeValue(boundArg))\n        )\n      );\n    }\n\n    invariant(!(val instanceof NativeFunctionValue), \"all native function values should be intrinsics\");\n    invariant(val instanceof ECMAScriptSourceFunctionValue);\n\n    let instance = this.residualFunctionInstances.get(val);\n    invariant(instance !== undefined);\n    let residualBindings = instance.residualFunctionBindings;\n\n    let inOptimizedFunction = this._residualOptimizedFunctions.tryGetOptimizedFunctionRoot(val);\n    if (inOptimizedFunction !== undefined) instance.containingAdditionalFunction = inOptimizedFunction;\n    let bindingsEmittedSemaphore = new CountingSemaphore(() => {\n      invariant(instance);\n      // hoist if we are in an additionalFunction\n      if (inOptimizedFunction !== undefined && canHoistFunction(this.realm, val, undefined, new Set())) {\n        instance.insertionPoint = new BodyReference(this.mainBody, this.mainBody.entries.length);\n        instance.containingAdditionalFunction = undefined;\n      } else {\n        instance.insertionPoint = this.emitter.getBodyReference();\n      }\n    });\n\n    for (let [boundName, residualBinding] of residualBindings) {\n      let referencedValues = [];\n      let serializeBindingFunc;\n      if (!residualBinding.declarativeEnvironmentRecord) {\n        serializeBindingFunc = () => this._serializeGlobalBinding(boundName, residualBinding);\n      } else {\n        serializeBindingFunc = () => this._serializeDeclarativeEnvironmentRecordBinding(residualBinding);\n        if (residualBinding.value !== undefined) referencedValues.push(residualBinding.value);\n      }\n      bindingsEmittedSemaphore.acquireOne();\n      this.emitter.emitNowOrAfterWaitingForDependencies(\n        referencedValues,\n        () => {\n          serializeBindingFunc();\n          bindingsEmittedSemaphore.releaseOne();\n        },\n        this.emitter.getBody()\n      );\n    }\n    if (val.$FunctionKind === \"classConstructor\") {\n      let homeObject = val.$HomeObject;\n      if (homeObject instanceof ObjectValue && homeObject.$IsClassPrototype) {\n        this._serializeClass(val, homeObject, bindingsEmittedSemaphore);\n        return;\n      }\n    }\n    bindingsEmittedSemaphore.releaseOne();\n    this._emitObjectProperties(val);\n    let additionalEffects = this.additionalFunctionValuesAndEffects.get(val);\n    if (additionalEffects) this._serializeAdditionalFunction(val, additionalEffects);\n  }\n\n  _serializeClass(\n    classFunc: ECMAScriptSourceFunctionValue,\n    classPrototype: ObjectValue,\n    bindingsEmittedSemaphore: CountingSemaphore\n  ): void {\n    let classMethodInstance = this.residualClassMethodInstances.get(classFunc);\n\n    invariant(classMethodInstance !== undefined);\n\n    let classProtoId;\n    let hasSerializedClassProtoId = false;\n    let propertiesToSerialize = new Map();\n\n    // handle class inheritance\n    if (!(classFunc.$Prototype instanceof NativeFunctionValue)) {\n      classMethodInstance.classSuperNode = this.serializeValue(classFunc.$Prototype);\n    }\n\n    let serializeClassPrototypeId = () => {\n      if (!hasSerializedClassProtoId) {\n        let classId = this.getSerializeObjectIdentifier(classFunc);\n        classProtoId = t.identifier(this.intrinsicNameGenerator.generate());\n        hasSerializedClassProtoId = true;\n        this.emitter.emit(\n          t.variableDeclaration(\"var\", [\n            t.variableDeclarator(classProtoId, t.memberExpression(classId, t.identifier(\"prototype\"))),\n          ])\n        );\n      }\n    };\n\n    let serializeClassMethodOrProperty = (propertyNameOrSymbol, methodFuncOrProperty) => {\n      const serializeNameAndId = () => {\n        let methodFuncOrPropertyId = this.serializeValue(methodFuncOrProperty);\n        let name;\n\n        if (typeof propertyNameOrSymbol === \"string\") {\n          name = t.identifier(propertyNameOrSymbol);\n        } else {\n          name = this.serializeValue(propertyNameOrSymbol);\n        }\n        return { name, methodFuncOrPropertyId };\n      };\n\n      if (methodFuncOrProperty instanceof ECMAScriptSourceFunctionValue) {\n        if (methodFuncOrProperty !== classFunc) {\n          // if the method does not have a $HomeObject, it's not a class method\n          if (methodFuncOrProperty.$HomeObject !== undefined) {\n            this.serializedValues.add(methodFuncOrProperty);\n            this._serializeClassMethod(propertyNameOrSymbol, methodFuncOrProperty);\n          } else {\n            // if the method is not part of the class, we have to assign it to the prototype\n            // we can't serialize via emitting the properties as that will emit all\n            // the prototype and we only want to mutate the prototype here\n            serializeClassPrototypeId();\n            invariant(classProtoId !== undefined);\n            let { name, methodFuncOrPropertyId } = serializeNameAndId();\n            this.emitter.emit(\n              t.expressionStatement(\n                t.assignmentExpression(\"=\", t.memberExpression(classProtoId, name), methodFuncOrPropertyId)\n              )\n            );\n          }\n        }\n      } else {\n        let prototypeId = t.memberExpression(this.getSerializeObjectIdentifier(classFunc), t.identifier(\"prototype\"));\n        let { name, methodFuncOrPropertyId } = serializeNameAndId();\n        this.emitter.emit(\n          t.expressionStatement(\n            t.assignmentExpression(\"=\", t.memberExpression(prototypeId, name), methodFuncOrPropertyId)\n          )\n        );\n      }\n    };\n\n    let serializeClassProperty = (propertyNameOrSymbol, propertyValue) => {\n      // we handle the prototype via class syntax\n      if (propertyNameOrSymbol === \"prototype\") {\n        this.serializedValues.add(propertyValue);\n      } else if (propertyValue instanceof ECMAScriptSourceFunctionValue && propertyValue.$HomeObject === classFunc) {\n        serializeClassMethodOrProperty(propertyNameOrSymbol, propertyValue);\n      } else {\n        let prop = classFunc.properties.get(propertyNameOrSymbol);\n        invariant(prop);\n        propertiesToSerialize.set(propertyNameOrSymbol, prop);\n      }\n    };\n\n    // find the all the properties on the class that we need to serialize\n    for (let [propertyName, method] of classFunc.properties) {\n      if (\n        !this.residualHeapInspector.canIgnoreProperty(classFunc, propertyName) &&\n        !ClassPropertiesToIgnore.has(propertyName) &&\n        method.descriptor !== undefined &&\n        !(propertyName === \"length\" && canIgnoreClassLengthProperty(classFunc, method.descriptor, this.logger))\n      ) {\n        withDescriptorValue(propertyName, method.descriptor, serializeClassProperty);\n      }\n    }\n    // pass in the properties and set it so we don't serialize the prototype\n    bindingsEmittedSemaphore.releaseOne();\n    this._emitObjectProperties(classFunc, propertiesToSerialize, undefined, undefined, true);\n\n    // handle non-symbol properties\n    for (let [propertyName, method] of classPrototype.properties) {\n      withDescriptorValue(propertyName, method.descriptor, serializeClassMethodOrProperty);\n    }\n    // handle symbol properties\n    for (let [symbol, method] of classPrototype.symbols) {\n      withDescriptorValue(symbol, method.descriptor, serializeClassMethodOrProperty);\n    }\n    // assign the AST method key node for the \"constructor\"\n    classMethodInstance.classMethodKeyNode = t.identifier(\"constructor\");\n  }\n\n  _serializeClassMethod(key: string | SymbolValue, methodFunc: ECMAScriptSourceFunctionValue): void {\n    let classMethodInstance = this.residualClassMethodInstances.get(methodFunc);\n\n    invariant(classMethodInstance !== undefined);\n    if (typeof key === \"string\") {\n      classMethodInstance.classMethodKeyNode = t.identifier(key);\n      // as we know the method name is a string again, we can remove the computed status\n      classMethodInstance.classMethodComputed = false;\n    } else if (key instanceof SymbolValue) {\n      classMethodInstance.classMethodKeyNode = this.serializeValue(key);\n    } else {\n      invariant(false, \"Unknown method key type\");\n    }\n    this._serializeValueFunction(methodFunc);\n  }\n\n  // Checks whether a property can be defined via simple assignment, or using object literal syntax.\n  _canEmbedProperty(obj: ObjectValue, key: string | SymbolValue | AbstractValue, prop: Descriptor): boolean {\n    if (!(prop instanceof PropertyDescriptor)) return false;\n\n    let targetDescriptor = this.residualHeapInspector.getTargetIntegrityDescriptor(obj);\n\n    if ((obj instanceof FunctionValue && key === \"prototype\") || (obj.getKind() === \"RegExp\" && key === \"lastIndex\"))\n      return (\n        prop.writable === targetDescriptor.writable && !prop.configurable && !prop.enumerable && !prop.set && !prop.get\n      );\n    else if (\n      prop.writable === targetDescriptor.writable &&\n      prop.configurable === targetDescriptor.configurable &&\n      !!prop.enumerable &&\n      !prop.set &&\n      !prop.get\n    ) {\n      return !(prop.value instanceof AbstractValue && prop.value.kind === \"widened property\");\n    } else {\n      return false;\n    }\n  }\n\n  _findLastObjectPrototype(obj: ObjectValue): ObjectValue {\n    while (obj.$Prototype instanceof ObjectValue) obj = obj.$Prototype;\n    return obj;\n  }\n\n  _serializeValueRegExpObject(val: ObjectValue): BabelNodeExpression {\n    let source = val.$OriginalSource;\n    let flags = val.$OriginalFlags;\n    invariant(typeof source === \"string\");\n    invariant(typeof flags === \"string\");\n    this._emitObjectProperties(val);\n    source = new RegExp(source).source; // add escapes as per 21.2.3.2.4\n    return t.regExpLiteral(source, flags);\n  }\n\n  // Overridable.\n  serializeValueRawObject(\n    val: ObjectValue,\n    skipPrototype: boolean,\n    emitIntegrityCommand: void | (SerializedBody => void)\n  ): BabelNodeExpression {\n    let remainingProperties = new Map(val.properties);\n    const dummyProperties = new Set();\n    let props = [];\n    let isCertainlyLeaked = !val.mightNotBeLeakedObject();\n\n    // TODO #2259: Make deduplication in the face of leaking work for custom accessors\n    let shouldDropAsAssignedProp = (descriptor: Descriptor | void) =>\n      isCertainlyLeaked &&\n      (descriptor instanceof PropertyDescriptor && (descriptor.get === undefined && descriptor.set === undefined));\n\n    if (val.temporalAlias !== undefined) {\n      return t.objectExpression(props);\n    } else {\n      for (let [key, propertyBinding] of val.properties) {\n        if (propertyBinding.descriptor !== undefined && shouldDropAsAssignedProp(propertyBinding.descriptor)) {\n          remainingProperties.delete(key);\n          continue;\n        }\n\n        if (propertyBinding.pathNode !== undefined) continue; // written to inside loop\n        let descriptor = propertyBinding.descriptor;\n        if (descriptor === undefined || !(descriptor instanceof PropertyDescriptor) || descriptor.value === undefined)\n          continue; // deleted\n\n        let serializedKey = getAsPropertyNameExpression(key);\n        if (this._canEmbedProperty(val, key, descriptor)) {\n          let propValue = descriptor.value;\n          invariant(propValue instanceof Value);\n          if (this.residualHeapInspector.canIgnoreProperty(val, key)) continue;\n          let mightHaveBeenDeleted = propValue.mightHaveBeenDeleted();\n\n          let instantRenderMode = this.realm.instantRender.enabled;\n\n          let delayReason;\n          if (instantRenderMode) {\n            if (this.emitter.getReasonToWaitForDependencies(propValue)) {\n              this.realm.instantRenderBailout(\n                \"InstantRender does not yet support cyclical arrays or objects\",\n                val.expressionLocation\n              );\n            }\n            delayReason = undefined;\n          } else {\n            delayReason =\n              this.emitter.getReasonToWaitForDependencies(propValue) ||\n              this.emitter.getReasonToWaitForActiveValue(val, mightHaveBeenDeleted);\n          }\n\n          // Although the property needs to be delayed, we still want to emit dummy \"undefined\"\n          // value as part of the object literal to ensure a consistent property ordering.\n          let serializedValue = !instantRenderMode ? voidExpression : emptyExpression;\n          if (delayReason) {\n            // May need to be cleaned up later.\n            dummyProperties.add(key);\n          } else {\n            remainingProperties.delete(key);\n            serializedValue = this.serializeValue(propValue);\n          }\n          props.push(t.objectProperty(serializedKey, serializedValue));\n        } else if (descriptor.value instanceof Value && descriptor.value.mightHaveBeenDeleted()) {\n          dummyProperties.add(key);\n          props.push(t.objectProperty(serializedKey, voidExpression));\n        }\n      }\n    }\n\n    this._emitObjectProperties(\n      val,\n      remainingProperties,\n      /*objectPrototypeAlreadyEstablished*/ false,\n      dummyProperties,\n      skipPrototype\n    );\n\n    return t.objectExpression(props);\n  }\n\n  _serializeValueObjectViaConstructor(\n    val: ObjectValue,\n    skipPrototype: boolean,\n    classConstructor?: Value\n  ): BabelNodeExpression {\n    let proto = val.$Prototype;\n    this._emitObjectProperties(\n      val,\n      val.properties,\n      /*objectPrototypeAlreadyEstablished*/ true,\n      undefined,\n      skipPrototype\n    );\n    let serializedProto = this.serializeValue(classConstructor ? classConstructor : proto);\n    if (val.temporalAlias === undefined) {\n      this.needsAuxiliaryConstructor = true;\n      return t.sequenceExpression([\n        t.assignmentExpression(\n          \"=\",\n          t.memberExpression(constructorExpression, t.identifier(\"prototype\")),\n          classConstructor ? t.memberExpression(serializedProto, t.identifier(\"prototype\")) : serializedProto\n        ),\n        t.newExpression(constructorExpression, []),\n      ]);\n    } else {\n      this.emitter.emitAfterWaiting(\n        val.temporalAlias,\n        [],\n        () => {\n          invariant(val.temporalAlias !== undefined);\n          let uid = this.serializeValue(val.temporalAlias);\n          this.emitter.emit(\n            t.expressionStatement(\n              t.callExpression(this.preludeGenerator.memoizeReference(\"Object.setPrototypeOf\"), [uid, serializedProto])\n            )\n          );\n        },\n        this.emitter.getBody()\n      );\n      return t.objectExpression([]);\n    }\n  }\n\n  serializeValueObject(\n    val: ObjectValue,\n    emitIntegrityCommand: void | (SerializedBody => void)\n  ): BabelNodeExpression | void {\n    // If this object is a prototype object that was implicitly created by the runtime\n    // for a constructor, then we can obtain a reference to this object\n    // in a special way that's handled alongside function serialization.\n    let constructor = val.originalConstructor;\n    if (constructor !== undefined) {\n      let prototypeId = this.residualHeapValueIdentifiers.getIdentifier(val);\n      this.emitter.emitNowOrAfterWaitingForDependencies(\n        [constructor],\n        () => {\n          invariant(constructor !== undefined);\n          invariant(prototypeId !== undefined);\n          this.serializeValue(constructor);\n          this._emitObjectProperties(val);\n          invariant(prototypeId.type === \"Identifier\");\n          this.residualFunctions.setFunctionPrototype(constructor, prototypeId);\n        },\n        this.emitter.getBody()\n      );\n      return prototypeId;\n    }\n\n    let kind = val.getKind();\n    switch (kind) {\n      case \"RegExp\":\n        return this._serializeValueRegExpObject(val);\n      case \"Number\":\n        let numberData = val.$NumberData;\n        invariant(numberData !== undefined);\n        numberData.throwIfNotConcreteNumber();\n        invariant(numberData instanceof NumberValue, \"expected number data internal slot to be a number value\");\n        this._emitObjectProperties(val);\n        return t.newExpression(this.preludeGenerator.memoizeReference(\"Number\"), [t.numericLiteral(numberData.value)]);\n      case \"String\":\n        let stringData = val.$StringData;\n        invariant(stringData !== undefined);\n        stringData.throwIfNotConcreteString();\n        invariant(stringData instanceof StringValue, \"expected string data internal slot to be a string value\");\n        this._emitObjectProperties(val);\n        return t.newExpression(this.preludeGenerator.memoizeReference(\"String\"), [t.stringLiteral(stringData.value)]);\n      case \"Boolean\":\n        let booleanData = val.$BooleanData;\n        invariant(booleanData !== undefined);\n        booleanData.throwIfNotConcreteBoolean();\n        invariant(booleanData instanceof BooleanValue, \"expected boolean data internal slot to be a boolean value\");\n        this._emitObjectProperties(val);\n        return t.newExpression(this.preludeGenerator.memoizeReference(\"Boolean\"), [\n          t.booleanLiteral(booleanData.value),\n        ]);\n      case \"Date\":\n        let dateValue = val.$DateValue;\n        invariant(dateValue !== undefined);\n        let serializedDateValue = this.serializeValue(dateValue);\n        this._emitObjectProperties(val);\n        return t.newExpression(this.preludeGenerator.memoizeReference(\"Date\"), [serializedDateValue]);\n      case \"Float32Array\":\n      case \"Float64Array\":\n      case \"Int8Array\":\n      case \"Int16Array\":\n      case \"Int32Array\":\n      case \"Uint8Array\":\n      case \"Uint16Array\":\n      case \"Uint32Array\":\n      case \"Uint8ClampedArray\":\n      case \"DataView\":\n        return this._serializeValueTypedArrayOrDataView(val);\n      case \"ArrayBuffer\":\n        return this._serializeValueArrayBuffer(val);\n      case \"ReactElement\":\n        this.residualReactElementSerializer.serializeReactElement(val);\n        return;\n      case \"Map\":\n      case \"WeakMap\":\n        return this._serializeValueMap(val);\n      case \"Set\":\n      case \"WeakSet\":\n        return this._serializeValueSet(val);\n      default:\n        invariant(kind === \"Object\", \"invariant established by visitor\");\n\n        let proto = val.$Prototype;\n        let { skipPrototype, constructor: _constructor } = getObjectPrototypeMetadata(this.realm, val);\n        let createViaAuxiliaryConstructor =\n          val.temporalAlias === undefined &&\n          proto !== this.realm.intrinsics.ObjectPrototype &&\n          this._findLastObjectPrototype(val) === this.realm.intrinsics.ObjectPrototype &&\n          proto instanceof ObjectValue &&\n          !skipPrototype;\n\n        return createViaAuxiliaryConstructor || _constructor\n          ? this._serializeValueObjectViaConstructor(val, skipPrototype, _constructor)\n          : this.serializeValueRawObject(val, skipPrototype, emitIntegrityCommand);\n    }\n  }\n\n  _serializeValueSymbol(val: SymbolValue): BabelNodeExpression {\n    let args = [];\n    if (val.$Description instanceof Value) {\n      let serializedArg = this.serializeValue(val.$Description);\n      invariant(serializedArg);\n      args.push(serializedArg);\n    }\n    // check if symbol value exists in the global symbol map, in that case we emit an invocation of System.for\n    // to look it up\n    let globalReg = this.realm.globalSymbolRegistry.find(e => e.$Symbol === val) !== undefined;\n    if (globalReg) {\n      return t.callExpression(this.preludeGenerator.memoizeReference(\"Symbol.for\"), args);\n    } else {\n      return t.callExpression(this.preludeGenerator.memoizeReference(\"Symbol\"), args);\n    }\n  }\n\n  _serializeValueProxy(val: ProxyValue): BabelNodeExpression {\n    return t.newExpression(this.preludeGenerator.memoizeReference(\"Proxy\"), [\n      this.serializeValue(val.$ProxyTarget),\n      this.serializeValue(val.$ProxyHandler),\n    ]);\n  }\n\n  _serializeAbstractValueHelper(val: AbstractValue): BabelNodeExpression {\n    let serializedArgs = val.args.map((abstractArg, i) => this.serializeValue(abstractArg));\n    if (val.kind === \"abstractConcreteUnion\") {\n      invariant(val.args.length >= 2);\n      invariant(val.args[0] instanceof AbstractValue);\n      return serializedArgs[0];\n    }\n    if (val.kind === \"explicit conversion to object\") {\n      let ob = serializedArgs[0];\n      invariant(ob !== undefined);\n      return t.callExpression(this.preludeGenerator.memoizeReference(\"Object.assign\"), [ob]);\n    } else if (val.kind === \"template for prototype member expression\") {\n      let obj = this.serializeValue(val.args[0]);\n      let prop = this.serializeValue(val.args[1]);\n      return t.memberExpression(obj, prop, true);\n    }\n    invariant(val.operationDescriptor !== undefined);\n    let serializedValue = this.residualOperationSerializer.serializeExpression(val.operationDescriptor, serializedArgs);\n    if (serializedValue.type === \"Identifier\") {\n      let id = ((serializedValue: any): BabelNodeIdentifier);\n      invariant(\n        !this.realm.derivedIds.has(id.name) ||\n          this.emitter.cannotDeclare() ||\n          this.emitter.hasBeenDeclared(val) ||\n          !!this.emitter.getActiveOptimizedFunction(),\n        `an abstract value with an identifier \"${id.name}\" was referenced before being declared`\n      );\n    }\n    return serializedValue;\n  }\n\n  _serializeAbstractValue(val: AbstractValue): void | BabelNodeExpression {\n    invariant(val.kind !== \"sentinel member expression\", \"invariant established by visitor\");\n    if (val.kind === \"conditional\") {\n      let cf = this.conditionalFeasibility.get(val);\n      invariant(cf !== undefined);\n      if (cf.t && !cf.f) return this.serializeValue(val.args[1]);\n      else if (!cf.t && cf.f) return this.serializeValue(val.args[2]);\n      else invariant(cf.t && cf.f);\n    }\n    if (val.hasIdentifier()) {\n      return this._serializeAbstractValueHelper(val);\n    } else {\n      // This abstract value's dependencies should all be declared\n      // but still need to check them again in case their serialized bodies are in different generator scope.\n      let reason = this.emitter.getReasonToWaitForDependencies(val.args);\n      if (reason === undefined) {\n        return this._serializeAbstractValueHelper(val);\n      } else {\n        this.emitter.emitAfterWaiting(\n          reason,\n          val.args,\n          () => {\n            const serializedValue = this._serializeAbstractValueHelper(val);\n            let uid = this.getSerializeObjectIdentifier(val);\n            this._declare(this.emitter.cannotDeclare(), undefined, \"var\", uid, serializedValue);\n          },\n          this.emitter.getBody()\n        );\n      }\n    }\n  }\n\n  _serializeEmptyValue(): BabelNodeExpression {\n    this.needsEmptyVar = !this.realm.instantRender.enabled;\n    return emptyExpression;\n  }\n\n  _serializeValue(val: Value): void | BabelNodeExpression {\n    if (val instanceof AbstractValue) {\n      return this._serializeAbstractValue(val);\n    } else if (val.isIntrinsic()) {\n      return this._serializeValueIntrinsic(val);\n    } else if (val instanceof EmptyValue) {\n      return this._serializeEmptyValue();\n    } else if (val instanceof UndefinedValue) {\n      return voidExpression;\n    } else if (HeapInspector.isLeaf(val)) {\n      return t.valueToNode(val.serialize());\n    } else if (val instanceof ObjectValue) {\n      return this._serializeValueObjectBase(val);\n    } else {\n      invariant(val instanceof SymbolValue);\n      return this._serializeValueSymbol(val);\n    }\n  }\n\n  _serializeValueObjectBase(obj: ObjectValue): void | BabelNodeExpression {\n    if (obj instanceof ProxyValue) {\n      return this._serializeValueProxy(obj);\n    }\n\n    let objectSemaphore;\n    let targetCommand = this.residualHeapInspector.getTargetIntegrityCommand(obj);\n    let emitIntegrityCommand;\n    if (targetCommand) {\n      let body = this.emitter.getBody();\n      objectSemaphore = new CountingSemaphore(() => {\n        this.emitter.emitNowOrAfterWaitingForDependencies(\n          [obj],\n          () => {\n            let uid = this.getSerializeObjectIdentifier(obj);\n            this.emitter.emit(\n              t.expressionStatement(\n                t.callExpression(this.preludeGenerator.memoizeReference(\"Object.\" + targetCommand), [uid])\n              )\n            );\n          },\n          body\n        );\n      });\n      this._objectSemaphores.set(obj, objectSemaphore);\n      emitIntegrityCommand = alternateBody => {\n        if (objectSemaphore !== undefined) {\n          if (alternateBody !== undefined) body = alternateBody;\n          objectSemaphore.releaseOne();\n          this._objectSemaphores.delete(obj);\n        }\n        objectSemaphore = undefined;\n      };\n    }\n    let res;\n    if (IsArray(this.realm, obj)) {\n      res = this._serializeValueArray(obj);\n    } else if (obj instanceof FunctionValue) {\n      res = this._serializeValueFunction(obj);\n    } else {\n      res = this.serializeValueObject(obj, emitIntegrityCommand);\n    }\n    if (emitIntegrityCommand !== undefined) emitIntegrityCommand();\n    return res;\n  }\n\n  _serializeGlobalBinding(boundName: string, binding: ResidualFunctionBinding): void {\n    invariant(!binding.declarativeEnvironmentRecord);\n    if (!binding.serializedValue) {\n      binding.referentialized = true;\n      if (boundName === \"undefined\") {\n        binding.serializedValue = voidExpression;\n      } else if (binding.value !== undefined) {\n        binding.serializedValue = t.identifier(boundName);\n        invariant(binding.value !== undefined);\n        this.declaredGlobalLets.set(boundName, binding.value);\n      }\n    }\n  }\n\n  _annotateGeneratorStatements(generator: Generator, statements: Array<BabelNodeStatement>): void {\n    let comment = `generator \"${generator.getName()}\"`;\n    let parent = this.generatorTree.getParent(generator);\n    if (parent instanceof Generator) {\n      comment = `${comment} with parent \"${parent.getName()}\"`;\n    } else if (parent instanceof FunctionValue) {\n      comment = `${comment} with function parent`;\n    } else {\n      invariant(parent === \"GLOBAL\");\n      comment = `${comment} with global parent`;\n    }\n    let beginComments = [commentStatement(\"begin \" + comment)];\n    let effects = generator.effectsToApply;\n    if (effects) {\n      let valueToString = value =>\n        this.residualHeapValueIdentifiers.hasIdentifier(value)\n          ? this.residualHeapValueIdentifiers.getIdentifier(value).name\n          : \"?\";\n      let keyToString = key => (typeof key === \"string\" ? key : key instanceof Value ? valueToString(key) : \"?\");\n\n      beginComments.push(\n        commentStatement(\n          `  has effects: ${effects.createdObjects.size} created objects, ${\n            effects.modifiedBindings.size\n          } modified bindings, ${effects.modifiedProperties.size} modified properties`\n        )\n      );\n      if (effects.createdObjects.size > 0)\n        beginComments.push(\n          commentStatement(\n            `    created objects: ${Array.from(effects.createdObjects)\n              .map(valueToString)\n              .join(\", \")}`\n          )\n        );\n      if (effects.modifiedBindings.size > 0)\n        beginComments.push(\n          commentStatement(\n            `    modified bindings: ${Array.from(effects.modifiedBindings.keys())\n              .map(b => b.name)\n              .join(\", \")}`\n          )\n        );\n      if (effects.modifiedProperties.size > 0)\n        beginComments.push(\n          commentStatement(\n            `    modified properties: ${Array.from(effects.modifiedProperties.keys())\n              .map(b => `${valueToString(b.object)}.${keyToString(b.key)}`)\n              .join(\", \")}`\n          )\n        );\n    }\n    statements.unshift(...beginComments);\n    statements.push(commentStatement(\"end \" + comment));\n  }\n\n  _withGeneratorScope(\n    type: \"Generator\" | \"OptimizedFunction\",\n    generator: Generator,\n    valuesToProcess: void | Set<AbstractValue | ObjectValue>,\n    callback: SerializedBody => void,\n    optimizedFunction?: void | FunctionValue\n  ): Array<BabelNodeStatement> {\n    let newBody = { type, parentBody: undefined, entries: [], done: false, optimizedFunction };\n    let optimizedFunctionRoot =\n      optimizedFunction === undefined\n        ? undefined\n        : this._residualOptimizedFunctions.tryGetOptimizedFunctionRoot(optimizedFunction);\n    let isChild = !!optimizedFunctionRoot || type === \"Generator\";\n    let oldBody = this.emitter.beginEmitting(generator, newBody, /*isChild*/ isChild);\n    invariant(!this.activeGeneratorBodies.has(generator));\n    this.activeGeneratorBodies.set(generator, newBody);\n    callback(newBody);\n    invariant(this.activeGeneratorBodies.has(generator));\n    this.activeGeneratorBodies.delete(generator);\n    const statements = this.emitter.endEmitting(generator, oldBody, valuesToProcess, /*isChild*/ isChild).entries;\n    if (this._options.debugScopes) this._annotateGeneratorStatements(generator, statements);\n    this.getStatistics().generators++;\n    return statements;\n  }\n\n  _getContext(): SerializationContext {\n    let context = {\n      serializeOperationDescriptor: this.residualOperationSerializer.serializeStatement.bind(\n        this.residualOperationSerializer\n      ),\n      serializeBinding: this.serializeBinding.bind(this),\n      serializeBindingAssignment: (binding: Binding, bindingValue: Value) => {\n        let serializeBinding = this.serializeBinding(binding);\n        let serializedValue = context.serializeValue(bindingValue);\n        return t.expressionStatement(t.assignmentExpression(\"=\", serializeBinding, serializedValue));\n      },\n      serializeCondition: (\n        condition: Value,\n        consequentGenerator: Generator,\n        alternateGenerator: Generator,\n        valuesToProcess: Set<AbstractValue | ObjectValue>\n      ) => {\n        let serializedCondition = this.serializeValue(condition);\n        let consequentBody = context.serializeGenerator(consequentGenerator, valuesToProcess);\n        let alternateBody = context.serializeGenerator(alternateGenerator, valuesToProcess);\n        return t.ifStatement(serializedCondition, t.blockStatement(consequentBody), t.blockStatement(alternateBody));\n      },\n      serializeDebugScopeComment(declared: ObjectValue | AbstractValue) {\n        let s = t.emptyStatement();\n        s.leadingComments = [({ type: \"BlockComment\", value: `declaring ${declared.intrinsicName || \"?\"}` }: any)];\n        return s;\n      },\n      serializeReturnValue: (val: Value) => {\n        return t.returnStatement(this.serializeValue(val));\n      },\n      serializeGenerator: (\n        generator: Generator,\n        valuesToProcess: Set<AbstractValue | ObjectValue>\n      ): Array<BabelNodeStatement> =>\n        this._withGeneratorScope(\"Generator\", generator, valuesToProcess, () =>\n          generator.serialize(((context: any): SerializationContext))\n        ),\n      serializeValue: this.serializeValue.bind(this),\n      initGenerator: (generator: Generator) => {\n        let activeGeneratorBody = this._getActiveBodyOfGenerator(generator);\n        invariant(activeGeneratorBody === this.emitter.getBody(), \"generator to init must be current emitter body\");\n        let s = this.additionalGeneratorRoots.get(generator);\n        if (s !== undefined) for (let value of s) this.serializeValue(value);\n      },\n      finalizeGenerator: (generator: Generator) => {\n        let activeGeneratorBody = this._getActiveBodyOfGenerator(generator);\n        invariant(activeGeneratorBody === this.emitter.getBody(), \"generator to finalize must be current emitter body\");\n        this.emitter.finalizeCurrentBody();\n      },\n      emit: (statement: BabelNodeStatement) => {\n        this.emitter.emit(statement);\n      },\n      processValues: (valuesToProcess: Set<AbstractValue | ObjectValue>) => {\n        this.emitter.processValues(valuesToProcess);\n      },\n      getPropertyAssignmentStatement: this._getPropertyAssignmentStatement.bind(this),\n      emitDefinePropertyBody: this.emitDefinePropertyBody.bind(this, false, undefined),\n      canOmit: (value: Value) => {\n        let canOmit = !this.referencedDeclaredValues.has(value) && !this.residualValues.has(value);\n        if (!canOmit) {\n          return false;\n        }\n        if (value instanceof ObjectValue && value.temporalAlias !== undefined) {\n          let temporalAlias = value.temporalAlias;\n          return !this.referencedDeclaredValues.has(temporalAlias) && !this.residualValues.has(temporalAlias);\n        }\n        return canOmit;\n      },\n      declare: (value: AbstractValue | ObjectValue) => {\n        this.emitter.declare(value);\n      },\n      emitBindingModification: (binding: Binding) => {\n        let residualFunctionBinding = this._getResidualFunctionBinding(binding);\n        if (residualFunctionBinding !== undefined) {\n          invariant(residualFunctionBinding.referentialized);\n          invariant(\n            residualFunctionBinding.serializedValue,\n            \"ResidualFunctionBinding must be referentialized before serializing a mutation to it.\"\n          );\n          let newValue = binding.value;\n          invariant(newValue);\n          let bindingReference = ((residualFunctionBinding.serializedValue: any): BabelNodeLVal);\n          invariant(\n            t.isLVal(bindingReference),\n            \"Referentialized values must be LVals even though serializedValues may be any Expression\"\n          );\n          let serializedNewValue = this.serializeValue(newValue);\n          this.emitter.emit(t.expressionStatement(t.assignmentExpression(\"=\", bindingReference, serializedNewValue)));\n        }\n      },\n      emitPropertyModification: (propertyBinding: PropertyBinding) => {\n        let desc = propertyBinding.descriptor;\n        let object = propertyBinding.object;\n        invariant(object instanceof ObjectValue);\n        if (this.residualValues.has(object)) {\n          let key = propertyBinding.key;\n          invariant(key !== undefined, \"established by visitor\");\n          let dependencies = [];\n          if (desc !== undefined) dependencies.push(...this._getDescriptorValues(desc));\n          dependencies.push(object);\n          if (key instanceof Value) dependencies.push(key);\n          this.emitter.emitNowOrAfterWaitingForDependencies(\n            dependencies,\n            () => {\n              // separate serialize object, as _emitProperty assumes that this already happened\n              this.serializeValue(object);\n              this._emitProperty(object, key, desc, true);\n            },\n            this.emitter.getBody()\n          );\n        }\n      },\n      options: this._options,\n    };\n    return context;\n  }\n\n  _shouldBeWrapped(body: Array<any>): boolean {\n    for (let i = 0; i < body.length; i++) {\n      let item = body[i];\n      if (item.type === \"ExpressionStatement\") {\n        continue;\n      } else if (item.type === \"VariableDeclaration\" || item.type === \"FunctionDeclaration\") {\n        return true;\n      } else if (item.type === \"BlockStatement\") {\n        if (this._shouldBeWrapped(item.body)) {\n          return true;\n        }\n      } else if (item.type === \"IfStatement\") {\n        if (item.alternate) {\n          if (this._shouldBeWrapped(item.alternate.body)) {\n            return true;\n          }\n        }\n        if (item.consequent) {\n          if (this._shouldBeWrapped(item.consequent.body)) {\n            return true;\n          }\n        }\n      }\n    }\n    return false;\n  }\n\n  _serializeAdditionalFunctionGeneratorAndEffects(\n    generator: Generator,\n    functionValue: FunctionValue,\n    additionalEffects: AdditionalFunctionEffects\n  ): Array<BabelNodeStatement> {\n    return this._withGeneratorScope(\n      \"OptimizedFunction\",\n      generator,\n      /*valuesToProcess*/ undefined,\n      newBody => {\n        let effectsGenerator = additionalEffects.generator;\n        invariant(effectsGenerator === generator);\n        effectsGenerator.serialize(this._getContext());\n        this.realm.withEffectsAppliedInGlobalEnv(() => {\n          const lazyHoistedReactNodes = this.residualReactElementSerializer.serializeLazyHoistedNodes(functionValue);\n          this.mainBody.entries.push(...lazyHoistedReactNodes);\n          return null;\n        }, additionalEffects.effects);\n      },\n      functionValue\n    );\n  }\n\n  // result -- serialize it, a return statement will be generated later, must be a Value\n  // Generator -- visit all entries\n  // Bindings -- only need to serialize bindings if they're captured by some nested function?\n  //          -- need to apply them and maybe need to revisit functions in ancestors to make sure\n  //          -- we don't overwrite anything they capture\n  // PropertyBindings -- visit any property bindings that aren't to createdobjects\n  // CreatedObjects -- should take care of itself\n  _serializeAdditionalFunction(\n    additionalFunctionValue: FunctionValue,\n    additionalEffects: AdditionalFunctionEffects\n  ): void {\n    let { effects, transforms, generator, additionalRoots } = additionalEffects;\n    // No function info means the function is dead code, also break recursive cycles where we've already started\n    // serializing this value\n    if (\n      !this.additionalFunctionValueInfos.has(additionalFunctionValue) ||\n      this.rewrittenAdditionalFunctions.has(additionalFunctionValue)\n    ) {\n      return;\n    }\n    this.rewrittenAdditionalFunctions.set(additionalFunctionValue, []);\n\n    // visit all additional roots before going into the additional functions;\n    // this ensures that those potentially stateful additional roots will get\n    // initially serialized with the right initial effects applied.\n    for (let additionalRoot of additionalRoots) this.serializeValue(additionalRoot);\n\n    let createdObjects = effects.createdObjects;\n    let nestedFunctions = new Set([...createdObjects].filter(object => object instanceof FunctionValue));\n    // Allows us to emit function declarations etc. inside of this additional\n    // function instead of adding them at global scope\n    // TODO: make sure this generator isn't getting mutated oddly\n    ((nestedFunctions: any): Set<FunctionValue>).forEach(val => this.additionalFunctionValueNestedFunctions.add(val));\n    let body = this._serializeAdditionalFunctionGeneratorAndEffects(\n      generator,\n      additionalFunctionValue,\n      additionalEffects\n    );\n    invariant(additionalFunctionValue instanceof ECMAScriptSourceFunctionValue);\n    for (let transform of transforms) {\n      transform(body);\n    }\n    this.rewrittenAdditionalFunctions.set(additionalFunctionValue, body);\n  }\n\n  prepareAdditionalFunctionValues(): void {\n    for (let [additionalFunctionValue, { generator }] of this.additionalFunctionValuesAndEffects.entries()) {\n      invariant(!this.additionalFunctionGenerators.has(additionalFunctionValue));\n      this.additionalFunctionGenerators.set(additionalFunctionValue, generator);\n    }\n  }\n\n  // Hook point for any serialization needs to be done after generator serialization is complete.\n  postGeneratorSerialization(): void {\n    // For overriding only.\n  }\n\n  serialize(): BabelNodeFile {\n    this.prepareAdditionalFunctionValues();\n\n    this.generator.serialize(this._getContext());\n    this.getStatistics().generators++;\n    invariant(this.emitter.declaredCount() <= this.realm.derivedIds.size);\n\n    // TODO #20: add timers\n\n    // TODO #21: add event listeners\n\n    for (let [moduleId, moduleValue] of this.modules.initializedModules)\n      this.requireReturns.set(moduleId, getReplacement(this.serializeValue(moduleValue), moduleValue));\n\n    for (let [name, value] of this.declaredGlobalLets) {\n      this.emitter.emit(\n        t.expressionStatement(t.assignmentExpression(\"=\", t.identifier(name), this.serializeValue(value)))\n      );\n    }\n\n    this.postGeneratorSerialization();\n\n    Array.prototype.push.apply(this.prelude, this.preludeGenerator.prelude);\n\n    this.emitter.finalize();\n\n    this.residualFunctions.residualFunctionInitializers.factorifyInitializers(this.factoryNameGenerator);\n    let { unstrictFunctionBodies, strictFunctionBodies } = this.residualFunctions.spliceFunctions(\n      this.rewrittenAdditionalFunctions\n    );\n\n    // add strict modes\n    let strictDirective = t.directive(t.directiveLiteral(\"use strict\"));\n    let globalDirectives = [];\n    if (!this.realm.isStrict && !unstrictFunctionBodies.length && strictFunctionBodies.length) {\n      // no unstrict functions, only strict ones\n      globalDirectives.push(strictDirective);\n    } else if (unstrictFunctionBodies.length && strictFunctionBodies.length) {\n      // strict and unstrict functions\n      funcLoop: for (let node of strictFunctionBodies) {\n        if (t.isFunctionExpression(node)) {\n          let func = ((node: any): BabelNodeFunctionExpression);\n          if (func.body.directives) {\n            for (let directive of func.body.directives) {\n              if (directive.value.value === \"use strict\") {\n                // already have a use strict directive\n                continue funcLoop;\n              }\n            }\n          } else func.body.directives = [];\n\n          func.body.directives.unshift(strictDirective);\n        }\n      }\n    }\n\n    // build ast\n    if (this.needsEmptyVar) {\n      this.prelude.push(t.variableDeclaration(\"var\", [t.variableDeclarator(emptyExpression, t.objectExpression([]))]));\n    }\n    if (this.needsAuxiliaryConstructor) {\n      this.prelude.push(\n        t.variableDeclaration(\"var\", [\n          t.variableDeclarator(constructorExpression, t.functionExpression(null, [], t.blockStatement([]))),\n        ])\n      );\n    }\n\n    let body = this.prelude.concat(this.emitter.getBody().entries);\n    factorifyObjects(body, this.factoryNameGenerator);\n\n    let ast_body = [];\n    if (this.preludeGenerator.declaredGlobals.size > 0)\n      ast_body.push(\n        t.variableDeclaration(\n          \"var\",\n          Array.from(this.preludeGenerator.declaredGlobals).map(key => t.variableDeclarator(t.identifier(key)))\n        )\n      );\n    if (this.declaredGlobalLets.size > 0)\n      ast_body.push(\n        t.variableDeclaration(\n          \"let\",\n          Array.from(this.declaredGlobalLets.keys()).map(key => t.variableDeclarator(t.identifier(key)))\n        )\n      );\n    if (body.length) {\n      if (this.realm.isCompatibleWith(\"node-source-maps\")) {\n        ast_body.push(\n          t.expressionStatement(\n            t.callExpression(\n              t.memberExpression(\n                t.callExpression(t.identifier(\"require\"), [t.stringLiteral(\"source-map-support\")]),\n                t.identifier(\"install\")\n              ),\n              []\n            )\n          )\n        );\n      }\n\n      if (this._shouldBeWrapped(body)) {\n        let globalExpression = t.thisExpression();\n\n        let functionExpression = t.functionExpression(null, [], t.blockStatement(body, globalDirectives));\n        let callExpression = this.preludeGenerator.usesThis\n          ? t.callExpression(t.memberExpression(functionExpression, t.identifier(\"call\")), [globalExpression])\n          : t.callExpression(functionExpression, []);\n        ast_body.push(t.expressionStatement(callExpression));\n      } else {\n        Array.prototype.push.apply(ast_body, body);\n      }\n    }\n\n    // Make sure that the visitor visited exactly the same values as the serializer\n    if (\n      this.serializedValues.size !== this.residualValues.size ||\n      !Array.from(this.serializedValues).every(val => this.residualValues.has(val))\n    ) {\n      this._logSerializedResidualMismatches();\n      invariant(false, \"serialized \" + this.serializedValues.size + \" of \" + this.residualValues.size);\n    }\n\n    // TODO: find better way to do this?\n    // revert changes to functionInstances in case we do multiple serialization passes\n    for (let instance of this.residualFunctionInstances.values()) {\n      this.referentializer.cleanInstance(instance);\n    }\n\n    let program_directives = [];\n    if (this.realm.isStrict) program_directives.push(strictDirective);\n    return t.file(t.program(ast_body, program_directives));\n  }\n\n  _logScopes(scopes: Set<Scope>): void {\n    console.log(`  referenced by ${scopes.size} scopes`);\n    for (let s of scopes)\n      if (s instanceof Generator) {\n        let text = \"\";\n        for (; s instanceof Generator; s = this.generatorTree.getParent(s)) text += \"=>\" + s.getName();\n        console.log(`      ${text}`);\n      } else {\n        invariant(s instanceof FunctionValue);\n        console.log(`      ${s.__originalName || JSON.stringify(s.expressionLocation) || s.constructor.name}`);\n      }\n  }\n\n  _logSerializedResidualMismatches(): void {\n    let logValue = value => {\n      console.log(describeValue(value));\n      let scopes = this.residualValues.get(value);\n      if (scopes !== undefined) this._logScopes(scopes);\n    };\n    console.log(\"=== serialized but not visited values\");\n    for (let value of this.serializedValues) if (!this.residualValues.has(value)) logValue(value);\n    console.log(\"=== visited but not serialized values\");\n    for (let value of this.residualValues.keys()) if (!this.serializedValues.has(value)) logValue(value);\n  }\n}\n"
  },
  {
    "path": "src/serializer/ResidualHeapValueIdentifiers.js",
    "content": "/**\n * Copyright (c) 2017-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n/* @flow strict-local */\n\nimport { Value } from \"../values/index.js\";\nimport type { BabelNodeIdentifier } from \"@babel/types\";\nimport invariant from \"../invariant.js\";\nimport type { PreludeGenerator } from \"../utils/PreludeGenerator.js\";\nimport type { NameGenerator } from \"../utils/NameGenerator.js\";\nimport * as t from \"@babel/types\";\n\n// This class maintains a map of values to babel identifiers.\n// This class can optionally track how often such value identifiers are referenced\n// when pass 1 is activated, which is usually followed by pass 2 in which\n// unneeded identifiers (those which were only ever referenced once) are\n// eliminated as the defining expression can be inlined.\nexport class ResidualHeapValueIdentifiers {\n  constructor(values: Iterator<Value>, preludeGenerator: PreludeGenerator) {\n    this.collectValToRefCountOnly = false;\n    this._valueNameGenerator = preludeGenerator.createNameGenerator(\"_\");\n    this._populateIdentifierMap(values);\n  }\n\n  initPass1(): void {\n    this.collectValToRefCountOnly = true;\n    this.valToRefCount = new Map();\n  }\n\n  initPass2(): void {\n    this.collectValToRefCountOnly = false;\n  }\n\n  collectValToRefCountOnly: boolean;\n  valToRefCount: void | Map<Value, number>;\n  refs: Map<Value, BabelNodeIdentifier>;\n  _valueNameGenerator: NameGenerator;\n\n  _populateIdentifierMap(values: Iterator<Value>): void {\n    this.refs = new Map();\n    for (const val of values) {\n      this._setIdentifier(val, this._createNewIdentifier(val));\n    }\n  }\n\n  _createNewIdentifier(val: Value): BabelNodeIdentifier {\n    const name = this._valueNameGenerator.generate(val.__originalName || \"\");\n    return t.identifier(name);\n  }\n\n  _setIdentifier(val: Value, id: BabelNodeIdentifier) {\n    invariant(!this.refs.has(val));\n    this.refs.set(val, id);\n  }\n\n  hasIdentifier(val: Value): boolean {\n    return this.refs.has(val);\n  }\n\n  getIdentifier(val: Value): BabelNodeIdentifier {\n    let id = this.refs.get(val);\n    invariant(id !== undefined);\n    return id;\n  }\n\n  deleteIdentifier(val: Value): void {\n    invariant(this.refs.has(val));\n    this.refs.delete(val);\n  }\n\n  getIdentifierAndIncrementReferenceCount(val: Value): BabelNodeIdentifier {\n    this.incrementReferenceCount(val);\n    let id = this.refs.get(val);\n    invariant(id !== undefined, \"Value Id cannot be null or undefined\");\n    return id;\n  }\n\n  incrementReferenceCount(val: Value): void {\n    if (this.collectValToRefCountOnly) {\n      let valToRefCount = this.valToRefCount;\n      invariant(valToRefCount !== undefined);\n      let refCount = valToRefCount.get(val);\n      if (refCount !== undefined) {\n        refCount++;\n      } else {\n        refCount = 1;\n      }\n      valToRefCount.set(val, refCount);\n    }\n  }\n\n  needsIdentifier(val: Value): boolean {\n    if (this.collectValToRefCountOnly || this.valToRefCount === undefined) return true;\n    let refCount = this.valToRefCount.get(val);\n    invariant(refCount !== undefined && refCount > 0);\n    return refCount !== 1;\n  }\n}\n"
  },
  {
    "path": "src/serializer/ResidualHeapVisitor.js",
    "content": "/**\n * Copyright (c) 2017-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n/* @flow */\n\nimport { GlobalEnvironmentRecord, DeclarativeEnvironmentRecord, EnvironmentRecord } from \"../environment.js\";\nimport { CompilerDiagnostic, FatalError } from \"../errors.js\";\nimport { type Effects, Realm } from \"../realm.js\";\nimport { Path } from \"../singletons.js\";\nimport type { Descriptor, PropertyBinding, ObjectKind } from \"../types.js\";\nimport type { Binding } from \"../environment.js\";\nimport { HashSet, IsArray, Get } from \"../methods/index.js\";\nimport {\n  AbstractObjectValue,\n  AbstractValue,\n  ArrayValue,\n  BoundFunctionValue,\n  ECMAScriptFunctionValue,\n  ECMAScriptSourceFunctionValue,\n  EmptyValue,\n  FunctionValue,\n  NativeFunctionValue,\n  ObjectValue,\n  ProxyValue,\n  StringValue,\n  SymbolValue,\n  Value,\n} from \"../values/index.js\";\nimport { describeLocation } from \"../intrinsics/ecma262/Error.js\";\nimport * as t from \"@babel/types\";\nimport type { BabelNodeBlockStatement } from \"@babel/types\";\nimport { Generator } from \"../utils/generator.js\";\nimport type { GeneratorEntry, VisitEntryCallbacks } from \"../utils/generator.js\";\nimport traverse from \"@babel/traverse\";\nimport invariant from \"../invariant.js\";\nimport type {\n  AdditionalFunctionEffects,\n  AdditionalFunctionInfo,\n  ClassMethodInstance,\n  FunctionInfo,\n  FunctionInstance,\n  ResidualFunctionBinding,\n  ReferentializationScope,\n  Scope,\n  ResidualHeapInfo,\n} from \"./types.js\";\nimport { ClosureRefVisitor } from \"./visitors.js\";\nimport { Logger } from \"../utils/logger.js\";\nimport { Modules } from \"../utils/modules.js\";\nimport { HeapInspector } from \"../utils/HeapInspector.js\";\nimport {\n  canIgnoreClassLengthProperty,\n  ClassPropertiesToIgnore,\n  getObjectPrototypeMetadata,\n  getOrDefault,\n  getSuggestedArrayLiteralLength,\n  withDescriptorValue,\n} from \"./utils.js\";\nimport { createPathConditions, Environment, To } from \"../singletons.js\";\nimport { isReactElement, isReactPropsObject, valueIsReactLibraryObject } from \"../react/utils.js\";\nimport { ResidualReactElementVisitor } from \"./ResidualReactElementVisitor.js\";\nimport { GeneratorTree } from \"./GeneratorTree.js\";\nimport { PropertyDescriptor, AbstractJoinedDescriptor } from \"../descriptors.js\";\n\ntype BindingState = {|\n  capturedBindings: Set<ResidualFunctionBinding>,\n  capturingScopes: Set<Scope>,\n|};\n\n/* This class visits all values that are reachable in the residual heap.\n   In particular, this \"filters out\" values that are:\n   - captured by a DeclarativeEnvironmentRecord, but not actually used by any closure.\n   - Unmodified prototype objects\n   TODO #680: Figure out minimal set of values that need to be kept alive for WeakSet and WeakMap instances.\n*/\nexport class ResidualHeapVisitor {\n  constructor(\n    realm: Realm,\n    logger: Logger,\n    modules: Modules,\n    additionalFunctionValuesAndEffects: Map<FunctionValue, AdditionalFunctionEffects>\n  ) {\n    invariant(realm.useAbstractInterpretation);\n    this.realm = realm;\n    this.logger = logger;\n    this.modules = modules;\n\n    this.declarativeEnvironmentRecordsBindings = new Map();\n    this.globalBindings = new Map();\n    this.functionInfos = new Map();\n    this.classMethodInstances = new Map();\n    this.functionInstances = new Map();\n    this.values = new Map();\n    this.conditionalFeasibility = new Map();\n    let generator = this.realm.generator;\n    invariant(generator);\n    this.scope = this.globalGenerator = generator;\n    this.inspector = new HeapInspector(realm, logger);\n    this.referencedDeclaredValues = new Map();\n    this.delayedActions = [];\n    this.additionalFunctionValuesAndEffects = additionalFunctionValuesAndEffects;\n    this.equivalenceSet = new HashSet();\n    this.additionalFunctionValueInfos = new Map();\n    this.functionToCapturedScopes = new Map();\n    let environment = realm.$GlobalEnv.environmentRecord;\n    invariant(environment instanceof GlobalEnvironmentRecord);\n    this.globalEnvironmentRecord = environment;\n    this.additionalGeneratorRoots = new Map();\n    this.residualReactElementVisitor = new ResidualReactElementVisitor(this.realm, this);\n    this.generatorTree = new GeneratorTree();\n  }\n\n  realm: Realm;\n  logger: Logger;\n  modules: Modules;\n  globalGenerator: Generator;\n\n  // Caches that ensure one ResidualFunctionBinding exists per (record, name) pair\n  declarativeEnvironmentRecordsBindings: Map<DeclarativeEnvironmentRecord, Map<string, ResidualFunctionBinding>>;\n  globalBindings: Map<string, ResidualFunctionBinding>;\n\n  functionToCapturedScopes: Map<ReferentializationScope, Map<DeclarativeEnvironmentRecord, BindingState>>;\n  functionInfos: Map<BabelNodeBlockStatement, FunctionInfo>;\n  scope: Scope;\n  values: Map<Value, Set<Scope>>;\n\n  // For every abstract value of kind \"conditional\", this map keeps track of whether the consequent and/or alternate is feasible in any scope\n  conditionalFeasibility: Map<AbstractValue, { t: boolean, f: boolean }>;\n  inspector: HeapInspector;\n  referencedDeclaredValues: Map<Value, void | FunctionValue>;\n  delayedActions: Array<{| scope: Scope, action: () => void | boolean |}>;\n  additionalFunctionValuesAndEffects: Map<FunctionValue, AdditionalFunctionEffects>;\n  functionInstances: Map<FunctionValue, FunctionInstance>;\n  additionalFunctionValueInfos: Map<FunctionValue, AdditionalFunctionInfo>;\n  equivalenceSet: HashSet<AbstractValue>;\n  classMethodInstances: Map<FunctionValue, ClassMethodInstance>;\n  // Parents will always be a generator, optimized function value or \"GLOBAL\"\n  additionalGeneratorRoots: Map<Generator, Set<ObjectValue>>;\n  generatorTree: GeneratorTree;\n  globalEnvironmentRecord: GlobalEnvironmentRecord;\n  residualReactElementVisitor: ResidualReactElementVisitor;\n\n  // Going backwards from the current scope, find either the containing\n  // additional function, or if there isn't one, return the global generator.\n  _getCommonScope(): FunctionValue | Generator {\n    let s = this.scope;\n    while (true) {\n      if (s instanceof Generator) s = this.generatorTree.getParent(s);\n      else if (s instanceof FunctionValue) {\n        // Did we find an additional function?\n        if (this.additionalFunctionValuesAndEffects.has(s)) return s;\n\n        // Did the function itself get created by a generator we can chase?\n        s = this.generatorTree.getCreator(s) || \"GLOBAL\";\n      } else {\n        invariant(s === \"GLOBAL\");\n        let generator = this.globalGenerator;\n        invariant(generator);\n        return generator;\n      }\n    }\n    invariant(false);\n  }\n\n  // If the current scope has a containing additional function, retrieve it.\n  _getAdditionalFunctionOfScope(): FunctionValue | void {\n    let s = this._getCommonScope();\n    return s instanceof FunctionValue ? s : undefined;\n  }\n\n  // When a value has been created by some generator that is unrelated\n  // to the current common scope, visit the value in the scope it was\n  // created --- this causes the value later to be serialized in its\n  // creation scope, ensuring that the value has the right creation / life time.\n  _registerAdditionalRoot(value: ObjectValue): void {\n    let creationGenerator = this.generatorTree.getCreator(value) || this.globalGenerator;\n\n    let additionalFunction = this._getAdditionalFunctionOfScope() || \"GLOBAL\";\n    let targetAdditionalFunction;\n    if (creationGenerator === this.globalGenerator) {\n      targetAdditionalFunction = \"GLOBAL\";\n    } else {\n      let s = creationGenerator;\n      while (s instanceof Generator) {\n        s = this.generatorTree.getParent(s);\n        invariant(s !== undefined);\n      }\n      invariant(s === \"GLOBAL\" || s instanceof FunctionValue);\n      targetAdditionalFunction = s;\n    }\n\n    let usageScope;\n    if (additionalFunction === targetAdditionalFunction) {\n      usageScope = this.scope;\n    } else {\n      // Object was created outside of current additional function scope\n      invariant(additionalFunction instanceof FunctionValue);\n      let additionalFVEffects = this.additionalFunctionValuesAndEffects.get(additionalFunction);\n      invariant(additionalFVEffects !== undefined);\n      additionalFVEffects.additionalRoots.add(value);\n\n      this._visitInUnrelatedScope(creationGenerator, value);\n      usageScope = this.generatorTree.getCreator(value) || this.globalGenerator;\n    }\n\n    usageScope = this.scope;\n    if (usageScope instanceof Generator) {\n      // Also check if object is used in some nested generator scope that involved\n      // applying effects; if so, store additional information that the serializer\n      // can use to proactive serialize such objects from within the right generator\n      let anyRelevantEffects = false;\n      for (let g = usageScope; g instanceof Generator; g = this.generatorTree.getParent(g)) {\n        if (g === creationGenerator) {\n          if (anyRelevantEffects) {\n            let s = this.additionalGeneratorRoots.get(g);\n            if (s === undefined) this.additionalGeneratorRoots.set(g, (s = new Set()));\n            if (!s.has(value)) {\n              s.add(value);\n              this._visitInUnrelatedScope(g, value);\n            }\n          }\n          break;\n        }\n        let effectsToApply = g.effectsToApply;\n        if (effectsToApply)\n          for (let pb of effectsToApply.modifiedProperties.keys())\n            if (pb.object === value) {\n              anyRelevantEffects = true;\n              break;\n            }\n      }\n    }\n  }\n\n  // Careful!\n  // Only use _withScope when you know that the currently applied effects makes sense for the given (nested) scope!\n  _withScope(scope: Scope, f: () => void): void {\n    let oldScope = this.scope;\n    this.scope = scope;\n    try {\n      f();\n    } finally {\n      this.scope = oldScope;\n    }\n  }\n\n  // Queues up an action to be later processed in some arbitrary scope.\n  _enqueueWithUnrelatedScope(scope: Scope, action: () => void | boolean): void {\n    // If we are in a zone with a non-default equivalence set (we are wrapped in a `withCleanEquivalenceSet` call) then\n    // we need to save our equivalence set so that we may load it before running our action.\n    if (this.residualReactElementVisitor.defaultEquivalenceSet === false) {\n      const save = this.residualReactElementVisitor.saveEquivalenceSet();\n      const originalAction = action;\n      action = () => this.residualReactElementVisitor.loadEquivalenceSet(save, originalAction);\n    }\n\n    this.delayedActions.push({ scope, action });\n  }\n\n  // Queues up visiting a value in some arbitrary scope.\n  _visitInUnrelatedScope(scope: Scope, val: Value): void {\n    let scopes = this.values.get(val);\n    if (scopes !== undefined && scopes.has(scope)) return;\n    this._enqueueWithUnrelatedScope(scope, () => this.visitValue(val));\n  }\n\n  visitObjectProperty(binding: PropertyBinding): void {\n    let desc = binding.descriptor;\n    let obj = binding.object;\n    invariant(binding.key !== undefined, \"Undefined keys should never make it here.\");\n    if (\n      obj instanceof AbstractObjectValue ||\n      !(typeof binding.key === \"string\" && this.inspector.canIgnoreProperty(obj, binding.key))\n    ) {\n      if (desc !== undefined) this.visitDescriptor(desc);\n    }\n    if (binding.key instanceof Value) this.visitValue(binding.key);\n  }\n\n  visitObjectProperties(obj: ObjectValue, kind?: ObjectKind): void {\n    // In non-instant render mode, properties of leaked objects are generated via assignments\n    let { skipPrototype, constructor } = getObjectPrototypeMetadata(this.realm, obj);\n    if (obj.temporalAlias !== undefined) return;\n\n    // visit properties\n    for (let [symbol, propertyBinding] of obj.symbols) {\n      invariant(propertyBinding);\n      let desc = propertyBinding.descriptor;\n      if (desc === undefined) continue; //deleted\n      this.visitDescriptor(desc);\n      this.visitValue(symbol);\n    }\n\n    // visit properties\n    for (let [propertyBindingKey, propertyBindingValue] of obj.properties) {\n      // we don't want to visit these as we handle the serialization ourselves\n      // via a different logic route for classes\n      let descriptor = propertyBindingValue.descriptor;\n      if (\n        obj instanceof ECMAScriptFunctionValue &&\n        obj.$FunctionKind === \"classConstructor\" &&\n        (ClassPropertiesToIgnore.has(propertyBindingKey) ||\n          (propertyBindingKey === \"length\" && canIgnoreClassLengthProperty(obj, descriptor, this.logger)))\n      ) {\n        continue;\n      }\n      if (propertyBindingValue.pathNode !== undefined) continue; // property is written to inside a loop\n\n      // Leaked object. Properties are set via assignments\n      // TODO #2259: Make deduplication in the face of leaking work for custom accessors\n      if (\n        !(obj instanceof ArrayValue) &&\n        !obj.mightNotBeLeakedObject() &&\n        (descriptor instanceof PropertyDescriptor && (descriptor.get === undefined && descriptor.set === undefined))\n      ) {\n        continue;\n      }\n\n      this.visitObjectProperty(propertyBindingValue);\n    }\n\n    // inject properties with computed names\n    if (obj.unknownProperty !== undefined) {\n      this.visitObjectPropertiesWithComputedNamesDescriptor(obj.unknownProperty.descriptor);\n    }\n\n    // prototype\n    if (!skipPrototype) {\n      this.visitObjectPrototype(obj);\n    }\n    if (obj instanceof FunctionValue) {\n      this.visitConstructorPrototype(constructor ? constructor : obj);\n    } else if (obj instanceof ObjectValue && skipPrototype && constructor) {\n      this.visitValue(constructor);\n    }\n  }\n\n  visitObjectPrototype(obj: ObjectValue): void {\n    let proto = obj.$Prototype;\n\n    let kind = obj.getKind();\n    if (proto === this.realm.intrinsics[kind + \"Prototype\"]) return;\n\n    if (!obj.$IsClassPrototype || proto !== this.realm.intrinsics.null) {\n      this.visitValue(proto);\n    }\n  }\n\n  visitConstructorPrototype(func: Value): void {\n    // If the original prototype object was mutated,\n    // request its serialization here as this might be observable by\n    // residual code.\n    invariant(func instanceof FunctionValue);\n    let prototype = HeapInspector.getPropertyValue(func, \"prototype\");\n    if (\n      prototype instanceof ObjectValue &&\n      prototype.originalConstructor === func &&\n      !this.inspector.isDefaultPrototype(prototype)\n    ) {\n      this.visitValue(prototype);\n    }\n  }\n\n  visitObjectPropertiesWithComputedNamesDescriptor(desc: void | Descriptor): void {\n    if (desc !== undefined) {\n      if (desc instanceof PropertyDescriptor) {\n        let val = desc.value;\n        invariant(val instanceof AbstractValue);\n        this.visitObjectPropertiesWithComputedNames(val);\n      } else if (desc instanceof AbstractJoinedDescriptor) {\n        this.visitValue(desc.joinCondition);\n        this.visitObjectPropertiesWithComputedNamesDescriptor(desc.descriptor1);\n        this.visitObjectPropertiesWithComputedNamesDescriptor(desc.descriptor2);\n      } else {\n        invariant(false, \"unknown descriptor\");\n      }\n    }\n  }\n\n  visitObjectPropertiesWithComputedNames(absVal: AbstractValue): void {\n    if (absVal.kind === \"widened property\") return;\n    if (absVal.kind === \"template for prototype member expression\") return;\n    if (absVal.kind === \"conditional\") {\n      let cond = absVal.args[0];\n      invariant(cond instanceof AbstractValue);\n      if (cond.kind === \"template for property name condition\") {\n        let P = cond.args[0];\n        invariant(P instanceof AbstractValue);\n        let V = absVal.args[1];\n        let earlier_props = absVal.args[2];\n        if (earlier_props instanceof AbstractValue) this.visitObjectPropertiesWithComputedNames(earlier_props);\n        this.visitValue(P);\n        this.visitValue(V);\n      } else {\n        // conditional assignment\n        absVal.args[0] = this.visitEquivalentValue(cond);\n        let consequent = absVal.args[1];\n        if (consequent instanceof AbstractValue) {\n          this.visitObjectPropertiesWithComputedNames(consequent);\n        }\n        let alternate = absVal.args[2];\n        if (alternate instanceof AbstractValue) {\n          this.visitObjectPropertiesWithComputedNames(alternate);\n        }\n      }\n    } else {\n      this.visitValue(absVal);\n    }\n  }\n\n  visitDescriptor(desc: void | Descriptor): void {\n    if (desc === undefined) {\n    } else if (desc instanceof PropertyDescriptor) {\n      if (desc.value !== undefined) desc.value = this.visitEquivalentValue(desc.value);\n      if (desc.get !== undefined) this.visitValue(desc.get);\n      if (desc.set !== undefined) this.visitValue(desc.set);\n    } else if (desc instanceof AbstractJoinedDescriptor) {\n      desc.joinCondition = this.visitEquivalentValue(desc.joinCondition);\n      if (desc.descriptor1 !== undefined) this.visitDescriptor(desc.descriptor1);\n      if (desc.descriptor2 !== undefined) this.visitDescriptor(desc.descriptor2);\n    } else {\n      invariant(false, \"unknown descriptor\");\n    }\n  }\n\n  visitValueArray(val: ObjectValue): void {\n    this._registerAdditionalRoot(val);\n\n    this.visitObjectProperties(val);\n    const realm = this.realm;\n    let lenProperty;\n    if (val.mightBeLeakedObject()) {\n      lenProperty = this.realm.evaluateWithoutLeakLogic(() => Get(realm, val, \"length\"));\n    } else {\n      lenProperty = Get(realm, val, \"length\");\n    }\n    let [initialLength, lengthAssignmentNotNeeded] = getSuggestedArrayLiteralLength(realm, val);\n    if (lengthAssignmentNotNeeded) return;\n    if (\n      lenProperty instanceof AbstractValue\n        ? lenProperty.kind !== \"widened property\"\n        : To.ToLength(realm, lenProperty) !== initialLength\n    ) {\n      this.visitValue(lenProperty);\n    }\n  }\n\n  visitValueMap(val: ObjectValue): void {\n    invariant(val.getKind() === \"Map\");\n    let entries = val.$MapData;\n\n    invariant(entries !== undefined);\n    let len = entries.length;\n\n    for (let i = 0; i < len; i++) {\n      let entry = entries[i];\n      let key = entry.$Key;\n      let value = entry.$Value;\n      if (key === undefined || value === undefined) continue;\n      this.visitValue(key);\n      this.visitValue(value);\n    }\n  }\n\n  visitValueWeakMap(val: ObjectValue): void {\n    invariant(val.getKind() === \"WeakMap\");\n    let entries = val.$WeakMapData;\n\n    invariant(entries !== undefined);\n    let len = entries.length;\n\n    for (let i = 0; i < len; i++) {\n      let entry = entries[i];\n      let key = entry.$Key;\n      let value = entry.$Value;\n\n      if (key !== undefined && value !== undefined) {\n        let fixpoint_rerun = () => {\n          let progress;\n          if (this.values.has(key)) {\n            progress = true;\n            this.visitValue(key);\n            this.visitValue(value);\n          } else {\n            progress = false;\n            this._enqueueWithUnrelatedScope(this.scope, fixpoint_rerun);\n          }\n          return progress;\n        };\n        fixpoint_rerun();\n      }\n    }\n  }\n\n  visitValueSet(val: ObjectValue): void {\n    invariant(val.getKind() === \"Set\");\n\n    let entries = val.$SetData;\n    invariant(entries !== undefined);\n\n    let len = entries.length;\n    for (let i = 0; i < len; i++) {\n      let entry = entries[i];\n      if (entry === undefined) continue;\n      this.visitValue(entry);\n    }\n  }\n\n  visitValueWeakSet(val: ObjectValue): void {\n    invariant(val.getKind() === \"WeakSet\");\n\n    let entries = val.$WeakSetData;\n    invariant(entries !== undefined);\n\n    let len = entries.length;\n    for (let i = 0; i < len; i++) {\n      let entry = entries[i];\n      if (entry !== undefined) {\n        let fixpoint_rerun = () => {\n          let progress;\n          if (this.values.has(entry)) {\n            progress = true;\n            this.visitValue(entry);\n          } else {\n            progress = false;\n            this._enqueueWithUnrelatedScope(this.scope, fixpoint_rerun);\n          }\n          return progress;\n        };\n        fixpoint_rerun();\n      }\n    }\n  }\n\n  visitValueFunction(val: FunctionValue): void {\n    let isClass = false;\n\n    this._registerAdditionalRoot(val);\n    if (val instanceof ECMAScriptFunctionValue && val.$FunctionKind === \"classConstructor\") {\n      invariant(val instanceof ECMAScriptSourceFunctionValue);\n      let homeObject = val.$HomeObject;\n      if (homeObject instanceof ObjectValue && homeObject.$IsClassPrototype) {\n        isClass = true;\n      }\n    }\n    this.visitObjectProperties(val);\n\n    if (val instanceof BoundFunctionValue) {\n      this.visitValue(val.$BoundTargetFunction);\n      this.visitValue(val.$BoundThis);\n      for (let boundArg of val.$BoundArguments) this.visitValue(boundArg);\n      return;\n    }\n\n    invariant(!(val instanceof NativeFunctionValue), \"all native function values should be intrinsics\");\n\n    invariant(val instanceof ECMAScriptSourceFunctionValue);\n    invariant(val.constructor === ECMAScriptSourceFunctionValue);\n    let formalParameters = val.$FormalParameters;\n    let code = val.$ECMAScriptCode;\n\n    let functionInfo = this.functionInfos.get(code);\n    let residualFunctionBindings = new Map();\n    this.functionInstances.set(val, {\n      residualFunctionBindings,\n      initializationStatements: [],\n      functionValue: val,\n      scopeInstances: new Map(),\n    });\n\n    if (!functionInfo) {\n      functionInfo = {\n        depth: 0,\n        lexicalDepth: 0,\n        unbound: new Map(),\n        requireCalls: new Map(),\n        modified: new Set(),\n        usesArguments: false,\n        usesThis: false,\n      };\n      let state = {\n        functionInfo,\n        realm: this.realm,\n        getModuleIdIfNodeIsRequireFunction: this.modules.getGetModuleIdIfNodeIsRequireFunction(formalParameters, [val]),\n      };\n\n      traverse(\n        t.file(t.program([t.expressionStatement(t.functionExpression(null, formalParameters, code))])),\n        ClosureRefVisitor,\n        null,\n        state\n      );\n      traverse.cache.clear();\n      this.functionInfos.set(code, functionInfo);\n\n      if (val.isResidual && functionInfo.unbound.size) {\n        if (!val.isUnsafeResidual) {\n          this.logger.logError(\n            val,\n            `residual function ${describeLocation(this.realm, val, undefined, code.loc) ||\n              \"(unknown)\"} refers to the following identifiers defined outside of the local scope: ${Object.keys(\n              functionInfo.unbound\n            ).join(\", \")}`\n          );\n        }\n      }\n    }\n\n    let additionalFunctionEffects = this.additionalFunctionValuesAndEffects.get(val);\n    if (additionalFunctionEffects) {\n      this._visitAdditionalFunction(val, additionalFunctionEffects);\n    } else {\n      this._enqueueWithUnrelatedScope(val, () => {\n        invariant(this.scope === val);\n        invariant(functionInfo);\n        for (let innerName of functionInfo.unbound.keys()) {\n          let environment = this.resolveBinding(val, innerName);\n          let residualBinding = this.getBinding(environment, innerName);\n          this.visitBinding(val, residualBinding);\n          residualFunctionBindings.set(innerName, residualBinding);\n          if (functionInfo.modified.has(innerName)) residualBinding.modified = true;\n        }\n      });\n    }\n    if (isClass && val.$HomeObject instanceof ObjectValue) {\n      this._visitClass(val, val.$HomeObject);\n    }\n  }\n\n  _visitBindingHelper(residualFunctionBinding: ResidualFunctionBinding) {\n    if (residualFunctionBinding.hasLeaked) return;\n    let environment = residualFunctionBinding.declarativeEnvironmentRecord;\n    invariant(environment !== null);\n\n    if (residualFunctionBinding.value === undefined) {\n      // The first time we visit, we need to initialize the value to its equivalent value\n      invariant(environment instanceof DeclarativeEnvironmentRecord);\n      let binding = environment.bindings[residualFunctionBinding.name];\n      invariant(binding !== undefined);\n      invariant(!binding.deletable);\n      let value = (binding.initialized && binding.value) || this.realm.intrinsics.undefined;\n      if (value !== this.realm.intrinsics.__leakedValue) {\n        residualFunctionBinding.value = this.visitEquivalentValue(value);\n      }\n    } else if (residualFunctionBinding.value !== this.realm.intrinsics.__leakedValue) {\n      // Subsequently, we just need to visit the value.\n      this.visitValue(residualFunctionBinding.value);\n    }\n  }\n\n  // Addresses the case:\n  // let x = [];\n  // let y = [];\n  // function a() { x.push(\"hi\"); }\n  // function b() { y.push(\"bye\"); }\n  // function c() { return x.length + y.length; }\n  // Here we need to make sure that a and b both initialize x and y because x and y will be in the same\n  // captured scope because c captures both x and y.\n  visitBinding(scope: Scope, residualFunctionBinding: ResidualFunctionBinding): void {\n    let environment = residualFunctionBinding.declarativeEnvironmentRecord;\n    if (environment === null) return;\n    invariant(this.scope === scope);\n\n    let refScope = this._getAdditionalFunctionOfScope() || \"GLOBAL\";\n    residualFunctionBinding.potentialReferentializationScopes.add(refScope);\n    invariant(!(refScope instanceof Generator));\n    let funcToScopes = getOrDefault(this.functionToCapturedScopes, refScope, () => new Map());\n    let envRec = residualFunctionBinding.declarativeEnvironmentRecord;\n    invariant(envRec !== null);\n    let bindingState = getOrDefault(funcToScopes, envRec, () => ({\n      capturedBindings: new Set(),\n      capturingScopes: new Set(),\n    }));\n    // If the binding is new for this bindingState, have all functions capturing bindings from that scope visit it\n    if (!bindingState.capturedBindings.has(residualFunctionBinding)) {\n      for (let capturingScope of bindingState.capturingScopes) {\n        this._enqueueWithUnrelatedScope(capturingScope, () => this._visitBindingHelper(residualFunctionBinding));\n      }\n      bindingState.capturedBindings.add(residualFunctionBinding);\n    }\n    // If the function is new for this bindingState, visit all existent bindings in this scope\n    if (!bindingState.capturingScopes.has(scope)) {\n      invariant(this.scope === scope);\n      for (let residualBinding of bindingState.capturedBindings) this._visitBindingHelper(residualBinding);\n      bindingState.capturingScopes.add(scope);\n    }\n  }\n\n  resolveBinding(val: FunctionValue, name: string): EnvironmentRecord {\n    let doesNotMatter = true;\n    let reference = this.logger.tryQuery(\n      () => Environment.ResolveBinding(this.realm, name, doesNotMatter, val.$Environment),\n      undefined\n    );\n    if (\n      reference === undefined ||\n      Environment.IsUnresolvableReference(this.realm, reference) ||\n      reference.base === this.globalEnvironmentRecord ||\n      reference.base === this.globalEnvironmentRecord.$DeclarativeRecord\n    ) {\n      return this.globalEnvironmentRecord;\n    } else {\n      invariant(!Environment.IsUnresolvableReference(this.realm, reference));\n      let referencedBase = reference.base;\n      let referencedName: string = (reference.referencedName: any);\n      invariant(referencedName === name);\n      invariant(referencedBase instanceof DeclarativeEnvironmentRecord);\n      return referencedBase;\n    }\n  }\n\n  hasBinding(environment: EnvironmentRecord, name: string): boolean {\n    if (environment === this.globalEnvironmentRecord.$DeclarativeRecord) environment = this.globalEnvironmentRecord;\n\n    if (environment === this.globalEnvironmentRecord) {\n      // Global Binding\n      return this.globalBindings.get(name) !== undefined;\n    } else {\n      invariant(environment instanceof DeclarativeEnvironmentRecord);\n      // DeclarativeEnvironmentRecord binding\n      let residualFunctionBindings = this.declarativeEnvironmentRecordsBindings.get(environment);\n      if (residualFunctionBindings === undefined) return false;\n      return residualFunctionBindings.get(name) !== undefined;\n    }\n  }\n\n  // Visits a binding, returns a ResidualFunctionBinding\n  getBinding(environment: EnvironmentRecord, name: string): ResidualFunctionBinding {\n    if (environment === this.globalEnvironmentRecord.$DeclarativeRecord) environment = this.globalEnvironmentRecord;\n\n    if (environment === this.globalEnvironmentRecord) {\n      // Global Binding\n      return getOrDefault(this.globalBindings, name, () => {\n        let residualFunctionBinding = {\n          name,\n          value: undefined,\n          modified: true,\n          hasLeaked: false,\n          declarativeEnvironmentRecord: null,\n          potentialReferentializationScopes: new Set(),\n        };\n        // Queue up visiting of global binding exactly once in the globalGenerator scope.\n        this._enqueueWithUnrelatedScope(this.globalGenerator, () => {\n          let value = this.realm.getGlobalLetBinding(name);\n          if (value !== undefined) residualFunctionBinding.value = this.visitEquivalentValue(value);\n        });\n        return residualFunctionBinding;\n      });\n    } else {\n      invariant(environment instanceof DeclarativeEnvironmentRecord);\n      // DeclarativeEnvironmentRecord binding\n      let residualFunctionBindings = getOrDefault(\n        this.declarativeEnvironmentRecordsBindings,\n        environment,\n        () => new Map()\n      );\n      return getOrDefault(\n        residualFunctionBindings,\n        name,\n        (): ResidualFunctionBinding => {\n          invariant(environment instanceof DeclarativeEnvironmentRecord);\n          return {\n            name,\n            value: undefined,\n            modified: false,\n            hasLeaked: false,\n            declarativeEnvironmentRecord: environment,\n            potentialReferentializationScopes: new Set(),\n          };\n        }\n      );\n      // Note that we don't yet visit the binding (and its value) here,\n      // as that should be done by a call to visitBinding, in the right scope,\n      // if the binding's incoming value is relevant.\n    }\n  }\n\n  _visitClass(classFunc: ECMAScriptSourceFunctionValue, classPrototype: ObjectValue): void {\n    let visitClassMethod = (propertyNameOrSymbol, methodFunc, methodType, isStatic) => {\n      if (methodFunc instanceof ECMAScriptSourceFunctionValue) {\n        // if the method does not have a $HomeObject, it's not a class method\n        if (methodFunc.$HomeObject !== undefined) {\n          if (methodFunc !== classFunc) {\n            this._visitClassMethod(methodFunc, methodType, classPrototype, !!isStatic);\n          }\n        }\n      }\n    };\n    for (let [propertyName, method] of classPrototype.properties) {\n      withDescriptorValue(propertyName, method.descriptor, visitClassMethod);\n    }\n    for (let [symbol, method] of classPrototype.symbols) {\n      withDescriptorValue(symbol, method.descriptor, visitClassMethod);\n    }\n\n    // handle class inheritance\n    if (!(classFunc.$Prototype instanceof NativeFunctionValue)) {\n      this.visitValue(classFunc.$Prototype);\n    }\n\n    if (classPrototype.properties.has(\"constructor\")) {\n      let constructor = classPrototype.properties.get(\"constructor\");\n\n      invariant(constructor !== undefined);\n      // check if the constructor was deleted, as it can't really be deleted\n      // it just gets set to empty (the default again)\n      if (constructor.descriptor === undefined) {\n        classFunc.$HasEmptyConstructor = true;\n      } else {\n        let visitClassProperty = (propertyNameOrSymbol, methodFunc, methodType) => {\n          visitClassMethod(propertyNameOrSymbol, methodFunc, methodType, true);\n        };\n        // check if we have any static methods we need to include\n        let constructorFunc = Get(this.realm, classPrototype, \"constructor\");\n        invariant(constructorFunc instanceof ObjectValue);\n        for (let [propertyName, method] of constructorFunc.properties) {\n          if (\n            !ClassPropertiesToIgnore.has(propertyName) &&\n            method.descriptor !== undefined &&\n            !(\n              propertyName === \"length\" && canIgnoreClassLengthProperty(constructorFunc, method.descriptor, this.logger)\n            )\n          ) {\n            withDescriptorValue(propertyName, method.descriptor, visitClassProperty);\n          }\n        }\n      }\n    }\n    this.classMethodInstances.set(classFunc, {\n      classPrototype,\n      methodType: \"constructor\",\n      classSuperNode: undefined,\n      classMethodIsStatic: false,\n      classMethodKeyNode: undefined,\n      classMethodComputed: false,\n    });\n  }\n\n  _visitClassMethod(\n    methodFunc: ECMAScriptSourceFunctionValue,\n    methodType: \"get\" | \"set\" | \"value\",\n    classPrototype: ObjectValue,\n    isStatic: boolean\n  ): void {\n    this.classMethodInstances.set(methodFunc, {\n      classPrototype,\n      methodType: methodType === \"value\" ? \"method\" : methodType,\n      classSuperNode: undefined,\n      classMethodIsStatic: isStatic,\n      classMethodKeyNode: undefined,\n      classMethodComputed: !!methodFunc.$HasComputedName,\n    });\n  }\n\n  visitValueObject(val: ObjectValue): void {\n    invariant(val.isValid());\n    this._registerAdditionalRoot(val);\n    if (isReactElement(val)) {\n      this.residualReactElementVisitor.visitReactElement(val);\n      return;\n    }\n    let kind = val.getKind();\n    this.visitObjectProperties(val, kind);\n\n    // If this object is a prototype object that was implicitly created by the runtime\n    // for a constructor, then we can obtain a reference to this object\n    // in a special way that's handled alongside function serialization.\n    let constructor = val.originalConstructor;\n    if (constructor !== undefined) {\n      this.visitValue(constructor);\n      return;\n    }\n\n    switch (kind) {\n      case \"RegExp\":\n      case \"Number\":\n      case \"String\":\n      case \"Boolean\":\n      case \"ArrayBuffer\":\n        return;\n      case \"Date\":\n        let dateValue = val.$DateValue;\n        invariant(dateValue !== undefined);\n        this.visitValue(dateValue);\n        return;\n      case \"Float32Array\":\n      case \"Float64Array\":\n      case \"Int8Array\":\n      case \"Int16Array\":\n      case \"Int32Array\":\n      case \"Uint8Array\":\n      case \"Uint16Array\":\n      case \"Uint32Array\":\n      case \"Uint8ClampedArray\":\n      case \"DataView\":\n        let buf = val.$ViewedArrayBuffer;\n        invariant(buf !== undefined);\n        this.visitValue(buf);\n        return;\n      case \"Map\":\n        this.visitValueMap(val);\n        return;\n      case \"WeakMap\":\n        this.visitValueWeakMap(val);\n        return;\n      case \"Set\":\n        this.visitValueSet(val);\n        return;\n      case \"WeakSet\":\n        this.visitValueWeakSet(val);\n        return;\n      default:\n        if (kind !== \"Object\") this.logger.logError(val, `Object of kind ${kind} is not supported in residual heap.`);\n        if (this.realm.react.enabled && valueIsReactLibraryObject(this.realm, val, this.logger)) {\n          this.realm.fbLibraries.react = val;\n        }\n        return;\n    }\n  }\n\n  visitValueSymbol(val: SymbolValue): void {\n    if (val.$Description) this.visitValue(val.$Description);\n  }\n\n  visitValueProxy(val: ProxyValue): void {\n    this._registerAdditionalRoot(val);\n\n    this.visitValue(val.$ProxyTarget);\n    this.visitValue(val.$ProxyHandler);\n  }\n\n  _visitAbstractValueConditional(val: AbstractValue): void {\n    let condition = val.args[0];\n    invariant(condition instanceof AbstractValue);\n\n    let cf = this.conditionalFeasibility.get(val);\n    if (cf === undefined) this.conditionalFeasibility.set(val, (cf = { t: false, f: false }));\n\n    let feasibleT, feasibleF;\n    let savedPath = this.realm.pathConditions;\n    try {\n      this.realm.pathConditions = this.scope instanceof Generator ? this.scope.pathConditions : createPathConditions();\n\n      let impliesT = Path.implies(condition);\n      let impliesF = Path.impliesNot(condition);\n      invariant(!(impliesT && impliesF));\n\n      if (!impliesT && !impliesF) {\n        feasibleT = feasibleF = true;\n      } else {\n        feasibleT = impliesT;\n        feasibleF = impliesF;\n      }\n    } finally {\n      this.realm.pathConditions = savedPath;\n    }\n\n    let visitedT = false,\n      visitedF = false;\n\n    if (!cf.t && feasibleT) {\n      val.args[1] = this.visitEquivalentValue(val.args[1]);\n      cf.t = true;\n      if (cf.f) val.args[0] = this.visitEquivalentValue(val.args[0]);\n      visitedT = true;\n    }\n\n    if (!cf.f && feasibleF) {\n      val.args[2] = this.visitEquivalentValue(val.args[2]);\n      cf.f = true;\n      if (cf.t) val.args[0] = this.visitEquivalentValue(val.args[0]);\n      visitedF = true;\n    }\n\n    if (!visitedT || !visitedF) {\n      let fixpoint_rerun = () => {\n        let progress = false;\n        invariant(cf !== undefined);\n        if (cf.f && cf.t) {\n          invariant(!visitedT || !visitedF);\n          this.visitValue(val.args[0]);\n        }\n\n        if (cf.t && !visitedT) {\n          this.visitValue(val.args[1]);\n          progress = visitedT = true;\n        }\n        invariant(cf.t === visitedT);\n\n        if (cf.f && !visitedF) {\n          this.visitValue(val.args[2]);\n          progress = visitedF = true;\n        }\n        invariant(cf.f === visitedF);\n\n        // When not all possible outcomes are assumed to be feasible yet after visiting some scopes,\n        // it might be that they do become assumed to be feasible when later visiting some other scopes.\n        // In that case, we should also re-visit the corresponding cases in this scope.\n        // To this end, calling _enqueueWithUnrelatedScope enqueues this function for later re-execution if\n        // any other visiting progress was made.\n        if (!visitedT || !visitedF) this._enqueueWithUnrelatedScope(this.scope, fixpoint_rerun);\n\n        return progress;\n      };\n\n      fixpoint_rerun();\n    }\n  }\n\n  visitAbstractValue(val: AbstractValue): void {\n    invariant(val !== this.realm.intrinsics.__leakedValue, \"leaked binding values should never be visited\");\n    if (val.kind === \"sentinel member expression\") {\n      this.logger.logError(val, \"expressions of type o[p] are not yet supported for partially known o and unknown p\");\n    } else if (val.kind === \"environment initialization expression\") {\n      this.logger.logError(val, \"reads during environment initialization should never leak to serialization\");\n    } else if (val.kind === \"conditional\") {\n      this._visitAbstractValueConditional(val);\n      return;\n    }\n    for (let i = 0, n = val.args.length; i < n; i++) {\n      val.args[i] = this.visitEquivalentValue(val.args[i]);\n    }\n  }\n\n  // Overridable hook for pre-visiting the value.\n  // Return false will tell visitor to skip visiting children of this node.\n  preProcessValue(val: Value): boolean {\n    return this._mark(val);\n  }\n\n  // Overridable hook for post-visiting the value.\n  postProcessValue(val: Value): void {}\n\n  _mark(val: Value): boolean {\n    let scopes = this.values.get(val);\n    if (scopes === undefined) this.values.set(val, (scopes = new Set()));\n    if (this.scope instanceof Generator && this.scope.effectsToApply === undefined) {\n      // If we've already marked this value for any simple parent (non-effect carrying) generator,\n      // then we don't need to re-mark it, as such a set of generators is reduced to the\n      // parent generator in all uses of the scopes set.\n      for (\n        let g = this.scope;\n        g instanceof Generator && g.effectsToApply === undefined;\n        g = this.generatorTree.getParent(g)\n      ) {\n        if (scopes.has(g)) return false;\n      }\n    } else if (scopes.has(this.scope)) return false;\n    scopes.add(this.scope);\n    return true;\n  }\n\n  visitEquivalentValue<T: Value>(val: T): T {\n    if (val instanceof AbstractValue) {\n      let equivalentValue = this.equivalenceSet.add(val);\n      if (this.preProcessValue(equivalentValue)) this.visitAbstractValue(equivalentValue);\n      this.postProcessValue(equivalentValue);\n      return (equivalentValue: any);\n    }\n    if (val instanceof ObjectValue) {\n      invariant(val.isValid());\n      if (isReactElement(val)) {\n        if (val.temporalAlias !== undefined) {\n          return this.visitEquivalentValue(val.temporalAlias);\n        }\n        let equivalentReactElementValue = this.residualReactElementVisitor.reactElementEquivalenceSet.add(val);\n        if (this._mark(equivalentReactElementValue)) this.visitValueObject(equivalentReactElementValue);\n        return (equivalentReactElementValue: any);\n      } else if (isReactPropsObject(val)) {\n        let equivalentReactPropsValue = this.residualReactElementVisitor.reactPropsEquivalenceSet.add(val);\n        if (this._mark(equivalentReactPropsValue)) this.visitValueObject(equivalentReactPropsValue);\n        return (equivalentReactPropsValue: any);\n      }\n    }\n    this.visitValue(val);\n    return val;\n  }\n\n  visitValue(val: Value): void {\n    invariant(val !== undefined);\n    invariant(!(val instanceof ObjectValue && val.refuseSerialization));\n    if (val instanceof AbstractValue) {\n      if (this.preProcessValue(val)) this.visitAbstractValue(val);\n      this.postProcessValue(val);\n    } else if (val.isIntrinsic()) {\n      // All intrinsic values exist from the beginning of time...\n      // ...except for a few that come into existence as templates for abstract objects via executable code.\n      if (val instanceof ObjectValue && val.isScopedTemplate) {\n        this.preProcessValue(val);\n        this.postProcessValue(val);\n      } else\n        this._enqueueWithUnrelatedScope(this._getCommonScope(), () => {\n          this.preProcessValue(val);\n          this.postProcessValue(val);\n        });\n    } else if (val instanceof EmptyValue) {\n      this.preProcessValue(val);\n      this.postProcessValue(val);\n    } else if (HeapInspector.isLeaf(val)) {\n      this.preProcessValue(val);\n      this.postProcessValue(val);\n    } else if (IsArray(this.realm, val)) {\n      invariant(val instanceof ObjectValue);\n      if (this.preProcessValue(val)) this.visitValueArray(val);\n      this.postProcessValue(val);\n    } else if (val instanceof ProxyValue) {\n      if (this.preProcessValue(val)) this.visitValueProxy(val);\n      this.postProcessValue(val);\n    } else if (val instanceof FunctionValue) {\n      let creationGenerator = this.generatorTree.getCreator(val) || this.globalGenerator;\n\n      // 1. Visit function in its creation scope\n      this._enqueueWithUnrelatedScope(creationGenerator, () => {\n        invariant(val instanceof FunctionValue);\n        if (this.preProcessValue(val)) this.visitValueFunction(val);\n        this.postProcessValue(val);\n      });\n\n      // 2. If current scope is not related to creation scope,\n      //    and if this is not a recursive visit, mark the usage of this function\n      //    in the common scope as well.\n      let commonScope = this._getCommonScope();\n      if (commonScope !== creationGenerator && commonScope !== val) {\n        this._enqueueWithUnrelatedScope(commonScope, () => {\n          this.preProcessValue(val);\n          this.postProcessValue(val);\n        });\n      }\n    } else if (val instanceof SymbolValue) {\n      if (this.preProcessValue(val)) this.visitValueSymbol(val);\n      this.postProcessValue(val);\n    } else {\n      invariant(val instanceof ObjectValue);\n\n      if (this.preProcessValue(val)) this.visitValueObject(val);\n      this.postProcessValue(val);\n    }\n  }\n\n  createGeneratorVisitCallbacks(additionalFunctionInfo?: AdditionalFunctionInfo): VisitEntryCallbacks {\n    let callbacks = {\n      visitEquivalentValue: this.visitEquivalentValue.bind(this),\n      visitGenerator: (generator, parent) => {\n        invariant(this.generatorTree.getParent(generator) === parent);\n        this.visitGenerator(generator, additionalFunctionInfo);\n      },\n      canOmit: (value: Value): boolean => {\n        let canOmit = !this.referencedDeclaredValues.has(value) && !this.values.has(value);\n        if (!canOmit) {\n          return false;\n        }\n        if (value instanceof ObjectValue && value.temporalAlias !== undefined) {\n          let temporalAlias = value.temporalAlias;\n          return !this.referencedDeclaredValues.has(temporalAlias) && !this.values.has(temporalAlias);\n        }\n        return canOmit;\n      },\n      recordDeclaration: (value: Value) => {\n        this.referencedDeclaredValues.set(value, this._getAdditionalFunctionOfScope());\n      },\n      recordDelayedEntry: (generator, entry: GeneratorEntry) => {\n        this._enqueueWithUnrelatedScope(generator, () => entry.visit(callbacks, generator));\n      },\n      visitModifiedProperty: (binding: PropertyBinding) => {\n        let fixpoint_rerun = () => {\n          if (this.values.has(binding.object)) {\n            if (binding.internalSlot) {\n              invariant(typeof binding.key === \"string\");\n              let error = new CompilerDiagnostic(\n                `Internal slot ${binding.key} modified in a nested context. This is not yet supported.`,\n                binding.object.expressionLocation,\n                \"PP1006\",\n                \"FatalError\"\n              );\n              this.realm.handleError(error) === \"Fail\";\n              throw new FatalError();\n            }\n            this.visitValue(binding.object);\n            if (binding.key instanceof Value) this.visitValue(binding.key);\n            this.visitObjectProperty(binding);\n            return true;\n          } else {\n            this._enqueueWithUnrelatedScope(this.scope, fixpoint_rerun);\n            return false;\n          }\n        };\n        fixpoint_rerun();\n      },\n      visitModifiedBinding: (modifiedBinding: Binding) => {\n        let fixpoint_rerun = () => {\n          if (this.hasBinding(modifiedBinding.environment, modifiedBinding.name)) {\n            invariant(additionalFunctionInfo);\n            let { functionValue } = additionalFunctionInfo;\n            invariant(functionValue instanceof ECMAScriptSourceFunctionValue);\n            let residualBinding = this.getBinding(modifiedBinding.environment, modifiedBinding.name);\n            let funcInstance = additionalFunctionInfo.instance;\n            invariant(funcInstance !== undefined);\n            funcInstance.residualFunctionBindings.set(modifiedBinding.name, residualBinding);\n            let newValue = modifiedBinding.value;\n            invariant(newValue);\n            this.visitValue(newValue);\n            residualBinding.modified = true;\n            let otherFunc = residualBinding.additionalFunctionOverridesValue;\n            if (otherFunc !== undefined && otherFunc !== functionValue) {\n              let otherNameVal = otherFunc._SafeGetDataPropertyValue(\"name\");\n              let otherNameStr = otherNameVal instanceof StringValue ? otherNameVal.value : \"unknown function\";\n              let funcNameVal = functionValue._SafeGetDataPropertyValue(\"name\");\n              let funNameStr = funcNameVal instanceof StringValue ? funcNameVal.value : \"unknown function\";\n              let error = new CompilerDiagnostic(\n                `Variable ${\n                  modifiedBinding.name\n                } written to in optimized function ${funNameStr} conflicts with write in another optimized function ${otherNameStr}`,\n                funcNameVal.expressionLocation,\n                \"PP1001\",\n                \"RecoverableError\"\n              );\n              if (functionValue.$Realm.handleError(error) === \"Fail\") throw new FatalError();\n            }\n            residualBinding.additionalFunctionOverridesValue = functionValue;\n            additionalFunctionInfo.modifiedBindings.set(modifiedBinding, residualBinding);\n            // TODO #2430 nested optimized functions: revisit adding GLOBAL as outer optimized function\n            residualBinding.potentialReferentializationScopes.add(\"GLOBAL\");\n            return true;\n          } else {\n            this._enqueueWithUnrelatedScope(this.scope, fixpoint_rerun);\n            return false;\n          }\n        };\n        fixpoint_rerun();\n      },\n      visitBindingAssignment: (binding: Binding, value: Value) => {\n        let residualBinding = this.getBinding(binding.environment, binding.name);\n        residualBinding.modified = true;\n        residualBinding.hasLeaked = true;\n        // This may not have been referentialized if the binding is a local of an optimized function.\n        // in that case, we need to figure out which optimized function it is, and referentialize it in that scope.\n        let commonScope = this._getCommonScope();\n        if (residualBinding.potentialReferentializationScopes.size === 0) {\n          this._enqueueWithUnrelatedScope(commonScope, () => {\n            if (additionalFunctionInfo !== undefined) {\n              let funcInstance = additionalFunctionInfo.instance;\n              invariant(funcInstance !== undefined);\n              funcInstance.residualFunctionBindings.set(residualBinding.name, residualBinding);\n            }\n            this.visitBinding(commonScope, residualBinding);\n          });\n        }\n        return this.visitEquivalentValue(value);\n      },\n    };\n    return callbacks;\n  }\n\n  visitGenerator(generator: Generator, additionalFunctionInfo?: AdditionalFunctionInfo): void {\n    this._withScope(generator, () => {\n      generator.visit(this.createGeneratorVisitCallbacks(additionalFunctionInfo));\n    });\n\n    // We don't bother purging created objects\n  }\n\n  // result -- serialized as a return statement\n  // Generator -- visit all entries\n  // Bindings -- (modifications to named variables) only need to serialize bindings if they're\n  //             captured by a residual function\n  //          -- need to apply them and maybe need to revisit functions in ancestors to make sure\n  //             we don't overwrite anything they capture\n  // PropertyBindings -- (property modifications) visit any property bindings to pre-existing objects\n  // CreatedObjects -- should take care of itself\n  _visitAdditionalFunction(functionValue: FunctionValue, additionalEffects: AdditionalFunctionEffects): void {\n    // Get Instance + Info\n    invariant(functionValue instanceof ECMAScriptSourceFunctionValue);\n    let code = functionValue.$ECMAScriptCode;\n    let functionInfo = this.functionInfos.get(code);\n    invariant(functionInfo !== undefined);\n    let funcInstance = this.functionInstances.get(functionValue);\n    invariant(funcInstance !== undefined);\n\n    // Set Visitor state\n    // Allows us to emit function declarations etc. inside of this additional\n    // function instead of adding them at global scope\n    let visitor = () => {\n      invariant(funcInstance !== undefined);\n      invariant(functionInfo !== undefined);\n      let additionalFunctionInfo = {\n        modifiedBindings: new Map(),\n        functionValue,\n        instance: funcInstance,\n        prelude: [],\n      };\n      this.additionalFunctionValueInfos.set(functionValue, additionalFunctionInfo);\n\n      let effectsGenerator = additionalEffects.generator;\n      this.generatorTree.add(functionValue, effectsGenerator);\n      this.visitGenerator(effectsGenerator, additionalFunctionInfo);\n    };\n\n    if (this.realm.react.enabled) {\n      this.residualReactElementVisitor.withCleanEquivalenceSet(visitor);\n    } else {\n      visitor();\n    }\n  }\n\n  visitRoots(): void {\n    this.generatorTree.add(\"GLOBAL\", this.globalGenerator);\n    this.visitGenerator(this.globalGenerator);\n    for (let moduleValue of this.modules.initializedModules.values()) this.visitValue(moduleValue);\n\n    this._visitUntilFixpoint();\n  }\n\n  _visitUntilFixpoint(): void {\n    if (this.realm.react.verbose) {\n      this.logger.logInformation(`Computing fixed point...`);\n    }\n    // Do a fixpoint over all pure generator entries to make sure that we visit\n    // arguments of only BodyEntries that are required by some other residual value\n    let progress = true;\n    while (progress) {\n      // Let's partition the actions by their generators,\n      // as applying effects is expensive, and so we don't want to do it\n      // more often than necessary.\n      let actionsByGenerator = new Map();\n      let expected = 0;\n      for (let { scope, action } of this.delayedActions) {\n        let generator;\n        if (scope instanceof FunctionValue) generator = this.generatorTree.getCreator(scope) || this.globalGenerator;\n        else if (scope === \"GLOBAL\") generator = this.globalGenerator;\n        else {\n          invariant(scope instanceof Generator);\n          generator = scope;\n        }\n        let a = actionsByGenerator.get(generator);\n        if (a === undefined) actionsByGenerator.set(generator, (a = []));\n        a.push({ action, scope });\n        expected++;\n      }\n      this.delayedActions = [];\n      progress = false;\n      // We build up a tree of effects runner that mirror the nesting of Generator effects.\n      // This way, we only have to apply any given effects once, regardless of how many actions we have associated with whatever generators.\n      let effectsInfos: Map<Effects, { runner: () => void, nestedEffectsRunners: Array<() => void> }> = new Map();\n      let topEffectsRunners: Array<() => void> = [];\n      let actual = 0;\n      for (let [generator, scopedActions] of actionsByGenerator) {\n        let runGeneratorAction = () => {\n          for (let { action, scope } of scopedActions) {\n            actual++;\n            this._withScope(scope, () => {\n              if (action() !== false) progress = true;\n            });\n          }\n        };\n        let s = generator;\n        let visited = new Set();\n        let newNestedRunner;\n        while (s !== \"GLOBAL\") {\n          invariant(!visited.has(s));\n          visited.add(s);\n          if (s instanceof Generator) {\n            let effectsToApply = s.effectsToApply;\n            if (effectsToApply) {\n              let info = effectsInfos.get(effectsToApply);\n              let runner;\n              if (info === undefined) {\n                runner = () => {\n                  this.realm.withEffectsAppliedInGlobalEnv(() => {\n                    invariant(info !== undefined);\n                    for (let nestedEffectsRunner of info.nestedEffectsRunners) nestedEffectsRunner();\n                    return null;\n                  }, effectsToApply);\n                };\n                effectsInfos.set(effectsToApply, (info = { runner, nestedEffectsRunners: [] }));\n              }\n              if (newNestedRunner !== undefined) info.nestedEffectsRunners.push(newNestedRunner);\n              newNestedRunner = runner;\n              if (runGeneratorAction === undefined) break;\n              info.nestedEffectsRunners.push(runGeneratorAction);\n              runGeneratorAction = undefined;\n            }\n            s = this.generatorTree.getParent(s);\n          } else if (s instanceof FunctionValue) {\n            invariant(this.additionalFunctionValuesAndEffects.has(s));\n            s = this.generatorTree.getCreator(s) || \"GLOBAL\";\n          }\n          invariant(s instanceof Generator || s instanceof FunctionValue || s === \"GLOBAL\");\n        }\n        if (runGeneratorAction !== undefined) {\n          invariant(newNestedRunner === undefined);\n          runGeneratorAction();\n        } else if (newNestedRunner !== undefined) topEffectsRunners.push(newNestedRunner);\n      }\n      for (let topEffectsRunner of topEffectsRunners) topEffectsRunner();\n      invariant(expected === actual);\n      if (this.realm.react.verbose) {\n        this.logger.logInformation(`  (${actual} items processed)`);\n      }\n    }\n  }\n\n  toInfo(): ResidualHeapInfo {\n    return {\n      values: this.values,\n      functionInstances: this.functionInstances,\n      classMethodInstances: this.classMethodInstances,\n      functionInfos: this.functionInfos,\n      referencedDeclaredValues: this.referencedDeclaredValues,\n      additionalFunctionValueInfos: this.additionalFunctionValueInfos,\n      declarativeEnvironmentRecordsBindings: this.declarativeEnvironmentRecordsBindings,\n      globalBindings: this.globalBindings,\n      conditionalFeasibility: this.conditionalFeasibility,\n      additionalGeneratorRoots: this.additionalGeneratorRoots,\n    };\n  }\n}\n"
  },
  {
    "path": "src/serializer/ResidualOperationSerializer.js",
    "content": "/**\n * Copyright (c) 2017-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n/* @flow */\n\nimport { Realm } from \"../realm.js\";\nimport {\n  Generator,\n  type SerializationContext,\n  type OperationDescriptor,\n  type OperationDescriptorData,\n} from \"../utils/generator.js\";\nimport { PreludeGenerator, Placeholders } from \"../utils/PreludeGenerator.js\";\nimport {\n  emptyExpression,\n  memberExpressionHelper,\n  nullExpression,\n  protoExpression,\n  voidExpression,\n} from \"../utils/babelhelpers.js\";\nimport invariant from \"../invariant.js\";\nimport * as t from \"@babel/types\";\nimport { AbstractValue, EmptyValue, ObjectValue, Value } from \"../values/index.js\";\nimport type {\n  BabelNodeBlockStatement,\n  BabelNodeExpression,\n  BabelNodeSpreadElement,\n  BabelNodeStringLiteral,\n} from \"@babel/types\";\nimport { Utils } from \"../singletons.js\";\n\nfunction serializeBody(\n  generator: Generator,\n  context: SerializationContext,\n  valuesToProcess: Set<AbstractValue | ObjectValue>\n): BabelNodeBlockStatement {\n  let statements = context.serializeGenerator(generator, valuesToProcess);\n  if (statements.length === 1 && statements[0].type === \"BlockStatement\") return (statements[0]: any);\n  return t.blockStatement(statements);\n}\n\nfunction isSelfReferential(value: Value, pathNode: void | AbstractValue): boolean {\n  if (value === pathNode) return true;\n  if (value instanceof AbstractValue && pathNode !== undefined) {\n    for (let v of value.args) {\n      if (isSelfReferential(v, pathNode)) return true;\n    }\n  }\n  return false;\n}\n\nexport class ResidualOperationSerializer {\n  constructor(realm: Realm, preludeGenerator: PreludeGenerator) {\n    this.realm = realm;\n    this.preludeGenerator = preludeGenerator;\n  }\n  realm: Realm;\n  preludeGenerator: PreludeGenerator;\n\n  getErrorStatement(message: BabelNodeExpression): BabelNodeStatement {\n    if (this.realm.invariantMode === \"throw\")\n      return t.throwStatement(t.newExpression(this.preludeGenerator.memoizeReference(\"Error\"), [message]));\n    else {\n      let targetReference = this.realm.invariantMode;\n      let args = [message];\n      let i = targetReference.indexOf(\"+\");\n      if (i !== -1) {\n        let s = targetReference.substr(i + 1);\n        let x = Number.parseInt(s, 10);\n        args.push(isNaN(x) ? t.stringLiteral(s) : t.numericLiteral(x));\n        targetReference = targetReference.substr(0, i);\n      }\n      return t.expressionStatement(t.callExpression(this.preludeGenerator.memoizeReference(targetReference), args));\n    }\n  }\n\n  serializeStatement(\n    operationDescriptor: OperationDescriptor,\n    nodes: Array<BabelNodeExpression>,\n    context: SerializationContext,\n    valuesToProcess: Set<AbstractValue | ObjectValue>,\n    declaredId: void | string\n  ): BabelNodeStatement {\n    let { data, type } = operationDescriptor;\n    let babelNode;\n\n    switch (type) {\n      case \"ASSUME_CALL\":\n        babelNode = this._serializeAssumeCall(data, nodes);\n        break;\n      case \"CONCRETE_MODEL\":\n        babelNode = this._serializeConcreteModel(data, nodes);\n        break;\n      case \"CONDITIONAL_PROPERTY_ASSIGNMENT\":\n        babelNode = this._serializeConditionalPropertyAssignment(data, nodes, context, valuesToProcess);\n        break;\n      case \"CONDITIONAL_THROW\":\n        babelNode = this._serializeConditionalThrow(data, nodes, context);\n        break;\n      case \"CONSOLE_LOG\":\n        babelNode = this._serializeConsoleLog(data, nodes);\n        break;\n      case \"DEFINE_PROPERTY\":\n        babelNode = this._serializeDefineProperty(data, nodes, context);\n        break;\n      case \"DO_WHILE\":\n        babelNode = this._serializeDoWhile(data, nodes, context, valuesToProcess);\n        break;\n      case \"EMIT_CALL\":\n        babelNode = this._serializeEmitCall(data, nodes);\n        break;\n      case \"EMIT_PROPERTY_ASSIGNMENT\":\n        babelNode = this._serializeEmitPropertyAssignment(data, nodes, context);\n        break;\n      case \"FOR_IN\":\n        babelNode = this._serializeForIn(data, nodes);\n        break;\n      case \"GLOBAL_ASSIGNMENT\":\n        babelNode = this._serializeGlobalAssignment(data, nodes);\n        break;\n      case \"GLOBAL_DELETE\":\n        babelNode = this._serializeGlobalDelete(data, nodes);\n        break;\n      case \"JOIN_GENERATORS\":\n        babelNode = this._serializeJoinGenerators(data, nodes, context, valuesToProcess);\n        break;\n      case \"LOCAL_ASSIGNMENT\":\n        babelNode = this._serializeLocalAssignment(data, nodes, context, valuesToProcess);\n        break;\n      case \"NOOP\":\n        babelNode = t.emptyStatement();\n        break;\n      case \"OBJECT_SET_PARTIAL\":\n        babelNode = this._serializeObjectSetPartial(data, nodes);\n        break;\n      case \"PROPERTY_ASSIGNMENT\":\n        babelNode = this._serializePropertyAssignment(data, nodes, context, valuesToProcess);\n        break;\n      case \"PROPERTY_DELETE\":\n        babelNode = this._serializePropertyDelete(data, nodes);\n        break;\n      case \"THROW\":\n        babelNode = this._serializeThrow(data, nodes);\n        break;\n\n      // Invariants\n      case \"INVARIANT\":\n        babelNode = this._serializeInvariant(data, nodes);\n        break;\n\n      // React\n      case \"REACT_SSR_REGEX_CONSTANT\":\n        return t.variableDeclaration(\"var\", [\n          t.variableDeclarator(t.identifier(\"matchHtmlRegExp\"), t.regExpLiteral(\"[\\\"'&<>]\")),\n        ]);\n      case \"REACT_SSR_PREV_TEXT_NODE\":\n        return t.variableDeclaration(\"var\", [\n          t.variableDeclarator(t.identifier(\"previousWasTextNode\"), t.booleanLiteral(false)),\n        ]);\n\n      default:\n        let babelNodeExpression = this.serializeExpression(operationDescriptor, nodes, context);\n        if (declaredId !== undefined)\n          babelNode = this._serializeDerivedOperationDescriptor(declaredId, babelNodeExpression);\n        else babelNode = this._serializeVoidOperationDescriptor(babelNodeExpression);\n        return babelNode;\n    }\n\n    invariant(declaredId === undefined);\n    return babelNode;\n  }\n\n  serializeExpression(\n    operationDescriptor: OperationDescriptor,\n    nodes: Array<BabelNodeExpression>,\n    context?: SerializationContext,\n    valuesToProcess?: Set<AbstractValue | ObjectValue>\n  ): BabelNodeExpression {\n    let { data, type } = operationDescriptor;\n    let babelNode;\n\n    switch (type) {\n      case \"IDENTIFIER\":\n        babelNode = this._serializeIdentifier(data, nodes);\n        break;\n      case \"REBUILT_OBJECT\":\n        babelNode = this._serializeRebuiltObject(data, nodes);\n        break;\n      case \"BINARY_EXPRESSION\":\n        babelNode = this._serializeBinaryExpression(data, nodes);\n        break;\n      case \"LOGICAL_EXPRESSION\":\n        babelNode = this._serializeLogicalExpression(data, nodes);\n        break;\n      case \"CONDITIONAL_EXPRESSION\":\n        babelNode = this._serializeConditionalExpression(data, nodes);\n        break;\n      case \"UNARY_EXPRESSION\":\n        babelNode = this._serializeUnaryExpression(data, nodes);\n        break;\n      case \"ABSTRACT_PROPERTY\":\n        babelNode = this._serializeAbstractProperty(data, nodes);\n        break;\n      case \"ABSTRACT_FROM_TEMPLATE\":\n        babelNode = this._serializeAbstractFromTemplate(data, nodes);\n        break;\n      case \"COERCE_TO_STRING\":\n        babelNode = this._serializeCoerceToString(data, nodes);\n        break;\n      case \"OBJECT_ASSIGN\":\n        babelNode = this._serializeObjectAssign(data, nodes);\n        break;\n      case \"SINGLE_ARG\":\n        babelNode = this._serializeSingleArg(data, nodes);\n        break;\n      case \"CALL_BAILOUT\":\n        babelNode = this._serializeCallBailout(data, nodes);\n        break;\n      case \"EMIT_CALL_AND_CAPTURE_RESULT\":\n        babelNode = this._serializeEmitCallAndCaptureResults(data, nodes);\n        break;\n      case \"NEW_EXPRESSION\":\n        babelNode = this._serializeNewExpression(data, nodes);\n        break;\n      case \"FOR_STATEMENT_FUNC\":\n        babelNode = this._serializeForFunctionCall(data, nodes);\n        break;\n      case \"GET_BINDING\":\n        babelNode = this._serializeGetBinding(data, nodes, context);\n        break;\n      case \"UNKNOWN_ARRAY_METHOD_CALL\":\n        babelNode = this._serializeUnknownArrayMethodCall(data, nodes);\n        break;\n      case \"UNKNOWN_ARRAY_METHOD_PROPERTY_CALL\":\n        babelNode = this._serializeUnknownArrayMethodPropertyCall(data, nodes);\n        break;\n      case \"UNKNOWN_ARRAY_LENGTH\":\n        babelNode = this._serializeUnknownArrayLength(data, nodes);\n        break;\n      case \"UNKNOWN_ARRAY_GET_PARTIAL\":\n        babelNode = this._serializeUnknownArrayGetPartial(data, nodes);\n        break;\n      case \"OBJECT_GET_PARTIAL\":\n        babelNode = this._serializeObjectGetPartial(data, nodes);\n        break;\n      case \"ABSTRACT_OBJECT_GET_PARTIAL\":\n        babelNode = this._serializeAbstractObjectGetPartial(data, nodes);\n        break;\n      case \"ABSTRACT_OBJECT_GET_PROTO_OF\":\n        babelNode = this._serializeAbstractObjectGetProtoOf(data, nodes);\n        break;\n      case \"ABSTRACT_OBJECT_GET\":\n        babelNode = this._serializeAbstractObjectGet(data, nodes);\n        break;\n      case \"OBJECT_PROTO_HAS_OWN_PROPERTY\":\n        babelNode = this._serializeObjectProtoHasOwnProperty(data, nodes);\n        break;\n      case \"OBJECT_PROTO_GET_OWN_PROPERTY_DESCRIPTOR\":\n        babelNode = this._serializeObjectProtoGetOwnPropertyDescriptor(data, nodes);\n        break;\n      case \"DIRECT_CALL_WITH_ARG_LIST\":\n        babelNode = this._serializeDirectCallWithArgList(data, nodes);\n        break;\n      case \"CALL_ABSTRACT_FUNC\":\n        babelNode = this._serializeCallAbstractFunc(data, nodes);\n        break;\n      case \"CALL_ABSTRACT_FUNC_THIS\":\n        babelNode = this._serializeCallAbstractFuncThis(data, nodes);\n        break;\n      case \"LOGICAL_PROPERTY_ASSIGNMENT\":\n        babelNode = this._serializeLogicalPropertyAssignment(data, nodes);\n        break;\n      case \"UPDATE_INCREMENTOR\":\n        babelNode = this._serializeUpdateIncrementor(data, nodes);\n        break;\n      case \"MODULES_REQUIRE\":\n        babelNode = this._serializeModulesRequires(data, nodes);\n        break;\n      case \"RESIDUAL_CALL\":\n        babelNode = this._serializeResidualCall(data, nodes);\n        break;\n      case \"CANNOT_BECOME_OBJECT\":\n        babelNode = this._serializeCannotBecomeObject(data, nodes);\n        break;\n      case \"WIDENED_IDENTIFIER\":\n        babelNode = this._serializeIdentifier(data, nodes);\n        break;\n      case \"WIDEN_PROPERTY\":\n        babelNode = this._serializeWidenProperty(data, nodes);\n        break;\n      case \"WIDEN_PROPERTY_ASSIGNMENT\":\n        babelNode = this._serializeWidenPropertyAssignment(data, nodes);\n        break;\n\n      // Invariants\n      case \"DERIVED_ABSTRACT_INVARIANT\":\n        babelNode = this._serializeDerivedAbstractInvariant(data, nodes);\n        break;\n      case \"PROPERTY_INVARIANT\":\n        babelNode = this._serializePropertyInvariant(data, nodes);\n        break;\n      case \"INVARIANT_APPEND\":\n        babelNode = this._serializeInvariantAppend(data, nodes);\n        break;\n      case \"FULL_INVARIANT\":\n        babelNode = this._serializeFullInvariant(data, nodes);\n        break;\n      case \"FULL_INVARIANT_ABSTRACT\":\n        babelNode = this._serializeFullInvariantAbstract(data, nodes);\n        break;\n      case \"FULL_INVARIANT_FUNCTION\":\n        babelNode = this._serializeFullInvariantFunction(data, nodes);\n        break;\n\n      // React\n      case \"REACT_DEFAULT_PROPS_HELPER\":\n        babelNode = this._serializeReactDefaultPropsHelper(data, nodes);\n        break;\n      case \"REACT_SSR_RENDER_VALUE_HELPER\":\n        babelNode = this._serializeReactRenderValueHelper(data, nodes);\n        break;\n      case \"REACT_SSR_TEMPLATE_LITERAL\":\n        babelNode = this._serializeReactSSRTemplateLiteral(data, nodes);\n        break;\n      case \"REACT_TEMPORAL_FUNC\":\n        babelNode = this._serializeReactTemporalFunc(data, nodes);\n        break;\n      case \"REACT_CREATE_CONTEXT_PROVIDER\":\n        babelNode = this._serializeReactCreateContextProvider(data, nodes);\n        break;\n      case \"REACT_NATIVE_STRING_LITERAL\":\n        babelNode = this._serializeReactNativeStringLiteral(data, nodes);\n        break;\n      case \"REACT_RELAY_MOCK_CONTAINER\":\n        babelNode = this._serializeReactRelayMockContainer(data, nodes);\n        break;\n\n      // FB Mocks\n      case \"FB_MOCKS_BOOTLOADER_LOAD_MODULES\":\n        babelNode = this._serializeFBMocksBootloaderLoadModules(data, nodes);\n        break;\n      case \"FB_MOCKS_MAGIC_GLOBAL_FUNCTION\":\n        babelNode = this._serializeFBMocksMagicGlobalFunction(data, nodes);\n        break;\n\n      // Babel helpers\n      case \"BABEL_HELPERS_OBJECT_WITHOUT_PROPERTIES\":\n        babelNode = this._serializeBabelHelpersObjectWithoutProperties(data, nodes);\n        break;\n      default:\n        invariant(false, `operation descriptor \"type\" not recognized when serializing operation descriptor`);\n    }\n\n    return babelNode;\n  }\n\n  _serializeAssumeCall({  }: OperationDescriptorData, [c, s]: Array<BabelNodeExpression>): BabelNodeStatement {\n    let errorLiteral = s.type === \"StringLiteral\" ? s : t.stringLiteral(\"Assumption violated\");\n    return t.ifStatement(\n      t.unaryExpression(\"!\", c),\n      t.blockStatement([t.throwStatement(t.newExpression(t.identifier(\"Error\"), [errorLiteral]))])\n    );\n  }\n\n  _serializeWidenPropertyAssignment(\n    {  }: OperationDescriptorData,\n    [o, propName, v]: Array<BabelNodeExpression>\n  ): BabelNodeExpression {\n    return t.assignmentExpression(\"=\", memberExpressionHelper(o, propName), v);\n  }\n\n  _serializeWidenAbstractProperty(\n    {  }: OperationDescriptorData,\n    [o, p]: Array<BabelNodeExpression>\n  ): BabelNodeExpression {\n    return memberExpressionHelper(o, p);\n  }\n\n  _serializeWidenProperty(\n    {  }: OperationDescriptorData,\n    [o, propName]: Array<BabelNodeExpression>\n  ): BabelNodeExpression {\n    return memberExpressionHelper(o, propName);\n  }\n\n  _serializeAbstractObjectGet(\n    { propertyGetter }: OperationDescriptorData,\n    [o, P]: Array<BabelNodeExpression>\n  ): BabelNodeExpression {\n    return propertyGetter !== undefined\n      ? t.callExpression(t.memberExpression(t.identifier(\"global\"), t.identifier(\"__prop_\" + propertyGetter)), [o, P])\n      : memberExpressionHelper(o, P);\n  }\n\n  _serializeAbstractObjectGetProtoOf(\n    {  }: OperationDescriptorData,\n    [p]: Array<BabelNodeExpression>\n  ): BabelNodeExpression {\n    invariant(this.realm.preludeGenerator !== undefined);\n    let getPrototypeOf = this.realm.preludeGenerator.memoizeReference(\"Object.getPrototypeOf\");\n    return this.realm.isCompatibleWith(this.realm.MOBILE_JSC_VERSION) || this.realm.isCompatibleWith(\"mobile\")\n      ? t.memberExpression(p, protoExpression)\n      : t.callExpression(getPrototypeOf, [p]);\n  }\n\n  _serializeCannotBecomeObject({  }: OperationDescriptorData, [n]: Array<BabelNodeExpression>): BabelNodeExpression {\n    let callFunc = t.identifier(\"global.__cannotBecomeObject\");\n    return t.callExpression(callFunc, [n]);\n  }\n\n  _serializeResidualCall({  }: OperationDescriptorData, nodes: Array<BabelNodeExpression>): BabelNodeExpression {\n    return t.callExpression(nodes[0], ((nodes.slice(1): any): Array<BabelNodeExpression | BabelNodeSpreadElement>));\n  }\n\n  _serializeModulesRequires(\n    {  }: OperationDescriptorData,\n    [propName]: Array<BabelNodeExpression>\n  ): BabelNodeExpression {\n    return t.callExpression(t.identifier(\"require\"), [propName]);\n  }\n\n  _serializeConcreteModel(\n    {  }: OperationDescriptorData,\n    [valueNode, propName]: Array<BabelNodeExpression>\n  ): BabelNodeStatement {\n    let propString = ((propName: any): BabelNodeStringLiteral).value;\n    return t.expressionStatement(\n      t.assignmentExpression(\"=\", this.preludeGenerator.globalReference(propString, false), valueNode)\n    );\n  }\n\n  _serializeConsoleLog(\n    {  }: OperationDescriptorData,\n    [propName, ...nodes]: Array<BabelNodeExpression>\n  ): BabelNodeStatement {\n    let propString = ((propName: any): BabelNodeStringLiteral).value;\n    return t.expressionStatement(\n      t.callExpression(t.memberExpression(t.identifier(\"console\"), t.identifier(propString)), [...nodes])\n    );\n  }\n\n  _serializeDoWhile(\n    { generator, value }: OperationDescriptorData,\n    nodes: Array<BabelNodeExpression>,\n    context?: SerializationContext,\n    valuesToProcess?: Set<AbstractValue | ObjectValue>\n  ): BabelNodeStatement {\n    invariant(context !== undefined);\n    invariant(valuesToProcess !== undefined);\n    invariant(value !== undefined);\n    let testId = value.intrinsicName;\n    invariant(testId !== undefined);\n    invariant(generator !== undefined);\n    let statements = context.serializeGenerator(generator, valuesToProcess);\n    let block = t.blockStatement(statements);\n    return t.doWhileStatement(t.identifier(testId), block);\n  }\n\n  _serializeForIn(\n    { boundName, lh }: OperationDescriptorData,\n    [obj, tgt, src]: Array<BabelNodeExpression>\n  ): BabelNodeStatement {\n    invariant(boundName !== undefined);\n    invariant(lh !== undefined);\n    return t.forInStatement(\n      lh,\n      obj,\n      t.blockStatement([\n        t.expressionStatement(\n          t.assignmentExpression(\"=\", memberExpressionHelper(tgt, boundName), memberExpressionHelper(src, boundName))\n        ),\n      ])\n    );\n  }\n\n  _serializeFullInvariant(\n    {  }: OperationDescriptorData,\n    [propName, objectNode, valueNode]: Array<BabelNodeExpression>\n  ): BabelNodeExpression {\n    return t.binaryExpression(\"!==\", memberExpressionHelper(objectNode, propName), valueNode);\n  }\n\n  _serializeFullInvariantFunction(\n    {  }: OperationDescriptorData,\n    [propName, objectNode]: Array<BabelNodeExpression>\n  ): BabelNodeExpression {\n    return t.binaryExpression(\n      \"!==\",\n      t.unaryExpression(\"typeof\", memberExpressionHelper(objectNode, propName), true),\n      t.stringLiteral(\"function\")\n    );\n  }\n\n  _serializeFullInvariantAbstract(\n    { concreteComparisons, typeComparisons }: OperationDescriptorData,\n    [propName, valueNode]: Array<BabelNodeExpression>\n  ): BabelNodeExpression {\n    invariant(concreteComparisons !== undefined);\n    invariant(typeComparisons !== undefined);\n    // Create `object.property !== concreteValue`\n    let checks = concreteComparisons.map(concreteValue =>\n      t.binaryExpression(\"!==\", valueNode, t.valueToNode(concreteValue.serialize()))\n    );\n    // Create `typeof object.property !== typeValue`\n    checks = checks.concat(\n      [...typeComparisons].map(typeValue => {\n        let typeString = Utils.typeToString(typeValue);\n        invariant(typeString !== undefined, typeValue);\n        return t.binaryExpression(\"!==\", t.unaryExpression(\"typeof\", valueNode, true), t.stringLiteral(typeString));\n      })\n    );\n    return checks.reduce((expr, newCondition) => t.logicalExpression(\"&&\", expr, newCondition));\n  }\n\n  _serializeInvariantAppend(\n    {  }: OperationDescriptorData,\n    [propName, objectNode]: Array<BabelNodeExpression>\n  ): BabelNodeExpression {\n    return memberExpressionHelper(objectNode, propName);\n  }\n\n  _serializePropertyInvariant(\n    { state }: OperationDescriptorData,\n    [propName, objectNode]: Array<BabelNodeExpression>\n  ): BabelNodeExpression {\n    invariant(state !== undefined);\n    let n = t.callExpression(\n      t.memberExpression(\n        this.preludeGenerator.memoizeReference(\"Object.prototype.hasOwnProperty\"),\n        t.identifier(\"call\")\n      ),\n      [objectNode, propName]\n    );\n    if (state !== \"MISSING\") {\n      n = t.unaryExpression(\"!\", n, true);\n      if (state === \"DEFINED\")\n        n = t.logicalExpression(\n          \"||\",\n          n,\n          t.binaryExpression(\"===\", memberExpressionHelper(objectNode, propName), t.valueToNode(undefined))\n        );\n    }\n    return n;\n  }\n\n  _serializeUpdateIncrementor(\n    { incrementor }: OperationDescriptorData,\n    [oldValNode]: Array<BabelNodeExpression>\n  ): BabelNodeExpression {\n    invariant(incrementor !== undefined);\n    return t.binaryExpression(incrementor, oldValNode, t.numericLiteral(1));\n  }\n\n  _serializeDerivedAbstractInvariant(\n    {  }: OperationDescriptorData,\n    [typeOfStringNode, typeofNode]: Array<BabelNodeExpression>\n  ): BabelNodeExpression {\n    let typeofString = ((typeOfStringNode: any): BabelNodeStringLiteral).value;\n    let condition = t.binaryExpression(\"!==\", t.unaryExpression(\"typeof\", typeofNode), t.stringLiteral(typeofString));\n    if (typeofString === \"object\") {\n      condition = t.logicalExpression(\n        \"&&\",\n        condition,\n        t.binaryExpression(\"!==\", t.unaryExpression(\"typeof\", typeofNode), t.stringLiteral(\"function\"))\n      );\n      condition = t.logicalExpression(\"||\", condition, t.binaryExpression(\"===\", typeofNode, nullExpression));\n    }\n    return condition;\n  }\n\n  _serializeInvariant(\n    { appendLastToInvariantOperationDescriptor, violationConditionOperationDescriptor }: OperationDescriptorData,\n    nodes: Array<BabelNodeExpression>\n  ): BabelNodeStatement {\n    invariant(violationConditionOperationDescriptor !== undefined);\n    let messageComponents = [\n      t.stringLiteral(\"Prepack model invariant violation (\"),\n      t.numericLiteral(this.preludeGenerator.nextInvariantId++),\n    ];\n    if (appendLastToInvariantOperationDescriptor) {\n      let propName = nodes[0];\n      let last = nodes.pop();\n      messageComponents.push(t.stringLiteral(\"): \"));\n      messageComponents.push(this.serializeExpression(appendLastToInvariantOperationDescriptor, [propName, last]));\n    } else {\n      messageComponents.push(t.stringLiteral(\")\"));\n    }\n    let throwString = messageComponents[0];\n    for (let i = 1; i < messageComponents.length; i++)\n      throwString = t.binaryExpression(\"+\", throwString, messageComponents[i]);\n    let condition = this.serializeExpression(violationConditionOperationDescriptor, nodes);\n    let consequent = this.getErrorStatement(throwString);\n    return t.ifStatement(condition, consequent);\n  }\n\n  _serializeReactRelayMockContainer(\n    {  }: OperationDescriptorData,\n    [reactRelayIdent, propName, ...otherArgs]: Array<BabelNodeExpression>\n  ): BabelNodeExpression {\n    let propString = ((propName: any): BabelNodeStringLiteral).value;\n    return t.callExpression(\n      t.memberExpression(reactRelayIdent, t.identifier(propString)),\n      ((otherArgs: any): Array<any>)\n    );\n  }\n\n  _serializePropertyAssignment(\n    { path }: OperationDescriptorData,\n    [o, p, v, e]: Array<BabelNodeExpression>,\n    context?: SerializationContext,\n    valuesToProcess?: Set<AbstractValue | ObjectValue>\n  ): BabelNodeStatement {\n    invariant(path instanceof AbstractValue);\n    invariant(path.operationDescriptor !== undefined);\n    let lh = this.serializeExpression(path.operationDescriptor, [o, p], context, valuesToProcess);\n    return t.expressionStatement(t.assignmentExpression(\"=\", (lh: any), v));\n  }\n\n  _serializeConditionalPropertyAssignment(\n    { path, value }: OperationDescriptorData,\n    [o, v, e, keyKey]: Array<BabelNodeExpression>,\n    context?: SerializationContext,\n    valuesToProcess?: Set<AbstractValue | ObjectValue>\n  ): BabelNodeStatement {\n    invariant(value instanceof AbstractValue);\n    invariant(path instanceof AbstractValue);\n    let mightHaveBeenDeleted = value.mightHaveBeenDeleted();\n    let mightBeUndefined = value.mightBeUndefined();\n    invariant(path.operationDescriptor !== undefined);\n    let lh = this.serializeExpression(path.operationDescriptor, [o, keyKey], context, valuesToProcess);\n    let r = t.expressionStatement(t.assignmentExpression(\"=\", (lh: any), v));\n    if (mightHaveBeenDeleted) {\n      // If v === __empty || (v === undefined  && !(key.key in o))  then delete it\n      let emptyTest = t.binaryExpression(\"===\", v, e);\n      let undefinedTest = t.binaryExpression(\"===\", v, voidExpression);\n      let inTest = t.unaryExpression(\"!\", t.binaryExpression(\"in\", keyKey, o));\n      let guard = t.logicalExpression(\"||\", emptyTest, t.logicalExpression(\"&&\", undefinedTest, inTest));\n      let deleteIt = t.expressionStatement(t.unaryExpression(\"delete\", (lh: any)));\n      return t.ifStatement(mightBeUndefined ? emptyTest : guard, deleteIt, r);\n    }\n    return r;\n  }\n\n  _serializeLogicalPropertyAssignment(\n    { propertyBinding, value }: OperationDescriptorData,\n    [o, n]: Array<BabelNodeExpression>\n  ): BabelNodeExpression {\n    invariant(value instanceof Value);\n    invariant(propertyBinding !== undefined);\n    if (\n      typeof propertyBinding.key === \"string\" &&\n      value.mightHaveBeenDeleted() &&\n      isSelfReferential(value, propertyBinding.pathNode)\n    ) {\n      let inTest = t.binaryExpression(\"in\", t.stringLiteral(propertyBinding.key), o);\n      let addEmpty = t.conditionalExpression(inTest, n, emptyExpression);\n      n = t.logicalExpression(\"||\", n, addEmpty);\n    }\n    return n;\n  }\n\n  _serializeLocalAssignment(\n    { value }: OperationDescriptorData,\n    [v]: Array<BabelNodeExpression>,\n    context?: SerializationContext,\n    valuesToProcess?: Set<AbstractValue | ObjectValue>\n  ): BabelNodeStatement {\n    invariant(value instanceof AbstractValue);\n    invariant(value.operationDescriptor !== undefined);\n    let id = this.serializeExpression(value.operationDescriptor, [], context, valuesToProcess);\n    return t.expressionStatement(t.assignmentExpression(\"=\", (id: any), v));\n  }\n\n  _serializeReactNativeStringLiteral(\n    {  }: OperationDescriptorData,\n    [propName]: Array<BabelNodeExpression>\n  ): BabelNodeExpression {\n    return propName;\n  }\n\n  _serializeReactCreateContextProvider(\n    {  }: OperationDescriptorData,\n    [consumerNode]: Array<BabelNodeExpression>\n  ): BabelNodeExpression {\n    return t.memberExpression(consumerNode, t.identifier(\"Provider\"));\n  }\n\n  _serializeReactTemporalFunc(\n    {  }: OperationDescriptorData,\n    [renderNode, ..._args]: Array<BabelNodeExpression>\n  ): BabelNodeExpression {\n    return t.callExpression(renderNode, ((_args: any): Array<any>));\n  }\n\n  _serializeCallAbstractFunc({  }: OperationDescriptorData, nodes: Array<BabelNodeExpression>): BabelNodeExpression {\n    let fun_args = ((nodes.slice(1): any): Array<BabelNodeExpression | BabelNodeSpreadElement>);\n    return t.callExpression(nodes[0], fun_args);\n  }\n\n  _serializeCallAbstractFuncThis(\n    {  }: OperationDescriptorData,\n    nodes: Array<BabelNodeExpression>\n  ): BabelNodeExpression {\n    let fun_args = ((nodes.slice(1): any): Array<BabelNodeExpression | BabelNodeSpreadElement>);\n    return t.callExpression(t.memberExpression(nodes[0], t.identifier(\"call\")), fun_args);\n  }\n\n  _serializeDirectCallWithArgList(\n    {  }: OperationDescriptorData,\n    nodes: Array<BabelNodeExpression>\n  ): BabelNodeExpression {\n    let fun_args = nodes.slice(1);\n    return t.callExpression(nodes[0], ((fun_args: any): Array<BabelNodeExpression | BabelNodeSpreadElement>));\n  }\n\n  _serializeObjectProtoHasOwnProperty(\n    {  }: OperationDescriptorData,\n    [methodNode, objectNode, nameNode]: Array<BabelNodeExpression>\n  ): BabelNodeExpression {\n    return t.callExpression(t.memberExpression(methodNode, t.identifier(\"call\")), [objectNode, nameNode]);\n  }\n\n  _serializeRebuiltObject(\n    {  }: OperationDescriptorData,\n    [node, propName]: Array<BabelNodeExpression>\n  ): BabelNodeExpression {\n    let propString = ((propName: any): BabelNodeStringLiteral).value;\n    return t.isValidIdentifier(propString)\n      ? t.memberExpression(node, t.identifier(propString), false)\n      : t.memberExpression(node, propName, true);\n  }\n\n  _serializeGlobalDelete({  }: OperationDescriptorData, [propName]: Array<BabelNodeExpression>): BabelNodeStatement {\n    let propString = ((propName: any): BabelNodeStringLiteral).value;\n    return t.expressionStatement(t.unaryExpression(\"delete\", this.preludeGenerator.globalReference(propString, false)));\n  }\n\n  _serializeDefineProperty(\n    { object, descriptor }: OperationDescriptorData,\n    [propName]: Array<BabelNodeExpression>,\n    context?: SerializationContext\n  ): BabelNodeStatement {\n    let propString = ((propName: any): BabelNodeStringLiteral).value;\n    invariant(object !== undefined);\n    invariant(descriptor !== undefined);\n    invariant(context !== undefined);\n    return context.emitDefinePropertyBody(object, propString, descriptor);\n  }\n\n  _serializeFBMocksMagicGlobalFunction(\n    {  }: OperationDescriptorData,\n    [propName, ...args]: Array<BabelNodeExpression>\n  ): BabelNodeExpression {\n    let propString = ((propName: any): BabelNodeStringLiteral).value;\n    return t.callExpression(t.identifier(propString), ((args: any): Array<any>));\n  }\n\n  _serializeFBMocksBootloaderLoadModules(\n    {  }: OperationDescriptorData,\n    args: Array<BabelNodeExpression>\n  ): BabelNodeExpression {\n    return t.callExpression(\n      t.memberExpression(t.identifier(\"Bootloader\"), t.identifier(\"loadModules\")),\n      ((args: any): Array<any>)\n    );\n  }\n\n  _serializeUnknownArrayGetPartial(\n    {  }: OperationDescriptorData,\n    [o, p]: Array<BabelNodeExpression>\n  ): BabelNodeExpression {\n    return memberExpressionHelper(o, p);\n  }\n\n  _serializeObjectGetPartial({  }: OperationDescriptorData, [o, p]: Array<BabelNodeExpression>): BabelNodeExpression {\n    return memberExpressionHelper(o, p);\n  }\n\n  _serializeAbstractObjectGetPartial(\n    {  }: OperationDescriptorData,\n    [o, p]: Array<BabelNodeExpression>\n  ): BabelNodeExpression {\n    return memberExpressionHelper(o, p);\n  }\n\n  _serializeObjectSetPartial(\n    {  }: OperationDescriptorData,\n    [objectNode, keyNode, valueNode]: Array<BabelNodeExpression>\n  ): BabelNodeStatement {\n    return t.expressionStatement(t.assignmentExpression(\"=\", memberExpressionHelper(objectNode, keyNode), valueNode));\n  }\n\n  _serializeIdentifier({ id }: OperationDescriptorData, nodes: Array<BabelNodeExpression>): BabelNodeExpression {\n    invariant(id !== undefined);\n    return t.identifier(id);\n  }\n\n  _serializeCoerceToString({  }: OperationDescriptorData, [p]: Array<BabelNodeExpression>): BabelNodeExpression {\n    return t.binaryExpression(\"+\", t.stringLiteral(\"\"), p);\n  }\n\n  _serializeBabelHelpersObjectWithoutProperties(\n    {  }: OperationDescriptorData,\n    [methodNode, objNode, propRemoveNode]: Array<BabelNodeExpression>\n  ): BabelNodeExpression {\n    return t.callExpression(methodNode, [objNode, propRemoveNode]);\n  }\n\n  _serializeReactDefaultPropsHelper(\n    {  }: OperationDescriptorData,\n    [methodNode, ..._args]: Array<BabelNodeExpression>\n  ): BabelNodeExpression {\n    return t.callExpression(methodNode, ((_args: any): Array<any>));\n  }\n\n  _serializeUnknownArrayMethodCall(\n    {  }: OperationDescriptorData,\n    [methodNode, ..._args]: Array<BabelNodeExpression>\n  ): BabelNodeExpression {\n    return t.callExpression(methodNode, ((_args: any): Array<any>));\n  }\n\n  _serializeUnknownArrayLength({  }: OperationDescriptorData, [o]: Array<BabelNodeExpression>): BabelNodeExpression {\n    return t.memberExpression(o, t.identifier(\"length\"), false);\n  }\n\n  _serializeUnknownArrayMethodPropertyCall(\n    {  }: OperationDescriptorData,\n    [objNode, propName, ..._args]: Array<BabelNodeExpression>\n  ): BabelNodeExpression {\n    let propString = ((propName: any): BabelNodeStringLiteral).value;\n    return t.callExpression(t.memberExpression(objNode, t.identifier(propString)), ((_args: any): Array<any>));\n  }\n\n  _serializeThrow({  }: OperationDescriptorData, [argument]: Array<BabelNodeExpression>): BabelNodeStatement {\n    return t.throwStatement(argument);\n  }\n\n  _serializeConditionalThrow(\n    { value }: OperationDescriptorData,\n    nodes: Array<BabelNodeExpression>,\n    context?: SerializationContext\n  ): BabelNodeStatement {\n    invariant(value instanceof Value);\n\n    function createStatement(val: Value) {\n      invariant(context !== undefined);\n      if (!(val instanceof AbstractValue) || val.kind !== \"conditional\") {\n        return t.throwStatement(context.serializeValue(val));\n      }\n      let [cond, trueVal, falseVal] = val.args;\n      let condVal = context.serializeValue(cond);\n      let trueStat, falseStat;\n      if (trueVal instanceof EmptyValue) trueStat = t.blockStatement([]);\n      else trueStat = createStatement(trueVal);\n      if (falseVal instanceof EmptyValue) falseStat = t.blockStatement([]);\n      else falseStat = createStatement(falseVal);\n      return t.ifStatement(condVal, trueStat, falseStat);\n    }\n    return createStatement(value);\n  }\n\n  _serializeReactSSRTemplateLiteral(\n    { quasis }: OperationDescriptorData,\n    valueNodes: Array<BabelNodeExpression>\n  ): BabelNodeExpression {\n    invariant(quasis !== undefined);\n    return t.templateLiteral(quasis, valueNodes);\n  }\n\n  _serializeReactRenderValueHelper(\n    {  }: OperationDescriptorData,\n    [helperNode, valueNode]: Array<BabelNodeExpression>\n  ): BabelNodeExpression {\n    return t.callExpression(helperNode, [valueNode]);\n  }\n\n  _serializePropertyDelete(\n    {  }: OperationDescriptorData,\n    [objectNode, propName]: Array<BabelNodeExpression>\n  ): BabelNodeStatement {\n    return t.expressionStatement(t.unaryExpression(\"delete\", memberExpressionHelper(objectNode, propName)));\n  }\n\n  _serializeGetBinding(\n    { binding }: OperationDescriptorData,\n    nodes: Array<BabelNodeExpression>,\n    context?: SerializationContext\n  ): BabelNodeExpression {\n    invariant(binding !== undefined);\n    invariant(context !== undefined);\n    return context.serializeBinding(binding);\n  }\n\n  _serializeForFunctionCall(\n    { usesThis }: OperationDescriptorData,\n    [func, thisExpr]: Array<BabelNodeExpression>\n  ): BabelNodeExpression {\n    return usesThis\n      ? t.callExpression(t.memberExpression(func, t.identifier(\"call\")), [thisExpr])\n      : t.callExpression(func, []);\n  }\n\n  _serializeNewExpression(\n    {  }: OperationDescriptorData,\n    [constructorNode, ...argListNodes]: Array<BabelNodeExpression>\n  ): BabelNodeExpression {\n    return t.newExpression(constructorNode, argListNodes);\n  }\n\n  _serializeEmitCall(\n    { callFunctionRef }: OperationDescriptorData,\n    nodes: Array<BabelNodeExpression>\n  ): BabelNodeStatement {\n    invariant(callFunctionRef !== undefined);\n    let callFunction = this.preludeGenerator.memoizeReference(callFunctionRef);\n    return t.expressionStatement(t.callExpression(callFunction, [...nodes]));\n  }\n\n  _serializeEmitCallAndCaptureResults(\n    { callFunctionRef }: OperationDescriptorData,\n    nodes: Array<BabelNodeExpression>\n  ): BabelNodeExpression {\n    invariant(callFunctionRef !== undefined);\n    let callFunction = this.preludeGenerator.memoizeReference(callFunctionRef);\n    return t.callExpression(callFunction, ((nodes: any): Array<BabelNodeExpression | BabelNodeSpreadElement>));\n  }\n\n  _serializeObjectProtoGetOwnPropertyDescriptor(\n    {  }: OperationDescriptorData,\n    [funcNode, ...args]: Array<BabelNodeExpression>\n  ): BabelNodeExpression {\n    return t.callExpression(funcNode, ((args: any): Array<BabelNodeExpression | BabelNodeSpreadElement>));\n  }\n\n  _serializeCallBailout(\n    { propRef, thisArg }: OperationDescriptorData,\n    nodes: Array<BabelNodeExpression>\n  ): BabelNodeExpression {\n    let callFunc;\n    let argStart = 1;\n    if (thisArg instanceof Value) {\n      if (typeof propRef === \"string\") {\n        callFunc = memberExpressionHelper(nodes[0], propRef);\n      } else {\n        callFunc = memberExpressionHelper(nodes[0], nodes[1]);\n        argStart = 2;\n      }\n    } else {\n      callFunc = nodes[0];\n    }\n    let fun_args = ((nodes.slice(argStart): any): Array<BabelNodeExpression | BabelNodeSpreadElement>);\n    return t.callExpression(callFunc, fun_args);\n  }\n\n  _serializeJoinGenerators(\n    { generators }: OperationDescriptorData,\n    [cond]: Array<BabelNodeExpression>,\n    context?: SerializationContext,\n    valuesToProcess?: Set<AbstractValue | ObjectValue>\n  ): BabelNodeStatement {\n    invariant(context !== undefined);\n    invariant(valuesToProcess !== undefined);\n    invariant(generators !== undefined);\n    let [generator1, generator2] = generators;\n    let block1 = generator1.empty() ? null : serializeBody(generator1, context, valuesToProcess);\n    let block2 = generator2.empty() ? null : serializeBody(generator2, context, valuesToProcess);\n    if (block1) return t.ifStatement(cond, block1, block2);\n    invariant(block2);\n    return t.ifStatement(t.unaryExpression(\"!\", cond), block2);\n  }\n\n  _serializeEmitPropertyAssignment(\n    { value }: OperationDescriptorData,\n    [objectNode, valueNode, propName]: Array<BabelNodeExpression>,\n    context?: SerializationContext\n  ): BabelNodeStatement {\n    invariant(context !== undefined);\n    invariant(value instanceof Value);\n    return context.getPropertyAssignmentStatement(\n      memberExpressionHelper(objectNode, propName),\n      value,\n      value.mightHaveBeenDeleted(),\n      /* deleteIfMightHaveBeenDeleted */ true\n    );\n  }\n\n  _serializeGlobalAssignment(\n    {  }: OperationDescriptorData,\n    [valueNode, propName]: Array<BabelNodeExpression>\n  ): BabelNodeStatement {\n    let propString = ((propName: any): BabelNodeStringLiteral).value;\n    return t.expressionStatement(\n      t.assignmentExpression(\"=\", this.preludeGenerator.globalReference(propString, false), valueNode)\n    );\n  }\n\n  _serializeSingleArg({  }: OperationDescriptorData, [o]: Array<BabelNodeExpression>): BabelNodeExpression {\n    return o;\n  }\n\n  _serializeAbstractProperty(\n    {  }: OperationDescriptorData,\n    [o, propName]: Array<BabelNodeExpression>\n  ): BabelNodeExpression {\n    return memberExpressionHelper(o, propName);\n  }\n\n  _serializeUnaryExpression(\n    { unaryOperator, prefix }: OperationDescriptorData,\n    [x, y]: Array<BabelNodeExpression>\n  ): BabelNodeExpression {\n    invariant(unaryOperator !== undefined);\n    return t.unaryExpression(unaryOperator, x, prefix);\n  }\n\n  _serializeBinaryExpression(\n    { binaryOperator }: OperationDescriptorData,\n    [x, y]: Array<BabelNodeExpression>\n  ): BabelNodeExpression {\n    invariant(binaryOperator !== undefined);\n    return t.binaryExpression(binaryOperator, x, y);\n  }\n\n  _serializeLogicalExpression(\n    { logicalOperator }: OperationDescriptorData,\n    [x, y]: Array<BabelNodeExpression>\n  ): BabelNodeExpression {\n    invariant(logicalOperator !== undefined);\n    return t.logicalExpression(logicalOperator, x, y);\n  }\n\n  _serializeConditionalExpression(\n    {  }: OperationDescriptorData,\n    [c, x, y]: Array<BabelNodeExpression>\n  ): BabelNodeExpression {\n    return t.conditionalExpression(c, x, y);\n  }\n\n  _serializeDerivedOperationDescriptor(id: string, babelNode: BabelNodeExpression): BabelNodeStatement {\n    return t.variableDeclaration(\"var\", [t.variableDeclarator(t.identifier(id), babelNode)]);\n  }\n\n  _serializeVoidOperationDescriptor(babelNode: BabelNodeExpression): BabelNodeStatement {\n    return t.expressionStatement(babelNode);\n  }\n\n  _serializeAbstractFromTemplate(\n    { templateSource }: OperationDescriptorData,\n    nodes: Array<BabelNodeExpression>\n  ): BabelNodeExpression {\n    let templateArguments = {};\n    let i = 0;\n    for (let node of nodes) templateArguments[Placeholders[i++]] = node;\n    invariant(templateSource !== undefined);\n    return this.preludeGenerator.buildExpression(templateSource, templateArguments);\n  }\n\n  _serializeObjectAssign(\n    {  }: OperationDescriptorData,\n    [targetNode, ...sourceNodes]: Array<BabelNodeExpression>\n  ): BabelNodeExpression {\n    return t.callExpression(this.preludeGenerator.memoizeReference(\"Object.assign\"), [targetNode, ...sourceNodes]);\n  }\n}\n"
  },
  {
    "path": "src/serializer/ResidualOptimizedFunctions.js",
    "content": "/**\n * Copyright (c) 2017-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n/* @flow */\n\nimport { FunctionValue } from \"../values/index.js\";\nimport type { AdditionalFunctionEffects } from \"./types\";\nimport invariant from \"../invariant.js\";\nimport { GeneratorTree } from \"./GeneratorTree\";\nimport type { Scope } from \"./types.js\";\nimport { FunctionEnvironmentRecord } from \"../environment\";\nimport type { Value } from \"../values/index\";\nimport { Generator } from \"../utils/generator\";\n\nexport class ResidualOptimizedFunctions {\n  constructor(\n    generatorTree: GeneratorTree,\n    optimizedFunctionsAndEffects: Map<FunctionValue, AdditionalFunctionEffects>,\n    residualValues: Map<Value, Set<Scope>>\n  ) {\n    this._generatorTree = generatorTree;\n    this._optimizedFunctionsAndEffects = optimizedFunctionsAndEffects;\n    this._residualValues = residualValues;\n  }\n\n  _generatorTree: GeneratorTree;\n  _optimizedFunctionsAndEffects: Map<FunctionValue, AdditionalFunctionEffects>;\n  _residualValues: Map<Value, Set<Scope>>;\n\n  _isDefinedInsideFunction(childFunction: FunctionValue, maybeParentFunctions: Set<FunctionValue>): boolean {\n    for (let maybeParentFunction of maybeParentFunctions) {\n      if (childFunction === maybeParentFunction) {\n        continue;\n      }\n      // for optimized functions, we should use created objects\n      let maybeParentFunctionInfo = this._optimizedFunctionsAndEffects.get(maybeParentFunction);\n      if (maybeParentFunctionInfo && maybeParentFunctionInfo.effects.createdObjects.has(childFunction)) return true;\n      else {\n        // for other functions, check environment records\n        let env = childFunction.$Environment;\n        while (env.parent !== null) {\n          let envRecord = env.environmentRecord;\n          if (envRecord instanceof FunctionEnvironmentRecord && envRecord.$FunctionObject === maybeParentFunction)\n            return true;\n          env = env.parent;\n        }\n      }\n    }\n    return false;\n  }\n\n  // Check if an optimized function defines the given set of functions.\n  _definesFunctions(possibleParentFunction: FunctionValue, functions: Set<FunctionValue>): boolean {\n    let maybeParentFunctionInfo = this._optimizedFunctionsAndEffects.get(possibleParentFunction);\n    invariant(maybeParentFunctionInfo);\n    let createdObjects = maybeParentFunctionInfo.effects.createdObjects;\n    for (let func of functions) if (func !== possibleParentFunction && !createdObjects.has(func)) return false;\n    return true;\n  }\n\n  // Try and get the root optimized function when passed in an optimized function\n  // that may or may not be nested in the tree of said root, or is the root optimized function\n  tryGetOptimizedFunctionRoot(val: Value): void | FunctionValue {\n    let scopes = this._residualValues.get(val);\n    invariant(scopes !== undefined);\n    return this.tryGetOutermostOptimizedFunction(scopes);\n  }\n\n  // Try and get the optimized function that contains all the scopes passed in (may be one of the\n  // scopes passed in)\n  tryGetOutermostOptimizedFunction(scopes: Set<Scope>): void | FunctionValue {\n    let functionValues = new Set();\n    invariant(scopes !== undefined);\n    for (let scope of scopes) {\n      let s = scope;\n      while (s instanceof Generator) {\n        s = this._generatorTree.getParent(s);\n      }\n      if (s === \"GLOBAL\") return undefined;\n      invariant(s instanceof FunctionValue);\n      functionValues.add(s);\n    }\n    let outermostAdditionalFunctions = new Set();\n\n    // Get the set of optimized functions that may be the root\n\n    for (let functionValue of functionValues) {\n      if (this._optimizedFunctionsAndEffects.has(functionValue)) {\n        if (!this._isDefinedInsideFunction(functionValue, functionValues))\n          outermostAdditionalFunctions.add(functionValue);\n      } else {\n        let f = this.tryGetOptimizedFunctionRoot(functionValue);\n        if (f === undefined) return undefined;\n        if (!this._isDefinedInsideFunction(f, functionValues)) outermostAdditionalFunctions.add(f);\n      }\n    }\n    if (outermostAdditionalFunctions.size === 1) return [...outermostAdditionalFunctions][0];\n\n    // See if any of the outermost (or any of their parents) are the outermost optimized function\n    let possibleRoots = [...outermostAdditionalFunctions];\n    while (possibleRoots.length > 0) {\n      let possibleRoot = possibleRoots.shift();\n      if (this._definesFunctions(possibleRoot, outermostAdditionalFunctions)) return possibleRoot;\n      let additionalFunctionEffects = this._optimizedFunctionsAndEffects.get(possibleRoot);\n      invariant(additionalFunctionEffects);\n      let parent = additionalFunctionEffects.parentAdditionalFunction;\n      if (parent) possibleRoots.push(parent);\n    }\n    return undefined;\n  }\n}\n"
  },
  {
    "path": "src/serializer/ResidualReactElementSerializer.js",
    "content": "/**\n * Copyright (c) 2017-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n/* @flow */\n\nimport { Realm } from \"../realm.js\";\nimport { ResidualHeapSerializer } from \"./ResidualHeapSerializer.js\";\nimport { canHoistReactElement } from \"../react/hoisting.js\";\nimport * as t from \"@babel/types\";\nimport type { BabelNode, BabelNodeExpression } from \"@babel/types\";\nimport { AbstractValue, AbstractObjectValue, ObjectValue, SymbolValue, FunctionValue, Value } from \"../values/index.js\";\nimport { convertExpressionToJSXIdentifier, convertKeyValueToJSXAttribute } from \"../react/jsx.js\";\nimport { Logger } from \"../utils/logger.js\";\nimport invariant from \"../invariant.js\";\nimport { FatalError } from \"../errors.js\";\nimport { traverseReactElement } from \"../react/elements.js\";\nimport { canExcludeReactElementObjectProperty, getReactSymbol, getProperty } from \"../react/utils.js\";\nimport type { ReactOutputTypes } from \"../options.js\";\nimport type { LazilyHoistedNodes } from \"./types.js\";\nimport type { ResidualOptimizedFunctions } from \"./ResidualOptimizedFunctions\";\n\ntype ReactElementAttributeType = \"SPREAD\" | \"PROPERTY\" | \"PENDING\";\ntype ReactElementChildType = \"NORMAL\" | \"PENDING\";\n\ntype ReactElementChild = {\n  expr: void | BabelNodeExpression,\n  type: ReactElementChildType,\n};\n\ntype ReactElementAttribute = {\n  expr: void | BabelNodeExpression,\n  key: void | string,\n  type: ReactElementAttributeType,\n};\n\ntype ReactElement = {\n  attributes: Array<ReactElementAttribute>,\n  children: Array<ReactElementChild>,\n  declared: boolean,\n  type: void | BabelNodeExpression,\n  value: ObjectValue,\n};\n\nexport class ResidualReactElementSerializer {\n  constructor(\n    realm: Realm,\n    residualHeapSerializer: ResidualHeapSerializer,\n    residualOptimizedFunctions: ResidualOptimizedFunctions\n  ) {\n    this.realm = realm;\n    this.residualHeapSerializer = residualHeapSerializer;\n    this.logger = residualHeapSerializer.logger;\n    this.reactOutput = realm.react.output || \"create-element\";\n    this._lazilyHoistedNodes = new Map();\n    this._residualOptimizedFunctions = residualOptimizedFunctions;\n  }\n\n  realm: Realm;\n  logger: Logger;\n  reactOutput: ReactOutputTypes;\n  residualHeapSerializer: ResidualHeapSerializer;\n  _lazilyHoistedNodes: Map<FunctionValue, LazilyHoistedNodes>;\n  _residualOptimizedFunctions: ResidualOptimizedFunctions;\n\n  _createReactElement(value: ObjectValue): ReactElement {\n    return { attributes: [], children: [], declared: false, type: undefined, value };\n  }\n\n  _createReactElementAttribute(): ReactElementAttribute {\n    return { expr: undefined, key: undefined, type: \"PENDING\" };\n  }\n\n  _createReactElementChild(): ReactElementChild {\n    return { expr: undefined, type: \"PENDING\" };\n  }\n\n  _emitHoistedReactElement(\n    reactElement: ObjectValue,\n    id: BabelNodeExpression,\n    reactElementAst: BabelNodeExpression,\n    hoistedCreateElementIdentifier: BabelNodeIdentifier,\n    originalCreateElementIdentifier: BabelNodeIdentifier\n  ): void {\n    // if the currentHoistedReactElements is not defined, we create it an emit the function call\n    // this should only occur once per additional function\n    const optimizedFunction = this._residualOptimizedFunctions.tryGetOptimizedFunctionRoot(reactElement);\n    invariant(optimizedFunction);\n    let lazilyHoistedNodes = this._lazilyHoistedNodes.get(optimizedFunction);\n    if (lazilyHoistedNodes === undefined) {\n      let funcId = t.identifier(this.residualHeapSerializer.functionNameGenerator.generate());\n      lazilyHoistedNodes = {\n        id: funcId,\n        createElementIdentifier: hoistedCreateElementIdentifier,\n        nodes: [],\n      };\n      this._lazilyHoistedNodes.set(optimizedFunction, lazilyHoistedNodes);\n      let statement = t.expressionStatement(\n        t.logicalExpression(\n          \"&&\",\n          t.binaryExpression(\"===\", id, t.unaryExpression(\"void\", t.numericLiteral(0), true)),\n          // pass the createElementIdentifier if it's not null\n          t.callExpression(funcId, originalCreateElementIdentifier ? [originalCreateElementIdentifier] : [])\n        )\n      );\n      this.residualHeapSerializer.getPrelude(optimizedFunction).push(statement);\n    }\n    // we then push the reactElement and its id into our list of elements to process after\n    // the current additional function has serialzied\n    lazilyHoistedNodes.nodes.push({ id, astNode: reactElementAst });\n  }\n\n  _getReactLibraryValue(): AbstractObjectValue | ObjectValue {\n    let reactLibraryObject = this.realm.fbLibraries.react;\n    // if there is no React library, then we should throw and error\n    if (reactLibraryObject === undefined) {\n      throw new FatalError(\"unable to find React library reference in scope\");\n    }\n    return reactLibraryObject;\n  }\n\n  _getReactCreateElementValue(): Value {\n    let reactLibraryObject = this._getReactLibraryValue();\n    return getProperty(this.realm, reactLibraryObject, \"createElement\");\n  }\n\n  _emitReactElement(reactElement: ReactElement): BabelNodeExpression {\n    let { value } = reactElement;\n    let typeValue = getProperty(this.realm, value, \"type\");\n    let keyValue = getProperty(this.realm, value, \"key\");\n    let refValue = getProperty(this.realm, value, \"ref\");\n    let propsValue = getProperty(this.realm, value, \"props\");\n\n    let shouldHoist =\n      this._residualOptimizedFunctions.tryGetOptimizedFunctionRoot(value) !== undefined &&\n      canHoistReactElement(this.realm, value);\n\n    let id = this.residualHeapSerializer.getSerializeObjectIdentifier(value);\n    // this identifier is used as the deafult, but also passed to the hoisted factory function\n    let originalCreateElementIdentifier = null;\n    // this name is used when hoisting, and is passed into the factory function, rather than the original\n    let hoistedCreateElementIdentifier = null;\n    let reactElementAstNode;\n    let dependencies = [typeValue, keyValue, refValue, propsValue, value];\n    let createElement;\n\n    if (this.reactOutput === \"create-element\") {\n      createElement = this._getReactCreateElementValue();\n      dependencies.push(createElement);\n    }\n\n    this.residualHeapSerializer.emitter.emitNowOrAfterWaitingForDependencies(\n      dependencies,\n      () => {\n        if (this.reactOutput === \"jsx\") {\n          reactElementAstNode = this._serializeReactElementToJSXElement(value, reactElement);\n        } else if (this.reactOutput === \"create-element\") {\n          originalCreateElementIdentifier = this.residualHeapSerializer.serializeValue(createElement);\n\n          if (shouldHoist) {\n            const optimizedFunction = this._residualOptimizedFunctions.tryGetOptimizedFunctionRoot(value);\n            invariant(optimizedFunction);\n            const lazilyHoistedNodes = this._lazilyHoistedNodes.get(optimizedFunction);\n            // if we haven't created a lazilyHoistedNodes before, then this is the first time\n            // so we only create the hoisted identifier once\n            if (lazilyHoistedNodes === undefined) {\n              // create a new unique instance\n              hoistedCreateElementIdentifier = t.identifier(\n                this.residualHeapSerializer.intrinsicNameGenerator.generate()\n              );\n            } else {\n              hoistedCreateElementIdentifier = lazilyHoistedNodes.createElementIdentifier;\n            }\n          }\n\n          let createElementIdentifier = shouldHoist ? hoistedCreateElementIdentifier : originalCreateElementIdentifier;\n          reactElementAstNode = this._serializeReactElementToCreateElement(\n            value,\n            reactElement,\n            createElementIdentifier\n          );\n        } else {\n          invariant(false, \"Unknown reactOutput specified\");\n        }\n        // if we are hoisting this React element, put the assignment in the body\n        // also ensure we are in an additional function\n        if (shouldHoist) {\n          this._emitHoistedReactElement(\n            value,\n            id,\n            reactElementAstNode,\n            hoistedCreateElementIdentifier,\n            originalCreateElementIdentifier\n          );\n        } else {\n          // Note: it can be expected that we assign to the same variable multiple times\n          // this is due to fact ReactElements are immutable objects and the fact that\n          // when we inline/fold logic, the same ReactElements are referenced at different\n          // points with different attributes. Given we can't mutate an immutable object,\n          // we instead create new objects and assign to the same binding\n          if (reactElement.declared) {\n            this.residualHeapSerializer.emitter.emit(\n              t.expressionStatement(t.assignmentExpression(\"=\", id, reactElementAstNode))\n            );\n          } else {\n            reactElement.declared = true;\n            this.residualHeapSerializer.emitter.emit(\n              t.variableDeclaration(\"var\", [t.variableDeclarator(id, reactElementAstNode)])\n            );\n          }\n        }\n      },\n      this.residualHeapSerializer.emitter.getBody()\n    );\n    return id;\n  }\n\n  _serializeNowOrAfterWaitingForDependencies(\n    value: Value,\n    reactElement: ReactElement,\n    func: () => void | BabelNode,\n    shouldSerialize?: boolean = true\n  ): void {\n    let reason = this.residualHeapSerializer.emitter.getReasonToWaitForDependencies(value);\n\n    const serialize = () => {\n      func();\n    };\n\n    if (reason) {\n      this.residualHeapSerializer.emitter.emitAfterWaiting(\n        reason,\n        [value],\n        () => {\n          serialize();\n          this._emitReactElement(reactElement);\n        },\n        this.residualHeapSerializer.emitter.getBody()\n      );\n    } else {\n      serialize();\n    }\n  }\n\n  _serializeReactFragmentType(typeValue: SymbolValue): BabelNodeExpression {\n    let reactLibraryObject = this._getReactLibraryValue();\n    return t.memberExpression(this.residualHeapSerializer.serializeValue(reactLibraryObject), t.identifier(\"Fragment\"));\n  }\n\n  serializeReactElement(val: ObjectValue): BabelNodeExpression {\n    let reactElementData = this.realm.react.reactElements.get(val);\n    invariant(reactElementData !== undefined);\n    let { firstRenderOnly } = reactElementData;\n    let reactElement = this._createReactElement(val);\n\n    traverseReactElement(this.realm, reactElement.value, {\n      visitType: (typeValue: Value) => {\n        this._serializeNowOrAfterWaitingForDependencies(typeValue, reactElement, () => {\n          let expr;\n\n          if (typeValue instanceof SymbolValue && typeValue === getReactSymbol(\"react.fragment\", this.realm)) {\n            expr = this._serializeReactFragmentType(typeValue);\n          } else {\n            expr = this.residualHeapSerializer.serializeValue(typeValue);\n            // Increment ref count one more time to ensure that this object will be assigned a unique id.\n            // Abstract values that are emitted as first argument to JSX elements needs a proper id.\n            this.residualHeapSerializer.residualHeapValueIdentifiers.incrementReferenceCount(typeValue);\n          }\n          reactElement.type = expr;\n        });\n      },\n      visitKey: (keyValue: Value) => {\n        let reactElementKey = this._createReactElementAttribute();\n        this._serializeNowOrAfterWaitingForDependencies(keyValue, reactElement, () => {\n          let expr = this.residualHeapSerializer.serializeValue(keyValue);\n          reactElementKey.expr = expr;\n          reactElementKey.key = \"key\";\n          reactElementKey.type = \"PROPERTY\";\n        });\n        reactElement.attributes.push(reactElementKey);\n      },\n      visitRef: (refValue: Value) => {\n        if (!firstRenderOnly) {\n          let reactElementRef = this._createReactElementAttribute();\n          this._serializeNowOrAfterWaitingForDependencies(refValue, reactElement, () => {\n            let expr = this.residualHeapSerializer.serializeValue(refValue);\n            reactElementRef.expr = expr;\n            reactElementRef.key = \"ref\";\n            reactElementRef.type = \"PROPERTY\";\n          });\n          reactElement.attributes.push(reactElementRef);\n        }\n      },\n      visitAbstractOrPartialProps: (propsValue: AbstractValue | ObjectValue) => {\n        let reactElementSpread = this._createReactElementAttribute();\n        this._serializeNowOrAfterWaitingForDependencies(propsValue, reactElement, () => {\n          let expr = this.residualHeapSerializer.serializeValue(propsValue);\n          reactElementSpread.expr = expr;\n          reactElementSpread.type = \"SPREAD\";\n        });\n        reactElement.attributes.push(reactElementSpread);\n      },\n      visitConcreteProps: (propsValue: ObjectValue) => {\n        for (let [propName, binding] of propsValue.properties) {\n          if (binding.descriptor === undefined || propName === \"children\") {\n            continue;\n          }\n          let propValue = getProperty(this.realm, propsValue, propName);\n          if (canExcludeReactElementObjectProperty(this.realm, val, propName, propValue)) {\n            continue;\n          }\n          let reactElementAttribute = this._createReactElementAttribute();\n\n          this._serializeNowOrAfterWaitingForDependencies(propValue, reactElement, () => {\n            let expr = this.residualHeapSerializer.serializeValue(propValue);\n            reactElementAttribute.expr = expr;\n            reactElementAttribute.key = propName;\n            reactElementAttribute.type = \"PROPERTY\";\n          });\n          reactElement.attributes.push(reactElementAttribute);\n        }\n      },\n      visitChildNode: (childValue: Value) => {\n        reactElement.children.push(this._serializeReactElementChild(childValue, reactElement));\n      },\n    });\n    return this._emitReactElement(reactElement);\n  }\n\n  _addSerializedValueToJSXAttriutes(prop: string | null, expr: any, attributes: Array<BabelNode>): void {\n    if (prop === null) {\n      attributes.push(t.jSXSpreadAttribute(expr));\n    } else {\n      attributes.push(convertKeyValueToJSXAttribute(prop, expr));\n    }\n  }\n\n  _serializeReactElementToCreateElement(\n    val: ObjectValue,\n    reactElement: ReactElement,\n    createElementIdentifier: BabelNodeIdentifier\n  ): BabelNodeExpression {\n    let { type, attributes, children } = reactElement;\n\n    let createElementArguments = [type];\n    // check if we need to add attributes\n    if (attributes.length !== 0) {\n      let astAttributes = [];\n      for (let attribute of attributes) {\n        let expr = ((attribute.expr: any): BabelNodeExpression);\n\n        if (attribute.type === \"SPREAD\") {\n          astAttributes.push(t.spreadElement(expr));\n        } else if (attribute.type === \"PROPERTY\") {\n          let attributeKey = attribute.key;\n          let key;\n\n          invariant(typeof attributeKey === \"string\");\n          if (attributeKey.includes(\"-\")) {\n            key = t.stringLiteral(attributeKey);\n          } else {\n            key = t.identifier(attributeKey);\n          }\n          astAttributes.push(t.objectProperty(key, expr));\n        }\n      }\n      createElementArguments.push(t.objectExpression(astAttributes));\n    }\n    if (children.length !== 0) {\n      if (attributes.length === 0) {\n        createElementArguments.push(t.nullLiteral());\n      }\n      let astChildren = [];\n      for (let child of children) {\n        let expr = ((child.expr: any): BabelNodeExpression);\n\n        if (child.type === \"NORMAL\") {\n          astChildren.push(expr);\n        }\n      }\n      createElementArguments.push(...astChildren);\n    }\n    // cast to any for createElementArguments as casting it to BabelNodeExpresion[] isn't working\n    let createElementCall = t.callExpression(createElementIdentifier, (createElementArguments: any));\n    this._addBailOutMessageToBabelNode(val, createElementCall);\n    return createElementCall;\n  }\n\n  _serializeReactElementToJSXElement(val: ObjectValue, reactElement: ReactElement): BabelNodeExpression {\n    let { type, attributes, children } = reactElement;\n\n    let jsxTypeIdentifer = convertExpressionToJSXIdentifier(((type: any): BabelNodeIdentifier), true);\n    let astAttributes = [];\n    for (let attribute of attributes) {\n      let expr = ((attribute.expr: any): BabelNodeExpression);\n\n      if (attribute.type === \"SPREAD\") {\n        astAttributes.push(t.jSXSpreadAttribute(expr));\n      } else if (attribute.type === \"PROPERTY\") {\n        let attributeKey = attribute.key;\n        invariant(typeof attributeKey === \"string\");\n        astAttributes.push(convertKeyValueToJSXAttribute(attributeKey, expr));\n      }\n    }\n\n    let astChildren = [];\n    for (let child of children) {\n      let expr = ((child.expr: any): BabelNodeExpression);\n\n      if (child.type === \"NORMAL\") {\n        if (t.isStringLiteral(expr) || t.isNumericLiteral(expr)) {\n          astChildren.push(t.jSXText(((expr: any).value: string) + \"\"));\n        } else if (t.isJSXElement(expr)) {\n          astChildren.push(expr);\n        } else {\n          astChildren.push(t.jSXExpressionContainer(expr));\n        }\n      }\n    }\n\n    let openingElement = t.jSXOpeningElement(jsxTypeIdentifer, (astAttributes: any), astChildren.length === 0);\n    let closingElement = t.jSXClosingElement(jsxTypeIdentifer);\n    let jsxElement = t.jSXElement(openingElement, closingElement, astChildren, astChildren.length === 0);\n    this._addBailOutMessageToBabelNode(val, jsxElement);\n    return jsxElement;\n  }\n\n  _addBailOutMessageToBabelNode(val: ObjectValue, node: BabelNode): void {\n    // if there has been a bail-out, we create an inline BlockComment node before the JSX element\n    if (val.$BailOutReason !== undefined) {\n      // $BailOutReason contains an optional string of what to print out in the comment\n      node.leadingComments = [({ type: \"BlockComment\", value: `${val.$BailOutReason}` }: any)];\n    }\n  }\n\n  _serializeReactElementChild(child: Value, reactElement: ReactElement): ReactElementChild {\n    let reactElementChild = this._createReactElementChild();\n    this._serializeNowOrAfterWaitingForDependencies(child, reactElement, () => {\n      let expr = this.residualHeapSerializer.serializeValue(child);\n\n      reactElementChild.expr = expr;\n      reactElementChild.type = \"NORMAL\";\n    });\n    return reactElementChild;\n  }\n\n  serializeLazyHoistedNodes(optimizedFunction: FunctionValue): Array<BabelNodeStatement> {\n    const entries = [];\n    const lazilyHoistedNodes = this._lazilyHoistedNodes.get(optimizedFunction);\n    if (lazilyHoistedNodes !== undefined) {\n      let { id, nodes, createElementIdentifier } = lazilyHoistedNodes;\n      // create a function that initializes all the hoisted nodes\n      let func = t.functionExpression(\n        null,\n        // use createElementIdentifier if it's not null\n        createElementIdentifier ? [createElementIdentifier] : [],\n        t.blockStatement(nodes.map(node => t.expressionStatement(t.assignmentExpression(\"=\", node.id, node.astNode))))\n      );\n      // push it to the mainBody of the module\n      entries.push(t.variableDeclaration(\"var\", [t.variableDeclarator(id, func)]));\n      // output all the empty variable declarations that will hold the nodes lazily\n      entries.push(...nodes.map(node => t.variableDeclaration(\"var\", [t.variableDeclarator(node.id)])));\n      // reset the _lazilyHoistedNodes so other additional functions work\n      this._lazilyHoistedNodes.delete(optimizedFunction);\n    }\n    return entries;\n  }\n}\n"
  },
  {
    "path": "src/serializer/ResidualReactElementVisitor.js",
    "content": "/**\n * Copyright (c) 2017-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n/* @flow strict-local */\n\nimport { Realm } from \"../realm.js\";\nimport {\n  AbstractObjectValue,\n  AbstractValue,\n  FunctionValue,\n  ObjectValue,\n  StringValue,\n  SymbolValue,\n  Value,\n} from \"../values/index.js\";\nimport { ResidualHeapVisitor } from \"./ResidualHeapVisitor.js\";\nimport { determineIfReactElementCanBeHoisted } from \"../react/hoisting.js\";\nimport { traverseReactElement } from \"../react/elements.js\";\nimport {\n  canExcludeReactElementObjectProperty,\n  getProperty,\n  getReactSymbol,\n  hardModifyReactObjectPropertyBinding,\n} from \"../react/utils.js\";\nimport invariant from \"../invariant.js\";\nimport { TemporalOperationEntry } from \"../utils/generator.js\";\nimport { ReactEquivalenceSet } from \"../react/ReactEquivalenceSet.js\";\nimport { ReactElementSet } from \"../react/ReactElementSet.js\";\nimport { ReactPropsSet } from \"../react/ReactPropsSet.js\";\nimport type { ReactOutputTypes } from \"../options.js\";\nimport { Get } from \"../methods/index.js\";\n\nexport opaque type ReactEquivalenceSetSave = {|\n  +reactEquivalenceSet: ReactEquivalenceSet,\n  +reactElementEquivalenceSet: ReactElementSet,\n  +reactPropsEquivalenceSet: ReactPropsSet,\n|};\n\nexport class ResidualReactElementVisitor {\n  constructor(realm: Realm, residualHeapVisitor: ResidualHeapVisitor) {\n    this.realm = realm;\n    this.residualHeapVisitor = residualHeapVisitor;\n    this.reactOutput = realm.react.output || \"create-element\";\n    this.defaultEquivalenceSet = true;\n    this.reactEquivalenceSet = new ReactEquivalenceSet(realm, this);\n    this.reactElementEquivalenceSet = new ReactElementSet(realm, this.reactEquivalenceSet);\n    this.reactPropsEquivalenceSet = new ReactPropsSet(realm, this.reactEquivalenceSet);\n  }\n\n  realm: Realm;\n  residualHeapVisitor: ResidualHeapVisitor;\n  reactOutput: ReactOutputTypes;\n  defaultEquivalenceSet: boolean;\n  reactEquivalenceSet: ReactEquivalenceSet;\n  reactElementEquivalenceSet: ReactElementSet;\n  reactPropsEquivalenceSet: ReactPropsSet;\n\n  visitReactElement(reactElement: ObjectValue): void {\n    let reactElementData = this.realm.react.reactElements.get(reactElement);\n    invariant(reactElementData !== undefined);\n    let { firstRenderOnly } = reactElementData;\n    let isReactFragment = false;\n\n    traverseReactElement(this.realm, reactElement, {\n      visitType: (typeValue: Value) => {\n        let reactElementStringTypeReferences = this.realm.react.reactElementStringTypeReferences;\n\n        // If the type is a text value, and we have a derived reference for it\n        // then use that derived reference instead of the string value. This is\n        // primarily designed around RCTView and RCTText, which are string values\n        // for RN apps, but are treated as special host components.\n        if (typeValue instanceof StringValue && reactElementStringTypeReferences.has(typeValue.value)) {\n          let reference = reactElementStringTypeReferences.get(typeValue.value);\n          invariant(reference instanceof AbstractValue);\n          hardModifyReactObjectPropertyBinding(this.realm, reactElement, \"type\", reference);\n          this.residualHeapVisitor.visitValue(reference);\n          return;\n        }\n        isReactFragment =\n          typeValue instanceof SymbolValue && typeValue === getReactSymbol(\"react.fragment\", this.realm);\n        // we don't want to visit fragments as they are internal values\n        if (!isReactFragment) {\n          this.residualHeapVisitor.visitValue(typeValue);\n        }\n      },\n      visitKey: (keyValue: Value) => {\n        this.residualHeapVisitor.visitValue(keyValue);\n      },\n      visitRef: (refValue: Value) => {\n        if (!firstRenderOnly) {\n          this.residualHeapVisitor.visitValue(refValue);\n        }\n      },\n      visitAbstractOrPartialProps: (propsValue: AbstractValue | ObjectValue) => {\n        this.residualHeapVisitor.visitValue(propsValue);\n      },\n      visitConcreteProps: (propsValue: ObjectValue) => {\n        for (let [propName, binding] of propsValue.properties) {\n          invariant(propName !== \"key\" && propName !== \"ref\", `\"${propName}\" is a reserved prop name`);\n          if (binding.descriptor === undefined || propName === \"children\") {\n            continue;\n          }\n          let propValue = getProperty(this.realm, propsValue, propName);\n          if (canExcludeReactElementObjectProperty(this.realm, reactElement, propName, propValue)) {\n            continue;\n          }\n          this.residualHeapVisitor.visitValue(propValue);\n        }\n      },\n      visitChildNode: (childValue: Value) => {\n        this.residualHeapVisitor.visitValue(childValue);\n      },\n    });\n\n    // Our serializer requires that every value we serialize must first be visited in every scope where it appears. In\n    // our React element serializer we serialize some values (namely `React.createElement` and `React.Fragment`) that do\n    // not necessarily appear in our source code. We must manually visit these values in our visitor pass for the values\n    // to be serializable.\n    if (this.realm.react.output === \"create-element\") {\n      const reactLibraryObject = this._getReactLibraryValue();\n      invariant(reactLibraryObject instanceof ObjectValue);\n      const createElement = reactLibraryObject.properties.get(\"createElement\");\n      invariant(createElement !== undefined);\n      const reactCreateElement = Get(this.realm, reactLibraryObject, \"createElement\");\n      // Our `createElement` value will be used in the prelude of the optimized function we serialize to initialize\n      // our hoisted React elements. So we need to ensure that we visit our value in a scope above our own to allow\n      // the function to be used in our optimized function prelude. We use our global scope to accomplish this. We are\n      // a \"friend\" class of `ResidualHeapVisitor` so we call one of its private methods.\n      this.residualHeapVisitor._visitInUnrelatedScope(this.residualHeapVisitor.globalGenerator, reactCreateElement);\n    }\n    if (isReactFragment) {\n      const reactLibraryObject = this._getReactLibraryValue();\n      // Our `React.Fragment` value will be used in the function to lazily initialize hoisted JSX elements. So we need\n      // to visit the library in our global generator so that it is available when creating the hoisted elements.\n      this.residualHeapVisitor._visitInUnrelatedScope(this.residualHeapVisitor.globalGenerator, reactLibraryObject);\n    }\n\n    // determine if this ReactElement node tree is going to be hoistable\n    determineIfReactElementCanBeHoisted(this.realm, reactElement, this.residualHeapVisitor);\n  }\n\n  withCleanEquivalenceSet(func: () => void): void {\n    let defaultEquivalenceSet = this.defaultEquivalenceSet;\n    let reactEquivalenceSet = this.reactEquivalenceSet;\n    let reactElementEquivalenceSet = this.reactElementEquivalenceSet;\n    let reactPropsEquivalenceSet = this.reactPropsEquivalenceSet;\n    this.defaultEquivalenceSet = false;\n    this.reactEquivalenceSet = new ReactEquivalenceSet(this.realm, this);\n    this.reactElementEquivalenceSet = new ReactElementSet(this.realm, this.reactEquivalenceSet);\n    this.reactPropsEquivalenceSet = new ReactPropsSet(this.realm, this.reactEquivalenceSet);\n    func();\n    // Cleanup\n    this.defaultEquivalenceSet = defaultEquivalenceSet;\n    this.reactEquivalenceSet = reactEquivalenceSet;\n    this.reactElementEquivalenceSet = reactElementEquivalenceSet;\n    this.reactPropsEquivalenceSet = reactPropsEquivalenceSet;\n  }\n\n  saveEquivalenceSet(): ReactEquivalenceSetSave {\n    const { reactEquivalenceSet, reactElementEquivalenceSet, reactPropsEquivalenceSet } = this;\n    return { reactEquivalenceSet, reactElementEquivalenceSet, reactPropsEquivalenceSet };\n  }\n\n  loadEquivalenceSet<T>(save: ReactEquivalenceSetSave, func: () => T): T {\n    const defaultEquivalenceSet = this.defaultEquivalenceSet;\n    const reactEquivalenceSet = this.reactEquivalenceSet;\n    const reactElementEquivalenceSet = this.reactElementEquivalenceSet;\n    const reactPropsEquivalenceSet = this.reactPropsEquivalenceSet;\n    this.defaultEquivalenceSet = false;\n    this.reactEquivalenceSet = save.reactEquivalenceSet;\n    this.reactElementEquivalenceSet = save.reactElementEquivalenceSet;\n    this.reactPropsEquivalenceSet = save.reactPropsEquivalenceSet;\n    const result = func();\n    // Cleanup\n    this.defaultEquivalenceSet = defaultEquivalenceSet;\n    this.reactEquivalenceSet = reactEquivalenceSet;\n    this.reactElementEquivalenceSet = reactElementEquivalenceSet;\n    this.reactPropsEquivalenceSet = reactPropsEquivalenceSet;\n    return result;\n  }\n\n  wasTemporalAliasDeclaredInCurrentScope(temporalAlias: AbstractObjectValue): boolean {\n    let scope = this.residualHeapVisitor.scope;\n    if (scope instanceof FunctionValue) {\n      return false;\n    }\n    // If the temporal has already been visited, then we know the temporal\n    // value was used and thus declared in another scope\n    if (this.residualHeapVisitor.values.has(temporalAlias)) {\n      return false;\n    }\n    // Otherwise, we check the current scope and see if the\n    // temporal value was declared in one of the entries\n    for (let i = 0; i < scope._entries.length; i++) {\n      let entry = scope._entries[i];\n      if (entry instanceof TemporalOperationEntry) {\n        if (entry.declared === temporalAlias) {\n          return true;\n        }\n      }\n    }\n    return false;\n  }\n\n  _getReactLibraryValue() {\n    const reactLibraryObject = this.realm.fbLibraries.react;\n    invariant(reactLibraryObject, \"Unable to find React library reference in scope.\");\n    return reactLibraryObject;\n  }\n}\n"
  },
  {
    "path": "src/serializer/factorify.js",
    "content": "/**\n * Copyright (c) 2017-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n/* @flow strict-local */\n\nimport * as t from \"@babel/types\";\nimport type { BabelNodeStatement, BabelNodeObjectExpression, BabelNodeLVal } from \"@babel/types\";\nimport { NameGenerator } from \"../utils/NameGenerator\";\n\nfunction isLiteral(node) {\n  switch (node.type) {\n    case \"NullLiteral\":\n    case \"BooleanLiteral\":\n    case \"StringLiteral\":\n    case \"NumericLiteral\":\n      return true;\n    case \"UnaryExpression\":\n      return node.operator === \"void\" && isLiteral(node.argument);\n    default:\n      return false;\n  }\n}\n\nfunction isSameNode(left, right) {\n  let type = left.type;\n\n  if (type !== right.type) {\n    return false;\n  }\n\n  if (type === \"Identifier\") {\n    return left.name === right.name;\n  }\n\n  if (type === \"NullLiteral\") {\n    return true;\n  }\n\n  if (type === \"BooleanLiteral\" || type === \"StringLiteral\" || type === \"NumericLiteral\") {\n    return Object.is(left.value, right.value);\n  }\n\n  if (type === \"UnaryExpression\") {\n    return (\n      left.operator === \"void\" && right.operator === \"void\" && isLiteral(left.argument) && isLiteral(right.argument)\n    );\n  }\n\n  return false;\n}\n\nfunction getObjectKeys(obj: BabelNodeObjectExpression): string | false {\n  let keys = [];\n\n  for (let prop of obj.properties) {\n    if (prop.type !== \"ObjectProperty\") return false;\n\n    let key = prop.key;\n    if (key.type === \"StringLiteral\") {\n      keys.push(key.value);\n    } else if (key.type === \"Identifier\") {\n      if (prop.computed) return false;\n      keys.push(key.name);\n    } else {\n      return false;\n    }\n  }\n\n  for (let key of keys) {\n    if (key.indexOf(\"|\") >= 0) return false;\n  }\n\n  return keys.join(\"|\");\n}\n\n// This function looks for recurring initialization patterns in the code of the form\n//   var x = { a: literal1, b: literal2 }\n//   var y = { a: literal1, b: literal3 }\n// and transforms them into something like\n//   function factory(b) { return { a: literal1, b } }\n//   var x = factory(literal2);\n//   var y = factory(literal3);\n// TODO #884: Right now, the visitor below only looks into top-level variable declaration\n// with a flat object literal initializer.\n// It should also look into conditional control flow, residual functions, and nested object literals.\nexport function factorifyObjects(body: Array<BabelNodeStatement>, factoryNameGenerator: NameGenerator): void {\n  let signatures = Object.create(null);\n\n  for (let node of body) {\n    switch (node.type) {\n      case \"VariableDeclaration\":\n        for (let declar of node.declarations) {\n          let { init } = declar;\n          if (!init) continue;\n          if (init.type !== \"ObjectExpression\") continue;\n\n          let keys = getObjectKeys(init);\n          if (!keys) continue;\n\n          let initializerAstNodeName = \"init\";\n          let declars = (signatures[keys] = signatures[keys] || []);\n          declars.push({ declar, initializerAstNodeName });\n        }\n        break;\n\n      case \"ExpressionStatement\":\n        const expr = node.expression;\n        if (expr.type !== \"AssignmentExpression\") {\n          break;\n        }\n        const { right } = expr;\n        if (right.type !== \"ObjectExpression\") {\n          break;\n        }\n\n        let keys = getObjectKeys(right);\n        if (!keys) continue;\n\n        let initializerAstNodeName = \"right\";\n        let declars = (signatures[keys] = signatures[keys] || []);\n        declars.push({ declar: node.expression, initializerAstNodeName });\n        break;\n\n      default:\n        // Continue to next node.\n        break;\n    }\n  }\n\n  for (let signatureKey in signatures) {\n    let declars = signatures[signatureKey];\n    if (declars.length < 5) continue;\n\n    let keys = signatureKey.split(\"|\");\n\n    let rootFactoryParams: Array<BabelNodeLVal> = [];\n    let rootFactoryProps = [];\n    for (let keyIndex = 0; keyIndex < keys.length; keyIndex++) {\n      let key = keys[keyIndex];\n      let id = t.identifier(`__${keyIndex}`);\n      rootFactoryParams.push(id);\n      let keyNode = t.isValidIdentifier(key) ? t.identifier(key) : t.stringLiteral(key);\n      rootFactoryProps.push(t.objectProperty(keyNode, id));\n    }\n\n    let rootFactoryId = t.identifier(factoryNameGenerator.generate(\"root\"));\n    let rootFactoryBody = t.blockStatement([t.returnStatement(t.objectExpression(rootFactoryProps))]);\n    let rootFactory = t.functionDeclaration(rootFactoryId, rootFactoryParams, rootFactoryBody);\n    body.unshift(rootFactory);\n\n    for (let { declar, initializerAstNodeName } of declars) {\n      let args = [];\n      for (let prop of declar[initializerAstNodeName].properties) {\n        args.push(prop.value);\n      }\n\n      declar[initializerAstNodeName] = t.callExpression(rootFactoryId, args);\n    }\n\n    let seen = new Set();\n    for (let { declar, initializerAstNodeName } of declars) {\n      if (seen.has(declar)) continue;\n\n      // build up a map containing the arguments that are shared\n      let common = [];\n      let mostSharedArgsLength = 0;\n      for (let { declar: declar2, initializerAstNodeName: initializerAstNodeName2 } of declars) {\n        if (seen.has(declar2)) continue;\n        if (declar === declar2) continue;\n\n        let sharedArgs = [];\n        for (let i = 0; i < keys.length; i++) {\n          if (isSameNode(declar[initializerAstNodeName].arguments[i], declar2[initializerAstNodeName2].arguments[i])) {\n            sharedArgs.push(i);\n          }\n        }\n        if (!sharedArgs.length) continue;\n\n        mostSharedArgsLength = Math.max(mostSharedArgsLength, sharedArgs.length);\n        common.push({ declar: declar2, initializerAstNodeName: initializerAstNodeName2, sharedArgs });\n      }\n\n      // build up a mapping of the argument positions that are shared so we can pick the top one\n      let sharedPairs = Object.create(null);\n      for (let { declar: declar2, initializerAstNodeName: initializerAstNodeName2, sharedArgs } of common) {\n        if (sharedArgs.length === mostSharedArgsLength) {\n          sharedArgs = sharedArgs.join(\",\");\n          let pair = (sharedPairs[sharedArgs] = sharedPairs[sharedArgs] || [{ declar, initializerAstNodeName }]);\n          pair.push({ declar: declar2, initializerAstNodeName: initializerAstNodeName2 });\n        }\n      }\n\n      // get the highest pair\n      let highestPairArgs;\n      let highestPairCount;\n      for (let pairArgs in sharedPairs) {\n        let pair = sharedPairs[pairArgs];\n        if (highestPairArgs === undefined || pair.length > highestPairCount) {\n          highestPairCount = pair.length;\n          highestPairArgs = pairArgs;\n        }\n      }\n      if (highestPairArgs === undefined) continue;\n\n      let declarsSub = sharedPairs[highestPairArgs];\n      let removeArgs = highestPairArgs.split(\",\");\n\n      let subFactoryArgs = [];\n      let subFactoryParams = [];\n      let sharedArgs = declar[initializerAstNodeName].arguments;\n      for (let i = 0; i < sharedArgs.length; i++) {\n        let arg = sharedArgs[i];\n        if (removeArgs.indexOf(i + \"\") >= 0) {\n          subFactoryArgs.push(arg);\n        } else {\n          let id = t.identifier(`__${i}`);\n          subFactoryArgs.push(id);\n          subFactoryParams.push(id);\n        }\n      }\n\n      let subFactoryId = t.identifier(factoryNameGenerator.generate(\"sub\"));\n      let subFactoryBody = t.blockStatement([t.returnStatement(t.callExpression(rootFactoryId, subFactoryArgs))]);\n      let subFactory = t.functionDeclaration(subFactoryId, subFactoryParams, subFactoryBody);\n      body.unshift(subFactory);\n\n      for (let { declar: declar2, initializerAstNodeName: initializerAstNodeName2 } of declarsSub) {\n        seen.add(declar2);\n\n        let call = declar2[initializerAstNodeName2];\n        call.callee = subFactoryId;\n        call.arguments = call.arguments.filter(function(val, i) {\n          return removeArgs.indexOf(i + \"\") < 0;\n        });\n      }\n    }\n  }\n}\n"
  },
  {
    "path": "src/serializer/functions.js",
    "content": "/**\n * Copyright (c) 2017-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n/* @flow */\n\nimport type { BabelNodeSourceLocation } from \"@babel/types\";\nimport { AbruptCompletion } from \"../completions.js\";\nimport { CompilerDiagnostic, FatalError } from \"../errors.js\";\nimport invariant from \"../invariant.js\";\nimport { type Effects, type PropertyBindings, Realm } from \"../realm.js\";\nimport type { PropertyBinding, ReactComponentTreeConfig } from \"../types.js\";\nimport { ignoreErrorsIn } from \"../utils/errors.js\";\nimport {\n  AbstractObjectValue,\n  AbstractValue,\n  BoundFunctionValue,\n  ECMAScriptSourceFunctionValue,\n  FunctionValue,\n  ObjectValue,\n  UndefinedValue,\n  EmptyValue,\n  Value,\n} from \"../values/index.js\";\nimport { Get } from \"../methods/index.js\";\nimport { ModuleTracer } from \"../utils/modules.js\";\nimport { createAdditionalEffects } from \"./utils.js\";\nimport { ReactStatistics } from \"./types\";\nimport type { AdditionalFunctionEffects, WriteEffects } from \"./types\";\nimport { convertConfigObjectToReactComponentTreeConfig, valueIsKnownReactAbstraction } from \"../react/utils.js\";\nimport { optimizeReactComponentTreeRoot } from \"../react/optimizing.js\";\nimport { handleReportedSideEffect } from \"./utils.js\";\nimport type { ArgModel } from \"../types.js\";\nimport { optionalStringOfLocation } from \"../utils/babelhelpers\";\nimport { Properties, Utils } from \"../singletons.js\";\nimport { PropertyDescriptor } from \"../descriptors.js\";\n\ntype AdditionalFunctionEntry = {\n  value: ECMAScriptSourceFunctionValue | AbstractValue,\n  config?: ReactComponentTreeConfig,\n  argModel?: ArgModel,\n};\n\nexport class Functions {\n  constructor(realm: Realm, moduleTracer: ModuleTracer) {\n    this.realm = realm;\n    this.moduleTracer = moduleTracer;\n    this._writeEffects = new Map();\n    this._noopFunction = undefined;\n    this._optimizedFunctionId = 0;\n    this.reactFunctionMap = new Map();\n  }\n\n  realm: Realm;\n  moduleTracer: ModuleTracer;\n  _writeEffects: WriteEffects;\n  _noopFunction: void | ECMAScriptSourceFunctionValue;\n  _optimizedFunctionId: number;\n  reactFunctionMap: Map<FunctionValue, FunctionValue>;\n\n  _unwrapAbstract(value: AbstractValue): Value {\n    let elements = value.values.getElements();\n    if (elements) {\n      let possibleValues = [...elements].filter(\n        element => !(element instanceof EmptyValue || element instanceof UndefinedValue)\n      );\n      if (possibleValues.length === 1) {\n        return possibleValues[0];\n      }\n    }\n    return value;\n  }\n\n  _optimizedFunctionEntryOfValue(value: Value): AdditionalFunctionEntry | void {\n    let realm = this.realm;\n    // if we conditionally called __optimize, we may have an AbstractValue that is the union of Empty or Undefined and\n    // a function/component to optimize\n    if (value instanceof AbstractValue) {\n      value = this._unwrapAbstract(value);\n    }\n    invariant(value instanceof ObjectValue);\n    // React component tree logic\n    let config = Get(realm, value, \"config\");\n    let rootComponent = Get(realm, value, \"rootComponent\");\n    let validConfig = config instanceof ObjectValue || config === realm.intrinsics.undefined;\n    let validRootComponent =\n      rootComponent instanceof ECMAScriptSourceFunctionValue ||\n      rootComponent instanceof BoundFunctionValue ||\n      (rootComponent instanceof AbstractValue && valueIsKnownReactAbstraction(this.realm, rootComponent));\n\n    if (validConfig && validRootComponent) {\n      return {\n        value: ((rootComponent: any): AbstractValue | ECMAScriptSourceFunctionValue),\n        config: convertConfigObjectToReactComponentTreeConfig(realm, ((config: any): ObjectValue | UndefinedValue)),\n      };\n    }\n\n    let location = optionalStringOfLocation(value.expressionLocation);\n    let result = realm.handleError(\n      new CompilerDiagnostic(\n        `Optimized Function Value ${location} is an not a function or react element`,\n        realm.currentLocation,\n        \"PP0033\",\n        \"Warning\"\n      )\n    );\n    // Here we can recover by ignoring the __optimize call and emit correct code\n    if (result !== \"Recover\") throw new FatalError(\"Optimized Function Values must be functions or react elements\");\n  }\n\n  _generateInitialAdditionalFunctions(globalKey: string): Array<AdditionalFunctionEntry> {\n    let recordedAdditionalFunctions: Array<AdditionalFunctionEntry> = [];\n    let realm = this.realm;\n    let globalRecordedAdditionalFunctionsMap = this.moduleTracer.modules.logger.tryQuery(\n      () => Get(realm, realm.$GlobalObject, globalKey),\n      realm.intrinsics.undefined\n    );\n    invariant(globalRecordedAdditionalFunctionsMap instanceof ObjectValue);\n    for (let funcId of Properties.GetOwnPropertyKeysArray(realm, globalRecordedAdditionalFunctionsMap, true, false)) {\n      let property = globalRecordedAdditionalFunctionsMap.properties.get(funcId);\n      if (property) {\n        invariant(property.descriptor instanceof PropertyDescriptor);\n        let value = property.descriptor.value;\n        invariant(value !== undefined);\n        let entry = this._optimizedFunctionEntryOfValue(value);\n        if (entry) recordedAdditionalFunctions.push(entry);\n      }\n    }\n    return recordedAdditionalFunctions;\n  }\n\n  _generateOptimizedFunctionsFromRealm(): Array<AdditionalFunctionEntry> {\n    let realm = this.realm;\n    let recordedAdditionalFunctions = [];\n    for (let [valueToOptimize, argModel] of realm.optimizedFunctions) {\n      let value = valueToOptimize instanceof AbstractValue ? this._unwrapAbstract(valueToOptimize) : valueToOptimize;\n      invariant(value instanceof ECMAScriptSourceFunctionValue);\n      // Check for case where __optimize was called in speculative context where effects were discarded\n      if (!value.isValid()) {\n        let error = new CompilerDiagnostic(\n          \"Called __optimize on function in failed speculative context\",\n          value.expressionLocation,\n          \"PP1008\",\n          \"RecoverableError\"\n        );\n        if (realm.handleError(error) !== \"Recover\") throw new FatalError();\n      } else {\n        recordedAdditionalFunctions.push({ value, argModel });\n      }\n    }\n    return recordedAdditionalFunctions;\n  }\n\n  optimizeReactComponentTreeRoots(statistics: ReactStatistics): void {\n    let logger = this.moduleTracer.modules.logger;\n    let recordedReactRootValues = this._generateInitialAdditionalFunctions(\"__reactComponentTrees\");\n    // Get write effects of the components\n    if (this.realm.react.verbose) {\n      logger.logInformation(`Evaluating ${recordedReactRootValues.length} React component tree roots...`);\n    }\n    let alreadyEvaluated = new Map();\n    for (let { value: componentRoot, config } of recordedReactRootValues) {\n      invariant(config);\n      optimizeReactComponentTreeRoot(\n        this.realm,\n        componentRoot,\n        config,\n        this._writeEffects,\n        logger,\n        statistics,\n        alreadyEvaluated,\n        this.reactFunctionMap\n      );\n    }\n  }\n\n  // Note: this may only be used by nested optimized functions that are known to be evaluated inside of their parent\n  // optimized function's __optimize call (e.g. array.map/filter). In this case, lexical nesting is equivalent to the\n  // nesting of __optimize calls.\n  getDeclaringOptimizedFunction(functionValue: ECMAScriptSourceFunctionValue): void | FunctionValue {\n    for (let [optimizedFunctionValue, additionalEffects] of this._writeEffects) {\n      // CreatedObjects is all objects created by this optimized function but not\n      // nested optimized functions.\n      let createdObjects = additionalEffects.effects.createdObjects;\n      if (createdObjects.has(functionValue)) return optimizedFunctionValue;\n    }\n  }\n\n  processCollectedNestedOptimizedFunctions(): void {\n    for (let [functionValue, effects] of this.realm.collectedNestedOptimizedFunctionEffects) {\n      let additionalFunctionEffects = createAdditionalEffects(\n        this.realm,\n        effects,\n        true,\n        \"AdditionalFunctionEffects\",\n        functionValue,\n        this.getDeclaringOptimizedFunction(functionValue)\n      );\n      invariant(additionalFunctionEffects !== null);\n      this._writeEffects.set(functionValue, additionalFunctionEffects);\n    }\n  }\n\n  _withEmptyOptimizedFunctionList(\n    { value, argModel }: AdditionalFunctionEntry,\n    func: (ECMAScriptSourceFunctionValue, ArgModel | void) => void\n  ): void {\n    let oldRealmOptimizedFunctions = this.realm.optimizedFunctions;\n    this.realm.optimizedFunctions = new Map();\n    let currentOptimizedFunctionId = this._optimizedFunctionId++;\n    invariant(value instanceof ECMAScriptSourceFunctionValue);\n    for (let t1 of this.realm.tracers) t1.beginOptimizingFunction(currentOptimizedFunctionId, value);\n    this.realm.withNewOptimizedFunction(() => func(value, argModel), value);\n    for (let t2 of this.realm.tracers) t2.endOptimizingFunction(currentOptimizedFunctionId);\n    for (let [oldValue, model] of oldRealmOptimizedFunctions) this.realm.optimizedFunctions.set(oldValue, model);\n  }\n\n  checkThatFunctionsAreIndependent(): void {\n    let additionalFunctionsToProcess = this._generateOptimizedFunctionsFromRealm();\n    // When we find declarations of nested optimized functions, we need to apply the parent\n    // effects.\n    let additionalFunctionStack = [];\n    let additionalFunctions = new Set(additionalFunctionsToProcess.map(entry => entry.value));\n\n    let recordWriteEffectsForOptimizedFunctionAndNestedFunctions = (\n      functionValue: ECMAScriptSourceFunctionValue,\n      argModel: ArgModel | void\n    ) => {\n      additionalFunctionStack.push(functionValue);\n      let call = Utils.createModelledFunctionCall(this.realm, functionValue, argModel);\n      let realm = this.realm;\n\n      let logCompilerDiagnostic = (msg: string, location: ?BabelNodeSourceLocation) => {\n        let error = new CompilerDiagnostic(msg, location, \"PP1007\", \"Warning\");\n        realm.handleError(error);\n      };\n      const functionCall = () =>\n        realm.evaluateFunctionForPureEffectsInGlobalEnv(\n          functionValue,\n          call,\n          (sideEffectType, binding, expressionLocation) =>\n            handleReportedSideEffect(logCompilerDiagnostic, sideEffectType, binding, expressionLocation),\n          undefined,\n          \"additional function\"\n        );\n      let effects: Effects = realm.isInPureScope() ? functionCall() : realm.evaluateWithPureScope(functionCall);\n      invariant(effects);\n      let additionalFunctionEffects = createAdditionalEffects(\n        this.realm,\n        effects,\n        true,\n        \"AdditionalFunctionEffects\",\n        functionValue,\n        this.getDeclaringOptimizedFunction(functionValue)\n      );\n      invariant(additionalFunctionEffects);\n      effects = additionalFunctionEffects.effects;\n      if (this._writeEffects.has(functionValue)) {\n        let error = new CompilerDiagnostic(\n          \"Trying to optimize a function with two parent optimized functions, which is not currently allowed.\",\n          functionValue.expressionLocation,\n          \"PP1009\",\n          \"RecoverableError\"\n        );\n        // we can recover by assuming one set of effects to show further diagnostics\n        if (realm.handleError(error) !== \"Recover\") throw new FatalError();\n      } else {\n        this._writeEffects.set(functionValue, additionalFunctionEffects);\n      }\n\n      // Conceptually this will ensure that the nested additional function is defined\n      // although for later cases, we'll apply the effects of the parents only.\n      this.realm.withEffectsAppliedInGlobalEnv(() => {\n        let newOptFuncs = this._generateOptimizedFunctionsFromRealm();\n        for (let newEntry of newOptFuncs) {\n          additionalFunctions.add(newEntry.value);\n          this._withEmptyOptimizedFunctionList(newEntry, recordWriteEffectsForOptimizedFunctionAndNestedFunctions);\n        }\n        // Now we have to remember the stack of effects that need to be applied to deal with\n        // this additional function.\n        return null;\n      }, additionalFunctionEffects.effects);\n      invariant(additionalFunctionStack.pop() === functionValue);\n    };\n\n    for (let funcObject of additionalFunctionsToProcess) {\n      this._withEmptyOptimizedFunctionList(funcObject, recordWriteEffectsForOptimizedFunctionAndNestedFunctions);\n    }\n    invariant(additionalFunctionStack.length === 0);\n\n    // check that functions are independent\n    let conflicts: Map<BabelNodeSourceLocation, CompilerDiagnostic> = new Map();\n    let isParentOf = (possibleParent, fun) => {\n      if (fun === undefined) return false;\n      let effects = this._writeEffects.get(fun);\n      invariant(effects !== undefined);\n      if (effects.parentAdditionalFunction !== undefined) {\n        if (effects.parentAdditionalFunction === possibleParent) return true;\n        return isParentOf(possibleParent, effects.parentAdditionalFunction);\n      }\n      return false;\n    };\n    for (let fun1 of additionalFunctions) {\n      invariant(fun1 instanceof FunctionValue);\n      let fun1Location = fun1.expressionLocation;\n      let fun1Name = fun1.getDebugName() || optionalStringOfLocation(fun1Location);\n      // Also do argument validation here\n      let additionalFunctionEffects = this._writeEffects.get(fun1);\n      invariant(additionalFunctionEffects !== undefined);\n      let e1 = additionalFunctionEffects.effects;\n      invariant(e1 !== undefined);\n      if (e1.result instanceof AbruptCompletion) {\n        let error = new CompilerDiagnostic(\n          `Additional function ${fun1Name} will terminate abruptly`,\n          e1.result.location,\n          \"PP1002\",\n          \"RecoverableError\"\n        );\n        // We generate correct code in this case, but the user probably doesn't want us to emit an unconditional throw\n        if (this.realm.handleError(error) !== \"Recover\") throw new FatalError();\n      }\n      for (let fun2 of additionalFunctions) {\n        if (fun1 === fun2) continue;\n        invariant(fun2 instanceof FunctionValue);\n        let fun2Location = fun2.expressionLocation;\n        let fun2Name = fun2.getDebugName() || optionalStringOfLocation(fun2Location);\n        let reportFn = () => {\n          this.reportWriteConflicts(\n            fun1Name,\n            fun2Name,\n            conflicts,\n            e1.modifiedProperties,\n            isParentOf(fun1, fun2),\n            Utils.createModelledFunctionCall(this.realm, fun2)\n          );\n          return null;\n        };\n        // Recursively apply all parent effects\n        let withPossibleParentEffectsApplied = (toExecute, optimizedFunction) => {\n          let funEffects = this._writeEffects.get(optimizedFunction);\n          invariant(funEffects !== undefined);\n          let parentAdditionalFunction = funEffects.parentAdditionalFunction;\n          if (parentAdditionalFunction !== undefined) {\n            let parentEffects = this._writeEffects.get(parentAdditionalFunction);\n            invariant(parentEffects !== undefined);\n            let newToExecute = () => this.realm.withEffectsAppliedInGlobalEnv(toExecute, parentEffects.effects);\n            withPossibleParentEffectsApplied(newToExecute, parentAdditionalFunction);\n          } else {\n            toExecute();\n          }\n        };\n        withPossibleParentEffectsApplied(reportFn, fun2);\n      }\n    }\n    if (conflicts.size > 0) {\n      for (let diagnostic of conflicts.values())\n        if (this.realm.handleError(diagnostic) !== \"Recover\") throw new FatalError();\n    }\n  }\n\n  getAdditionalFunctionValuesToEffects(): Map<FunctionValue, AdditionalFunctionEffects> {\n    return this._writeEffects;\n  }\n\n  reportWriteConflicts(\n    f1name: string,\n    f2name: string,\n    conflicts: Map<BabelNodeSourceLocation, CompilerDiagnostic>,\n    pbs: PropertyBindings,\n    f1IsParentOfF2: boolean,\n    call2: void => Value\n  ): void {\n    let reportConflict = (\n      location: BabelNodeSourceLocation,\n      object: string = \"\",\n      key?: string,\n      originalLocation: BabelNodeSourceLocation | void | null\n    ) => {\n      let firstLocationString = optionalStringOfLocation(originalLocation);\n      let secondLocationString = optionalStringOfLocation(location);\n      let propString = key ? ` \"${key}\"` : \"\";\n      let objectString = object ? ` on object \"${object}\" ` : \"\";\n      if (!objectString && key) objectString = \" on <unnamed object> \";\n      let error = new CompilerDiagnostic(\n        `Write to property${propString}${objectString}at optimized function ${f1name}${firstLocationString} conflicts with access in function ${f2name}${secondLocationString}`,\n        location,\n        \"PP1003\",\n        \"RecoverableError\"\n      );\n      conflicts.set(location, error);\n    };\n    let writtenObjects: Set<ObjectValue | AbstractObjectValue> = new Set();\n    pbs.forEach((val, key, m) => {\n      writtenObjects.add(key.object);\n    });\n    let oldReportObjectGetOwnProperties = this.realm.reportObjectGetOwnProperties;\n    this.realm.reportObjectGetOwnProperties = (ob: ObjectValue | AbstractObjectValue) => {\n      let location = this.realm.currentLocation;\n      invariant(location);\n      if (writtenObjects.has(ob) && !conflicts.has(location))\n        reportConflict(location, ob.getDebugName(), undefined, ob.expressionLocation);\n    };\n    let oldReportPropertyAccess = this.realm.reportPropertyAccess;\n    this.realm.reportPropertyAccess = (pb: PropertyBinding, isWrite: boolean) => {\n      if (ObjectValue.refuseSerializationOnPropertyBinding(pb)) return;\n      let location = this.realm.currentLocation;\n      if (!location) return; // happens only when accessing an additional function property\n      if (pbs.has(pb) && (!f1IsParentOfF2 || isWrite) && !conflicts.has(location)) {\n        let originalLocation =\n          pb.descriptor instanceof PropertyDescriptor && pb.descriptor.value && !Array.isArray(pb.descriptor.value)\n            ? pb.descriptor.value.expressionLocation\n            : undefined;\n        let keyString = pb.key instanceof Value ? pb.key.toDisplayString() : pb.key;\n        reportConflict(location, pb.object ? pb.object.getDebugName() : undefined, keyString, originalLocation);\n      }\n    };\n    try {\n      ignoreErrorsIn(this.realm, () => this.realm.evaluateForEffectsInGlobalEnv(call2));\n    } finally {\n      this.realm.reportPropertyAccess = oldReportPropertyAccess;\n      this.realm.reportObjectGetOwnProperties = oldReportObjectGetOwnProperties;\n    }\n  }\n}\n"
  },
  {
    "path": "src/serializer/index.js",
    "content": "/**\n * Copyright (c) 2017-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n/* @flow strict-local */\n\nimport { Serializer } from \"./serializer.js\";\nexport default Serializer;\n"
  },
  {
    "path": "src/serializer/serializer.js",
    "content": "/**\n * Copyright (c) 2017-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n/* @flow */\n\nimport { Realm, ExecutionContext } from \"../realm.js\";\nimport { CompilerDiagnostic, FatalError } from \"../errors.js\";\nimport { SourceFileCollection } from \"../types.js\";\nimport { AbruptCompletion } from \"../completions.js\";\nimport { Generator } from \"../utils/generator.js\";\nimport generate from \"@babel/generator\";\nimport traverseFast from \"../utils/traverse-fast.js\";\nimport invariant from \"../invariant.js\";\nimport type { SerializerOptions } from \"../options.js\";\nimport { SerializerStatistics } from \"./statistics.js\";\nimport { type SerializedResult, ReactStatistics } from \"./types.js\";\nimport { Functions } from \"./functions.js\";\nimport { Logger } from \"../utils/logger.js\";\nimport { Modules } from \"../utils/modules.js\";\nimport { stripFlowTypeAnnotations } from \"../utils/flow.js\";\nimport { LoggingTracer } from \"./LoggingTracer.js\";\nimport { ResidualHeapVisitor } from \"./ResidualHeapVisitor.js\";\nimport { ResidualHeapSerializer } from \"./ResidualHeapSerializer.js\";\nimport { ResidualHeapValueIdentifiers } from \"./ResidualHeapValueIdentifiers.js\";\nimport { LazyObjectsSerializer } from \"./LazyObjectsSerializer.js\";\nimport * as t from \"@babel/types\";\nimport type { BabelNodeFile } from \"@babel/types\";\nimport { ResidualHeapRefCounter } from \"./ResidualHeapRefCounter\";\nimport { ResidualHeapGraphGenerator } from \"./ResidualHeapGraphGenerator\";\nimport { Referentializer } from \"./Referentializer.js\";\nimport { Get } from \"../methods/index.js\";\nimport { ObjectValue, Value, FunctionValue } from \"../values/index.js\";\nimport { Properties } from \"../singletons.js\";\nimport { PropertyDescriptor } from \"../descriptors.js\";\nimport { ResidualOptimizedFunctions } from \"./ResidualOptimizedFunctions\";\n\nexport class Serializer {\n  constructor(realm: Realm, serializerOptions: SerializerOptions = {}) {\n    invariant(realm.useAbstractInterpretation);\n    // Start tracking mutations\n    realm.generator = new Generator(realm, \"main\", realm.pathConditions);\n\n    this.realm = realm;\n    this.logger = new Logger(this.realm, !!serializerOptions.internalDebug);\n    this.modules = new Modules(this.realm, this.logger, !!serializerOptions.logModules);\n    this.functions = new Functions(this.realm, this.modules.moduleTracer);\n    if (serializerOptions.trace) {\n      let loggingTracer = new LoggingTracer(this.realm);\n      this.realm.tracers.push(loggingTracer);\n    }\n\n    this.options = serializerOptions;\n  }\n\n  realm: Realm;\n  functions: Functions;\n  logger: Logger;\n  modules: Modules;\n  options: SerializerOptions;\n\n  _execute(\n    sourceFileCollection: SourceFileCollection,\n    sourceMaps?: boolean = false,\n    onParse?: BabelNodeFile => void\n  ): { [string]: string } {\n    let realm = this.realm;\n    let [res, code] = realm.$GlobalEnv.executeSources(sourceFileCollection.toArray(), \"script\", ast => {\n      let realmPreludeGenerator = realm.preludeGenerator;\n      invariant(realmPreludeGenerator);\n      let forbiddenNames = realmPreludeGenerator.nameGenerator.forbiddenNames;\n      traverseFast(ast, node => {\n        if (!t.isIdentifier(node)) return false;\n\n        forbiddenNames.add(((node: any): BabelNodeIdentifier).name);\n        return true;\n      });\n      if (onParse) onParse(ast);\n    });\n\n    // Release memory of source files and their source maps\n    sourceFileCollection.destroy();\n\n    if (res instanceof AbruptCompletion) {\n      let context = new ExecutionContext();\n      realm.pushContext(context);\n      try {\n        this.logger.logCompletion(res);\n      } finally {\n        realm.popContext(context);\n      }\n      let diagnostic = new CompilerDiagnostic(\"Global code may end abruptly\", res.location, \"PP0016\", \"FatalError\");\n      realm.handleError(diagnostic);\n      throw new FatalError();\n    }\n    return code;\n  }\n\n  // When global.__output is an object, then this function replaces the global generator\n  // with one that declares global variables corresponding to the key-value pairs in the __output object,\n  // effectively rewriting the roots for visiting/serialization.\n  processOutputEntries(): boolean {\n    let realm = this.realm;\n    let output = this.logger.tryQuery(() => Get(realm, realm.$GlobalObject, \"__output\"), realm.intrinsics.undefined);\n    if (!(output instanceof ObjectValue)) return false;\n    let generator = realm.generator;\n    let preludeGenerator = realm.preludeGenerator;\n    if (generator === undefined || preludeGenerator === undefined) return false;\n    generator._entries.length = 0;\n    preludeGenerator.declaredGlobals.clear();\n    for (let name of Properties.GetOwnPropertyKeysArray(realm, output, false, false)) {\n      let property = output.properties.get(name);\n      if (!property) continue;\n      let value = property.descriptor instanceof PropertyDescriptor && property.descriptor.value;\n      if (!(value instanceof Value)) continue;\n      generator.emitGlobalDeclaration(name, value);\n    }\n    return true;\n  }\n\n  init(\n    sourceFileCollection: SourceFileCollection,\n    sourceMaps?: boolean = false,\n    onParse?: BabelNodeFile => void,\n    onExecute?: (Realm, Map<FunctionValue, Generator>) => void\n  ): void | SerializedResult {\n    let realmStatistics = this.realm.statistics;\n    invariant(realmStatistics instanceof SerializerStatistics, \"serialization requires SerializerStatistics\");\n    let statistics: SerializerStatistics = realmStatistics;\n\n    let result = statistics.total.measure(() => {\n      // Phase 1: Let's interpret.\n      if (this.realm.react.verbose) {\n        this.logger.logInformation(`Evaluating initialization path...`);\n      }\n\n      let code = this._execute(sourceFileCollection, sourceMaps, onParse);\n\n      if (this.logger.hasErrors()) return undefined;\n\n      if (!this.processOutputEntries()) {\n        statistics.resolveInitializedModules.measure(() => this.modules.resolveInitializedModules());\n      }\n\n      statistics.checkThatFunctionsAreIndependent.measure(() => this.functions.checkThatFunctionsAreIndependent());\n\n      let reactStatistics;\n      if (this.realm.react.enabled) {\n        statistics.optimizeReactComponentTreeRoots.measure(() => {\n          reactStatistics = new ReactStatistics();\n          this.functions.optimizeReactComponentTreeRoots(reactStatistics);\n        });\n      }\n\n      statistics.processCollectedNestedOptimizedFunctions.measure(() =>\n        this.functions.processCollectedNestedOptimizedFunctions()\n      );\n\n      statistics.dumpIR.measure(() => {\n        if (onExecute !== undefined) {\n          let optimizedFunctions = new Map();\n          for (let [functionValue, additionalFunctionEffects] of this.functions.getAdditionalFunctionValuesToEffects())\n            optimizedFunctions.set(functionValue, additionalFunctionEffects.generator);\n          onExecute(this.realm, optimizedFunctions);\n        }\n      });\n\n      let modulesToInitialize = this.options.modulesToInitialize;\n      if (modulesToInitialize) {\n        statistics.modulesToInitialize.measure(() => this.modules.initializeMoreModules(modulesToInitialize));\n        if (this.logger.hasErrors()) return undefined;\n      }\n\n      let moduleFactoryFunctionsToRemove = this.realm.moduleFactoryFunctionsToRemove;\n      for (let [functionId, moduleIdOfFunction] of this.realm.moduleFactoryFunctionsToRemove) {\n        if (!this.modules.initializedModules.has(moduleIdOfFunction)) moduleFactoryFunctionsToRemove.delete(functionId);\n      }\n\n      let heapGraph;\n      let ast = (() => {\n        // We wrap the following in an anonymous function declaration to ensure\n        // that all local variables are locally scoped, and allocated memory cannot\n        // get released when this function returns.\n\n        let additionalFunctionValuesAndEffects = this.functions.getAdditionalFunctionValuesToEffects();\n\n        // Deep traversal of the heap to identify the necessary scope of residual functions\n        let preludeGenerator = this.realm.preludeGenerator;\n        invariant(preludeGenerator !== undefined);\n        if (this.realm.react.verbose) {\n          this.logger.logInformation(`Visiting evaluated nodes...`);\n        }\n        let [residualHeapInfo, generatorTree, inspector] = (() => {\n          let residualHeapVisitor = new ResidualHeapVisitor(\n            this.realm,\n            this.logger,\n            this.modules,\n            additionalFunctionValuesAndEffects\n          );\n          statistics.deepTraversal.measure(() => residualHeapVisitor.visitRoots());\n          return [residualHeapVisitor.toInfo(), residualHeapVisitor.generatorTree, residualHeapVisitor.inspector];\n        })();\n        if (this.logger.hasErrors()) return undefined;\n\n        let residualOptimizedFunctions = new ResidualOptimizedFunctions(\n          generatorTree,\n          additionalFunctionValuesAndEffects,\n          residualHeapInfo.values\n        );\n        let referentializer = new Referentializer(\n          this.realm,\n          this.options,\n          preludeGenerator.createNameGenerator(\"__scope_\"),\n          preludeGenerator.createNameGenerator(\"__get_scope_binding_\"),\n          preludeGenerator.createNameGenerator(\"__leaked_\"),\n          residualOptimizedFunctions\n        );\n        statistics.referentialization.measure(() => {\n          for (let instance of residualHeapInfo.functionInstances.values()) referentializer.referentialize(instance);\n        });\n\n        if (this.realm.react.verbose) {\n          this.logger.logInformation(`Serializing evaluated nodes...`);\n        }\n        const realmPreludeGenerator = this.realm.preludeGenerator;\n        invariant(realmPreludeGenerator);\n        const residualHeapValueIdentifiers = new ResidualHeapValueIdentifiers(\n          residualHeapInfo.values.keys(),\n          realmPreludeGenerator\n        );\n\n        if (this.options.heapGraphFormat) {\n          const heapRefCounter = new ResidualHeapRefCounter(\n            this.realm,\n            this.logger,\n            this.modules,\n            additionalFunctionValuesAndEffects\n          );\n          heapRefCounter.visitRoots();\n\n          const heapGraphGenerator = new ResidualHeapGraphGenerator(\n            this.realm,\n            this.logger,\n            this.modules,\n            additionalFunctionValuesAndEffects,\n            residualHeapValueIdentifiers,\n            heapRefCounter.getResult()\n          );\n          heapGraphGenerator.visitRoots();\n          invariant(this.options.heapGraphFormat);\n          heapGraph = heapGraphGenerator.generateResult(this.options.heapGraphFormat);\n        }\n\n        // Phase 2: Let's serialize the heap and generate code.\n        // Serialize for the first time in order to gather reference counts\n\n        if (this.options.inlineExpressions) {\n          residualHeapValueIdentifiers.initPass1();\n          statistics.referenceCounts.measure(() => {\n            new ResidualHeapSerializer(\n              this.realm,\n              this.logger,\n              this.modules,\n              residualHeapValueIdentifiers,\n              inspector,\n              residualHeapInfo,\n              this.options,\n              additionalFunctionValuesAndEffects,\n              referentializer,\n              generatorTree,\n              residualOptimizedFunctions\n            ).serialize();\n          });\n          if (this.logger.hasErrors()) return undefined;\n          residualHeapValueIdentifiers.initPass2();\n        }\n\n        // Serialize for a second time, using reference counts to minimize number of generated identifiers\n        const TargetSerializer =\n          this.options.lazyObjectsRuntime != null ? LazyObjectsSerializer : ResidualHeapSerializer;\n        statistics.resetBeforePass();\n        return statistics.serializePass.measure(() =>\n          new TargetSerializer(\n            this.realm,\n            this.logger,\n            this.modules,\n            residualHeapValueIdentifiers,\n            inspector,\n            residualHeapInfo,\n            this.options,\n            additionalFunctionValuesAndEffects,\n            referentializer,\n            generatorTree,\n            residualOptimizedFunctions\n          ).serialize()\n        );\n      })();\n\n      invariant(ast !== undefined);\n      if (this.realm.stripFlow) {\n        stripFlowTypeAnnotations(ast);\n      }\n\n      // the signature for generate is not complete, hence the any\n      let generated = statistics.babelGenerate.measure(() => generate(ast, { sourceMaps: sourceMaps }, (code: any)));\n\n      invariant(!this.logger.hasErrors());\n      return {\n        code: generated.code,\n        map: generated.map,\n        statistics,\n        reactStatistics,\n        heapGraph,\n      };\n    });\n\n    if (this.options.logStatistics) {\n      statistics.log();\n      statistics.logSerializerPerformanceTrackers(\n        \"time statistics\",\n        statistics.forcingGC\n          ? \"Time statistics are skewed because of forced garbage collections; remove --expose-gc flag from node.js invocation to disable forced garbage collections.\"\n          : undefined,\n        pf => `${pf.time}ms`\n      );\n      statistics.logSerializerPerformanceTrackers(\n        \"memory statistics\",\n        statistics.forcingGC\n          ? undefined\n          : \"Memory statistics are unreliable because garbage collections could not be forced; pass --expose-gc to node.js to enable forced garbage collections.\",\n        pf => `${pf.memory > 0 ? \"+\" : \"\"}${Math.round(pf.memory / 1024 / 1024)}MB`\n      );\n    }\n\n    return result;\n  }\n}\n"
  },
  {
    "path": "src/serializer/statistics.js",
    "content": "/**\n * Copyright (c) 2017-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n/* @flow strict-local */\n\nimport { RealmStatistics, PerformanceTracker } from \"../statistics.js\";\n\nexport class SerializerStatistics extends RealmStatistics {\n  constructor(getTime: void | (() => number), getMemory: void | (() => number), forcingGC: boolean = false) {\n    super(getTime, getMemory);\n    this.forcingGC = forcingGC;\n\n    this.functions = 0;\n    this.delayedValues = 0;\n    this.initializedModules = 0;\n    this.acceleratedModules = 0;\n    this.delayedModules = 0;\n    this.totalModules = 0;\n    this.resetBeforePass();\n\n    this.total = new PerformanceTracker(getTime, getMemory);\n    this.resolveInitializedModules = new PerformanceTracker(getTime, getMemory);\n    this.modulesToInitialize = new PerformanceTracker(getTime, getMemory);\n    this.optimizeReactComponentTreeRoots = new PerformanceTracker(getTime, getMemory);\n    this.checkThatFunctionsAreIndependent = new PerformanceTracker(getTime, getMemory);\n    this.processCollectedNestedOptimizedFunctions = new PerformanceTracker(getTime, getMemory);\n    this.deepTraversal = new PerformanceTracker(getTime, getMemory);\n    this.referentialization = new PerformanceTracker(getTime, getMemory);\n    this.referenceCounts = new PerformanceTracker(getTime, getMemory);\n    this.serializePass = new PerformanceTracker(getTime, getMemory);\n    this.babelGenerate = new PerformanceTracker(getTime, getMemory);\n    this.dumpIR = new PerformanceTracker(getTime, getMemory);\n  }\n\n  resetBeforePass(): void {\n    this.objects = 0;\n    this.objectProperties = 0;\n    this.functionClones = 0;\n    this.lazyObjects = 0;\n    this.referentialized = 0;\n    this.valueIds = 0;\n    this.valuesInlined = 0;\n    this.generators = 0;\n    this.requireCalls = 0;\n    this.requireCallsReplaced = 0;\n  }\n\n  forcingGC: boolean;\n\n  objects: number;\n  objectProperties: number;\n  functions: number;\n  functionClones: number;\n  lazyObjects: number;\n  referentialized: number;\n  valueIds: number;\n  valuesInlined: number;\n  delayedValues: number;\n  initializedModules: number;\n  acceleratedModules: number;\n  delayedModules: number;\n  totalModules: number;\n  generators: number;\n  requireCalls: number;\n  requireCallsReplaced: number;\n\n  // legacy projection\n  getSerializerStatistics() {\n    return {\n      objects: this.objects,\n      objectProperties: this.objectProperties,\n      functions: this.functions,\n      functionClones: this.functionClones,\n      lazyObjects: this.lazyObjects,\n      referentialized: this.referentialized,\n      valueIds: this.valueIds,\n      valuesInlined: this.valuesInlined,\n      delayedValues: this.delayedValues,\n      initializedModules: this.initializedModules,\n      acceleratedModules: this.acceleratedModules,\n      delayedModules: this.delayedModules,\n      totalModules: this.totalModules,\n      generators: this.generators,\n      requireCalls: this.requireCalls,\n      requireCallsReplaced: this.requireCallsReplaced,\n    };\n  }\n\n  total: PerformanceTracker;\n  resolveInitializedModules: PerformanceTracker;\n  modulesToInitialize: PerformanceTracker;\n  optimizeReactComponentTreeRoots: PerformanceTracker;\n  checkThatFunctionsAreIndependent: PerformanceTracker;\n  processCollectedNestedOptimizedFunctions: PerformanceTracker;\n  deepTraversal: PerformanceTracker;\n  referenceCounts: PerformanceTracker;\n  referentialization: PerformanceTracker;\n  serializePass: PerformanceTracker;\n  babelGenerate: PerformanceTracker;\n  dumpIR: PerformanceTracker;\n\n  log(): void {\n    super.log();\n    console.log(`=== serialization statistics`);\n    console.log(`${this.objects} objects with ${this.objectProperties} properties`);\n    console.log(\n      `${this.functions} functions plus ${this.functionClones} clones due to captured variables; ${\n        this.referentialized\n      } captured mutable variables`\n    );\n    console.log(`${this.lazyObjects} objects are lazy.`);\n    console.log(\n      `${this.valueIds} eager and ${this.delayedValues} delayed value ids generated, and ${\n        this.valuesInlined\n      } values inlined.`\n    );\n    console.log(\n      `${this.initializedModules} out of ${this.totalModules} modules initialized, with ${\n        this.acceleratedModules\n      } accelerated and ${this.delayedModules} delayed.`\n    );\n    console.log(`${this.requireCallsReplaced} of ${this.requireCalls} require calls inlined.`);\n    console.log(`${this.generators} generators`);\n  }\n\n  logSerializerPerformanceTrackers(title: string, note: void | string, format: PerformanceTracker => string): void {\n    console.log(`=== ${title}: ${format(this.total)} total`);\n    if (note !== undefined) console.log(`NOTE: ${note}`);\n    this.logPerformanceTrackers(format);\n    console.log(\n      `${format(this.resolveInitializedModules)} resolving initialized modules, ${format(\n        this.modulesToInitialize\n      )} initializing more modules, ${format(\n        this.optimizeReactComponentTreeRoots\n      )} optimizing react component tree roots, ${format(\n        this.checkThatFunctionsAreIndependent\n      )} evaluating functions to optimize, ${format(this.dumpIR)} dumping IR`\n    );\n    console.log(\n      `${format(this.deepTraversal)} visiting residual heap, ${format(\n        this.referentialization\n      )} referentializing functions, ${format(this.referenceCounts)} reference counting, ${format(\n        this.serializePass\n      )} generating AST, ${format(this.babelGenerate)} generating source code`\n    );\n  }\n}\n"
  },
  {
    "path": "src/serializer/types.js",
    "content": "/**\n * Copyright (c) 2017-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n/* @flow strict-local */\n\nimport { DeclarativeEnvironmentRecord, type Binding } from \"../environment.js\";\nimport { AbstractValue, ConcreteValue, ObjectValue, Value } from \"../values/index.js\";\nimport type { ECMAScriptSourceFunctionValue, FunctionValue } from \"../values/index.js\";\nimport type {\n  BabelNodeExpression,\n  BabelNodeStatement,\n  BabelNodeMemberExpression,\n  BabelNodeBlockStatement,\n} from \"@babel/types\";\nimport { SameValue } from \"../methods/abstract.js\";\nimport { Realm, type Effects } from \"../realm.js\";\nimport invariant from \"../invariant.js\";\nimport type { Generator } from \"../utils/generator.js\";\nimport { type SerializerStatistics } from \"./statistics.js\";\n\nexport type TryQuery<T> = (f: () => T, defaultValue: T) => T;\n\nexport type SerializedBodyType =\n  | \"MainGenerator\"\n  | \"Generator\"\n  | \"OptimizedFunction\"\n  | \"DelayInitializations\"\n  | \"ConditionalAssignmentBranch\"\n  | \"LazyObjectInitializer\";\n\nexport type SerializedBody = {\n  type: SerializedBodyType,\n  entries: Array<BabelNodeStatement>,\n  done: boolean,\n  declaredValues?: Map<AbstractValue | ObjectValue, SerializedBody>,\n  parentBody?: SerializedBody,\n  nestingLevel?: number,\n  processing?: boolean,\n  optimizedFunction?: FunctionValue, // defined if any only if type is OptimizedFunction\n};\n\nexport type AdditionalFunctionTransform = (body: Array<BabelNodeStatement>) => void;\n\nexport type AdditionalFunctionEffects = {\n  // All of these effects must be applied for this additional function\n  // to be properly setup\n  parentAdditionalFunction: FunctionValue | void,\n  effects: Effects,\n  generator: Generator,\n  transforms: Array<AdditionalFunctionTransform>,\n  additionalRoots: Set<ObjectValue>,\n};\n\nexport type WriteEffects = Map<FunctionValue, AdditionalFunctionEffects>;\n\nexport type AdditionalFunctionInfo = {\n  functionValue: FunctionValue,\n  modifiedBindings: Map<Binding, ResidualFunctionBinding>,\n  instance: FunctionInstance,\n};\n\nexport type ClassMethodInstance = {|\n  classPrototype: ObjectValue,\n  methodType: \"constructor\" | \"method\" | \"get\" | \"set\",\n  classSuperNode: void | BabelNodeIdentifier,\n  classMethodIsStatic: boolean,\n  classMethodKeyNode: void | BabelNodeExpression,\n  classMethodComputed: boolean,\n|};\n\n// Each of these will correspond to a different preludeGenerator and thus will\n// have different values available for initialization. FunctionValues should\n// only be additional functions.\nexport type ReferentializationScope = FunctionValue | \"GLOBAL\";\n\nexport type FunctionInstance = {\n  residualFunctionBindings: Map<string, ResidualFunctionBinding>,\n  functionValue: ECMAScriptSourceFunctionValue,\n  insertionPoint?: BodyReference,\n  // Additional function that the function instance was declared inside of (if any)\n  containingAdditionalFunction?: FunctionValue,\n  scopeInstances: Map<string, ScopeBinding>,\n  initializationStatements: Array<BabelNodeStatement>,\n};\n\nexport type FunctionInfo = {\n  depth: number,\n  lexicalDepth: number,\n  unbound: Map<string, Array<BabelNodeIdentifier>>,\n  requireCalls: Map<BabelNode, number | string>,\n  modified: Set<string>,\n  usesArguments: boolean,\n  usesThis: boolean,\n};\n\nexport type LazilyHoistedNodes = {|\n  id: BabelNodeIdentifier,\n  createElementIdentifier: null | BabelNodeIdentifier,\n  nodes: Array<{ id: BabelNodeIdentifier, astNode: BabelNode }>,\n|};\n\nexport type FactoryFunctionInfo = {\n  factoryId: BabelNodeIdentifier,\n  functionInfo: FunctionInfo,\n  anyContainingAdditionalFunction: boolean,\n};\n\nexport type ResidualFunctionBinding = {\n  name: string,\n  value: void | Value,\n  modified: boolean,\n  hasLeaked: boolean,\n  // null means a global binding\n  declarativeEnvironmentRecord: null | DeclarativeEnvironmentRecord,\n  // The serializedValue is only not yet present during the initialization of a binding that involves recursive dependencies.\n  serializedValue?: void | BabelNodeExpression,\n  serializedUnscopedLocation?: void | BabelNodeIdentifier | BabelNodeMemberExpression,\n  referentialized?: boolean,\n  scope?: ScopeBinding,\n  // Which additional functions a binding is accessed by. (Determines what initializer\n  // to put the binding in -- global or additional function)\n  potentialReferentializationScopes: Set<ReferentializationScope>,\n  // If the binding is overwritten by an additional function, these contain the\n  // new values\n  // TODO #1087: make this a map and support arbitrary binding modifications\n  additionalFunctionOverridesValue?: FunctionValue,\n};\n\nexport type ScopeBinding = {\n  name: string,\n  id: number,\n  initializationValues: Array<BabelNodeExpression>,\n  leakedIds: Array<BabelNodeIdentifier>,\n  capturedScope?: string,\n  referentializationScope: ReferentializationScope,\n};\n\nexport function AreSameResidualBinding(realm: Realm, x: ResidualFunctionBinding, y: ResidualFunctionBinding): boolean {\n  if (x.serializedValue === y.serializedValue) return true;\n  if (x.value && x.value === y.value) return true;\n  if (x.value instanceof ConcreteValue && y.value instanceof ConcreteValue) {\n    return SameValue(realm, x.value, y.value);\n  }\n  return false;\n}\n\nexport class BodyReference {\n  constructor(body: SerializedBody, index: number) {\n    invariant(index >= 0);\n    this.body = body;\n    this.index = index;\n  }\n  isNotEarlierThan(other: BodyReference): boolean {\n    return this.body === other.body && this.index >= other.index;\n  }\n  body: SerializedBody;\n  index: number;\n}\n\nexport type ReactEvaluatedNode = {\n  children: Array<ReactEvaluatedNode>,\n  message: string,\n  name: string,\n  status:\n    | \"ROOT\"\n    | \"NEW_TREE\"\n    | \"INLINED\"\n    | \"BAIL-OUT\"\n    | \"FATAL\"\n    | \"UNKNOWN_TYPE\"\n    | \"RENDER_PROPS\"\n    | \"FORWARD_REF\"\n    | \"NORMAL\",\n};\n\nexport class ReactStatistics {\n  constructor() {\n    this.optimizedTrees = 0;\n    this.inlinedComponents = 0;\n    this.evaluatedRootNodes = [];\n    this.componentsEvaluated = 0;\n    this.optimizedNestedClosures = 0;\n  }\n  optimizedTrees: number;\n  inlinedComponents: number;\n  evaluatedRootNodes: Array<ReactEvaluatedNode>;\n  componentsEvaluated: number;\n  optimizedNestedClosures: number;\n}\n\nexport type LocationService = {\n  getContainingAdditionalFunction: FunctionValue => void | FunctionValue,\n  getLocation: Value => BabelNodeIdentifier,\n  createLocation: (void | FunctionValue) => BabelNodeIdentifier,\n  createFunction: (void | FunctionValue, Array<BabelNodeStatement>) => BabelNodeIdentifier,\n};\n\nexport type ObjectRefCount = {\n  inComing: number, // The number of objects that references this object.\n  outGoing: number, // The number of objects that are referenced by this object.\n};\n\nexport type SerializedResult = {\n  code: string,\n  map: void | SourceMap,\n  statistics?: SerializerStatistics,\n  reactStatistics?: ReactStatistics,\n  heapGraph?: string,\n  sourceFilePaths?: { sourceMaps: Array<string>, sourceFiles: Array<{ absolute: string, relative: string }> },\n};\n\nexport type Scope = FunctionValue | Generator;\n\nexport type ResidualHeapInfo = {\n  values: Map<Value, Set<Scope>>,\n  functionInstances: Map<FunctionValue, FunctionInstance>,\n  classMethodInstances: Map<FunctionValue, ClassMethodInstance>,\n  functionInfos: Map<BabelNodeBlockStatement, FunctionInfo>,\n  referencedDeclaredValues: Map<Value, void | FunctionValue>,\n  additionalFunctionValueInfos: Map<FunctionValue, AdditionalFunctionInfo>,\n  // Caches that ensure one ResidualFunctionBinding exists per (record, name) pair\n  declarativeEnvironmentRecordsBindings: Map<DeclarativeEnvironmentRecord, Map<string, ResidualFunctionBinding>>,\n  globalBindings: Map<string, ResidualFunctionBinding>,\n  // For every abstract value of kind \"conditional\", this map keeps track of whether the consequent and/or alternate is feasible in any scope\n  conditionalFeasibility: Map<AbstractValue, { t: boolean, f: boolean }>,\n  // Parents will always be a generator, optimized function value or \"GLOBAL\"\n  additionalGeneratorRoots: Map<Generator, Set<ObjectValue>>,\n};\n"
  },
  {
    "path": "src/serializer/utils.js",
    "content": "/**\n * Copyright (c) 2017-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n/* @flow */\n\nimport {\n  AbstractValue,\n  ECMAScriptSourceFunctionValue,\n  EmptyValue,\n  FunctionValue,\n  IntegralValue,\n  ObjectValue,\n  SymbolValue,\n} from \"../values/index.js\";\nimport type { Effects, Realm, SideEffectType } from \"../realm.js\";\n\nimport { FatalError } from \"../errors.js\";\nimport type { PropertyBinding, Descriptor } from \"../types.js\";\nimport invariant from \"../invariant.js\";\nimport { IsArray, IsArrayIndex } from \"../methods/index.js\";\nimport { Logger } from \"../utils/logger.js\";\nimport { Generator } from \"../utils/generator.js\";\nimport type { AdditionalFunctionEffects, AdditionalFunctionTransform } from \"./types\";\nimport type { Binding } from \"../environment.js\";\nimport type { BabelNodeSourceLocation } from \"@babel/types\";\nimport { optionalStringOfLocation } from \"../utils/babelhelpers.js\";\nimport { PropertyDescriptor } from \"../descriptors.js\";\n\n/**\n * Get index property list length by searching array properties list for the max index key value plus 1.\n * If tail elements are conditional, return the minimum length if an assignment to the length property\n * can be avoided because of that. The boolean part of the result is a flag that indicates if the latter is true.\n */\nexport function getSuggestedArrayLiteralLength(realm: Realm, val: ObjectValue): [number, boolean] {\n  invariant(IsArray(realm, val));\n  let instantRenderMode = realm.instantRender.enabled;\n  let minLength = 0,\n    maxLength = 0;\n  let actualLength;\n  for (const key of val.properties.keys()) {\n    if (IsArrayIndex(realm, key) && Number(key) >= maxLength) {\n      let prevMax = maxLength;\n      maxLength = Number(key) + 1;\n      let elem = val._SafeGetDataPropertyValue(key);\n      if (instantRenderMode || !elem.mightHaveBeenDeleted()) minLength = maxLength;\n      else if (elem instanceof AbstractValue && elem.kind === \"conditional\") {\n        let maxLengthVal = new IntegralValue(realm, maxLength);\n        let [c, x, y] = elem.args;\n        if (x instanceof EmptyValue && !y.mightHaveBeenDeleted()) {\n          let prevActual = actualLength === undefined ? new IntegralValue(realm, prevMax) : actualLength;\n          actualLength = AbstractValue.createFromConditionalOp(realm, c, prevActual, maxLengthVal);\n        } else if (y instanceof EmptyValue && !x.mightHaveBeenDeleted()) {\n          let prevActual = actualLength === undefined ? new IntegralValue(realm, prevMax) : actualLength;\n          actualLength = AbstractValue.createFromConditionalOp(realm, c, maxLengthVal, prevActual);\n        } else {\n          actualLength = undefined;\n        }\n      }\n    }\n  }\n  if (maxLength > minLength && actualLength instanceof AbstractValue) {\n    let lengthVal = val._SafeGetDataPropertyValue(\"length\");\n    if (lengthVal.equals(actualLength)) return [minLength, true];\n  }\n  return [maxLength, false];\n}\n\nexport function commonAncestorOf<T>(node1: void | T, node2: void | T, getParent: T => void | T): void | T {\n  if (node1 === node2) return node1;\n  // First get the path length to the root node for both nodes while also checking if\n  // either node is the parent of the other.\n  let n1 = node1,\n    n2 = node2,\n    count1 = 0,\n    count2 = 0;\n  while (true) {\n    let p1 = n1 && getParent(n1);\n    let p2 = n2 && getParent(n2);\n    if (p1 === node2) return node2;\n    if (p2 === node1) return node1;\n    if (p1 !== undefined) count1++;\n    if (p2 !== undefined) count2++;\n    if (p1 === undefined && p2 === undefined) break;\n    n1 = p1;\n    n2 = p2;\n  }\n  // Now shorten the longest path to the same length as the shorter path\n  n1 = node1;\n  while (count1 > count2) {\n    invariant(n1 !== undefined);\n    n1 = getParent(n1);\n    count1--;\n  }\n  n2 = node2;\n  while (count1 < count2) {\n    invariant(n2 !== undefined);\n    n2 = getParent(n2);\n    count2--;\n  }\n  // Now run up both paths in tandem, stopping at the first common entry\n  while (n1 !== n2) {\n    invariant(n1 !== undefined);\n    n1 = getParent(n1);\n    invariant(n2 !== undefined);\n    n2 = getParent(n2);\n  }\n  return n1;\n}\n\n// Gets map[key] with default value provided by defaultFn\nexport function getOrDefault<K, V>(map: Map<K, V>, key: K, defaultFn: () => V): V {\n  let value = map.get(key);\n  if (value === undefined) map.set(key, (value = defaultFn()));\n  invariant(value !== undefined);\n  return value;\n}\n\nexport function withDescriptorValue(\n  propertyNameOrSymbol: string | SymbolValue,\n  descriptor: void | Descriptor,\n  func: Function\n): void {\n  if (descriptor !== undefined) {\n    invariant(descriptor instanceof PropertyDescriptor); // TODO: Handle joined descriptors.\n    if (descriptor.value !== undefined) {\n      func(propertyNameOrSymbol, descriptor.value, \"value\");\n    } else {\n      if (descriptor.get !== undefined) {\n        func(propertyNameOrSymbol, descriptor.get, \"get\");\n      }\n      if (descriptor.set !== undefined) {\n        func(propertyNameOrSymbol, descriptor.set, \"set\");\n      }\n    }\n  }\n}\n\nexport const ClassPropertiesToIgnore: Set<string> = new Set([\"arguments\", \"name\", \"caller\"]);\n\nexport function canIgnoreClassLengthProperty(val: ObjectValue, desc: void | Descriptor, logger: Logger): boolean {\n  if (desc) {\n    if (desc instanceof PropertyDescriptor) {\n      if (desc.value === undefined) {\n        logger.logError(val, \"Functions with length accessor properties are not supported in residual heap.\");\n      }\n    } else {\n      logger.logError(\n        val,\n        \"Functions with length properties with different attributes are not supported in residual heap.\"\n      );\n    }\n  }\n  return true;\n}\n\nexport function getObjectPrototypeMetadata(\n  realm: Realm,\n  obj: ObjectValue\n): { skipPrototype: boolean, constructor: void | ECMAScriptSourceFunctionValue } {\n  let proto = obj.$Prototype;\n  let skipPrototype = false;\n  let constructor;\n\n  if (obj.$IsClassPrototype) {\n    skipPrototype = true;\n  }\n  if (proto && proto.$IsClassPrototype) {\n    invariant(proto instanceof ObjectValue);\n    // we now need to check if the prototpe has a constructor\n    let _constructor = proto.properties.get(\"constructor\");\n    if (_constructor !== undefined) {\n      // if the contructor has been deleted then we have no way\n      // to serialize the original class AST as it won't have been\n      // evluated and thus visited\n      if (_constructor.descriptor === undefined) {\n        throw new FatalError(\"TODO #1024: implement object prototype serialization with deleted constructor\");\n      }\n      if (!(_constructor.descriptor instanceof PropertyDescriptor)) {\n        throw new FatalError(\n          \"TODO #1024: implement object prototype serialization with multiple constructor attributes\"\n        );\n      }\n      let classFunc = _constructor.descriptor.value;\n      if (classFunc instanceof ECMAScriptSourceFunctionValue) {\n        constructor = classFunc;\n        skipPrototype = true;\n      }\n    }\n  }\n\n  return {\n    skipPrototype,\n    constructor,\n  };\n}\n\nexport function createAdditionalEffects(\n  realm: Realm,\n  effects: Effects,\n  fatalOnAbrupt: boolean,\n  name: string,\n  optimizedFunction: FunctionValue,\n  parentOptimizedFunction: FunctionValue | void,\n  transforms: Array<AdditionalFunctionTransform> = []\n): AdditionalFunctionEffects | null {\n  let generator = Generator.fromEffects(effects, realm, name, optimizedFunction);\n  let retValue: AdditionalFunctionEffects = {\n    parentAdditionalFunction: parentOptimizedFunction || undefined,\n    effects,\n    transforms,\n    generator,\n    additionalRoots: new Set(),\n  };\n  return retValue;\n}\n\nexport function handleReportedSideEffect(\n  exceptionHandler: (string, ?BabelNodeSourceLocation) => void,\n  sideEffectType: SideEffectType,\n  binding: void | Binding | PropertyBinding,\n  expressionLocation: ?BabelNodeSourceLocation\n): void {\n  // This causes an infinite recursion because creating a callstack causes internal-only side effects\n  if (binding && binding.object && binding.object.intrinsicName === \"__checkedBindings\") return;\n  let location = optionalStringOfLocation(expressionLocation);\n\n  if (sideEffectType === \"MODIFIED_BINDING\") {\n    let name = binding ? `\"${((binding: any): Binding).name}\"` : \"unknown\";\n    exceptionHandler(`side-effects from mutating the binding ${name}${location}`, expressionLocation);\n  } else if (sideEffectType === \"MODIFIED_PROPERTY\" || sideEffectType === \"MODIFIED_GLOBAL\") {\n    let name = \"\";\n    let pb = ((binding: any): PropertyBinding);\n    let key = pb.key;\n    if (typeof key === \"string\") {\n      name = `\"${key}\"`;\n    }\n    if (sideEffectType === \"MODIFIED_PROPERTY\") {\n      if (!ObjectValue.refuseSerializationOnPropertyBinding(pb))\n        exceptionHandler(`side-effects from mutating a property ${name}${location}`, expressionLocation);\n    } else {\n      exceptionHandler(`side-effects from mutating the global object property ${name}${location}`, expressionLocation);\n    }\n  } else if (sideEffectType === \"EXCEPTION_THROWN\") {\n    exceptionHandler(`side-effects from throwing exception${location}`, expressionLocation);\n  }\n}\n"
  },
  {
    "path": "src/serializer/visitors.js",
    "content": "/**\n * Copyright (c) 2017-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n/* @flow strict-local */\n\nimport { Realm } from \"../realm.js\";\nimport * as t from \"@babel/types\";\nimport type { BabelNodeCallExpression } from \"@babel/types\";\nimport type { BabelTraversePath, BabelTraverseScope } from \"@babel/traverse\";\nimport type { FunctionInfo } from \"./types.js\";\n\ntype GetModuleIdIfNodeIsRequireFunction =\n  | void\n  | ((scope: BabelTraverseScope, node: BabelNodeCallExpression) => void | number | string);\n\nexport type ClosureRefVisitorState = {\n  functionInfo: FunctionInfo,\n  realm: Realm,\n  getModuleIdIfNodeIsRequireFunction: GetModuleIdIfNodeIsRequireFunction,\n};\n\nfunction visitName(path, state, node, modified) {\n  // Is the name bound to some local identifier? If so, we don't need to do anything\n  if (path.scope.hasBinding(node.name, /*noGlobals*/ true)) return;\n\n  // Otherwise, let's record that there's an unbound identifier\n  let nodes = state.functionInfo.unbound.get(node.name);\n  if (nodes === undefined) state.functionInfo.unbound.set(node.name, (nodes = []));\n  nodes.push(node);\n  if (modified) state.functionInfo.modified.add(node.name);\n}\n\nfunction ignorePath(path: BabelTraversePath) {\n  let parent = path.parent;\n  return t.isLabeledStatement(parent) || t.isBreakStatement(parent) || t.isContinueStatement(parent);\n}\n\nexport let ClosureRefVisitor = {\n  \"FunctionDeclaration|ArrowFunctionExpression|FunctionExpression\": {\n    enter(path: BabelTraversePath, state: ClosureRefVisitorState) {\n      state.functionInfo.depth++;\n    },\n    exit(path: BabelTraversePath, state: ClosureRefVisitorState) {\n      state.functionInfo.depth--;\n    },\n  },\n\n  ArrowFunctionExpression: {\n    enter(path: BabelTraversePath, state: ClosureRefVisitorState) {\n      state.functionInfo.depth++;\n      state.functionInfo.lexicalDepth++;\n    },\n    exit(path: BabelTraversePath, state: ClosureRefVisitorState) {\n      state.functionInfo.depth--;\n      state.functionInfo.lexicalDepth--;\n    },\n  },\n\n  CallExpression(path: BabelTraversePath, state: ClosureRefVisitorState) {\n    // Here we apply the require optimization by replacing require calls with their\n    // corresponding initialized modules.\n    if (state.getModuleIdIfNodeIsRequireFunction === undefined) return;\n    let moduleId = state.getModuleIdIfNodeIsRequireFunction(path.scope, path.node);\n    if (moduleId === undefined) return;\n    state.functionInfo.requireCalls.set(path.node, moduleId);\n  },\n\n  ReferencedIdentifier(path: BabelTraversePath, state: ClosureRefVisitorState) {\n    if (ignorePath(path)) return;\n\n    let innerName = path.node.name;\n    if (innerName === \"arguments\") {\n      if (state.functionInfo.depth === 1) {\n        state.functionInfo.usesArguments = true;\n      }\n      // \"arguments\" bound to local scope. therefore, there's no need to visit this identifier.\n      return;\n    }\n    visitName(path, state, path.node, false);\n  },\n\n  ThisExpression(path: BabelTraversePath, state: ClosureRefVisitorState) {\n    if (state.functionInfo.depth - state.functionInfo.lexicalDepth === 1) {\n      state.functionInfo.usesThis = true;\n    }\n  },\n\n  \"AssignmentExpression|UpdateExpression\"(path: BabelTraversePath, state: ClosureRefVisitorState) {\n    let ids = path.getBindingIdentifiers();\n    for (let name in ids) {\n      visitName(path, state, ids[name], true);\n    }\n  },\n\n  \"ForInStatement|ForOfStatement\"(path: BabelTraversePath, state: ClosureRefVisitorState) {\n    if (path.node.left !== \"VariableDeclaration\") {\n      // `LeftHandSideExpression`s in a for-in/for-of statement perform `DestructuringAssignment` on the current loop\n      // value so we need to make sure we visit these bindings and mark them as modified.\n      const ids = path.get(\"left\").getBindingIdentifiers();\n      for (const name in ids) {\n        visitName(path, state, ids[name], true);\n      }\n    }\n  },\n};\n"
  },
  {
    "path": "src/singletons.js",
    "content": "/**\n * Copyright (c) 2017-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n/* @flow */\n\nimport type {\n  ConcretizeType,\n  CreateType,\n  EnvironmentType,\n  FunctionType,\n  LeakType,\n  JoinType,\n  MaterializeType,\n  PathType,\n  PathConditions,\n  PropertiesType,\n  ReachabilityType,\n  ToType,\n  UtilsType,\n  WidenType,\n  DebugReproManagerType,\n} from \"./types.js\";\n\nexport let Create: CreateType = (null: any);\nexport let Environment: EnvironmentType = (null: any);\nexport let Functions: FunctionType = (null: any);\nexport let Leak: LeakType = (null: any);\nexport let Materialize: MaterializeType = (null: any);\nexport let Reachability: ReachabilityType = (null: any);\nexport let Join: JoinType = (null: any);\nexport let Path: PathType = (null: any);\nexport let createPathConditions: (PathConditions | void) => PathConditions = (null: any);\nexport let Properties: PropertiesType = (null: any);\nexport let To: ToType = (null: any);\nexport let Widen: WidenType = (null: any);\nexport let concretize: ConcretizeType = (null: any);\n\nexport let Utils: UtilsType = (null: any);\nexport let DebugReproManager: DebugReproManagerType = (null: any);\n\nexport function setCreate(singleton: CreateType): void {\n  Create = singleton;\n}\n\nexport function setEnvironment(singleton: EnvironmentType): void {\n  Environment = singleton;\n}\n\nexport function setFunctions(singleton: FunctionType): void {\n  Functions = singleton;\n}\n\nexport function setLeak(singleton: LeakType): void {\n  Leak = singleton;\n}\n\nexport function setMaterialize(singleton: MaterializeType): void {\n  Materialize = singleton;\n}\n\nexport function setReachability(singleton: ReachabilityType): void {\n  Reachability = singleton;\n}\nexport function setJoin(singleton: JoinType): void {\n  Join = singleton;\n}\n\nexport function setPath(singleton: PathType): void {\n  Path = singleton;\n}\n\nexport function setPathConditions(f: (PathConditions | void) => PathConditions): void {\n  createPathConditions = f;\n}\n\nexport function setProperties(singleton: PropertiesType): void {\n  Properties = singleton;\n}\n\nexport function setTo(singleton: ToType): void {\n  To = singleton;\n}\n\nexport function setWiden(singleton: WidenType): void {\n  Widen = singleton;\n}\n\nexport function setConcretize(singleton: ConcretizeType): void {\n  concretize = singleton;\n}\n\nexport function setUtils(singleton: UtilsType): void {\n  Utils = singleton;\n}\n\nexport function setDebugReproManager(singleton: DebugReproManagerType): void {\n  DebugReproManager = singleton;\n}\n"
  },
  {
    "path": "src/statistics.js",
    "content": "/**\n * Copyright (c) 2017-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n/* @flow */\n\nimport invariant from \"./invariant.js\";\n\nexport class RealmStatistics {\n  constructor(getTime: void | (() => number), getMemory: void | (() => number)) {\n    this.simplifications = 0;\n    this.simplificationAttempts = 0;\n    this.evaluatedNodes = 0;\n\n    this.parsing = new PerformanceTracker(getTime, getMemory);\n    this.fixupSourceLocations = new PerformanceTracker(getTime, getMemory);\n    this.fixupFilenames = new PerformanceTracker(getTime, getMemory);\n    this.evaluation = new PerformanceTracker(getTime, getMemory);\n  }\n\n  simplifications: number;\n  simplificationAttempts: number;\n  evaluatedNodes: number;\n\n  // legacy projection\n  getRealmStatistics(): any {\n    return {\n      simplifications: this.simplifications,\n      simplificationAttempts: this.simplificationAttempts,\n      evaluatedNodes: this.evaluatedNodes,\n    };\n  }\n\n  parsing: PerformanceTracker;\n  fixupSourceLocations: PerformanceTracker;\n  fixupFilenames: PerformanceTracker;\n  evaluation: PerformanceTracker;\n\n  projectPerformanceTrackers(suffix: string, projection: PerformanceTracker => number): any {\n    let res = {};\n    for (let key of Object.keys(this)) {\n      let value = (this: any)[key];\n      if (value instanceof PerformanceTracker) res[key + suffix] = projection(value);\n    }\n    return res;\n  }\n\n  log(): void {\n    console.log(`=== realm statistics`);\n    console.log(`${this.evaluatedNodes} AST nodes evaluated.`);\n    console.log(`${this.simplifications} abstract values simplified after ${this.simplificationAttempts} attempts.`);\n  }\n\n  logPerformanceTrackers(format: PerformanceTracker => string): void {\n    console.log(\n      `${format(this.parsing)} parsing, ${format(this.fixupSourceLocations)} fixing source locations, ${format(\n        this.fixupFilenames\n      )} fixing filenames, ${format(this.evaluation)} evaluating global code`\n    );\n  }\n}\n\nexport class PerformanceTracker {\n  time: number;\n  memory: number;\n\n  _getTime: void | (() => number);\n  _getMemory: void | (() => number);\n  _running: boolean;\n\n  constructor(getTime: void | (() => number), getMemory: void | (() => number)) {\n    this.time = this.memory = 0;\n    this._getTime = getTime;\n    this._getMemory = getMemory;\n    this._running = false;\n  }\n\n  start(): void {\n    invariant(this._running === false);\n    if (this._getTime !== undefined) this.time = this._getTime() - this.time;\n    if (this._getMemory !== undefined) this.memory = this._getMemory() - this.memory;\n    this._running = true;\n  }\n\n  stop(): void {\n    invariant(this._running === true);\n    if (this._getTime !== undefined) this.time = this._getTime() - this.time;\n    if (this._getMemory !== undefined) this.memory = this._getMemory() - this.memory;\n    this._running = false;\n  }\n\n  measure<T>(action: () => T): T {\n    this.start();\n    try {\n      return action();\n    } finally {\n      this.stop();\n    }\n  }\n}\n"
  },
  {
    "path": "src/types.js",
    "content": "/**\n * Copyright (c) 2017-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n/* @flow */\n\nimport type {\n  AbstractObjectValue,\n  AbstractValue,\n  ArrayValue,\n  BooleanValue,\n  ConcreteValue,\n  ECMAScriptFunctionValue,\n  ECMAScriptSourceFunctionValue,\n  EmptyValue,\n  FunctionValue,\n  NativeFunctionValue,\n  NullValue,\n  NumberValue,\n  PrimitiveValue,\n  StringValue,\n  SymbolValue,\n  UndefinedValue,\n} from \"./values/index.js\";\nimport { Value } from \"./values/index.js\";\nimport { Completion } from \"./completions.js\";\nimport type { Descriptor as DescriptorClass } from \"./descriptors.js\";\nimport { type Binding, EnvironmentRecord, LexicalEnvironment, Reference } from \"./environment.js\";\nimport { ObjectValue } from \"./values/index.js\";\nimport type {\n  BabelNode,\n  BabelNodeBlockStatement,\n  BabelNodeClassMethod,\n  BabelNodeLVal,\n  BabelNodeObjectMethod,\n  BabelNodePattern,\n  BabelNodeVariableDeclaration,\n  BabelNodeSourceLocation,\n} from \"@babel/types\";\nimport type { BindingEntry, Effects, Realm, SideEffectCallback } from \"./realm.js\";\nimport { CompilerDiagnostic } from \"./errors.js\";\nimport type { Severity } from \"./errors.js\";\nimport type { DebugChannel } from \"./debugger/server/channel/DebugChannel.js\";\nimport invariant from \"./invariant.js\";\n\nexport const ElementSize = {\n  Float32: 4,\n  Float64: 8,\n  Int8: 1,\n  Int16: 2,\n  Int32: 4,\n  Uint8: 1,\n  Uint16: 2,\n  Uint32: 4,\n  Uint8Clamped: 1,\n};\n\nexport type ConsoleMethodTypes =\n  | \"assert\"\n  | \"clear\"\n  | \"count\"\n  | \"dir\"\n  | \"dirxml\"\n  | \"error\"\n  | \"group\"\n  | \"groupCollapsed\"\n  | \"groupEnd\"\n  | \"info\"\n  | \"log\"\n  | \"table\"\n  | \"time\"\n  | \"timeEnd\"\n  | \"trace\"\n  | \"warn\";\n\nexport type IterationKind = \"key+value\" | \"value\" | \"key\";\n\nexport type SourceType = \"module\" | \"script\";\n\nexport type SourceFile = {\n  filePath: string,\n  fileContents: string,\n  sourceMapContents?: string,\n  sourceMapFilename?: string,\n};\n\nexport class SourceFileCollection {\n  constructor(sourceFiles: Array<SourceFile>) {\n    this._sourceFiles = sourceFiles;\n  }\n  _sourceFiles: void | Array<SourceFile>;\n  toArray(): Array<SourceFile> {\n    invariant(this._sourceFiles !== undefined);\n    return this._sourceFiles;\n  }\n  destroy(): void {\n    this._sourceFiles = undefined;\n  }\n}\nexport type SourceMap = {\n  sources: Array<string>,\n  names: Array<string>,\n  mappings: string,\n  sourcesContent: Array<string>,\n};\n\nexport type AbstractTime = \"early\" | \"late\";\n\nexport type ElementType =\n  | \"Float32\"\n  | \"Float64\"\n  | \"Int8\"\n  | \"Int16\"\n  | \"Int32\"\n  | \"Uint8\"\n  | \"Uint16\"\n  | \"Uint32\"\n  | \"Uint8Clamped\";\n\n//\n\ndeclare class _CallableObjectValue extends ObjectValue {\n  $Call: void | ((thisArgument: Value, argsList: Array<Value>) => Value);\n}\nexport type CallableObjectValue = _CallableObjectValue | FunctionValue | NativeFunctionValue;\n\n//\n\nexport type DataBlock = Uint8Array;\n\n//\n\nexport type Descriptor = DescriptorClass;\n\nexport type FunctionBodyAstNode = {\n  // Function body ast node will have uniqueOrderedTag after being interpreted.\n  // This tag value is unique and sorted in ast DFS traversal ordering.\n  uniqueOrderedTag?: number,\n};\n\nexport type PropertyBinding = {\n  descriptor?: Descriptor,\n  object: ObjectValue,\n  key: void | string | SymbolValue | AbstractValue, // where an abstract value must be of type String or Number or Symbol\n  // contains a operation descriptor that produces a member expression that resolves to this property binding (location)\n  pathNode?: AbstractValue,\n  internalSlot?: boolean,\n};\n\nexport type LexicalEnvironmentTypes = \"global\" | \"module\" | \"script\" | \"function\" | \"block\" | \"catch\" | \"loop\" | \"with\";\n\nexport type PropertyKeyValue = string | StringValue | SymbolValue;\n\nexport type Intrinsics = {\n  undefined: UndefinedValue,\n  empty: EmptyValue,\n  null: NullValue,\n  false: BooleanValue,\n  true: BooleanValue,\n  NaN: NumberValue,\n  Infinity: NumberValue,\n  negativeInfinity: NumberValue,\n  zero: NumberValue,\n  negativeZero: NumberValue,\n  emptyString: StringValue,\n\n  SymbolHasInstance: SymbolValue,\n  SymbolIsConcatSpreadable: SymbolValue,\n  SymbolSpecies: SymbolValue,\n  SymbolReplace: SymbolValue,\n  SymbolIterator: SymbolValue,\n  SymbolSplit: SymbolValue,\n  SymbolToPrimitive: SymbolValue,\n  SymbolToStringTag: SymbolValue,\n  SymbolMatch: SymbolValue,\n  SymbolSearch: SymbolValue,\n  SymbolUnscopables: SymbolValue,\n\n  ObjectPrototype: ObjectValue,\n  FunctionPrototype: NativeFunctionValue,\n  ArrayPrototype: ObjectValue,\n  RegExpPrototype: ObjectValue,\n  DatePrototype: ObjectValue,\n  Boolean: NativeFunctionValue,\n  BooleanPrototype: ObjectValue,\n\n  Error: NativeFunctionValue,\n  ErrorPrototype: ObjectValue,\n  ReferenceError: NativeFunctionValue,\n  ReferenceErrorPrototype: ObjectValue,\n  SyntaxError: NativeFunctionValue,\n  SyntaxErrorPrototype: ObjectValue,\n  TypeError: NativeFunctionValue,\n  TypeErrorPrototype: ObjectValue,\n  URIError: NativeFunctionValue,\n  URIErrorPrototype: ObjectValue,\n  EvalError: NativeFunctionValue,\n  EvalErrorPrototype: ObjectValue,\n  JSON: ObjectValue,\n  Reflect: ObjectValue,\n  Proxy: NativeFunctionValue,\n  RangeError: NativeFunctionValue,\n  RangeErrorPrototype: ObjectValue,\n  ArrayIteratorPrototype: ObjectValue,\n  StringIteratorPrototype: ObjectValue,\n  IteratorPrototype: ObjectValue,\n  SetIteratorPrototype: ObjectValue,\n  MapIteratorPrototype: ObjectValue,\n  Number: NativeFunctionValue,\n  NumberPrototype: ObjectValue,\n  Symbol: NativeFunctionValue,\n  SymbolPrototype: ObjectValue,\n  StringPrototype: ObjectValue,\n  Object: NativeFunctionValue,\n  Function: NativeFunctionValue,\n  Array: NativeFunctionValue,\n  RegExp: NativeFunctionValue,\n  Date: NativeFunctionValue,\n  String: NativeFunctionValue,\n  Math: ObjectValue,\n  isNaN: NativeFunctionValue,\n  parseInt: NativeFunctionValue,\n  parseFloat: NativeFunctionValue,\n  isFinite: NativeFunctionValue,\n  decodeURI: NativeFunctionValue,\n  decodeURIComponent: NativeFunctionValue,\n  encodeURI: NativeFunctionValue,\n  encodeURIComponent: NativeFunctionValue,\n  ThrowTypeError: NativeFunctionValue,\n  ArrayProto_values: NativeFunctionValue,\n  ArrayProto_toString: NativeFunctionValue,\n  ObjectProto_toString: NativeFunctionValue,\n  TypedArrayProto_values: NativeFunctionValue,\n  eval: NativeFunctionValue,\n  console: ObjectValue,\n  document: ObjectValue,\n  process: ObjectValue,\n\n  DataView: NativeFunctionValue,\n  DataViewPrototype: ObjectValue,\n  TypedArray: NativeFunctionValue,\n  TypedArrayPrototype: ObjectValue,\n  Float32Array: NativeFunctionValue,\n  Float32ArrayPrototype: ObjectValue,\n  Float64Array: NativeFunctionValue,\n  Float64ArrayPrototype: ObjectValue,\n  Int8Array: NativeFunctionValue,\n  Int8ArrayPrototype: ObjectValue,\n  Int16Array: NativeFunctionValue,\n  Int16ArrayPrototype: ObjectValue,\n  Int32Array: NativeFunctionValue,\n  Int32ArrayPrototype: ObjectValue,\n  Map: NativeFunctionValue,\n  MapPrototype: ObjectValue,\n  WeakMap: NativeFunctionValue,\n  WeakMapPrototype: ObjectValue,\n  Set: NativeFunctionValue,\n  SetPrototype: ObjectValue,\n  Promise: NativeFunctionValue,\n  PromisePrototype: ObjectValue,\n  Uint8Array: NativeFunctionValue,\n  Uint8ArrayPrototype: ObjectValue,\n  Uint8ClampedArray: NativeFunctionValue,\n  Uint8ClampedArrayPrototype: ObjectValue,\n  Uint16Array: NativeFunctionValue,\n  Uint16ArrayPrototype: ObjectValue,\n  Uint32Array: NativeFunctionValue,\n  Uint32ArrayPrototype: ObjectValue,\n  WeakSet: NativeFunctionValue,\n  WeakSetPrototype: ObjectValue,\n  ArrayBuffer: NativeFunctionValue,\n  ArrayBufferPrototype: ObjectValue,\n\n  Generator: ObjectValue,\n  GeneratorPrototype: ObjectValue,\n  GeneratorFunction: NativeFunctionValue,\n\n  __IntrospectionError: NativeFunctionValue,\n  __IntrospectionErrorPrototype: ObjectValue,\n  __topValue: AbstractValue,\n  __bottomValue: AbstractValue,\n  __leakedValue: AbstractValue,\n};\n\nexport type PromiseCapability = {\n  promise: ObjectValue | UndefinedValue,\n  resolve: Value,\n  reject: Value,\n};\n\nexport type PromiseReaction = {\n  capabilities: PromiseCapability,\n  handler: Value,\n};\n\nexport type ResolvingFunctions = {\n  resolve: Value,\n  reject: Value,\n};\n\nexport type TypedArrayKind =\n  | \"Float32Array\"\n  | \"Float64Array\"\n  | \"Int8Array\"\n  | \"Int16Array\"\n  | \"Int32Array\"\n  | \"Uint8Array\"\n  | \"Uint16Array\"\n  | \"Uint32Array\"\n  | \"Uint8ClampedArray\";\n\nexport type ObjectKind =\n  | \"Object\"\n  | \"Array\"\n  | \"Function\"\n  | \"Symbol\"\n  | \"String\"\n  | \"Number\"\n  | \"Boolean\"\n  | \"Date\"\n  | \"RegExp\"\n  | \"Set\"\n  | \"Map\"\n  | \"DataView\"\n  | \"ArrayBuffer\"\n  | \"WeakMap\"\n  | \"WeakSet\"\n  | TypedArrayKind\n  | \"ReactElement\";\n// TODO #26 #712: Promises. All kinds of iterators. Generators.\n\nexport type ClassComponentMetadata = {\n  instanceProperties: Set<string>,\n  instanceSymbols: Set<SymbolValue>,\n};\n\nexport type ReactHint = {| firstRenderValue: Value, object: ObjectValue, propertyName: string, args: Array<Value> |};\n\nexport type ReactComponentTreeConfig = {\n  firstRenderOnly: boolean,\n  isRoot: boolean,\n  modelString: void | string,\n};\n\nexport type DebugServerType = {\n  checkForActions: BabelNode => void,\n  handlePrepackError: CompilerDiagnostic => void,\n  shouldStopForSeverity: Severity => boolean,\n  shutdown: () => void,\n};\n\nexport type PathType = {\n  // this => val. A false value does not imply that !(this => val).\n  implies(condition: Value, depth?: number): boolean,\n  // this => !val. A false value does not imply that !(this => !val).\n  impliesNot(condition: Value, depth?: number): boolean,\n  withCondition<T>(condition: Value, evaluate: () => T): T,\n  withInverseCondition<T>(condition: Value, evaluate: () => T): T,\n  pushAndRefine(condition: Value): void,\n  pushInverseAndRefine(condition: Value): void,\n};\n\nexport class PathConditions {\n  add(c: AbstractValue): void {}\n\n  equals(x: PathConditions): boolean {\n    return false;\n  }\n\n  // this => val. A false value does not imply that !(this => val).\n  implies(e: Value, depth: number = 0): boolean {\n    return false;\n  }\n\n  // this => !val. A false value does not imply that !(this => !val).\n  impliesNot(e: Value, depth: number = 0): boolean {\n    return false;\n  }\n\n  isEmpty(): boolean {\n    return false;\n  }\n\n  isReadOnly(): boolean {\n    return false;\n  }\n\n  getLength(): number {\n    return 0;\n  }\n\n  getAssumedConditions(): Set<AbstractValue> {\n    return new Set();\n  }\n\n  refineBaseConditons(realm: Realm, depth?: number = 0): void {}\n}\n\nexport type LeakType = {\n  value(realm: Realm, value: Value, loc: ?BabelNodeSourceLocation): void,\n};\n\nexport type MaterializeType = {\n  materializeObject(realm: Realm, object: ObjectValue): void,\n};\n\nexport type ReachabilityType = {\n  computeReachableObjectsAndBindings(\n    realm: Realm,\n    rootValue: Value,\n    filterValue: (Value) => boolean,\n    readOnly?: boolean\n  ): [Set<ObjectValue>, Set<Binding>],\n};\nexport type PropertiesType = {\n  // ECMA262 9.1.9.1\n  OrdinarySet(realm: Realm, O: ObjectValue, P: PropertyKeyValue, V: Value, Receiver: Value): boolean,\n  OrdinarySetPartial(\n    realm: Realm,\n    O: ObjectValue,\n    P: AbstractValue | PropertyKeyValue,\n    V: Value,\n    Receiver: Value\n  ): boolean,\n\n  // ECMA262 6.2.4.4\n  FromPropertyDescriptor(realm: Realm, Desc: ?Descriptor): Value,\n\n  //\n  OrdinaryDelete(realm: Realm, O: ObjectValue, P: PropertyKeyValue): boolean,\n\n  // ECMA262 7.3.8\n  DeletePropertyOrThrow(realm: Realm, O: ObjectValue, P: PropertyKeyValue): boolean,\n\n  // ECMA262 6.2.4.6\n  CompletePropertyDescriptor(realm: Realm, Desc: Descriptor): Descriptor,\n\n  // ECMA262 9.1.6.2\n  IsCompatiblePropertyDescriptor(realm: Realm, extensible: boolean, Desc: Descriptor, current: ?Descriptor): boolean,\n\n  // ECMA262 9.1.6.3\n  ValidateAndApplyPropertyDescriptor(\n    realm: Realm,\n    O: void | ObjectValue,\n    P: void | PropertyKeyValue,\n    extensible: boolean,\n    Desc: Descriptor,\n    current: ?Descriptor\n  ): boolean,\n\n  // ECMA262 9.1.6.1\n  OrdinaryDefineOwnProperty(realm: Realm, O: ObjectValue, P: PropertyKeyValue, Desc: Descriptor): boolean,\n\n  // ECMA262 19.1.2.3.1\n  ObjectDefineProperties(realm: Realm, O: Value, Properties: Value): ObjectValue | AbstractObjectValue,\n\n  // ECMA262 7.3.3\n  Set(realm: Realm, O: ObjectValue | AbstractObjectValue, P: PropertyKeyValue, V: Value, Throw: boolean): boolean,\n\n  // ECMA262 7.3.7\n  DefinePropertyOrThrow(\n    realm: Realm,\n    O: ObjectValue | AbstractObjectValue,\n    P: PropertyKeyValue,\n    desc: Descriptor\n  ): boolean,\n\n  // ECMA262 6.2.3.2\n  PutValue(realm: Realm, V: Value | Reference, W: Value): void | boolean | Value,\n\n  // ECMA262 9.4.2.4\n  ArraySetLength(realm: Realm, A: ArrayValue, Desc: Descriptor): boolean,\n\n  // ECMA262 9.1.5.1\n  OrdinaryGetOwnProperty(realm: Realm, O: ObjectValue, P: PropertyKeyValue): Descriptor | void,\n\n  // ECMA262 9.1.2.1\n  OrdinarySetPrototypeOf(realm: Realm, O: ObjectValue, V: ObjectValue | NullValue): boolean,\n\n  // ECMA262 13.7.5.15\n  EnumerateObjectProperties(realm: Realm, O: ObjectValue): ObjectValue,\n\n  ThrowIfMightHaveBeenDeleted(desc: Descriptor): void,\n\n  ThrowIfInternalSlotNotWritable<T: ObjectValue>(realm: Realm, object: T, key: string): T,\n\n  // ECMA 14.3.9\n  PropertyDefinitionEvaluation(\n    realm: Realm,\n    MethodDefinition: BabelNodeObjectMethod | BabelNodeClassMethod,\n    object: ObjectValue,\n    env: LexicalEnvironment,\n    strictCode: boolean,\n    enumerable: boolean\n  ): boolean,\n\n  GetOwnPropertyKeysArray(\n    realm: Realm,\n    O: ObjectValue,\n    allowAbstractKeys: boolean,\n    getOwnPropertyKeysEvenIfPartial: boolean\n  ): Array<string>,\n};\n\nexport type FunctionType = {\n  FindVarScopedDeclarations(ast_node: BabelNode): Array<BabelNode>,\n\n  // ECMA262 9.2.12\n  FunctionDeclarationInstantiation(\n    realm: Realm,\n    func: ECMAScriptSourceFunctionValue,\n    argumentsList: Array<Value>\n  ): EmptyValue,\n\n  // ECMA262 9.2.11\n  SetFunctionName(realm: Realm, F: ObjectValue, name: PropertyKeyValue | AbstractValue, prefix?: string): boolean,\n\n  // ECMA262 9.2.3\n  FunctionInitialize(\n    realm: Realm,\n    F: ECMAScriptSourceFunctionValue,\n    kind: \"normal\" | \"method\" | \"arrow\",\n    ParameterList: Array<BabelNodeLVal>,\n    Body: BabelNodeBlockStatement,\n    Scope: LexicalEnvironment\n  ): ECMAScriptSourceFunctionValue,\n\n  // ECMA262 9.2.6\n  GeneratorFunctionCreate(\n    realm: Realm,\n    kind: \"normal\" | \"method\",\n    ParameterList: Array<BabelNodeLVal>,\n    Body: BabelNodeBlockStatement,\n    Scope: LexicalEnvironment,\n    Strict: boolean\n  ): ECMAScriptSourceFunctionValue,\n\n  // ECMA262 9.2.7\n  AddRestrictedFunctionProperties(F: FunctionValue, realm: Realm): boolean,\n\n  // ECMA262 9.2.1\n  $Call(realm: Realm, F: ECMAScriptFunctionValue, thisArgument: Value, argsList: Array<Value>): Value,\n\n  // ECMA262 9.2.2\n  $Construct(\n    realm: Realm,\n    F: ECMAScriptFunctionValue,\n    argumentsList: Array<Value>,\n    newTarget: ObjectValue\n  ): ObjectValue | AbstractObjectValue,\n\n  // ECMA262 9.2.3\n  FunctionAllocate(\n    realm: Realm,\n    functionPrototype: ObjectValue | AbstractObjectValue,\n    strict: boolean,\n    functionKind: \"normal\" | \"non-constructor\" | \"generator\"\n  ): ECMAScriptSourceFunctionValue,\n\n  // ECMA262 9.4.1.3\n  BoundFunctionCreate(\n    realm: Realm,\n    targetFunction: ObjectValue,\n    boundThis: Value,\n    boundArgs: Array<Value>\n  ): ObjectValue,\n\n  // ECMA262 18.2.1.1\n  PerformEval(realm: Realm, x: Value, evalRealm: Realm, strictCaller: boolean, direct: boolean): Value,\n\n  // Composes realm.savedCompletion with c, clears realm.savedCompletion and return the composition.\n  // Call this only when a join point has been reached.\n  incorporateSavedCompletion(realm: Realm, c: void | Completion | Value): void | Completion | Value,\n\n  EvaluateStatements(\n    body: Array<BabelNodeStatement>,\n    initialBlockValue: void | Value,\n    strictCode: boolean,\n    blockEnv: LexicalEnvironment,\n    realm: Realm\n  ): Value,\n\n  // ECMA262 9.2.5\n  FunctionCreate(\n    realm: Realm,\n    kind: \"normal\" | \"arrow\" | \"method\",\n    ParameterList: Array<BabelNodeLVal>,\n    Body: BabelNodeBlockStatement,\n    Scope: LexicalEnvironment,\n    Strict: boolean,\n    prototype?: ObjectValue\n  ): ECMAScriptSourceFunctionValue,\n\n  // ECMA262 18.2.1.2\n  EvalDeclarationInstantiation(\n    realm: Realm,\n    body: BabelNodeBlockStatement,\n    varEnv: LexicalEnvironment,\n    lexEnv: LexicalEnvironment,\n    strict: boolean\n  ): Value,\n\n  // ECMA 9.2.10\n  MakeMethod(realm: Realm, F: ECMAScriptSourceFunctionValue, homeObject: ObjectValue): Value,\n\n  // ECMA 14.3.8\n  DefineMethod(\n    realm: Realm,\n    prop: BabelNodeObjectMethod | BabelNodeClassMethod,\n    obj: ObjectValue,\n    env: LexicalEnvironment,\n    strictCode: boolean,\n    functionPrototype?: ObjectValue\n  ): { $Key: PropertyKeyValue, $Closure: ECMAScriptSourceFunctionValue },\n};\n\nexport type EnvironmentType = {\n  // ECMA262 6.2.3\n  // IsSuperReference(V). Returns true if this reference has a thisValue component.\n  IsSuperReference(realm: Realm, V: Reference): boolean,\n\n  // ECMA262 6.2.3\n  // HasPrimitiveBase(V). Returns true if Type(base) is Boolean, String, Symbol, or Number.\n  HasPrimitiveBase(realm: Realm, V: Reference): boolean,\n\n  // ECMA262 6.2.3\n  // GetReferencedName(V). Returns the referenced name component of the reference V.\n  GetReferencedName(realm: Realm, V: Reference): string | SymbolValue,\n\n  GetReferencedNamePartial(realm: Realm, V: Reference): AbstractValue | string | SymbolValue,\n\n  // ECMA262 6.2.3.1\n  GetValue(realm: Realm, V: Reference | Value): Value,\n  GetConditionValue(realm: Realm, V: Reference | Value): Value,\n\n  // ECMA262 6.2.3\n  // IsStrictReference(V). Returns the strict reference flag component of the reference V.\n  IsStrictReference(realm: Realm, V: Reference): boolean,\n\n  // ECMA262 6.2.3\n  // IsPropertyReference(V). Returns true if either the base value is an object or HasPrimitiveBase(V) is true; otherwise returns false.\n  IsPropertyReference(realm: Realm, V: Reference): boolean,\n\n  // ECMA262 6.2.3\n  // GetBase(V). Returns the base value component of the reference V.\n  GetBase(realm: Realm, V: Reference): void | Value | EnvironmentRecord,\n\n  // ECMA262 6.2.3\n  // IsUnresolvableReference(V). Returns true if the base value is undefined and false otherwise.\n  IsUnresolvableReference(realm: Realm, V: Reference): boolean,\n\n  // ECMA262 8.1.2.2\n  NewDeclarativeEnvironment(realm: Realm, E: LexicalEnvironment, active?: boolean): LexicalEnvironment,\n\n  BoundNames(realm: Realm, node: BabelNode): Array<string>,\n\n  // ECMA262 13.3.3.2\n  ContainsExpression(realm: Realm, node: ?BabelNode): boolean,\n\n  // ECMA262 8.3.2\n  ResolveBinding(realm: Realm, name: string, strict: boolean, env?: ?LexicalEnvironment): Reference,\n\n  // ECMA262 8.1.2.1\n  GetIdentifierReference(realm: Realm, lex: ?LexicalEnvironment, name: string, strict: boolean): Reference,\n\n  // ECMA262 6.2.3.4\n  InitializeReferencedBinding(realm: Realm, V: Reference, W: Value): Value,\n\n  // ECMA262 13.2.14\n  BlockDeclarationInstantiation(\n    realm: Realm,\n    strictCode: boolean,\n    body: Array<BabelNodeStatement>,\n    env: LexicalEnvironment\n  ): void,\n\n  // ECMA262 8.1.2.5\n  NewGlobalEnvironment(\n    realm: Realm,\n    G: ObjectValue | AbstractObjectValue,\n    thisValue: ObjectValue | AbstractObjectValue\n  ): LexicalEnvironment,\n\n  // ECMA262 8.1.2.3\n  NewObjectEnvironment(realm: Realm, O: ObjectValue | AbstractObjectValue, E: LexicalEnvironment): LexicalEnvironment,\n\n  // ECMA262 8.1.2.4\n  NewFunctionEnvironment(realm: Realm, F: ECMAScriptFunctionValue, newTarget?: ObjectValue): LexicalEnvironment,\n\n  // ECMA262 8.3.1\n  GetActiveScriptOrModule(realm: Realm): any,\n\n  // ECMA262 8.3.3\n  GetThisEnvironment(realm: Realm): EnvironmentRecord,\n\n  // ECMA262 8.3.4\n  ResolveThisBinding(realm: Realm): NullValue | ObjectValue | AbstractObjectValue | UndefinedValue,\n\n  BindingInitialization(\n    realm: Realm,\n    node: BabelNodeLVal | BabelNodeVariableDeclaration,\n    value: Value,\n    strictCode: boolean,\n    environment: void | LexicalEnvironment\n  ): void | boolean | Value,\n\n  // ECMA262 13.3.3.6\n  // ECMA262 14.1.19\n  IteratorBindingInitialization(\n    realm: Realm,\n    formals: $ReadOnlyArray<BabelNodeLVal | null>,\n    iteratorRecord: { $Iterator: ObjectValue, $Done: boolean },\n    strictCode: boolean,\n    environment: void | LexicalEnvironment\n  ): void,\n\n  // ECMA262 12.1.5.1\n  InitializeBoundName(\n    realm: Realm,\n    name: string,\n    value: Value,\n    environment: void | LexicalEnvironment\n  ): void | boolean | Value,\n\n  // ECMA262 12.3.1.3 and 13.7.5.6\n  IsDestructuring(ast: BabelNode): boolean,\n\n  // ECMA262 13.3.3.7\n  KeyedBindingInitialization(\n    realm: Realm,\n    node: BabelNodeIdentifier | BabelNodePattern,\n    value: Value,\n    strictCode: boolean,\n    environment: ?LexicalEnvironment,\n    propertyName: PropertyKeyValue\n  ): void | boolean | Value,\n};\n\nexport type JoinType = {\n  composeCompletions(leftCompletion: void | Completion | Value, rightCompletion: Completion | Value): Completion,\n\n  composeWithEffects(completion: Completion, effects: Effects): Effects,\n\n  joinCompletions(joinCondition: Value, c1: Completion, c2: Completion): Completion,\n\n  joinEffects(joinCondition: Value, e1: Effects, e2: Effects): Effects,\n\n  joinDescriptors(\n    realm: Realm,\n    joinCondition: AbstractValue,\n    d1: void | Descriptor,\n    d2: void | Descriptor\n  ): void | Descriptor,\n\n  joinValuesOfSelectedCompletions(\n    selector: (Completion) => boolean,\n    completion: Completion,\n    keepInfeasiblePaths?: boolean\n  ): Value,\n\n  mapAndJoin(\n    realm: Realm,\n    values: Set<ConcreteValue>,\n    joinConditionFactory: (ConcreteValue) => Value,\n    functionToMap: (ConcreteValue) => Completion | Value\n  ): Value,\n};\n\nexport type CreateType = {\n  // ECMA262 9.4.3.3\n  StringCreate(realm: Realm, value: StringValue, prototype: ObjectValue | AbstractObjectValue): ObjectValue,\n\n  // B.2.3.2.1\n  CreateHTML(realm: Realm, string: Value, tag: string, attribute: string, value: string | Value): StringValue,\n\n  // ECMA262 9.4.4.8.1\n  MakeArgGetter(realm: Realm, name: string, env: EnvironmentRecord): NativeFunctionValue,\n\n  // ECMA262 9.4.4.8.1\n  MakeArgSetter(realm: Realm, name: string, env: EnvironmentRecord): NativeFunctionValue,\n\n  // ECMA262 21.1.5.1\n  CreateStringIterator(realm: Realm, string: StringValue): ObjectValue,\n\n  // ECMA262 9.4.2.3\n  ArraySpeciesCreate(realm: Realm, originalArray: ObjectValue, length: number): ObjectValue,\n\n  // ECMA262 7.4.7\n  CreateIterResultObject(realm: Realm, value: Value, done: boolean): ObjectValue,\n\n  // ECMA262 22.1.5.1\n  CreateArrayIterator(realm: Realm, array: ObjectValue, kind: IterationKind): ObjectValue,\n\n  // ECMA262 9.4.2.2\n  ArrayCreate(realm: Realm, length: number, proto?: ObjectValue | AbstractObjectValue): ArrayValue,\n\n  // ECMA262 7.3.16\n  CreateArrayFromList(realm: Realm, elems: Array<Value>): ArrayValue,\n\n  // ECMA262 9.4.4.7\n  CreateUnmappedArgumentsObject(realm: Realm, argumentsList: Array<Value>): ObjectValue,\n\n  // ECMA262 9.4.4.8\n  CreateMappedArgumentsObject(\n    realm: Realm,\n    func: FunctionValue,\n    formals: Array<BabelNodeLVal>,\n    argumentsList: Array<Value>,\n    env: EnvironmentRecord\n  ): ObjectValue,\n\n  // ECMA262 7.3.23 (sec-copydataproperties)\n  CopyDataProperties(realm: Realm, target: ObjectValue, source: Value, excluded: Array<PropertyKeyValue>): ObjectValue,\n\n  // ECMA262 7.3.4\n  CreateDataProperty(realm: Realm, O: ObjectValue | AbstractObjectValue, P: PropertyKeyValue, V: Value): boolean,\n\n  // ECMA262 7.3.5\n  CreateMethodProperty(realm: Realm, O: ObjectValue, P: PropertyKeyValue, V: Value): boolean,\n\n  // ECMA262 7.3.6\n  CreateDataPropertyOrThrow(realm: Realm, O: Value, P: PropertyKeyValue, V: Value): boolean,\n\n  // ECMA262 9.1.12\n  ObjectCreate(\n    realm: Realm,\n    proto: ObjectValue | AbstractObjectValue | NullValue,\n    internalSlotsList?: { [key: string]: void }\n  ): ObjectValue,\n\n  // ECMA262 9.1.13\n  OrdinaryCreateFromConstructor(\n    realm: Realm,\n    constructor: ObjectValue,\n    intrinsicDefaultProto: string,\n    internalSlotsList?: { [key: string]: void }\n  ): ObjectValue,\n\n  // ECMA262 7.3.17\n  CreateListFromArrayLike(realm: Realm, obj: Value, elementTypes?: Array<string>): Array<Value>,\n\n  // ECMA262 19.2.1.1.1\n  CreateDynamicFunction(\n    realm: Realm,\n    constructor: ObjectValue,\n    newTarget: void | ObjectValue,\n    kind: \"normal\" | \"generator\",\n    args: Array<Value>\n  ): Value,\n};\n\nexport type WidenType = {\n  // Returns a new effects summary that includes both e1 and e2.\n  widenEffects(realm: Realm, e1: Effects, e2: Effects): Effects,\n\n  // Returns an abstract value that includes both v1 and v2 as potential values.\n  widenValues(\n    realm: Realm,\n    v1: Value | Array<Value> | Array<{ $Key: void | Value, $Value: void | Value }>,\n    v2: Value | Array<Value> | Array<{ $Key: void | Value, $Value: void | Value }>\n  ): Value | Array<Value> | Array<{ $Key: void | Value, $Value: void | Value }>,\n\n  containsArraysOfValue(realm: Realm, a1: void | Array<Value>, a2: void | Array<Value>): boolean,\n\n  // If e2 is the result of a loop iteration starting with effects e1 and it has a subset of elements of e1,\n  // then we have reached a fixed point and no further calls to widen are needed. e1/e2 represent a general\n  // summary of the loop, regardless of how many iterations will be performed at runtime.\n  containsEffects(e1: Effects, e2: Effects): boolean,\n};\n\nexport type numberOrValue = number | Value;\n\nexport type ElementConvType = {\n  Int8: (Realm, numberOrValue) => number,\n  Int16: (Realm, numberOrValue) => number,\n  Int32: (Realm, numberOrValue) => number,\n  Uint8: (Realm, numberOrValue) => number,\n  Uint16: (Realm, numberOrValue) => number,\n  Uint32: (Realm, numberOrValue) => number,\n  Uint8Clamped: (Realm, numberOrValue) => number,\n};\n\nexport type ToType = {\n  ElementConv: ElementConvType,\n\n  // ECMA262 7.1.5\n  ToInt32(realm: Realm, argument: numberOrValue): number,\n\n  // ECMA262 7.1.6\n  ToUint32(realm: Realm, argument: numberOrValue): number,\n\n  // ECMA262 7.1.7\n  ToInt16(realm: Realm, argument: numberOrValue): number,\n\n  // ECMA262 7.1.8\n  ToUint16(realm: Realm, argument: numberOrValue): number,\n\n  // ECMA262 7.1.9\n  ToInt8(realm: Realm, argument: numberOrValue): number,\n\n  // ECMA262 7.1.10\n  ToUint8(realm: Realm, argument: numberOrValue): number,\n\n  // ECMA262 7.1.11\n  ToUint8Clamp(realm: Realm, argument: numberOrValue): number,\n\n  // ECMA262 19.3.3.1\n  thisBooleanValue(realm: Realm, value: Value): BooleanValue,\n\n  // ECMA262 20.1.3\n  thisNumberValue(realm: Realm, value: Value): NumberValue,\n\n  // ECMA262 21.1.3\n  thisStringValue(realm: Realm, value: Value): StringValue,\n\n  // ECMA262 6.2.4.5\n  ToPropertyDescriptor(realm: Realm, Obj: Value): Descriptor,\n\n  // ECMA262 7.1.13\n  ToObject(realm: Realm, arg: Value): ObjectValue | AbstractObjectValue,\n\n  // ECMA262 7.1.15\n  ToLength(realm: Realm, argument: numberOrValue): number,\n\n  // ECMA262 7.1.4\n  ToInteger(realm: Realm, argument: numberOrValue): number,\n\n  // ECMA262 7.1.17\n  ToIndex(realm: Realm, value: number | ConcreteValue): number,\n\n  ToIndexPartial(realm: Realm, value: numberOrValue): number,\n\n  // ECMA262 7.1.3\n  ToNumber(realm: Realm, val: numberOrValue): number,\n\n  ToNumberOrAbstract(realm: Realm, val: numberOrValue): number | AbstractValue,\n\n  IsToNumberPure(realm: Realm, val: numberOrValue): boolean,\n\n  // ECMA262 7.1.1\n  ToPrimitive(realm: Realm, input: ConcreteValue, hint?: \"default\" | \"string\" | \"number\"): PrimitiveValue,\n\n  ToPrimitiveOrAbstract(\n    realm: Realm,\n    input: ConcreteValue,\n    hint?: \"default\" | \"string\" | \"number\"\n  ): AbstractValue | PrimitiveValue,\n\n  // Returns result type of ToPrimitive if it is pure (terminates, does not throw exception, does not read or write heap), otherwise undefined.\n  GetToPrimitivePureResultType(realm: Realm, input: Value): void | typeof Value,\n\n  IsToPrimitivePure(realm: Realm, input: Value): boolean,\n\n  // ECMA262 7.1.1\n  OrdinaryToPrimitive(realm: Realm, input: ObjectValue, hint: \"string\" | \"number\"): PrimitiveValue,\n\n  OrdinaryToPrimitiveOrAbstract(\n    realm: Realm,\n    input: ObjectValue,\n    hint: \"string\" | \"number\"\n  ): AbstractValue | PrimitiveValue,\n\n  IsToStringPure(realm: Realm, input: string | Value): boolean,\n\n  // ECMA262 7.1.12\n  ToString(realm: Realm, val: string | ConcreteValue): string,\n\n  ToStringPartial(realm: Realm, val: string | Value): string,\n\n  ToStringValue(realm: Realm, val: Value): Value,\n\n  ToStringAbstract(realm: Realm, val: AbstractValue): AbstractValue,\n\n  // ECMA262 7.1.2\n  ToBoolean(realm: Realm, val: ConcreteValue): boolean,\n\n  ToBooleanPartial(realm: Realm, val: Value): boolean,\n\n  // ECMA262 7.1.14\n  ToPropertyKey(realm: Realm, arg: ConcreteValue): SymbolValue | string /* but not StringValue */,\n\n  ToPropertyKeyPartial(realm: Realm, arg: Value): AbstractValue | SymbolValue | string /* but not StringValue */,\n\n  // ECMA262 7.1.16\n  CanonicalNumericIndexString(realm: Realm, argument: StringValue): number | void,\n};\n\nexport type ConcretizeType = (realm: Realm, val: Value) => ConcreteValue;\n\nexport type DisplayResult = {} | string;\n\nexport type UtilsType = {|\n  typeToString: (typeof Value) => void | string,\n  getTypeFromName: string => void | typeof Value,\n  describeValue: Value => string,\n  jsonToDisplayString: <T: { toDisplayJson(number): DisplayResult }>(T, number) => string,\n  verboseToDisplayJson: ({}, number) => DisplayResult,\n  createModelledFunctionCall: (Realm, FunctionValue, void | string | ArgModel, void | Value) => void => Value,\n  isBindingMutationOutsideFunction: (binding: Binding, bindingEntry: BindingEntry, F: FunctionValue) => boolean,\n  areEffectsPure: (realm: Realm, effects: Effects, F: FunctionValue) => boolean,\n  reportSideEffectsFromEffects: (\n    realm: Realm,\n    effects: Effects,\n    F: FunctionValue,\n    sideEffectCallback: SideEffectCallback\n  ) => void,\n|};\n\nexport type DebuggerConfigArguments = {\n  diagnosticSeverity?: Severity,\n  sourcemaps?: Array<SourceFile>,\n  buckRoot?: string,\n  debugChannel?: DebugChannel,\n};\n\nexport type SupportedGraphQLGetters =\n  | \"bool\"\n  | \"double\"\n  | \"int\"\n  | \"time\"\n  | \"string\"\n  | \"tree\"\n  | \"bool_list\"\n  | \"double_list\"\n  | \"int_list\"\n  | \"time_list\"\n  | \"string_list\"\n  | \"tree_list\";\n\nexport interface ShapeInformationInterface {\n  getPropertyShape(key: string): void | ShapeInformationInterface;\n  getGetter(): void | SupportedGraphQLGetters;\n  getAbstractType(): typeof Value;\n}\n\ntype ECMAScriptType =\n  | \"void\"\n  | \"null\"\n  | \"boolean\"\n  | \"string\"\n  | \"symbol\"\n  | \"number\"\n  | \"object\"\n  | \"array\"\n  | \"function\"\n  | \"integral\";\n\ntype ShapeDescriptorCommon = {\n  jsType: ECMAScriptType,\n  graphQLType?: string,\n};\n\nexport type ShapePropertyDescriptor = {\n  shape: ShapeDescriptor,\n  optional: boolean,\n};\n\ntype ShapeDescriptorOfObject = ShapeDescriptorCommon & {\n  kind: \"object\",\n  properties: { [string]: void | ShapePropertyDescriptor },\n};\n\ntype ShapeDescriptorOfArray = ShapeDescriptorCommon & {\n  kind: \"array\",\n  elementShape: void | ShapePropertyDescriptor,\n};\n\ntype ShapeDescriptorOfLink = ShapeDescriptorCommon & {\n  kind: \"link\",\n  shapeName: string,\n};\n\ntype ShapeDescriptorOfPrimitive = ShapeDescriptorCommon & {\n  kind: \"scalar\",\n};\n\ntype ShapeDescriptorOfEnum = ShapeDescriptorCommon & {\n  kind: \"enum\",\n};\n\nexport type ShapeDescriptorNonLink =\n  | ShapeDescriptorOfObject\n  | ShapeDescriptorOfArray\n  | ShapeDescriptorOfPrimitive\n  | ShapeDescriptorOfEnum;\n\nexport type ShapeDescriptor = ShapeDescriptorNonLink | ShapeDescriptorOfLink;\n\nexport type ShapeUniverse = { [string]: ShapeDescriptor };\n\nexport type ArgModel = {\n  universe: ShapeUniverse,\n  arguments: { [string]: string },\n};\n\nexport type DebugReproManagerType = {\n  construct(configArgs: DebugReproArguments): void,\n  addSourceFile(fileName: string): void,\n  getSourceFilePaths(): Array<{ absolute: string, relative: string }>,\n  getSourceMapPaths(): Array<string>,\n};\n\nexport type DebugReproArguments = {\n  sourcemaps?: Array<SourceFile>,\n  buckRoot?: string,\n};\n"
  },
  {
    "path": "src/utils/ConcreteModelConverter.js",
    "content": "/**\n * Copyright (c) 2017-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n/* @flow */\n\n/**\n * This file contains code that converts abstract models into concrete values.\n */\n\nimport type { Realm } from \"../realm.js\";\nimport type { BabelNodeSourceLocation } from \"@babel/types\";\nimport {\n  AbstractObjectValue,\n  AbstractValue,\n  BooleanValue,\n  ConcreteValue,\n  FunctionValue,\n  NullValue,\n  NumberValue,\n  ObjectValue,\n  StringValue,\n  SymbolValue,\n  UndefinedValue,\n  PrimitiveValue,\n  ArrayValue,\n  ECMAScriptSourceFunctionValue,\n  Value,\n} from \"../values/index.js\";\nimport * as t from \"@babel/types\";\nimport invariant from \"../invariant.js\";\nimport { CompilerDiagnostic } from \"../errors.js\";\nimport { EnumerableOwnProperties, Get } from \"../methods/index.js\";\nimport { Create } from \"../singletons.js\";\n\nfunction reportCompileError(realm: Realm, message: string, loc: ?BabelNodeSourceLocation) {\n  let error = new CompilerDiagnostic(message, loc, \"PP9000\", \"RecoverableError\");\n  realm.handleError(error);\n}\n\nfunction createEmptyFunction(realm: Realm) {\n  const concreteFunction = new ECMAScriptSourceFunctionValue(realm);\n  concreteFunction.initialize([], t.blockStatement([]));\n  return concreteFunction;\n}\n\n/**\n * Convert abstract model value into concrete value.\n */\nexport function concretize(realm: Realm, val: Value): ConcreteValue {\n  if (val instanceof ConcreteValue) {\n    return val;\n  }\n  invariant(val instanceof AbstractValue);\n  if (val.kind === \"abstractConcreteUnion\") {\n    invariant(val.args.length >= 2);\n    return concretize(realm, val.args[0]);\n  }\n  const type = val.types.getType();\n  if (val.types.isTop()) {\n    return new UndefinedValue(realm);\n  } else if ((type: any).prototype instanceof PrimitiveValue) {\n    if (val.values.isTop()) {\n      switch (type) {\n        case StringValue:\n          return new StringValue(realm, \"__concreteModel\");\n        case NumberValue:\n          return new NumberValue(realm, 42);\n        case SymbolValue:\n          return new SymbolValue(realm, new StringValue(realm, \"__concreteModel\"));\n        case BooleanValue:\n          return new BooleanValue(realm, true);\n        case NullValue:\n          return new NullValue(realm);\n        case UndefinedValue:\n          return new UndefinedValue(realm);\n        default:\n          invariant(false, \"Not yet implemented\");\n      }\n    } else {\n      // TODO: This was broken. Is this actually used?\n      const values = val.values.getElements();\n      invariant(values.size === 1, \"Concrete model should only have one value\");\n      for (let value in values) {\n        invariant(value instanceof ConcreteValue, \"Concrete model should only contain one concrete value\");\n        return value;\n      }\n      invariant(false);\n    }\n  } else if (type === FunctionValue) {\n    return createEmptyFunction(realm);\n  } else if (type === ArrayValue) {\n    reportCompileError(\n      realm,\n      \"Emitting a concrete model for abstract array value is not supported yet.\",\n      val.expressionLocation\n    );\n  } else if (val instanceof AbstractObjectValue) {\n    if (val.values.isTop()) {\n      return new ObjectValue(realm);\n    } else {\n      let template = val.getTemplate();\n      let concreteObj = Create.ObjectCreate(realm, template.$GetPrototypeOf());\n      let keys = EnumerableOwnProperties(realm, template, \"key\", true);\n      for (let P of keys) {\n        invariant(P instanceof StringValue);\n        let newElement = Get(realm, template, P);\n        Create.CreateDataProperty(realm, concreteObj, P, concretize(realm, newElement));\n      }\n      return concreteObj;\n    }\n  }\n  reportCompileError(\n    realm,\n    \"Emitting a concrete model for this abstract value is not supported yet.\",\n    val.expressionLocation\n  );\n  // Return undefined to make flow happy.\n  return new UndefinedValue(realm);\n}\n"
  },
  {
    "path": "src/utils/DebugReproManager.js",
    "content": "/**\n * Copyright (c) 2017-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n/* @flow strict-local */\n\nimport { SourceMapManager } from \"./SourceMapManager.js\";\nimport type { DebugReproArguments } from \"../types.js\";\n\n/**\n * Manager that captures name of all original sourcefiles touched by Prepack.\n * When Prepack exits (regardless of success or failure), the list of all\n * relevant sourcefiles is passed back to the CLI to be included in the reproBundle.\n */\nexport class DebugReproManagerImplementation {\n  construct(configArgs: DebugReproArguments): DebugReproManagerImplementation {\n    this._sourceMapManager = new SourceMapManager(configArgs.buckRoot, configArgs.sourcemaps);\n    if (configArgs.sourcemaps) {\n      this._sourceMapNames = [];\n      configArgs.sourcemaps.forEach(m => {\n        if (m.sourceMapFilename !== undefined) this._sourceMapNames.push(m.sourceMapFilename);\n      });\n    }\n    this._usedSourceFiles = new Set();\n\n    return this;\n  }\n\n  // Manager to translate between relative/absolute paths used by sourceMaps/Filesystem.\n  _sourceMapManager: SourceMapManager;\n  // Set of source files (to handle repeat additions) that Prepack encounters.\n  _usedSourceFiles: Set<string>;\n  // The actual sourcemaps associated with the input.\n  _sourceMapNames: Array<string>;\n\n  addSourceFile(fileName: string) {\n    if (!fileName.includes(\"node_modules\"))\n      this._usedSourceFiles.add(this._sourceMapManager.relativeToAbsolute(fileName));\n  }\n\n  getSourceFilePaths(): Array<{ absolute: string, relative: string }> {\n    return Array.from(this._usedSourceFiles).map(absolutePath => {\n      return {\n        absolute: absolutePath,\n        relative: this._sourceMapManager.absoluteToRelative(absolutePath),\n      };\n    });\n  }\n\n  getSourceMapPaths(): Array<string> {\n    return this._sourceMapNames;\n  }\n}\n"
  },
  {
    "path": "src/utils/DebugReproPackager.js",
    "content": "/**\n * Copyright (c) 2017-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n/* @flow-strict */\n\n/* eslint-disable no-shadow */\n\nimport zipFactory from \"node-zip\";\nimport zipdir from \"zip-dir\";\nimport path from \"path\";\nimport child_process from \"child_process\";\nimport fs from \"fs\";\n\nexport class DebugReproPackager {\n  constructor() {\n    this._reproZip = zipFactory();\n    return;\n  }\n\n  _reproZip: zipFactory;\n\n  _generateZip(\n    reproArguments: Array<string>,\n    reproFileNames: Array<string>,\n    reproFilePath: string,\n    runtimeDir: string\n  ): void {\n    // Programatically assemble parameters to debugger.\n    let reproScriptArguments = `prepackArguments=${reproArguments.map(a => `${a}`).join(\"&prepackArguments=\")}`;\n    let reproScriptSourceFiles = `sourceFiles=$(pwd)/${reproFileNames\n      .map(f => `${path.basename(f)}`)\n      .join(\"&sourceFiles=$(pwd)/\")}`;\n\n    // Generating script that `yarn install`s prepack dependencies.\n    // Then assembles a Nuclide deeplink that reflects the copy of Prepack in the package,\n    // the prepack arguments that this run was started with, and the input files being prepacked.\n    // The link is then called to open the Nuclide debugger.\n    this._reproZip.file(\n      \"repro.sh\",\n      `#!/bin/bash\n      unzip prepack-runtime-bundle.zip\n      yarn install\n      PREPACK_RUNTIME=\"prepackRuntime=$(pwd)/${runtimeDir}/prepack-cli.js\"\n      PREPACK_ARGUMENTS=\"${reproScriptArguments}\"\n      PREPACK_SOURCEFILES=\"${reproScriptSourceFiles}\"\n      atom \\\"atom://nuclide/prepack-debugger?$PREPACK_SOURCEFILES&$PREPACK_RUNTIME&$PREPACK_ARGUMENTS\\\"\n      `\n    );\n    const data = this._reproZip.generate({ base64: false, compression: \"DEFLATE\" });\n    if (reproFilePath) {\n      fs.writeFileSync(reproFilePath, data, \"binary\");\n      console.log(`ReproBundle written to ${reproFilePath}`);\n    }\n  }\n\n  // Returns true on success, false on failure\n  generateDebugRepro(\n    shouldExitWithError: boolean,\n    sourceFiles: Array<{ absolute: string, relative: string }>,\n    sourceMaps: Array<string>,\n    reproFilePath: string,\n    reproFileNames: Array<string>,\n    reproArguments: Array<string>,\n    externalPrepackPath?: string\n  ): void {\n    if (reproFilePath === undefined) process.exit(1);\n\n    // Copy all input files.\n    for (let file of reproFileNames) {\n      try {\n        let content = fs.readFileSync(file, \"utf8\");\n        this._reproZip.file(path.basename(file), content);\n      } catch (err) {\n        console.error(`Could not zip input file ${err}`);\n        if (shouldExitWithError) process.exit(1);\n        else return;\n      }\n    }\n\n    // Copy all sourcemaps (discovered while prepacking).\n    for (let map of sourceMaps) {\n      try {\n        let content = fs.readFileSync(map, \"utf8\");\n        this._reproZip.file(path.basename(map), content);\n      } catch (err) {\n        console.error(`Could not zip sourcemap: ${err}`);\n        if (shouldExitWithError) process.exit(1);\n        else return;\n      }\n    }\n\n    // Copy all original sourcefiles used while Prepacking.\n    for (let file of sourceFiles) {\n      try {\n        // To avoid copying the \"/User/name/...\" version of the bundle/map/model included in originalSourceFiles\n        if (!reproFileNames.includes(file.relative)) {\n          let content = fs.readFileSync(file.absolute, \"utf8\");\n          this._reproZip.file(file.relative, content);\n        }\n      } catch (err) {\n        console.error(`Could not zip source file: ${err}. Proceeding...`);\n      }\n    }\n\n    // If not told where to copy prepack from, try to yarn pack it up.\n    if (externalPrepackPath === undefined) {\n      // Copy Prepack lib and package.json to install dependencies.\n      // The `yarn pack` command finds all necessary files automatically.\n      // The following steps need to be sequential, hence the series of `.on(\"exit\")` callbacks.\n      let yarnRuntime = \"yarn\";\n      let yarnCommand = [\"pack\", \"--filename\", path.resolve(process.cwd(), \"prepack-bundled.tgz\")];\n      child_process.spawnSync(yarnRuntime, yarnCommand, { cwd: __dirname });\n      // Because zipping the .tgz causes corruption issues when unzipping, we will\n      // unpack the .tgz, then zip those contents.\n      let unzipRuntime = \"tar\";\n      let unzipCommand = [\"-xzf\", path.resolve(`.`, \"prepack-bundled.tgz\")];\n      child_process.spawnSync(unzipRuntime, unzipCommand);\n      // Note that this process is asynchronous. A process.exit() elsewhere in this cli code\n      // might cause the whole process (including an ongoing zip) to prematurely terminate.\n      zipdir(path.resolve(\".\", \"package\"), (err, buffer) => {\n        if (err) {\n          console.error(`Could not zip Prepack ${err}`);\n          process.exit(1);\n        }\n\n        this._reproZip.file(\"prepack-runtime-bundle.zip\", buffer);\n        this._generateZip(reproArguments, reproFileNames, reproFilePath, \"lib\");\n\n        if (shouldExitWithError) process.exit(1);\n      });\n    } else {\n      try {\n        let prepackContent = fs.readFileSync(externalPrepackPath);\n        this._reproZip.file(\"prepack-runtime-bundle.zip\", prepackContent);\n        this._generateZip(reproArguments, reproFileNames, reproFilePath, \"src\");\n      } catch (err) {\n        console.error(`Could not zip prepack from given path: ${err}`);\n        process.exit(1);\n      }\n      if (shouldExitWithError) process.exit(1);\n    }\n  }\n}\n"
  },
  {
    "path": "src/utils/HeapInspector.js",
    "content": "/**\n * Copyright (c) 2017-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n/* @flow strict-local */\n\nimport { Realm } from \"../realm.js\";\nimport type { Descriptor } from \"../types.js\";\nimport { IsArray } from \"../methods/index.js\";\nimport {\n  AbstractValue,\n  BooleanValue,\n  ConcreteValue,\n  ECMAScriptSourceFunctionValue,\n  FunctionValue,\n  NumberValue,\n  ObjectValue,\n  PrimitiveValue,\n  ProxyValue,\n  SymbolValue,\n  UndefinedValue,\n  Value,\n} from \"../values/index.js\";\nimport { To } from \"../singletons.js\";\nimport invariant from \"../invariant.js\";\nimport { Logger } from \"./logger.js\";\nimport { PropertyDescriptor, AbstractJoinedDescriptor } from \"../descriptors.js\";\n\ntype TargetIntegrityCommand = \"freeze\" | \"seal\" | \"preventExtensions\" | \"\";\n\nfunction hasAnyConfigurable(desc: void | Descriptor): boolean {\n  if (!desc) {\n    return false;\n  }\n  if (desc instanceof PropertyDescriptor) {\n    return !!desc.configurable;\n  }\n  if (desc instanceof AbstractJoinedDescriptor) {\n    return hasAnyConfigurable(desc.descriptor1) || hasAnyConfigurable(desc.descriptor2);\n  }\n  invariant(false, \"internal slots aren't covered here\");\n}\n\nfunction hasAnyWritable(desc: void | Descriptor): boolean {\n  if (!desc) {\n    return false;\n  }\n  if (desc instanceof PropertyDescriptor) {\n    return desc.value !== undefined && !!desc.writable;\n  }\n  if (desc instanceof AbstractJoinedDescriptor) {\n    return hasAnyWritable(desc.descriptor1) || hasAnyWritable(desc.descriptor2);\n  }\n  invariant(false, \"internal slots aren't covered here\");\n}\n\nexport class HeapInspector {\n  constructor(realm: Realm, logger: Logger) {\n    this.realm = realm;\n    this.logger = logger;\n    this.ignoredProperties = new Map();\n    this._targetIntegrityCommands = new Map();\n  }\n\n  realm: Realm;\n  logger: Logger;\n  ignoredProperties: Map<ObjectValue, Set<string>>;\n  _targetIntegrityCommands: Map<ObjectValue, TargetIntegrityCommand>;\n\n  getTargetIntegrityCommand(val: ObjectValue): TargetIntegrityCommand {\n    let command = this._targetIntegrityCommands.get(val);\n    if (command === undefined) {\n      command = \"\";\n      if (val instanceof ProxyValue) {\n        // proxies don't participate in regular object freezing/sealing,\n        // only their underlying proxied objects do\n      } else {\n        let extensible = val.$Extensible;\n        if (!(extensible instanceof BooleanValue)) {\n          this.logger.logError(\n            val,\n            \"Object that might or might not be sealed or frozen are not supported in residual heap.\"\n          );\n        } else if (!extensible.value) {\n          let anyWritable = false,\n            anyConfigurable = false;\n          for (let propertyBinding of val.properties.values()) {\n            let desc = propertyBinding.descriptor;\n            if (desc === undefined) continue; //deleted\n            if (hasAnyConfigurable(desc)) anyConfigurable = true;\n            else if (hasAnyWritable(desc)) anyWritable = true;\n          }\n          command = anyConfigurable ? \"preventExtensions\" : anyWritable ? \"seal\" : \"freeze\";\n        }\n      }\n      this._targetIntegrityCommands.set(val, command);\n    }\n    return command;\n  }\n\n  static _integrityDescriptors = {\n    \"\": { writable: true, configurable: true },\n    preventExtensions: { writable: true, configurable: true },\n    seal: { writable: true, configurable: false },\n    freeze: { writable: false, configurable: false },\n  };\n\n  getTargetIntegrityDescriptor(val: ObjectValue): { writable: boolean, configurable: boolean } {\n    return HeapInspector._integrityDescriptors[this.getTargetIntegrityCommand(val)];\n  }\n\n  static isLeaf(val: Value): boolean {\n    if (val instanceof SymbolValue) {\n      return false;\n    }\n\n    if (val instanceof AbstractValue) {\n      if (val.hasIdentifier()) {\n        return true;\n      }\n\n      if (\n        val.$Realm.instantRender.enabled &&\n        val.intrinsicName !== undefined &&\n        val.intrinsicName.startsWith(\"__native\")\n      ) {\n        // Never factor out multiple occurrences of InstantRender's __native... abstract functions.\n        return true;\n      }\n    }\n\n    if (val.isIntrinsic()) {\n      return false;\n    }\n\n    return val instanceof PrimitiveValue;\n  }\n\n  // Object properties which have the default value can be ignored by the serializer.\n  canIgnoreProperty(val: ObjectValue, key: string): boolean {\n    let set = this.ignoredProperties.get(val);\n    if (!set) {\n      this.ignoredProperties.set(val, (set = this._getIgnoredProperties(val)));\n    }\n    return set.has(key);\n  }\n\n  _getIgnoredProperties(val: ObjectValue): Set<string> {\n    let set: Set<string> = new Set();\n    for (let [key, propertyBinding] of val.properties) {\n      invariant(propertyBinding);\n      let desc = propertyBinding.descriptor;\n      if (desc === undefined) continue; //deleted\n      if (this._canIgnoreProperty(val, key, desc)) set.add(key);\n    }\n    return set;\n  }\n\n  _canIgnoreProperty(val: ObjectValue, key: string, desc: Descriptor): boolean {\n    if (!(desc instanceof PropertyDescriptor)) {\n      // If we have a joined descriptor, there is at least one variant that isn't the same as\n      // the target descriptor. Since the two descriptors won't be equal.\n      return false;\n    }\n\n    let targetDescriptor = this.getTargetIntegrityDescriptor(val);\n\n    if (IsArray(this.realm, val)) {\n      if (\n        key === \"length\" &&\n        desc.writable === targetDescriptor.writable &&\n        desc.enumerable !== true &&\n        desc.configurable !== true\n      ) {\n        // length property has the correct descriptor values\n        return true;\n      }\n    } else if (val instanceof FunctionValue) {\n      if (key === \"length\") {\n        if (desc.value === undefined) {\n          this.logger.logError(val, \"Functions with length accessor properties are not supported in residual heap.\");\n          // Rationale: .bind() would call the accessor, which might throw, mutate state, or do whatever...\n        }\n        // length property will be inferred already by the amount of parameters\n        return (\n          desc.writable !== true &&\n          desc.enumerable !== true &&\n          desc.configurable === targetDescriptor.configurable &&\n          val.hasDefaultLength()\n        );\n      }\n\n      if (key === \"name\") {\n        // TODO #474: Make sure that we retain original function names. Or set name property.\n        // Or ensure that nothing references the name property.\n        // NOTE: with some old runtimes notably JSC, function names are not configurable\n        // For now don't ignore the property if it is different from the function name.\n        // I.e. if it was set explicitly in the code, retain it.\n        if (\n          desc.value !== undefined &&\n          !this.realm.isCompatibleWith(this.realm.MOBILE_JSC_VERSION) &&\n          !this.realm.isCompatibleWith(\"mobile\") &&\n          (desc.value instanceof AbstractValue ||\n            (desc.value instanceof ConcreteValue &&\n              val.__originalName !== undefined &&\n              val.__originalName !== \"\" &&\n              To.ToString(this.realm, desc.value) !== val.__originalName))\n        )\n          return false;\n        return true;\n      }\n\n      // Properties `caller` and `arguments` are added to normal functions in non-strict mode to prevent TypeErrors.\n      // Because they are autogenerated, they should be ignored.\n      if (key === \"arguments\" || key === \"caller\") {\n        invariant(val instanceof ECMAScriptSourceFunctionValue);\n        if (\n          !val.$Strict &&\n          desc.writable === (!val.$Strict && targetDescriptor.writable) &&\n          desc.enumerable !== true &&\n          desc.configurable === targetDescriptor.configurable &&\n          desc.value instanceof UndefinedValue &&\n          val.$FunctionKind === \"normal\"\n        )\n          return true;\n      }\n\n      // ignore the `prototype` property when it's the right one\n      if (key === \"prototype\") {\n        if (\n          desc.configurable !== true &&\n          desc.enumerable !== true &&\n          desc.writable === targetDescriptor.writable &&\n          desc.value instanceof ObjectValue &&\n          desc.value.originalConstructor === val\n        ) {\n          return true;\n        }\n      }\n    } else {\n      let kind = val.getKind();\n      switch (kind) {\n        case \"RegExp\":\n          if (\n            key === \"lastIndex\" &&\n            desc.writable === targetDescriptor.writable &&\n            desc.enumerable !== true &&\n            desc.configurable !== true\n          ) {\n            // length property has the correct descriptor values\n            let v = desc.value;\n            return v instanceof NumberValue && v.value === 0;\n          }\n          break;\n        default:\n          break;\n      }\n    }\n\n    if (key === \"constructor\") {\n      if (\n        desc.configurable === targetDescriptor.configurable &&\n        desc.enumerable !== true &&\n        desc.writable === targetDescriptor.writable &&\n        desc.value === val.originalConstructor\n      )\n        return true;\n    }\n\n    return false;\n  }\n\n  static getPropertyValue(val: ObjectValue, name: string): void | Value {\n    let prototypeBinding = val.properties.get(name);\n    if (prototypeBinding === undefined) return undefined;\n    let prototypeDesc = prototypeBinding.descriptor;\n    if (prototypeDesc === undefined) return undefined;\n    invariant(prototypeDesc instanceof PropertyDescriptor);\n    invariant(prototypeDesc.value === undefined || prototypeDesc.value instanceof Value);\n    return prototypeDesc.value;\n  }\n\n  isDefaultPrototype(prototype: ObjectValue): boolean {\n    if (\n      prototype.symbols.size !== 0 ||\n      prototype.$Prototype !== this.realm.intrinsics.ObjectPrototype ||\n      prototype.$Extensible.mightNotBeTrue()\n    ) {\n      return false;\n    }\n    let foundConstructor = false;\n    for (let name of prototype.properties.keys())\n      if (name === \"constructor\" && HeapInspector.getPropertyValue(prototype, name) === prototype.originalConstructor)\n        foundConstructor = true;\n      else return false;\n    return foundConstructor;\n  }\n}\n"
  },
  {
    "path": "src/utils/JSONTokenizer.js",
    "content": "/**\n * Copyright (c) 2017-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n/* @flow */\n\nimport invariant from \"../invariant.js\";\n\n// JSON.stringify is not the right choice when writing out giant objects\n// to disk. This is an alternative that produces a stream of tokens incrementally\n// instead of building a giant in-memory representation first.\n// The exported function returns a function that, when called repeatedly,\n// provides all the strings that when concatenated together produce the\n// result JSON.stringified would have produced on the data.\n// After all strings have been provided, the final answer will be undefined.\nexport default (data: any): (() => void | string) => {\n  // $FlowFixMe: \"symbol\" not yet supported by Flow\n  let isLegal = x => x !== undefined && typeof x !== \"function\" && typeof x !== \"symbol\";\n  invariant(isLegal(data));\n  let pushData = (stack, x) => stack.push(typeof x === \"object\" && x !== null ? x : JSON.stringify(x));\n  let stack = [];\n  pushData(stack, data);\n  let visited = new Set();\n  return () => {\n    while (stack.length > 0) {\n      data = stack.pop();\n      if (typeof data === \"string\") return data;\n      invariant(typeof data === \"object\" && data !== null);\n      if (visited.has(data)) throw new TypeError(\"Converting circular structure to JSON\");\n      visited.add(data);\n      if (Array.isArray(data)) {\n        stack.push(\"]\");\n        for (let i = data.length - 1; i >= 0; i--) {\n          let value = data[i];\n          pushData(stack, isLegal(value) ? value : null);\n          if (i > 0) stack.push(\",\");\n        }\n        stack.push(\"[\");\n      } else {\n        stack.push(\"}\");\n        let reversedStack = [];\n        for (let key in data) {\n          // $FlowFixMe: \"symbol\" not yet supported by Flow\n          if (typeof key === \"symbol\") continue;\n          let value = data[key];\n          if (!isLegal(value)) continue;\n          if (reversedStack.length > 0) reversedStack.push(\",\");\n          reversedStack.push(JSON.stringify(key));\n          reversedStack.push(\":\");\n          pushData(reversedStack, value);\n        }\n        stack.push(...reversedStack.reverse());\n        stack.push(\"{\");\n      }\n    }\n  };\n};\n"
  },
  {
    "path": "src/utils/NameGenerator.js",
    "content": "/**\n * Copyright (c) 2017-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n/* @flow */\n\nimport invariant from \"../invariant.js\";\n\nfunction escapeInvalidIdentifierCharacters(s: string): string {\n  let res = \"\";\n  for (let c of s)\n    if ((c >= \"0\" && c <= \"9\") || (c >= \"a\" && c <= \"z\") || (c >= \"A\" && c <= \"Z\")) res += c;\n    else res += \"_\" + c.charCodeAt(0);\n  return res;\n}\n\nconst base62characters = \"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz\";\nfunction base62encode(n: number): string {\n  invariant((n | 0) === n && n >= 0);\n  if (n === 0) return \"0\";\n  let s = \"\";\n  while (n > 0) {\n    let f = n % base62characters.length;\n    s = base62characters[f] + s;\n    n = (n - f) / base62characters.length;\n  }\n  return s;\n}\n\nexport class NameGenerator {\n  constructor(forbiddenNames: Set<string>, debugNames: boolean, uniqueSuffix: string, prefix: string) {\n    this.prefix = prefix;\n    this.uidCounter = 0;\n    this.debugNames = debugNames;\n    this.forbiddenNames = forbiddenNames;\n    this.uniqueSuffix = uniqueSuffix;\n  }\n  prefix: string;\n  uidCounter: number;\n  debugNames: boolean;\n  forbiddenNames: Set<string>;\n  uniqueSuffix: string;\n  generate(debugSuffix: ?string): string {\n    let id;\n    do {\n      id = this.prefix + base62encode(this.uidCounter++);\n      if (this.uniqueSuffix.length > 0) id += this.uniqueSuffix;\n      if (this.debugNames) {\n        if (debugSuffix) id += \"_\" + escapeInvalidIdentifierCharacters(debugSuffix);\n        else id += \"_\";\n      }\n    } while (this.forbiddenNames.has(id));\n    return id;\n  }\n}\n"
  },
  {
    "path": "src/utils/PreludeGenerator.js",
    "content": "/**\n * Copyright (c) 2017-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n/* @flow */\n\nimport * as t from \"@babel/types\";\nimport { memberExpressionHelper } from \"./babelhelpers.js\";\nimport type {\n  BabelNodeIdentifier,\n  BabelNodeThisExpression,\n  BabelNodeStatement,\n  BabelNodeMemberExpression,\n  BabelNodeExpression,\n} from \"@babel/types\";\nimport { NameGenerator } from \"./NameGenerator.js\";\nimport buildTemplate from \"@babel/template\";\nimport invariant from \"../invariant.js\";\n\nexport const Placeholders = \"ABCDEFGHIJKLMNOPQRSTUVWXYZ\".split(\"\");\nconst placeholderDefaultWhiteList = new Set([\"global\"]);\nconst placeholderWhitelist = new Set([...placeholderDefaultWhiteList, ...Placeholders]);\nexport const DisablePlaceholderSuffix = \"// disable placeholders\";\n\nexport class PreludeGenerator {\n  constructor(debugNames: ?boolean, uniqueSuffix: ?string) {\n    this.prelude = [];\n    this.memoizedRefs = new Map();\n    this.nameGenerator = new NameGenerator(new Set(), !!debugNames, uniqueSuffix || \"\", \"_$\");\n    this.usesThis = false;\n    this.declaredGlobals = new Set();\n    this.nextInvariantId = 0;\n    this._expressionTemplates = new Map();\n  }\n\n  prelude: Array<BabelNodeStatement>;\n  memoizedRefs: Map<string, BabelNodeIdentifier>;\n  nameGenerator: NameGenerator;\n  usesThis: boolean;\n  declaredGlobals: Set<string>;\n  nextInvariantId: number;\n  _expressionTemplates: Map<string, ({}) => BabelNodeExpression>;\n\n  createNameGenerator(prefix: string): NameGenerator {\n    return new NameGenerator(\n      this.nameGenerator.forbiddenNames,\n      this.nameGenerator.debugNames,\n      this.nameGenerator.uniqueSuffix,\n      prefix\n    );\n  }\n\n  convertStringToMember(str: string): BabelNodeIdentifier | BabelNodeThisExpression | BabelNodeMemberExpression {\n    return str\n      .split(\".\")\n      .map(name => {\n        if (name === \"global\") {\n          return this.memoizeReference(name);\n        } else if (name === \"this\") {\n          return t.thisExpression();\n        } else {\n          return t.identifier(name);\n        }\n      })\n      .reduce((obj, prop) => t.memberExpression(obj, prop));\n  }\n\n  globalReference(key: string, globalScope: boolean = false): BabelNodeIdentifier | BabelNodeMemberExpression {\n    if (globalScope && t.isValidIdentifier(key)) return t.identifier(key);\n    return memberExpressionHelper(this.memoizeReference(\"global\"), key);\n  }\n\n  memoizeReference(key: string): BabelNodeIdentifier {\n    let ref = this.memoizedRefs.get(key);\n    if (ref) return ref;\n\n    let init;\n    if (key.includes(\"(\") || key.includes(\"[\")) {\n      // Horrible but effective hack:\n      // Some internal object have intrinsic names such as\n      //    ([][Symbol.iterator]().__proto__.__proto__)\n      // and\n      //    RegExp.prototype[Symbol.match]\n      // which get turned into a babel node here.\n      // TODO: We should properly parse such a string, and memoize all references in it separately.\n      // Instead, we just turn it into a funky identifier, which Babel seems to accept.\n      init = t.identifier(key);\n    } else if (key === \"global\") {\n      this.usesThis = true;\n      init = t.thisExpression();\n    } else {\n      let i = key.lastIndexOf(\".\");\n      if (i === -1) {\n        init = t.memberExpression(this.memoizeReference(\"global\"), t.identifier(key));\n      } else {\n        init = t.memberExpression(this.memoizeReference(key.substr(0, i)), t.identifier(key.substr(i + 1)));\n      }\n    }\n    ref = t.identifier(this.nameGenerator.generate(key));\n    this.prelude.push(t.variableDeclaration(\"var\", [t.variableDeclarator(ref, init)]));\n    this.memoizedRefs.set(key, ref);\n    return ref;\n  }\n\n  buildExpression(code: string, templateArguments: {}): BabelNodeExpression {\n    let disablePlaceholders = false;\n    const key = code;\n    let template = this._expressionTemplates.get(key);\n    if (template === undefined) {\n      if (code.endsWith(DisablePlaceholderSuffix)) {\n        code = code.substring(0, code.length - DisablePlaceholderSuffix.length);\n        disablePlaceholders = true;\n      }\n\n      template = buildTemplate(code, {\n        placeholderPattern: false,\n        placeholderWhitelist: disablePlaceholders ? placeholderDefaultWhiteList : placeholderWhitelist,\n      });\n\n      this._expressionTemplates.set(key, template);\n    }\n\n    if (code.includes(\"global\"))\n      templateArguments = Object.assign(\n        {\n          global: this.memoizeReference(\"global\"),\n        },\n        templateArguments\n      );\n\n    let result = (template(templateArguments): any).expression;\n    invariant(result !== undefined, \"Code does not represent an expression: \" + code);\n    return result;\n  }\n}\n"
  },
  {
    "path": "src/utils/ShapeInformation.js",
    "content": "/**\n * Copyright (c) 2017-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n/* @flow */\n\nimport { Utils } from \"../singletons.js\";\nimport { Value, StringValue } from \"../values/index.js\";\nimport type {\n  SupportedGraphQLGetters,\n  ShapeInformationInterface,\n  ShapeUniverse,\n  ShapeDescriptorNonLink,\n  ArgModel,\n  ShapeDescriptor,\n  ShapePropertyDescriptor,\n} from \"../types.js\";\nimport { FatalError, CompilerDiagnostic } from \"../errors.js\";\nimport { Realm } from \"../realm.js\";\n\nexport type ComponentModel = {\n  universe: ShapeUniverse,\n  component: { props: string },\n};\n\nexport class ShapeInformation implements ShapeInformationInterface {\n  constructor(\n    descriptor: ShapeDescriptorNonLink,\n    parentDescriptor: void | ShapeDescriptorNonLink,\n    parentKey: void | string,\n    universe: ShapeUniverse\n  ) {\n    this._descriptor = descriptor;\n    this._parentDescriptor = parentDescriptor;\n    this._parentKey = parentKey;\n    this._universe = universe;\n  }\n\n  _descriptor: ShapeDescriptorNonLink;\n  _parentDescriptor: void | ShapeDescriptorNonLink;\n  _parentKey: void | string;\n  _universe: ShapeUniverse;\n\n  getGetter(): void | SupportedGraphQLGetters {\n    // we want getter only for existing GraphQL objects\n    return this._parentDescriptor !== undefined &&\n      this._parentDescriptor.graphQLType !== undefined &&\n      this._parentDescriptor.kind === \"object\"\n      ? this._getAssociatedGetter()\n      : undefined;\n  }\n\n  getAbstractType(): typeof Value {\n    // we assume that value is not optional if it root\n    if (this._isOptional() || this._descriptor.jsType === \"void\" || this._descriptor.jsType === \"null\") {\n      return Value;\n    }\n    return Utils.getTypeFromName(this._descriptor.jsType) || Value;\n  }\n\n  getPropertyShape(key: string): void | ShapeInformation {\n    let property = this._getInformationForProperty(key);\n    return property !== undefined\n      ? ShapeInformation._resolveLinksAndWrap(property.shape, this._descriptor, key, this._universe)\n      : undefined;\n  }\n\n  static createForArgument(model: void | ArgModel, argname: string): void | ShapeInformation {\n    return model !== undefined\n      ? ShapeInformation._resolveLinksAndWrap(\n          model.universe[model.arguments[argname]],\n          undefined,\n          undefined,\n          model.universe\n        )\n      : undefined;\n  }\n\n  static createForReactComponentProps(model: void | ComponentModel): void | ShapeInformation {\n    return model !== undefined\n      ? ShapeInformation._resolveLinksAndWrap(\n          model.universe[model.component.props],\n          undefined,\n          undefined,\n          model.universe\n        )\n      : undefined;\n  }\n\n  _isOptional(): void | boolean {\n    if (this._parentDescriptor === undefined) {\n      return undefined;\n    }\n    switch (this._parentDescriptor.kind) {\n      case \"object\":\n        return this._parentKey !== undefined && this._parentDescriptor.properties[this._parentKey] !== undefined\n          ? this._parentDescriptor.properties[this._parentKey].optional\n          : undefined;\n      case \"array\":\n        return this._parentDescriptor.elementShape !== undefined\n          ? this._parentDescriptor.elementShape.optional\n          : undefined;\n      default:\n        return undefined;\n    }\n  }\n\n  _getInformationForProperty(key: string): void | ShapePropertyDescriptor {\n    switch (this._descriptor.kind) {\n      case \"object\":\n        return this._descriptor.properties[key];\n      case \"array\":\n        switch (key) {\n          case \"length\":\n            return ShapeInformation._arrayLengthProperty;\n          case \"prototype\":\n            return undefined;\n          default:\n            return this._descriptor.elementShape;\n        }\n      default:\n        // it is still legal to do member access on primitive value\n        // such as string\n        return undefined;\n    }\n  }\n\n  _getAssociatedGetter(): void | SupportedGraphQLGetters {\n    switch (this._descriptor.kind) {\n      case \"object\":\n        return \"tree\";\n      case \"array\":\n        let elementShape =\n          this._descriptor.elementShape !== undefined ? this._descriptor.elementShape.shape : undefined;\n        let innerShape = ShapeInformation._resolveLinksAndWrap(\n          elementShape,\n          this._descriptor,\n          undefined,\n          this._universe\n        );\n        if (innerShape === undefined) {\n          return undefined;\n        }\n        switch (innerShape._getAssociatedGetter()) {\n          case \"bool\":\n            return \"bool_list\";\n          case \"double\":\n            return \"double_list\";\n          case \"int\":\n            return \"int_list\";\n          case \"time\":\n            return \"time_list\";\n          case \"string\":\n            return \"string_list\";\n          case \"tree\":\n            return \"tree_list\";\n          // no support for nested arrays yet\n          default:\n            return undefined;\n        }\n      case \"scalar\":\n        switch (this._descriptor.graphQLType) {\n          case \"Color\":\n          case \"File\":\n          case \"ID\":\n          case \"String\":\n          case \"Url\":\n            return \"string\";\n          case \"Int\":\n          case \"Time\":\n            return \"int\";\n          case \"Float\":\n            return \"double\";\n          case \"Boolean\":\n            return \"bool\";\n          default:\n            return undefined;\n        }\n      case \"enum\":\n        return \"string\";\n      default:\n        return undefined;\n    }\n  }\n\n  static _resolveLinksAndWrap(\n    descriptor: void | ShapeDescriptor,\n    parentDescription: void | ShapeDescriptorNonLink,\n    parentKey: void | string,\n    universe: ShapeUniverse\n  ): void | ShapeInformation {\n    while (descriptor && descriptor.kind === \"link\") {\n      descriptor = universe[descriptor.shapeName];\n    }\n    return descriptor !== undefined\n      ? new ShapeInformation(descriptor, parentDescription, parentKey, universe)\n      : undefined;\n  }\n\n  static _arrayLengthProperty = {\n    shape: {\n      kind: \"scalar\",\n      jsType: \"integral\",\n    },\n    optional: false,\n  };\n}\n\n// TODO: do more full validation walking the whole shape\nexport function createAndValidateArgModel(realm: Realm, argModelString: Value): ArgModel | void {\n  let argModelError;\n  if (argModelString instanceof StringValue) {\n    try {\n      let argModel = JSON.parse(argModelString.value);\n      if (!argModel.universe)\n        argModelError = new CompilerDiagnostic(\n          \"ArgModel must contain a universe property containing a ShapeUniverse\",\n          realm.currentLocation,\n          \"PP1008\",\n          \"FatalError\"\n        );\n      if (!argModel.arguments)\n        argModelError = new CompilerDiagnostic(\n          \"ArgModel must contain an arguments property.\",\n          realm.currentLocation,\n          \"PP1008\",\n          \"FatalError\"\n        );\n      return (argModel: ArgModel);\n    } catch (e) {\n      argModelError = new CompilerDiagnostic(\n        \"Failed to parse model for arguments\",\n        realm.currentLocation,\n        \"PP1008\",\n        \"FatalError\"\n      );\n    }\n  } else {\n    argModelError = new CompilerDiagnostic(\"String expected as a model\", realm.currentLocation, \"PP1008\", \"FatalError\");\n  }\n  if (argModelError !== undefined && realm.handleError(argModelError) !== \"Recover\") {\n    throw new FatalError();\n  }\n  return undefined;\n}\n"
  },
  {
    "path": "src/utils/SourceMapManager.js",
    "content": "/**\n * Copyright (c) 2017-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n/* @flow strict-local */\n\nimport type { SourceFile } from \"../types.js\";\nimport invariant from \"../invariant.js\";\n\n/**\n * Sourcemap paths can come in one of two formats:\n *     - Relative: The paths include `../` and can be followed from the sourcemap's location\n *         to arrive at the original source's location. In this format, path conversion\n *         requires two different prefixes (MapDifference and CommonPrefix) that must be\n *         discovered from the input paths.\n *     - Common Directory: The paths take the format of an absolute path (`/foo/bar`) and\n *         assume there is a common prefix to the path that, when added, will make the path an\n *         valid absolute path. This prefix is passed in as the `buckRoot` argument.\n *     Example:\n *         In a directory structure with /A/B/map.js and /A/C/original.js,\n *         the sourcemaps would have the following path structures:\n *           - Relative: ../C/original.js, with `CP` = /A and 'MD' = ../\n *           - Common Directory: /C/original.js, with `buckRoot` = /A\n */\nexport class SourceMapManager {\n  constructor(buckRoot?: string, sourceMaps?: Array<SourceFile>) {\n    // Use presence of buck root argument to indicate which path format sourcemap prefixes take on.\n    if (buckRoot !== undefined) {\n      if (sourceMaps === undefined) {\n        throw new Error(\"Invalid input: Can't provide a sourcemap directory root without having sourcemaps present\");\n      }\n      this._buckRoot = buckRoot;\n      if (this._buckRoot[this._buckRoot.length - 1] === \"/\") {\n        // Remove trailing slash to prepare for prepending to internal paths.\n        this._buckRoot = this._buckRoot.slice(0, -1);\n      }\n    } else {\n      // If sourcemaps don't exist, set prefixes to undefined and break.\n      if (sourceMaps && sourceMaps.length > 0) {\n        for (let map of sourceMaps) {\n          if (map.sourceMapContents === undefined || map.sourceMapContents === \"\") {\n            this._sourcemapCommonPrefix = undefined;\n            this._sourcemapMapDifference = undefined;\n            return;\n          }\n        }\n      } else {\n        this._sourcemapCommonPrefix = undefined;\n        this._sourcemapMapDifference = undefined;\n        return;\n      }\n\n      // Extract common prefix and map difference\n      let originalSourcePaths = [];\n      let mapPaths = [];\n      for (let map of sourceMaps) {\n        invariant(map.sourceMapContents !== undefined); // Checked above.\n        let parsed = JSON.parse(map.sourceMapContents);\n        // Two formats for sourcemaps exist.\n        if (\"sections\" in parsed) {\n          for (let section of parsed.sections) {\n            for (let source of section.map.sources) {\n              originalSourcePaths.push(this._getAbsoluteSourcePath(map.filePath, source));\n            }\n          }\n        } else {\n          for (let source of parsed.sources) {\n            originalSourcePaths.push(this._getAbsoluteSourcePath(map.filePath, source));\n          }\n        }\n        mapPaths.push(this._stripEmptyStringBookends(map.filePath.split(\"/\")));\n      }\n\n      let originalSourceCommonPrefix = this._findCommonPrefix(originalSourcePaths);\n      let originalSourceCPElements = this._stripEmptyStringBookends(originalSourceCommonPrefix.split(\"/\"));\n      let mapCommonPrefix = this._findCommonPrefix(mapPaths);\n      let mapCPElements = this._stripEmptyStringBookends(mapCommonPrefix.split(\"/\"));\n\n      this._sourcemapCommonPrefix = this._findCommonPrefix([originalSourceCPElements, mapCPElements]);\n      this._sourcemapMapDifference = this._findMapDifference(this._sourcemapCommonPrefix, mapCommonPrefix);\n    }\n  }\n\n  // Prefixes used to translate between relative paths stored in AST nodes and absolute paths given to IDE.\n  _sourcemapCommonPrefix: void | string; // For paths relative to map location. (Used in Babel format)\n  _sourcemapMapDifference: void | string; // For paths relative to map location. (Used in Babel format)\n  _buckRoot: void | string; // For paths relative to directory root. (Used in Buck format)\n\n  /**\n   * Assumes that input file and sourcemap are in the same directory.\n   * Assumes pathToInput is an absolute path and pathToSource is relative.\n   * Uses pathToSource to find absolute path of original source file.\n   */\n  _getAbsoluteSourcePath(pathToInput: string, pathToSource: string): Array<string> {\n    // pathToInput is an absolute path to the file being prepacked.\n    let fullPath = this._stripEmptyStringBookends(pathToInput.split(\"/\"));\n    // Remove last entry because it is the filename, while we want the parent directory of the input file.\n    fullPath.pop();\n\n    // Traverse the path to the source file.\n    let steps = pathToSource.split(\"/\");\n    for (let step of steps) {\n      switch (step) {\n        case \".\":\n          break;\n        case \"..\":\n          fullPath.pop();\n          break;\n        default:\n          fullPath.push(step);\n          break;\n      }\n    }\n    return fullPath;\n  }\n\n  /**\n   * Finds the longest possible prefix common to all input paths.\n   * Input paths must be absolute.\n   * Input is nested array because each path must be separated into elements.\n   */\n  _findCommonPrefix(paths: Array<Array<string>>): string {\n    // Find the point at which the paths diverge.\n    let divergenceIndex = 0;\n    let allPathsMatch = true;\n    let maxDivergenceIndex = Math.max(...paths.map(path => path.length));\n\n    while (allPathsMatch && divergenceIndex < maxDivergenceIndex) {\n      let entry = paths[0][divergenceIndex]; // Arbitrary choice of 0th path, since we're checking if all entires match.\n      for (let path of paths) {\n        if (path[divergenceIndex] !== entry) {\n          allPathsMatch = false;\n          break;\n        }\n      }\n      if (allPathsMatch) divergenceIndex += 1;\n    }\n    // Edge case: if there's only one path, it will match itself, including the filename at the end.\n    // For 2+ paths, even if they all share a prefix, the filenames will not match, so this is not needed.\n    if (paths.length === 1) divergenceIndex -= 1;\n\n    // Concatenate prefix into string that's bookended by slashes for use as an absolute path prefix.\n    return `/${paths[0].slice(0, divergenceIndex).join(\"/\")}/`;\n  }\n\n  /**\n   * Finds the path that must be followed to arrive at the directory of the\n   * common prefix from the sourcemap.\n   */\n  _findMapDifference(commonPrefix: string, mapPrefix: string): string {\n    // Find difference in path between the map's location and the common prefix.\n    let mapPrefixUniqueElements = this._stripEmptyStringBookends(mapPrefix.replace(commonPrefix, \"\").split(\"/\"));\n    let mapDifference = \"\";\n    for (let i = 0; i < mapPrefixUniqueElements.length; i++) {\n      mapDifference = mapDifference.concat(\"../\");\n    }\n    return mapDifference;\n  }\n\n  /**\n   *  Takes in [\"\", \"foo\", \"bar\", \"\"] and returns [\"foo\", \"bar\"]\n   */\n  _stripEmptyStringBookends(path: Array<string>): Array<string> {\n    if (path[0] === \"\") path.shift();\n    if (path[path.length - 1] === \"\") path.pop();\n    return path;\n  }\n\n  /**\n   * Used by DebugAdapter to convert relative paths (used internally in debugging/Prepack engine)\n   * into absolute paths (used by debugging UI/IDE).\n   */\n  relativeToAbsolute(path: string): string {\n    let absolute;\n    if (this._buckRoot !== undefined) {\n      let dirRoot = this._buckRoot;\n      if (\n        // If the \"relative\" path is actually absolute, then don't prepend anything.\n        this._stripEmptyStringBookends(path.split(\"/\"))[0] ===\n        this._stripEmptyStringBookends(this._buckRoot.split(\"/\"))[0]\n      ) {\n        absolute = path;\n      } else {\n        let separator = path[0] === \"/\" ? \"\" : \"/\";\n        absolute = dirRoot + separator + path;\n      }\n    } else {\n      if (this._sourcemapCommonPrefix !== undefined && this._sourcemapMapDifference !== undefined) {\n        absolute = path.replace(this._sourcemapMapDifference, \"\");\n        invariant(this._sourcemapCommonPrefix !== undefined);\n        absolute = this._sourcemapCommonPrefix + absolute;\n      } else {\n        absolute = path;\n      }\n    }\n    return absolute;\n  }\n\n  /**\n   * Used by DebugAdapter to convert absolute paths (used by debugging UI/IDE)\n   * into relative paths (used internally in debugging/Prepack engine).\n   */\n  absoluteToRelative(path: string): string {\n    let relative;\n    if (this._buckRoot !== undefined) {\n      relative = path.replace(this._buckRoot, \"\");\n    } else {\n      if (this._sourcemapCommonPrefix !== undefined && this._sourcemapMapDifference !== undefined) {\n        relative = path.replace(this._sourcemapCommonPrefix, \"\");\n        invariant(this._sourcemapMapDifference !== undefined);\n        relative = this._sourcemapMapDifference + relative;\n      } else {\n        relative = path;\n      }\n    }\n    return relative;\n  }\n}\n"
  },
  {
    "path": "src/utils/TextPrinter.js",
    "content": "/**\n * Copyright (c) 2017-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n/* @flow */\n\nimport {\n  Completion,\n  SimpleNormalCompletion,\n  ThrowCompletion,\n  JoinedNormalAndAbruptCompletions,\n} from \"../completions.js\";\nimport type { Realm, Effects } from \"../realm.js\";\nimport type { Descriptor, PropertyBinding } from \"../types.js\";\nimport { PropertyDescriptor, InternalSlotDescriptor, AbstractJoinedDescriptor } from \"../descriptors.js\";\nimport {\n  EnvironmentRecord,\n  type Binding,\n  type LexicalEnvironment,\n  DeclarativeEnvironmentRecord,\n  FunctionEnvironmentRecord,\n  ObjectEnvironmentRecord,\n  GlobalEnvironmentRecord,\n} from \"../environment.js\";\nimport {\n  PrimitiveValue,\n  AbstractValue,\n  ObjectValue,\n  FunctionValue,\n  ECMAScriptSourceFunctionValue,\n  NativeFunctionValue,\n  BoundFunctionValue,\n  SymbolValue,\n  ProxyValue,\n  Value,\n  UndefinedValue,\n} from \"../values/index.js\";\nimport invariant from \"../invariant.js\";\nimport {\n  Printer,\n  Generator,\n  type OperationDescriptorType,\n  type CustomGeneratorEntryType,\n  type OperationDescriptorData,\n} from \"./generator.js\";\nimport * as t from \"@babel/types\";\n\nconst indent = \"  \";\n\nexport class TextPrinter implements Printer {\n  constructor(\n    printLine: string => void,\n    abstractValueIds?: Map<AbstractValue, number> = new Map(),\n    symbolIds?: Map<SymbolValue, number> = new Map()\n  ) {\n    this._printLine = printLine;\n    this._abstractValueIds = abstractValueIds;\n    this._symbolIds = symbolIds;\n    this._indent = \"\";\n    this._objects = new Set();\n    this._propertyBindings = new Set();\n    this._environmentRecords = new Set();\n    this._bindings = new Set();\n    this._lexicalEnvironments = new Set();\n    this._symbols = new Set();\n  }\n\n  _printLine: string => void;\n  _abstractValueIds: Map<AbstractValue, number>;\n  _symbolIds: Map<SymbolValue, number>;\n  _indent: string;\n  _objects: Set<ObjectValue>;\n  _propertyBindings: Set<PropertyBinding>;\n  _environmentRecords: Set<EnvironmentRecord>;\n  _bindings: Set<Binding>;\n  _lexicalEnvironments: Set<LexicalEnvironment>;\n  _symbols: Set<SymbolValue>;\n\n  _nest(): void {\n    this._indent += indent;\n  }\n  _unnest(): void {\n    this._indent = this._indent.substring(0, this._indent.length - indent.length);\n  }\n\n  _print(text: string): void {\n    this._printLine(this._indent + text);\n  }\n\n  _printDefinition(id: string, constructorName: string, args: Array<string>) {\n    this._print(`* ${id} = ${constructorName}(${args.join(\", \")})`);\n  }\n\n  printGeneratorEntry(\n    declared: void | AbstractValue | ObjectValue,\n    type: OperationDescriptorType | CustomGeneratorEntryType,\n    args: Array<Value>,\n    data: OperationDescriptorData,\n    metadata: { isPure: boolean, mutatesOnly: void | Array<Value> }\n  ): void {\n    switch (type) {\n      case \"DO_WHILE\":\n        invariant(data.value !== undefined);\n        this._print(`do while ${this.describeValue(data.value)}`);\n        this._nest();\n        const generator = data.generator;\n        invariant(generator !== undefined);\n        this.printGenerator(generator, \"body\");\n        this._unnest();\n        break;\n      case \"JOIN_GENERATORS\":\n        invariant(args.length === 1);\n        this._print(`if ${this.describeValue(args[0])}`);\n        this._nest();\n        const generators = data.generators;\n        invariant(generators !== undefined && generators.length === 2);\n        this.printGenerator(generators[0], \"then\");\n        this.printGenerator(generators[1], \"else\");\n        this._unnest();\n        break;\n      default:\n        let text;\n        if (declared !== undefined) {\n          invariant(declared.intrinsicName !== undefined);\n          text = `${this.describeExpression(declared.intrinsicName)} := `;\n        } else {\n          text = \"\";\n        }\n        text += type;\n\n        const dataTexts = [];\n        if (data.unaryOperator !== undefined) dataTexts.push(`unary ${data.unaryOperator}`); // used by UNARY_EXPRESSION\n        if (data.binaryOperator !== undefined) dataTexts.push(`binary ${data.binaryOperator}`); // used by BINARY_EXPRESSION\n        if (data.logicalOperator !== undefined) dataTexts.push(`logical ${data.logicalOperator}`); // used by LOGICAL_EXPRESSION\n        if (data.incrementor !== undefined) dataTexts.push(`incrementor ${data.incrementor}`); // used by UPDATE_INCREMENTOR\n        if (data.prefix !== undefined) dataTexts.push(\"prefix\"); // used by UNARY_EXPRESSION\n        if (data.binding !== undefined) dataTexts.push(`binding ${this.describeBinding(data.binding)}`); // used by GET_BINDING\n        if (data.propertyBinding !== undefined)\n          dataTexts.push(`property binding ${this.describePropertyBinding(data.propertyBinding)}`); // used by LOGICAL_PROPERTY_ASSIGNMENT\n        if (data.object !== undefined) dataTexts.push(`object ${this.describeValue(data.object)}`); // used by DEFINE_PROPERTY\n        if (data.descriptor !== undefined) dataTexts.push(`desc ${this.describeDescriptor(data.descriptor)}`); // used by DEFINE_PROPERTY\n        if (data.value !== undefined) dataTexts.push(`value ${this.describeValue(data.value)}`); // used by DO_WHILE, CONDITIONAL_PROPERTY_ASSIGNMENT, LOGICAL_PROPERTY_ASSIGNMENT, LOCAL_ASSIGNMENT, CONDITIONAL_THROW, EMIT_PROPERTY_ASSIGNMENT\n        if (data.id !== undefined) dataTexts.push(`id ${this.describeExpression(data.id)}`); // used by IDENTIFIER\n        if (data.thisArg !== undefined) dataTexts.push(`this arg ${this.describeBaseValue(data.thisArg)}`); // used by CALL_BAILOUT\n        if (data.propRef !== undefined) dataTexts.push(`prop ref ${this.describeKey(data.propRef)}`); // used by CALL_BAILOUT, and then only if string\n        if (data.state !== undefined) dataTexts.push(`state ${data.state}`); // used by PROPERTY_INVARIANT\n        if (data.usesThis !== undefined) dataTexts.push(`usesThis`); // used by FOR_STATEMENT_FUNC\n        if (data.path !== undefined) dataTexts.push(`path ${this.describeValue(data.path)}`); // used by PROPERTY_ASSIGNMENT, CONDITIONAL_PROPERTY_ASSIGNMENT\n        if (data.callFunctionRef !== undefined)\n          dataTexts.push(`call function ref ${this.describeExpression(data.callFunctionRef)}`); // used by EMIT_CALL and EMIT_CALL_AND_CAPTURE_RESULT\n        if (data.templateSource !== undefined)\n          dataTexts.push(`template source ${this.describeExpression(data.templateSource)}`); // used by ABSTRACT_FROM_TEMPLATE\n        if (data.propertyGetter !== undefined) dataTexts.push(`property getter ${data.propertyGetter}`); // used by ABSTRACT_OBJECT_GET\n\n        // TODO:\n        // appendLastToInvariantOperationDescriptor?: OperationDescriptor, // used by INVARIANT\n        // concreteComparisons?: Array<Value>, // used by FULL_INVARIANT_ABSTRACT\n        // boundName?: BabelNodeIdentifier, // used by FOR_IN\n        // lh?: BabelNodeVariableDeclaration, // used by FOR_IN\n        // quasis?: Array<BabelNodeTemplateElement>, // used by REACT_SSR_TEMPLATE_LITERAL\n        // typeComparisons?: Set<typeof Value>, // used by FULL_INVARIANT_ABSTRACT\n        // violationConditionOperationDescriptor?: OperationDescriptor, // used by INVARIANT\n        if (dataTexts.length > 0) text += `<${dataTexts.join(\"; \")}>`;\n\n        if (args.length > 0) text += `(${this.describeValues(args)})`;\n\n        const metadataTexts = [];\n        if (metadata.isPure) metadataTexts.push(\"isPure\");\n        if (metadata.mutatesOnly !== undefined && metadata.mutatesOnly.length > 0)\n          metadataTexts.push(`mutates only: [${this.describeValues(metadata.mutatesOnly)}]`);\n        if (metadataTexts.length > 0) text += `[${metadataTexts.join(\"; \")}]`;\n\n        this._print(text);\n        break;\n    }\n  }\n\n  printGenerator(generator: Generator, label?: string = \"(entry point)\"): void {\n    this._print(`${label}: ${JSON.stringify(generator.getName())}`);\n    this._nest();\n    if (generator.pathConditions.getLength() > 0)\n      this._print(\n        `path conditions ${this.describeValues(Array.from(generator.pathConditions.getAssumedConditions()))}`\n      );\n    generator.print(this);\n    this._unnest();\n  }\n\n  print(realm: Realm, optimizedFunctions: Map<FunctionValue, Generator>): void {\n    const realmGenerator = realm.generator;\n    if (realmGenerator !== undefined) this.printGenerator(realmGenerator);\n    for (const [functionValue, generator] of optimizedFunctions) {\n      const effectsToApply = generator.effectsToApply;\n      invariant(effectsToApply !== undefined);\n      this._print(`=== optimized function ${this.describeValue(functionValue)}`);\n      realm.withEffectsAppliedInGlobalEnv(effects => {\n        const nestedPrinter = new TextPrinter(this._printLine, this._abstractValueIds, this._symbolIds);\n        nestedPrinter.printEffects(effects, generator);\n        return nestedPrinter; // not needed, but withEffectsAppliedInGlobalEnv has an unmotivated invariant that the result must not be undefined\n      }, effectsToApply);\n    }\n  }\n\n  describeCompletion(result: Completion): string {\n    const args = [];\n    if (result instanceof SimpleNormalCompletion) args.push(`value ${this.describeValue(result.value)}`);\n    else if (result instanceof ThrowCompletion) args.push(`value ${this.describeValue(result.value)}`);\n    else {\n      invariant(result instanceof JoinedNormalAndAbruptCompletions);\n      args.push(`join condition ${this.describeValue(result.joinCondition)}`);\n      args.push(`consequent ${this.describeCompletion(result.consequent)}`);\n      args.push(`alternate ${this.describeCompletion(result.alternate)}`);\n      if (result.composedWith !== undefined) args.push(`composed with ${this.describeCompletion(result.composedWith)}`);\n    }\n    return `${result.constructor.name}(${args.join(\", \")})`;\n  }\n\n  printEffects(effects: Effects, generator?: Generator): void {\n    this._nest();\n    this.printGenerator(generator || effects.generator);\n    // skip effects.generator\n    if (effects.modifiedProperties.size > 0)\n      this._print(\n        `modified property bindings: [${Array.from(effects.modifiedProperties.keys())\n          .map(propertyBinding => this.describePropertyBinding(propertyBinding))\n          .join(\", \")}]`\n      );\n    if (effects.modifiedBindings.size > 0)\n      this._print(\n        `modified bindings: [${Array.from(effects.modifiedBindings.keys())\n          .map(binding => this.describeBinding(binding))\n          .join(\", \")}]`\n      );\n    if (effects.createdObjects.size > 0)\n      this._print(\n        `created objects: [${Array.from(effects.createdObjects)\n          .map(object => this.describeValue(object))\n          .join(\", \")}]`\n      );\n    if (!(effects.result instanceof UndefinedValue)) this._print(`result: ${this.describeCompletion(effects.result)}`);\n    this._unnest();\n  }\n\n  describeExpression(expression: string): string {\n    if (t.isValidIdentifier(expression)) return expression;\n    else return \"@\" + JSON.stringify(expression);\n  }\n\n  describeValues<V: Value>(values: Array<V>): string {\n    return values.map(value => this.describeValue(value)).join(\", \");\n  }\n\n  abstractValueName(value: AbstractValue): string {\n    const id = this._abstractValueIds.get(value);\n    invariant(id !== undefined);\n    return `value#${id}`;\n  }\n\n  printAbstractValue(value: AbstractValue): void {\n    invariant(value.intrinsicName === undefined);\n    let kind = value.kind;\n    // TODO: I'd expect kind to be defined in this situation; however, it's not defined for test ForInStatement4.js\n    // invariant(kind !== undefined);\n    if (kind === undefined) kind = \"(no kind)\";\n    this._printDefinition(\n      this.abstractValueName(value),\n      this.describeExpression(kind),\n      value.args.map(arg => this.describeValue(arg))\n    );\n  }\n\n  objectValueName(value: ObjectValue): string {\n    invariant(this._objects.has(value));\n    let name;\n    if (value instanceof FunctionValue) name = \"func\";\n    else if (value instanceof ProxyValue) name = \"proxy\";\n    else name = \"object\";\n    return `${name}#${value.getHash()}`;\n  }\n\n  printObjectValue(value: ObjectValue): void {\n    const args = [];\n\n    if (value.temporalAlias !== undefined) args.push(`temporalAlias ${this.describeValue(value.temporalAlias)}`);\n\n    if (value instanceof FunctionValue) {\n      if (value instanceof NativeFunctionValue) {\n        // TODO: This shouldn't happen; all native function values should be intrinsics\n      } else if (value instanceof BoundFunctionValue) {\n        args.push(`$BoundTargetFunction ${this.describeValue(value.$BoundTargetFunction)}`);\n        args.push(`$BoundThis ${this.describeValue(value.$BoundThis)}`);\n        args.push(`$BoundArguments [${this.describeValues(value.$BoundArguments)}]`);\n      } else {\n        invariant(value instanceof ECMAScriptSourceFunctionValue);\n        args.push(`$ConstructorKind ${value.$ConstructorKind}`);\n        args.push(`$ThisMode ${value.$ThisMode}`);\n        args.push(`$FunctionKind ${value.$FunctionKind}`);\n        if (value.$HomeObject !== undefined) args.push(`$HomeObject ${this.describeValue(value.$HomeObject)}`);\n\n        // TODO: $Strict should always be defined according to its flow type signature, however, there are some tests where it's not\n        if (value.$Strict) args.push(`$Strict`);\n        args.push(`$FormalParameters ${value.$FormalParameters.length}`);\n        // TODO: pretty-print $ECMAScriptCode\n\n        // TODO: $Environment should always be defined according to its flow type signature, however, it's not in test ConcreteModel2.js\n        if (value.$Environment) args.push(`$Environment ${this.describeLexicalEnvironment(value.$Environment)}`);\n      }\n    } else if (value instanceof ProxyValue) {\n      args.push(`$ProxyTarget ${this.describeValue(value.$ProxyTarget)}`);\n      args.push(`$ProxyHandler ${this.describeValue(value.$ProxyHandler)}`);\n    } else {\n      const kind = value.getKind();\n      if (kind !== \"Object\") args.push(`kind ${kind}`);\n      switch (kind) {\n        case \"RegExp\":\n          const originalSource = value.$OriginalSource;\n          invariant(originalSource !== undefined);\n          args.push(`$OriginalSource ${originalSource}`);\n          const originalFlags = value.$OriginalFlags;\n          invariant(originalFlags !== undefined);\n          args.push(`$OriginalFlags ${originalFlags}`);\n          break;\n        case \"Number\":\n          const numberData = value.$NumberData;\n          invariant(numberData !== undefined);\n          args.push(`$NumberData ${this.describeValue(numberData)}`);\n          break;\n        case \"String\":\n          const stringData = value.$StringData;\n          invariant(stringData !== undefined);\n          args.push(`$StringData ${this.describeValue(stringData)}`);\n          break;\n        case \"Boolean\":\n          const booleanData = value.$BooleanData;\n          invariant(booleanData !== undefined);\n          args.push(`$BooleanData ${this.describeValue(booleanData)}`);\n          break;\n        case \"Date\":\n          const dateValue = value.$DateValue;\n          invariant(dateValue !== undefined);\n          args.push(`$DateValue ${this.describeValue(dateValue)}`);\n          break;\n        case \"ArrayBuffer\":\n          const len = value.$ArrayBufferByteLength;\n          invariant(len !== undefined);\n          args.push(`$ArrayBufferByteLength ${len}`);\n          const db = value.$ArrayBufferData;\n          invariant(db !== undefined);\n          if (db !== null) args.push(`$ArrayBufferData [${db.join(\", \")}]`);\n          break;\n        case \"Float32Array\":\n        case \"Float64Array\":\n        case \"Int8Array\":\n        case \"Int16Array\":\n        case \"Int32Array\":\n        case \"Uint8Array\":\n        case \"Uint16Array\":\n        case \"Uint32Array\":\n        case \"Uint8ClampedArray\":\n        case \"DataView\":\n          const buf = value.$ViewedArrayBuffer;\n          invariant(buf !== undefined);\n          args.push(`$ViewedArrayBuffer ${this.describeValue(buf)}`);\n          break;\n        case \"Map\":\n          const mapDataEntries = value.$MapData;\n          invariant(mapDataEntries !== undefined);\n          args.push(`$MapData [${this.describeMapEntries(mapDataEntries)}]`);\n          break;\n        case \"WeakMap\":\n          const weakMapDataEntries = value.$WeakMapData;\n          invariant(weakMapDataEntries !== undefined);\n          args.push(`$WeakMapData [${this.describeMapEntries(weakMapDataEntries)}]`);\n          break;\n        case \"Set\":\n          const setDataEntries = value.$SetData;\n          invariant(setDataEntries !== undefined);\n          args.push(`$SetData [${this.describeSetEntries(setDataEntries)}]`);\n          break;\n        case \"WeakSet\":\n          const weakSetDataEntries = value.$WeakSetData;\n          invariant(weakSetDataEntries !== undefined);\n          args.push(`$WeakSetData [${this.describeSetEntries(weakSetDataEntries)}]`);\n          break;\n        case \"ReactElement\":\n        case \"Object\":\n        case \"Array\":\n          break;\n        default:\n          invariant(false);\n      }\n    }\n\n    // properties\n    if (value.properties.size > 0) {\n      args.push(\n        `properties [${Array.from(value.properties.keys())\n          .map(key => this.describeKey(key))\n          .join(\", \")}]`\n      );\n    }\n\n    // symbols\n    if (value.symbols.size > 0) {\n      args.push(\n        `symbols [${Array.from(value.symbols.keys())\n          .map(key => this.describeKey(key))\n          .join(\", \")}]`\n      );\n    }\n\n    const unknownProperty = value.unknownProperty;\n    if (unknownProperty !== undefined) args.push(`unknown property`);\n\n    if (value.$Prototype !== undefined) args.push(`$Prototype ${this.describeValue(value.$Prototype)}`);\n\n    this._printDefinition(this.objectValueName(value), value.constructor.name, args);\n\n    // jull pull on property bindings to get them emitting\n    for (const propertyBinding of value.properties.values()) this.describePropertyBinding(propertyBinding);\n    for (const propertyBinding of value.symbols.values()) this.describePropertyBinding(propertyBinding);\n    if (unknownProperty !== undefined) this.describePropertyBinding(unknownProperty);\n  }\n\n  describeValue(value: Value): string {\n    if (value.intrinsicName !== undefined) return this.describeExpression(value.intrinsicName);\n    if (value instanceof SymbolValue) return this.describeSymbol(value);\n    if (value instanceof PrimitiveValue) return value.toDisplayString();\n    if (value instanceof ObjectValue) {\n      if (!this._objects.has(value)) {\n        this._objects.add(value);\n        this.printObjectValue(value);\n      }\n      return this.objectValueName(value);\n    } else {\n      invariant(value instanceof AbstractValue, value.constructor.name);\n      if (!this._abstractValueIds.has(value)) {\n        this._abstractValueIds.set(value, this._abstractValueIds.size);\n        this.printAbstractValue(value);\n      }\n      return this.abstractValueName(value);\n    }\n  }\n\n  describeMapEntries(entries: Array<{ $Key: void | Value, $Value: void | Value }>): string {\n    return entries\n      .map(entry => {\n        const args = [];\n        if (entry.$Key !== undefined) args.push(`$Key ${this.describeValue(entry.$Key)}`);\n        if (entry.$Value !== undefined) args.push(`$Value ${this.describeValue(entry.$Value)}`);\n        return `{${args.join(\", \")}}`;\n      })\n      .join(\", \");\n  }\n\n  describeSetEntries(entries: Array<void | Value>): string {\n    return entries.map(entry => (entry === undefined ? \"(undefined)\" : this.describeValue(entry))).join(\", \");\n  }\n\n  describeDescriptor(desc: Descriptor): string {\n    if (desc instanceof PropertyDescriptor) return this.describePropertyDescriptor(desc);\n    else if (desc instanceof InternalSlotDescriptor) return this.describeInternalSlotDescriptor(desc);\n    else {\n      invariant(desc instanceof AbstractJoinedDescriptor, desc.constructor.name);\n      return this.describeAbstractJoinedDescriptor(desc);\n    }\n  }\n\n  describePropertyDescriptor(desc: PropertyDescriptor): string {\n    const args = [];\n    if (desc.writable) args.push(\"writable\");\n    if (desc.enumerable) args.push(\"enumerable\");\n    if (desc.configurable) args.push(\"configurable\");\n    if (desc.value !== undefined) args.push(`value ${this.describeValue(desc.value)}`);\n    if (desc.get !== undefined) args.push(`get ${this.describeValue(desc.get)}`);\n    if (desc.set !== undefined) args.push(`set ${this.describeValue(desc.set)}`);\n    return `PropertyDescriptor(${args.join(\", \")})`;\n  }\n\n  describeInternalSlotDescriptor(desc: InternalSlotDescriptor): string {\n    const args = [];\n    if (desc.value instanceof Value) args.push(`value ${this.describeValue(desc.value)}`);\n    else if (Array.isArray(desc.value)) args.push(`some array`); // TODO\n    return `InternalSlotDescriptor(${args.join(\", \")})`;\n  }\n\n  describeAbstractJoinedDescriptor(desc: AbstractJoinedDescriptor): string {\n    const args = [];\n    args.push(`join condition ${this.describeValue(desc.joinCondition)}`);\n    if (desc.descriptor1 !== undefined) args.push(`descriptor1 ${this.describeDescriptor(desc.descriptor1)}`);\n    if (desc.descriptor2 !== undefined) args.push(`descriptor2 ${this.describeDescriptor(desc.descriptor2)}`);\n    return `AbstractJoinedDescriptor(${args.join(\", \")})`;\n  }\n\n  bindingName(binding: Binding): string {\n    invariant(this._bindings.has(binding));\n    return `${this.describeEnvironmentRecord(binding.environment)}.${this.describeExpression(binding.name)}`;\n  }\n\n  printBinding(binding: Binding): void {\n    const args = [];\n    if (binding.isGlobal) args.push(\"is global\");\n    if (binding.mightHaveBeenCaptured) args.push(\"might have been captured\");\n    if (binding.initialized) args.push(\"initialized\");\n    if (binding.mutable) args.push(\"mutable\");\n    if (binding.deletable) args.push(\"deletable\");\n    if (binding.strict) args.push(\"strict\");\n    if (binding.hasLeaked) args.push(\"has leaked\");\n    if (binding.value !== undefined) args.push(`value ${this.describeValue(binding.value)})`);\n    if (binding.phiNode !== undefined) args.push(`phi node ${this.describeValue(binding.phiNode)}`);\n    this._printDefinition(this.bindingName(binding), \"Binding\", args);\n  }\n\n  describeBinding(binding: Binding): string {\n    if (!this._bindings.has(binding)) {\n      this._bindings.add(binding);\n      this.printBinding(binding);\n    }\n    return this.bindingName(binding);\n  }\n\n  describeKey(key: void | string | Value): string {\n    if (key === undefined) return \"(undefined)\";\n    else if (typeof key === \"string\") return this.describeExpression(key);\n    else {\n      invariant(key instanceof Value);\n      return this.describeValue(key);\n    }\n  }\n\n  propertyBindingName(propertyBinding: PropertyBinding): string {\n    return `${this.describeValue(propertyBinding.object)}.${this.describeKey(propertyBinding.key)}`;\n  }\n\n  printPropertyBinding(propertyBinding: PropertyBinding): void {\n    const args = [];\n    if (propertyBinding.internalSlot) args.push(\"internal slot\");\n    if (propertyBinding.descriptor !== undefined)\n      args.push(`descriptor ${this.describeDescriptor(propertyBinding.descriptor)}`);\n    if (propertyBinding.pathNode !== undefined) args.push(`path node ${this.describeValue(propertyBinding.pathNode)}`);\n    this._printDefinition(this.propertyBindingName(propertyBinding), \"PropertyBinding\", args);\n  }\n\n  describePropertyBinding(propertyBinding: PropertyBinding): string {\n    if (!this._propertyBindings.has(propertyBinding)) {\n      this._propertyBindings.add(propertyBinding);\n      this.printPropertyBinding(propertyBinding);\n    }\n    return this.propertyBindingName(propertyBinding);\n  }\n\n  environmentRecordName(environment: EnvironmentRecord): string {\n    invariant(this._environmentRecords.has(environment));\n    let name;\n    if (environment instanceof DeclarativeEnvironmentRecord) {\n      name = environment instanceof FunctionEnvironmentRecord ? \"funEnv\" : \"declEnv\";\n    } else if (environment instanceof ObjectEnvironmentRecord) {\n      name = \"objEnv\";\n    } else {\n      invariant(environment instanceof GlobalEnvironmentRecord);\n      name = \"globEnv\";\n    }\n    return `${name}#${environment.id}`;\n  }\n\n  printEnvironmentRecord(environment: EnvironmentRecord): void {\n    const args = [];\n    if (environment instanceof DeclarativeEnvironmentRecord) {\n      if (environment instanceof FunctionEnvironmentRecord) {\n        args.push(`$ThisBindingStatus ${environment.$ThisBindingStatus}`);\n        // TODO: $ThisValue should always be defined according to its flow type signature, however, it's not for test ObjectAssign9.js\n        if (environment.$ThisValue !== undefined) args.push(`$ThisValue ${this.describeValue(environment.$ThisValue)}`);\n        if (environment.$HomeObject !== undefined)\n          args.push(`$HomeObject ${this.describeValue(environment.$HomeObject)}`);\n        args.push(`$FunctionObject ${this.describeValue(environment.$FunctionObject)}`);\n      }\n      if (environment.$NewTarget !== undefined) args.push(`$NewTarget ${this.describeValue(environment.$NewTarget)}`);\n      if (environment.frozen) args.push(\"frozen\");\n      const bindings = Object.keys(environment.bindings);\n      if (bindings.length > 0)\n        args.push(\n          `bindings [${Object.keys(environment.bindings)\n            .map(key => this.describeKey(key))\n            .join(\", \")}]`\n        );\n    } else if (environment instanceof ObjectEnvironmentRecord) {\n      args.push(`object ${this.describeValue(environment.object)}`);\n      if (environment.withEnvironment) args.push(\"with environment\");\n    } else if (environment instanceof GlobalEnvironmentRecord) {\n      args.push(`$DeclarativeRecord ${this.describeEnvironmentRecord(environment.$DeclarativeRecord)}`);\n      args.push(`$ObjectRecord ${this.describeEnvironmentRecord(environment.$DeclarativeRecord)}`);\n      if (environment.$VarNames.length > 0)\n        args.push(`$VarNames [${environment.$VarNames.map(varName => this.describeExpression(varName)).join(\", \")}]`);\n      args.push(`$GlobalThisValue ${this.describeValue(environment.$GlobalThisValue)}`);\n    }\n    this._printDefinition(this.environmentRecordName(environment), environment.constructor.name, args);\n\n    // pull on bindings to get them emitted\n    if (environment instanceof DeclarativeEnvironmentRecord)\n      for (const bindingName in environment.bindings) this.describeBinding(environment.bindings[bindingName]);\n  }\n\n  describeEnvironmentRecord(environment: EnvironmentRecord): string {\n    if (!this._environmentRecords.has(environment)) {\n      this._environmentRecords.add(environment);\n      this.printEnvironmentRecord(environment);\n    }\n    return this.environmentRecordName(environment);\n  }\n\n  describeBaseValue(value: void | EnvironmentRecord | Value): string {\n    if (value === undefined) return \"(undefined)\";\n    else if (value instanceof Value) return this.describeValue(value);\n    invariant(value instanceof EnvironmentRecord);\n    return this.describeEnvironmentRecord(value);\n  }\n\n  lexicalEnvironmentName(environment: LexicalEnvironment): string {\n    invariant(this._lexicalEnvironments.has(environment));\n    return `lexEnv#${environment._uid}`;\n  }\n\n  printLexicalEnvironment(environment: LexicalEnvironment): void {\n    const args = [];\n    if (environment.destroyed) args.push(\"destroyed\");\n    if (environment.parent !== null) args.push(`parent ${this.describeLexicalEnvironment(environment.parent)}`);\n    args.push(`environment record ${this.describeEnvironmentRecord(environment.environmentRecord)}`);\n    this._printDefinition(this.lexicalEnvironmentName(environment), \"LexicalEnvironment\", args);\n  }\n\n  describeLexicalEnvironment(environment: LexicalEnvironment): string {\n    if (!this._lexicalEnvironments.has(environment)) {\n      this._lexicalEnvironments.add(environment);\n      this.printLexicalEnvironment(environment);\n    }\n    return this.lexicalEnvironmentName(environment);\n  }\n\n  symbolName(symbol: SymbolValue): string {\n    const id = this._symbolIds.get(symbol);\n    invariant(id !== undefined);\n    return `symbol#${id}`;\n  }\n\n  printSymbol(symbol: SymbolValue): void {\n    const args = [];\n    if (symbol.$Description) args.push(`$Description ${this.describeValue(symbol.$Description)}`);\n    this._printDefinition(this.symbolName(symbol), \"Symbol\", args);\n  }\n\n  describeSymbol(symbol: SymbolValue): string {\n    if (!this._symbolIds.has(symbol)) {\n      this._symbolIds.set(symbol, this._symbolIds.size);\n    }\n    if (!this._symbols.has(symbol)) {\n      this._symbols.add(symbol);\n      this.printSymbol(symbol);\n    }\n    return this.symbolName(symbol);\n  }\n}\n"
  },
  {
    "path": "src/utils/babelhelpers.js",
    "content": "/**\n * Copyright (c) 2017-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n/* @flow */\n\nimport type {\n  BabelNodeExpression,\n  BabelNodeMemberExpression,\n  BabelNodeStringLiteral,\n  BabelNodeIdentifier,\n  BabelNodeSourceLocation,\n} from \"@babel/types\";\nimport * as t from \"@babel/types\";\n\nexport const voidExpression: BabelNodeExpression = t.unaryExpression(\"void\", t.numericLiteral(0), true);\nexport const nullExpression: BabelNodeExpression = t.nullLiteral();\nexport const emptyExpression: BabelNodeIdentifier = t.identifier(\"__empty\");\nexport const constructorExpression: BabelNodeIdentifier = t.identifier(\"__constructor\");\nexport const protoExpression: BabelNodeIdentifier = t.identifier(\"__proto__\");\n\nexport function getAsPropertyNameExpression(key: string, canBeIdentifier: boolean = true): BabelNodeExpression {\n  // If key is a non-negative numeric string literal, parse it and set it as a numeric index instead.\n  let index = Number.parseInt(key, 10);\n  if (index >= 0 && index.toString() === key) {\n    return t.numericLiteral(index);\n  }\n\n  if (canBeIdentifier) {\n    // TODO #1020: revert this when Unicode identifiers are supported by all targetted JavaScript engines\n    let keyIsAscii = /^[\\u0000-\\u007f]*$/.test(key);\n    if (t.isValidIdentifier(key) && keyIsAscii) return t.identifier(key);\n  }\n\n  return t.stringLiteral(key);\n}\n\nexport function memberExpressionHelper(\n  object: BabelNodeExpression,\n  property: string | BabelNodeExpression\n): BabelNodeMemberExpression {\n  let propertyExpression: BabelNodeExpression;\n  let computed;\n  if (typeof property === \"string\") {\n    propertyExpression = getAsPropertyNameExpression(property);\n    computed = !t.isIdentifier(propertyExpression);\n  } else if (t.isStringLiteral(property)) {\n    propertyExpression = getAsPropertyNameExpression(((property: any): BabelNodeStringLiteral).value);\n    computed = !t.isIdentifier(propertyExpression);\n  } else {\n    propertyExpression = property;\n    computed = true;\n  }\n  return t.memberExpression(object, propertyExpression, computed);\n}\n\nexport function optionalStringOfLocation(location: ?BabelNodeSourceLocation): string {\n  // if we can't get a value, then it's likely that the source file was not given\n  return location ? ` at location ${stringOfLocation(location)}` : \"\";\n}\n\nexport function stringOfLocation(location: BabelNodeSourceLocation): string {\n  return `${location.source || \"(unknown source file)\"}[${location.start.line}:${location.start.column}]`;\n}\n"
  },
  {
    "path": "src/utils/errors.js",
    "content": "/**\n * Copyright (c) 2017-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n/* @flow strict-local */\n\nimport { FatalError } from \"../errors.js\";\nimport { Realm } from \"../realm.js\";\n\nexport function ignoreErrorsIn<T>(realm: Realm, f: () => T): void | T {\n  let savedHandler = realm.errorHandler;\n  realm.errorHandler = d => \"Recover\";\n  try {\n    return f();\n  } catch (err) {\n    if (err instanceof FatalError) return undefined;\n    throw err;\n  } finally {\n    realm.errorHandler = savedHandler;\n  }\n}\n"
  },
  {
    "path": "src/utils/flow.js",
    "content": "/**\n * Copyright (c) 2017-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n/* @flow strict */\n\nimport traverse from \"@babel/traverse\";\nimport { BabelNode } from \"@babel/types\";\nimport * as t from \"@babel/types\";\n\n// Taken directly from Babel:\n// https://github.com/babel/babel/blob/cde005422701a69ff21044c138c29a5ad23b6d0a/packages/babel-plugin-transform-flow-strip-types/src/index.js#L32-L107\n// Copyright 2015-present Sebastian McKenzie / Babel project (https://github.com/babel)\n// only the lines reflected in the above were used\nexport function stripFlowTypeAnnotations(ast: BabelNode): void {\n  traverse(\n    ast,\n    {\n      ImportDeclaration(path) {\n        if (!path.node.specifiers.length) return;\n        let typeCount = 0;\n        path.node.specifiers.forEach(({ importKind }) => {\n          if (importKind === \"type\" || importKind === \"typeof\") {\n            typeCount++;\n          }\n        });\n        if (typeCount === path.node.specifiers.length) {\n          path.remove();\n        }\n      },\n      Flow(path) {\n        path.remove();\n      },\n      ClassProperty(path) {\n        path.node.variance = null;\n        path.node.typeAnnotation = null;\n        if (!path.node.value) path.remove();\n      },\n      Class(path) {\n        path.node.implements = null;\n        path.get(\"body.body\").forEach(child => {\n          if (child.isClassProperty()) {\n            child.node.typeAnnotation = null;\n            if (!child.node.value) child.remove();\n          }\n        });\n      },\n      AssignmentPattern({ node }) {\n        node.left.optional = false;\n      },\n      Function({ node }) {\n        for (let i = 0; i < node.params.length; i++) {\n          const param = node.params[i];\n          param.optional = false;\n          if (param.type === \"AssignmentPattern\") {\n            param.left.optional = false;\n          }\n        }\n        node.predicate = null;\n      },\n      TypeCastExpression(path) {\n        let { node } = path;\n        do {\n          node = node.expression;\n        } while (t.isTypeCastExpression(node));\n        path.replaceWith(node);\n      },\n    },\n    undefined,\n    {},\n    undefined\n  );\n  traverse.cache.clear();\n}\n"
  },
  {
    "path": "src/utils/generator.js",
    "content": "/**\n * Copyright (c) 2017-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n/* @flow */\n\nimport type { Effects, Realm } from \"../realm.js\";\nimport type {\n  ConsoleMethodTypes,\n  Descriptor,\n  DisplayResult,\n  PropertyBinding,\n  SupportedGraphQLGetters,\n} from \"../types.js\";\nimport type { BaseValue, Binding, ReferenceName } from \"../environment.js\";\nimport {\n  AbstractObjectValue,\n  AbstractValue,\n  type AbstractValueKind,\n  BooleanValue,\n  ConcreteValue,\n  EmptyValue,\n  FunctionValue,\n  NullValue,\n  NumberValue,\n  IntegralValue,\n  ObjectValue,\n  StringValue,\n  SymbolValue,\n  UndefinedValue,\n  Value,\n} from \"../values/index.js\";\nimport { CompilerDiagnostic } from \"../errors.js\";\nimport { TypesDomain, ValuesDomain } from \"../domains/index.js\";\nimport invariant from \"../invariant.js\";\nimport { JoinedNormalAndAbruptCompletions, SimpleNormalCompletion, ThrowCompletion } from \"../completions.js\";\nimport type {\n  BabelNodeExpression,\n  BabelNodeIdentifier,\n  BabelNodeMemberExpression,\n  BabelNodeStatement,\n  BabelNodeVariableDeclaration,\n  BabelNodeBlockStatement,\n  BabelNodeLVal,\n  BabelUnaryOperator,\n  BabelBinaryOperator,\n  BabelLogicalOperator,\n  BabelNodeTemplateElement,\n} from \"@babel/types\";\nimport { concretize, Join, Utils } from \"../singletons.js\";\nimport type { SerializerOptions } from \"../options.js\";\nimport type { PathConditions, ShapeInformationInterface } from \"../types.js\";\nimport { PreludeGenerator } from \"./PreludeGenerator.js\";\nimport { PropertyDescriptor } from \"../descriptors.js\";\n\nexport type OperationDescriptorType =\n  | \"ABSTRACT_FROM_TEMPLATE\"\n  | \"ABSTRACT_OBJECT_GET\"\n  | \"ABSTRACT_OBJECT_GET_PARTIAL\"\n  | \"ABSTRACT_OBJECT_GET_PROTO_OF\"\n  | \"ABSTRACT_PROPERTY\"\n  | \"ASSUME_CALL\"\n  | \"BABEL_HELPERS_OBJECT_WITHOUT_PROPERTIES\"\n  | \"BINARY_EXPRESSION\"\n  | \"CALL_ABSTRACT_FUNC\"\n  | \"CALL_ABSTRACT_FUNC_THIS\"\n  | \"CALL_BAILOUT\"\n  | \"CANNOT_BECOME_OBJECT\"\n  | \"COERCE_TO_STRING\"\n  | \"CONCRETE_MODEL\"\n  | \"CONDITIONAL_EXPRESSION\"\n  | \"CONDITIONAL_PROPERTY_ASSIGNMENT\"\n  | \"CONDITIONAL_THROW\"\n  | \"CONSOLE_LOG\"\n  | \"DEFINE_PROPERTY\"\n  | \"DERIVED_ABSTRACT_INVARIANT\"\n  | \"DIRECT_CALL_WITH_ARG_LIST\"\n  | \"DO_WHILE\"\n  | \"EMIT_CALL\"\n  | \"EMIT_CALL_AND_CAPTURE_RESULT\"\n  | \"EMIT_PROPERTY_ASSIGNMENT\"\n  | \"FB_MOCKS_BOOTLOADER_LOAD_MODULES\"\n  | \"FB_MOCKS_MAGIC_GLOBAL_FUNCTION\"\n  | \"FOR_IN\"\n  | \"FOR_STATEMENT_FUNC\"\n  | \"FULL_INVARIANT\"\n  | \"FULL_INVARIANT_ABSTRACT\"\n  | \"FULL_INVARIANT_FUNCTION\"\n  | \"GET_BINDING\"\n  | \"GLOBAL_ASSIGNMENT\"\n  | \"GLOBAL_DELETE\"\n  | \"IDENTIFIER\"\n  | \"INVARIANT\"\n  | \"INVARIANT_APPEND\"\n  | \"JOIN_GENERATORS\"\n  | \"LOCAL_ASSIGNMENT\"\n  | \"LOGICAL_EXPRESSION\"\n  | \"LOGICAL_PROPERTY_ASSIGNMENT\"\n  | \"MODULES_REQUIRE\"\n  | \"NEW_EXPRESSION\"\n  | \"NOOP\"\n  | \"OBJECT_ASSIGN\"\n  | \"OBJECT_GET_PARTIAL\"\n  | \"OBJECT_PROTO_GET_OWN_PROPERTY_DESCRIPTOR\"\n  | \"OBJECT_PROTO_HAS_OWN_PROPERTY\"\n  | \"OBJECT_SET_PARTIAL\"\n  | \"PROPERTY_ASSIGNMENT\"\n  | \"PROPERTY_DELETE\"\n  | \"PROPERTY_INVARIANT\"\n  | \"REACT_CREATE_CONTEXT_PROVIDER\"\n  | \"REACT_DEFAULT_PROPS_HELPER\"\n  | \"REACT_NATIVE_STRING_LITERAL\"\n  | \"REACT_RELAY_MOCK_CONTAINER\"\n  | \"REACT_SSR_PREV_TEXT_NODE\"\n  | \"REACT_SSR_REGEX_CONSTANT\"\n  | \"REACT_SSR_RENDER_VALUE_HELPER\"\n  | \"REACT_SSR_TEMPLATE_LITERAL\"\n  | \"REACT_TEMPORAL_FUNC\"\n  | \"REBUILT_OBJECT\"\n  | \"RESIDUAL_CALL\"\n  | \"SINGLE_ARG\"\n  | \"THROW\"\n  | \"UNARY_EXPRESSION\"\n  | \"UNKNOWN_ARRAY_GET_PARTIAL\"\n  | \"UNKNOWN_ARRAY_LENGTH\"\n  | \"UNKNOWN_ARRAY_METHOD_CALL\"\n  | \"UNKNOWN_ARRAY_METHOD_PROPERTY_CALL\"\n  | \"UPDATE_INCREMENTOR\"\n  | \"WIDEN_PROPERTY\"\n  | \"WIDEN_PROPERTY_ASSIGNMENT\"\n  | \"WIDENED_IDENTIFIER\";\n\nexport type OperationDescriptor = {\n  data: OperationDescriptorData,\n  type: OperationDescriptorType,\n};\n\n// TODO: gradually remove all these, currently it's a random bag of values\n// that should be in args or in other places rather than here.\nexport type OperationDescriptorData = {\n  appendLastToInvariantOperationDescriptor?: OperationDescriptor, // used by INVARIANT\n  binding?: Binding, // used by GET_BINDING\n  propertyBinding?: PropertyBinding, // used by LOGICAL_PROPERTY_ASSIGNMENT\n  boundName?: BabelNodeIdentifier, // used by FOR_IN\n  callFunctionRef?: string, // used by EMIT_CALL and EMIT_CALL_AND_CAPTURE_RESULT\n  concreteComparisons?: Array<Value>, // used by FULL_INVARIANT_ABSTRACT\n  descriptor?: Descriptor, // used by DEFINE_PROPERTY\n  generator?: Generator, // used by DO_WHILE\n  generators?: Array<Generator>, // used by JOIN_GENERATORS\n  id?: string, // used by IDENTIFIER\n  lh?: BabelNodeVariableDeclaration, // used by FOR_IN\n  unaryOperator?: BabelUnaryOperator, // used by UNARY_EXPRESSION\n  binaryOperator?: BabelBinaryOperator, // used by BINARY_EXPRESSION\n  logicalOperator?: BabelLogicalOperator, // used by LOGICAL_EXPRESSION\n  incrementor?: \"+\" | \"-\", // used by UPDATE_INCREMENTOR\n  prefix?: boolean, // used by UNARY_EXPRESSION\n  path?: Value, // used by PROPERTY_ASSIGNMENT, CONDITIONAL_PROPERTY_ASSIGNMENT\n  propertyGetter?: SupportedGraphQLGetters, // used by ABSTRACT_OBJECT_GET\n  propRef?: ReferenceName | AbstractValue, // used by CALL_BAILOUT, and then only if string\n  object?: ObjectValue, // used by DEFINE_PROPERTY\n  quasis?: Array<BabelNodeTemplateElement>, // used by REACT_SSR_TEMPLATE_LITERAL\n  state?: \"MISSING\" | \"PRESENT\" | \"DEFINED\", // used by PROPERTY_INVARIANT\n  thisArg?: BaseValue | Value, // used by CALL_BAILOUT\n  templateSource?: string, // used by ABSTRACT_FROM_TEMPLATE\n  typeComparisons?: Set<typeof Value>, // used by FULL_INVARIANT_ABSTRACT\n  usesThis?: boolean, // used by FOR_STATEMENT_FUNC\n  value?: Value, // used by DO_WHILE, CONDITIONAL_PROPERTY_ASSIGNMENT, LOGICAL_PROPERTY_ASSIGNMENT, LOCAL_ASSIGNMENT, CONDITIONAL_THROW, EMIT_PROPERTY_ASSIGNMENT\n  violationConditionOperationDescriptor?: OperationDescriptor, // used by INVARIANT\n};\n\nexport function createOperationDescriptor(\n  type: OperationDescriptorType,\n  data?: OperationDescriptorData = {}\n): OperationDescriptor {\n  return {\n    data,\n    type,\n  };\n}\n\nexport type SerializationContext = {|\n  serializeOperationDescriptor: (\n    OperationDescriptor,\n    Array<BabelNodeExpression>,\n    SerializationContext,\n    Set<AbstractValue | ObjectValue>,\n    void | string\n  ) => BabelNodeStatement,\n  serializeBinding: Binding => BabelNodeIdentifier | BabelNodeMemberExpression,\n  serializeBindingAssignment: (Binding, Value) => BabelNodeStatement,\n  serializeCondition: (Value, Generator, Generator, Set<AbstractValue | ObjectValue>) => BabelNodeStatement,\n  serializeDebugScopeComment: (AbstractValue | ObjectValue) => BabelNodeStatement,\n  serializeReturnValue: Value => BabelNodeStatement,\n  serializeGenerator: (Generator, Set<AbstractValue | ObjectValue>) => Array<BabelNodeStatement>,\n  serializeValue: Value => BabelNodeExpression,\n  getPropertyAssignmentStatement: (\n    location: BabelNodeLVal,\n    value: Value,\n    mightHaveBeenDeleted: boolean,\n    deleteIfMightHaveBeenDeleted: boolean\n  ) => BabelNodeStatement,\n  initGenerator: Generator => void,\n  finalizeGenerator: Generator => void,\n  emitDefinePropertyBody: (ObjectValue, string | SymbolValue, Descriptor) => BabelNodeStatement,\n  emit: BabelNodeStatement => void,\n  processValues: (Set<AbstractValue | ObjectValue>) => void,\n  canOmit: Value => boolean,\n  declare: (AbstractValue | ObjectValue) => void,\n  emitPropertyModification: PropertyBinding => void,\n  emitBindingModification: Binding => void,\n  options: SerializerOptions,\n|};\n\nexport type VisitEntryCallbacks = {|\n  visitEquivalentValue: Value => Value,\n  visitGenerator: (Generator, Generator) => void,\n  canOmit: Value => boolean,\n  recordDeclaration: (AbstractValue | ObjectValue) => void,\n  recordDelayedEntry: (Generator, GeneratorEntry) => void,\n  visitModifiedProperty: PropertyBinding => void,\n  visitModifiedBinding: Binding => void,\n  visitBindingAssignment: (Binding, Value) => Value,\n|};\n\nexport type CustomGeneratorEntryType = \"MODIFIED_PROPERTY\" | \"MODIFIED_BINDING\" | \"RETURN\" | \"BINDING_ASSIGNMENT\";\n\nexport interface Printer {\n  printGeneratorEntry(\n    declared: void | AbstractValue | ObjectValue,\n    type: OperationDescriptorType | CustomGeneratorEntryType,\n    args: Array<Value>,\n    data: OperationDescriptorData,\n    metadata: { isPure: boolean, mutatesOnly: void | Array<Value> }\n  ): void;\n  printGenerator(generator: Generator, label?: string): void;\n}\n\nexport class GeneratorEntry {\n  constructor(realm: Realm) {\n    // We increment the index of every TemporalOperationEntry created.\n    // This should match up as a form of timeline value due to the tree-like\n    // structure we use to create entries during evaluation. For example,\n    // if all AST nodes in a BlockStatement resulted in a temporal operation\n    // for each AST node, then each would have a sequential index as to its\n    // position of how it was evaluated in the BlockSstatement.\n    this.index = realm.temporalEntryCounter++;\n  }\n\n  print(printer: Printer): void {\n    invariant(false, \"GeneratorEntry is an abstract base class\");\n  }\n\n  visit(callbacks: VisitEntryCallbacks, containingGenerator: Generator): boolean {\n    invariant(false, \"GeneratorEntry is an abstract base class\");\n  }\n\n  serialize(context: SerializationContext) {\n    invariant(false, \"GeneratorEntry is an abstract base class\");\n  }\n\n  getDependencies(): void | Array<Generator> {\n    invariant(false, \"GeneratorEntry is an abstract base class\");\n  }\n\n  notEqualToAndDoesNotHappenBefore(entry: GeneratorEntry): boolean {\n    return this.index > entry.index;\n  }\n\n  notEqualToAndDoesNotHappenAfter(entry: GeneratorEntry): boolean {\n    return this.index < entry.index;\n  }\n\n  index: number;\n}\n\nexport type TemporalOperationEntryArgs = {\n  declared?: AbstractValue | ObjectValue,\n  args: Array<Value>,\n  operationDescriptor: OperationDescriptor,\n  isPure?: boolean,\n  mutatesOnly?: Array<Value>,\n};\n\nexport class TemporalOperationEntry extends GeneratorEntry {\n  constructor(realm: Realm, args: TemporalOperationEntryArgs) {\n    super(realm);\n    Object.assign(this, args);\n    if (this.mutatesOnly !== undefined) {\n      invariant(!this.isPure);\n      for (let arg of this.mutatesOnly) {\n        invariant(this.args.includes(arg));\n      }\n    }\n    invariant(this.operationDescriptor !== undefined);\n  }\n\n  declared: void | AbstractValue | ObjectValue;\n  args: Array<Value>;\n  operationDescriptor: OperationDescriptor;\n  isPure: void | boolean;\n  mutatesOnly: void | Array<Value>;\n\n  print(printer: Printer): void {\n    const operationDescriptor = this.operationDescriptor;\n    printer.printGeneratorEntry(this.declared, operationDescriptor.type, this.args, this.operationDescriptor.data, {\n      isPure: !!this.isPure,\n      mutatesOnly: this.mutatesOnly,\n    });\n  }\n\n  toDisplayJson(depth: number): DisplayResult {\n    if (depth <= 0) return `TemporalOperation${this.index}`;\n    let obj = { type: \"TemporalOperation\", ...this };\n    delete obj.operationDescriptor;\n    return Utils.verboseToDisplayJson(obj, depth);\n  }\n\n  visit(callbacks: VisitEntryCallbacks, containingGenerator: Generator): boolean {\n    let omit = this.isPure && this.declared && callbacks.canOmit(this.declared);\n\n    if (!omit && this.declared && this.mutatesOnly !== undefined) {\n      omit = true;\n      for (let arg of this.mutatesOnly) {\n        if (!callbacks.canOmit(arg)) {\n          omit = false;\n        }\n      }\n    }\n    if (omit) {\n      callbacks.recordDelayedEntry(containingGenerator, this);\n      return false;\n    } else {\n      if (this.declared) callbacks.recordDeclaration(this.declared);\n      for (let i = 0, n = this.args.length; i < n; i++) {\n        let originalArg = this.args[i];\n        let visitedArg = callbacks.visitEquivalentValue(originalArg);\n        this.args[i] = visitedArg;\n        if (i === 0) {\n          switch (this.operationDescriptor.type) {\n            case \"CALL_BAILOUT\":\n              if (originalArg === this.operationDescriptor.data.thisArg)\n                this.operationDescriptor.data.thisArg = visitedArg;\n              break;\n            case \"CONDITIONAL_THROW\":\n              this.operationDescriptor.data.value = visitedArg;\n              break;\n            default:\n              break;\n          }\n        } else if (i === 1) {\n          switch (this.operationDescriptor.type) {\n            case \"EMIT_PROPERTY_ASSIGNMENT\":\n            case \"LOGICAL_PROPERTY_ASSIGNMENT\":\n              this.operationDescriptor.data.value = visitedArg;\n              break;\n            case \"CONDITIONAL_PROPERTY_ASSIGNMENT\":\n              if (originalArg === this.operationDescriptor.data.value) this.operationDescriptor.data.value = visitedArg;\n              break;\n            case \"DEFINE_PROPERTY\":\n              invariant(visitedArg instanceof ObjectValue);\n              this.operationDescriptor.data.object = visitedArg;\n              break;\n            default:\n              break;\n          }\n        }\n      }\n      let dependencies = this.getDependencies();\n      if (dependencies !== undefined)\n        for (let dependency of dependencies) callbacks.visitGenerator(dependency, containingGenerator);\n      return true;\n    }\n  }\n\n  serialize(context: SerializationContext): void {\n    let omit = this.isPure && this.declared && context.canOmit(this.declared);\n\n    if (!omit && this.declared && this.mutatesOnly !== undefined) {\n      omit = true;\n      for (let arg of this.mutatesOnly) {\n        if (!context.canOmit(arg)) {\n          omit = false;\n        }\n      }\n    }\n    if (!omit) {\n      let nodes = this.args.map((boundArg, i) => context.serializeValue(boundArg));\n      let valuesToProcess = new Set();\n      let declaredId = this.declared !== undefined ? this.declared.intrinsicName : undefined;\n      let node = context.serializeOperationDescriptor(\n        this.operationDescriptor,\n        nodes,\n        context,\n        valuesToProcess,\n        declaredId\n      );\n      if (node.type === \"BlockStatement\") {\n        let block: BabelNodeBlockStatement = (node: any);\n        let statements = block.body;\n        if (statements.length === 0) return;\n        if (statements.length === 1) {\n          node = statements[0];\n        }\n      }\n      let declared = this.declared;\n      if (declared !== undefined && context.options.debugScopes) {\n        context.emit(context.serializeDebugScopeComment(declared));\n      }\n      context.emit(node);\n      context.processValues(valuesToProcess);\n\n      if (this.declared !== undefined) context.declare(this.declared);\n    }\n  }\n\n  getDependencies(): void | Array<Generator> {\n    const operationDescriptor = this.operationDescriptor;\n    switch (operationDescriptor.type) {\n      case \"DO_WHILE\":\n        let generator = operationDescriptor.data.generator;\n        invariant(generator !== undefined);\n        return [generator];\n      case \"JOIN_GENERATORS\":\n        let generators = operationDescriptor.data.generators;\n        invariant(generators !== undefined);\n        return generators;\n      default:\n        return undefined;\n    }\n  }\n}\n\nexport class TemporalObjectAssignEntry extends TemporalOperationEntry {\n  visit(callbacks: VisitEntryCallbacks, containingGenerator: Generator): boolean {\n    let declared = this.declared;\n    if (!(declared instanceof AbstractObjectValue || declared instanceof ObjectValue)) {\n      return false;\n    }\n    let realm = declared.$Realm;\n    // The only optimization we attempt to do to Object.assign for now is merging of multiple entries\n    // into a new generator entry.\n    let result = attemptToMergeEquivalentObjectAssigns(realm, callbacks, this);\n\n    if (result instanceof TemporalObjectAssignEntry) {\n      let nextResult = result;\n      while (nextResult instanceof TemporalObjectAssignEntry) {\n        nextResult = attemptToMergeEquivalentObjectAssigns(realm, callbacks, result);\n        // If we get back a TemporalObjectAssignEntry, then we have successfully merged a single\n        // Object.assign, but we may be able to merge more. So repeat the process.\n        if (nextResult instanceof TemporalObjectAssignEntry) {\n          result = nextResult;\n        }\n      }\n      // We have an optimized temporal entry, so replace the current temporal\n      // entry and visit that entry instead.\n      this.args = result.args;\n    } else if (result === \"POSSIBLE_OPTIMIZATION\") {\n      callbacks.recordDelayedEntry(containingGenerator, this);\n      return false;\n    }\n    return super.visit(callbacks, containingGenerator);\n  }\n}\n\ntype ModifiedPropertyEntryArgs = {|\n  propertyBinding: PropertyBinding,\n  newDescriptor: void | Descriptor,\n  containingGenerator: Generator,\n|};\n\nclass ModifiedPropertyEntry extends GeneratorEntry {\n  constructor(realm: Realm, args: ModifiedPropertyEntryArgs) {\n    super(realm);\n    Object.assign(this, args);\n  }\n\n  containingGenerator: Generator;\n  propertyBinding: PropertyBinding;\n  newDescriptor: void | Descriptor;\n\n  print(printer: Printer): void {\n    printer.printGeneratorEntry(\n      undefined,\n      \"MODIFIED_PROPERTY\",\n      [],\n      { descriptor: this.newDescriptor, propertyBinding: this.propertyBinding },\n      { isPure: false, mutatesOnly: undefined }\n    );\n  }\n\n  toDisplayString(): string {\n    let propertyKey = this.propertyBinding.key;\n    let propertyKeyString = propertyKey instanceof Value ? propertyKey.toDisplayString() : propertyKey;\n    invariant(propertyKeyString !== undefined);\n    return `[ModifiedProperty ${propertyKeyString}]`;\n  }\n\n  serialize(context: SerializationContext): void {\n    let desc = this.propertyBinding.descriptor;\n    invariant(desc === this.newDescriptor);\n    context.emitPropertyModification(this.propertyBinding);\n  }\n\n  visit(context: VisitEntryCallbacks, containingGenerator: Generator): boolean {\n    invariant(\n      containingGenerator === this.containingGenerator,\n      \"This entry requires effects to be applied and may not be moved\"\n    );\n    let desc = this.propertyBinding.descriptor;\n    invariant(desc === this.newDescriptor);\n    context.visitModifiedProperty(this.propertyBinding);\n    return true;\n  }\n\n  getDependencies(): void | Array<Generator> {\n    return undefined;\n  }\n}\n\ntype ModifiedBindingEntryArgs = {|\n  modifiedBinding: Binding,\n  containingGenerator: Generator,\n|};\n\nclass ModifiedBindingEntry extends GeneratorEntry {\n  constructor(realm: Realm, args: ModifiedBindingEntryArgs) {\n    super(realm);\n    Object.assign(this, args);\n  }\n\n  containingGenerator: Generator;\n  modifiedBinding: Binding;\n\n  print(printer: Printer): void {\n    printer.printGeneratorEntry(\n      undefined,\n      \"MODIFIED_BINDING\",\n      [],\n      { binding: this.modifiedBinding, value: this.modifiedBinding.value },\n      { isPure: false, mutatesOnly: undefined }\n    );\n  }\n\n  toDisplayString(): string {\n    return `[ModifiedBinding ${this.modifiedBinding.name}]`;\n  }\n\n  serialize(context: SerializationContext): void {\n    context.emitBindingModification(this.modifiedBinding);\n  }\n\n  visit(context: VisitEntryCallbacks, containingGenerator: Generator): boolean {\n    invariant(\n      containingGenerator === this.containingGenerator,\n      \"This entry requires effects to be applied and may not be moved\"\n    );\n    context.visitModifiedBinding(this.modifiedBinding);\n    return true;\n  }\n\n  getDependencies(): void | Array<Generator> {\n    return undefined;\n  }\n}\n\nclass ReturnValueEntry extends GeneratorEntry {\n  constructor(realm: Realm, generator: Generator, returnValue: Value) {\n    super(realm);\n    this.returnValue = returnValue.promoteEmptyToUndefined();\n    this.containingGenerator = generator;\n  }\n\n  returnValue: Value;\n  containingGenerator: Generator;\n\n  print(printer: Printer): void {\n    printer.printGeneratorEntry(undefined, \"RETURN\", [this.returnValue], {}, { isPure: false, mutatesOnly: undefined });\n  }\n\n  toDisplayString(): string {\n    return `[Return ${this.returnValue.toDisplayString()}]`;\n  }\n\n  visit(context: VisitEntryCallbacks, containingGenerator: Generator): boolean {\n    invariant(\n      containingGenerator === this.containingGenerator,\n      \"This entry requires effects to be applied and may not be moved\"\n    );\n    this.returnValue = context.visitEquivalentValue(this.returnValue);\n    return true;\n  }\n\n  serialize(context: SerializationContext): void {\n    context.emit(context.serializeReturnValue(this.returnValue));\n  }\n\n  getDependencies(): void | Array<Generator> {\n    return undefined;\n  }\n}\n\nclass BindingAssignmentEntry extends GeneratorEntry {\n  constructor(realm: Realm, binding: Binding, value: Value) {\n    super(realm);\n    this.binding = binding;\n    this.value = value;\n  }\n\n  binding: Binding;\n  value: Value;\n\n  print(printer: Printer): void {\n    printer.printGeneratorEntry(\n      undefined,\n      \"BINDING_ASSIGNMENT\",\n      [this.value],\n      { binding: this.binding },\n      { isPure: false, mutatesOnly: undefined }\n    );\n  }\n\n  toDisplayString(): string {\n    return `[BindingAssignment ${this.binding.name} = ${this.value.toDisplayString()}]`;\n  }\n\n  serialize(context: SerializationContext): void {\n    context.emit(context.serializeBindingAssignment(this.binding, this.value));\n  }\n\n  visit(context: VisitEntryCallbacks, containingGenerator: Generator): boolean {\n    this.value = context.visitBindingAssignment(this.binding, this.value);\n    return true;\n  }\n\n  getDependencies(): void | Array<Generator> {\n    return undefined;\n  }\n}\n\nexport class Generator {\n  constructor(realm: Realm, name: string, pathConditions: PathConditions, effects?: Effects) {\n    invariant(realm.useAbstractInterpretation);\n    let realmPreludeGenerator = realm.preludeGenerator;\n    invariant(realmPreludeGenerator);\n    this.preludeGenerator = realmPreludeGenerator;\n    this.realm = realm;\n    this._entries = [];\n    this.id = realm.nextGeneratorId++;\n    this._name = name;\n    this.effectsToApply = effects;\n    this.pathConditions = pathConditions;\n  }\n\n  realm: Realm;\n  _entries: Array<GeneratorEntry>;\n  preludeGenerator: PreludeGenerator;\n  effectsToApply: void | Effects;\n  id: number;\n  _name: string;\n  pathConditions: PathConditions;\n\n  print(printer: Printer): void {\n    for (let entry of this._entries) entry.print(printer);\n  }\n\n  toDisplayString(): string {\n    return Utils.jsonToDisplayString(this, 2);\n  }\n\n  toDisplayJson(depth: number): DisplayResult {\n    if (depth <= 0) return `Generator${this.id}-${this._name}`;\n    return Utils.verboseToDisplayJson(this, depth);\n  }\n\n  static _generatorOfEffects(\n    realm: Realm,\n    name: string,\n    optimizedFunction: FunctionValue,\n    effects: Effects\n  ): Generator {\n    let { result, generator, modifiedBindings, modifiedProperties, createdObjects } = effects;\n\n    let output = new Generator(realm, name, generator.pathConditions, effects);\n    output.appendGenerator(generator, generator._name);\n\n    for (let propertyBinding of modifiedProperties.keys()) {\n      let object = propertyBinding.object;\n      invariant(object.isValid());\n      if (createdObjects.has(object)) continue; // Created Object's binding\n      if (ObjectValue.refuseSerializationOnPropertyBinding(propertyBinding)) continue; // modification to internal state\n      // modifications to intrinsic objects are tracked in the generator\n      if (object.isIntrinsic()) continue;\n      output.emitPropertyModification(propertyBinding);\n    }\n\n    for (let [modifiedBinding, previousValue] of modifiedBindings.entries()) {\n      if (Utils.isBindingMutationOutsideFunction(modifiedBinding, previousValue, optimizedFunction)) {\n        if (!modifiedBinding.hasLeaked) {\n          invariant(modifiedBinding.value !== undefined);\n          output.emitBindingModification(modifiedBinding);\n        }\n      }\n    }\n\n    if (result instanceof UndefinedValue) return output;\n    if (result instanceof SimpleNormalCompletion) {\n      output.emitReturnValue(result.value);\n    } else if (result instanceof ThrowCompletion) {\n      output.emitThrow(result.value);\n    } else if (result instanceof JoinedNormalAndAbruptCompletions) {\n      let selector = c =>\n        c instanceof ThrowCompletion && c.value !== realm.intrinsics.__bottomValue && !(c.value instanceof EmptyValue);\n      output.emitConditionalThrow(Join.joinValuesOfSelectedCompletions(selector, result, true));\n      output.emitReturnValue(result.value);\n    } else {\n      invariant(false);\n    }\n    return output;\n  }\n\n  // Make sure to to fixup\n  // how to apply things around sets of things\n  static fromEffects(effects: Effects, realm: Realm, name: string, optimizedFunction: FunctionValue): Generator {\n    return realm.withEffectsAppliedInGlobalEnv(\n      this._generatorOfEffects.bind(this, realm, name, optimizedFunction),\n      effects\n    );\n  }\n\n  emitPropertyModification(propertyBinding: PropertyBinding): void {\n    invariant(this.effectsToApply !== undefined);\n    let desc = propertyBinding.descriptor;\n    if (desc !== undefined && desc instanceof PropertyDescriptor) {\n      let value = desc.value;\n      if (value instanceof AbstractValue) {\n        if (value.kind === \"conditional\") {\n          let [c, x, y] = value.args;\n          if (c instanceof AbstractValue && c.kind === \"template for property name condition\") {\n            let ydesc = new PropertyDescriptor(Object.assign({}, (desc: any), { value: y }));\n            let yprop = Object.assign({}, propertyBinding, { descriptor: ydesc });\n            this.emitPropertyModification(yprop);\n            let xdesc = new PropertyDescriptor(Object.assign({}, (desc: any), { value: x }));\n            let key = c.args[0];\n            invariant(key instanceof AbstractValue);\n            let xprop = Object.assign({}, propertyBinding, { key, descriptor: xdesc });\n            this.emitPropertyModification(xprop);\n            return;\n          }\n        } else if (value.kind === \"template for prototype member expression\") {\n          return;\n        }\n      }\n    }\n    this._entries.push(\n      new ModifiedPropertyEntry(this.realm, {\n        propertyBinding,\n        newDescriptor: desc,\n        containingGenerator: this,\n      })\n    );\n  }\n\n  emitBindingModification(modifiedBinding: Binding): void {\n    invariant(this.effectsToApply !== undefined);\n    this._entries.push(\n      new ModifiedBindingEntry(this.realm, {\n        modifiedBinding,\n        containingGenerator: this,\n      })\n    );\n  }\n\n  emitReturnValue(result: Value): void {\n    this._entries.push(new ReturnValueEntry(this.realm, this, result));\n  }\n\n  getName(): string {\n    return `${this._name}(#${this.id})`;\n  }\n\n  empty(): boolean {\n    return this._entries.length === 0;\n  }\n\n  emitGlobalDeclaration(key: string, value: Value): void {\n    this.preludeGenerator.declaredGlobals.add(key);\n    if (!(value instanceof UndefinedValue)) this.emitGlobalAssignment(key, value);\n  }\n\n  emitGlobalAssignment(key: string, value: Value): void {\n    this._addEntry({\n      args: [value, new StringValue(this.realm, key)],\n      operationDescriptor: createOperationDescriptor(\"GLOBAL_ASSIGNMENT\"),\n    });\n  }\n\n  emitConcreteModel(key: string, value: Value): void {\n    this._addEntry({\n      args: [concretize(this.realm, value), new StringValue(this.realm, key)],\n      operationDescriptor: createOperationDescriptor(\"CONCRETE_MODEL\"),\n    });\n  }\n\n  emitGlobalDelete(key: string): void {\n    this._addEntry({\n      args: [new StringValue(this.realm, key)],\n      operationDescriptor: createOperationDescriptor(\"GLOBAL_DELETE\"),\n    });\n  }\n\n  emitBindingAssignment(binding: Binding, value: Value): void {\n    this._entries.push(new BindingAssignmentEntry(this.realm, binding, value));\n  }\n\n  emitPropertyAssignment(object: Value, key: string | Value, value: Value): void {\n    if (object instanceof ObjectValue && object.refuseSerialization) {\n      return;\n    }\n    if (typeof key === \"string\") {\n      key = new StringValue(this.realm, key);\n    }\n    this._addEntry({\n      args: [object, value, key],\n      operationDescriptor: createOperationDescriptor(\"EMIT_PROPERTY_ASSIGNMENT\", { value }),\n    });\n  }\n\n  emitDefineProperty(object: ObjectValue, key: string, desc: PropertyDescriptor, isDescChanged: boolean = true): void {\n    if (object.refuseSerialization) return;\n    if (desc.enumerable && desc.configurable && desc.writable && desc.value && !isDescChanged) {\n      let descValue = desc.value;\n      invariant(descValue instanceof Value);\n      this.emitPropertyAssignment(object, key, descValue);\n    } else {\n      desc = new PropertyDescriptor(desc);\n      let descValue = desc.value || object.$Realm.intrinsics.undefined;\n      invariant(descValue instanceof Value);\n      this._addEntry({\n        args: [\n          new StringValue(this.realm, key),\n          object,\n          descValue,\n          desc.get || object.$Realm.intrinsics.undefined,\n          desc.set || object.$Realm.intrinsics.undefined,\n        ],\n        operationDescriptor: createOperationDescriptor(\"DEFINE_PROPERTY\", { object, descriptor: desc }),\n      });\n    }\n  }\n\n  emitPropertyDelete(object: ObjectValue, key: string): void {\n    if (object.refuseSerialization) return;\n    this._addEntry({\n      args: [object, new StringValue(this.realm, key)],\n      operationDescriptor: createOperationDescriptor(\"PROPERTY_DELETE\"),\n    });\n  }\n\n  emitCall(callFunctionRef: string, args: Array<Value>): void {\n    this._addEntry({\n      args,\n      operationDescriptor: createOperationDescriptor(\"EMIT_CALL\", { callFunctionRef }),\n    });\n  }\n\n  emitConsoleLog(method: ConsoleMethodTypes, args: Array<string | ConcreteValue>): void {\n    this._addEntry({\n      args: [\n        new StringValue(this.realm, method),\n        ...args.map(v => (typeof v === \"string\" ? new StringValue(this.realm, v) : v)),\n      ],\n      operationDescriptor: createOperationDescriptor(\"CONSOLE_LOG\"),\n    });\n  }\n\n  // test must be a temporal value, which means that it must have a defined intrinsicName\n  emitDoWhileStatement(test: AbstractValue, body: Generator): void {\n    this._addEntry({\n      args: [],\n      operationDescriptor: createOperationDescriptor(\"DO_WHILE\", { generator: body, value: test }),\n    });\n  }\n\n  emitConditionalThrow(value: Value): void {\n    if (value instanceof EmptyValue) return;\n    this._issueThrowCompilerDiagnostic(value);\n    this._addEntry({\n      args: [value],\n      operationDescriptor: createOperationDescriptor(\"CONDITIONAL_THROW\", { value }),\n    });\n  }\n\n  _issueThrowCompilerDiagnostic(value: Value): void {\n    let message = \"Program may terminate with exception\";\n    if (value instanceof ObjectValue) {\n      let object = ((value: any): ObjectValue);\n      let objectMessage = this.realm.evaluateWithUndo(() => object._SafeGetDataPropertyValue(\"message\"));\n      if (objectMessage instanceof StringValue) message += `: ${objectMessage.value}`;\n      const objectStack = this.realm.evaluateWithUndo(() => object._SafeGetDataPropertyValue(\"stack\"));\n      if (objectStack instanceof StringValue)\n        message += `\n  ${objectStack.value}`;\n    }\n    const diagnostic = new CompilerDiagnostic(message, value.expressionLocation, \"PP0023\", \"Warning\");\n    this.realm.handleError(diagnostic);\n  }\n\n  emitThrow(value: Value): void {\n    this._issueThrowCompilerDiagnostic(value);\n    this.emitStatement([value], createOperationDescriptor(\"THROW\"));\n  }\n\n  // Checks the full set of possible concrete values as well as typeof\n  // for any AbstractValues\n  // e.g: (obj.property !== undefined && typeof obj.property !== \"object\")\n  // NB: if the type of the AbstractValue is top, skips the invariant\n  emitFullInvariant(object: ObjectValue | AbstractObjectValue, key: string, value: Value): void {\n    if (object.refuseSerialization) return;\n    if (value instanceof AbstractValue) {\n      let isTop = false;\n      let concreteComparisons = [];\n      let typeComparisons = new Set();\n\n      function populateComparisonsLists(absValue: AbstractValue) {\n        if (absValue.kind === \"abstractConcreteUnion\") {\n          // recurse\n          for (let nestedValue of absValue.args)\n            if (nestedValue instanceof ConcreteValue) {\n              concreteComparisons.push(nestedValue);\n            } else {\n              invariant(nestedValue instanceof AbstractValue);\n              populateComparisonsLists(nestedValue);\n            }\n        } else if (absValue.getType() === Value) {\n          isTop = true;\n        } else {\n          typeComparisons.add(absValue.getType());\n        }\n      }\n      populateComparisonsLists(value);\n\n      // No point in doing the invariant if we don't know the type\n      // of one of the nested abstract values\n      if (isTop) {\n        return;\n      } else {\n        this._emitInvariant(\n          [new StringValue(this.realm, key), value, value],\n          createOperationDescriptor(\"FULL_INVARIANT_ABSTRACT\", { concreteComparisons, typeComparisons }),\n          createOperationDescriptor(\"INVARIANT_APPEND\")\n        );\n      }\n    } else if (value instanceof FunctionValue) {\n      // We do a special case for functions,\n      // as we like to use concrete functions in the model to model abstract behaviors.\n      // These concrete functions do not have the right identity.\n      this._emitInvariant(\n        [new StringValue(this.realm, key), object, value, object],\n        createOperationDescriptor(\"FULL_INVARIANT_FUNCTION\"),\n        createOperationDescriptor(\"INVARIANT_APPEND\")\n      );\n    } else {\n      this._emitInvariant(\n        [new StringValue(this.realm, key), object, value, object],\n        createOperationDescriptor(\"FULL_INVARIANT\"),\n        createOperationDescriptor(\"INVARIANT_APPEND\")\n      );\n    }\n  }\n\n  emitPropertyInvariant(\n    object: ObjectValue | AbstractObjectValue,\n    key: string,\n    state: \"MISSING\" | \"PRESENT\" | \"DEFINED\"\n  ): void {\n    if (object.refuseSerialization) return;\n    this._emitInvariant(\n      [new StringValue(this.realm, key), object, object],\n      createOperationDescriptor(\"PROPERTY_INVARIANT\", { state }),\n      createOperationDescriptor(\"INVARIANT_APPEND\")\n    );\n  }\n\n  _emitInvariant(\n    args: Array<Value>,\n    violationConditionOperationDescriptor: OperationDescriptor,\n    appendLastToInvariantOperationDescriptor: OperationDescriptor\n  ): void {\n    invariant(this.realm.invariantLevel > 0);\n    let invariantOperationDescriptor = createOperationDescriptor(\"INVARIANT\", {\n      appendLastToInvariantOperationDescriptor,\n      violationConditionOperationDescriptor,\n    });\n    this._addEntry({\n      args,\n      operationDescriptor: invariantOperationDescriptor,\n    });\n  }\n\n  emitCallAndCaptureResult(\n    types: TypesDomain,\n    values: ValuesDomain,\n    callFunctionRef: string,\n    args: Array<Value>,\n    kind?: AbstractValueKind\n  ): AbstractValue {\n    return this.deriveAbstract(\n      types,\n      values,\n      args,\n      createOperationDescriptor(\"EMIT_CALL_AND_CAPTURE_RESULT\", { callFunctionRef }),\n      { kind }\n    );\n  }\n\n  emitStatement(args: Array<Value>, operationDescriptor: OperationDescriptor): void {\n    invariant(typeof operationDescriptor !== \"function\");\n    this._addEntry({\n      args,\n      operationDescriptor,\n    });\n  }\n\n  emitVoidExpression(\n    types: TypesDomain,\n    values: ValuesDomain,\n    args: Array<Value>,\n    operationDescriptor: OperationDescriptor\n  ): UndefinedValue {\n    this._addEntry({\n      args,\n      operationDescriptor,\n    });\n    return this.realm.intrinsics.undefined;\n  }\n\n  emitForInStatement(\n    o: ObjectValue | AbstractObjectValue,\n    lh: BabelNodeVariableDeclaration,\n    sourceObject: ObjectValue,\n    targetObject: ObjectValue,\n    boundName: BabelNodeIdentifier\n  ): void {\n    this._addEntry({\n      // duplicate args to ensure refcount > 1\n      args: [o, targetObject, sourceObject, targetObject, sourceObject],\n      operationDescriptor: createOperationDescriptor(\"FOR_IN\", { boundName, lh }),\n    });\n  }\n\n  deriveConcreteObject(\n    buildValue: (intrinsicName: string) => ObjectValue,\n    args: Array<Value>,\n    operationDescriptor: OperationDescriptor,\n    optionalArgs?: {| isPure?: boolean |}\n  ): ConcreteValue {\n    let id = this.preludeGenerator.nameGenerator.generate(\"derived\");\n    let value = buildValue(id);\n    value.intrinsicNameGenerated = true;\n    value.isScopedTemplate = true; // because this object doesn't exist ahead of time, and the visitor would otherwise declare it in the common scope\n    invariant(value.intrinsicName === id);\n    this._addDerivedEntry({\n      isPure: optionalArgs ? optionalArgs.isPure : undefined,\n      declared: value,\n      args,\n      operationDescriptor,\n    });\n    return value;\n  }\n\n  deriveAbstract(\n    types: TypesDomain,\n    values: ValuesDomain,\n    args: Array<Value>,\n    operationDescriptor: OperationDescriptor,\n    optionalArgs?: {|\n      kind?: AbstractValueKind,\n      isPure?: boolean,\n      skipInvariant?: boolean,\n      mutatesOnly?: Array<Value>,\n      shape?: void | ShapeInformationInterface,\n    |}\n  ): AbstractValue {\n    let id = this.preludeGenerator.nameGenerator.generate(\"derived\");\n    let options = {};\n    if (optionalArgs && optionalArgs.kind !== undefined) options.kind = optionalArgs.kind;\n    if (optionalArgs && optionalArgs.shape !== undefined) options.shape = optionalArgs.shape;\n    let Constructor = Value.isTypeCompatibleWith(types.getType(), ObjectValue) ? AbstractObjectValue : AbstractValue;\n    let res = new Constructor(\n      this.realm,\n      types,\n      values,\n      1735003607742176 + this.realm.derivedIds.size,\n      [],\n      createOperationDescriptor(\"IDENTIFIER\", { id }),\n      options\n    );\n    res.intrinsicName = id;\n    this._addDerivedEntry({\n      isPure: optionalArgs ? optionalArgs.isPure : undefined,\n      declared: res,\n      args,\n      operationDescriptor,\n      mutatesOnly: optionalArgs ? optionalArgs.mutatesOnly : undefined,\n    });\n    let type = types.getType();\n    if (optionalArgs && optionalArgs.skipInvariant) return res;\n    let typeofString;\n    if (type instanceof FunctionValue) typeofString = \"function\";\n    else if (type === UndefinedValue) invariant(false);\n    else if (type === NullValue) invariant(false);\n    else if (type === StringValue) typeofString = \"string\";\n    else if (type === BooleanValue) typeofString = \"boolean\";\n    else if (type === NumberValue) typeofString = \"number\";\n    else if (type === IntegralValue) typeofString = \"number\";\n    else if (type === SymbolValue) typeofString = \"symbol\";\n    else if (type === ObjectValue) typeofString = \"object\";\n    if (typeofString !== undefined && this.realm.invariantLevel >= 1) {\n      // Verify that the types are as expected, a failure of this invariant\n      // should mean the model is wrong.\n      this._emitInvariant(\n        [new StringValue(this.realm, typeofString), res, res],\n        createOperationDescriptor(\"DERIVED_ABSTRACT_INVARIANT\"),\n        createOperationDescriptor(\"SINGLE_ARG\")\n      );\n    }\n\n    return res;\n  }\n\n  visit(callbacks: VisitEntryCallbacks): void {\n    let visitFn = () => {\n      for (let entry of this._entries) entry.visit(callbacks, this);\n      return null;\n    };\n    if (this.effectsToApply) {\n      this.realm.withEffectsAppliedInGlobalEnv(visitFn, this.effectsToApply);\n    } else {\n      visitFn();\n    }\n  }\n\n  serialize(context: SerializationContext): void {\n    let serializeFn = () => {\n      context.initGenerator(this);\n      for (let entry of this._entries) entry.serialize(context);\n      context.finalizeGenerator(this);\n      return null;\n    };\n    if (this.effectsToApply) {\n      this.realm.withEffectsAppliedInGlobalEnv(serializeFn, this.effectsToApply);\n    } else {\n      serializeFn();\n    }\n  }\n\n  getDependencies(): Array<Generator> {\n    let res = [];\n    for (let entry of this._entries) {\n      let dependencies = entry.getDependencies();\n      if (dependencies !== undefined) res.push(...dependencies);\n    }\n    return res;\n  }\n\n  _addEntry(entryArgs: TemporalOperationEntryArgs): TemporalOperationEntry {\n    let entry;\n    let operationDescriptor = entryArgs.operationDescriptor;\n    if (operationDescriptor && operationDescriptor.type === \"OBJECT_ASSIGN\") {\n      entry = new TemporalObjectAssignEntry(this.realm, entryArgs);\n    } else {\n      entry = new TemporalOperationEntry(this.realm, entryArgs);\n    }\n    this.realm.saveTemporalGeneratorEntryArgs(entry);\n    this._entries.push(entry);\n    return entry;\n  }\n\n  _addDerivedEntry(entryArgs: TemporalOperationEntryArgs): void {\n    let declared = entryArgs.declared;\n    invariant(declared !== undefined);\n    let id = declared.intrinsicName;\n    invariant(id !== undefined);\n    let entry = this._addEntry(entryArgs);\n    this.realm.derivedIds.set(id, entry);\n  }\n\n  appendGenerator(other: Generator, leadingComment: string): void {\n    invariant(other !== this);\n    invariant(other.realm === this.realm);\n    invariant(other.preludeGenerator === this.preludeGenerator);\n    invariant(other.effectsToApply === undefined);\n\n    if (other.empty()) return;\n    let otherEntries = other._entries;\n    otherEntries.forEach(otherEntry => this._appendEntry(otherEntry));\n  }\n\n  _appendEntry(entry: GeneratorEntry): void {\n    let attemptToMergeEntry = (): boolean => {\n      // It attempts to merge the `entry` argument with the last entry item\n      // in `this._entries` if both are `JOIN_GENERATORS` and have the same\n      // path conditions\n      if (entry instanceof TemporalOperationEntry) {\n        let operationDescriptor = entry.operationDescriptor;\n        if (operationDescriptor.type === \"JOIN_GENERATORS\" && !this.empty()) {\n          invariant(operationDescriptor.data.generators);\n          let thisLastEntry = this._entries[this._entries.length - 1];\n          if (thisLastEntry instanceof TemporalOperationEntry) {\n            let thisLastEntryOperationDescriptor = thisLastEntry.operationDescriptor;\n            if (thisLastEntryOperationDescriptor.type === \"JOIN_GENERATORS\") {\n              invariant(thisLastEntryOperationDescriptor.data.generators);\n              let [entryGenerator1, entryGenerator2] = operationDescriptor.data.generators;\n              let [thisLastEntryGenerator1, thisLastEntryGenerator2] = thisLastEntryOperationDescriptor.data.generators;\n              if (\n                entryGenerator1.pathConditions.equals(thisLastEntryGenerator1.pathConditions) &&\n                entryGenerator2.pathConditions.equals(thisLastEntryGenerator2.pathConditions)\n              ) {\n                if (!entryGenerator1.empty())\n                  entryGenerator1._entries.forEach(e => thisLastEntryGenerator1._entries.push(e));\n                if (!entryGenerator2.empty())\n                  entryGenerator2._entries.forEach(e => thisLastEntryGenerator2._entries.push(e));\n                return true;\n              }\n            }\n          }\n        }\n      }\n      return false;\n    };\n\n    attemptToMergeEntry() || this._entries.push(entry);\n  }\n\n  joinGenerators(joinCondition: AbstractValue, generator1: Generator, generator2: Generator): void {\n    invariant(generator1 !== this && generator2 !== this && generator1 !== generator2);\n    if (generator1.empty() && generator2.empty()) return;\n    let generators = [generator1, generator2];\n    this._addEntry({\n      args: [joinCondition],\n      operationDescriptor: createOperationDescriptor(\"JOIN_GENERATORS\", { generators }),\n    });\n  }\n}\n\ntype TemporalOperationEntryOptimizationStatus = \"NO_OPTIMIZATION\" | \"POSSIBLE_OPTIMIZATION\";\n\n// This function attempts to optimize Object.assign calls, by merging mulitple\n// calls into one another where possible. For example:\n//\n// var a = Object.assign({}, someAbstact);\n// var b = Object.assign({}, a);\n//\n// Becomes:\n// var b = Object.assign({}, someAbstract, a);\n//\nexport function attemptToMergeEquivalentObjectAssigns(\n  realm: Realm,\n  callbacks: VisitEntryCallbacks,\n  temporalOperationEntry: TemporalOperationEntry\n): TemporalOperationEntryOptimizationStatus | TemporalObjectAssignEntry {\n  let args = temporalOperationEntry.args;\n  // If we are Object.assigning 2 or more args\n  if (args.length < 2) {\n    return \"NO_OPTIMIZATION\";\n  }\n  let to = args[0];\n  // Then scan through the args after the \"to\" of this Object.assign, to see if any\n  // other sources are the \"to\" of a previous Object.assign call\n  loopThroughArgs: for (let i = 1; i < args.length; i++) {\n    let possibleOtherObjectAssignTo = args[i];\n    // Ensure that the \"to\" value can be omitted\n    // Note: this check is still somewhat fragile and depends on the visiting order\n    // but it's not a functional problem right now and can be better addressed at a\n    // later point.\n    if (!callbacks.canOmit(possibleOtherObjectAssignTo)) {\n      continue;\n    }\n    // Check if the \"to\" was definitely an Object.assign, it should\n    // be a snapshot AbstractObjectValue\n    if (possibleOtherObjectAssignTo instanceof AbstractObjectValue) {\n      let otherTemporalOperationEntry = realm.getTemporalOperationEntryFromDerivedValue(possibleOtherObjectAssignTo);\n      if (!(otherTemporalOperationEntry instanceof TemporalObjectAssignEntry)) {\n        continue;\n      }\n      let otherArgs = otherTemporalOperationEntry.args;\n      // Object.assign has at least 1 arg\n      if (otherArgs.length < 1) {\n        continue;\n      }\n      let otherArgsToUse = [];\n      for (let x = 1; x < otherArgs.length; x++) {\n        let arg = otherArgs[x];\n        // The arg might have been leaked, so ensure we do not continue in this case\n        if (arg instanceof ObjectValue && arg.mightBeLeakedObject()) {\n          continue loopThroughArgs;\n        }\n        if (arg instanceof ObjectValue || arg instanceof AbstractValue) {\n          let temporalGeneratorEntries = realm.getTemporalGeneratorEntriesReferencingArg(arg);\n          // We need to now check if there are any other temporal entries that exist\n          // between the Object.assign TemporalObjectAssignEntry that we're trying to\n          // merge and the current TemporalObjectAssignEntry we're going to merge into.\n          if (temporalGeneratorEntries !== undefined) {\n            for (let temporalGeneratorEntry of temporalGeneratorEntries) {\n              // If the entry is that of another Object.assign, then\n              // we know that this entry isn't going to cause issues\n              // with merging the TemporalObjectAssignEntry.\n              if (temporalGeneratorEntry instanceof TemporalObjectAssignEntry) {\n                continue;\n              }\n              // TODO: what if the temporalGeneratorEntry can be omitted and not needed?\n\n              // If the index of this entry exists between start and end indexes,\n              // then we cannot optimize and merge the TemporalObjectAssignEntry\n              // because another generator entry may have a dependency on the Object.assign\n              // TemporalObjectAssignEntry we're trying to merge.\n              if (\n                temporalGeneratorEntry.notEqualToAndDoesNotHappenBefore(otherTemporalOperationEntry) &&\n                temporalGeneratorEntry.notEqualToAndDoesNotHappenAfter(temporalOperationEntry)\n              ) {\n                continue loopThroughArgs;\n              }\n            }\n          }\n        }\n        otherArgsToUse.push(arg);\n      }\n      // If we cannot omit the \"to\" value that means it's being used, so we shall not try to\n      // optimize this Object.assign.\n      if (!callbacks.canOmit(to)) {\n        // our merged Object.assign, shoud look like:\n        // Object.assign(to, ...prefixArgs, ...otherArgsToUse, ...suffixArgs)\n        let prefixArgs = args.slice(1, i - 1); // We start at 1, as 0 is the index of \"to\" a\n        let suffixArgs = args.slice(i + 1);\n        let newArgs = [to, ...prefixArgs, ...otherArgsToUse, ...suffixArgs];\n\n        // We now create a new TemporalObjectAssignEntry, without mutating the existing\n        // entry at this point. This new entry is essentially a TemporalObjectAssignEntry\n        // that contains two Object.assign call TemporalObjectAssignEntry entries that have\n        // been merged into a single entry. The previous Object.assign TemporalObjectAssignEntry\n        // should dead-code eliminate away once we replace the original TemporalObjectAssignEntry\n        // we started with with the new merged on as they will no longer be referenced.\n        let newTemporalObjectAssignEntryArgs = Object.assign({}, temporalOperationEntry, {\n          args: newArgs,\n        });\n        return new TemporalObjectAssignEntry(realm, newTemporalObjectAssignEntryArgs);\n      }\n      // We might be able to optimize, but we are not sure because \"to\" can still omit.\n      // So we return possible optimization status and wait until \"to\" does get visited.\n      // It may never get visited, but that's okay as we'll skip the optimization all\n      // together.\n      return \"POSSIBLE_OPTIMIZATION\";\n    }\n  }\n  return \"NO_OPTIMIZATION\";\n}\n"
  },
  {
    "path": "src/utils/internalizer.js",
    "content": ""
  },
  {
    "path": "src/utils/json.js",
    "content": "/**\n * Copyright (c) 2017-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n/* @flow */\ntype JSONValue = Array<JSONValue> | string | number | JSON;\ntype JSON = { [key: string]: JSONValue };\n\n// this will mutate the original JSON object\nexport function mergeAdjacentJSONTextNodes(node: JSON, removeFunctions: boolean, visitedNodes?: Set<JSON>): JSONValue {\n  if (visitedNodes === undefined) {\n    visitedNodes = new Set();\n  }\n  if (visitedNodes.has(node)) {\n    return node;\n  }\n  visitedNodes.add(node);\n\n  // we merge adjacent text nodes\n  if (Array.isArray(node)) {\n    // we create a new array rather than mutating the original\n    let arr = [];\n    let length = node.length;\n    let concatString = null;\n    let i = -1;\n    while (i++ < length) {\n      let child = node[i];\n      if (typeof child === \"string\" || typeof child === \"number\") {\n        if (concatString !== null) {\n          concatString += child;\n        } else {\n          concatString = child;\n        }\n      } else if (typeof child === \"object\" && child !== null) {\n        if (concatString !== null && concatString !== \"\") {\n          arr.push(concatString);\n          concatString = null;\n        }\n        arr.push(((mergeAdjacentJSONTextNodes(child, removeFunctions, visitedNodes): any): JSON));\n      }\n    }\n    if (concatString !== null && concatString !== \"\") {\n      arr.push(concatString);\n    }\n    return arr;\n  } else {\n    for (let key in node) {\n      let value = node[key];\n      if (typeof value === \"function\") {\n        if (removeFunctions) {\n          delete node[key];\n        } else {\n          node[key] = \"function\";\n        }\n      } else if (typeof value === \"object\" && value !== null) {\n        node[key] = ((mergeAdjacentJSONTextNodes(((value: any): JSON), removeFunctions, visitedNodes): any): JSON);\n      }\n    }\n  }\n  return node;\n}\n"
  },
  {
    "path": "src/utils/leak.js",
    "content": "/**\n * Copyright (c) 2017-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n/* @flow strict-local */\n\nimport { CompilerDiagnostic, FatalError } from \"../errors.js\";\nimport type { Realm } from \"../realm.js\";\nimport { leakBinding } from \"../environment.js\";\nimport { AbstractValue, ArrayValue, EmptyValue, ObjectValue, Value } from \"../values/index.js\";\nimport { TestIntegrityLevel } from \"../methods/index.js\";\nimport type { BabelNodeSourceLocation } from \"@babel/types\";\nimport invariant from \"../invariant.js\";\nimport { HeapInspector } from \"../utils/HeapInspector.js\";\nimport { Logger } from \"../utils/logger.js\";\nimport { isReactElement } from \"../react/utils.js\";\nimport { Reachability } from \"../singletons.js\";\nimport { PropertyDescriptor } from \"../descriptors.js\";\n\nfunction materializeObject(realm: Realm, object: ObjectValue, getCachingHeapInspector?: () => HeapInspector): void {\n  let generator = realm.generator;\n\n  if (object.symbols.size > 0) {\n    throw new FatalError(\"TODO: Support havocing objects with symbols\");\n  }\n\n  if (object.unknownProperty !== undefined) {\n    // TODO: Support unknown properties, or throw FatalError.\n    // We have repros, e.g. test/serializer/additional-functions/ArrayConcat.js.\n  }\n\n  let getHeapInspector =\n    getCachingHeapInspector || (() => new HeapInspector(realm, new Logger(realm, /*internalDebug*/ false)));\n\n  // TODO: We should emit current value and then reset value for all *internal slots*; this will require deep serializer support; or throw FatalError when we detect any non-initial values in internal slots.\n  for (let [name, propertyBinding] of object.properties) {\n    // ignore properties with their correct default values\n    if (getHeapInspector().canIgnoreProperty(object, name)) continue;\n\n    let descriptor = propertyBinding.descriptor;\n    if (descriptor === undefined) {\n      // TODO: This happens, e.g. test/serializer/pure-functions/ObjectAssign2.js\n      // If it indeed means deleted binding, should we initialize descriptor with a deleted value?\n      if (generator !== undefined) generator.emitPropertyDelete(object, name);\n    } else {\n      invariant(descriptor instanceof PropertyDescriptor); // TODO: Deal with joined descriptors.\n      let value = descriptor.value;\n      invariant(\n        value === undefined || value instanceof Value,\n        \"cannot be an array because we are not dealing with intrinsics here\"\n      );\n      if (value === undefined) {\n        // TODO: Deal with accessor properties\n        // We have repros, e.g. test/serializer/pure-functions/AbstractPropertyObjectKeyAssignment.js\n      } else {\n        invariant(value instanceof Value);\n        if (value instanceof EmptyValue) {\n          if (generator !== undefined) generator.emitPropertyDelete(object, name);\n        } else {\n          if (generator !== undefined) {\n            let targetDescriptor = getHeapInspector().getTargetIntegrityDescriptor(object);\n            if (!isReactElement(object)) {\n              if (\n                descriptor.writable !== targetDescriptor.writable ||\n                descriptor.configurable !== targetDescriptor.configurable\n              ) {\n                generator.emitDefineProperty(object, name, descriptor);\n              } else {\n                generator.emitPropertyAssignment(object, name, value);\n              }\n            }\n          }\n        }\n      }\n    }\n  }\n}\n\nfunction ensureFrozenValue(realm, value, loc): void {\n  // TODO: This should really check if it is recursively immutability.\n  if (value instanceof ObjectValue && !TestIntegrityLevel(realm, value, \"frozen\")) {\n    let diag = new CompilerDiagnostic(\n      \"Unfrozen object leaked before end of global code\",\n      loc || realm.currentLocation,\n      \"PP0017\",\n      \"RecoverableError\"\n    );\n    if (realm.handleError(diag) !== \"Recover\") throw new FatalError();\n  }\n}\n\n// Ensure that a value is immutable. If it is not, set all its properties to abstract values\n// and all reachable bindings to abstract values.\nexport class LeakImplementation {\n  value(realm: Realm, value: Value, loc: ?BabelNodeSourceLocation): void {\n    if (realm.instantRender.enabled) {\n      // TODO: For InstantRender...\n      // - For declarative bindings, we do want proper materialization/leaking/havocing\n      // - For object properties, we conceptually want materialization\n      //   (however, not via statements that mutate the objects,\n      //   but only as part of the initial object literals),\n      //   but actual no leaking or leaking as there should be a way to annotate/enforce\n      //   that external/abstract functions are pure with regards to heap objects\n      return;\n    }\n    let objectsTrackedForLeaks = realm.createdObjectsTrackedForLeaks;\n    if (objectsTrackedForLeaks === undefined) {\n      // We're not tracking a pure function. That means that we would track\n      // everything as leaked. We'll assume that any object argument\n      // is invalid unless it's frozen.\n      ensureFrozenValue(realm, value, loc);\n    } else {\n      // This function decides what values are descended into by leaking\n      function leakingFilter(val: Value) {\n        if (val instanceof AbstractValue) {\n          // To ensure that we don't forget to provide arguments\n          // that can be leaked, we require at least one argument.\n          let whitelistedKind = val.kind && val.kind.startsWith(\"abstractCounted\");\n\n          invariant(\n            whitelistedKind !== undefined || val.intrinsicName !== undefined || val.args.length > 0,\n            \"Leaked unknown object requires leakable arguments\"\n          );\n        }\n\n        // We skip a value if one of the following holds:\n        // 1. It has certainly been leaked\n        // 2. It was not created in the current pure scope\n        // 3. It is not a frozen object\n        // 4. It certainly does not evaluate to an object\n        // 5. Is it an intrinsic, but not a widened array\n        return (\n          (!(val instanceof ObjectValue) ||\n            (val.mightNotBeLeakedObject() &&\n              objectsTrackedForLeaks.has(val) &&\n              !TestIntegrityLevel(realm, val, \"frozen\"))) &&\n          val.mightBeObject() &&\n          (!val.isIntrinsic() || (val instanceof ArrayValue && ArrayValue.isIntrinsicAndHasWidenedNumericProperty(val)))\n        );\n      }\n      let [reachableObjects, reachableBindings] = Reachability.computeReachableObjectsAndBindings(\n        realm,\n        value,\n        leakingFilter,\n        false /* readOnly */\n      );\n\n      let cachedHeapInspector;\n      let makeAndCacheHeapInspector = () => {\n        if (cachedHeapInspector === undefined) {\n          cachedHeapInspector = new HeapInspector(realm, new Logger(realm, /*internalDebug*/ false));\n        }\n        return cachedHeapInspector;\n      };\n\n      for (let val of reachableObjects) {\n        val.leak();\n        materializeObject(realm, val, makeAndCacheHeapInspector);\n      }\n\n      for (let binding of reachableBindings) {\n        leakBinding(binding);\n      }\n    }\n  }\n}\n\nexport class MaterializeImplementation {\n  // TODO: Understand relation to snapshots: #2441\n  materializeObject(realm: Realm, val: ObjectValue): void {\n    if (realm.instantRender.enabled)\n      // Materialization leads to runtime code that mutates objects\n      // this is at best undesirable in InstantRender\n      val.makeFinal();\n    else materializeObject(realm, val);\n  }\n}\n"
  },
  {
    "path": "src/utils/logger.js",
    "content": "/**\n * Copyright (c) 2017-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n/* @flow */\n\nimport { Realm, ExecutionContext } from \"../realm.js\";\nimport { CompilerDiagnostic, FatalError, type Severity } from \"../errors.js\";\nimport { Get, InstanceofOperator } from \"../methods/index.js\";\nimport { Completion, ThrowCompletion } from \"../completions.js\";\nimport { ObjectValue, StringValue, Value } from \"../values/index.js\";\nimport { To } from \"../singletons.js\";\nimport invariant from \"../invariant.js\";\nimport { PropertyDescriptor } from \"../descriptors.js\";\n\nexport class Logger {\n  constructor(realm: Realm, internalDebug: boolean) {\n    this.realm = realm;\n    this._hasErrors = false;\n    this.internalDebug = internalDebug;\n  }\n\n  realm: Realm;\n  _hasErrors: boolean;\n  internalDebug: boolean;\n\n  // Wraps a query that might potentially execute user code.\n  tryQuery<T>(f: () => T, defaultValue: T): T {\n    let realm = this.realm;\n    let context = new ExecutionContext();\n    context.isStrict = realm.isStrict;\n    let env = realm.$GlobalEnv;\n    context.lexicalEnvironment = env;\n    context.variableEnvironment = env;\n    context.realm = realm;\n    realm.pushContext(context);\n    // We use partial evaluation so that we can throw away any state mutations\n    let oldErrorHandler = realm.errorHandler;\n    realm.errorHandler = d => {\n      if (d.severity === \"Information\" || d.severity === \"Warning\") return \"Recover\";\n      return \"Fail\";\n    };\n    try {\n      let result;\n      let effects = realm.evaluateForEffects(\n        () => {\n          try {\n            result = f();\n          } catch (e) {\n            if (e instanceof Completion) {\n              result = defaultValue;\n            } else if (e instanceof FatalError) {\n              result = defaultValue;\n            } else {\n              throw e;\n            }\n          }\n          return realm.intrinsics.undefined;\n        },\n        undefined,\n        \"tryQuery\"\n      );\n      invariant(effects.result.value === realm.intrinsics.undefined);\n      return ((result: any): T);\n    } finally {\n      realm.errorHandler = oldErrorHandler;\n      realm.popContext(context);\n    }\n  }\n\n  logCompletion(res: Completion): void {\n    let realm = this.realm;\n    let value = res.value;\n    if (this.internalDebug) console.error(`=== ${res.constructor.name} ===`);\n    if (\n      this.tryQuery(\n        () => value instanceof ObjectValue && InstanceofOperator(realm, value, realm.intrinsics.Error),\n        false\n      )\n    ) {\n      let object = ((value: any): ObjectValue);\n      try {\n        let err = new FatalError(\n          this.tryQuery(() => To.ToStringPartial(realm, Get(realm, object, \"message\")), \"(unknown message)\")\n        );\n        err.stack = this.tryQuery(() => To.ToStringPartial(realm, Get(realm, object, \"stack\")), \"(unknown stack)\");\n        console.error(err.message);\n        console.error(err.stack);\n        if (this.internalDebug && res instanceof ThrowCompletion) console.error(res.nativeStack);\n      } catch (err) {\n        let message = object.properties.get(\"message\");\n        console.error(\n          message &&\n          message.descriptor &&\n          message.descriptor instanceof PropertyDescriptor &&\n          message.descriptor.value instanceof StringValue\n            ? message.descriptor.value.value\n            : \"(no message available)\"\n        );\n        console.error(err.stack);\n        if (object.$ErrorData) {\n          console.error(object.$ErrorData.contextStack);\n        }\n      }\n    } else {\n      try {\n        value = To.ToStringPartial(realm, value);\n      } catch (err) {\n        value = err.message;\n      }\n      console.error(value);\n      if (this.internalDebug && res instanceof ThrowCompletion) console.error(res.nativeStack);\n    }\n    this._hasErrors = true;\n  }\n\n  logError(value: Value, message: string): void {\n    this._log(value, message, \"RecoverableError\");\n    this._hasErrors = true;\n  }\n\n  logWarning(value: Value, message: string): void {\n    this._log(value, message, \"Warning\");\n  }\n\n  logInformation(message: string): void {\n    this._log(this.realm.intrinsics.undefined, message, \"Information\");\n  }\n\n  _log(value: Value, message: string, severity: Severity): void {\n    let loc = value.expressionLocation;\n    if (value.intrinsicName) {\n      message = `${message}\\nintrinsic name: ${value.intrinsicName}`;\n    }\n    let diagnostic = new CompilerDiagnostic(message, loc, \"PP9000\", severity);\n    if (this.realm.handleError(diagnostic) === \"Fail\") throw new FatalError();\n  }\n\n  hasErrors(): boolean {\n    return this._hasErrors;\n  }\n}\n"
  },
  {
    "path": "src/utils/modules.js",
    "content": "/**\n * Copyright (c) 2017-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n/* @flow */\n\nimport { GlobalEnvironmentRecord, DeclarativeEnvironmentRecord } from \"../environment.js\";\nimport { FatalError } from \"../errors.js\";\nimport { Realm, Tracer } from \"../realm.js\";\nimport type { Effects } from \"../realm.js\";\nimport type { FunctionBodyAstNode } from \"../types.js\";\nimport { Get } from \"../methods/index.js\";\nimport { Environment } from \"../singletons.js\";\nimport {\n  Value,\n  BoundFunctionValue,\n  ECMAScriptSourceFunctionValue,\n  FunctionValue,\n  ObjectValue,\n  NumberValue,\n  StringValue,\n  ArrayValue,\n  UndefinedValue,\n  NullValue,\n} from \"../values/index.js\";\nimport { NormalCompletion } from \"../completions.js\";\nimport * as t from \"@babel/types\";\nimport type {\n  BabelNodeIdentifier,\n  BabelNodeLVal,\n  BabelNodeCallExpression,\n  BabelNodeNumericLiteral,\n  BabelNodeStringLiteral,\n  BabelNodeMemberExpression,\n} from \"@babel/types\";\nimport invariant from \"../invariant.js\";\nimport { Logger } from \"./logger.js\";\nimport { SerializerStatistics } from \"../serializer/statistics.js\";\nimport { PropertyDescriptor } from \"../descriptors.js\";\n\nfunction downgradeErrorsToWarnings(realm: Realm, f: () => any) {\n  let savedHandler = realm.errorHandler;\n  function handler(e) {\n    e.severity = \"Warning\";\n    realm.errorHandler = savedHandler;\n    try {\n      return realm.handleError(e);\n    } finally {\n      realm.errorHandler = handler;\n    }\n  }\n  realm.errorHandler = handler;\n  try {\n    return f();\n  } finally {\n    realm.errorHandler = savedHandler;\n  }\n}\n\nexport class ModuleTracer extends Tracer {\n  constructor(modules: Modules, logModules: boolean) {\n    super();\n    this.modules = modules;\n    this.evaluateForEffectsNesting = 0;\n    this.requireStack = [];\n    this.requireSequence = [];\n    this.logModules = logModules;\n    this.uninitializedModuleIdsRequiredInEvaluateForEffects = new Set();\n  }\n\n  modules: Modules;\n  evaluateForEffectsNesting: number;\n  requireStack: Array<number | string | void>;\n  requireSequence: Array<number | string>;\n  uninitializedModuleIdsRequiredInEvaluateForEffects: Set<number | string>;\n  // We can't say that a module has been initialized if it was initialized in a\n  // evaluate for effects context until we know the effects are applied.\n  logModules: boolean;\n\n  getStatistics(): SerializerStatistics {\n    return this.modules.getStatistics();\n  }\n\n  log(message: string): void {\n    if (this.logModules) console.log(`[modules] ${this.requireStack.map(_ => \"  \").join(\"\")}${message}`);\n  }\n\n  beginEvaluateForEffects(state: any): void {\n    if (state !== this) {\n      this.log(\">evaluate for effects\");\n      this.evaluateForEffectsNesting++;\n      this.requireStack.push(undefined);\n    }\n  }\n\n  endEvaluateForEffects(state: any, effects: void | Effects): void {\n    if (state !== this) {\n      let popped = this.requireStack.pop();\n      invariant(popped === undefined);\n      this.evaluateForEffectsNesting--;\n      this.log(\"<evaluate for effects\");\n    }\n  }\n\n  _callRequireAndRecord(moduleIdValue: number | string, performCall: () => Value): void | Value {\n    if (this.requireStack.length === 0 || this.requireStack[this.requireStack.length - 1] !== moduleIdValue) {\n      this.requireStack.push(moduleIdValue);\n      try {\n        let value = performCall();\n        if (this.modules.moduleIds.has(\"\" + moduleIdValue)) this.modules.recordModuleInitialized(moduleIdValue, value);\n        return value;\n      } finally {\n        invariant(this.requireStack.pop() === moduleIdValue);\n      }\n    }\n    return undefined;\n  }\n\n  _tryExtractDependencies(value: void | Value): void | Array<Value> {\n    if (value === undefined || value instanceof NullValue || value instanceof UndefinedValue) return [];\n    if (value instanceof ArrayValue) {\n      const realm = this.modules.realm;\n      const lengthValue = Get(realm, value, \"length\");\n      if (lengthValue instanceof NumberValue) {\n        const dependencies = [];\n        const logger = this.modules.logger;\n        for (let i = 0; i < lengthValue.value; i++) {\n          const elementValue = logger.tryQuery(\n            () => Get(realm, ((value: any): ArrayValue), \"\" + i),\n            realm.intrinsics.undefined\n          );\n          dependencies.push(elementValue);\n        }\n        return dependencies;\n      }\n    }\n    return undefined;\n  }\n\n  detourCall(\n    F: FunctionValue,\n    thisArgument: void | Value,\n    argumentsList: Array<Value>,\n    newTarget: void | ObjectValue,\n    performCall: () => Value\n  ): void | Value {\n    let requireInfo = this.modules.getRequireInfo();\n    if (requireInfo !== undefined && F === requireInfo.value && argumentsList.length === 1) {\n      // Here, we handle calls of the form\n      //   require(42)\n\n      let moduleId = argumentsList[0];\n      let moduleIdValue;\n\n      // Do some sanity checks and request require(...) calls with bad arguments\n      if (moduleId instanceof NumberValue || moduleId instanceof StringValue) moduleIdValue = moduleId.value;\n      else return performCall();\n      // call require(...); this might cause calls to the define function\n      let res = this._callRequireAndRecord(moduleIdValue, performCall);\n      if (F.$Realm.eagerlyRequireModuleDependencies) {\n        // all dependencies of the required module should now be known\n        let dependencies = this.modules.moduleDependencies.get(moduleIdValue);\n        if (dependencies === undefined)\n          this.modules.logger.logError(moduleId, `Cannot resolve module dependencies for ${moduleIdValue.toString()}.`);\n        else\n          for (let dependency of dependencies) {\n            // We'll try to initialize module dependency on a best-effort basis,\n            // ignoring any errors. Note that tryInitializeModule applies effects on success.\n            if (dependency instanceof NumberValue || dependency instanceof StringValue)\n              this.modules.tryInitializeModule(dependency.value, `Eager initialization of module ${dependency.value}`);\n          }\n      }\n      return res;\n    } else if (F === this.modules.getDefine()) {\n      // Here, we handle calls of the form\n      //   __d(factoryFunction, moduleId, dependencyArray)\n      let moduleId = argumentsList[1];\n      if (moduleId instanceof NumberValue || moduleId instanceof StringValue) {\n        let moduleIdValue = moduleId.value;\n        let factoryFunction = argumentsList[0];\n        if (factoryFunction instanceof FunctionValue) {\n          this.modules.moduleIds.add(\"\" + moduleIdValue);\n          let dependencies = this._tryExtractDependencies(argumentsList[2]);\n          if (dependencies !== undefined) {\n            this.modules.moduleDependencies.set(moduleIdValue, dependencies);\n            this.modules.factoryFunctionDependencies.set(factoryFunction, dependencies);\n          } else\n            this.modules.logger.logError(\n              argumentsList[2],\n              \"Third argument to define function is present but not a concrete array.\"\n            );\n\n          // Remove if explicitly marked at optimization time\n          let realm = factoryFunction.$Realm;\n          if (realm.removeModuleFactoryFunctions) {\n            let targetFunction = factoryFunction;\n            if (factoryFunction instanceof BoundFunctionValue) targetFunction = factoryFunction.$BoundTargetFunction;\n            invariant(targetFunction instanceof ECMAScriptSourceFunctionValue);\n            let body = ((targetFunction.$ECMAScriptCode: any): FunctionBodyAstNode);\n            let uniqueOrderedTag = body.uniqueOrderedTag;\n            invariant(uniqueOrderedTag !== undefined);\n            realm.moduleFactoryFunctionsToRemove.set(uniqueOrderedTag, \"\" + moduleId.value);\n          }\n        } else\n          this.modules.logger.logError(factoryFunction, \"First argument to define function is not a function value.\");\n      } else\n        this.modules.logger.logError(moduleId, \"Second argument to define function is not a number or string value.\");\n    }\n    return undefined;\n  }\n}\n\nexport type RequireInfo = {\n  value: FunctionValue,\n  globalName: string,\n};\n\nexport class Modules {\n  constructor(realm: Realm, logger: Logger, logModules: boolean) {\n    this.realm = realm;\n    this.logger = logger;\n    this._define = realm.intrinsics.undefined;\n    this.factoryFunctionDependencies = new Map();\n    this.moduleDependencies = new Map();\n    this.moduleIds = new Set();\n    this.initializedModules = new Map();\n    realm.tracers.push((this.moduleTracer = new ModuleTracer(this, logModules)));\n  }\n\n  realm: Realm;\n  logger: Logger;\n  _requireInfo: void | RequireInfo;\n  _define: Value;\n  factoryFunctionDependencies: Map<FunctionValue, Array<Value>>;\n  moduleDependencies: Map<number | string, Array<Value>>;\n  moduleIds: Set<string>;\n  initializedModules: Map<string, Value>;\n  active: boolean;\n  moduleTracer: ModuleTracer;\n\n  getStatistics(): SerializerStatistics {\n    invariant(this.realm.statistics instanceof SerializerStatistics, \"serialization requires SerializerStatistics\");\n    return this.realm.statistics;\n  }\n\n  resolveInitializedModules(): void {\n    let globalInitializedModulesMap = this._getGlobalProperty(\"__initializedModules\");\n    invariant(globalInitializedModulesMap instanceof ObjectValue);\n    for (let moduleId of globalInitializedModulesMap.properties.keys()) {\n      let property = globalInitializedModulesMap.properties.get(moduleId);\n      invariant(property);\n      if (property.descriptor instanceof PropertyDescriptor) {\n        let moduleValue = property.descriptor && property.descriptor.value;\n        if (moduleValue instanceof Value && !moduleValue.mightHaveBeenDeleted()) {\n          this.initializedModules.set(moduleId, moduleValue);\n        }\n      }\n    }\n\n    let moduleFactoryFunctionsToRemove = this.realm.moduleFactoryFunctionsToRemove;\n    for (let [functionId, moduleIdOfFunction] of this.realm.moduleFactoryFunctionsToRemove) {\n      if (!this.initializedModules.has(moduleIdOfFunction)) moduleFactoryFunctionsToRemove.delete(functionId);\n    }\n    this.getStatistics().initializedModules = this.initializedModules.size;\n    this.getStatistics().totalModules = this.moduleIds.size;\n  }\n\n  _getGlobalProperty(name: string): Value {\n    if (this.active) return this.realm.intrinsics.undefined;\n    this.active = true;\n    try {\n      let realm = this.realm;\n      return this.logger.tryQuery(() => Get(realm, realm.$GlobalObject, name), realm.intrinsics.undefined);\n    } finally {\n      this.active = false;\n    }\n  }\n\n  getRequireInfo(): void | RequireInfo {\n    if (this._requireInfo === undefined)\n      for (let globalName of [\"require\", \"__r\"]) {\n        let value = this._getGlobalProperty(globalName);\n        if (value instanceof FunctionValue) {\n          this._requireInfo = { value, globalName };\n          break;\n        }\n      }\n    return this._requireInfo;\n  }\n\n  getDefine(): Value {\n    if (!(this._define instanceof FunctionValue)) this._define = this._getGlobalProperty(\"__d\");\n    return this._define;\n  }\n\n  // Returns a function that checks if a call node represents a call to a\n  // known require function, and if so, what module id that call indicates.\n  // A known require function call is either of the form\n  //   ... require(42) ...\n  // where require resolves to the global require function, or\n  //   factoryFunction(, require, , , dependencies) {\n  //     ...\n  //       ... require(dependencies[3]) ...\n  // where factoryFunction and dependencies were announced as part of the\n  // global code execution via a global module declaration call such as\n  //   global.__d(factoryFunction, , [0,2,4,6,8])\n  getGetModuleIdIfNodeIsRequireFunction(\n    formalParameters: Array<BabelNodeLVal>,\n    functions: Array<FunctionValue>\n  ): (scope: any, node: BabelNodeCallExpression) => void | number | string {\n    let realm = this.realm;\n    let logger = this.logger;\n    let modules = this;\n    return (scope: any, node: BabelNodeCallExpression) => {\n      // Are we calling a function that has a single name and a single argument?\n      if (!t.isIdentifier(node.callee) || node.arguments.length !== 1) return undefined;\n      let argument = node.arguments[0];\n      if (!argument) return undefined;\n\n      if (!t.isNumericLiteral(argument) && !t.isStringLiteral(argument) && !t.isMemberExpression(argument))\n        return undefined;\n\n      invariant(node.callee);\n      let innerName = ((node.callee: any): BabelNodeIdentifier).name;\n\n      let moduleId;\n\n      // Helper function used to give up if we ever come up with different module ids for different functions\n      let updateModuleId = newModuleId => {\n        if (moduleId !== undefined && moduleId !== newModuleId) return false;\n        moduleId = newModuleId;\n        return true;\n      };\n\n      // Helper function that retrieves module id from call argument, possibly chasing dependency array indirection\n      const getModuleId = (dependencies?: Array<Value>): void | number | string => {\n        if (t.isMemberExpression(argument)) {\n          if (dependencies !== undefined) {\n            let memberExpression = ((argument: any): BabelNodeMemberExpression);\n            if (t.isIdentifier(memberExpression.object)) {\n              let scopedBinding = scope.getBinding(((memberExpression.object: any): BabelNodeIdentifier).name);\n              if (scopedBinding && formalParameters[4] === scopedBinding.path.node) {\n                if (t.isNumericLiteral(memberExpression.property)) {\n                  let dependencyIndex = memberExpression.property.value;\n                  if (\n                    Number.isInteger(dependencyIndex) &&\n                    dependencyIndex >= 0 &&\n                    dependencyIndex < dependencies.length\n                  ) {\n                    let dependency = dependencies[dependencyIndex];\n                    if (dependency instanceof NumberValue || dependency instanceof StringValue) return dependency.value;\n                  }\n                }\n              }\n            }\n          }\n        } else {\n          return ((argument: any): BabelNodeNumericLiteral | BabelNodeStringLiteral).value;\n        }\n      };\n\n      // Let's consider each of the function instances (closures for the same code)\n      for (let f of functions) {\n        // 1. Let's check if we have a match for a factory function like\n        //      factoryFunction(, require, , , [dependencies])\n        //    which is used with the Metro bundler\n        let scopedBinding = scope.getBinding(innerName);\n        if (scopedBinding) {\n          let dependencies = modules.factoryFunctionDependencies.get(f);\n          if (dependencies !== undefined && formalParameters[1] === scopedBinding.path.node) {\n            invariant(scopedBinding.kind === \"param\");\n            let newModuleId = getModuleId(dependencies);\n            if (newModuleId !== undefined && !updateModuleId(newModuleId)) return undefined;\n            continue;\n          }\n\n          // The name binds to some local entity, but nothing we'd know what exactly it is\n          return undefined;\n        }\n\n        // 2. Let's check if we can resolve the called function just by looking at the\n        //    function instance environment.\n        //    TODO: We should not do this if the current node is in a nested function!\n\n        // We won't have a dependency map here, so this only works for literal arguments.\n        if (!t.isNumericLiteral(argument) && !t.isStringLiteral(argument)) return undefined;\n\n        let doesNotMatter = true;\n        let reference = logger.tryQuery(\n          () => Environment.ResolveBinding(realm, innerName, doesNotMatter, f.$Environment),\n          undefined\n        );\n        if (reference === undefined) {\n          // We couldn't resolve as we came across some behavior that we cannot deal with abstractly\n          return undefined;\n        }\n        if (Environment.IsUnresolvableReference(realm, reference)) return undefined;\n        let referencedBase = reference.base;\n        let referencedName: string = (reference.referencedName: any);\n        if (typeof referencedName !== \"string\") return undefined;\n        let value;\n        if (reference.base instanceof GlobalEnvironmentRecord) {\n          value = logger.tryQuery(() => Get(realm, realm.$GlobalObject, innerName), realm.intrinsics.undefined);\n        } else {\n          invariant(referencedBase instanceof DeclarativeEnvironmentRecord);\n          let binding = referencedBase.bindings[referencedName];\n          if (!binding.initialized) return undefined;\n          value = binding.value;\n        }\n        let requireInfo = modules.getRequireInfo();\n        if (requireInfo === undefined || value !== requireInfo.value) return undefined;\n        const newModuleId = getModuleId();\n        invariant(newModuleId !== undefined);\n        if (!updateModuleId(newModuleId)) return undefined;\n      }\n\n      return moduleId;\n    };\n  }\n\n  recordModuleInitialized(moduleId: number | string, value: Value): void {\n    this.realm.assignToGlobal(\n      t.memberExpression(\n        t.memberExpression(t.identifier(\"global\"), t.identifier(\"__initializedModules\")),\n        t.identifier(\"\" + moduleId)\n      ),\n      value\n    );\n  }\n\n  tryInitializeModule(moduleId: number | string, message: string): void | Effects {\n    let realm = this.realm;\n    let requireInfo = this.getRequireInfo();\n    if (requireInfo === undefined) return undefined;\n    return downgradeErrorsToWarnings(realm, () => {\n      try {\n        let node = t.callExpression(t.identifier(requireInfo.globalName), [t.valueToNode(moduleId)]);\n\n        let effects = realm.evaluateNodeForEffectsInGlobalEnv(node);\n        realm.applyEffects(effects, message);\n        return effects;\n      } catch (err) {\n        if (err instanceof FatalError) return undefined;\n        else throw err;\n      }\n    });\n  }\n\n  initializeMoreModules(modulesToInitialize: Set<string | number> | \"ALL\"): void {\n    // partially evaluate all factory methods by calling require\n    let count = 0;\n    let body = (moduleId: string) => {\n      if (this.initializedModules.has(moduleId)) return;\n      let moduleIdNumberIfNumeric = parseInt(moduleId, 10);\n      if (isNaN(moduleIdNumberIfNumeric)) moduleIdNumberIfNumeric = moduleId;\n      let effects = this.tryInitializeModule(\n        moduleIdNumberIfNumeric,\n        `Speculative initialization of module ${moduleId}`\n      );\n      if (effects === undefined) return;\n      let result = effects.result;\n      if (!(result instanceof NormalCompletion)) return; // module might throw\n      count++;\n      this.initializedModules.set(moduleId, result.value);\n    };\n    if (modulesToInitialize === \"ALL\") {\n      for (let moduleId of this.moduleIds) body(moduleId);\n    } else {\n      for (let moduleId of modulesToInitialize) body(\"\" + moduleId);\n    }\n    if (count > 0) console.log(`=== speculatively initialized ${count} additional modules`);\n  }\n}\n"
  },
  {
    "path": "src/utils/native-to-interp.js",
    "content": "/**\n * Copyright (c) 2017-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n/* @flow */\n\nimport type { Realm } from \"../realm.js\";\nimport { FatalError } from \"../errors.js\";\nimport { Value, StringValue, NumberValue, ObjectValue } from \"../values/index.js\";\nimport { Create } from \"../singletons.js\";\nimport { PropertyDescriptor } from \"../descriptors.js\";\n\nexport default function convert(realm: Realm, val: any): Value {\n  if (typeof val === \"number\") {\n    return new NumberValue(realm, val);\n  } else if (typeof val === \"string\") {\n    return new StringValue(realm, val);\n  } else if (val === null) {\n    return realm.intrinsics.null;\n  } else if (val === undefined) {\n    return realm.intrinsics.undefined;\n  } else if (val === true) {\n    return realm.intrinsics.true;\n  } else if (val === false) {\n    return realm.intrinsics.false;\n  } else if (Array.isArray(val)) {\n    return Create.CreateArrayFromList(realm, val.map(item => convert(realm, item)));\n  } else if (typeof val === \"object\") {\n    let obj = new ObjectValue(realm, realm.intrinsics.ObjectPrototype);\n\n    for (let key in val) {\n      obj.$DefineOwnProperty(\n        key,\n        new PropertyDescriptor({\n          enumerable: true,\n          writable: true,\n          configurable: true,\n          value: convert(realm, val[key]),\n        })\n      );\n    }\n\n    return obj;\n  } else {\n    throw new FatalError(\"need to convert value of type \" + typeof val);\n  }\n}\n"
  },
  {
    "path": "src/utils/parse.js",
    "content": "/**\n * Copyright (c) 2017-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n/* @flow strict-local */\n\nimport invariant from \"../invariant.js\";\nimport type { SourceType } from \"../types.js\";\nimport type { Realm } from \"../realm.js\";\nimport { ThrowCompletion } from \"../completions.js\";\nimport { StringValue } from \"../values/index.js\";\nimport { Construct } from \"../methods/construct.js\";\nimport traverseFast from \"./traverse-fast.js\";\nimport { parse } from \"@babel/parser\";\nimport type { BabelNodeFile } from \"@babel/types\";\n\nexport default function(\n  realm: Realm,\n  code: string,\n  filename: string,\n  sourceType: SourceType = \"script\",\n  startLine: number = 1\n): BabelNodeFile {\n  try {\n    let plugins = [\"objectRestSpread\"];\n    if (realm.react.enabled) {\n      plugins.push(\"jsx\");\n    }\n    if (realm.stripFlow) {\n      plugins.push(\"flow\");\n    }\n    let ast = parse(code, { filename, sourceType, startLine, plugins });\n    traverseFast(ast, node => {\n      invariant(node.loc);\n      node.loc.source = filename;\n      return false;\n    });\n    return ast;\n  } catch (e) {\n    if (e instanceof SyntaxError) {\n      // Babel reports all errors as syntax errors, even if a ReferenceError should be thrown.\n      // What we do here is a totally robust way to address that issue.\n      let referenceErrors = [\n        \"Invalid left-hand side in postfix operation\",\n        \"Invalid left-hand side in prefix operation\",\n        \"Invalid left-hand side in assignment expression\",\n      ];\n\n      let error;\n      if (referenceErrors.some(msg => e.message.indexOf(msg) >= 0)) {\n        error = Construct(realm, realm.intrinsics.ReferenceError, [new StringValue(realm, e.message)]);\n      } else {\n        error = Construct(realm, realm.intrinsics.SyntaxError, [new StringValue(realm, e.message)]);\n      }\n      error = error.throwIfNotConcreteObject();\n      // These constructors are currently guaranteed to produce an object with\n      // built-in error data. Append location information about the syntax error\n      // and the source code to it so that we can use it to print nicer errors.\n      invariant(error.$ErrorData);\n      error.$ErrorData.locationData = {\n        filename: filename,\n        sourceCode: code,\n        loc: e.loc,\n        stackDecorated: false,\n      };\n      throw new ThrowCompletion(error, e.loc);\n    } else {\n      throw e;\n    }\n  }\n}\n"
  },
  {
    "path": "src/utils/paths.js",
    "content": "/**\n * Copyright (c) 2017-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n/* @flow strict-local */\n\nimport { InfeasiblePathError } from \"../errors.js\";\nimport invariant from \"../invariant.js\";\nimport { Realm } from \"../realm.js\";\nimport { PathConditions } from \"../types.js\";\nimport { AbstractValue, ConcreteValue, NullValue, UndefinedValue, Value } from \"../values/index.js\";\n\nexport class PathConditionsImplementation extends PathConditions {\n  constructor(baseConditions?: void | PathConditions) {\n    super();\n    this._assumedConditions = new Set();\n    this._readonly = false;\n    if (baseConditions !== undefined) {\n      invariant(baseConditions instanceof PathConditionsImplementation);\n      this._baseConditions = baseConditions;\n    }\n  }\n\n  _assumedConditions: Set<AbstractValue>;\n  _readonly: boolean;\n  _baseConditions: void | PathConditionsImplementation;\n  _impliedConditions: void | Set<AbstractValue>;\n  _impliedNegatives: void | Set<AbstractValue>;\n  _failedImplications: void | Set<AbstractValue>;\n  _failedNegativeImplications: void | Set<AbstractValue>;\n\n  add(c: AbstractValue): void {\n    invariant(!this._readonly);\n    this._assumedConditions.add(c);\n    this._failedImplications = undefined;\n    this._failedNegativeImplications = undefined;\n  }\n\n  // It makes the strong assumption that, in order for 2 path conditions to be equal,\n  // the number of values must be the same, as well as their order.\n  // This might not always be the case, yielding false negatives?!\n  equals(x: PathConditions): boolean {\n    invariant(x instanceof PathConditionsImplementation);\n    let conditionsAreEqual = () => {\n      if (this._assumedConditions.size !== x._assumedConditions.size) return false;\n      let thisConditions = Array.from(this._assumedConditions);\n      let xConditions = Array.from(x._assumedConditions);\n      let thisLength = thisConditions.length;\n      for (let i = 0; i < thisLength; i++) {\n        let thisCondition = thisConditions[i];\n        let xCondition = xConditions[i];\n        if (!thisCondition.equals(xCondition)) return false;\n      }\n      return true;\n    };\n    let baseConditionsAreEqual = () => {\n      if (this._baseConditions && !x._baseConditions) return false;\n      if (!this._baseConditions && x._baseConditions) return false;\n      if (this._baseConditions && x._baseConditions) return this._baseConditions.equals(x._baseConditions);\n      return true;\n    };\n    return this === x || (conditionsAreEqual() && baseConditionsAreEqual());\n  }\n\n  isReadOnly(): boolean {\n    return this._readonly;\n  }\n\n  // this => val. A false value does not imply that !(this => val).\n  implies(e: Value, depth: number = 0): boolean {\n    if (!e.mightNotBeTrue()) return true;\n    if (!e.mightNotBeFalse()) return false;\n    invariant(e instanceof AbstractValue);\n    if (this._assumedConditions.has(e)) return true;\n    if (this._impliedConditions !== undefined && this._impliedConditions.has(e)) return true;\n    if (this._impliedNegatives !== undefined && this._impliedNegatives.has(e)) return false;\n    if (this._failedImplications !== undefined && this._failedImplications.has(e)) return false;\n    if (depth > 10) return false;\n    if (this._baseConditions !== undefined && this._baseConditions.implies(e, depth + 1)) return true;\n    for (let assumedCondition of this._assumedConditions) {\n      if (assumedCondition.implies(e, depth + 1)) return this.cacheImplicationSuccess(e);\n    }\n    if (e.kind === \"||\") {\n      let [x, y] = e.args;\n      // this => x || true, regardless of the value of x\n      // this => true || y, regardless of the value of y\n      if (!x.mightNotBeTrue() || !y.mightNotBeTrue()) return this.cacheImplicationSuccess(e);\n      // this => false || y, if this => y\n      if (!x.mightNotBeFalse() && this.implies(y, depth + 1)) return this.cacheImplicationSuccess(e);\n      // this => x || false if this => x\n      if (!y.mightNotBeFalse() && this.implies(x, depth + 1)) return this.cacheImplicationSuccess(e);\n      // this => x || y if this => x\n      if (this.implies(x, depth + 1)) return this.cacheImplicationSuccess(e);\n      // this => x || y if this => y\n      if (this.implies(y, depth + 1)) return this.cacheImplicationSuccess(e);\n    }\n    if (e.kind === \"!==\" || e.kind === \"!=\") {\n      let [x, y] = e.args;\n      if (x instanceof AbstractValue) {\n        // this => x !== null && x !== undefined, if this => x\n        // this => x != null && x != undefined, if this => x\n        if ((y instanceof NullValue || y instanceof UndefinedValue) && this.implies(x, depth + 1))\n          return this.cacheImplicationSuccess(e);\n      } else {\n        invariant(y instanceof AbstractValue); // otherwise e would have been simplied\n        // this => null !== y && undefined !== y, if this => y\n        // this => null != y && undefined != y, if this => y\n        if ((x instanceof NullValue || x instanceof UndefinedValue) && this.implies(y, depth + 1))\n          return this.cacheImplicationSuccess(e);\n      }\n    }\n    if (e.kind === \"!\") {\n      let [x] = e.args;\n      if (this.impliesNot(x, depth + 1)) return this.cacheImplicationSuccess(e);\n    }\n    if (this._failedImplications === undefined) this._failedImplications = new Set();\n    this._failedImplications.add(e);\n    return false;\n  }\n\n  cacheImplicationSuccess(e: AbstractValue): true {\n    if (this._impliedConditions === undefined) this._impliedConditions = new Set();\n    this._impliedConditions.add(e);\n    return true;\n  }\n\n  // this => !val. A false value does not imply that !(this => !val).\n  impliesNot(e: Value, depth: number = 0): boolean {\n    if (!e.mightNotBeTrue()) return false;\n    if (!e.mightNotBeFalse()) return true;\n    invariant(e instanceof AbstractValue);\n    if (this._assumedConditions.has(e)) return false;\n    if (this._impliedConditions !== undefined && this._impliedConditions.has(e)) return false;\n    if (this._impliedNegatives !== undefined && this._impliedNegatives.has(e)) return true;\n    if (this._failedNegativeImplications !== undefined && this._failedNegativeImplications.has(e)) return false;\n    if (depth > 10) return false;\n    if (this._baseConditions !== undefined && this._baseConditions.impliesNot(e, depth + 1)) return true;\n    for (let assumedCondition of this._assumedConditions) {\n      if (assumedCondition.impliesNot(e, depth + 1)) return this.cacheNegativeImplicationSuccess(e);\n    }\n    if (e.kind === \"&&\") {\n      let [x, y] = e.args;\n      // this => !(false && y) regardless of the value of y\n      // this => !(x && false) regardless of the value of x\n      if (!x.mightNotBeFalse() || !y.mightNotBeFalse()) return this.cacheNegativeImplicationSuccess(e);\n      // this => !(true && y), if this => !y\n      if (!x.mightNotBeTrue() && this.impliesNot(y, depth + 1)) return this.cacheNegativeImplicationSuccess(e);\n      // this => !(x && true) if this => !x\n      if (!y.mightNotBeTrue() && this.impliesNot(x, depth + 1)) return this.cacheNegativeImplicationSuccess(e);\n      // this => !(x && y) if this => !x\n      if (this.impliesNot(x, depth + 1)) return this.cacheNegativeImplicationSuccess(e);\n      // this => !(x && y) if this => !y\n      if (this.impliesNot(y, depth + 1)) return this.cacheNegativeImplicationSuccess(e);\n    }\n    if (e.kind === \"===\" || e.kind === \"==\") {\n      let [x, y] = e.args;\n      if (x instanceof AbstractValue) {\n        // this => !(x === null) && !(x === undefined), if this => x\n        // this => !(x == null) && !(x == undefined), if this => x\n        if ((y instanceof NullValue || y instanceof UndefinedValue) && this.implies(x, depth + 1))\n          return this.cacheNegativeImplicationSuccess(e);\n      } else {\n        invariant(y instanceof AbstractValue); // otherwise e would have been simplied\n        // this => !(null === y) && !(undefined === y), if this => y\n        // this => !(null == y) && !(undefined == y), if this => y\n        if ((x instanceof NullValue || x instanceof UndefinedValue) && this.implies(y, depth + 1))\n          return this.cacheNegativeImplicationSuccess(e);\n      }\n    }\n    if (e.kind === \"!\") {\n      let [x] = e.args;\n      if (this.implies(x, depth + 1)) return this.cacheNegativeImplicationSuccess(e);\n    }\n    if (this._failedNegativeImplications === undefined) this._failedNegativeImplications = new Set();\n    this._failedNegativeImplications.add(e);\n    return false;\n  }\n\n  cacheNegativeImplicationSuccess(e: AbstractValue): true {\n    if (this._impliedNegatives === undefined) this._impliedNegatives = new Set();\n    this._impliedNegatives.add(e);\n    return true;\n  }\n\n  isEmpty(): boolean {\n    return this._assumedConditions.size === 0;\n  }\n\n  getLength(): number {\n    return this._assumedConditions.size;\n  }\n\n  getAssumedConditions(): Set<AbstractValue> {\n    return this._assumedConditions;\n  }\n\n  // Refinement may temporarily make a target non-read-only, but marks the target as read-only at the end.\n  refineBaseConditons(\n    realm: Realm,\n    totalRefinements: number = 0,\n    refinementTarget: PathConditionsImplementation = this\n  ): void {\n    try {\n      if (realm.abstractValueImpliesMax > 0) return;\n      let total = totalRefinements;\n      let refine = (condition: AbstractValue) => {\n        let refinedCondition = realm.simplifyAndRefineAbstractCondition(condition);\n        if (refinedCondition !== condition) {\n          if (!refinedCondition.mightNotBeFalse()) throw new InfeasiblePathError();\n          if (refinedCondition instanceof AbstractValue) {\n            refinementTarget._readonly = false;\n            refinementTarget.add(refinedCondition);\n          }\n        }\n      };\n      if (this._baseConditions !== undefined) {\n        let savedBaseConditions = this._baseConditions;\n        try {\n          this._baseConditions = undefined;\n          for (let assumedCondition of savedBaseConditions._assumedConditions) {\n            if (assumedCondition.kind === \"||\") {\n              if (++total > 4) break;\n              refine(assumedCondition);\n            }\n          }\n        } finally {\n          this._baseConditions = savedBaseConditions;\n        }\n        savedBaseConditions.refineBaseConditons(realm, total, refinementTarget);\n      }\n    } finally {\n      refinementTarget._readonly = true;\n    }\n  }\n}\n\nexport class PathImplementation {\n  // this => val. A false value does not imply that !(this => val).\n  implies(condition: Value, depth: number = 0): boolean {\n    if (!condition.mightNotBeTrue()) return true; // any path implies true\n    if (!condition.mightNotBeFalse()) return false; // no path condition is false\n    invariant(condition instanceof AbstractValue);\n    return condition.$Realm.pathConditions.implies(condition, depth);\n  }\n\n  // this => !val. A false value does not imply that !(this => !val).\n  impliesNot(condition: Value, depth: number = 0): boolean {\n    if (!condition.mightNotBeFalse()) return true; // any path implies !false\n    if (!condition.mightNotBeTrue()) return false; // no path condition is false, so none can imply !true\n    invariant(condition instanceof AbstractValue);\n    return condition.$Realm.pathConditions.impliesNot(condition, depth);\n  }\n\n  withCondition<T>(condition: Value, evaluate: () => T): T {\n    let realm = condition.$Realm;\n    if (!condition.mightNotBeFalse()) {\n      if (realm.impliesCounterOverflowed) throw new InfeasiblePathError();\n      invariant(false, \"assuming that false equals true is asking for trouble\");\n    }\n    let savedPath = realm.pathConditions;\n    realm.pathConditions = new PathConditionsImplementation(savedPath);\n    try {\n      pushPathCondition(condition);\n      realm.pathConditions.refineBaseConditons(realm);\n      return evaluate();\n    } catch (e) {\n      if (e instanceof InfeasiblePathError) {\n        // if condition is true, one of the saved path conditions must be false\n        // since we have to assume that those conditions are true we now know that on this path, condition is false\n        realm.pathConditions = savedPath;\n        pushInversePathCondition(condition);\n      }\n      throw e;\n    } finally {\n      realm.pathConditions = savedPath;\n    }\n  }\n\n  withInverseCondition<T>(condition: Value, evaluate: () => T): T {\n    let realm = condition.$Realm;\n    if (!condition.mightNotBeTrue()) {\n      if (realm.impliesCounterOverflowed) throw new InfeasiblePathError();\n      invariant(false, \"assuming that false equals true is asking for trouble\");\n    }\n    let savedPath = realm.pathConditions;\n    realm.pathConditions = new PathConditionsImplementation(savedPath);\n    try {\n      pushInversePathCondition(condition);\n      realm.pathConditions.refineBaseConditons(realm);\n      return evaluate();\n    } catch (e) {\n      if (e instanceof InfeasiblePathError) {\n        // if condition is false, one of the saved path conditions must be false\n        // since we have to assume that those conditions are true we now know that on this path, condition is true\n        realm.pathConditions = savedPath;\n        pushPathCondition(condition);\n      }\n      throw e;\n    } finally {\n      realm.pathConditions = savedPath;\n    }\n  }\n\n  pushAndRefine(condition: Value): void {\n    let realm = condition.$Realm;\n    let savedPath = realm.pathConditions;\n    realm.pathConditions = new PathConditionsImplementation(savedPath);\n\n    pushPathCondition(condition);\n    realm.pathConditions.refineBaseConditons(realm);\n  }\n\n  pushInverseAndRefine(condition: Value): void {\n    let realm = condition.$Realm;\n    let savedPath = realm.pathConditions;\n    realm.pathConditions = new PathConditionsImplementation(savedPath);\n\n    pushInversePathCondition(condition);\n    realm.pathConditions.refineBaseConditons(realm);\n  }\n}\n\n// A path condition is an abstract value that must be true in this particular code path, so we want to assume as much\nfunction pushPathCondition(condition: Value): void {\n  let realm = condition.$Realm;\n  if (realm.pathConditions.isReadOnly()) realm.pathConditions = new PathConditionsImplementation(realm.pathConditions);\n  if (!condition.mightNotBeFalse()) {\n    if (realm.impliesCounterOverflowed) throw new InfeasiblePathError();\n    invariant(false, \"assuming that false equals true is asking for trouble\");\n  }\n  if (condition instanceof ConcreteValue) return;\n  if (!condition.mightNotBeTrue()) return;\n  invariant(condition instanceof AbstractValue);\n  if (condition.kind === \"&&\") {\n    let left = condition.args[0];\n    let right = condition.args[1];\n    invariant(left instanceof AbstractValue); // it is a mistake to create an abstract value when concrete value will do\n    pushPathCondition(left);\n    pushPathCondition(right);\n  } else if (condition.kind === \"===\") {\n    let [left, right] = condition.args;\n    if (right instanceof AbstractValue && right.kind === \"conditional\") [left, right] === [right, left];\n    if (left instanceof AbstractValue && left.kind === \"conditional\") {\n      let [cond, x, y] = left.args;\n      if (right instanceof ConcreteValue && x instanceof ConcreteValue && y instanceof ConcreteValue) {\n        if (right.equals(x) && !right.equals(y)) {\n          pushPathCondition(cond);\n        } else if (!right.equals(x) && right.equals(y)) {\n          pushInversePathCondition(cond);\n        }\n      }\n    }\n    realm.pathConditions.add(condition);\n  } else {\n    if (condition.kind === \"!=\" || condition.kind === \"==\") {\n      let left = condition.args[0];\n      let right = condition.args[1];\n      if (left instanceof ConcreteValue && right instanceof AbstractValue) [left, right] = [right, left];\n      if (left instanceof AbstractValue && (right instanceof UndefinedValue || right instanceof NullValue)) {\n        if (condition.kind === \"!=\") {\n          // x != null => x!==null && x!==undefined\n          pushPathCondition(left);\n          let leftNeNull = AbstractValue.createFromBinaryOp(realm, \"!==\", left, realm.intrinsics.null);\n          let leftNeUndefined = AbstractValue.createFromBinaryOp(realm, \"!==\", left, realm.intrinsics.undefined);\n          pushPathCondition(leftNeNull);\n          pushPathCondition(leftNeUndefined);\n        } else if (condition.kind === \"==\") {\n          // x == null => x===null || x===undefined\n          pushInversePathCondition(left);\n          let leftEqNull = AbstractValue.createFromBinaryOp(realm, \"===\", left, realm.intrinsics.null);\n          let leftEqUndefined = AbstractValue.createFromBinaryOp(realm, \"===\", left, realm.intrinsics.undefined);\n          let c;\n          if (!leftEqNull.mightNotBeFalse()) c = leftEqUndefined;\n          else if (!leftEqUndefined.mightNotBeFalse()) c = leftEqNull;\n          else c = AbstractValue.createFromLogicalOp(realm, \"||\", leftEqNull, leftEqUndefined);\n          pushPathCondition(c);\n        }\n        return;\n      }\n    }\n    realm.pathConditions.add(condition);\n  }\n}\n\n// An inverse path condition is an abstract value that must be false in this particular code path, so we want to assume as much\nfunction pushInversePathCondition(condition: Value): void {\n  let realm = condition.$Realm;\n  if (realm.pathConditions.isReadOnly()) realm.pathConditions = new PathConditionsImplementation(realm.pathConditions);\n  if (!condition.mightNotBeTrue()) {\n    if (realm.impliesCounterOverflowed) throw new InfeasiblePathError();\n    invariant(false, \"assuming that false equals true is asking for trouble\");\n  }\n  if (condition instanceof ConcreteValue) return;\n  invariant(condition instanceof AbstractValue);\n  if (condition.kind === \"||\") {\n    let left = condition.args[0];\n    let right = condition.args[1];\n    invariant(left instanceof AbstractValue); // it is a mistake to create an abstract value when concrete value will do\n    pushInversePathCondition(left);\n    if (right instanceof AbstractValue) right = realm.simplifyAndRefineAbstractCondition(right);\n    if (right.mightNotBeTrue()) pushInversePathCondition(right);\n  } else {\n    if (condition.kind === \"!=\" || condition.kind === \"==\") {\n      let left = condition.args[0];\n      let right = condition.args[1];\n      if (left instanceof ConcreteValue && right instanceof AbstractValue) [left, right] = [right, left];\n      if (left instanceof AbstractValue && (right instanceof UndefinedValue || right instanceof NullValue)) {\n        let op = condition.kind === \"!=\" ? \"===\" : \"!==\";\n        if (op === \"!==\") pushPathCondition(left);\n        else pushInversePathCondition(left);\n        let leftEqNull = AbstractValue.createFromBinaryOp(realm, op, left, realm.intrinsics.null);\n        if (leftEqNull.mightNotBeFalse()) pushPathCondition(leftEqNull);\n        let leftEqUndefined = AbstractValue.createFromBinaryOp(realm, op, left, realm.intrinsics.undefined);\n        if (leftEqUndefined.mightNotBeFalse()) pushPathCondition(leftEqUndefined);\n        return;\n      }\n    }\n    let inverseCondition = AbstractValue.createFromUnaryOp(realm, \"!\", condition, false, undefined, true, true);\n    pushPathCondition(inverseCondition);\n    if (inverseCondition instanceof AbstractValue) {\n      let simplifiedInverseCondition = realm.simplifyAndRefineAbstractCondition(inverseCondition);\n      if (!simplifiedInverseCondition.equals(inverseCondition)) pushPathCondition(simplifiedInverseCondition);\n    }\n  }\n}\n"
  },
  {
    "path": "src/utils/reachability.js",
    "content": "/**\n * Copyright (c) 2017-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n/* @flow strict-local */\n\n// Implements routines to find reachable values for the purpose of leaked value analysis\n\nimport type { Realm } from \"../realm.js\";\nimport type { Descriptor, PropertyBinding, ObjectKind } from \"../types.js\";\nimport {\n  DeclarativeEnvironmentRecord,\n  FunctionEnvironmentRecord,\n  ObjectEnvironmentRecord,\n  GlobalEnvironmentRecord,\n} from \"../environment.js\";\nimport {\n  AbstractValue,\n  BoundFunctionValue,\n  ECMAScriptSourceFunctionValue,\n  EmptyValue,\n  FunctionValue,\n  NativeFunctionValue,\n  ObjectValue,\n  PrimitiveValue,\n  ProxyValue,\n  Value,\n} from \"../values/index.js\";\nimport * as t from \"@babel/types\";\nimport traverse from \"@babel/traverse\";\nimport type { BabelTraversePath } from \"@babel/traverse\";\nimport type { Binding } from \"../environment.js\";\nimport invariant from \"../invariant.js\";\nimport { PropertyDescriptor, AbstractJoinedDescriptor } from \"../descriptors.js\";\n\ntype FunctionBindingVisitorInfo = {\n  unboundReads: Set<string>,\n  unboundWrites: Set<string>,\n};\n\nfunction visitName(\n  path: BabelTraversePath,\n  state: FunctionBindingVisitorInfo,\n  name: string,\n  read: boolean,\n  write: boolean\n): void {\n  // Is the name bound to some local identifier? If so, we don't need to do anything\n  if (path.scope.hasBinding(name, /*noGlobals*/ true)) return;\n\n  // Otherwise, let's record that there's an unbound identifier\n  if (read) state.unboundReads.add(name);\n  if (write) state.unboundWrites.add(name);\n}\n\n// Why are these paths ignored?\nfunction ignorePath(path: BabelTraversePath): boolean {\n  let parent = path.parent;\n  return t.isLabeledStatement(parent) || t.isBreakStatement(parent) || t.isContinueStatement(parent);\n}\n\nlet FunctionBindingVisitor = {\n  _readOnly: false,\n  ReferencedIdentifier(path: BabelTraversePath, state: FunctionBindingVisitorInfo): void {\n    if (ignorePath(path)) return;\n\n    let innerName = path.node.name;\n    if (innerName === \"arguments\") {\n      return;\n    }\n    visitName(path, state, innerName, true, false);\n  },\n  AssignmentExpression(path: BabelTraversePath, state: FunctionBindingVisitorInfo): void {\n    let doesRead = path.node.operator !== \"=\";\n    for (let name in path.getBindingIdentifiers()) {\n      visitName(path, state, name, doesRead, !this._readOnly);\n    }\n  },\n  UpdateExpression(path: BabelTraversePath, state: FunctionBindingVisitorInfo): void {\n    let doesRead = path.node.operator !== \"=\";\n    for (let name in path.getBindingIdentifiers()) {\n      visitName(path, state, name, doesRead, !this._readOnly);\n    }\n  },\n};\n\nexport class ReachabilityImplementation {\n  computeReachableObjectsAndBindings(\n    realm: Realm,\n    rootValue: Value,\n    filterValue: Value => boolean,\n    readOnly?: boolean\n  ): [Set<ObjectValue>, Set<Binding>] {\n    invariant(realm.isInPureScope());\n\n    let reachableObjects: Set<ObjectValue> = new Set();\n    let reachableBindings: Set<Binding> = new Set();\n    let visitedValues: Set<Value> = new Set();\n    computeFromValue(rootValue);\n\n    return [reachableObjects, reachableBindings];\n\n    function computeFromBindings(\n      func: FunctionValue,\n      nonLocalReadBindings: Set<string>,\n      nonLocalWriteBindings: Set<string>\n    ): void {\n      invariant(func instanceof ECMAScriptSourceFunctionValue);\n      let environment = func.$Environment;\n      while (environment) {\n        let record = environment.environmentRecord;\n        if (record instanceof ObjectEnvironmentRecord) computeFromValue(record.object);\n        else if (record instanceof DeclarativeEnvironmentRecord || record instanceof FunctionEnvironmentRecord) {\n          computeFromDeclarativeEnvironmentRecord(record, nonLocalReadBindings, nonLocalWriteBindings);\n          if (record instanceof FunctionEnvironmentRecord) {\n            // We only ascend further in environments if the function is whitelisted\n            let fn = record.$FunctionObject;\n            if (!filterValue(fn)) break;\n          }\n        } else if (record instanceof GlobalEnvironmentRecord) {\n          // Reachability does not enumerate global bindings and objects.\n          // Prepack assumes that external functions will not mutate globals\n          // and that any references to globals need their final values.\n          break;\n        }\n        environment = environment.parent;\n      }\n    }\n    function computeFromDeclarativeEnvironmentRecord(\n      record: DeclarativeEnvironmentRecord,\n      nonLocalReadBindings: Set<string>,\n      nonLocalWriteBindings: Set<string>\n    ): void {\n      let environmentBindings = record.bindings;\n      for (let bindingName of Object.keys(environmentBindings)) {\n        let binding = environmentBindings[bindingName];\n        invariant(binding !== undefined);\n        let readFound = nonLocalReadBindings.delete(bindingName);\n        let writeFound = readOnly !== undefined && readOnly === false && nonLocalWriteBindings.delete(bindingName);\n\n        // Check what undefined could mean here, besides absent binding\n        // #2446\n        let value = binding.value;\n        if (readFound && value !== undefined) {\n          computeFromValue(value);\n        }\n\n        if (readFound || writeFound) {\n          reachableBindings.add(binding);\n        }\n      }\n    }\n    function computeFromAbstractValue(value: AbstractValue): void {\n      if (value.kind === \"conditional\") {\n        // For a conditional, we only have to visit each case. Not the condition itself.\n        computeFromValue(value.args[1]);\n        computeFromValue(value.args[2]);\n        return;\n      }\n\n      if (value.values.isTop()) {\n        for (let arg of value.args) {\n          computeFromValue(arg);\n        }\n      } else {\n        // If we know which object this might be, then leak each of them.\n        for (let element of value.values.getElements()) {\n          computeFromValue(element);\n        }\n      }\n    }\n    function computeFromProxyValue(value: ProxyValue): void {\n      computeFromValue(value.$ProxyTarget);\n      computeFromValue(value.$ProxyHandler);\n    }\n    function computeFromValue(value: Value): void {\n      invariant(value !== undefined);\n      if (value instanceof EmptyValue || value instanceof PrimitiveValue) {\n        visit(value);\n      } else if (value instanceof AbstractValue) {\n        ifNotVisited(value, computeFromAbstractValue);\n      } else if (value instanceof FunctionValue) {\n        ifNotVisited(value, computeFromFunctionValue);\n      } else if (value instanceof ObjectValue) {\n        ifNotVisited(value, computeFromObjectValue);\n      } else if (value instanceof ProxyValue) {\n        ifNotVisited(value, computeFromProxyValue);\n      }\n    }\n    function computeFromObjectValue(value: Value): void {\n      invariant(value instanceof ObjectValue);\n\n      let kind = value.getKind();\n      computeFromObjectProperties(value, kind);\n\n      switch (kind) {\n        case \"RegExp\":\n        case \"Number\":\n        case \"String\":\n        case \"Boolean\":\n        case \"ReactElement\":\n        case \"ArrayBuffer\":\n        case \"Array\":\n          break;\n        case \"Date\":\n          let dateValue = value.$DateValue;\n          invariant(dateValue !== undefined);\n          computeFromValue(dateValue);\n          break;\n        case \"Float32Array\":\n        case \"Float64Array\":\n        case \"Int8Array\":\n        case \"Int16Array\":\n        case \"Int32Array\":\n        case \"Uint8Array\":\n        case \"Uint16Array\":\n        case \"Uint32Array\":\n        case \"Uint8ClampedArray\":\n        case \"DataView\":\n          let buf = value.$ViewedArrayBuffer;\n          invariant(buf !== undefined);\n          computeFromValue(buf);\n          break;\n        case \"Map\":\n        case \"WeakMap\":\n          ifNotVisited(value, computeFromMap);\n          break;\n        case \"Set\":\n        case \"WeakSet\":\n          ifNotVisited(value, computeFromSet);\n          break;\n        default:\n          invariant(kind === \"Object\", `Object of kind ${kind} is not supported in calls to abstract functions.`);\n          invariant(\n            value.$ParameterMap === undefined,\n            `Arguments object is not supported in calls to abstract functions.`\n          );\n          break;\n      }\n      if (!reachableObjects.has(value)) reachableObjects.add(value);\n    }\n    function computeFromDescriptor(descriptor: Descriptor): void {\n      if (descriptor === undefined) {\n      } else if (descriptor instanceof PropertyDescriptor) {\n        if (descriptor.value !== undefined) computeFromValue(descriptor.value);\n        if (descriptor.get !== undefined) computeFromValue(descriptor.get);\n        if (descriptor.set !== undefined) computeFromValue(descriptor.set);\n      } else if (descriptor instanceof AbstractJoinedDescriptor) {\n        computeFromValue(descriptor.joinCondition);\n        if (descriptor.descriptor1 !== undefined) computeFromDescriptor(descriptor.descriptor1);\n        if (descriptor.descriptor2 !== undefined) computeFromDescriptor(descriptor.descriptor2);\n      } else {\n        invariant(false, \"unknown descriptor\");\n      }\n    }\n    function computeFromObjectPropertyBinding(binding: PropertyBinding): void {\n      let descriptor = binding.descriptor;\n      if (descriptor === undefined) return; //deleted\n      computeFromDescriptor(descriptor);\n    }\n\n    function computeFromObjectProperties(obj: ObjectValue, kind?: ObjectKind): void {\n      // symbol properties\n      for (let [, propertyBindingValue] of obj.symbols) {\n        invariant(propertyBindingValue);\n        computeFromObjectPropertyBinding(propertyBindingValue);\n      }\n\n      // string properties\n      for (let [, propertyBindingValue] of obj.properties) {\n        invariant(propertyBindingValue);\n        computeFromObjectPropertyBinding(propertyBindingValue);\n      }\n\n      // unkonwn property\n      if (obj.unknownProperty !== undefined && obj.unknownProperty.descriptor !== undefined) {\n        computeFromDescriptor(obj.unknownProperty.descriptor);\n      }\n\n      // prototype\n      if (obj.$Prototype !== undefined) computeFromObjectPrototype(obj);\n    }\n    function computeFromObjectPrototype(obj: ObjectValue) {\n      computeFromValue(obj.$Prototype);\n    }\n    function computeFromFunctionValue(fn: FunctionValue) {\n      computeFromObjectProperties(fn);\n\n      if (fn instanceof BoundFunctionValue) {\n        computeFromValue(fn.$BoundTargetFunction);\n        computeFromValue(fn.$BoundThis);\n        for (let boundArg of fn.$BoundArguments) computeFromValue(boundArg);\n        return;\n      }\n\n      invariant(\n        !(fn instanceof NativeFunctionValue),\n        \"all native function values should have already been created outside this pure function\"\n      );\n\n      let [nonLocalReadBindings, nonLocalWriteBindings] = parsedBindingsOfFunction(fn);\n      computeFromBindings(fn, nonLocalReadBindings, nonLocalWriteBindings);\n    }\n\n    function computeFromMap(val: ObjectValue): void {\n      let kind = val.getKind();\n\n      let entries;\n      if (kind === \"Map\") {\n        entries = val.$MapData;\n      } else {\n        invariant(kind === \"WeakMap\");\n        entries = val.$WeakMapData;\n      }\n      invariant(entries !== undefined);\n      let len = entries.length;\n\n      for (let i = 0; i < len; i++) {\n        let entry = entries[i];\n        let key = entry.$Key;\n        let value = entry.$Value;\n        if (key === undefined || value === undefined) continue;\n        computeFromValue(key);\n        computeFromValue(value);\n      }\n    }\n\n    function computeFromSet(val: ObjectValue): void {\n      let kind = val.getKind();\n\n      let entries;\n      if (kind === \"Set\") {\n        entries = val.$SetData;\n      } else {\n        invariant(kind === \"WeakSet\");\n        entries = val.$WeakSetData;\n      }\n      invariant(entries !== undefined);\n      let len = entries.length;\n\n      for (let i = 0; i < len; i++) {\n        let entry = entries[i];\n        if (entry === undefined) continue;\n\n        computeFromValue(entry);\n      }\n    }\n\n    function parsedBindingsOfFunction(func: FunctionValue): [Set<string>, Set<string>] {\n      let functionInfo = {\n        unboundReads: new Set(),\n        unboundWrites: new Set(),\n      };\n\n      invariant(func instanceof ECMAScriptSourceFunctionValue);\n\n      let formalParameters = func.$FormalParameters;\n      invariant(formalParameters != null);\n\n      let code = func.$ECMAScriptCode;\n      invariant(code != null);\n\n      FunctionBindingVisitor._readOnly = !!readOnly;\n\n      traverse(\n        t.file(t.program([t.expressionStatement(t.functionExpression(null, formalParameters, code))])),\n        FunctionBindingVisitor,\n        null,\n        functionInfo\n      );\n      traverse.cache.clear();\n\n      return [functionInfo.unboundReads, functionInfo.unboundWrites];\n    }\n    function ifNotVisited<T>(value: T, computeFrom: T => void): void {\n      if (!(value instanceof Value) || (filterValue(value) && !visitedValues.has(value))) {\n        visitedValues.add(value);\n        computeFrom(value);\n      }\n    }\n    function visit(value: Value): void {\n      visitedValues.add(value);\n    }\n  }\n}\n"
  },
  {
    "path": "src/utils/simplifier.js",
    "content": "/**\n * Copyright (c) 2017-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n/* @flow */\n\nimport type { BabelNodeSourceLocation } from \"@babel/types\";\nimport { FatalError, InfeasiblePathError } from \"../errors.js\";\nimport { ValuesDomain } from \"../domains/index.js\";\nimport invariant from \"../invariant.js\";\nimport { Realm } from \"../realm.js\";\nimport { AbstractValue, BooleanValue, ConcreteValue, Value } from \"../values/index.js\";\nimport { Path, To } from \"../singletons.js\";\nimport EmptyValue from \"../values/EmptyValue.js\";\nimport { createOperationDescriptor } from \"./generator.js\";\nimport { NullValue, NumberValue, ObjectValue, PrimitiveValue, UndefinedValue } from \"../values/index.js\";\n\nexport default function simplifyAndRefineAbstractValue(\n  realm: Realm,\n  isCondition: boolean, // The value is only used after converting it to a Boolean\n  value: AbstractValue\n): Value {\n  if (value.intrinsicName !== undefined) return value;\n  let savedHandler = realm.errorHandler;\n  let savedIsReadOnly = realm.isReadOnly;\n  realm.isReadOnly = true;\n  let isRootSimplification = false;\n  realm.statistics.simplificationAttempts++;\n\n  if (!realm.inSimplificationPath) {\n    realm.inSimplificationPath = isRootSimplification = true;\n  }\n  try {\n    realm.errorHandler = diagnostic => {\n      if (diagnostic.errorCode === \"PP0029\") {\n        throw new FatalError(`${diagnostic.errorCode}: ${diagnostic.message}`);\n      }\n      throw new FatalError();\n    };\n    let result = simplify(realm, value, isCondition, 0);\n    if (result !== value) realm.statistics.simplifications++;\n    return result;\n  } catch (e) {\n    if (e.name === \"Invariant Violation\") throw e;\n    if (e instanceof FatalError && typeof e.message === \"string\" && e.message.includes(\"PP0029\")) {\n      if (isRootSimplification) {\n        return value;\n      }\n      throw e;\n    }\n    return value;\n  } finally {\n    if (isRootSimplification) {\n      realm.abstractValueImpliesCounter = 0;\n      realm.inSimplificationPath = false;\n    }\n    realm.errorHandler = savedHandler;\n    realm.isReadOnly = savedIsReadOnly;\n  }\n}\n\nfunction simplify(realm, value: Value, isCondition: boolean = false, depth: number): Value {\n  if (value instanceof ConcreteValue || depth > 5) return value;\n  invariant(value instanceof AbstractValue);\n  if (isCondition || value.getType() === BooleanValue) {\n    if (Path.implies(value, depth + 1)) return realm.intrinsics.true;\n    if (Path.impliesNot(value, depth + 1)) return realm.intrinsics.false;\n  }\n  let loc = value.expressionLocation;\n  let op = value.kind;\n  switch (op) {\n    case \"!\": {\n      let [x0] = value.args;\n      invariant(x0 instanceof AbstractValue);\n      if (x0.kind === \"!\") {\n        invariant(x0 instanceof AbstractValue);\n        let [x00] = x0.args;\n        let xx = simplify(realm, x00, true, depth + 1);\n        if (isCondition || xx.getType() === BooleanValue) return xx;\n      }\n      return negate(realm, x0, depth + 1, loc, value, isCondition);\n    }\n    case \"||\":\n    case \"&&\": {\n      let [x0, y0] = value.args;\n      let x = simplify(realm, x0, isCondition, depth + 1);\n      let y = simplify(realm, y0, isCondition, depth + 1);\n      if (x instanceof AbstractValue && x.equals(y)) return x;\n      // true && y <=> y\n      // true || y <=> true\n      if (!x.mightNotBeTrue()) return op === \"&&\" ? y : x;\n      // (x == false) && y <=> x\n      // false || y <=> y\n      if (!x.mightNotBeFalse()) return op === \"||\" ? y : x;\n      if (isCondition || (x.getType() === BooleanValue && y.getType() === BooleanValue)) {\n        // (x: boolean) && true <=> x\n        // x || true <=> true\n        if (!y.mightNotBeTrue()) return op === \"&&\" ? x : realm.intrinsics.true;\n        // (x: boolean) && false <=> false\n        // (x: boolean) || false <=> x\n        if (!y.mightNotBeFalse()) return op === \"||\" ? x : realm.intrinsics.false;\n      }\n      if (op === \"||\") {\n        if (y instanceof AbstractValue && y.kind === \"||\") {\n          // x || x || y <=> x || y\n          if (x.equals(y.args[0])) return y;\n          if (x instanceof AbstractValue && x.kind === \"!\") {\n            // !x0 || y0 || x0 <=> true, if isCondition\n            if (isCondition && x.args[0].equals(y.args[1])) return realm.intrinsics.true;\n          }\n        }\n      }\n      if (op === \"&&\") {\n        if (x instanceof AbstractValue) {\n          if (x.kind === \"&&\") {\n            // (x && y) && x <=> x && y, if isCondition\n            if (isCondition && x.args[0].equals(y)) return x;\n            // (x && y) && y <=> x && y\n            if (x.args[1].equals(y)) return x;\n          } else if (x.kind === \"!\") {\n            // !x && x <=> false, if isCondition\n            if (isCondition && x.args[0].equals(y)) return realm.intrinsics.false;\n          }\n        }\n        if (y instanceof AbstractValue && y.kind === \"&&\") {\n          // x && (x && y) <=> x && y\n          // y && (x && y) <=> x && y\n          if (x.equals(y.args[0]) || x.equals(y.args[1])) return y;\n        }\n        // x && (x && y || x && z) <=> x && (y || z)\n        if (y instanceof AbstractValue && y.kind === \"||\") {\n          let [yx, yy] = y.args;\n          let yxs, yys;\n          if (yx instanceof AbstractValue && yx.kind === \"&&\") {\n            if (x.equals(yx.args[0])) yxs = yx.args[1];\n            else if (x.equals(yx.args[1])) yxs = yx.args[0];\n          }\n          if (yy instanceof AbstractValue && yy.kind === \"&&\") {\n            if (x.equals(yy.args[0])) yys = yy.args[1];\n            else if (x.equals(yy.args[1])) yys = yy.args[0];\n          }\n          if (yxs !== undefined || yys !== undefined) {\n            let ys = AbstractValue.createFromLogicalOp(realm, \"||\", yxs || yx, yys || yy, undefined, isCondition);\n            return AbstractValue.createFromLogicalOp(realm, \"&&\", x, ys, undefined, isCondition);\n          }\n        }\n      }\n      if (realm.instantRender.enabled) {\n        if (op === \"||\" && x0 instanceof AbstractValue && y0 instanceof AbstractValue) {\n          if (x0.kind === \"===\" && y0.kind === \"===\") {\n            let [xa, xb] = x0.args;\n            let [ya, yb] = y0.args;\n            if (xa.equals(ya) && !xb.equals(yb) && nullOrUndefined(xb) && nullOrUndefined(yb)) return rewrite(xa);\n            else if (xb.equals(yb) && !xa.equals(ya) && nullOrUndefined(xa) && nullOrUndefined(ya)) return rewrite(xb);\n            else if (xa.equals(yb) && !xb.equals(ya) && nullOrUndefined(xb) && nullOrUndefined(ya)) return rewrite(xa);\n            else if (xb.equals(ya) && !xa.equals(yb) && nullOrUndefined(xa) && nullOrUndefined(yb)) return rewrite(xb);\n            function nullOrUndefined(z: Value) {\n              return !z.mightNotBeNull() || !z.mightNotBeUndefined();\n            }\n            function rewrite(z: Value) {\n              return AbstractValue.createFromBuildFunction(\n                realm,\n                BooleanValue,\n                [xa],\n                createOperationDescriptor(\"CANNOT_BECOME_OBJECT\"),\n                { kind: \"global.__cannotBecomeObject(A)\" }\n              );\n            }\n          }\n        }\n      }\n      if (x.equals(x0) && y.equals(y0)) return value;\n      return AbstractValue.createFromLogicalOp(realm, (value.kind: any), x, y, loc, isCondition, true);\n    }\n    case \"<\":\n    case \"<=\":\n    case \">\":\n    case \">=\":\n      return distributeConditional(realm, value, isCondition, args =>\n        AbstractValue.createFromBinaryOp(realm, op, args[0], args[1], loc, undefined, isCondition, true)\n      );\n    case \"==\":\n    case \"!=\":\n    case \"===\":\n    case \"!==\":\n      return simplifyEquality(realm, value, depth + 1);\n    case \"conditional\": {\n      let [c0, x0, y0] = value.args;\n      let c = simplify(realm, c0, true, depth + 1);\n      let x, y;\n      if (c0 instanceof AbstractValue && c.mightBeFalse() && c.mightBeTrue()) {\n        try {\n          x = Path.withCondition(c0, () => simplify(realm, x0, isCondition, depth + 1));\n        } catch (e) {\n          if (e instanceof InfeasiblePathError) {\n            // We now know that c0 cannot be be true on this path\n            return simplify(realm, y0, isCondition, depth + 1);\n          }\n          throw e;\n        }\n        try {\n          y = Path.withInverseCondition(c0, () => simplify(realm, y0, isCondition, depth + 1));\n        } catch (e) {\n          if (e instanceof InfeasiblePathError) {\n            // We now know that c0 cannot be be false on this path\n            return x;\n          }\n          throw e;\n        }\n      }\n      let cIsFalse = !c.mightNotBeFalse();\n      let cIsTrue = !c.mightNotBeTrue();\n      if (x === undefined && !cIsFalse) x = simplify(realm, x0, isCondition, depth + 1);\n      if (cIsTrue) {\n        invariant(x !== undefined); // cIsTrue ==> !cIsFalse\n        return x;\n      }\n      if (y === undefined) y = simplify(realm, y0, isCondition, depth + 1);\n      if (cIsFalse) return y;\n      invariant(x !== undefined); // because !csIsFalse\n      invariant(c instanceof AbstractValue);\n      if (Path.implies(c, depth + 1)) return x;\n      let notc = AbstractValue.createFromUnaryOp(realm, \"!\", c, true, loc, isCondition, true);\n      if (!notc.mightNotBeTrue()) return y;\n      if (!notc.mightNotBeFalse()) return x;\n      invariant(notc instanceof AbstractValue);\n      if (Path.implies(notc, depth + 1)) return y;\n      if (!isCondition) {\n        if (Path.implies(AbstractValue.createFromBinaryOp(realm, \"===\", value, x), depth + 1)) return x;\n        if (!x.mightBeNumber() && Path.implies(AbstractValue.createFromBinaryOp(realm, \"!==\", value, x), depth + 1))\n          return y;\n        if (!y.mightBeNumber() && Path.implies(AbstractValue.createFromBinaryOp(realm, \"!==\", value, y), depth + 1))\n          return x;\n        if (Path.implies(AbstractValue.createFromBinaryOp(realm, \"===\", value, y), depth + 1)) return y;\n      }\n      // c ? x : x <=> x\n      if (x.equals(y)) return x;\n      // x ? x : y <=> x || y\n      let cs = isCondition ? c : simplify(realm, c0, false, depth + 1);\n      if (cs.equals(x)) return AbstractValue.createFromLogicalOp(realm, \"||\", x, y, loc, isCondition, true);\n      // y ? x : y <=> y && x\n      if (cs.equals(y)) return AbstractValue.createFromLogicalOp(realm, \"&&\", y, x, loc, isCondition, true);\n      // c ? (c ? xx : xy) : y <=> c ? xx : y\n      if (x instanceof AbstractValue && x.kind === \"conditional\") {\n        let [xc, xx] = x.args;\n        if (c.equals(xc))\n          return AbstractValue.createFromConditionalOp(realm, c, xx, y, value.expressionLocation, isCondition, true);\n      }\n      // c ? x : (c ? y : z) : z <=> c ? x : z\n      if (y instanceof AbstractValue && y.kind === \"conditional\") {\n        let [yc, , z] = y.args;\n        if (c.equals(yc))\n          return AbstractValue.createFromConditionalOp(realm, c, x, z, value.expressionLocation, isCondition, true);\n      }\n      if (isCondition || (x.getType() === BooleanValue && y.getType() === BooleanValue)) {\n        // c ? true : false <=> c\n        if (!x.mightNotBeTrue() && !y.mightNotBeFalse()) return c;\n        // c ? false : true <=> !c\n        if (!x.mightNotBeFalse() && !y.mightNotBeTrue())\n          return AbstractValue.createFromUnaryOp(realm, \"!\", c, true, loc, true);\n      }\n      if (c.equals(c0) && x.equals(x0) && y.equals(y0)) return value;\n      return AbstractValue.createFromConditionalOp(realm, c, x, y, value.expressionLocation, isCondition, true);\n    }\n    case \"abstractConcreteUnion\": {\n      // The union of an abstract value with one or more concrete values.\n      if (realm.pathConditions.isEmpty()) return value;\n      let [abstractValue, concreteValues] = AbstractValue.dischargeValuesFromUnion(realm, value);\n      invariant(abstractValue instanceof AbstractValue);\n      let remainingConcreteValues = [];\n      for (let concreteValue of concreteValues) {\n        if (Path.implies(AbstractValue.createFromBinaryOp(realm, \"!==\", value, concreteValue), depth + 1)) continue;\n        if (Path.implies(AbstractValue.createFromBinaryOp(realm, \"===\", value, concreteValue), depth + 1))\n          return concreteValue;\n        remainingConcreteValues.push(concreteValue);\n      }\n      if (remainingConcreteValues.length === 0) return abstractValue;\n      if (remainingConcreteValues.length === concreteValues.length) return value;\n      return AbstractValue.createAbstractConcreteUnion(realm, abstractValue, remainingConcreteValues);\n    }\n    default:\n      return value;\n  }\n}\n\nfunction distributeConditional(\n  realm: Realm,\n  value: AbstractValue,\n  isCondition: boolean,\n  create: (Array<Value>) => Value\n): Value {\n  // Find a conditional argument\n  let condition;\n  let args = value.args;\n  for (let arg of args)\n    if (arg instanceof AbstractValue && arg.kind === \"conditional\") {\n      if (condition === undefined) condition = arg.args[0];\n      else if (condition !== arg.args[0]) return value; // giving up, multiple conditions involved\n    }\n\n  if (condition === undefined) return value; // no conditional found, nothing to do\n\n  // We have at least one conditional argument; if there are more than one, they all share the same condition\n  let leftArgs = args.slice(0);\n  let rightArgs = args.slice(0);\n  for (let i = 0; i < args.length; i++) {\n    let arg = args[i];\n    if (arg instanceof AbstractValue && arg.kind === \"conditional\") {\n      leftArgs[i] = arg.args[1];\n      rightArgs[i] = arg.args[2];\n    }\n  }\n\n  return AbstractValue.createFromConditionalOp(\n    realm,\n    condition,\n    create(leftArgs),\n    create(rightArgs),\n    condition.expressionLocation,\n    isCondition,\n    true\n  );\n}\n\nfunction simplifyNullCheck(\n  realm: Realm,\n  op: \"===\" | \"==\" | \"!==\" | \"!=\",\n  value: Value,\n  depth: number,\n  loc: ?BabelNodeSourceLocation\n): void | Value {\n  if (op === \"==\" || op === \"!=\") {\n    if (!value.mightNotBeNull() || !value.mightNotBeUndefined())\n      return op === \"==\" ? realm.intrinsics.true : realm.intrinsics.false;\n    if (!value.mightBeNull() && !value.mightBeUndefined())\n      return op === \"==\" ? realm.intrinsics.false : realm.intrinsics.true;\n  } else {\n    if (!value.mightNotBeNull()) return op === \"===\" ? realm.intrinsics.true : realm.intrinsics.false;\n    if (!value.mightBeNull()) return op === \"===\" ? realm.intrinsics.false : realm.intrinsics.true;\n  }\n  invariant(value instanceof AbstractValue); // concrete values will either be null or not null\n  // try to simplify \"(cond ? x : y) op null\" to just \"cond\" or \"!cond\"\n  // failing that, use \"cond ? x op null : y op null\" if either of the subexpressions simplify\n  if (value.kind === \"conditional\" && depth < 10) {\n    let [cond, x, y] = value.args;\n    let sx = simplifyNullCheck(realm, op, x, depth + 1, loc);\n    let sy = simplifyNullCheck(realm, op, y, depth + 1, loc);\n    if (sx !== undefined && sy !== undefined) {\n      if (!sx.mightNotBeTrue() && !sy.mightNotBeFalse()) return makeBoolean(realm, cond, loc);\n      if (!sx.mightNotBeFalse() && !sy.mightNotBeTrue()) return negate(realm, cond, depth + 1, loc);\n    }\n    if (sx !== undefined || sy !== undefined) {\n      if (sx === undefined)\n        sx = AbstractValue.createFromBinaryOp(\n          realm,\n          op,\n          x,\n          realm.intrinsics.null,\n          x.expressionLocation,\n          undefined,\n          false,\n          true\n        );\n      if (sy === undefined)\n        sy = AbstractValue.createFromBinaryOp(\n          realm,\n          op,\n          y,\n          realm.intrinsics.null,\n          y.expressionLocation,\n          undefined,\n          false,\n          true\n        );\n      return AbstractValue.createFromConditionalOp(realm, cond, sx, sy, loc, true, true);\n    }\n  }\n}\n\nfunction simplifyUndefinedCheck(\n  realm: Realm,\n  op: \"===\" | \"==\" | \"!==\" | \"!=\",\n  value: Value,\n  depth: number,\n  loc: ?BabelNodeSourceLocation\n): void | Value {\n  if (op === \"==\" || op === \"!=\") {\n    if (!value.mightNotBeNull() || !value.mightNotBeUndefined())\n      return op === \"==\" ? realm.intrinsics.true : realm.intrinsics.false;\n    if (!value.mightBeNull() && !value.mightBeUndefined())\n      return op === \"==\" ? realm.intrinsics.false : realm.intrinsics.true;\n  } else {\n    if (!value.mightNotBeUndefined()) return op === \"===\" ? realm.intrinsics.true : realm.intrinsics.false;\n    if (!value.mightBeUndefined()) return op === \"===\" ? realm.intrinsics.false : realm.intrinsics.true;\n  }\n  invariant(value instanceof AbstractValue); // concrete values will either be undefined or not undefined\n  // try to simplify \"(cond ? x : y) op undefined\" to just \"cond\" or \"!cond\"\n  // failing that, use \"cond ? x op undefined : y op undefined\" if either of the subexpressions simplify\n  if (value.kind === \"conditional\" && depth < 10) {\n    let [cond, x, y] = value.args;\n    let sx = simplifyUndefinedCheck(realm, op, x, depth + 1, loc);\n    let sy = simplifyUndefinedCheck(realm, op, y, depth + 1, loc);\n    if (sx !== undefined && sy !== undefined) {\n      if (!sx.mightNotBeTrue() && !sy.mightNotBeFalse()) return makeBoolean(realm, cond, loc);\n      if (!sx.mightNotBeFalse() && !sy.mightNotBeTrue()) return negate(realm, cond, depth + 1, loc);\n    }\n    if (sx !== undefined || sy !== undefined) {\n      if (sx === undefined)\n        sx = AbstractValue.createFromBinaryOp(\n          realm,\n          op,\n          x,\n          realm.intrinsics.undefined,\n          x.expressionLocation,\n          undefined,\n          false,\n          true\n        );\n      if (sy === undefined)\n        sy = AbstractValue.createFromBinaryOp(\n          realm,\n          op,\n          y,\n          realm.intrinsics.undefined,\n          y.expressionLocation,\n          undefined,\n          false,\n          true\n        );\n      return AbstractValue.createFromConditionalOp(realm, cond, sx, sy, loc, true, true);\n    }\n  }\n}\n\nfunction simplifyEquality(realm: Realm, equality: AbstractValue, depth: number): Value {\n  let loc = equality.expressionLocation;\n  let op = equality.kind;\n  let [x, y] = equality.args;\n  if (y instanceof EmptyValue) return equality;\n  if (x instanceof ConcreteValue) [x, y] = [y, x];\n  if (op === \"===\" || op === \"==\" || op === \"!==\" || op === \"==\") {\n    if (!x.mightNotBeNull()) {\n      let sy = simplifyNullCheck(realm, op, y, depth + 1);\n      if (sy !== undefined) return sy;\n    }\n    if (!y.mightNotBeNull()) {\n      let sx = simplifyNullCheck(realm, op, x, depth + 1);\n      if (sx !== undefined) return sx;\n    }\n    if (!x.mightNotBeUndefined()) {\n      let sy = simplifyUndefinedCheck(realm, op, y, depth + 1);\n      if (sy !== undefined) return sy;\n    }\n    if (!y.mightNotBeUndefined()) {\n      let sx = simplifyUndefinedCheck(realm, op, x, depth + 1);\n      if (sx !== undefined) return sx;\n    }\n  }\n  if (op === \"===\") {\n    let xType = x.getType();\n    let yType = y.getType();\n    if (xType !== yType) {\n      if (xType === Value || xType === PrimitiveValue || yType === Value || yType === PrimitiveValue) return equality;\n      if (\n        (Value.isTypeCompatibleWith(xType, NumberValue) && Value.isTypeCompatibleWith(yType, NumberValue)) ||\n        (Value.isTypeCompatibleWith(xType, ObjectValue) && Value.isTypeCompatibleWith(yType, ObjectValue))\n      )\n        return equality;\n      return realm.intrinsics.false;\n    } else if (x instanceof AbstractValue && x.kind === \"conditional\") {\n      let [cond, xx, xy] = x.args;\n      // ((cond ? xx : xy) === y) && xx === y && xy !== y <=> cond\n      if (xx.equals(y) && !xy.equals(y)) return cond;\n      // ((!cond ? xx : xy) === y) && xx !== y && xy === y <=> !cond\n      if (!xx.equals(y) && xy.equals(y)) return negate(realm, cond, depth + 1, loc);\n    } else if (y instanceof AbstractValue && y.kind === \"conditional\") {\n      let [cond, yx, yy] = y.args;\n      // (x === (cond ? yx : yy) === y) && x === yx && x !== yy <=> cond\n      if (yx.equals(x) && !yy.equals(x)) return cond;\n      // (x === (!cond ? yx : yy) === y) && x !== yx && x === yy <=> !cond\n      if (!x.equals(yx) && x.equals(yy)) return negate(realm, cond, depth + 1, loc);\n    }\n  } else if (op === \"==\") {\n    let xType = x.getType();\n    let xIsNullOrUndefined = xType === NullValue || xType === UndefinedValue;\n    let yType = y.getType();\n    let yIsNullOrUndefined = yType === NullValue || yType === UndefinedValue;\n    // If x and y are both known to be null/undefined we should never get here because both should be concrete values.\n    invariant(!xIsNullOrUndefined || !yIsNullOrUndefined);\n    if (xIsNullOrUndefined) {\n      return yType === Value || yType === PrimitiveValue ? equality : realm.intrinsics.false;\n    }\n    if (yIsNullOrUndefined) {\n      return xType === Value || xType === PrimitiveValue ? equality : realm.intrinsics.false;\n    }\n  }\n  return equality;\n}\n\nfunction makeBoolean(realm: Realm, value: Value, loc: ?BabelNodeSourceLocation = undefined): Value {\n  if (value.getType() === BooleanValue) return value;\n  if (value instanceof ConcreteValue) return new BooleanValue(realm, To.ToBoolean(realm, value));\n  invariant(value instanceof AbstractValue);\n  let v = AbstractValue.createFromUnaryOp(realm, \"!\", value, true, value.expressionLocation);\n  if (v instanceof ConcreteValue) return new BooleanValue(realm, !To.ToBoolean(realm, v));\n  invariant(v instanceof AbstractValue);\n  return AbstractValue.createFromUnaryOp(realm, \"!\", v, true, loc || value.expressionLocation);\n}\n\nfunction negate(\n  realm: Realm,\n  value: Value,\n  depth: number = 0,\n  loc: ?BabelNodeSourceLocation = undefined,\n  unsimplifiedNegation: void | Value = undefined,\n  isCondition?: boolean\n): Value {\n  if (value instanceof ConcreteValue) return ValuesDomain.computeUnary(realm, \"!\", value);\n  invariant(value instanceof AbstractValue);\n  value = simplify(realm, value, true, depth + 1);\n  if (!value.mightNotBeTrue()) return realm.intrinsics.false;\n  if (!value.mightNotBeFalse()) return realm.intrinsics.true;\n  invariant(value instanceof AbstractValue);\n  if (value.kind === \"!\") {\n    let [x] = value.args;\n    if (isCondition || x.getType() === BooleanValue) return simplify(realm, x, true, depth + 1);\n    if (unsimplifiedNegation !== undefined) return unsimplifiedNegation;\n    return makeBoolean(realm, x, loc);\n  }\n  // If NaN is not an issue, invert binary ops\n  if (value.args.length === 2 && !value.args[0].mightBeNumber() && !value.args[1].mightBeNumber()) {\n    let invertedComparison;\n    switch (value.kind) {\n      case \"===\":\n        invertedComparison = \"!==\";\n        break;\n      case \"==\":\n        invertedComparison = \"!=\";\n        break;\n      case \"!==\":\n        invertedComparison = \"===\";\n        break;\n      case \"!=\":\n        invertedComparison = \"==\";\n        break;\n      case \"<\":\n        invertedComparison = \">=\";\n        break;\n      case \"<=\":\n        invertedComparison = \">\";\n        break;\n      case \">\":\n        invertedComparison = \"<=\";\n        break;\n      case \">=\":\n        invertedComparison = \"<\";\n        break;\n      default:\n        break;\n    }\n    if (invertedComparison !== undefined) {\n      let left = simplify(realm, value.args[0], false, depth + 1);\n      let right = simplify(realm, value.args[1], false, depth + 1);\n      return AbstractValue.createFromBinaryOp(realm, invertedComparison, left, right, loc || value.expressionLocation);\n    }\n    let invertedLogicalOp;\n    switch (value.kind) {\n      case \"&&\":\n        invertedLogicalOp = \"||\";\n        break;\n      case \"||\":\n        invertedLogicalOp = \"&&\";\n        break;\n      default:\n        break;\n    }\n    if (invertedLogicalOp !== undefined) {\n      let left = negate(realm, value.args[0], depth + 1);\n      let right = negate(realm, value.args[1], depth + 1);\n      return AbstractValue.createFromLogicalOp(\n        realm,\n        invertedLogicalOp,\n        left,\n        right,\n        loc || value.expressionLocation,\n        true\n      );\n    }\n  }\n  if (unsimplifiedNegation !== undefined) return unsimplifiedNegation;\n  return AbstractValue.createFromUnaryOp(realm, \"!\", value, true, loc || value.expressionLocation, true);\n}\n"
  },
  {
    "path": "src/utils/strict.js",
    "content": "/**\n * Copyright (c) 2017-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n/* @flow */\n\nimport type { BabelNode, BabelNodeBlockStatement, BabelNodeProgram } from \"@babel/types\";\n\nexport default function IsStrict(node: BabelNode): boolean {\n  if (node.type !== \"BlockStatement\" && node.type !== \"Program\") return false;\n  let directives = ((node: any): BabelNodeBlockStatement | BabelNodeProgram).directives;\n  if (!directives) return false;\n  return directives.some(directive => {\n    if (directive.type !== \"Directive\") {\n      return false;\n    }\n    if (directive.value.type !== \"DirectiveLiteral\") {\n      return false;\n    }\n    return directive.value.value === \"use strict\";\n  });\n}\n"
  },
  {
    "path": "src/utils/traverse-fast.js",
    "content": "/**\n * Copyright (c) 2017-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n/* @flow */\n\nimport { BabelNode } from \"@babel/types\";\nimport * as t from \"@babel/types\";\n\n// This is a variation of traverseFast from\n// https://github.com/babel/babel/blob/28ae47a174f67a8ae6f4527e0a66e88896814170/packages/babel-types/src/index.js\n// This version...\n// - takes a callback function that returns a boolean to indicate whether to short-circuit the traversal\n// - doesn't pass around or allocate an optional parameter value to the callback.\nexport default function traverse(node: BabelNode, enter: BabelNode => boolean) {\n  if (!node) return;\n\n  let keys = t.VISITOR_KEYS[node.type];\n  if (!keys) return;\n\n  let stop = enter(node);\n  if (stop) return;\n\n  for (let key of keys) {\n    let subNode = (node: any)[key];\n\n    if (Array.isArray(subNode)) {\n      for (let elementNode of subNode) {\n        traverse(elementNode, enter);\n      }\n    } else {\n      traverse(subNode, enter);\n    }\n  }\n}\n"
  },
  {
    "path": "src/utils.js",
    "content": "/**\n * Copyright (c) 2017-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n/* @flow strict-local */\n\nimport type { BindingEntry, Effects, Realm, SideEffectCallback } from \"./realm.js\";\nimport {\n  AbstractValue,\n  ArrayValue,\n  BooleanValue,\n  ECMAScriptSourceFunctionValue,\n  EmptyValue,\n  FunctionValue,\n  NullValue,\n  NumberValue,\n  IntegralValue,\n  ObjectValue,\n  StringValue,\n  SymbolValue,\n  UndefinedValue,\n  PrimitiveValue,\n  Value,\n} from \"./values/index.js\";\nimport invariant from \"./invariant.js\";\nimport { ShapeInformation } from \"./utils/ShapeInformation.js\";\nimport type { ArgModel } from \"./types.js\";\nimport { CompilerDiagnostic, FatalError } from \"./errors.js\";\nimport type { Binding } from \"./environment.js\";\nimport * as t from \"@babel/types\";\n\nexport function typeToString(type: typeof Value): void | string {\n  function isInstance(proto, Constructor): boolean {\n    return proto instanceof Constructor || proto === Constructor.prototype;\n  }\n  let proto = type.prototype;\n  if (isInstance(proto, UndefinedValue)) {\n    return \"undefined\";\n  } else if (isInstance(proto, NullValue)) {\n    return \"object\";\n  } else if (isInstance(proto, StringValue)) {\n    return \"string\";\n  } else if (isInstance(proto, BooleanValue)) {\n    return \"boolean\";\n  } else if (isInstance(proto, NumberValue)) {\n    return \"number\";\n  } else if (isInstance(proto, SymbolValue)) {\n    return \"symbol\";\n  } else if (isInstance(proto, ObjectValue)) {\n    if (Value.isTypeCompatibleWith(type, FunctionValue)) {\n      return \"function\";\n    }\n    return \"object\";\n  } else {\n    return undefined;\n  }\n}\n\nexport function getTypeFromName(typeName: string): void | typeof Value {\n  switch (typeName) {\n    case \"empty\":\n      return EmptyValue;\n    case \"void\":\n      return UndefinedValue;\n    case \"null\":\n      return NullValue;\n    case \"boolean\":\n      return BooleanValue;\n    case \"string\":\n      return StringValue;\n    case \"symbol\":\n      return SymbolValue;\n    case \"number\":\n      return NumberValue;\n    case \"object\":\n      return ObjectValue;\n    case \"array\":\n      return ArrayValue;\n    case \"function\":\n      return FunctionValue;\n    case \"integral\":\n      return IntegralValue;\n    default:\n      return undefined;\n  }\n}\n\nexport function describeValue(value: Value): string {\n  let title;\n  let suffix = \"\";\n  if (value instanceof PrimitiveValue) title = value.toDisplayString();\n  else if (value instanceof ObjectValue) title = \"[object]\";\n  else {\n    invariant(value instanceof AbstractValue, value.constructor.name);\n    title = \"[abstract]\";\n    if (value.kind !== undefined) title += `, kind: ${value.kind}`;\n    for (let arg of value.args) {\n      let desc = describeValue(arg);\n      suffix +=\n        desc\n          .split(\"\\n\")\n          .map(u => \"  \" + u)\n          .join(\"\\n\") + \"\\n\";\n    }\n  }\n  title += `, hash: ${value.getHash()}`;\n  if (value.intrinsicName !== undefined) title += `, intrinsic name: ${value.intrinsicName}`;\n  if (value.__originalName !== undefined) title += `, original name: ${value.__originalName}`;\n  return suffix ? `${title}\\n${suffix}` : title;\n}\n\ntype DisplayResult = {} | string;\n\nexport function jsonToDisplayString<T: { toDisplayJson(number): DisplayResult }>(instance: T, depth: number): string {\n  let result = instance.toDisplayJson(depth);\n  return typeof result === \"string\" ? result : JSON.stringify(result, null, 2).replace(/\\\"/g, \"\");\n}\n\nexport function verboseToDisplayJson(obj: {}, depth: number): DisplayResult {\n  let result = {};\n  function valueOfProp(prop) {\n    if (typeof prop === \"function\") return undefined;\n    if (Array.isArray(prop)) {\n      // Try to return a 1-line string if possible\n      if (prop.length === 0) return \"[]\";\n      let valuesArray = prop.map(x => valueOfProp(x));\n      if (valuesArray.length < 5) {\n        let string =\n          \"[\" + valuesArray.reduce((acc, x) => `${acc}, ${x instanceof Object ? JSON.stringify(x) : x}`) + \"]\";\n        string = string.replace(/\\\"/g, \"\");\n        if (string.length < 60) return string;\n      }\n      return valuesArray;\n    }\n    if (prop instanceof Set || prop instanceof Map) return `${prop.constructor.name}(${prop.size})`;\n    if (prop.toDisplayJson) return prop.toDisplayJson(depth - 1);\n    if (prop.toDisplayString) return prop.toDisplayString();\n    if (prop.toJSON) return prop.toJSON();\n    return prop.toString();\n  }\n  for (let key in obj) {\n    let prop = obj[key];\n    if (!prop) continue;\n    let value = valueOfProp(prop);\n    if (value !== undefined && value !== \"[object Object]\") result[key] = value;\n  }\n  return result;\n}\n\nexport function createModelledFunctionCall(\n  realm: Realm,\n  funcValue: FunctionValue,\n  argModelInput: void | string | ArgModel,\n  thisValue: void | Value\n): void => Value {\n  let call = funcValue.$Call;\n  invariant(call);\n  let numArgs = funcValue.getLength();\n  let args = [];\n  let argModel = typeof argModelInput === \"string\" ? (JSON.parse(argModelInput): ArgModel) : argModelInput;\n  invariant(funcValue instanceof ECMAScriptSourceFunctionValue);\n  let params = funcValue.$FormalParameters;\n  if (numArgs !== undefined && numArgs > 0 && params) {\n    for (let parameterId of params) {\n      if (t.isIdentifier(parameterId)) {\n        // $FlowFixMe: Flow strict file does not allow for casting\n        let paramName = ((parameterId: any): BabelNodeIdentifier).name;\n        let shape = ShapeInformation.createForArgument(argModel, paramName);\n        // Create an AbstractValue similar to __abstract being called\n        args.push(\n          AbstractValue.createAbstractArgument(\n            realm,\n            paramName,\n            funcValue.expressionLocation,\n            shape !== undefined ? shape.getAbstractType() : Value,\n            shape\n          )\n        );\n      } else {\n        realm.handleError(\n          new CompilerDiagnostic(\n            \"Non-identifier args to additional functions unsupported\",\n            funcValue.expressionLocation,\n            \"PP1005\",\n            \"FatalError\"\n          )\n        );\n        throw new FatalError(\"Non-identifier args to additional functions unsupported\");\n      }\n    }\n  }\n  let thisArg =\n    thisValue !== undefined\n      ? thisValue\n      : AbstractValue.createAbstractArgument(realm, \"this\", funcValue.expressionLocation, ObjectValue);\n  return () => {\n    let savedPathConditions = realm.pathConditions;\n    let newPathConditions = funcValue.pathConditionDuringDeclaration || savedPathConditions;\n    realm.pathConditions = newPathConditions;\n    try {\n      let result = call(thisArg, args);\n      return result;\n    } finally {\n      realm.pathConditions = savedPathConditions;\n    }\n  };\n}\n\nexport function isBindingMutationOutsideFunction(\n  binding: Binding,\n  bindingEntry: BindingEntry,\n  F: FunctionValue\n): boolean {\n  // If either the previous values are uninitialized then this is not a mutation\n  // TODO validate that the below statement holds for all cases. It's known that\n  // joining effects with a conditional where one side of the effects is missing\n  // a binding that exists in the other effects can cause this.\n  // See issue: https://github.com/facebook/prepack/issues/2599\n  if (binding.value === undefined || bindingEntry.value === undefined) {\n    return false;\n  }\n  // If the binding has a \"strict\" property then it's const and can never mutate\n  if (binding.strict !== undefined) {\n    return false;\n  }\n  // We traverse the bindings environment and go through each parent until we find\n  // F's inner environment. If we we can't find the environment's matching then we\n  // know that this was a mutation outside of the function.\n  let targetEnv = F.$InnerEnvironment;\n  let env = binding.environment.lexicalEnvironment;\n\n  invariant(env !== undefined);\n  if (env !== null) {\n    if (env === targetEnv) {\n      return false;\n    }\n    env = env.parent;\n  }\n  return true;\n}\n\nexport function areEffectsPure(realm: Realm, effects: Effects, F: FunctionValue): boolean {\n  for (let [binding] of effects.modifiedProperties) {\n    let obj = binding.object;\n    if (!effects.createdObjects.has(obj)) {\n      return false;\n    }\n  }\n\n  for (let [binding, bindingEntry] of effects.modifiedBindings) {\n    if (isBindingMutationOutsideFunction(binding, bindingEntry, F)) {\n      return false;\n    }\n  }\n  return true;\n}\n\nexport function reportSideEffectsFromEffects(\n  realm: Realm,\n  effects: Effects,\n  F: FunctionValue,\n  sideEffectCallback: SideEffectCallback\n): void {\n  for (let [binding] of effects.modifiedProperties) {\n    let obj = binding.object;\n    if (!effects.createdObjects.has(obj)) {\n      sideEffectCallback(\"MODIFIED_PROPERTY\", binding, binding.object.expressionLocation);\n    }\n  }\n\n  for (let [binding, bindingEntry] of effects.modifiedBindings) {\n    if (isBindingMutationOutsideFunction(binding, bindingEntry, F)) {\n      let value = bindingEntry.value;\n      sideEffectCallback(\"MODIFIED_BINDING\", binding, value && value.expressionLocation);\n    }\n  }\n}\n"
  },
  {
    "path": "src/values/AbstractObjectValue.js",
    "content": "/**\n * Copyright (c) 2017-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n/* @flow */\n\nimport { CompilerDiagnostic, FatalError } from \"../errors.js\";\nimport type { Realm } from \"../realm.js\";\nimport type { Descriptor, PropertyKeyValue, ShapeInformationInterface } from \"../types.js\";\nimport {\n  AbstractValue,\n  type AbstractValueKind,\n  ArrayValue,\n  BooleanValue,\n  NullValue,\n  NumberValue,\n  ObjectValue,\n  PrimitiveValue,\n  StringValue,\n  Value,\n} from \"./index.js\";\nimport { TypesDomain, ValuesDomain } from \"../domains/index.js\";\nimport { IsDataDescriptor } from \"../methods/index.js\";\nimport { Leak, Join, Widen } from \"../singletons.js\";\nimport invariant from \"../invariant.js\";\nimport { createOperationDescriptor, type OperationDescriptor } from \"../utils/generator.js\";\nimport { construct_empty_effects } from \"../realm.js\";\nimport { SimpleNormalCompletion } from \"../completions.js\";\nimport { cloneDescriptor, equalDescriptors, PropertyDescriptor } from \"../descriptors.js\";\n\nexport default class AbstractObjectValue extends AbstractValue {\n  constructor(\n    realm: Realm,\n    types: TypesDomain,\n    values: ValuesDomain,\n    hashValue: number,\n    args: Array<Value>,\n    operationDescriptor?: OperationDescriptor,\n    optionalArgs?: {| kind?: AbstractValueKind, intrinsicName?: string, shape?: ShapeInformationInterface |}\n  ) {\n    super(realm, types, values, hashValue, args, operationDescriptor, optionalArgs);\n    if (!values.isTop()) {\n      for (let element of this.values.getElements()) invariant(element instanceof ObjectValue);\n    }\n  }\n\n  cachedIsSimpleObject: void | boolean;\n  functionResultType: void | typeof Value;\n\n  getTemplate(): ObjectValue {\n    for (let element of this.values.getElements()) {\n      invariant(element instanceof ObjectValue);\n      if (element.isPartialObject()) {\n        return element;\n      } else {\n        break;\n      }\n    }\n    AbstractValue.reportIntrospectionError(this);\n    throw new FatalError();\n  }\n\n  set temporalAlias(temporalValue: AbstractObjectValue) {\n    if (this.values.isTop()) {\n      AbstractValue.reportIntrospectionError(this);\n      throw new FatalError();\n    }\n    for (let element of this.values.getElements()) {\n      invariant(element instanceof ObjectValue);\n      element.temporalAlias = temporalValue;\n    }\n  }\n\n  hasStringOrSymbolProperties(): boolean {\n    if (this.values.isTop()) return false;\n    for (let element of this.values.getElements()) {\n      invariant(element instanceof ObjectValue);\n      if (element.hasStringOrSymbolProperties()) return true;\n    }\n    return false;\n  }\n\n  isPartialObject(): boolean {\n    // At the very least, the identity of the object is unknown\n    return true;\n  }\n\n  isSimpleObject(): boolean {\n    if (this.cachedIsSimpleObject === undefined) this.cachedIsSimpleObject = this._elementsAreSimpleObjects();\n    return this.cachedIsSimpleObject;\n  }\n\n  _elementsAreSimpleObjects(): boolean {\n    if (this.values.isTop()) return false;\n    let result;\n    for (let element of this.values.getElements()) {\n      invariant(element instanceof ObjectValue);\n      if (result === undefined) {\n        result = element.isSimpleObject();\n      } else if (result !== element.isSimpleObject()) {\n        AbstractValue.reportIntrospectionError(this);\n        throw new FatalError();\n      }\n    }\n    if (result === undefined) {\n      AbstractValue.reportIntrospectionError(this);\n      throw new FatalError();\n    }\n    return result;\n  }\n\n  mightBeFinalObject(): boolean {\n    // modeled objects are always read-only\n    if (this.shape) return true;\n    if (this.values.isTop()) return false;\n    for (let element of this.values.getElements()) {\n      invariant(element instanceof ObjectValue);\n      if (element.mightBeFinalObject()) return true;\n    }\n    return false;\n  }\n\n  mightNotBeFinalObject(): boolean {\n    // modeled objects are always read-only\n    if (this.shape) return false;\n    if (this.values.isTop()) return false;\n    for (let element of this.values.getElements()) {\n      invariant(element instanceof ObjectValue);\n      if (element.mightNotBeFinalObject()) return true;\n    }\n    return false;\n  }\n\n  mightBeFalse(): boolean {\n    return false;\n  }\n\n  mightNotBeFalse(): boolean {\n    return true;\n  }\n\n  makePartial(): void {\n    if (this.values.isTop()) {\n      AbstractValue.reportIntrospectionError(this);\n      throw new FatalError();\n    }\n    for (let element of this.values.getElements()) {\n      invariant(element instanceof ObjectValue);\n      element.makePartial();\n    }\n  }\n\n  makeSimple(option?: string | Value): void {\n    if (this.values.isTop() && this.getType() === ObjectValue) {\n      let obj = new ObjectValue(this.$Realm, this.$Realm.intrinsics.ObjectPrototype);\n      obj.intrinsicName = this.intrinsicName;\n      obj.intrinsicNameGenerated = true;\n      obj.makePartial();\n      obj._templateFor = this;\n      this.values = new ValuesDomain(obj);\n    }\n    if (!this.values.isTop()) {\n      for (let element of this.values.getElements()) {\n        invariant(element instanceof ObjectValue);\n        element.makeSimple(option);\n      }\n    }\n    this.cachedIsSimpleObject = true;\n  }\n\n  // Use this only if it is known that only the string properties of the snapshot will be accessed.\n  getSnapshot(options?: { removeProperties: boolean }): AbstractObjectValue {\n    if (this.isIntrinsic()) return this; // already temporal\n    if (this.values.isTop()) return this; // always the same\n    if (this.kind === \"conditional\") {\n      let [c, l, r] = this.args;\n      invariant(l instanceof ObjectValue || l instanceof AbstractObjectValue);\n      let ls = l.getSnapshot(options);\n      invariant(r instanceof ObjectValue || r instanceof AbstractObjectValue);\n      let rs = r.getSnapshot(options);\n      invariant(c instanceof AbstractValue);\n      let absVal = AbstractValue.createFromConditionalOp(this.$Realm, c, ls, rs, this.expressionLocation);\n      invariant(absVal instanceof AbstractObjectValue);\n      return absVal;\n    }\n    // If this is some other kind of abstract object we don't know how to make a copy, so just make this final\n    this.makeFinal();\n    return this;\n  }\n\n  makeFinal(): void {\n    if (this.shape) return;\n    if (this.values.isTop()) {\n      AbstractValue.reportIntrospectionError(this);\n      throw new FatalError();\n    }\n    for (let element of this.values.getElements()) {\n      invariant(element instanceof ObjectValue);\n      element.makeFinal();\n    }\n  }\n\n  throwIfNotObject(): AbstractObjectValue {\n    return this;\n  }\n\n  usesOrdinaryObjectInternalPrototypeMethods(): boolean {\n    return true;\n  }\n\n  // ECMA262 9.1.1\n  $GetPrototypeOf(): ObjectValue | AbstractObjectValue | NullValue {\n    let realm = this.$Realm;\n    if (this.values.isTop()) {\n      let error = new CompilerDiagnostic(\n        \"prototype access on unknown object\",\n        this.$Realm.currentLocation,\n        \"PP0032\",\n        \"FatalError\"\n      );\n      this.$Realm.handleError(error);\n      throw new FatalError();\n    }\n    invariant(this.kind !== \"widened\", \"widening currently always leads to top values\");\n    let elements = this.values.getElements();\n    if (elements.size === 1) {\n      for (let cv of elements) {\n        invariant(cv instanceof ObjectValue);\n        return cv.$GetPrototypeOf();\n      }\n      invariant(false);\n    } else if (this.kind === \"conditional\") {\n      // this is the join of two concrete/abstract objects\n      // use this join condition for the join of the two property values\n      let [cond, ob1, ob2] = this.args;\n      invariant(cond instanceof AbstractValue);\n      invariant(ob1 instanceof ObjectValue || ob1 instanceof AbstractObjectValue);\n      invariant(ob2 instanceof ObjectValue || ob2 instanceof AbstractObjectValue);\n      let p1 = ob1.$GetPrototypeOf();\n      let p2 = ob2.$GetPrototypeOf();\n      let joinedObject = AbstractValue.createFromConditionalOp(realm, cond, p1, p2);\n      invariant(\n        joinedObject instanceof AbstractObjectValue ||\n          joinedObject instanceof ObjectValue ||\n          joinedObject instanceof NullValue\n      );\n      return joinedObject;\n    } else if (this.kind === \"explicit conversion to object\") {\n      let primitiveValue = this.args[0];\n      invariant(!Value.isTypeCompatibleWith(primitiveValue.getType(), PrimitiveValue));\n      let result = AbstractValue.createFromBuildFunction(\n        realm,\n        ObjectValue,\n        [primitiveValue],\n        createOperationDescriptor(\"ABSTRACT_OBJECT_GET_PROTO_OF\")\n      );\n      invariant(result instanceof AbstractObjectValue);\n      return result;\n    } else {\n      let joinedObject;\n      for (let cv of elements) {\n        invariant(cv instanceof ObjectValue);\n        let p = cv.$GetPrototypeOf();\n        if (joinedObject === undefined) {\n          joinedObject = p;\n        } else {\n          let cond = AbstractValue.createFromBinaryOp(realm, \"===\", this, cv, this.expressionLocation);\n          joinedObject = AbstractValue.createFromConditionalOp(realm, cond, p, joinedObject);\n        }\n      }\n      invariant(\n        joinedObject instanceof AbstractObjectValue ||\n          joinedObject instanceof ObjectValue ||\n          joinedObject instanceof NullValue\n      );\n      return joinedObject;\n    }\n  }\n\n  // ECMA262 9.1.3\n  $IsExtensible(): boolean {\n    return false;\n  }\n\n  // ECMA262 9.1.5\n  $GetOwnProperty(_P: PropertyKeyValue): Descriptor | void {\n    let P = _P;\n    if (P instanceof StringValue) P = P.value;\n\n    if (this.values.isTop()) {\n      let error = new CompilerDiagnostic(\n        \"property access on unknown object\",\n        this.$Realm.currentLocation,\n        \"PP0031\",\n        \"FatalError\"\n      );\n      this.$Realm.handleError(error);\n      throw new FatalError();\n    }\n\n    let elements = this.values.getElements();\n    if (elements.size === 1) {\n      for (let cv of elements) {\n        invariant(cv instanceof ObjectValue);\n        return cv.$GetOwnProperty(P);\n      }\n      invariant(false);\n    } else if (this.kind === \"conditional\") {\n      // this is the join of two concrete/abstract objects\n      // use this join condition for the join of the two property values\n      let [cond, ob1, ob2] = this.args;\n      invariant(cond instanceof AbstractValue);\n      invariant(ob1 instanceof ObjectValue || ob1 instanceof AbstractObjectValue);\n      invariant(ob2 instanceof ObjectValue || ob2 instanceof AbstractObjectValue);\n      let d1 = ob1.$GetOwnProperty(P);\n      let d2 = ob2.$GetOwnProperty(P);\n      return Join.joinDescriptors(this.$Realm, cond, d1, d2);\n    } else if (this.kind === \"widened\") {\n      // This abstract object was created by repeated assignments of freshly allocated objects to the same binding inside a loop\n      let [ob1, ob2] = this.args; // ob1: summary of iterations 1...n, ob2: summary of iteration n+1\n      invariant(ob1 instanceof ObjectValue);\n      invariant(ob2 instanceof ObjectValue);\n      let d1 = ob1.$GetOwnProperty(P);\n      let d2 = ob2.$GetOwnProperty(P);\n      if (d1 === undefined || d2 === undefined) {\n        // We do not handle the case where different loop iterations result in different kinds of propperties\n        AbstractValue.reportIntrospectionError(this, P);\n        throw new FatalError();\n      }\n      d1 = d1.throwIfNotConcrete(this.$Realm);\n      d2 = d2.throwIfNotConcrete(this.$Realm);\n      if (!equalDescriptors(d1, d2)) {\n        AbstractValue.reportIntrospectionError(this, P);\n        throw new FatalError();\n      }\n      let desc = cloneDescriptor(d1);\n      invariant(desc !== undefined);\n      if (IsDataDescriptor(this.$Realm, desc)) {\n        // Values may be different, i.e. values may be loop variant, so the widened value summarizes the entire loop\n        // equalDescriptors guarantees that both have value props and if you have a value prop is value is defined.\n        let d1Value = d1.value;\n        invariant(d1Value instanceof Value);\n        let d2Value = d2.value;\n        invariant(d2Value instanceof Value);\n        let dValue = Widen.widenValues(this.$Realm, d1Value, d2Value);\n        invariant(dValue instanceof Value);\n        desc.value = dValue;\n      } else {\n        // In this case equalDescriptors guarantees exact equality betwee d1 and d2.\n        // Inlining the accessors will eventually bring in data properties if the accessors have loop variant behavior\n      }\n      return desc;\n    } else {\n      let first = true;\n      let joinedDescriptor;\n      for (let cv of elements) {\n        invariant(cv instanceof ObjectValue);\n        let desc = cv.$GetOwnProperty(P);\n        if (first) {\n          first = false;\n          joinedDescriptor = desc;\n        } else {\n          let cond = AbstractValue.createFromBinaryOp(this.$Realm, \"===\", this, cv, this.expressionLocation);\n          invariant(cond instanceof AbstractValue);\n          joinedDescriptor = Join.joinDescriptors(this.$Realm, cond, desc, joinedDescriptor);\n        }\n      }\n      return joinedDescriptor;\n    }\n  }\n\n  // ECMA262 9.1.6\n  $DefineOwnProperty(_P: PropertyKeyValue, _Desc: Descriptor): boolean {\n    let P = _P;\n    if (P instanceof StringValue) P = P.value;\n    if (this.values.isTop()) {\n      AbstractValue.reportIntrospectionError(this, P);\n      throw new FatalError();\n    }\n\n    let elements = this.values.getElements();\n    if (elements.size === 1) {\n      for (let cv of elements) {\n        invariant(cv instanceof ObjectValue);\n        return cv.$DefineOwnProperty(P, _Desc);\n      }\n      invariant(false);\n    } else {\n      let Desc = _Desc.throwIfNotConcrete(this.$Realm);\n      if (!IsDataDescriptor(this.$Realm, Desc)) {\n        AbstractValue.reportIntrospectionError(this, P);\n        throw new FatalError();\n      }\n      // Extract the first existing descriptor to get its existing attributes as defaults.\n      let firstExistingDesc;\n      for (let cv of elements) {\n        invariant(cv instanceof ObjectValue);\n        firstExistingDesc = cv.$GetOwnProperty(P);\n        if (firstExistingDesc) {\n          break;\n        }\n      }\n      if (firstExistingDesc) {\n        firstExistingDesc = firstExistingDesc.throwIfNotConcrete(this.$Realm);\n      }\n      let desc = new PropertyDescriptor({\n        value: Desc.value !== undefined ? Desc.value : this.$Realm.intrinsics.undefined,\n        writable: Desc.writable !== undefined ? Desc.writable : firstExistingDesc ? firstExistingDesc.writable : false,\n        enumerable:\n          Desc.enumerable !== undefined ? Desc.enumerable : firstExistingDesc ? firstExistingDesc.enumerable : false,\n        configurable:\n          Desc.configurable !== undefined\n            ? Desc.configurable\n            : firstExistingDesc\n              ? firstExistingDesc.configurable\n              : false,\n      });\n      let newVal = desc.value;\n      if (this.kind === \"conditional\") {\n        // this is the join of two concrete/abstract objects\n        // use this join condition for the join of the two property values\n        let [cond, ob1, ob2] = this.args;\n        invariant(cond instanceof AbstractValue);\n        invariant(ob1 instanceof ObjectValue || ob1 instanceof AbstractObjectValue);\n        invariant(ob2 instanceof ObjectValue || ob2 instanceof AbstractObjectValue);\n        let d1 = ob1.$GetOwnProperty(P);\n        let d2 = ob2.$GetOwnProperty(P);\n        if (d1 !== undefined) {\n          d1 = d1.throwIfNotConcrete(this.$Realm);\n          if (!equalDescriptors(d1, desc)) {\n            AbstractValue.reportIntrospectionError(this, P);\n            throw new FatalError();\n          }\n        }\n        if (d2 !== undefined) {\n          d2 = d2.throwIfNotConcrete(this.$Realm);\n          if (!equalDescriptors(d2, desc)) {\n            AbstractValue.reportIntrospectionError(this, P);\n            throw new FatalError();\n          }\n        }\n        let oldVal1 = d1 === undefined || d1.value === undefined ? this.$Realm.intrinsics.empty : d1.value;\n        let oldVal2 = d2 === undefined || d2.value === undefined ? this.$Realm.intrinsics.empty : d2.value;\n        invariant(oldVal1 instanceof Value);\n        invariant(oldVal2 instanceof Value);\n        let newVal1 = AbstractValue.createFromConditionalOp(this.$Realm, cond, newVal, oldVal1);\n        let newVal2 = AbstractValue.createFromConditionalOp(this.$Realm, cond, oldVal2, newVal);\n        desc.value = newVal1;\n        let result1 = ob1.$DefineOwnProperty(P, desc);\n        desc.value = newVal2;\n        let result2 = ob2.$DefineOwnProperty(P, desc);\n        if (result1 !== result2) {\n          AbstractValue.reportIntrospectionError(this, P);\n          throw new FatalError();\n        }\n        return result1;\n      } else {\n        invariant(newVal instanceof Value);\n        let sawTrue = false;\n        let sawFalse = false;\n        for (let cv of elements) {\n          invariant(cv instanceof ObjectValue);\n          let d = cv.$GetOwnProperty(P);\n          if (d !== undefined) {\n            d = d.throwIfNotConcrete(this.$Realm);\n            if (!equalDescriptors(d, desc)) {\n              AbstractValue.reportIntrospectionError(this, P);\n              throw new FatalError();\n            }\n          }\n          let dval = d === undefined || d.value === undefined ? this.$Realm.intrinsics.empty : d.value;\n          invariant(dval instanceof Value);\n          let cond = AbstractValue.createFromBinaryOp(this.$Realm, \"===\", this, cv, this.expressionLocation);\n          desc.value = AbstractValue.createFromConditionalOp(this.$Realm, cond, newVal, dval);\n          if (cv.$DefineOwnProperty(P, desc)) {\n            sawTrue = true;\n          } else sawFalse = true;\n        }\n        if (sawTrue && sawFalse) {\n          AbstractValue.reportIntrospectionError(this, P);\n          throw new FatalError();\n        }\n        return sawTrue;\n      }\n    }\n  }\n\n  // ECMA262 9.1.7\n  $HasProperty(_P: PropertyKeyValue): boolean {\n    let P = _P;\n    if (P instanceof StringValue) P = P.value;\n    if (this.values.isTop()) {\n      let error = new CompilerDiagnostic(\n        \"property access on unknown object\",\n        this.$Realm.currentLocation,\n        \"PP0031\",\n        \"FatalError\"\n      );\n      this.$Realm.handleError(error);\n      throw new FatalError();\n    }\n\n    let elements = this.values.getElements();\n    if (elements.size === 1) {\n      for (let cv of elements) {\n        invariant(cv instanceof ObjectValue);\n        return cv.$HasProperty(P);\n      }\n      invariant(false);\n    } else {\n      let hasProp = false;\n      let doesNotHaveProp = false;\n      for (let cv of elements) {\n        invariant(cv instanceof ObjectValue);\n        if (cv.$HasProperty(P)) hasProp = true;\n        else doesNotHaveProp = true;\n      }\n      if (hasProp && doesNotHaveProp) {\n        AbstractValue.reportIntrospectionError(this, P);\n        throw new FatalError();\n      }\n      return hasProp;\n    }\n  }\n\n  // ECMA262 9.1.8\n  $Get(_P: PropertyKeyValue, Receiver: Value): Value {\n    let P = _P;\n    if (P instanceof StringValue) P = P.value;\n\n    if (this.values.isTop()) {\n      let generateAbstractGet = () => {\n        let ob = Receiver;\n        if (this.kind === \"explicit conversion to object\") ob = this.args[0];\n        let type = Value;\n        if (P === \"length\" && Value.isTypeCompatibleWith(this.getType(), ArrayValue)) type = NumberValue;\n        // shape logic\n        let shapeContainer = this.kind === \"explicit conversion to object\" ? this.args[0] : this;\n        invariant(shapeContainer instanceof AbstractValue);\n        let realm = this.$Realm;\n        let shape = shapeContainer.shape;\n        let propertyShape, propertyGetter;\n        // propertyShape expects only a string value\n        if (\n          (realm.instantRender.enabled || realm.react.enabled) &&\n          shape !== undefined &&\n          (typeof P === \"string\" || P instanceof StringValue)\n        ) {\n          propertyShape = shape.getPropertyShape(P instanceof StringValue ? P.value : P);\n          if (propertyShape !== undefined) {\n            type = propertyShape.getAbstractType();\n            propertyGetter = propertyShape.getGetter();\n          }\n        }\n        // P can also be a SymbolValue\n        if (typeof P === \"string\") {\n          P = new StringValue(this.$Realm, P);\n        }\n        // Create an temporal array with widened properties\n        if (type === ArrayValue) {\n          return ArrayValue.createTemporalWithWidenedNumericProperty(\n            realm,\n            [ob, P],\n            createOperationDescriptor(\"ABSTRACT_OBJECT_GET\", { propertyGetter })\n          );\n        }\n        let propAbsVal = AbstractValue.createTemporalFromBuildFunction(\n          realm,\n          type,\n          [ob, P],\n          createOperationDescriptor(\"ABSTRACT_OBJECT_GET\", { propertyGetter }),\n          {\n            skipInvariant: true,\n            isPure: true,\n            shape: propertyShape,\n          }\n        );\n        return propAbsVal;\n      };\n      if (this.isSimpleObject() && this.isIntrinsic()) {\n        return generateAbstractGet();\n      } else if (this.$Realm.isInPureScope()) {\n        // This object might have leaked to a getter.\n        Leak.value(this.$Realm, Receiver);\n        // The getter might throw anything.\n        return this.$Realm.evaluateWithPossibleThrowCompletion(\n          generateAbstractGet,\n          TypesDomain.topVal,\n          ValuesDomain.topVal\n        );\n      }\n      let error = new CompilerDiagnostic(\n        \"property access on unknown object\",\n        this.$Realm.currentLocation,\n        \"PP0031\",\n        \"FatalError\"\n      );\n      this.$Realm.handleError(error);\n      throw new FatalError();\n    }\n\n    let realm = this.$Realm;\n    let elements = this.values.getElements();\n    if (elements.size === 1) {\n      for (let cv of elements) {\n        invariant(cv instanceof ObjectValue);\n        return cv.$Get(P, Receiver);\n      }\n      invariant(false);\n    } else if (this.kind === \"conditional\") {\n      // this is the join of two concrete/abstract objects\n      // use this join condition for the join of the two property values\n      let [cond, ob1, ob2] = this.args;\n      invariant(cond instanceof AbstractValue);\n      invariant(ob1 instanceof ObjectValue || ob1 instanceof AbstractObjectValue);\n      invariant(ob2 instanceof ObjectValue || ob2 instanceof AbstractObjectValue);\n      // Evaluate the effect of each getter separately and join the result.\n      return realm.evaluateWithAbstractConditional(\n        cond,\n        () => realm.evaluateForEffects(() => ob1.$Get(P, Receiver), undefined, \"ConditionalGet/1\"),\n        () => realm.evaluateForEffects(() => ob2.$Get(P, Receiver), undefined, \"ConditionalGet/2\")\n      );\n    } else {\n      let result;\n      for (let cv of elements) {\n        invariant(cv instanceof ObjectValue);\n        let cond = AbstractValue.createFromBinaryOp(this.$Realm, \"===\", this, cv, this.expressionLocation);\n        invariant(cond instanceof AbstractValue);\n        result = realm.evaluateWithAbstractConditional(\n          cond,\n          () => realm.evaluateForEffects(() => cv.$Get(P, Receiver), undefined, \"AbstractGet\"),\n          () => construct_empty_effects(realm, result === undefined ? undefined : new SimpleNormalCompletion(result))\n        );\n      }\n      invariant(result !== undefined);\n      return result;\n    }\n  }\n\n  $GetPartial(P: AbstractValue | PropertyKeyValue, Receiver: Value): Value {\n    if (!(P instanceof AbstractValue)) return this.$Get(P, Receiver);\n    if (this.values.isTop() || !this.isSimpleObject()) {\n      if (this.isSimpleObject() && this.isIntrinsic()) {\n        return AbstractValue.createTemporalFromBuildFunction(\n          this.$Realm,\n          Value,\n          [this, P],\n          createOperationDescriptor(\"ABSTRACT_OBJECT_GET_PARTIAL\"),\n          { skipInvariant: true, isPure: true }\n        );\n      }\n      if (this.$Realm.isInPureScope()) {\n        // If we're in a pure scope, we can leak the key and the instance,\n        // and leave the residual property access in place.\n        // We assume that if the receiver is different than this object,\n        // then we only got here because there can be no other keys with\n        // this name on earlier parts of the prototype chain.\n        // We have to leak since the property may be a getter or setter,\n        // which can run unknown code that has access to Receiver and\n        // (even in pure mode) can modify it in unknown ways.\n        Leak.value(this.$Realm, Receiver);\n        // Coercion can only have effects on anything reachable from the key.\n        Leak.value(this.$Realm, P);\n        return AbstractValue.createTemporalFromBuildFunction(\n          this.$Realm,\n          Value,\n          [Receiver, P],\n          createOperationDescriptor(\"ABSTRACT_OBJECT_GET_PARTIAL\"),\n          { skipInvariant: true, isPure: true }\n        );\n      }\n      let error = new CompilerDiagnostic(\n        \"property access on unknown object\",\n        this.$Realm.currentLocation,\n        \"PP0031\",\n        \"FatalError\"\n      );\n      this.$Realm.handleError(error);\n      throw new FatalError();\n    }\n\n    let realm = this.$Realm;\n\n    let elements = this.values.getElements();\n    if (elements.size === 1) {\n      for (let cv of elements) {\n        invariant(cv instanceof ObjectValue);\n        return cv.$GetPartial(P, Receiver);\n      }\n      invariant(false);\n    } else if (this.kind === \"conditional\") {\n      // this is the join of two concrete/abstract objects\n      // use this join condition for the join of the two property values\n      let [cond, ob1, ob2] = this.args;\n      invariant(cond instanceof AbstractValue);\n      invariant(ob1 instanceof ObjectValue || ob1 instanceof AbstractObjectValue);\n      invariant(ob2 instanceof ObjectValue || ob2 instanceof AbstractObjectValue);\n      // Evaluate the effect of each getter separately and join the result.\n      return realm.evaluateWithAbstractConditional(\n        cond,\n        () => realm.evaluateForEffects(() => ob1.$GetPartial(P, Receiver), undefined, \"ConditionalGet/1\"),\n        () => realm.evaluateForEffects(() => ob2.$GetPartial(P, Receiver), undefined, \"ConditionalGet/2\")\n      );\n    } else {\n      let result;\n      for (let cv of elements) {\n        invariant(cv instanceof ObjectValue);\n        let cond = AbstractValue.createFromBinaryOp(this.$Realm, \"===\", this, cv, this.expressionLocation);\n        invariant(cond instanceof AbstractValue);\n        result = realm.evaluateWithAbstractConditional(\n          cond,\n          () => realm.evaluateForEffects(() => cv.$GetPartial(P, Receiver), undefined, \"AbstractGet\"),\n          () => construct_empty_effects(realm, result === undefined ? undefined : new SimpleNormalCompletion(result))\n        );\n      }\n      invariant(result !== undefined);\n      return result;\n    }\n  }\n\n  // ECMA262 9.1.9\n  $Set(P: PropertyKeyValue, V: Value, Receiver: Value): boolean {\n    if (this.values.isTop()) {\n      return this.$SetPartial(P, V, Receiver);\n    }\n\n    let realm = this.$Realm;\n    let elements = this.values.getElements();\n\n    if (elements.size === 1) {\n      for (let cv of elements) {\n        invariant(cv instanceof ObjectValue);\n        return cv.$Set(P, V, Receiver);\n      }\n      invariant(false);\n    } else if (this.kind === \"conditional\") {\n      // this is the join of two concrete/abstract objects\n      // use this join condition for the join of the two property values\n      let [cond, ob1, ob2] = this.args;\n      invariant(cond instanceof AbstractValue);\n      invariant(ob1 instanceof ObjectValue || ob1 instanceof AbstractObjectValue);\n      invariant(ob2 instanceof ObjectValue || ob2 instanceof AbstractObjectValue);\n      // Evaluate the effect of each setter separately and join the effects.\n      let result = realm.evaluateWithAbstractConditional(\n        cond,\n        () =>\n          realm.evaluateForEffects(\n            () => new BooleanValue(realm, ob1.$Set(P, V, Receiver)),\n            undefined,\n            \"ConditionalSet/1\"\n          ),\n        () =>\n          realm.evaluateForEffects(\n            () => new BooleanValue(realm, ob2.$Set(P, V, Receiver)),\n            undefined,\n            \"ConditionalSet/2\"\n          )\n      );\n      if (!(result instanceof BooleanValue)) {\n        let error = new CompilerDiagnostic(\n          \"object could have both succeeded and failed updating\",\n          realm.currentLocation,\n          \"PP0041\",\n          \"RecoverableError\"\n        );\n        if (realm.handleError(error) === \"Recover\") {\n          return true;\n        }\n        throw new FatalError();\n      }\n      return result.value;\n    } else {\n      let sawTrue = false;\n      let sawFalse = false;\n      for (let cv of elements) {\n        invariant(cv instanceof ObjectValue);\n        // Evaluate the effect of each setter separately and join the effects.\n        let cond = AbstractValue.createFromBinaryOp(this.$Realm, \"===\", this, cv, this.expressionLocation);\n        invariant(cond instanceof AbstractValue);\n        realm.evaluateWithAbstractConditional(\n          cond,\n          () =>\n            realm.evaluateForEffects(\n              () => {\n                if (cv.$Set(P, V, Receiver)) {\n                  sawTrue = true;\n                } else {\n                  sawFalse = true;\n                }\n                return realm.intrinsics.empty;\n              },\n              undefined,\n              \"AbstractSet\"\n            ),\n          () => construct_empty_effects(realm)\n        );\n      }\n      if (sawTrue && sawFalse) {\n        let error = new CompilerDiagnostic(\n          \"object could have both succeeded and failed updating\",\n          realm.currentLocation,\n          \"PP0041\",\n          \"RecoverableError\"\n        );\n        if (realm.handleError(error) === \"Recover\") {\n          return true;\n        }\n      }\n      return sawTrue;\n    }\n  }\n\n  $SetPartial(_P: AbstractValue | PropertyKeyValue, V: Value, Receiver: Value): boolean {\n    let P = _P;\n    if (!this.values.isTop() && !(P instanceof AbstractValue)) return this.$Set(P, V, Receiver);\n    if (this.values.isTop()) {\n      if (this.$Realm.isInPureScope()) {\n        // If we're in a pure scope, we can leak the key and the instance,\n        // and leave the residual property assignment in place.\n        // We assume that if the receiver is different than this object,\n        // then we only got here because there can be no other keys with\n        // this name on earlier parts of the prototype chain.\n        // We have to leak since the property may be a getter or setter,\n        // which can run unknown code that has access to Receiver and\n        // (even in pure mode) can modify it in unknown ways.\n        Leak.value(this.$Realm, Receiver);\n        // We also need to leaked the value since it might leak to a setter.\n        Leak.value(this.$Realm, V);\n        this.$Realm.evaluateWithPossibleThrowCompletion(\n          () => {\n            let generator = this.$Realm.generator;\n            invariant(generator);\n\n            if (typeof P !== \"string\" && !(P instanceof StringValue)) {\n              // Coercion can only have effects on anything reachable from the key.\n              Leak.value(this.$Realm, P);\n            }\n            generator.emitPropertyAssignment(Receiver, P, V);\n            return this.$Realm.intrinsics.undefined;\n          },\n          TypesDomain.topVal,\n          ValuesDomain.topVal\n        );\n        // The emitted assignment might throw at runtime but if it does, that\n        // is handled by evaluateWithPossibleThrowCompletion. Anything that\n        // happens after this, can assume we didn't throw and therefore,\n        // we return true here.\n        return true;\n      }\n      let error = new CompilerDiagnostic(\n        \"property access on unknown object\",\n        this.$Realm.currentLocation,\n        \"PP0031\",\n        \"FatalError\"\n      );\n      this.$Realm.handleError(error);\n      throw new FatalError();\n    }\n\n    let realm = this.$Realm;\n    let elements = this.values.getElements();\n\n    if (elements.size === 1) {\n      for (let cv of elements) {\n        invariant(cv instanceof ObjectValue);\n        return cv.$SetPartial(P, V, Receiver);\n      }\n      invariant(false);\n    } else if (this.kind === \"conditional\") {\n      // this is the join of two concrete/abstract objects\n      // use this join condition for the join of the two property values\n      let [cond, ob1, ob2] = this.args;\n      invariant(cond instanceof AbstractValue);\n      invariant(ob1 instanceof ObjectValue || ob1 instanceof AbstractObjectValue);\n      invariant(ob2 instanceof ObjectValue || ob2 instanceof AbstractObjectValue);\n      // Evaluate the effect of each setter separately and join the effects.\n      let result = realm.evaluateWithAbstractConditional(\n        cond,\n        () =>\n          realm.evaluateForEffects(\n            () => new BooleanValue(realm, ob1.$SetPartial(P, V, Receiver)),\n            undefined,\n            \"ConditionalSet/1\"\n          ),\n        () =>\n          realm.evaluateForEffects(\n            () => new BooleanValue(realm, ob2.$SetPartial(P, V, Receiver)),\n            undefined,\n            \"ConditionalSet/2\"\n          )\n      );\n      if (!(result instanceof BooleanValue)) {\n        let error = new CompilerDiagnostic(\n          \"object could have both succeeded and failed updating\",\n          realm.currentLocation,\n          \"PP0041\",\n          \"RecoverableError\"\n        );\n        if (realm.handleError(error) === \"Recover\") {\n          return true;\n        }\n        throw new FatalError();\n      }\n      return result.value;\n    } else {\n      let sawTrue = false;\n      let sawFalse = false;\n      for (let cv of elements) {\n        invariant(cv instanceof ObjectValue);\n        // Evaluate the effect of each setter separately and join the effects.\n        let cond = AbstractValue.createFromBinaryOp(this.$Realm, \"===\", this, cv, this.expressionLocation);\n        invariant(cond instanceof AbstractValue);\n        realm.evaluateWithAbstractConditional(\n          cond,\n          () =>\n            realm.evaluateForEffects(\n              () => {\n                if (cv.$SetPartial(P, V, Receiver)) {\n                  sawTrue = true;\n                } else {\n                  sawFalse = true;\n                }\n                return realm.intrinsics.empty;\n              },\n              undefined,\n              \"AbstractSet\"\n            ),\n          () => construct_empty_effects(realm)\n        );\n      }\n      if (sawTrue && sawFalse) {\n        let error = new CompilerDiagnostic(\n          \"object could have both succeeded and failed updating\",\n          realm.currentLocation,\n          \"PP0041\",\n          \"RecoverableError\"\n        );\n        if (realm.handleError(error) === \"Recover\") {\n          return true;\n        }\n      }\n      return sawTrue;\n    }\n  }\n\n  // ECMA262 9.1.10\n  $Delete(_P: PropertyKeyValue): boolean {\n    let P = _P;\n    if (P instanceof StringValue) P = P.value;\n    if (this.values.isTop()) {\n      AbstractValue.reportIntrospectionError(this, P);\n      throw new FatalError();\n    }\n\n    let elements = this.values.getElements();\n    if (elements.size === 1) {\n      for (let cv of elements) {\n        invariant(cv instanceof ObjectValue);\n        return cv.$Delete(P);\n      }\n      invariant(false);\n    } else if (this.kind === \"conditional\") {\n      // this is the join of two concrete/abstract objects\n      // use this join condition for the join of the two property values\n      let [cond, ob1, ob2] = this.args;\n      invariant(cond instanceof AbstractValue);\n      invariant(ob1 instanceof ObjectValue || ob1 instanceof AbstractObjectValue);\n      invariant(ob2 instanceof ObjectValue || ob2 instanceof AbstractObjectValue);\n      let d1 = ob1.$GetOwnProperty(P);\n      let d2 = ob2.$GetOwnProperty(P);\n      let oldVal1 =\n        d1 === undefined ? this.$Realm.intrinsics.empty : IsDataDescriptor(this.$Realm, d1) ? d1.value : undefined;\n      let oldVal2 =\n        d2 === undefined ? this.$Realm.intrinsics.empty : IsDataDescriptor(this.$Realm, d2) ? d2.value : undefined;\n      if (oldVal1 === undefined || oldVal2 === undefined) {\n        AbstractValue.reportIntrospectionError(this, P);\n        throw new FatalError();\n      }\n      invariant(oldVal1 instanceof Value);\n      invariant(oldVal2 instanceof Value);\n      let newVal1 = AbstractValue.createFromConditionalOp(this.$Realm, cond, this.$Realm.intrinsics.empty, oldVal1);\n      let newVal2 = AbstractValue.createFromConditionalOp(this.$Realm, cond, oldVal2, this.$Realm.intrinsics.empty);\n      let result1 = true;\n      let result2 = true;\n      if (d1 !== undefined) {\n        d1 = d1.throwIfNotConcrete(this.$Realm);\n        let newDesc1 = cloneDescriptor(d1);\n        invariant(newDesc1);\n        newDesc1 = newDesc1.throwIfNotConcrete(this.$Realm);\n        newDesc1.value = newVal1;\n        result1 = ob1.$DefineOwnProperty(P, newDesc1);\n      }\n      if (d2 !== undefined) {\n        d2 = d2.throwIfNotConcrete(this.$Realm);\n        let newDesc2 = cloneDescriptor(d2);\n        invariant(newDesc2);\n        newDesc2 = newDesc2.throwIfNotConcrete(this.$Realm);\n        newDesc2.value = newVal2;\n        result2 = ob2.$DefineOwnProperty(P, newDesc2);\n      }\n      if (result1 !== result2) {\n        AbstractValue.reportIntrospectionError(this, P);\n        throw new FatalError();\n      }\n      return result1;\n    } else {\n      let sawTrue = false;\n      let sawFalse = false;\n      for (let cv of elements) {\n        invariant(cv instanceof ObjectValue);\n        let d = cv.$GetOwnProperty(P);\n        if (d === undefined) continue;\n        if (!IsDataDescriptor(this.$Realm, d)) {\n          AbstractValue.reportIntrospectionError(this, P);\n          throw new FatalError();\n        }\n        let cond = AbstractValue.createFromBinaryOp(this.$Realm, \"===\", this, cv, this.expressionLocation);\n        let dval = d.value;\n        invariant(dval instanceof Value);\n        let v = AbstractValue.createFromConditionalOp(this.$Realm, cond, this.$Realm.intrinsics.empty, dval);\n        let newDesc = cloneDescriptor(d);\n        invariant(newDesc);\n        newDesc.value = v;\n        if (cv.$DefineOwnProperty(P, newDesc)) sawTrue = true;\n        else sawFalse = true;\n      }\n      if (sawTrue && sawFalse) {\n        let error = new CompilerDiagnostic(\n          \"object could have both succeeded and failed updating\",\n          this.$Realm.currentLocation,\n          \"PP0041\",\n          \"RecoverableError\"\n        );\n        if (this.$Realm.handleError(error) === \"Recover\") {\n          return true;\n        }\n      }\n      return sawTrue;\n    }\n  }\n\n  $OwnPropertyKeys(getOwnPropertyKeysEvenIfPartial?: boolean = false): Array<PropertyKeyValue> {\n    if (this.values.isTop()) {\n      AbstractValue.reportIntrospectionError(this);\n      throw new FatalError();\n    }\n    let elements = this.values.getElements();\n    if (elements.size === 1) {\n      for (let cv of elements) {\n        invariant(cv instanceof ObjectValue);\n        return cv.$OwnPropertyKeys(getOwnPropertyKeysEvenIfPartial);\n      }\n      invariant(false);\n    } else {\n      AbstractValue.reportIntrospectionError(this);\n      throw new FatalError();\n    }\n  }\n}\n"
  },
  {
    "path": "src/values/AbstractValue.js",
    "content": "/**\n * Copyright (c) 2017-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n/* @flow */\n\nimport type {\n  BabelBinaryOperator,\n  BabelLogicalOperator,\n  BabelNodeSourceLocation,\n  BabelUnaryOperator,\n} from \"@babel/types\";\nimport { Completion, JoinedAbruptCompletions, JoinedNormalAndAbruptCompletions } from \"../completions.js\";\nimport { FatalError } from \"../errors.js\";\nimport type { Realm } from \"../realm.js\";\nimport { createOperationDescriptor, type OperationDescriptor } from \"../utils/generator.js\";\nimport type { PropertyKeyValue, ShapeInformationInterface } from \"../types.js\";\nimport { Placeholders } from \"../utils/PreludeGenerator.js\";\nimport {\n  AbstractObjectValue,\n  BooleanValue,\n  ConcreteValue,\n  NullValue,\n  NumberValue,\n  ObjectValue,\n  PrimitiveValue,\n  StringValue,\n  SymbolValue,\n  UndefinedValue,\n  EmptyValue,\n  Value,\n} from \"./index.js\";\nimport { hashString, hashBinary, hashCall, hashTernary, hashUnary } from \"../methods/index.js\";\nimport { TypesDomain, ValuesDomain } from \"../domains/index.js\";\nimport invariant from \"../invariant.js\";\n\n// In addition to the explicitly listed kinds,\n// all strings that start with `AbstractValueKindPrefix` are also legal kinds.\nexport type AbstractValueKind =\n  | \"||\"\n  | \"!\"\n  | \"===\"\n  | \"!==\"\n  | \"rebuiltProperty\"\n  | \"abstractConcreteUnion\"\n  | \"mayAliasSet\"\n  | \"build function\"\n  | \"widened property\"\n  | \"widened numeric property\"\n  | \"conditional\"\n  | \"resolved\"\n  | \"dummy parameter\"\n  | \"explicit conversion to object\"\n  | \"check for known property\"\n  | \"sentinel member expression\"\n  | \"environment initialization expression\"\n  | \"template for property name condition\"\n  | \"template for prototype member expression\"\n  | \"this\"\n  | \"this.refs\"\n  | \"module\"\n  | \"module.exports\"\n  | \"JSResource\"\n  | \"Bootloader\"\n  | \"(A).length\"\n  | \"('' + A)\"\n  | \"(A).slice(B,C)\"\n  | \"(A).split(B,C)\"\n  | \"global.JSON.stringify(A)\"\n  | \"global.JSON.parse(A)\"\n  | \"JSON.stringify(...)\"\n  | \"JSON.parse(...)\"\n  | \"global.Math.imul(A, B)\"\n  | \"global.__cannotBecomeObject(A)\"\n  | \"leaked binding value\";\n\n// Use AbstractValue.makeKind to make a kind from one of these prefices.\ntype AbstractValueKindPrefix =\n  | \"abstract\"\n  | \"props\"\n  | \"context\"\n  | \"property\"\n  | \"process\"\n  | \"template\"\n  | \"abstractCounted\"\n  | \"magicGlobalObject\";\n\nexport default class AbstractValue extends Value {\n  constructor(\n    realm: Realm,\n    types: TypesDomain,\n    values: ValuesDomain,\n    hashValue: number,\n    args: Array<Value>,\n    operationDescriptor?: OperationDescriptor,\n    optionalArgs?: {| kind?: AbstractValueKind, intrinsicName?: string, shape?: ShapeInformationInterface |}\n  ) {\n    invariant(realm.useAbstractInterpretation);\n    super(realm, optionalArgs ? optionalArgs.intrinsicName : undefined);\n    realm.recordNewAbstract(this);\n    invariant(!Value.isTypeCompatibleWith(types.getType(), ObjectValue) || this instanceof AbstractObjectValue);\n    invariant(types.getType() !== NullValue && types.getType() !== UndefinedValue);\n    this.types = types;\n    this.values = values;\n    this.mightBeEmpty = false;\n    this.operationDescriptor = operationDescriptor;\n    this.args = args;\n    this.hashValue = hashValue;\n    this.kind = optionalArgs ? optionalArgs.kind : undefined;\n    this.shape = optionalArgs ? optionalArgs.shape : undefined;\n  }\n\n  hashValue: number;\n  kind: void | AbstractValueKind;\n  types: TypesDomain;\n  values: ValuesDomain;\n  mightBeEmpty: boolean;\n  args: Array<Value>;\n  shape: void | ShapeInformationInterface;\n  operationDescriptor: void | OperationDescriptor;\n\n  toDisplayString(): string {\n    return \"[Abstract \" + this.hashValue.toString() + \"]\";\n  }\n\n  addSourceLocationsTo(locations: Array<BabelNodeSourceLocation>, seenValues?: Set<AbstractValue> = new Set()): void {\n    if (seenValues.has(this)) return;\n    seenValues.add(this);\n    for (let val of this.args) {\n      if (val instanceof AbstractValue) val.addSourceLocationsTo(locations, seenValues);\n    }\n  }\n\n  addSourceNamesTo(names: Array<string>, visited: Set<AbstractValue> = new Set()): void {\n    if (visited.has(this)) return;\n    visited.add(this);\n    let realm = this.$Realm;\n    function add_intrinsic(name: string) {\n      if (name.startsWith(\"_$\")) {\n        let temporalOperationEntryArgs = realm.derivedIds.get(name);\n        invariant(temporalOperationEntryArgs !== undefined);\n        add_args(temporalOperationEntryArgs.args);\n      } else if (names.indexOf(name) < 0) {\n        names.push(name);\n      }\n    }\n    function add_args(args: void | Array<Value>) {\n      if (args === undefined) return;\n      for (let val of args) {\n        if (val.intrinsicName) {\n          add_intrinsic(val.intrinsicName);\n        } else if (val instanceof AbstractValue) {\n          val.addSourceNamesTo(names, visited);\n        } else if (val instanceof StringValue) {\n          if (val.value.startsWith(\"__\")) {\n            names.push(val.value.slice(2));\n          }\n        }\n      }\n    }\n    if (this.intrinsicName) {\n      add_intrinsic(this.intrinsicName);\n    }\n    add_args(this.args);\n  }\n\n  equals(x: Value): boolean {\n    if (x instanceof ConcreteValue) return false;\n    let thisArgs = this.args;\n    let n = thisArgs.length;\n\n    let argsAreEqual = () => {\n      invariant(x instanceof AbstractValue);\n      let xArgs = x.args;\n      let m = xArgs.length;\n      invariant(n === m); // Will be true if kinds are the same. Caller should see to it.\n      for (let i = 0; i < n; i++) {\n        let a = thisArgs[i];\n        let b = xArgs[i];\n        if (!a.equals(b)) return false;\n      }\n      return true;\n    };\n\n    return (\n      this === x ||\n      (x instanceof AbstractValue &&\n        this.kind === x.kind &&\n        this.hashValue === x.hashValue &&\n        ((this.intrinsicName && this.intrinsicName.length > 0 && this.intrinsicName === x.intrinsicName) ||\n          (n > 0 && argsAreEqual())))\n    );\n  }\n\n  getHash(): number {\n    return this.hashValue;\n  }\n\n  getType(): typeof Value {\n    return this.types.getType();\n  }\n\n  getIdentifier(): string {\n    invariant(this.hasIdentifier());\n    invariant(this.operationDescriptor !== undefined);\n    let { id } = this.operationDescriptor.data;\n    invariant(id !== undefined);\n    return id;\n  }\n\n  hasIdentifier(): boolean {\n    return this.operationDescriptor ? this.operationDescriptor.type === \"IDENTIFIER\" : false;\n  }\n\n  // this => val. A false value does not imply that !(this => val).\n  implies(val: AbstractValue, depth: number = 0): boolean {\n    if (depth > 5) return false;\n    if (this.equals(val)) return true; // x => x regardless of its value\n    if (this.kind === \"||\") {\n      let [x, y] = this.args;\n      let xi =\n        x.implies(val, depth + 1) ||\n        (x instanceof AbstractValue && this.$Realm.pathConditions.impliesNot(x, depth + 1));\n      if (!xi) return false;\n      let yi =\n        y.implies(val, depth + 1) ||\n        (y instanceof AbstractValue && this.$Realm.pathConditions.impliesNot(y, depth + 1));\n      return yi;\n    } else if (this.kind === \"&&\") {\n      let [x, y] = this.args;\n      let xi =\n        x.implies(val, depth + 1) ||\n        (x instanceof AbstractValue && this.$Realm.pathConditions.impliesNot(x, depth + 1));\n      if (xi) return true;\n      let yi =\n        y.implies(val, depth + 1) ||\n        (y instanceof AbstractValue && this.$Realm.pathConditions.impliesNot(y, depth + 1));\n      return yi;\n    } else if (this.kind === \"!\") {\n      let [nx] = this.args;\n      invariant(nx instanceof AbstractValue);\n      if (nx.kind === \"!\") {\n        // !!x => val if x => val\n        let [x] = nx.args;\n        invariant(x instanceof AbstractValue);\n        return x.implies(val, depth + 1);\n      }\n    } else if (this.kind === \"conditional\") {\n      let [c, x, y] = this.args;\n      // (c ? x : y) => val if x is true and y is false and c = val\n      if (!x.mightNotBeTrue() && !y.mightNotBeFalse()) {\n        return c.equals(val);\n      }\n\n      if (val.kind === \"!==\" || val.kind === \"!=\") {\n        let [vx, vy] = val.args;\n        if (!x.mightNotBeFalse()) {\n          // (c ? false : y) => vx !== undefined && vx !== null if y => vx, since val is false unless y is true\n          if (vx instanceof AbstractValue && (vy instanceof NullValue || vy instanceof UndefinedValue))\n            return y.implies(vx, depth + 1);\n          // (c ? false : y) => undefined !== vy && null !== vy if y => vy, since val is false unless y is true\n          if ((vx instanceof NullValue || vx instanceof UndefinedValue) && vy instanceof AbstractValue)\n            return y.implies(vy, depth + 1);\n        } else if (!y.mightNotBeFalse()) {\n          // (c ? x : false) => vx !== undefined && vx !== null if x => vx, since val is false unless x is true\n          if (vx instanceof AbstractValue && (vy instanceof NullValue || vy instanceof UndefinedValue))\n            return x.implies(vx, depth + 1);\n          // (c ? x : false) => undefined !== vy && null !== vy if x => vy, since val is false unless x is true\n          if ((vx instanceof NullValue || vx instanceof UndefinedValue) && vy instanceof AbstractValue)\n            return x.implies(vy, depth + 1);\n        }\n      }\n\n      // (c ? x : false) => c && x (if c or x were falsy, (c ? x : false) could not be true)\n      if (!y.mightNotBeFalse()) {\n        if (c.implies(val, depth + 1)) return true;\n        if (x.implies(val, depth + 1)) return true;\n      }\n    } else if (this.kind === \"!==\") {\n      // (0 !== x) => x since undefined, null, false, 0, NaN and \"\" are excluded by the !== and all other values are thruthy\n      let [x, y] = this.args;\n      if (x instanceof NumberValue && x.value === 0) return y.equals(val);\n      if (y instanceof NumberValue && y.value === 0) return x.equals(val);\n    } else if ((this.kind === \"===\" || this.kind === \"==\") && (val.kind === \"===\" || val.kind === \"==\")) {\n      let [x, y] = this.args;\n      let [vx, vy] = val.args;\n      if (x instanceof NullValue || x instanceof UndefinedValue) {\n        if (val.kind === \"==\") {\n          // null/undefined === y && null/undefined === vy && y === vy => null/undefined == vy\n          if (vx instanceof NullValue || vx instanceof UndefinedValue) return y.equals(vy);\n          // null/undefined === y && vx === null/undefined && y === vx => null/undefined == vx\n          if (vy instanceof NullValue || vy instanceof UndefinedValue) return y.equals(vx);\n        } else {\n          invariant(val.kind === \"===\");\n          // null === y && null === vy && y === vy => null === vy\n          // undefined === y && undefined === vy && y === vy => undefined === vy\n          if (x.equals(vx)) return y.equals(vy);\n          // null === y && vx === null && y === vx => vx === null\n          // undefined === y && vx === undefined && y === vx => vx === undefined\n          if (x.equals(vy)) return y.equals(vx);\n        }\n      }\n      if (y instanceof NullValue || y instanceof UndefinedValue) {\n        if (val.kind === \"==\") {\n          // x === null/undefined && null/undefined === vy && x === vy => null/undefined == vy\n          if (vx instanceof NullValue || vx instanceof UndefinedValue) return x.equals(vy);\n          // x === null/undefined && vx === null/undefined && x === vx => null/undefined == vx\n          if (vy instanceof NullValue || vy instanceof UndefinedValue) return x.equals(vx);\n        } else {\n          invariant(val.kind === \"===\");\n          // x === null && null === vy && x === vy => null === vy\n          // x == undefined && undefined === vy && x === vy => undefined === vy\n          if (y.equals(vx)) return x.equals(vy);\n          // x === null && vx === null && x === vx => null == vy\n          // x === undefined && vx === undefined && x === vx => vx === undefined\n          if (y.equals(vy)) return x.equals(vx);\n        }\n      }\n    }\n    // x => !y if y => !x\n    if (val.kind === \"!\") {\n      let [y] = val.args;\n      invariant(y instanceof AbstractValue);\n      return y.impliesNot(this, depth + 1);\n    }\n    return false;\n  }\n\n  // this => !val. A false value does not imply that !(this => !val).\n  impliesNot(val: AbstractValue, depth: number = 0): boolean {\n    if (depth > 5) return false;\n    if (this.equals(val)) return false; // x => x regardless of its value, hence x => !val is false\n    if (this.kind === \"||\") {\n      let [x, y] = this.args;\n      let xi = x.impliesNot(val, depth + 1);\n      if (!xi) return false;\n      let yi = y.impliesNot(val, depth + 1);\n      return yi;\n    } else if (this.kind === \"&&\") {\n      let [x, y] = this.args;\n      let xi = x.impliesNot(val, depth + 1);\n      if (xi) return true;\n      let yi = y.impliesNot(val, depth + 1);\n      return yi;\n    } else if (this.kind === \"!\") {\n      let [nx] = this.args;\n      invariant(nx instanceof AbstractValue);\n      if (nx.kind === \"!\") {\n        // !!x => !y if y => !x\n        let [x] = nx.args;\n        invariant(x instanceof AbstractValue);\n        return x.impliesNot(val, depth + 1);\n      }\n      if (nx.kind === \"abstractConcreteUnion\") return false; // can't use two valued logic for this.\n      // !x => !val if val => x since if val is false x can be any value and if val is true then x must be true\n      return val.implies(nx);\n    } else if (this.kind === \"conditional\") {\n      let [c, x, y] = this.args;\n      // (c ? x : y) => !val if x is false and y is true and c = val\n      if (!x.mightNotBeFalse() && !y.mightNotBeTrue()) {\n        return c.equals(val);\n      }\n\n      if (val.kind === \"===\" || val.kind === \"==\") {\n        let [vx, vy] = val.args;\n        if (!x.mightNotBeFalse()) {\n          // (c ? false : y) => !(vx === undefined) && !(vx === null) if y => vx, since val is false unless y is true\n          if (vx instanceof AbstractValue && (vy instanceof NullValue || vy instanceof UndefinedValue))\n            return y.implies(vx, depth + 1);\n          // (c ? false : y) => !(undefined === vy) && !(null === vy) if y => vy, since val is false unless y is true\n          if ((vx instanceof NullValue || vx instanceof UndefinedValue) && vy instanceof AbstractValue)\n            return y.implies(vy, depth + 1);\n        } else if (!y.mightNotBeFalse()) {\n          // (c ? x : false) => !(vx === undefined) && !(vx === null) if x => vx, since val is false unless x is true\n          if (vx instanceof AbstractValue && (vy instanceof NullValue || vy instanceof UndefinedValue))\n            return x.implies(vx, depth + 1);\n          // (c ? x : false) => !(undefined === vy) && !(null !== vy) if x => vy, since val is false unless x is true\n          if ((vx instanceof NullValue || vx instanceof UndefinedValue) && vy instanceof AbstractValue)\n            return x.implies(vy, depth + 1);\n        }\n      }\n\n      // (c ? x : false) => c && x (if c or x were falsy, (c ? x : false) could not be true)\n      if (!y.mightNotBeFalse()) {\n        if (c.impliesNot(val, depth + 1)) return true;\n        if (x.impliesNot(val, depth + 1)) return true;\n      }\n    } else if (this.kind === \"===\" && val.kind === \"===\") {\n      // x === y and y !== z => !(x === z)\n      let [x1, y1] = this.args;\n      let [x2, y2] = val.args;\n      if (x1.equals(x2) && y1 instanceof ConcreteValue && y2 instanceof ConcreteValue && !y1.equals(y2)) return true;\n      // x === y and x !== z => !(z === y)\n      if (y1.equals(y2) && x1 instanceof ConcreteValue && x2 instanceof ConcreteValue && !x1.equals(x2)) {\n        return true;\n      }\n    }\n    return false;\n  }\n\n  isTemporal(): boolean {\n    return this.$Realm.getTemporalOperationEntryFromDerivedValue(this) !== undefined;\n  }\n  // todo: abstract values should never be of type UndefinedValue or NullValue, assert this\n  mightBeFalse(): boolean {\n    let valueType = this.getType();\n    if (valueType === UndefinedValue) return true;\n    if (valueType === NullValue) return true;\n    if (valueType === SymbolValue) return false;\n    if (Value.isTypeCompatibleWith(valueType, ObjectValue)) return false;\n    if (this.kind === \"abstractConcreteUnion\") {\n      for (let arg of this.args) if (arg.mightBeFalse()) return true;\n      return false;\n    }\n    if (this.values.isTop()) return true;\n    return this.values.mightBeFalse();\n  }\n\n  mightNotBeFalse(): boolean {\n    let valueType = this.getType();\n    if (valueType === UndefinedValue) return false;\n    if (valueType === NullValue) return false;\n    if (valueType === SymbolValue) return true;\n    if (Value.isTypeCompatibleWith(valueType, ObjectValue)) return true;\n    if (this.kind === \"abstractConcreteUnion\") {\n      for (let arg of this.args) if (arg.mightNotBeFalse()) return true;\n      return false;\n    }\n    if (this.values.isTop()) return true;\n    return this.values.mightNotBeFalse();\n  }\n\n  mightBeNull(): boolean {\n    let valueType = this.getType();\n    if (valueType === NullValue) return true;\n    if (valueType !== PrimitiveValue && valueType !== Value) return false;\n    if (this.kind === \"abstractConcreteUnion\") {\n      for (let arg of this.args) if (arg.mightBeNull()) return true;\n      return false;\n    }\n    if (this.values.isTop()) return true;\n    return this.values.includesValueOfType(NullValue);\n  }\n\n  mightNotBeNull(): boolean {\n    let valueType = this.getType();\n    if (valueType === NullValue) return false;\n    if (valueType !== PrimitiveValue && valueType !== Value) return true;\n    if (this.kind === \"abstractConcreteUnion\") {\n      for (let arg of this.args) if (arg.mightNotBeNull()) return true;\n      return false;\n    }\n    if (this.values.isTop()) return true;\n    return this.values.includesValueNotOfType(NullValue);\n  }\n\n  mightBeNumber(): boolean {\n    let valueType = this.getType();\n    if (Value.isTypeCompatibleWith(valueType, NumberValue)) return true;\n    if (valueType !== PrimitiveValue && valueType !== Value) return false;\n    if (this.kind === \"abstractConcreteUnion\") {\n      for (let arg of this.args) if (arg.mightBeNumber()) return true;\n      return false;\n    }\n    if (this.values.isTop()) return true;\n    return this.values.includesValueOfType(NumberValue);\n  }\n\n  mightNotBeNumber(): boolean {\n    let valueType = this.getType();\n    if (Value.isTypeCompatibleWith(valueType, NumberValue)) return false;\n    if (valueType !== PrimitiveValue && valueType !== Value) return true;\n    if (this.kind === \"abstractConcreteUnion\") {\n      for (let arg of this.args) if (arg.mightNotBeNumber()) return true;\n      return false;\n    }\n    if (this.values.isTop()) return true;\n    return this.values.includesValueNotOfType(NumberValue);\n  }\n\n  mightNotBeObject(): boolean {\n    let valueType = this.getType();\n    if (Value.isTypeCompatibleWith(valueType, PrimitiveValue)) return true;\n    if (Value.isTypeCompatibleWith(valueType, ObjectValue)) return false;\n    if (this.kind === \"abstractConcreteUnion\") {\n      for (let arg of this.args) if (arg.mightNotBeObject()) return true;\n      return false;\n    }\n    if (this.values.isTop()) return true;\n    return this.values.includesValueNotOfType(ObjectValue);\n  }\n\n  mightBeObject(): boolean {\n    let valueType = this.getType();\n    if (Value.isTypeCompatibleWith(valueType, PrimitiveValue)) return false;\n    if (Value.isTypeCompatibleWith(valueType, ObjectValue)) return true;\n    if (this.kind === \"abstractConcreteUnion\") {\n      for (let arg of this.args) if (arg.mightBeObject()) return true;\n      return false;\n    }\n    if (this.values.isTop()) return true;\n    return this.values.includesValueOfType(ObjectValue);\n  }\n\n  mightBeString(): boolean {\n    let valueType = this.getType();\n    if (valueType === StringValue) return true;\n    if (valueType !== PrimitiveValue && valueType !== Value) return false;\n    if (this.kind === \"abstractConcreteUnion\") {\n      for (let arg of this.args) if (arg.mightBeString()) return true;\n      return false;\n    }\n    if (this.values.isTop()) return true;\n    return this.values.includesValueOfType(StringValue);\n  }\n\n  mightNotBeString(): boolean {\n    let valueType = this.getType();\n    if (valueType === StringValue) return false;\n    if (valueType !== PrimitiveValue && valueType !== Value) return true;\n    if (this.kind === \"abstractConcreteUnion\") {\n      for (let arg of this.args) if (arg.mightNotBeString()) return true;\n      return false;\n    }\n    if (this.values.isTop()) return true;\n    return this.values.includesValueNotOfType(StringValue);\n  }\n\n  mightBeUndefined(): boolean {\n    let valueType = this.getType();\n    if (valueType === UndefinedValue) return true;\n    if (valueType !== PrimitiveValue && valueType !== Value) return false;\n    if (this.kind === \"abstractConcreteUnion\") {\n      for (let arg of this.args) if (arg.mightBeUndefined()) return true;\n      return false;\n    }\n    if (this.values.isTop()) return true;\n    return this.values.includesValueOfType(UndefinedValue);\n  }\n\n  mightNotBeUndefined(): boolean {\n    let valueType = this.getType();\n    if (valueType === UndefinedValue) return false;\n    if (valueType === EmptyValue) return false;\n    if (valueType !== PrimitiveValue && valueType !== Value) return true;\n    if (this.kind === \"abstractConcreteUnion\") {\n      for (let arg of this.args) if (arg.mightNotBeUndefined()) return true;\n      return false;\n    }\n    if (this.values.isTop()) return true;\n    return this.values.includesValueNotOfType(UndefinedValue);\n  }\n\n  mightHaveBeenDeleted(): boolean {\n    return this.mightBeEmpty;\n  }\n\n  promoteEmptyToUndefined(): Value {\n    if (this.values.isTop()) return this;\n    if (!this.mightBeEmpty) return this;\n    let cond = AbstractValue.createFromBinaryOp(this.$Realm, \"===\", this, this.$Realm.intrinsics.empty);\n    let result = AbstractValue.createFromConditionalOp(this.$Realm, cond, this.$Realm.intrinsics.undefined, this);\n    if (result instanceof AbstractValue) result.values = this.values.promoteEmptyToUndefined();\n    return result;\n  }\n\n  throwIfNotConcrete(): ConcreteValue {\n    AbstractValue.reportIntrospectionError(this);\n    throw new FatalError();\n  }\n\n  throwIfNotConcreteNumber(): NumberValue {\n    AbstractValue.reportIntrospectionError(this);\n    throw new FatalError();\n  }\n\n  throwIfNotConcreteString(): StringValue {\n    AbstractValue.reportIntrospectionError(this);\n    throw new FatalError();\n  }\n\n  throwIfNotConcreteBoolean(): BooleanValue {\n    AbstractValue.reportIntrospectionError(this);\n    throw new FatalError();\n  }\n\n  throwIfNotConcreteSymbol(): SymbolValue {\n    AbstractValue.reportIntrospectionError(this);\n    throw new FatalError();\n  }\n\n  throwIfNotConcreteObject(): ObjectValue {\n    AbstractValue.reportIntrospectionError(this);\n    throw new FatalError();\n  }\n\n  throwIfNotConcretePrimitive(): PrimitiveValue {\n    AbstractValue.reportIntrospectionError(this);\n    throw new FatalError();\n  }\n\n  throwIfNotObject(): AbstractObjectValue {\n    invariant(!(this instanceof AbstractObjectValue));\n    AbstractValue.reportIntrospectionError(this);\n    throw new FatalError();\n  }\n\n  static createJoinConditionForSelectedCompletions(\n    selector: Completion => boolean,\n    completion: JoinedAbruptCompletions | JoinedNormalAndAbruptCompletions\n  ): Value {\n    let jcw;\n    let jc = completion.joinCondition;\n    let realm = jc.$Realm;\n    let njc = AbstractValue.createFromUnaryOp(realm, \"!\", jc, true, undefined, true);\n    if (completion instanceof JoinedNormalAndAbruptCompletions && completion.composedWith !== undefined) {\n      jcw = AbstractValue.createJoinConditionForSelectedCompletions(selector, completion.composedWith);\n      jc = AbstractValue.createFromLogicalOp(realm, \"&&\", jcw, jc, undefined, true);\n      njc = AbstractValue.createFromLogicalOp(realm, \"&&\", jcw, njc, undefined, true);\n    }\n    let c = completion.consequent;\n    let a = completion.alternate;\n    let cContainsSelectedCompletion = c.containsSelectedCompletion(selector);\n    let aContainsSelectedCompletion = a.containsSelectedCompletion(selector);\n    if (!cContainsSelectedCompletion && !aContainsSelectedCompletion) {\n      if (jcw !== undefined) return jcw;\n      return realm.intrinsics.false;\n    }\n    let cCond = jc;\n    if (cContainsSelectedCompletion) {\n      if (c instanceof JoinedAbruptCompletions || c instanceof JoinedNormalAndAbruptCompletions) {\n        let jcc = AbstractValue.createJoinConditionForSelectedCompletions(selector, c);\n        cCond = AbstractValue.createFromLogicalOp(realm, \"&&\", cCond, jcc, undefined, true);\n      }\n      if (!aContainsSelectedCompletion) return cCond;\n    }\n    let aCond = njc;\n    if (aContainsSelectedCompletion) {\n      if (a instanceof JoinedAbruptCompletions || a instanceof JoinedNormalAndAbruptCompletions) {\n        let jac = AbstractValue.createJoinConditionForSelectedCompletions(selector, a);\n        aCond = AbstractValue.createFromLogicalOp(realm, \"&&\", aCond, jac, undefined, true);\n      }\n      if (!cContainsSelectedCompletion) return aCond;\n    }\n    let or = AbstractValue.createFromLogicalOp(realm, \"||\", cCond, aCond, undefined, true);\n    if (completion instanceof JoinedNormalAndAbruptCompletions && completion.composedWith !== undefined) {\n      let composedCond = AbstractValue.createJoinConditionForSelectedCompletions(selector, completion.composedWith);\n      let and = AbstractValue.createFromLogicalOp(realm, \"&&\", composedCond, or, undefined, true);\n      return and;\n    }\n    return or;\n  }\n\n  static createFromBinaryOp(\n    realm: Realm,\n    op: BabelBinaryOperator,\n    left: Value,\n    right: Value,\n    loc?: ?BabelNodeSourceLocation,\n    kind?: AbstractValueKind,\n    isCondition?: boolean,\n    doNotSimplify?: boolean\n  ): Value {\n    let leftTypes, leftValues;\n    if (left instanceof AbstractValue) {\n      leftTypes = left.types;\n      leftValues = left.values;\n    } else {\n      leftTypes = new TypesDomain(left.getType());\n      invariant(left instanceof ConcreteValue);\n      leftValues = new ValuesDomain(left);\n    }\n\n    let rightTypes, rightValues;\n    if (right instanceof AbstractValue) {\n      rightTypes = right.types;\n      rightValues = right.values;\n    } else {\n      rightTypes = new TypesDomain(right.getType());\n      invariant(right instanceof ConcreteValue);\n      rightValues = new ValuesDomain(right);\n    }\n\n    let resultTypes = TypesDomain.binaryOp(op, leftTypes, rightTypes);\n    let resultValues =\n      kind === \"template for property name condition\"\n        ? ValuesDomain.topVal\n        : ValuesDomain.binaryOp(realm, op, leftValues, rightValues);\n    let [hash, args] = kind === undefined ? hashBinary(op, left, right) : hashCall(kind, left, right);\n    let operationDescriptor = createOperationDescriptor(\"BINARY_EXPRESSION\", { binaryOperator: op });\n    let result = new AbstractValue(realm, resultTypes, resultValues, hash, args, operationDescriptor);\n    result.kind = kind || op;\n    result.expressionLocation = loc;\n    if (doNotSimplify) return result;\n    return isCondition\n      ? realm.simplifyAndRefineAbstractCondition(result)\n      : realm.simplifyAndRefineAbstractValue(result);\n  }\n\n  static createFromLogicalOp(\n    realm: Realm,\n    op: BabelLogicalOperator,\n    left: Value,\n    right: Value,\n    loc?: ?BabelNodeSourceLocation,\n    isCondition?: boolean,\n    doNotSimplify?: boolean\n  ): Value {\n    let leftTypes, leftValues;\n    if (left instanceof AbstractValue) {\n      leftTypes = left.types;\n      leftValues = left.values;\n    } else {\n      leftTypes = new TypesDomain(left.getType());\n      invariant(left instanceof ConcreteValue);\n      leftValues = new ValuesDomain(left);\n    }\n\n    let rightTypes, rightValues;\n    if (right instanceof AbstractValue) {\n      rightTypes = right.types;\n      rightValues = right.values;\n    } else {\n      rightTypes = new TypesDomain(right.getType());\n      invariant(right instanceof ConcreteValue);\n      rightValues = new ValuesDomain(right);\n    }\n\n    let resultTypes = TypesDomain.logicalOp(op, leftTypes, rightTypes);\n    let resultValues = ValuesDomain.logicalOp(realm, op, leftValues, rightValues);\n    let [hash, args] = hashCall(op, left, right);\n    let Constructor = Value.isTypeCompatibleWith(resultTypes.getType(), ObjectValue)\n      ? AbstractObjectValue\n      : AbstractValue;\n    let operationDescriptor = createOperationDescriptor(\"LOGICAL_EXPRESSION\", { logicalOperator: op });\n    let result = new Constructor(realm, resultTypes, resultValues, hash, args, operationDescriptor);\n    result.kind = op;\n    result.expressionLocation = loc;\n    if (doNotSimplify) return result;\n    return isCondition\n      ? realm.simplifyAndRefineAbstractCondition(result)\n      : realm.simplifyAndRefineAbstractValue(result);\n  }\n\n  static createFromConditionalOp(\n    realm: Realm,\n    condition: Value,\n    left: void | Value,\n    right: void | Value,\n    loc?: ?BabelNodeSourceLocation,\n    isCondition?: boolean,\n    doNotSimplify?: boolean\n  ): Value {\n    if (left === right) {\n      return left || realm.intrinsics.undefined;\n    }\n    if (!condition.mightNotBeTrue()) return left || realm.intrinsics.undefined;\n    if (!condition.mightNotBeFalse()) return right || realm.intrinsics.undefined;\n\n    let types = TypesDomain.joinValues(left, right);\n    if (types.getType() === NullValue) return realm.intrinsics.null;\n    if (types.getType() === UndefinedValue) return realm.intrinsics.undefined;\n    let values = ValuesDomain.joinValues(realm, left, right);\n    let [hash, args] = hashTernary(condition, left || realm.intrinsics.undefined, right || realm.intrinsics.undefined);\n    let Constructor = Value.isTypeCompatibleWith(types.getType(), ObjectValue) ? AbstractObjectValue : AbstractValue;\n    let operationDescriptor = createOperationDescriptor(\"CONDITIONAL_EXPRESSION\");\n    let result = new Constructor(realm, types, values, hash, args, operationDescriptor, { kind: \"conditional\" });\n    result.expressionLocation = loc;\n    if (left) result.mightBeEmpty = left.mightHaveBeenDeleted();\n    if (right && !result.mightBeEmpty) result.mightBeEmpty = right.mightHaveBeenDeleted();\n    if (doNotSimplify || result.mightBeEmpty) return result;\n    return isCondition\n      ? realm.simplifyAndRefineAbstractCondition(result)\n      : realm.simplifyAndRefineAbstractValue(result);\n  }\n\n  static createFromUnaryOp(\n    realm: Realm,\n    op: BabelUnaryOperator,\n    operand: AbstractValue,\n    prefix?: boolean,\n    loc?: ?BabelNodeSourceLocation,\n    isCondition?: boolean,\n    doNotSimplify?: boolean\n  ): Value {\n    invariant(op !== \"delete\" && op !== \"++\" && op !== \"--\"); // The operation must be pure\n    let resultTypes = TypesDomain.unaryOp(op, new TypesDomain(operand.getType()));\n    let resultValues = ValuesDomain.unaryOp(realm, op, operand.values);\n    let operationDescriptor = createOperationDescriptor(\"UNARY_EXPRESSION\", { unaryOperator: op, prefix });\n    let result = new AbstractValue(\n      realm,\n      resultTypes,\n      resultValues,\n      hashUnary(op, operand),\n      [operand],\n      operationDescriptor\n    );\n    result.kind = op;\n    result.expressionLocation = loc;\n    if (doNotSimplify) return result;\n    return isCondition\n      ? realm.simplifyAndRefineAbstractCondition(result)\n      : realm.simplifyAndRefineAbstractValue(result);\n  }\n\n  /* Note that the template is parameterized by the names A, B, C and so on.\n     When the abstract value is serialized, the serialized operations are substituted\n     for the corresponding parameters and the resulting template is parsed into an AST subtree\n     that is incorporated into the AST produced by the serializer. */\n  static createFromTemplate(\n    realm: Realm,\n    templateSource: string,\n    resultType: typeof Value,\n    operands: Array<Value>,\n    loc?: ?BabelNodeSourceLocation\n  ): AbstractValue {\n    let kind = AbstractValue.makeKind(\"template\", templateSource);\n    let resultTypes = new TypesDomain(resultType);\n    let resultValues = ValuesDomain.topVal;\n    let hash;\n    [hash, operands] = hashCall(kind, ...operands);\n    let Constructor = Value.isTypeCompatibleWith(resultType, ObjectValue) ? AbstractObjectValue : AbstractValue;\n    invariant(Placeholders.length >= operands.length);\n    let operationDescriptor = createOperationDescriptor(\"ABSTRACT_FROM_TEMPLATE\", { templateSource });\n    // This doesn't mean that the function is not pure, just that it creates\n    // a new object on each call and thus is a future optimization opportunity.\n    if (Value.isTypeCompatibleWith(resultType, ObjectValue)) hash = ++realm.objectCount;\n    let result = new Constructor(realm, resultTypes, resultValues, hash, operands, operationDescriptor);\n    result.kind = kind;\n    result.expressionLocation = loc || realm.currentLocation;\n    return result;\n  }\n\n  static createFromType(\n    realm: Realm,\n    resultType: typeof Value,\n    kind?: AbstractValueKind,\n    operands?: Array<Value>\n  ): AbstractValue {\n    let types = new TypesDomain(resultType);\n    let Constructor = Value.isTypeCompatibleWith(resultType, ObjectValue) ? AbstractObjectValue : AbstractValue;\n    let [hash, args] = hashCall(resultType.name + (kind || \"\"), ...(operands || []));\n    if (Value.isTypeCompatibleWith(resultType, ObjectValue)) hash = ++realm.objectCount;\n    let result = new Constructor(realm, types, ValuesDomain.topVal, hash, args);\n    if (kind) result.kind = kind;\n    result.expressionLocation = realm.currentLocation;\n    return result;\n  }\n\n  /* Emits a declaration for an identifier into the generator at the current point in time\n     and initializes it with an expression constructed from the given template.\n     Returns an abstract value that refers to the newly declared identifier.\n     Note that the template must generate an expression which has no side-effects\n     on the prepack state. It is assumed, however, that there could be side-effects\n     on the native state unless the isPure option is specified.  */\n  static createTemporalFromTemplate(\n    realm: Realm,\n    templateSource: string,\n    resultType: typeof Value,\n    operands: Array<Value>,\n    optionalArgs?: {|\n      kind?: AbstractValueKind,\n      isPure?: boolean,\n      skipInvariant?: boolean,\n      mutatesOnly?: Array<Value>,\n      shape?: ShapeInformationInterface,\n    |}\n  ): AbstractValue {\n    invariant(resultType !== UndefinedValue);\n    let temp = AbstractValue.createFromTemplate(realm, templateSource, resultType, operands);\n    let types = temp.types;\n    let values = temp.values;\n    let args = temp.args;\n    invariant(realm.generator !== undefined);\n    invariant(temp.operationDescriptor !== undefined);\n    return realm.generator.deriveAbstract(types, values, args, temp.operationDescriptor, optionalArgs);\n  }\n\n  static createFromBuildFunction(\n    realm: Realm,\n    resultType: typeof Value,\n    args: Array<Value>,\n    operationDescriptor: OperationDescriptor,\n    optionalArgs?: {| kind?: AbstractValueKind |}\n  ): AbstractValue | UndefinedValue {\n    let types = new TypesDomain(resultType);\n    let values = ValuesDomain.topVal;\n    let Constructor = Value.isTypeCompatibleWith(resultType, ObjectValue) ? AbstractObjectValue : AbstractValue;\n    let kind = (optionalArgs && optionalArgs.kind) || \"build function\";\n    let hash;\n    [hash, args] = hashCall(kind, ...args);\n    let result = new Constructor(realm, types, values, hash, args, operationDescriptor);\n    result.kind = kind;\n    return result;\n  }\n\n  static createTemporalFromBuildFunction(\n    realm: Realm,\n    resultType: typeof Value,\n    args: Array<Value>,\n    operationDescriptor: OperationDescriptor,\n    optionalArgs?: {|\n      kind?: AbstractValueKind,\n      isPure?: boolean,\n      skipInvariant?: boolean,\n      mutatesOnly?: Array<Value>,\n      shape?: void | ShapeInformationInterface,\n    |}\n  ): AbstractValue | UndefinedValue {\n    let types = new TypesDomain(resultType);\n    let values = ValuesDomain.topVal;\n    invariant(realm.generator !== undefined);\n    if (resultType === UndefinedValue) {\n      return realm.generator.emitVoidExpression(types, values, args, operationDescriptor);\n    } else {\n      return realm.generator.deriveAbstract(types, values, args, operationDescriptor, optionalArgs);\n    }\n  }\n\n  static convertToTemporalIfArgsAreTemporal(realm: Realm, val: AbstractValue, condArgs?: Array<Value>): AbstractValue {\n    if (condArgs === undefined) condArgs = val.args;\n\n    let temporalArg = condArgs.find(arg => arg.isTemporal());\n    if (temporalArg !== undefined) {\n      let realmGenerator = realm.generator;\n      invariant(realmGenerator !== undefined);\n      invariant(val.operationDescriptor !== undefined);\n      return realmGenerator.deriveAbstract(val.types, val.values, val.args, val.operationDescriptor);\n    } else {\n      return val;\n    }\n  }\n\n  static dischargeValuesFromUnion(realm: Realm, union: AbstractValue): [AbstractValue, Array<ConcreteValue>] {\n    invariant(union instanceof AbstractValue && union.kind === \"abstractConcreteUnion\");\n    let abstractValue = union.args[0];\n    invariant(abstractValue instanceof AbstractValue);\n\n    let concreteValues = (union.args.filter(e => e instanceof ConcreteValue): any);\n    invariant(concreteValues.length === union.args.length - 1);\n\n    if (!abstractValue.isTemporal()) {\n      // We make the abstract value in an abstract concrete union temporal, as it is predicated\n      // on the conditions that preclude the concrete values in the union. The type invariant\n      // also only applies in that condition, so it is skipped when deriving the value\n      // See #2327\n      let realmGenerator = realm.generator;\n\n      invariant(realmGenerator !== undefined);\n      invariant(abstractValue.operationDescriptor !== undefined);\n      abstractValue = realmGenerator.deriveAbstract(\n        abstractValue.types,\n        abstractValue.values,\n        abstractValue.args,\n        abstractValue.operationDescriptor,\n        {\n          isPure: true,\n          skipInvariant: true,\n        }\n      );\n    }\n\n    return [abstractValue, concreteValues];\n  }\n\n  // Creates a union of an abstract value with one or more concrete values.\n  // The operation descriptor for the abstract values becomes the operation descriptor for the union.\n  // Use this only to allow instrinsic abstract objects to be null and/or undefined.\n  static createAbstractConcreteUnion(\n    realm: Realm,\n    abstractValue: AbstractValue,\n    concreteValues: Array<ConcreteValue>\n  ): AbstractValue {\n    invariant(concreteValues.length > 0);\n    invariant(abstractValue instanceof AbstractValue);\n\n    let checkedConcreteValues = (concreteValues.filter(e => e instanceof ConcreteValue): any);\n    invariant(checkedConcreteValues.length === concreteValues.length);\n\n    let concreteSet: Set<ConcreteValue> = new Set(checkedConcreteValues);\n    let values;\n\n    if (!abstractValue.values.isTop()) {\n      abstractValue.values.getElements().forEach(v => concreteSet.add(v));\n      values = new ValuesDomain(concreteSet);\n    } else {\n      values = ValuesDomain.topVal;\n    }\n    let types = TypesDomain.topVal;\n    let [hash, operands] = hashCall(\"abstractConcreteUnion\", abstractValue, ...checkedConcreteValues);\n    let result = new AbstractValue(realm, types, values, hash, operands, createOperationDescriptor(\"SINGLE_ARG\"), {\n      kind: \"abstractConcreteUnion\",\n    });\n    result.expressionLocation = realm.currentLocation;\n    return result;\n  }\n\n  static createFromWidenedProperty(\n    realm: Realm,\n    resultTemplate: AbstractValue,\n    args: Array<Value>,\n    operationDescriptor: OperationDescriptor\n  ): AbstractValue {\n    let types = resultTemplate.types;\n    let values = resultTemplate.values;\n    let [hash] = hashCall(\"widened property\", ...args);\n    let Constructor = Value.isTypeCompatibleWith(types.getType(), ObjectValue) ? AbstractObjectValue : AbstractValue;\n    let result = new Constructor(realm, types, values, hash, args, operationDescriptor);\n    result.kind = \"widened property\";\n    result.mightBeEmpty = resultTemplate.mightBeEmpty;\n    result.expressionLocation = resultTemplate.expressionLocation;\n    return result;\n  }\n\n  static createFromWidening(realm: Realm, value1: Value, value2: Value): AbstractValue {\n    // todo: #1174 look at kind and figure out much narrower widenings\n    let types = TypesDomain.joinValues(value1, value2);\n    let values = ValuesDomain.topVal;\n    let [hash] = hashCall(\"widened\");\n    let Constructor = Value.isTypeCompatibleWith(types.getType(), ObjectValue) ? AbstractObjectValue : AbstractValue;\n    let result = new Constructor(realm, types, values, hash, []);\n    result.kind = \"widened\";\n    result.mightBeEmpty = value1.mightHaveBeenDeleted() || value2.mightHaveBeenDeleted();\n    result.expressionLocation = value1.expressionLocation;\n    return result;\n  }\n\n  static createAbstractArgument(\n    realm: Realm,\n    name: string,\n    location: ?BabelNodeSourceLocation,\n    type: typeof Value = Value,\n    shape: void | ShapeInformationInterface = undefined\n  ): AbstractValue {\n    if (!realm.useAbstractInterpretation) {\n      throw realm.createErrorThrowCompletion(realm.intrinsics.TypeError, \"realm is not partial\");\n    }\n\n    let realmPreludeGenerator = realm.preludeGenerator;\n    invariant(realmPreludeGenerator);\n    let types = new TypesDomain(type);\n    let values = ValuesDomain.topVal;\n    let Constructor = Value.isTypeCompatibleWith(type, ObjectValue) ? AbstractObjectValue : AbstractValue;\n    let operationDescriptor = createOperationDescriptor(\"IDENTIFIER\", { id: name });\n    let result = new Constructor(realm, types, values, 943586754858 + hashString(name), [], operationDescriptor);\n    result.kind = AbstractValue.makeKind(\"abstractCounted\", (realm.objectCount++).toString()); // need not be an object, but must be unique\n    result.expressionLocation = location;\n    result.shape = shape;\n    return result;\n  }\n\n  static generateErrorInformationForAbstractVal(val: AbstractValue): string {\n    let names = [];\n    val.addSourceNamesTo(names);\n    return `abstract value${names.length > 1 ? \"s\" : \"\"} ${names.join(\" and \")}`;\n  }\n\n  static describe(val: Value, propertyName: void | PropertyKeyValue): string {\n    let realm = val.$Realm;\n\n    let identity;\n    if (val === realm.$GlobalObject) identity = \"global\";\n    else if (val instanceof AbstractValue) {\n      identity = this.generateErrorInformationForAbstractVal(val);\n    } else identity = val.intrinsicName || \"(some value)\";\n\n    let source_locations = [];\n    if (val instanceof AbstractValue) val.addSourceLocationsTo(source_locations);\n\n    let location;\n    if (propertyName instanceof SymbolValue) {\n      let desc = propertyName.$Description;\n      if (desc) {\n        location = `at symbol [${desc.throwIfNotConcreteString().value}]`;\n      } else {\n        location = `at symbol [${\"(no description)\"}]`;\n      }\n    } else if (propertyName instanceof StringValue) location = `at ${propertyName.value}`;\n    else if (typeof propertyName === \"string\") location = `at ${propertyName}`;\n    else location = source_locations.length === 0 ? \"\" : `at ${source_locations.join(\"\\n\")}`;\n\n    return `${identity} ${location}`;\n  }\n\n  static reportIntrospectionError(val: Value, propertyName: void | PropertyKeyValue): void {\n    let message = \"\";\n    if (!val.$Realm.suppressDiagnostics)\n      message = `This operation is not yet supported on ${AbstractValue.describe(val, propertyName)}`;\n\n    let realm = val.$Realm;\n    return realm.reportIntrospectionError(message);\n  }\n\n  static createAbstractObject(\n    realm: Realm,\n    name: string,\n    templateOrShape?: ObjectValue | ShapeInformationInterface\n  ): AbstractObjectValue {\n    let value;\n    if (templateOrShape === undefined) {\n      templateOrShape = new ObjectValue(realm, realm.intrinsics.ObjectPrototype);\n    }\n    value = AbstractValue.createFromTemplate(realm, name, ObjectValue, []);\n    if (!realm.isNameStringUnique(name)) {\n      value.hashValue = ++realm.objectCount;\n    } else {\n      realm.saveNameString(name);\n    }\n    value.intrinsicName = name;\n    if (templateOrShape instanceof ObjectValue) {\n      templateOrShape.makePartial();\n      templateOrShape.makeSimple();\n      value.values = new ValuesDomain(new Set([templateOrShape]));\n      realm.rebuildNestedProperties(value, name);\n    } else {\n      value.shape = templateOrShape;\n    }\n    invariant(value instanceof AbstractObjectValue);\n    return value;\n  }\n\n  static makeKind(prefix: AbstractValueKindPrefix, suffix: string): AbstractValueKind {\n    return ((`${prefix}:${suffix}`: any): AbstractValueKind);\n  }\n\n  static createTemporalObjectAssign(\n    realm: Realm,\n    to: ObjectValue | AbstractObjectValue,\n    sources: Array<Value>\n  ): AbstractObjectValue {\n    // Tell serializer that it may add properties to to only after temporalTo has been emitted\n    let temporalArgs = [to, ...sources];\n    let preludeGenerator = realm.preludeGenerator;\n    invariant(preludeGenerator !== undefined);\n    let temporalTo = AbstractValue.createTemporalFromBuildFunction(\n      realm,\n      ObjectValue,\n      temporalArgs,\n      createOperationDescriptor(\"OBJECT_ASSIGN\"),\n      { skipInvariant: true, mutatesOnly: [to] }\n    );\n    invariant(temporalTo instanceof AbstractObjectValue);\n    if (to instanceof AbstractObjectValue) {\n      temporalTo.values = to.values;\n    } else {\n      invariant(to instanceof ObjectValue);\n      temporalTo.values = new ValuesDomain(to);\n    }\n    to.temporalAlias = temporalTo;\n    return temporalTo;\n  }\n}\n"
  },
  {
    "path": "src/values/ArgumentsExotic.js",
    "content": "/**\n * Copyright (c) 2017-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n/* @flow strict-local */\n\nimport type { Realm } from \"../realm.js\";\nimport type { PropertyKeyValue, Descriptor } from \"../types.js\";\nimport { ObjectValue, Value } from \"./index.js\";\nimport { IsDataDescriptor, IsAccessorDescriptor } from \"../methods/is.js\";\nimport { HasOwnProperty } from \"../methods/has.js\";\nimport { SameValuePartial } from \"../methods/abstract.js\";\nimport { Get, OrdinaryGet } from \"../methods/get.js\";\nimport { Properties } from \"../singletons.js\";\nimport invariant from \"../invariant.js\";\nimport { PropertyDescriptor } from \"../descriptors.js\";\n\nexport default class ArgumentsExotic extends ObjectValue {\n  constructor(realm: Realm, intrinsicName?: string) {\n    super(realm, realm.intrinsics.ObjectPrototype, intrinsicName);\n  }\n\n  $ParameterMap: void | ObjectValue;\n\n  // ECMA262 9.4.4.1\n  $GetOwnProperty(P: PropertyKeyValue): Descriptor | void {\n    // 1. Let args be the arguments object.\n    let args = this;\n\n    // 2. Let desc be OrdinaryGetOwnProperty(args, P).\n    let desc = Properties.OrdinaryGetOwnProperty(this.$Realm, args, P);\n\n    // 3. If desc is undefined, return desc.\n    if (desc === undefined) return undefined;\n    Properties.ThrowIfMightHaveBeenDeleted(desc);\n    desc = desc.throwIfNotConcrete(this.$Realm);\n\n    // 4. Let map be args.[[ParameterMap]].\n    let map = args.$ParameterMap;\n    invariant(map);\n\n    // 5. Let isMapped be ! HasOwnProperty(map, P).\n    let isMapped = HasOwnProperty(this.$Realm, map, P);\n\n    // 6. If isMapped is true, then\n    if (isMapped === true) {\n      // a. Set desc.[[Value]] to Get(map, P).\n      desc.value = Get(this.$Realm, map, P);\n    }\n\n    // 7. Return desc.\n    return desc;\n  }\n\n  // ECMA262 9.4.4.2\n  $DefineOwnProperty(P: PropertyKeyValue, _Desc: Descriptor): boolean {\n    let Desc = _Desc.throwIfNotConcrete(this.$Realm);\n\n    // 1. Let args be the arguments object.\n    let args = this;\n\n    // 2. Let map be args.[[ParameterMap]].\n    let map = args.$ParameterMap;\n    invariant(map);\n\n    // 3. Let isMapped be HasOwnProperty(map, P).\n    let isMapped = HasOwnProperty(this.$Realm, map, P);\n\n    // 4. Let newArgDesc be Desc.\n    let newArgDesc = Desc;\n\n    // 5. If isMapped is true and IsDataDescriptor(Desc) is true, then\n    if (isMapped === true && IsDataDescriptor(this.$Realm, Desc) === true) {\n      // a. If Desc.[[Value]] is not present and Desc.[[Writable]] is present and its value is false, then\n      if (Desc.value === undefined && Desc.writable === false) {\n        // i. Let newArgDesc be a copy of Desc.\n        newArgDesc = new PropertyDescriptor(Desc);\n\n        // ii. Set newArgDesc.[[Value]] to Get(map, P).\n        newArgDesc.value = Get(this.$Realm, map, P);\n      }\n    }\n\n    // 6. Let allowed be ? OrdinaryDefineOwnProperty(args, P, newArgDesc).\n    let allowed = Properties.OrdinaryDefineOwnProperty(this.$Realm, args, P, newArgDesc);\n\n    // 7. If allowed is false, return false.\n    if (allowed === false) return false;\n\n    // 8. If isMapped is true, then\n    if (isMapped === true) {\n      // a. If IsAccessorDescriptor(Desc) is true, then\n      if (IsAccessorDescriptor(this.$Realm, Desc) === true) {\n        // i. Call map.[[Delete]](P).\n        map.$Delete(P);\n      } else {\n        // b. Else,\n        // i. If Desc.[[Value]] is present, then\n        if (Desc.value !== undefined) {\n          // 1. Let setStatus be Set(map, P, Desc.[[Value]], false).\n          invariant(Desc.value instanceof Value);\n          let setStatus = Properties.Set(this.$Realm, map, P, Desc.value, false);\n\n          // 2. Assert: setStatus is true because formal parameters mapped by argument objects are always writable.\n          invariant(setStatus === true);\n        }\n\n        // ii. If Desc.[[Writable]] is present and its value is false, then\n        if (Desc.writable === false) {\n          // 1. Call map.[[Delete]](P).\n          map.$Delete(P);\n        }\n      }\n    }\n\n    // 9. Return true.\n    return true;\n  }\n\n  // ECMA262 9.4.4.3\n  $Get(P: PropertyKeyValue, Receiver: Value): Value {\n    // 1. Let args be the arguments object.\n    let args = this;\n\n    // 2. Let map be args.[[ParameterMap]].\n    let map = args.$ParameterMap;\n    invariant(map);\n\n    // 3. Let isMapped be ! HasOwnProperty(map, P).\n    let isMapped = HasOwnProperty(this.$Realm, map, P);\n\n    // 4. If isMapped is false, then\n    if (isMapped === false) {\n      // a. Return ? OrdinaryGet(args, P, Receiver).\n      return OrdinaryGet(this.$Realm, args, P, Receiver);\n    } else {\n      // 5. Else map contains a formal parameter mapping for P,\n      // b. Return Get(map, P).\n      return Get(this.$Realm, map, P);\n    }\n  }\n\n  // ECMA262 9.4.4.4\n  $Set(P: PropertyKeyValue, V: Value, Receiver: Value): boolean {\n    // 1. Let args be the arguments object.\n    let args = this;\n\n    let isMapped, map;\n    // 2. If SameValue(args, Receiver) is false, then\n    if (SameValuePartial(this.$Realm, args, Receiver) === false) {\n      // a. Let isMapped be false.\n      isMapped = false;\n    } else {\n      // 3. Else,\n      // a. Let map be args.[[ParameterMap]].\n      map = args.$ParameterMap;\n      invariant(map);\n\n      // b. Let isMapped be ! HasOwnProperty(map, P).\n      isMapped = HasOwnProperty(this.$Realm, map, P);\n    }\n\n    // 4. If isMapped is true, then\n    if (isMapped === true) {\n      invariant(map);\n      // a. Let setStatus be Set(map, P, V, false).\n      let setStatus = Properties.Set(this.$Realm, map, P, V, false);\n\n      // b. Assert: setStatus is true because formal parameters mapped by argument objects are always writable.\n      invariant(setStatus === true);\n    }\n\n    // 5. Return ? OrdinarySet(args, P, V, Receiver).\n    return Properties.OrdinarySet(this.$Realm, args, P, V, Receiver);\n  }\n\n  // ECMA262 9.4.4.5\n  $Delete(P: PropertyKeyValue): boolean {\n    // 1. Let args be the arguments object.\n    let args = this;\n\n    // 2. Let map be args.[[ParameterMap]].\n    let map = args.$ParameterMap;\n    invariant(map);\n\n    // 3. Let isMapped be ! HasOwnProperty(map, P).\n    let isMapped = HasOwnProperty(this.$Realm, map, P);\n\n    // 4. Let result be ? OrdinaryDelete(args, P).\n    let result = Properties.OrdinaryDelete(this.$Realm, args, P);\n\n    // 5. If result is true and isMapped is true, then\n    if (result === true && isMapped === true) {\n      // a. Call map.[[Delete]](P).\n      map.$Delete(P);\n    }\n\n    // 6. Return result.\n    return result;\n  }\n}\n"
  },
  {
    "path": "src/values/ArrayValue.js",
    "content": "/**\n * Copyright (c) 2017-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n/* @flow strict-local */\n\nimport type { Effects, Realm } from \"../realm.js\";\nimport type { PropertyBinding, PropertyKeyValue, Descriptor, ObjectKind } from \"../types.js\";\nimport {\n  AbstractValue,\n  BoundFunctionValue,\n  ECMAScriptSourceFunctionValue,\n  NumberValue,\n  ObjectValue,\n  StringValue,\n  Value,\n} from \"./index.js\";\nimport { IsAccessorDescriptor, IsPropertyKey, IsArrayIndex } from \"../methods/is.js\";\nimport { Leak, Reachability, Properties, To, Utils } from \"../singletons.js\";\nimport { type OperationDescriptor } from \"../utils/generator.js\";\nimport invariant from \"../invariant.js\";\nimport { NestedOptimizedFunctionSideEffect } from \"../errors.js\";\nimport { PropertyDescriptor } from \"../descriptors.js\";\nimport { SimpleNormalCompletion } from \"../completions.js\";\n\ntype ArrayNestedOptimizedFunctionType = \"map\" | \"filter\";\ntype PossibleNestedOptimizedFunctions = [\n  {\n    func: BoundFunctionValue | ECMAScriptSourceFunctionValue,\n    thisValue: Value,\n    kind: ArrayNestedOptimizedFunctionType,\n  },\n];\n\nfunction evaluatePossibleNestedOptimizedFunctionsAndStoreEffects(\n  realm: Realm,\n  abstractArrayValue: ArrayValue,\n  possibleNestedOptimizedFunctions: PossibleNestedOptimizedFunctions\n): void {\n  for (let { func, thisValue } of possibleNestedOptimizedFunctions) {\n    let funcToModel = func;\n    if (func instanceof BoundFunctionValue) {\n      funcToModel = func.$BoundTargetFunction;\n      thisValue = func.$BoundThis;\n    }\n    invariant(funcToModel instanceof ECMAScriptSourceFunctionValue);\n\n    if (funcToModel.isCalledInMultipleContexts) return;\n\n    let previouslyComputedEffects = realm.collectedNestedOptimizedFunctionEffects.get(funcToModel);\n    if (previouslyComputedEffects !== undefined) {\n      if (realm.instantRender.enabled) {\n        realm.instantRenderBailout(\"Array operators may only be optimized once\", funcToModel.expressionLocation);\n      } else {\n        // We currently do not support context-sensitive specialization,\n        // where the calls we specialize depend on the specialization context.\n        // TODO: #2454\n        // TODO: Implement context-sensitive specialization instead of giving up\n        funcToModel.isCalledInMultipleContexts = true;\n        Leak.value(realm, func);\n        return;\n      }\n    }\n\n    let funcCall = () => {\n      invariant(funcToModel instanceof ECMAScriptSourceFunctionValue);\n      return realm.evaluateFunctionForPureEffects(\n        func,\n        Utils.createModelledFunctionCall(realm, funcToModel, undefined, thisValue),\n        null,\n        \"temporalArray nestedOptimizedFunction\",\n        () => {\n          throw new NestedOptimizedFunctionSideEffect();\n        }\n      );\n    };\n    // We take the modelled function and wrap it in a pure evaluation so we can check for\n    // side-effects that occur when evaluating the function. If there are side-effects, then\n    // we don't try and optimize the nested function.\n    let effects;\n    try {\n      effects = realm.isInPureScope() ? funcCall() : realm.evaluateWithPureScope(funcCall);\n    } catch (e) {\n      // If the nested optimized function had side-effects, we need to fallback to\n      // the default behaviour and leaked the nested functions so any bindings\n      // within the function properly leak and materialize.\n      if (e instanceof NestedOptimizedFunctionSideEffect) {\n        if (realm.instantRender.enabled) {\n          realm.instantRenderBailout(\n            \"InstantRender does not support impure array operators\",\n            funcCall.expressionLocation\n          );\n        }\n        Leak.value(realm, func);\n        return;\n      }\n      throw e;\n    }\n\n    // Check if effects were pure then add them\n    if (abstractArrayValue.nestedOptimizedFunctionEffects === undefined) {\n      abstractArrayValue.nestedOptimizedFunctionEffects = new Map();\n    }\n    abstractArrayValue.nestedOptimizedFunctionEffects.set(funcToModel, effects);\n    realm.collectedNestedOptimizedFunctionEffects.set(funcToModel, effects);\n  }\n}\n\n/*\n  We track aliases explicitly, because we currently do not have the primitives to model objects created\ninside of the loop. TODO: Revisit when #2543 and subsequent modeling work\nlands. At that point, instead of of a mayAliasSet, we can return a widened\nabstract value.\n*/\nfunction modelUnknownPropertyOfSpecializedArray(\n  realm: Realm,\n  args: Array<Value>,\n  array: ArrayValue,\n  possibleNestedOptimizedFunctions: ?PossibleNestedOptimizedFunctions\n): PropertyBinding {\n  let sentinelProperty = {\n    key: undefined,\n    descriptor: new PropertyDescriptor({\n      writable: true,\n      enumerable: true,\n      configurable: true,\n    }),\n    object: array,\n  };\n\n  let mayAliasedObjects: Set<ObjectValue> = new Set();\n\n  if (realm.arrayNestedOptimizedFunctionsEnabled && possibleNestedOptimizedFunctions) {\n    invariant(possibleNestedOptimizedFunctions.length > 0);\n    if (possibleNestedOptimizedFunctions[0].kind === \"map\") {\n      for (let { func } of possibleNestedOptimizedFunctions) {\n        let funcToModel;\n        if (func instanceof BoundFunctionValue) {\n          funcToModel = func.$BoundTargetFunction;\n        } else {\n          funcToModel = func;\n        }\n        invariant(funcToModel instanceof ECMAScriptSourceFunctionValue);\n        if (array.nestedOptimizedFunctionEffects !== undefined) {\n          let effects = array.nestedOptimizedFunctionEffects.get(funcToModel);\n          if (effects !== undefined) {\n            invariant(effects.result instanceof SimpleNormalCompletion);\n            let objectsTrackedForLeaks = realm.createdObjectsTrackedForLeaks;\n            let filterValues = o =>\n              !(o instanceof ObjectValue) ||\n              (!effects.createdObjects.has(o) &&\n                (objectsTrackedForLeaks === undefined || objectsTrackedForLeaks.has(o)));\n            let [reachableObjects, reachableBindings] = Reachability.computeReachableObjectsAndBindings(\n              realm,\n              effects.result.value,\n              filterValues,\n              true /* readOnly */\n            );\n            invariant(reachableBindings !== undefined);\n            for (let reachableObject of reachableObjects) {\n              mayAliasedObjects.add(reachableObject);\n            }\n          }\n        }\n      }\n    }\n    // For filter, we just collect the may alias set of the mapped array\n    if (args.length > 0) {\n      let mappedArray = args[0];\n      if (ArrayValue.isIntrinsicAndHasWidenedNumericProperty(mappedArray)) {\n        invariant(mappedArray instanceof ArrayValue);\n        invariant(mappedArray.unknownProperty !== undefined);\n        invariant(mappedArray.unknownProperty.descriptor instanceof PropertyDescriptor);\n\n        let unknownPropertyValue = mappedArray.unknownProperty.descriptor.value;\n        invariant(unknownPropertyValue instanceof AbstractValue);\n\n        let aliasSet = unknownPropertyValue.args[0];\n        invariant(aliasSet instanceof AbstractValue && aliasSet.kind === \"mayAliasSet\");\n        for (let aliasedObject of aliasSet.args) {\n          invariant(aliasedObject instanceof ObjectValue);\n          mayAliasedObjects.add(aliasedObject);\n        }\n      }\n    }\n  }\n\n  let aliasSet = AbstractValue.createFromType(realm, Value, \"mayAliasSet\", [...mayAliasedObjects]);\n  sentinelProperty.descriptor.value = AbstractValue.createFromType(realm, Value, \"widened numeric property\", [\n    aliasSet,\n  ]);\n\n  return sentinelProperty;\n}\n\nfunction createArrayWithWidenedNumericProperty(\n  realm: Realm,\n  args: Array<Value>,\n  intrinsicName: string,\n  possibleNestedOptimizedFunctions?: PossibleNestedOptimizedFunctions\n): ArrayValue {\n  let abstractArrayValue = new ArrayValue(realm, intrinsicName);\n\n  if (\n    realm.arrayNestedOptimizedFunctionsEnabled &&\n    (!realm.react.enabled || realm.react.optimizeNestedFunctions) &&\n    possibleNestedOptimizedFunctions !== undefined\n  ) {\n    if (possibleNestedOptimizedFunctions.length > 0) {\n      evaluatePossibleNestedOptimizedFunctionsAndStoreEffects(\n        realm,\n        abstractArrayValue,\n        possibleNestedOptimizedFunctions\n      );\n    } else {\n      // If nested optimized functions are disabled, we need to fallback to\n      // the default behaviour and leaked the nested functions so any bindings\n      // within the function properly leak and materialize.\n      for (let { func } of possibleNestedOptimizedFunctions) {\n        Leak.value(realm, func);\n      }\n    }\n  }\n  // Add unknownProperty so we manually handle this object property access\n  abstractArrayValue.unknownProperty = modelUnknownPropertyOfSpecializedArray(\n    realm,\n    args,\n    abstractArrayValue,\n    possibleNestedOptimizedFunctions\n  );\n  return abstractArrayValue;\n}\n\nexport default class ArrayValue extends ObjectValue {\n  constructor(realm: Realm, intrinsicName?: string) {\n    super(realm, realm.intrinsics.ArrayPrototype, intrinsicName);\n  }\n  nestedOptimizedFunctionEffects: void | Map<ECMAScriptSourceFunctionValue, Effects>;\n\n  getKind(): ObjectKind {\n    return \"Array\";\n  }\n\n  isSimpleObject(): boolean {\n    return this.$TypedArrayName === undefined;\n  }\n\n  // ECMA262 9.4.2.1\n  $DefineOwnProperty(P: PropertyKeyValue, Desc: Descriptor): boolean {\n    let A = this;\n\n    // 1. Assert: IsPropertyKey(P) is true.\n    invariant(IsPropertyKey(this.$Realm, P), \"expected a property key\");\n\n    // 2. If P is \"length\", then\n    if (P === \"length\" || (P instanceof StringValue && P.value === \"length\")) {\n      // a. Return ? ArraySetLength(A, Desc).\n      return Properties.ArraySetLength(this.$Realm, A, Desc);\n    } else if (IsArrayIndex(this.$Realm, P)) {\n      if (ArrayValue.isIntrinsicAndHasWidenedNumericProperty(this)) {\n        // The length of an array with widenend numeric properties is always abstract\n        let succeeded = Properties.OrdinaryDefineOwnProperty(this.$Realm, A, P, Desc);\n        if (succeeded === false) return false;\n        return true;\n      }\n      // 3. Else if P is an array index, then\n\n      // a. Let oldLenDesc be OrdinaryGetOwnProperty(A, \"length\").\n      let oldLenDesc = Properties.OrdinaryGetOwnProperty(this.$Realm, A, \"length\");\n\n      // b. Assert: oldLenDesc will never be undefined or an accessor descriptor because Array objects are\n      //    created with a length data property that cannot be deleted or reconfigured.\n      invariant(\n        oldLenDesc !== undefined && !IsAccessorDescriptor(this.$Realm, oldLenDesc),\n        \"cannot be undefined or an accessor descriptor\"\n      );\n      Properties.ThrowIfMightHaveBeenDeleted(oldLenDesc);\n      oldLenDesc = oldLenDesc.throwIfNotConcrete(this.$Realm);\n\n      // c. Let oldLen be oldLenDesc.[[Value]].\n      let oldLen = oldLenDesc.value;\n      invariant(oldLen instanceof Value);\n      oldLen = oldLen.throwIfNotConcrete();\n      invariant(oldLen instanceof NumberValue, \"expected number value\");\n      oldLen = oldLen.value;\n\n      // d. Let index be ! ToUint32(P).\n      let index = To.ToUint32(this.$Realm, typeof P === \"string\" ? new StringValue(this.$Realm, P) : P);\n\n      // e. If index ≥ oldLen and oldLenDesc.[[Writable]] is false, return false.\n      if (index >= oldLen && oldLenDesc.writable === false) return false;\n\n      // f. Let succeeded be ! OrdinaryDefineOwnProperty(A, P, Desc).\n      let succeeded = Properties.OrdinaryDefineOwnProperty(this.$Realm, A, P, Desc);\n\n      // g. If succeeded is false, return false.\n      if (succeeded === false) return false;\n\n      // h. If index ≥ oldLen, then\n      if (index >= oldLen) {\n        // i. Set oldLenDesc.[[Value]] to index + 1.\n        oldLenDesc.value = new NumberValue(this.$Realm, index + 1);\n\n        // ii. Let succeeded be OrdinaryDefineOwnProperty(A, \"length\", oldLenDesc).\n        succeeded = Properties.OrdinaryDefineOwnProperty(this.$Realm, A, \"length\", oldLenDesc);\n\n        // iii. Assert: succeeded is true.\n        invariant(succeeded, \"expected length definition to succeed\");\n      }\n\n      // i. Return true.\n      return true;\n    }\n\n    // 1. Return OrdinaryDefineOwnProperty(A, P, Desc).\n    return Properties.OrdinaryDefineOwnProperty(this.$Realm, A, P, Desc);\n  }\n\n  static createTemporalWithWidenedNumericProperty(\n    realm: Realm,\n    args: Array<Value>,\n    operationDescriptor: OperationDescriptor,\n    possibleNestedOptimizedFunctions?: PossibleNestedOptimizedFunctions\n  ): ArrayValue {\n    invariant(realm.generator !== undefined);\n\n    let value = realm.generator.deriveConcreteObject(\n      intrinsicName =>\n        createArrayWithWidenedNumericProperty(realm, args, intrinsicName, possibleNestedOptimizedFunctions),\n      args,\n      operationDescriptor,\n      { isPure: true }\n    );\n    invariant(value instanceof ArrayValue);\n    return value;\n  }\n\n  static isIntrinsicAndHasWidenedNumericProperty(obj: Value): boolean {\n    if (obj instanceof ArrayValue && obj.intrinsicName !== undefined && obj.isScopedTemplate !== undefined) {\n      invariant(ObjectValue.isIntrinsicDerivedObject(obj));\n      const prop = obj.unknownProperty;\n      if (prop !== undefined && prop.descriptor !== undefined) {\n        const desc = prop.descriptor.throwIfNotConcrete(obj.$Realm);\n        return desc.value instanceof AbstractValue && desc.value.kind === \"widened numeric property\";\n      }\n    }\n    return false;\n  }\n}\n"
  },
  {
    "path": "src/values/BooleanValue.js",
    "content": "/**\n * Copyright (c) 2017-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n/* @flow strict-local */\n\nimport { PrimitiveValue, Value } from \"./index.js\";\nimport type { Realm } from \"../realm.js\";\n\nexport default class BooleanValue extends PrimitiveValue {\n  constructor(realm: Realm, value: boolean, intrinsicName?: string) {\n    super(realm, intrinsicName);\n    this.value = value;\n\n    if (value && realm.intrinsics.true) return realm.intrinsics.true;\n    if (!value && realm.intrinsics.false) return realm.intrinsics.false;\n  }\n\n  value: boolean;\n\n  equals(x: Value): boolean {\n    return x instanceof BooleanValue && this.value === x.value;\n  }\n\n  getHash(): number {\n    return this.value ? 12484058682847432 : 3777063795205331;\n  }\n\n  mightBeFalse(): boolean {\n    return !this.value;\n  }\n\n  throwIfNotConcreteBoolean(): BooleanValue {\n    return this;\n  }\n\n  _serialize(): boolean {\n    return this.value;\n  }\n\n  toDisplayString(): string {\n    return this.value.toString();\n  }\n}\n"
  },
  {
    "path": "src/values/BoundFunctionValue.js",
    "content": "/**\n * Copyright (c) 2017-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n/* @flow strict-local */\n\nimport type { Realm } from \"../realm.js\";\nimport { Value, FunctionValue, ObjectValue } from \"./index.js\";\nimport invariant from \"../invariant.js\";\n\n/* Bound Function Exotic Objects */\nexport default class BoundFunctionValue extends FunctionValue {\n  constructor(realm: Realm, intrinsicName?: string) {\n    super(realm, intrinsicName);\n  }\n\n  $BoundTargetFunction: ObjectValue;\n  $BoundThis: Value;\n  $BoundArguments: Array<Value>;\n\n  // Override.\n  getName(): string {\n    return \"Bound\";\n  }\n\n  hasDefaultLength(): boolean {\n    let f = this.$BoundTargetFunction;\n    if (!(f instanceof FunctionValue) || !f.hasDefaultLength()) return false;\n    let fl = f.getLength();\n    invariant(fl !== undefined);\n    return this.getLength() === Math.max(fl - this.$BoundArguments.length, 0);\n  }\n}\n"
  },
  {
    "path": "src/values/ConcreteValue.js",
    "content": "/**\n * Copyright (c) 2017-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n/* @flow strict-local */\n\nimport type { Realm } from \"../realm.js\";\nimport {\n  EmptyValue,\n  NullValue,\n  NumberValue,\n  ObjectValue,\n  PrimitiveValue,\n  StringValue,\n  BooleanValue,\n  SymbolValue,\n  UndefinedValue,\n  Value,\n} from \"./index.js\";\nimport invariant from \"../invariant.js\";\n\nexport default class ConcreteValue extends Value {\n  constructor(realm: Realm, intrinsicName?: string) {\n    invariant(realm, \"realm required\");\n    super(realm, intrinsicName);\n  }\n\n  isTemporal(): boolean {\n    return false;\n  }\n  mightNotBeFalse(): boolean {\n    return !this.mightBeFalse();\n  }\n\n  mightBeNull(): boolean {\n    return this instanceof NullValue;\n  }\n\n  mightNotBeNull(): boolean {\n    return !(this instanceof NullValue);\n  }\n\n  mightBeNumber(): boolean {\n    return this instanceof NumberValue;\n  }\n\n  mightNotBeNumber(): boolean {\n    return !(this instanceof NumberValue);\n  }\n\n  mightNotBeObject(): boolean {\n    return !(this instanceof ObjectValue);\n  }\n\n  mightBeObject(): boolean {\n    return this instanceof ObjectValue;\n  }\n\n  mightBeString(): boolean {\n    return this instanceof StringValue;\n  }\n\n  mightNotBeString(): boolean {\n    return !(this instanceof StringValue);\n  }\n\n  mightBeUndefined(): boolean {\n    return this instanceof UndefinedValue;\n  }\n\n  mightNotBeUndefined(): boolean {\n    return !(this instanceof UndefinedValue);\n  }\n\n  mightHaveBeenDeleted(): boolean {\n    return this instanceof EmptyValue;\n  }\n\n  promoteEmptyToUndefined(): Value {\n    if (this instanceof EmptyValue) return this.$Realm.intrinsics.undefined;\n    return this;\n  }\n\n  throwIfNotConcrete(): ConcreteValue {\n    return this;\n  }\n\n  throwIfNotConcreteNumber(): NumberValue {\n    invariant(false, \"expected this to be a number if concrete\");\n  }\n\n  throwIfNotConcreteString(): StringValue {\n    invariant(false, \"expected this to be a string if concrete\");\n  }\n\n  throwIfNotConcreteBoolean(): BooleanValue {\n    invariant(false, \"expected this to be a boolean if concrete\");\n  }\n\n  throwIfNotConcreteSymbol(): SymbolValue {\n    invariant(false, \"expected this to be a symbol if concrete\");\n  }\n\n  throwIfNotConcreteObject(): ObjectValue {\n    return this.throwIfNotObject();\n  }\n\n  throwIfNotConcretePrimitive(): PrimitiveValue {\n    invariant(false, \"expected this to be a primitive value if concrete\");\n  }\n\n  throwIfNotObject(): ObjectValue {\n    invariant(false, \"expected this to be an object if concrete\");\n  }\n}\n"
  },
  {
    "path": "src/values/ECMAScriptFunctionValue.js",
    "content": "/**\n * Copyright (c) 2017-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n/* @flow strict-local */\n\nimport type { Realm } from \"../realm.js\";\nimport type { ObjectValue } from \"./index.js\";\nimport { FunctionValue, Value } from \"./index.js\";\nimport type { BabelNodeSourceLocation } from \"@babel/types\";\n\n/* Abstract base class for non-exotic function objects(either with source or built-in) */\nexport default class ECMAScriptFunctionValue extends FunctionValue {\n  constructor(realm: Realm, intrinsicName?: string) {\n    super(realm, intrinsicName);\n    this.isCalledInMultipleContexts = false;\n  }\n\n  $ConstructorKind: \"base\" | \"derived\";\n  $ThisMode: \"lexical\" | \"strict\" | \"global\";\n  $HomeObject: void | ObjectValue;\n  $FunctionKind: \"normal\" | \"classConstructor\" | \"generator\";\n  activeArguments: void | Map<BabelNodeSourceLocation, [number, Array<Value>]>;\n  isSelfRecursive: boolean;\n  isCalledInMultipleContexts: boolean;\n}\n"
  },
  {
    "path": "src/values/ECMAScriptSourceFunctionValue.js",
    "content": "/**\n * Copyright (c) 2017-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n/* @flow */\n\nimport type { Realm } from \"../realm.js\";\nimport type { BabelNodeBlockStatement, BabelNodeSourceLocation, BabelNodeLVal } from \"@babel/types\";\nimport type { FunctionBodyAstNode } from \"../types.js\";\nimport { ECMAScriptFunctionValue } from \"./index.js\";\nimport * as t from \"@babel/types\";\nimport invariant from \"../invariant.js\";\n\n/* Non built-in ECMAScript function objects with source code */\nexport default class ECMAScriptSourceFunctionValue extends ECMAScriptFunctionValue {\n  constructor(realm: Realm, intrinsicName?: string) {\n    super(realm, intrinsicName);\n  }\n\n  $Strict: boolean;\n  $FormalParameters: Array<BabelNodeLVal>;\n  $ECMAScriptCode: BabelNodeBlockStatement;\n  $HasComputedName: ?boolean;\n  $HasEmptyConstructor: ?boolean;\n  loc: ?BabelNodeSourceLocation;\n\n  initialize(params: Array<BabelNodeLVal>, body: BabelNodeBlockStatement) {\n    let node = ((body: any): FunctionBodyAstNode);\n    this.getHash();\n    // Record the sequence number, reflecting when this function was initialized for the first time\n    if (node.uniqueOrderedTag === undefined) node.uniqueOrderedTag = this.$Realm.functionBodyUniqueTagSeed++;\n    this.$ECMAScriptCode = body;\n    this.$FormalParameters = params;\n  }\n\n  // Override.\n  getName(): string {\n    const uniqueTag = ((this.$ECMAScriptCode: any): FunctionBodyAstNode).uniqueOrderedTag;\n    // Should only be called after the function is initialized.\n    invariant(uniqueTag);\n    return this.__originalName ? this.__originalName : `function#${uniqueTag}`;\n  }\n\n  hasDefaultLength(): boolean {\n    let params = this.$FormalParameters;\n    let expected = params.length;\n    for (let i = 0; i < params.length; i++) {\n      let param = params[i];\n      if (t.isAssignmentPattern(param) || t.isRestElement(param)) {\n        expected = i;\n        break;\n      }\n    }\n    return expected === this.getLength();\n  }\n}\n"
  },
  {
    "path": "src/values/EmptyValue.js",
    "content": "/**\n * Copyright (c) 2017-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n/* @flow strict-local */\n\nimport { UndefinedValue, Value } from \"./index.js\";\n\nexport default class EmptyValue extends UndefinedValue {\n  getHash(): number {\n    return 4523845144584502;\n  }\n\n  equals(x: Value): boolean {\n    return x instanceof EmptyValue;\n  }\n}\n"
  },
  {
    "path": "src/values/FunctionValue.js",
    "content": "/**\n * Copyright (c) 2017-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n/* @flow */\n\nimport type { PathConditions, ObjectKind } from \"../types.js\";\nimport type { LexicalEnvironment } from \"../environment.js\";\nimport type { Realm } from \"../realm.js\";\nimport { ObjectValue, NumberValue } from \"./index.js\";\nimport invariant from \"../invariant.js\";\n\n/* Abstract base class for all function objects */\nexport default class FunctionValue extends ObjectValue {\n  constructor(realm: Realm, intrinsicName?: string) {\n    super(realm, realm.intrinsics.FunctionPrototype, intrinsicName);\n  }\n\n  pathConditionDuringDeclaration: PathConditions | void;\n  $Environment: LexicalEnvironment;\n  $InnerEnvironment: LexicalEnvironment;\n  $ScriptOrModule: any;\n\n  // Indicates whether this function has been referenced by a __residual call.\n  // If true, the serializer will check that the function does not access any\n  // identifiers defined outside of the local scope.\n  isResidual: void | true;\n\n  // Allows for residual function with inference of parameters\n  isUnsafeResidual: void | true;\n\n  getName(): string {\n    throw new Error(\"Abstract method\");\n  }\n\n  getKind(): ObjectKind {\n    return \"Function\";\n  }\n\n  getLength(): void | number {\n    let binding = this.properties.get(\"length\");\n    invariant(binding);\n    let desc = binding.descriptor;\n    invariant(desc);\n    let value = desc.throwIfNotConcrete(this.$Realm).value;\n    if (!(value instanceof NumberValue)) return undefined;\n    return value.value;\n  }\n\n  hasDefaultLength(): boolean {\n    invariant(false, \"abstract method; please override\");\n  }\n\n  getDebugName(): string {\n    return super.getDebugName() || this.getName();\n  }\n}\n"
  },
  {
    "path": "src/values/IntegerIndexedExotic.js",
    "content": "/**\n * Copyright (c) 2017-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n/* @flow strict-local */\n\nimport type { Realm } from \"../realm.js\";\nimport type { PropertyKeyValue, Descriptor } from \"../types.js\";\nimport { ObjectValue, NumberValue, StringValue, Value, UndefinedValue } from \"./index.js\";\nimport { IsInteger, IsArrayIndex, IsAccessorDescriptor, IsDetachedBuffer, IsPropertyKey } from \"../methods/is.js\";\nimport { OrdinaryGet } from \"../methods/get.js\";\nimport { OrdinaryHasProperty } from \"../methods/has.js\";\nimport { IntegerIndexedElementSet, IntegerIndexedElementGet } from \"../methods/typedarray.js\";\nimport { Properties, To } from \"../singletons.js\";\nimport invariant from \"../invariant.js\";\nimport { PropertyDescriptor } from \"../descriptors.js\";\n\nexport default class IntegerIndexedExotic extends ObjectValue {\n  constructor(realm: Realm, intrinsicName?: string) {\n    super(realm, realm.intrinsics.ObjectPrototype, intrinsicName);\n  }\n\n  // ECMA262 9.4.5.1\n  $GetOwnProperty(P: PropertyKeyValue): Descriptor | void {\n    let O = this;\n\n    // 1. Assert: IsPropertyKey(P) is true.\n    invariant(IsPropertyKey(this.$Realm, P), \"IsPropertyKey(P) is true\");\n\n    // 2. Assert: O is an Object that has a [[ViewedArrayBuffer]] internal slot.\n    invariant(O instanceof ObjectValue && O.$ViewedArrayBuffer);\n\n    // 3. If Type(P) is String, then\n    if (typeof P === \"string\" || P instanceof StringValue) {\n      // a. Let numericIndex be ! CanonicalNumericIndexString(P).\n      let numericIndex = To.CanonicalNumericIndexString(\n        this.$Realm,\n        typeof P === \"string\" ? new StringValue(this.$Realm, P) : P\n      );\n\n      // b. If numericIndex is not undefined, then\n      if (numericIndex !== undefined) {\n        // i. Let value be ? IntegerIndexedElementGet(O, numericIndex).\n        let value = IntegerIndexedElementGet(this.$Realm, O, numericIndex);\n\n        // ii. If value is undefined, return undefined.\n        if (value instanceof UndefinedValue) return undefined;\n\n        // iii. Return a PropertyDescriptor{[[Value]]: value, [[Writable]]: true, [[Enumerable]]: true, [[Configurable]]: false}.\n        return new PropertyDescriptor({\n          value: value,\n          writable: true,\n          enumerable: true,\n          configurable: false,\n        });\n      }\n    }\n    // 4. Return OrdinaryGetOwnProperty(O, P).\n    return Properties.OrdinaryGetOwnProperty(this.$Realm, O, P);\n  }\n\n  // ECMA262 9.4.5.2\n  $HasProperty(P: PropertyKeyValue): boolean {\n    let O = this;\n\n    // 1. Assert: IsPropertyKey(P) is true.\n    invariant(IsPropertyKey(this.$Realm, P), \"IsPropertyKey(P) is true\");\n\n    // 2. Assert: O is an Object that has a [[ViewedArrayBuffer]] internal slot.\n    invariant(O instanceof ObjectValue && O.$ViewedArrayBuffer);\n\n    // 3. If Type(P) is String, then\n    if (typeof P === \"string\" || P instanceof StringValue) {\n      // a. Let numericIndex be ! CanonicalNumericIndexString(P).\n      let numericIndex = To.CanonicalNumericIndexString(\n        this.$Realm,\n        typeof P === \"string\" ? new StringValue(this.$Realm, P) : P\n      );\n\n      // b. If numericIndex is not undefined, then\n      if (numericIndex !== undefined) {\n        // i. Let buffer be O.[[ViewedArrayBuffer]].\n        let buffer = O.$ViewedArrayBuffer;\n        invariant(buffer);\n\n        // ii. If IsDetachedBuffer(buffer) is true, throw a TypeError exception.\n        if (IsDetachedBuffer(this.$Realm, buffer) === true) {\n          throw this.$Realm.createErrorThrowCompletion(\n            this.$Realm.intrinsics.TypeError,\n            \"IsDetachedBuffer(buffer) is true\"\n          );\n        }\n\n        // iii. If IsInteger(numericIndex) is false, return false.\n        if (IsInteger(this.$Realm, numericIndex) === false) return false;\n\n        // iv. If numericIndex = -0, return false.\n        if (Object.is(numericIndex, -0)) return false;\n\n        // v. If numericIndex < 0, return false.\n        if (numericIndex < 0) return false;\n\n        // vi. If numericIndex ≥ O.[[ArrayLength]], return false.\n        invariant(O.$ArrayLength !== undefined);\n        if (numericIndex >= O.$ArrayLength) return false;\n\n        // vii. Return true.\n        return true;\n      }\n    }\n\n    // 4. Return ? OrdinaryHasProperty(O, P).\n    return OrdinaryHasProperty(this.$Realm, O, P);\n  }\n\n  // ECMA262 9.4.5.3\n  $DefineOwnProperty(P: PropertyKeyValue, _Desc: Descriptor): boolean {\n    let O = this;\n\n    // 1. Assert: IsPropertyKey(P) is true.\n    invariant(IsPropertyKey(this.$Realm, P), \"IsPropertyKey(P) is true\");\n\n    // 2. Assert: O is an Object that has a [[ViewedArrayBuffer]] internal slot.\n    invariant(O instanceof ObjectValue && this.$ViewedArrayBuffer);\n\n    // 3. If Type(P) is String, then\n    if (typeof P === \"string\" || P instanceof StringValue) {\n      // a. Let numericIndex be ! CanonicalNumericIndexString(P).\n      let numericIndex = To.CanonicalNumericIndexString(\n        this.$Realm,\n        typeof P === \"string\" ? new StringValue(this.$Realm, P) : P\n      );\n\n      // b. If numericIndex is not undefined, then\n      if (numericIndex !== undefined) {\n        // i. If IsInteger(numericIndex) is false, return false.\n        if (IsInteger(this.$Realm, numericIndex) === false) return false;\n\n        // ii. If numericIndex = -0, return false.\n        if (Object.is(numericIndex, -0)) return false;\n\n        // iii. If numericIndex < 0, return false.\n        if (numericIndex < 0) return false;\n\n        // iv. Let length be O.[[ArrayLength]].\n        let length = this.$ArrayLength;\n        invariant(typeof length === \"number\");\n\n        // v. If numericIndex ≥ length, return false.\n        if (numericIndex >= length) return false;\n\n        let Desc = _Desc.throwIfNotConcrete(this.$Realm);\n\n        // vi. If IsAccessorDescriptor(Desc) is true, return false.\n        if (IsAccessorDescriptor(this.$Realm, Desc) === true) return false;\n\n        // vii. If Desc has a [[Configurable]] field and if Desc.[[Configurable]] is true, return false.\n        if (Desc.configurable === true) return false;\n\n        // viii. If Desc has an [[Enumerable]] field and if Desc.[[Enumerable]] is false, return false.\n        if (Desc.enumerable === false) return false;\n\n        // ix. If Desc has a [[Writable]] field and if Desc.[[Writable]] is false, return false.\n        if (Desc.writable === false) return false;\n\n        // x. If Desc has a [[Value]] field, then\n        if (Desc.value) {\n          // 1. Let value be Desc.[[Value]].\n          let value = Desc.value;\n          invariant(value === undefined || value instanceof Value);\n\n          // 2. Return ? IntegerIndexedElementSet(O, numericIndex, value).\n          return IntegerIndexedElementSet(this.$Realm, O, numericIndex, value);\n        }\n\n        // xi. Return true.\n        return true;\n      }\n    }\n\n    // 4. Return ! OrdinaryDefineOwnProperty(O, P, Desc).\n    return Properties.OrdinaryDefineOwnProperty(this.$Realm, O, P, _Desc);\n  }\n\n  // ECMA262 9.4.5.4\n  $Get(P: PropertyKeyValue, Receiver: Value): Value {\n    let O = this;\n\n    // 1. Assert: IsPropertyKey(P) is true.\n    invariant(IsPropertyKey(this.$Realm, P), \"IsPropertyKey(P) is true\");\n\n    // 2. If Type(P) is String, then\n    if (typeof P === \"string\" || P instanceof StringValue) {\n      // a. Let numericIndex be ! CanonicalNumericIndexString(P).\n      let numericIndex = To.CanonicalNumericIndexString(\n        this.$Realm,\n        typeof P === \"string\" ? new StringValue(this.$Realm, P) : P\n      );\n\n      // b. If numericIndex is not undefined, then\n      if (numericIndex !== undefined) {\n        // i. Return ? IntegerIndexedElementGet(O, numericIndex).\n        return IntegerIndexedElementGet(this.$Realm, O, numericIndex);\n      }\n    }\n\n    // 3. Return ? OrdinaryGet(O, P, Receiver).\n    return OrdinaryGet(this.$Realm, O, P, Receiver);\n  }\n\n  // ECMA262 9.4.5.5\n  $Set(P: PropertyKeyValue, V: Value, Receiver: Value): boolean {\n    let O = this;\n\n    // 1. Assert: IsPropertyKey(P) is true.\n    invariant(IsPropertyKey(this.$Realm, P), \"IsPropertyKey(P) is true\");\n\n    // 2. If Type(P) is String, then\n    if (typeof P === \"string\" || P instanceof StringValue) {\n      // a. Let numericIndex be ! CanonicalNumericIndexString(P).\n      let numericIndex = To.CanonicalNumericIndexString(\n        this.$Realm,\n        typeof P === \"string\" ? new StringValue(this.$Realm, P) : P\n      );\n\n      // b. If numericIndex is not undefined, then\n      if (numericIndex !== undefined) {\n        // i. Return ? IntegerIndexedElementSet(O, numericIndex, V).\n        return IntegerIndexedElementSet(this.$Realm, O, numericIndex, V);\n      }\n    }\n\n    // 3. Return ? OrdinarySet(O, P, V, Receiver).\n    return Properties.OrdinarySet(this.$Realm, O, P, V, Receiver);\n  }\n\n  // ECMA262 9.4.5.6\n  $OwnPropertyKeys(): Array<PropertyKeyValue> {\n    let O = this;\n\n    // 1. Let keys be a new empty List.\n    let keys = [];\n\n    // 2. Assert: O is an Object that has [[ViewedArrayBuffer]], [[ArrayLength]], [[ByteOffset]], and [[TypedArrayName]] internal slots.\n    invariant(\n      O instanceof ObjectValue &&\n        O.$ViewedArrayBuffer &&\n        O.$ArrayLength !== undefined &&\n        O.$ByteOffset !== undefined &&\n        O.$TypedArrayName\n    );\n\n    // 3. Let len be O.[[ArrayLength]].\n    let len = O.$ArrayLength;\n    invariant(typeof len === \"number\");\n\n    // 4. For each integer i starting with 0 such that i < len, in ascending order,\n    for (let i = 0; i < len; ++i) {\n      // a. Add ! ToString(i) as the last element of keys.\n      keys.push(new StringValue(this.$Realm, To.ToString(this.$Realm, new NumberValue(this.$Realm, i))));\n    }\n\n    let realm = this.$Realm;\n    // 5. For each own property key P of O such that Type(P) is String and P is not an integer index, in ascending chronological order of property creation\n    let properties = Properties.GetOwnPropertyKeysArray(realm, O, false, false);\n    for (let key of properties.filter(x => !IsArrayIndex(realm, x))) {\n      // i. Add P as the last element of keys.\n      keys.push(new StringValue(realm, key));\n    }\n\n    // 6. For each own property key P of O such that Type(P) is Symbol, in ascending chronological order of property creation\n    for (let key of O.symbols.keys()) {\n      // a. Add P as the last element of keys.\n      keys.push(key);\n    }\n\n    // 7. Return keys.\n    return keys;\n  }\n}\n"
  },
  {
    "path": "src/values/NativeFunctionValue.js",
    "content": "/**\n * Copyright (c) 2017-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n/* @flow strict-local */\n\nimport type { Value } from \"./index.js\";\nimport type { Realm } from \"../realm.js\";\nimport { SymbolValue } from \"./index.js\";\nimport {\n  NumberValue,\n  StringValue,\n  ECMAScriptFunctionValue,\n  ObjectValue,\n  NullValue,\n  ProxyValue,\n  UndefinedValue,\n  AbstractObjectValue,\n} from \"./index.js\";\nimport type { PromiseCapability } from \"../types.js\";\nimport { ReturnCompletion } from \"../completions.js\";\nimport { Functions } from \"../singletons.js\";\nimport { PropertyDescriptor } from \"../descriptors.js\";\nexport type NativeFunctionCallback = (\n  context: UndefinedValue | NullValue | ObjectValue | AbstractObjectValue,\n  args: Array<Value>,\n  argLength: number,\n  newTarget?: void | ObjectValue\n) => Value;\n\n/* Built-in Function Objects */\nexport default class NativeFunctionValue extends ECMAScriptFunctionValue {\n  constructor(\n    realm: Realm,\n    intrinsicName: void | string,\n    name: void | string | SymbolValue,\n    length: number,\n    callback: NativeFunctionCallback,\n    constructor?: boolean = true\n  ) {\n    super(realm, intrinsicName);\n\n    this.$ThisMode = \"strict\";\n    this.$HomeObject = undefined;\n    this.$FunctionKind = \"normal\";\n\n    this.$Call = (thisArgument, argsList) => {\n      return Functions.$Call(this.$Realm, this, thisArgument, argsList);\n    };\n\n    if (constructor) {\n      this.$ConstructorKind = \"base\";\n      this.$Construct = (argumentsList, newTarget) => {\n        return Functions.$Construct(this.$Realm, this, argumentsList, newTarget);\n      };\n    }\n\n    this.$Environment = realm.$GlobalEnv;\n\n    this.callback = callback;\n    this.length = length;\n\n    this.$DefineOwnProperty(\n      \"length\",\n      new PropertyDescriptor({\n        value: new NumberValue(realm, length),\n        writable: false,\n        configurable: true,\n        enumerable: false,\n      })\n    );\n\n    if (name !== undefined && name !== \"\") {\n      if (name instanceof SymbolValue) {\n        this.name = name.$Description ? `[${name.$Description.throwIfNotConcreteString().value}]` : \"[native]\";\n      } else {\n        this.name = name;\n      }\n      this.$DefineOwnProperty(\n        \"name\",\n        new PropertyDescriptor({\n          value: new StringValue(realm, this.name),\n          writable: false,\n          configurable: true,\n          enumerable: false,\n        })\n      );\n    } else {\n      this.name = \"native\";\n    }\n  }\n\n  static trackedPropertyNames = ObjectValue.trackedPropertyNames.concat(\"$RevocableProxy\");\n\n  getTrackedPropertyNames(): Array<string> {\n    return NativeFunctionValue.trackedPropertyNames;\n  }\n\n  hasDefaultLength(): boolean {\n    return this.getLength() === this.length;\n  }\n\n  name: string;\n  callback: NativeFunctionCallback;\n  length: number;\n\n  // Override.\n  getName(): string {\n    return this.name;\n  }\n\n  callCallback(\n    context: UndefinedValue | NullValue | ObjectValue | AbstractObjectValue,\n    originalArgsList: Array<Value>,\n    newTarget?: void | ObjectValue\n  ): ReturnCompletion {\n    let originalLength = originalArgsList.length;\n    let argsList = originalArgsList.slice();\n    for (let i = 0; i < this.length; i++) {\n      argsList[i] = originalArgsList[i] || this.$Realm.intrinsics.undefined;\n    }\n    return new ReturnCompletion(\n      this.callback(context, argsList, originalLength, newTarget),\n      this.$Realm.currentLocation\n    );\n  }\n\n  // for Proxy\n  $RevocableProxy: void | NullValue | ProxyValue;\n\n  // for Promise resolve/reject functions\n  $Promise: ?ObjectValue;\n  $AlreadyResolved: void | { value: boolean };\n\n  // for Promise resolve functions\n  $Capability: void | PromiseCapability;\n  $AlreadyCalled: void | { value: boolean };\n  $Index: void | number;\n  $Values: void | Array<Value>;\n  $Capabilities: void | PromiseCapability;\n  $RemainingElements: void | { value: number };\n}\n"
  },
  {
    "path": "src/values/NullValue.js",
    "content": "/**\n * Copyright (c) 2017-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n/* @flow strict-local */\n\nimport { PrimitiveValue, Value } from \"./index.js\";\n\nexport default class NullValue extends PrimitiveValue {\n  _serialize(): null {\n    return null;\n  }\n\n  equals(x: Value): boolean {\n    return x instanceof NullValue;\n  }\n\n  getHash(): number {\n    return 5613143836447527;\n  }\n\n  mightBeFalse(): boolean {\n    return true;\n  }\n\n  toDisplayString(): string {\n    return \"null\";\n  }\n}\n"
  },
  {
    "path": "src/values/NumberValue.js",
    "content": "/**\n * Copyright (c) 2017-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n/* @flow strict-local */\n\nimport { PrimitiveValue, Value } from \"./index.js\";\nimport type { Realm } from \"../realm.js\";\n\nexport class NumberValue extends PrimitiveValue {\n  constructor(realm: Realm, value: number, intrinsicName?: string) {\n    super(realm, intrinsicName);\n\n    this.value = value;\n  }\n\n  value: number;\n\n  equals(x: Value): boolean {\n    return x instanceof NumberValue && Object.is(this.value, x.value);\n  }\n\n  getHash(): number {\n    let num = Math.abs(this.value);\n    if (num < 100) num *= 10000000;\n    return num | 0; // make a 32-bit integer out of this and get rid of NaN\n  }\n\n  mightBeFalse(): boolean {\n    return this.value === 0 || isNaN(this.value);\n  }\n\n  throwIfNotConcreteNumber(): NumberValue {\n    return this;\n  }\n\n  _serialize(): number {\n    return this.value;\n  }\n\n  toDisplayString(): string {\n    return this.value.toString();\n  }\n}\n\nexport class IntegralValue extends NumberValue {\n  constructor(realm: Realm, value: number, intrinsicName?: string) {\n    super(realm, value, intrinsicName);\n  }\n\n  static createFromNumberValue(realm: Realm, value: number, intrinsicName?: string): IntegralValue | NumberValue {\n    return Number.isInteger(value)\n      ? new IntegralValue(realm, value, intrinsicName)\n      : new NumberValue(realm, value, intrinsicName);\n  }\n}\n"
  },
  {
    "path": "src/values/ObjectValue.js",
    "content": "/**\n * Copyright (c) 2017-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n/* @flow */\n\nimport type { Realm, ExecutionContext } from \"../realm.js\";\nimport { ValuesDomain } from \"../domains/index.js\";\nimport { FatalError } from \"../errors.js\";\nimport type {\n  DataBlock,\n  IterationKind,\n  ObjectKind,\n  PromiseReaction,\n  PropertyBinding,\n  PropertyKeyValue,\n  TypedArrayKind,\n} from \"../types.js\";\nimport {\n  AbstractObjectValue,\n  AbstractValue,\n  BooleanValue,\n  ConcreteValue,\n  NativeFunctionValue,\n  NullValue,\n  NumberValue,\n  StringValue,\n  SymbolValue,\n  UndefinedValue,\n  Value,\n} from \"./index.js\";\nimport { isReactElement } from \"../react/utils.js\";\nimport { ECMAScriptSourceFunctionValue, type NativeFunctionCallback } from \"./index.js\";\nimport {\n  Get,\n  IsDataDescriptor,\n  OrdinaryOwnPropertyKeys,\n  OrdinaryGet,\n  OrdinaryGetPartial,\n  OrdinaryHasProperty,\n  OrdinaryIsExtensible,\n  OrdinaryPreventExtensions,\n} from \"../methods/index.js\";\nimport { Properties } from \"../singletons.js\";\nimport invariant from \"../invariant.js\";\nimport type { typeAnnotation } from \"@babel/types\";\nimport { createOperationDescriptor } from \"../utils/generator.js\";\nimport { Descriptor, PropertyDescriptor, type DescriptorInitializer, InternalSlotDescriptor } from \"../descriptors.js\";\n\nexport default class ObjectValue extends ConcreteValue {\n  constructor(\n    realm: Realm,\n    proto?: ObjectValue | NullValue,\n    intrinsicName?: string,\n    refuseSerialization: boolean = false\n  ) {\n    super(realm, intrinsicName);\n    realm.recordNewObject(this);\n    if (realm.useAbstractInterpretation) this.setupBindings(this.getTrackedPropertyNames());\n    this.$Prototype = proto || realm.intrinsics.null;\n    this.$Extensible = realm.intrinsics.true;\n    this._isPartial = realm.intrinsics.false;\n    this._isLeaked = realm.intrinsics.false;\n    this._isSimple = realm.intrinsics.false;\n    this._simplicityIsTransitive = realm.intrinsics.false;\n    this._isFinal = realm.intrinsics.false;\n    this.properties = new Map();\n    this.symbols = new Map();\n    this.refuseSerialization = refuseSerialization;\n\n    // this.$IsClassPrototype should be the last thing that gets initialized,\n    // as other code checks whether this.$IsClassPrototype === undefined\n    // as a proxy for whether initialization is still ongoing.\n    this.$IsClassPrototype = false;\n  }\n\n  static trackedPropertyNames = [\n    \"_isPartial\",\n    \"_isLeaked\",\n    \"_isSimple\",\n    \"_isFinal\",\n    \"_simplicityIsTransitive\",\n    \"_temporalAlias\",\n    \"$ArrayIteratorNextIndex\",\n    \"$DateValue\",\n    \"$Extensible\",\n    \"$IteratedList\",\n    \"$IteratedObject\",\n    \"$IteratedSet\",\n    \"$IteratedString\",\n    \"$Map\",\n    \"$MapData\",\n    \"$MapNextIndex\",\n    \"$Prototype\",\n    \"$SetData\",\n    \"$SetNextIndex\",\n    \"$StringIteratorNextIndex\",\n    \"$WeakMapData\",\n    \"$WeakSetData\",\n  ];\n  static trackedPropertyBindingNames = new Map();\n\n  getTrackedPropertyNames(): Array<string> {\n    return ObjectValue.trackedPropertyNames;\n  }\n\n  setupBindings(propertyNames: Array<string>): void {\n    for (let propName of propertyNames) {\n      let propBindingName = ObjectValue.trackedPropertyBindingNames.get(propName);\n      invariant(propBindingName !== undefined);\n      (this: any)[propBindingName] = undefined;\n    }\n  }\n\n  static setupTrackedPropertyAccessors(propertyNames: Array<string>): void {\n    for (let propName of propertyNames) {\n      let propBindingName = ObjectValue.trackedPropertyBindingNames.get(propName);\n      if (propBindingName === undefined)\n        ObjectValue.trackedPropertyBindingNames.set(propName, (propBindingName = propName + \"_binding\"));\n      Object.defineProperty(ObjectValue.prototype, propName, {\n        configurable: true,\n        get: function() {\n          let binding = this[propBindingName];\n          invariant(binding === undefined || binding.descriptor instanceof InternalSlotDescriptor);\n          return binding === undefined ? undefined : binding.descriptor.value;\n        },\n        set: function(v) {\n          // Let's make sure that the object is not leaked.\n          // To that end, we'd like to call this.isLeakedObject().\n          // However, while the object is still being initialized,\n          // properties may be set, but this.isLeakedObject() may not be called yet.\n          // To check if we are still initializing, guard the call by looking at\n          // whether this.$IsClassPrototype has been initialized as a proxy for\n          // object initialization in general.\n          invariant(\n            // We're still initializing so we can set a property.\n            this.$IsClassPrototype === undefined ||\n              // It's not leaked so we can set a property.\n              this.mightNotBeLeakedObject() ||\n              // Object.assign() implementation needs to temporarily\n              // make potentially leaked objects non-partial and back.\n              // We don't gain anything from checking whether it's leaked\n              // before calling makePartial() so we'll whitelist this property.\n              propBindingName === \"_isPartial_binding\",\n            \"cannot mutate a leaked object\"\n          );\n          let binding = this[propBindingName];\n          if (binding === undefined) {\n            let desc = new InternalSlotDescriptor(undefined);\n            this[propBindingName] = binding = {\n              descriptor: desc,\n              object: this,\n              key: propName,\n              internalSlot: true,\n            };\n          }\n          this.$Realm.recordModifiedProperty(binding);\n          binding.descriptor.value = v;\n        },\n      });\n    }\n  }\n\n  $Prototype: ObjectValue | AbstractObjectValue | NullValue;\n  $Extensible: BooleanValue | AbstractValue;\n\n  $ParameterMap: void | ObjectValue; // undefined when the property is \"missing\"\n  $SymbolData: void | SymbolValue | AbstractValue;\n  $StringData: void | StringValue | AbstractValue;\n  $NumberData: void | NumberValue | AbstractValue;\n  $BooleanData: void | BooleanValue | AbstractValue;\n\n  // error\n  $ErrorData: void | {\n    // undefined when the property is \"missing\"\n    contextStack: Array<ExecutionContext>,\n    locationData: void | {\n      filename: string,\n      sourceCode: string,\n      loc: { line: number, column: number },\n      stackDecorated: boolean,\n    },\n  };\n\n  // function\n  $Call: void | ((thisArgument: Value, argumentsList: Array<Value>) => Value);\n  $Construct: void | ((argumentsList: Array<Value>, newTarget: ObjectValue) => ObjectValue | AbstractObjectValue);\n\n  // promise\n  $PromiseState: void | \"pending\" | \"fulfilled\" | \"rejected\";\n  $PromiseResult: void | Value;\n  $PromiseFulfillReactions: void | Array<PromiseReaction>;\n  $PromiseRejectReactions: void | Array<PromiseReaction>;\n  $PromiseIsHandled: void | boolean;\n\n  // iterator\n  $IteratedList: void | Array<Value>;\n  $ListIteratorNextIndex: void | number;\n  $IteratorNext: void | NativeFunctionValue;\n\n  // set\n  $SetIterationKind: void | IterationKind;\n  $SetNextIndex: void | number;\n  $IteratedSet: void | ObjectValue | UndefinedValue;\n  $SetData: void | Array<void | Value>;\n\n  // react\n  $SuperTypeParameters: void | typeAnnotation;\n\n  // map\n  $MapIterationKind: void | IterationKind;\n  $MapNextIndex: void | NumberValue;\n  $MapData: void | Array<{ $Key: void | Value, $Value: void | Value }>;\n  $Map: void | ObjectValue | UndefinedValue;\n\n  // weak map\n  $WeakMapData: void | Array<{ $Key: void | Value, $Value: void | Value }>;\n\n  // weak set\n  $WeakSetData: void | Array<void | Value>;\n\n  // date\n  $DateValue: void | NumberValue | AbstractValue; // of type number\n\n  // array\n  $ArrayIterationKind: void | IterationKind;\n  $ArrayIteratorNextIndex: void | NumberValue;\n  $IteratedObject: void | UndefinedValue | ObjectValue;\n\n  // regex\n  $OriginalSource: void | string;\n  $OriginalFlags: void | string;\n  $RegExpMatcher: void | ((S: string, lastIndex: number) => ?{ endIndex: number, captures: Array<any> });\n\n  // string\n  $StringIteratorNextIndex: void | number;\n  $IteratedString: void | StringValue;\n\n  // data view\n  $DataView: void | true;\n  $ViewedArrayBuffer: void | ObjectValue;\n  $ByteLength: void | number;\n  $ByteOffset: void | number;\n\n  // array buffer\n  $ArrayBufferData: void | null | DataBlock;\n  $ArrayBufferByteLength: void | number;\n\n  // generator\n  $GeneratorState: void | \"suspendedStart\" | \"executing\";\n  $GeneratorContext: void | ExecutionContext;\n\n  // typed array\n  $TypedArrayName: void | TypedArrayKind;\n  $ViewedArrayBuffer: void | ObjectValue;\n  $ArrayLength: void | number;\n\n  // backpointer to the constructor if this object was created its prototype object\n  originalConstructor: void | ECMAScriptSourceFunctionValue;\n\n  // partial objects\n  _isPartial: AbstractValue | BooleanValue;\n\n  // tainted objects\n  _isLeaked: AbstractValue | BooleanValue;\n\n  // If true, the object has no property getters or setters and it is safe\n  // to return AbstractValue for unknown properties.\n  _isSimple: AbstractValue | BooleanValue;\n\n  // If true, it is not safe to perform any more mutations that would change\n  // the object's serialized form.\n  _isFinal: AbstractValue | BooleanValue;\n\n  // Specifies whether the object is a template that needs to be created in a scope\n  // If set, this happened during object initialization and the value is never changed again, so not tracked.\n  isScopedTemplate: void | true;\n\n  // If true, then unknown properties should return transitively simple abstract object values\n  _simplicityIsTransitive: AbstractValue | BooleanValue;\n\n  // The abstract object for which this object is the template.\n  // Use this instead of the object itself when deriving temporal values for object properties.\n  _templateFor: void | AbstractObjectValue;\n\n  properties: Map<string, PropertyBinding>;\n  symbols: Map<SymbolValue, PropertyBinding>;\n  unknownProperty: void | PropertyBinding;\n  _temporalAlias: void | AbstractObjectValue;\n\n  // An object value with an intrinsic name can either exist from the beginning of time,\n  // or it can be associated with a particular point in time by being used as a template\n  // when deriving an abstract value via a generator.\n  intrinsicNameGenerated: void | true;\n  hashValue: void | number;\n\n  // ReactElement\n  $BailOutReason: void | string;\n\n  // ES2015 classes\n  $IsClassPrototype: boolean;\n\n  // We track some internal state as properties on the global object, these should\n  // never be serialized.\n  refuseSerialization: boolean;\n\n  // Checks whether effects are properly applied.\n  isValid(): boolean {\n    return this._isPartial !== undefined;\n  }\n\n  equals(x: Value): boolean {\n    return this === x;\n  }\n\n  getHash(): number {\n    if (!this.hashValue) {\n      this.hashValue = ++this.$Realm.objectCount;\n    }\n    return this.hashValue;\n  }\n\n  get temporalAlias(): void | AbstractObjectValue {\n    return this._temporalAlias;\n  }\n\n  set temporalAlias(value: AbstractObjectValue) {\n    this._temporalAlias = value;\n  }\n\n  hasStringOrSymbolProperties(): boolean {\n    for (let prop of this.properties.values()) {\n      if (prop.descriptor === undefined) continue;\n      return true;\n    }\n    for (let prop of this.symbols.values()) {\n      if (prop.descriptor === undefined) continue;\n      return true;\n    }\n    return false;\n  }\n\n  mightBeFalse(): boolean {\n    return false;\n  }\n\n  mightNotBeObject(): boolean {\n    return false;\n  }\n\n  throwIfNotObject(): ObjectValue {\n    return this;\n  }\n\n  makePartial(): void {\n    this._isPartial = this.$Realm.intrinsics.true;\n  }\n\n  makeSimple(option?: string | Value): void {\n    this._isSimple = this.$Realm.intrinsics.true;\n    this._simplicityIsTransitive = new BooleanValue(\n      this.$Realm,\n      option === \"transitive\" || (option instanceof StringValue && option.value === \"transitive\")\n    );\n  }\n\n  makeFinal(): void {\n    this._isFinal = this.$Realm.intrinsics.true;\n  }\n\n  makeNotFinal(): void {\n    this._isFinal = this.$Realm.intrinsics.false;\n  }\n\n  isPartialObject(): boolean {\n    return this._isPartial.mightBeTrue();\n  }\n\n  // When this object was created in an evaluateForEffects context and the effects have not been applied, the\n  // value is not valid (and we shouldn't try to access any properties on it). isPartial should always be set\n  // except when reverted by effects.\n  isValid(): boolean {\n    return this._isPartial !== undefined;\n  }\n\n  mightBeFinalObject(): boolean {\n    return this._isFinal.mightBeTrue();\n  }\n\n  mightNotBeFinalObject(): boolean {\n    return this._isFinal.mightNotBeTrue();\n  }\n\n  leak(): void {\n    this._isLeaked = this.$Realm.intrinsics.true;\n  }\n\n  mightBeLeakedObject(): boolean {\n    return this._isLeaked.mightBeTrue();\n  }\n\n  mightNotBeLeakedObject(): boolean {\n    return this._isLeaked.mightNotBeTrue();\n  }\n\n  isSimpleObject(): boolean {\n    if (this === this.$Realm.intrinsics.ObjectPrototype) return true;\n    if (!this._isSimple.mightNotBeTrue()) return true;\n    if (this.isPartialObject()) return false;\n    if (this.symbols.size > 0) return false;\n    for (let propertyBinding of this.properties.values()) {\n      let desc = propertyBinding.descriptor;\n      if (desc === undefined) continue; // deleted\n      if (!IsDataDescriptor(this.$Realm, desc)) return false;\n      if (!desc.writable) return false;\n    }\n    if (this.$Prototype instanceof NullValue) return true;\n    invariant(this.$Prototype);\n    return this.$Prototype.isSimpleObject();\n  }\n\n  isTransitivelySimple(): boolean {\n    return !this._simplicityIsTransitive.mightNotBeTrue();\n  }\n\n  getExtensible(): boolean {\n    return this.$Extensible.throwIfNotConcreteBoolean().value;\n  }\n\n  setExtensible(v: boolean) {\n    this.$Extensible = v ? this.$Realm.intrinsics.true : this.$Realm.intrinsics.false;\n  }\n\n  getKind(): ObjectKind {\n    // we can deduce the natural prototype by checking whether the following internal slots are present\n    if (this.$SymbolData !== undefined) return \"Symbol\";\n    if (this.$StringData !== undefined) return \"String\";\n    if (this.$NumberData !== undefined) return \"Number\";\n    if (this.$BooleanData !== undefined) return \"Boolean\";\n    if (this.$DateValue !== undefined) return \"Date\";\n    if (this.$RegExpMatcher !== undefined) return \"RegExp\";\n    if (this.$SetData !== undefined) return \"Set\";\n    if (this.$MapData !== undefined) return \"Map\";\n    if (this.$DataView !== undefined) return \"DataView\";\n    if (this.$ArrayBufferData !== undefined) return \"ArrayBuffer\";\n    if (this.$WeakMapData !== undefined) return \"WeakMap\";\n    if (this.$WeakSetData !== undefined) return \"WeakSet\";\n    if (isReactElement(this) && this.$Realm.react.enabled) return \"ReactElement\";\n    if (this.$TypedArrayName !== undefined) return this.$TypedArrayName;\n    // TODO #26 #712: Promises. All kinds of iterators. Generators.\n    return \"Object\";\n  }\n\n  defineNativeMethod(\n    name: SymbolValue | string,\n    length: number,\n    callback: NativeFunctionCallback,\n    desc?: DescriptorInitializer\n  ): Value {\n    let intrinsicName;\n    if (typeof name === \"string\") {\n      if (this.intrinsicName) intrinsicName = `${this.intrinsicName}.${name}`;\n    } else if (name instanceof SymbolValue) {\n      if (this.intrinsicName && name.intrinsicName) intrinsicName = `${this.intrinsicName}[${name.intrinsicName}]`;\n    } else {\n      invariant(false);\n    }\n    let fnValue = new NativeFunctionValue(this.$Realm, intrinsicName, name, length, callback, false);\n    this.defineNativeProperty(name, fnValue, desc);\n    return fnValue;\n  }\n\n  defineNativeProperty(name: SymbolValue | string, value?: Value | Array<Value>, desc?: DescriptorInitializer): void {\n    invariant(!value || value instanceof Value);\n    this.$DefineOwnProperty(\n      name,\n      new PropertyDescriptor({\n        value,\n        writable: true,\n        enumerable: false,\n        configurable: true,\n        ...desc,\n      })\n    );\n  }\n\n  defineNativeGetter(name: SymbolValue | string, callback: NativeFunctionCallback, desc?: DescriptorInitializer): void {\n    let intrinsicName, funcName;\n    if (typeof name === \"string\") {\n      funcName = `get ${name}`;\n      if (this.intrinsicName) intrinsicName = `${this.intrinsicName}.${name}`;\n    } else if (name instanceof SymbolValue) {\n      funcName =\n        name.$Description instanceof Value\n          ? `get [${name.$Description.throwIfNotConcreteString().value}]`\n          : `get [${\"?\"}]`;\n      if (this.intrinsicName && name.intrinsicName) intrinsicName = `${this.intrinsicName}[${name.intrinsicName}]`;\n    } else {\n      invariant(false);\n    }\n\n    let func = new NativeFunctionValue(this.$Realm, intrinsicName, funcName, 0, callback);\n    this.$DefineOwnProperty(\n      name,\n      new PropertyDescriptor({\n        get: func,\n        set: this.$Realm.intrinsics.undefined,\n        enumerable: false,\n        configurable: true,\n        ...desc,\n      })\n    );\n  }\n\n  defineNativeConstant(name: SymbolValue | string, value?: Value | Array<Value>, desc?: DescriptorInitializer): void {\n    invariant(!value || value instanceof Value);\n    this.$DefineOwnProperty(\n      name,\n      new PropertyDescriptor({\n        value,\n        writable: false,\n        enumerable: false,\n        configurable: false,\n        ...desc,\n      })\n    );\n  }\n\n  // Note that internal properties will not be copied to the snapshot, nor will they be removed.\n  getSnapshot(options?: { removeProperties: boolean }): AbstractObjectValue {\n    try {\n      if (this.temporalAlias !== undefined) return this.temporalAlias;\n      let realm = this.$Realm;\n      let template = new ObjectValue(this.$Realm, this.$Realm.intrinsics.ObjectPrototype);\n      let keys = Properties.GetOwnPropertyKeysArray(realm, this, false, true);\n      this.copyKeys(((keys: any): Array<PropertyKeyValue>), this, template);\n      // The snapshot is an immutable object snapshot\n      template.makeFinal();\n      // The original object might be a React props object, thus\n      // if it is, we need to ensure we mark it with the same rules\n      if (realm.react.enabled && realm.react.reactProps.has(this)) {\n        realm.react.reactProps.add(template);\n      }\n      let operationDescriptor = createOperationDescriptor(\"SINGLE_ARG\");\n      let result = AbstractValue.createTemporalFromBuildFunction(\n        this.$Realm,\n        ObjectValue,\n        [template],\n        operationDescriptor,\n        { skipInvariant: true, isPure: true }\n      );\n      invariant(result instanceof AbstractObjectValue);\n      result.values = new ValuesDomain(template);\n      return result;\n    } finally {\n      if (options && options.removeProperties) {\n        this.properties = new Map();\n        this.symbols = new Map();\n        this.unknownProperty = undefined;\n      }\n    }\n  }\n\n  copyKeys(keys: Array<PropertyKeyValue>, from: ObjectValue, to: ObjectValue): void {\n    // c. Repeat for each element nextKey of keys in List order,\n    for (let nextKey of keys) {\n      // i. Let desc be ? from.[[GetOwnProperty]](nextKey).\n      let desc = from.$GetOwnProperty(nextKey);\n\n      // ii. If desc is not undefined and desc.[[Enumerable]] is true, then\n      if (desc && desc.throwIfNotConcrete(this.$Realm).enumerable) {\n        Properties.ThrowIfMightHaveBeenDeleted(desc);\n\n        // 1. Let propValue be ? Get(from, nextKey).\n        let propValue = Get(this.$Realm, from, nextKey);\n\n        // 2. Perform ? Set(to, nextKey, propValue, true).\n        Properties.Set(this.$Realm, to, nextKey, propValue, true);\n      }\n    }\n  }\n\n  _serialize(set: Function, stack: Map<Value, any>): any {\n    let obj = set({});\n\n    for (let [key, propertyBinding] of this.properties) {\n      let desc = propertyBinding.descriptor;\n      if (desc === undefined) continue; // deleted\n      Properties.ThrowIfMightHaveBeenDeleted(desc);\n      desc = desc.throwIfNotConcrete(this.$Realm);\n      let serializedDesc: any = { enumerable: desc.enumerable, configurable: desc.configurable };\n      if (desc.value) {\n        serializedDesc.writable = desc.writable;\n        invariant(desc.value instanceof Value);\n        serializedDesc.value = desc.value.serialize(stack);\n      } else {\n        invariant(desc.get !== undefined);\n        serializedDesc.get = desc.get.serialize(stack);\n        invariant(desc.set !== undefined);\n        serializedDesc.set = desc.set.serialize(stack);\n      }\n      Object.defineProperty(obj, key, serializedDesc);\n    }\n    return obj;\n  }\n\n  // Whether [[{Get,Set}PrototypeOf]] delegate to Ordinary{Get,Set}PrototypeOf.\n  // E.g. ProxyValue overrides this to return false.\n  // See ECMA262 9.1.2.1 for an algorithm where this is relevant\n  usesOrdinaryObjectInternalPrototypeMethods(): boolean {\n    return true;\n  }\n\n  // ECMA262 9.1.1\n  $GetPrototypeOf(): ObjectValue | AbstractObjectValue | NullValue {\n    return this.$Prototype;\n  }\n\n  // ECMA262 9.1.2\n  $SetPrototypeOf(V: ObjectValue | NullValue): boolean {\n    // 1. Return ! OrdinarySetPrototypeOf(O, V).\n    return Properties.OrdinarySetPrototypeOf(this.$Realm, this, V);\n  }\n\n  // ECMA262 9.1.3\n  $IsExtensible(): boolean {\n    // 1. Return ! OrdinaryIsExtensible(O).\n    return OrdinaryIsExtensible(this.$Realm, this);\n  }\n\n  // ECMA262 9.1.4\n  $PreventExtensions(): boolean {\n    // 1. Return ! OrdinaryPreventExtensions(O).\n    return OrdinaryPreventExtensions(this.$Realm, this);\n  }\n\n  // ECMA262 9.1.5\n  $GetOwnProperty(P: PropertyKeyValue): Descriptor | void {\n    // 1. Return ! OrdinaryGetOwnProperty(O, P).\n    return Properties.OrdinaryGetOwnProperty(this.$Realm, this, P);\n  }\n\n  // ECMA262 9.1.6\n  $DefineOwnProperty(P: PropertyKeyValue, Desc: Descriptor): boolean {\n    // 1. Return ? OrdinaryDefineOwnProperty(O, P, Desc).\n    return Properties.OrdinaryDefineOwnProperty(this.$Realm, this, P, Desc);\n  }\n\n  // ECMA262 9.1.7\n  $HasProperty(P: PropertyKeyValue): boolean {\n    if (this.unknownProperty !== undefined && this.$GetOwnProperty(P) === undefined) {\n      AbstractValue.reportIntrospectionError(this, P);\n      throw new FatalError();\n    }\n\n    return OrdinaryHasProperty(this.$Realm, this, P);\n  }\n\n  // ECMA262 9.1.8\n  $Get(P: PropertyKeyValue, Receiver: Value): Value {\n    // 1. Return ? OrdinaryGet(O, P, Receiver).\n    return OrdinaryGet(this.$Realm, this, P, Receiver);\n  }\n\n  _SafeGetDataPropertyValue(P: PropertyKeyValue): Value {\n    let savedInvariantLevel = this.$Realm.invariantLevel;\n    try {\n      this.$Realm.invariantLevel = 0;\n      let desc = this.$GetOwnProperty(P);\n      if (desc === undefined) {\n        return this.$Realm.intrinsics.undefined;\n      }\n      desc = desc.throwIfNotConcrete(this.$Realm);\n      return desc.value ? desc.value : this.$Realm.intrinsics.undefined;\n    } finally {\n      this.$Realm.invariantLevel = savedInvariantLevel;\n    }\n  }\n\n  $GetPartial(P: AbstractValue | PropertyKeyValue, Receiver: Value): Value {\n    return OrdinaryGetPartial(this.$Realm, this, P, Receiver);\n  }\n\n  // ECMA262 9.1.9\n  $Set(P: PropertyKeyValue, V: Value, Receiver: Value): boolean {\n    // 1. Return ? OrdinarySet(O, P, V, Receiver).\n    return Properties.OrdinarySet(this.$Realm, this, P, V, Receiver);\n  }\n\n  $SetPartial(P: AbstractValue | PropertyKeyValue, V: Value, Receiver: Value): boolean {\n    return Properties.OrdinarySetPartial(this.$Realm, this, P, V, Receiver);\n  }\n\n  // ECMA262 9.1.10\n  $Delete(P: PropertyKeyValue): boolean {\n    if (this.unknownProperty !== undefined) {\n      // TODO #946: generate a delete from the object\n      AbstractValue.reportIntrospectionError(this, P);\n      throw new FatalError();\n    }\n\n    // 1. Return ? OrdinaryDelete(O, P).\n    return Properties.OrdinaryDelete(this.$Realm, this, P);\n  }\n\n  // ECMA262 9.1.11\n  $OwnPropertyKeys(getOwnPropertyKeysEvenIfPartial?: boolean = false): Array<PropertyKeyValue> {\n    return OrdinaryOwnPropertyKeys(this.$Realm, this, getOwnPropertyKeysEvenIfPartial);\n  }\n\n  static refuseSerializationOnPropertyBinding(pb: PropertyBinding): boolean {\n    if (pb.object.refuseSerialization) return true;\n    if (pb.internalSlot && typeof pb.key === \"string\" && pb.key[0] === \"_\") return true;\n    return false;\n  }\n\n  static isIntrinsicDerivedObject(obj: Value): boolean {\n    return obj instanceof ObjectValue && obj.intrinsicName !== undefined && obj.isScopedTemplate !== undefined;\n  }\n}\n"
  },
  {
    "path": "src/values/PrimitiveValue.js",
    "content": "/**\n * Copyright (c) 2017-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n/* @flow strict-local */\n\nimport type { Realm } from \"../realm.js\";\nimport { ConcreteValue } from \"./index.js\";\nimport invariant from \"../invariant.js\";\n\nexport default class PrimitiveValue extends ConcreteValue {\n  constructor(realm: Realm, intrinsicName?: string) {\n    invariant(realm, \"realm required\");\n    super(realm, intrinsicName);\n  }\n\n  throwIfNotConcretePrimitive(): PrimitiveValue {\n    return this;\n  }\n\n  toDisplayString(): string {\n    invariant(false, \"abstract method; please override\");\n  }\n}\n"
  },
  {
    "path": "src/values/ProxyValue.js",
    "content": "/**\n * Copyright (c) 2017-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n/* @flow */\n\nimport { Realm } from \"../realm.js\";\nimport {\n  Value,\n  AbstractObjectValue,\n  SymbolValue,\n  NullValue,\n  ObjectValue,\n  UndefinedValue,\n  StringValue,\n} from \"./index.js\";\nimport type { Descriptor, PropertyKeyValue } from \"../types.js\";\nimport invariant from \"../invariant.js\";\nimport { SameValuePartial, SamePropertyKey } from \"../methods/abstract.js\";\nimport { GetMethod } from \"../methods/get.js\";\nimport { IsExtensible, IsPropertyKey, IsDataDescriptor, IsAccessorDescriptor } from \"../methods/is.js\";\nimport { Create, Properties, To } from \"../singletons.js\";\nimport { Call } from \"../methods/call.js\";\n\nfunction FindPropertyKey(realm: Realm, keys: Array<PropertyKeyValue>, key: PropertyKeyValue): number {\n  for (let i = 0; i < keys.length; ++i) {\n    if (SamePropertyKey(realm, key, keys[i])) {\n      return i;\n    }\n  }\n  return -1;\n}\n\nexport default class ProxyValue extends ObjectValue {\n  $ProxyTarget: NullValue | ObjectValue;\n  $ProxyHandler: NullValue | ObjectValue;\n\n  constructor(realm: Realm) {\n    super(realm);\n  }\n\n  static trackedPropertyNames = ObjectValue.trackedPropertyNames.concat([\"$ProxyTarget\", \"$ProxyHandler\"]);\n\n  getTrackedPropertyNames(): Array<string> {\n    return ProxyValue.trackedPropertyNames;\n  }\n\n  isSimpleObject(): boolean {\n    return false;\n  }\n\n  usesOrdinaryObjectInternalPrototypeMethods(): boolean {\n    return false;\n  }\n\n  // ECMA262 9.5.1\n  $GetPrototypeOf(): NullValue | AbstractObjectValue | ObjectValue {\n    let realm = this.$Realm;\n\n    // 1. Let handler be the value of the [[ProxyHandler]] internal slot of O.\n    let handler = this.$ProxyHandler;\n\n    // 2. If handler is null, throw a TypeError exception.\n    if (handler instanceof NullValue) {\n      throw realm.createErrorThrowCompletion(realm.intrinsics.TypeError);\n    }\n\n    // 3. Assert: Type(handler) is Object.\n    invariant(handler instanceof ObjectValue, \"expected an object\");\n\n    // 4. Let target be the value of the [[ProxyTarget]] internal slot of O.\n    let target = this.$ProxyTarget;\n    invariant(target instanceof ObjectValue);\n\n    // 5. Let trap be ? GetMethod(handler, \"getPrototypeOf\").\n    let trap = GetMethod(realm, handler, \"getPrototypeOf\");\n\n    // 6. If trap is undefined, then\n    if (trap instanceof UndefinedValue) {\n      // a. Return ? target.[[GetPrototypeOf]]().\n      return target.$GetPrototypeOf();\n    }\n\n    // 7. Let handlerProto be ? Call(trap, handler, « target »).\n    let handlerProto = Call(realm, trap, handler, [target]);\n\n    // 8. If Type(handlerProto) is neither Object nor Null, throw a TypeError exception.\n    if (!(handlerProto instanceof ObjectValue) && !(handlerProto instanceof NullValue)) {\n      throw realm.createErrorThrowCompletion(realm.intrinsics.TypeError);\n    }\n\n    // 9. Let extensibleTarget be ? IsExtensible(target).\n    let extensibleTarget = IsExtensible(realm, target);\n\n    // 10. If extensibleTarget is true, return handlerProto.\n    if (extensibleTarget) return handlerProto;\n\n    // 11. Let targetProto be ? target.[[GetPrototypeOf]]().\n    let targetProto = target.$GetPrototypeOf();\n\n    // 12. If SameValue(handlerProto, targetProto) is false, throw a TypeError exception.\n    if (!SameValuePartial(realm, handlerProto, targetProto)) {\n      throw realm.createErrorThrowCompletion(realm.intrinsics.TypeError);\n    }\n\n    // 13. Return handlerProto.\n    return handlerProto;\n  }\n\n  // ECMA262 9.5.2\n  $SetPrototypeOf(V: ObjectValue | NullValue): boolean {\n    let realm = this.$Realm;\n\n    // 1. Assert: Either Type(V) is Object or Type(V) is Null.\n    invariant(V instanceof ObjectValue || V instanceof NullValue, \"expected object or null\");\n\n    // 2. Let handler be the value of the [[ProxyHandler]] internal slot of O.\n    let handler = this.$ProxyHandler;\n\n    // 3. If handler is null, throw a TypeError exception.\n    if (handler instanceof NullValue) {\n      throw realm.createErrorThrowCompletion(realm.intrinsics.TypeError);\n    }\n\n    // 4. Assert: Type(handler) is Object.\n    invariant(handler instanceof ObjectValue, \"expected object\");\n\n    // 5. Let target be the value of the [[ProxyTarget]] internal slot of O.\n    let target = this.$ProxyTarget;\n    invariant(target instanceof ObjectValue);\n\n    // 6. Let trap be ? GetMethod(handler, \"setPrototypeOf\").\n    let trap = GetMethod(realm, handler, \"setPrototypeOf\");\n\n    // 7. If trap is undefined, then\n    if (trap instanceof UndefinedValue) {\n      // a. Return ? target.[[SetPrototypeOf]](V).\n      return target.$SetPrototypeOf(V);\n    }\n\n    // 8. Let booleanTrapResult be ToBoolean(? Call(trap, handler, « target, V »)).\n    let booleanTrapResult = To.ToBooleanPartial(realm, Call(realm, trap, handler, [target, V]));\n\n    // 9. If booleanTrapResult is false, return false.\n    if (!booleanTrapResult) return false;\n\n    // 10. Let extensibleTarget be ? IsExtensible(target).\n    let extensibleTarget = IsExtensible(realm, target);\n\n    // 11. If extensibleTarget is true, return true.\n    if (extensibleTarget) return true;\n\n    // 12. Let targetProto be ? target.[[GetPrototypeOf]]().\n    let targetProto = target.$GetPrototypeOf();\n\n    // 13. If SameValue(V, targetProto) is false, throw a TypeError exception.\n    if (!SameValuePartial(realm, V, targetProto)) {\n      throw realm.createErrorThrowCompletion(realm.intrinsics.TypeError);\n    }\n\n    // 14. Return true.\n    return true;\n  }\n\n  // ECMA262 9.5.3\n  $IsExtensible(): boolean {\n    let realm = this.$Realm;\n\n    // 1. Let handler be the value of the [[ProxyHandler]] internal slot of O.\n    let handler = this.$ProxyHandler;\n\n    // 2. If handler is null, throw a TypeError exception.\n    if (handler instanceof NullValue) {\n      throw realm.createErrorThrowCompletion(realm.intrinsics.TypeError);\n    }\n\n    // 3. Assert: Type(handler) is Object.\n    invariant(handler instanceof ObjectValue, \"expected object\");\n\n    // 4. Let target be the value of the [[ProxyTarget]] internal slot of O.\n    let target = this.$ProxyTarget;\n\n    // 5. Let trap be ? GetMethod(handler, \"isExtensible\").\n    let trap = GetMethod(realm, handler, \"isExtensible\");\n\n    // 6. If trap is undefined, then\n    if (trap instanceof UndefinedValue) {\n      // a. Return ? target.[[IsExtensible]]().\n      invariant(target instanceof ObjectValue);\n      return target.$IsExtensible();\n    }\n\n    // 7. Let booleanTrapResult be ToBoolean(? Call(trap, handler, « target »)).\n    let booleanTrapResult = To.ToBooleanPartial(realm, Call(realm, trap, handler, [target]));\n\n    // 8. Let targetResult be ? target.[[IsExtensible]]().\n    invariant(target instanceof ObjectValue);\n    let targetResult = target.$IsExtensible();\n\n    // 9. If SameValue(booleanTrapResult, targetResult) is false, throw a TypeError exception.\n    if (booleanTrapResult !== targetResult) {\n      throw realm.createErrorThrowCompletion(realm.intrinsics.TypeError);\n    }\n\n    // 10. Return booleanTrapResult.\n    return booleanTrapResult;\n  }\n\n  // ECMA262 9.5.4\n  $PreventExtensions(): boolean {\n    let realm = this.$Realm;\n\n    // 1. Let handler be the value of the [[ProxyHandler]] internal slot of O.\n    let handler = this.$ProxyHandler;\n\n    // 2. If handler is null, throw a TypeError exception.\n    if (handler instanceof NullValue) {\n      throw realm.createErrorThrowCompletion(realm.intrinsics.TypeError);\n    }\n\n    // 3. Assert: Type(handler) is Object.\n    invariant(handler instanceof ObjectValue, \"expected object\");\n\n    // 4. Let target be the value of the [[ProxyTarget]] internal slot of O.\n    let target = this.$ProxyTarget;\n\n    // 5. Let trap be ? GetMethod(handler, \"preventExtensions\").\n    let trap = GetMethod(realm, handler, \"preventExtensions\");\n\n    // 6. If trap is undefined, then\n    if (trap instanceof UndefinedValue) {\n      // a. Return ? target.[[PreventExtensions]]().\n      invariant(target instanceof ObjectValue);\n      return target.$PreventExtensions();\n    }\n\n    // 7. Let booleanTrapResult be ToBoolean(? Call(trap, handler, « target »)).\n    let booleanTrapResult = To.ToBooleanPartial(realm, Call(realm, trap, handler, [target]));\n\n    // 8. If booleanTrapResult is true, then\n    if (booleanTrapResult) {\n      // a. Let targetIsExtensible be ? target.[[IsExtensible]]().\n      invariant(target instanceof ObjectValue);\n      let targetIsExtensible = target.$IsExtensible();\n\n      // b. If targetIsExtensible is true, throw a TypeError exception.\n      if (targetIsExtensible) {\n        throw realm.createErrorThrowCompletion(realm.intrinsics.TypeError);\n      }\n    }\n\n    // 9. Return booleanTrapResult.\n    return booleanTrapResult;\n  }\n\n  // ECMA262 9.5.5\n  $GetOwnProperty(P: PropertyKeyValue): Descriptor | void {\n    let realm = this.$Realm;\n\n    // 1. Assert: IsPropertyKey(P) is true.\n    invariant(IsPropertyKey(realm, P), \"expected property key\");\n\n    // 2. Let handler be the value of the [[ProxyHandler]] internal slot of O.\n    let handler = this.$ProxyHandler;\n\n    // 3. If handler is null, throw a TypeError exception.\n    if (handler instanceof NullValue) {\n      throw realm.createErrorThrowCompletion(realm.intrinsics.TypeError);\n    }\n\n    // 4. Assert: Type(handler) is Object.\n    invariant(handler instanceof ObjectValue, \"expected object\");\n\n    // 5. Let target be the value of the [[ProxyTarget]] internal slot of O.\n    let target = this.$ProxyTarget;\n    invariant(target instanceof ObjectValue);\n\n    // 6. Let trap be ? GetMethod(handler, \"getOwnPropertyDescriptor\").\n    let trap = GetMethod(realm, handler, \"getOwnPropertyDescriptor\");\n\n    // 7. If trap is undefined, then\n    if (trap instanceof UndefinedValue) {\n      // a. Return ? target.[[GetOwnProperty]](P).\n      return target.$GetOwnProperty(P);\n    }\n\n    // 8. Let trapResultObj be ? Call(trap, handler, « target, P »).\n    let trapResultObj = Call(realm, trap, handler, [target, typeof P === \"string\" ? new StringValue(realm, P) : P]);\n\n    // 9. If Type(trapResultObj) is neither Object nor Undefined, throw a TypeError exception.\n    if (!(trapResultObj instanceof ObjectValue) && !(trapResultObj instanceof UndefinedValue)) {\n      throw realm.createErrorThrowCompletion(realm.intrinsics.TypeError);\n    }\n\n    // 10. Let targetDesc be ? target.[[GetOwnProperty]](P).\n    let targetDesc = target.$GetOwnProperty(P);\n\n    // 11. If trapResultObj is undefined, then\n    if (trapResultObj instanceof UndefinedValue) {\n      // a. If targetDesc is undefined, return undefined.\n      if (!targetDesc) return undefined;\n      Properties.ThrowIfMightHaveBeenDeleted(targetDesc);\n      targetDesc = targetDesc.throwIfNotConcrete(realm);\n\n      // b. If targetDesc.[[Configurable]] is false, throw a TypeError exception.\n      if (!targetDesc.configurable) {\n        throw realm.createErrorThrowCompletion(realm.intrinsics.TypeError);\n      }\n\n      // c. Let extensibleTarget be ? IsExtensible(target).\n      let extensibleTarget = IsExtensible(realm, target);\n\n      // d. Assert: Type(extensibleTarget) is Boolean.\n      invariant(typeof extensibleTarget === \"boolean\", \"expected boolean\");\n\n      // e. If extensibleTarget is false, throw a TypeError exception.\n      if (!extensibleTarget) {\n        throw realm.createErrorThrowCompletion(realm.intrinsics.TypeError);\n      }\n\n      // f. Return undefined.\n      return undefined;\n    }\n\n    // 12. Let extensibleTarget be ? IsExtensible(target).\n    let extensibleTarget = IsExtensible(realm, target);\n\n    // 13. Let resultDesc be ? ToPropertyDescriptor(trapResultObj).\n    let resultDesc = To.ToPropertyDescriptor(realm, trapResultObj);\n\n    // 14. Call CompletePropertyDescriptor(resultDesc).\n    Properties.CompletePropertyDescriptor(realm, resultDesc);\n\n    // 15. Let valid be IsCompatiblePropertyDescriptor(extensibleTarget, resultDesc, targetDesc).\n    let valid = Properties.IsCompatiblePropertyDescriptor(realm, extensibleTarget, resultDesc, targetDesc);\n\n    // 16. If valid is false, throw a TypeError exception.\n    if (!valid) {\n      throw realm.createErrorThrowCompletion(realm.intrinsics.TypeError);\n    }\n\n    // 17. If resultDesc.[[Configurable]] is false, then\n    resultDesc = resultDesc.throwIfNotConcrete(realm);\n    if (!resultDesc.configurable) {\n      // a. If targetDesc is undefined or targetDesc.[[Configurable]] is true, then\n      if (!targetDesc || targetDesc.throwIfNotConcrete(realm).configurable) {\n        // i. Throw a TypeError exception.\n        throw realm.createErrorThrowCompletion(realm.intrinsics.TypeError);\n      }\n    }\n\n    // 18. Return resultDesc.\n    return resultDesc;\n  }\n\n  // ECMA262 9.5.6\n  $DefineOwnProperty(P: PropertyKeyValue, Desc: Descriptor): boolean {\n    let realm = this.$Realm;\n\n    // 1. Assert: IsPropertyKey(P) is true.\n    invariant(IsPropertyKey(realm, P), \"expected property key\");\n\n    // 2. Let handler be the value of the [[ProxyHandler]] internal slot of O.\n    let handler = this.$ProxyHandler;\n\n    // 3. If handler is null, throw a TypeError exception.\n    if (handler instanceof NullValue) {\n      throw realm.createErrorThrowCompletion(realm.intrinsics.TypeError);\n    }\n\n    // 4. Assert: Type(handler) is Object.\n    invariant(handler instanceof ObjectValue, \"expected object\");\n\n    // 5. Let target be the value of the [[ProxyTarget]] internal slot of O.\n    let target = this.$ProxyTarget;\n    invariant(target instanceof ObjectValue);\n\n    // 6. Let trap be ? GetMethod(handler, \"defineProperty\").\n    let trap = GetMethod(realm, handler, \"defineProperty\");\n\n    // 7. If trap is undefined, then\n    if (trap instanceof UndefinedValue) {\n      // a. Return ? target.[[DefineOwnProperty]](P, Desc).\n      return target.$DefineOwnProperty(P, Desc);\n    }\n\n    // 8. Let descObj be FromPropertyDescriptor(Desc).\n    let descObj = Properties.FromPropertyDescriptor(realm, Desc);\n\n    // 9. Let booleanTrapResult be ToBoolean(? Call(trap, handler, « target, P, descObj »)).\n    let booleanTrapResult = To.ToBooleanPartial(\n      realm,\n      Call(realm, trap, handler, [target, typeof P === \"string\" ? new StringValue(realm, P) : P, descObj])\n    );\n\n    // 10. If booleanTrapResult is false, return false.\n    if (!booleanTrapResult) return false;\n\n    // 11. Let targetDesc be ? target.[[GetOwnProperty]](P).\n    let targetDesc = target.$GetOwnProperty(P);\n\n    // 12. Let extensibleTarget be ? IsExtensible(target).\n    let extensibleTarget = IsExtensible(realm, target);\n\n    // 13. If Desc has a [[Configurable]] field and if Desc.[[Configurable]] is false, then\n    let settingConfigFalse;\n    if (Desc.throwIfNotConcrete(realm).configurable === false) {\n      // a. Let settingConfigFalse be true.\n      settingConfigFalse = true;\n    } else {\n      // 14. Else let settingConfigFalse be false.\n      settingConfigFalse = false;\n    }\n\n    // 15. If targetDesc is undefined, then\n    if (!targetDesc) {\n      // a. If extensibleTarget is false, throw a TypeError exception.\n      if (!extensibleTarget) {\n        throw realm.createErrorThrowCompletion(realm.intrinsics.TypeError);\n      }\n\n      // b. If settingConfigFalse is true, throw a TypeError exception.\n      if (settingConfigFalse) {\n        throw realm.createErrorThrowCompletion(realm.intrinsics.TypeError);\n      }\n    } else {\n      // 16. Else targetDesc is not undefined,\n      Properties.ThrowIfMightHaveBeenDeleted(targetDesc);\n\n      // a. If IsCompatiblePropertyDescriptor(extensibleTarget, Desc, targetDesc) is false, throw a TypeError exception.\n      if (!Properties.IsCompatiblePropertyDescriptor(realm, extensibleTarget, Desc, targetDesc)) {\n        throw realm.createErrorThrowCompletion(realm.intrinsics.TypeError);\n      }\n\n      // b. If settingConfigFalse is true and targetDesc.[[Configurable]] is true, throw a TypeError exception.\n      if (settingConfigFalse && targetDesc.throwIfNotConcrete(realm).configurable) {\n        throw realm.createErrorThrowCompletion(realm.intrinsics.TypeError);\n      }\n    }\n\n    // 17. Return true.\n    return true;\n  }\n\n  // ECMA262 9.5.7\n  $HasProperty(P: PropertyKeyValue): boolean {\n    let realm = this.$Realm;\n\n    // 1. Assert: IsPropertyKey(P) is true.\n    invariant(IsPropertyKey(realm, P), \"expected property key\");\n\n    // 2. Let handler be the value of the [[ProxyHandler]] internal slot of O.\n    let handler = this.$ProxyHandler;\n\n    // 3. If handler is null, throw a TypeError exception.\n    if (handler instanceof NullValue) {\n      throw realm.createErrorThrowCompletion(realm.intrinsics.TypeError);\n    }\n\n    // 4. Assert: Type(handler) is Object.\n    invariant(handler instanceof ObjectValue, \"expected object\");\n\n    // 5. Let target be the value of the [[ProxyTarget]] internal slot of O.\n    let target = this.$ProxyTarget;\n    invariant(target instanceof ObjectValue);\n\n    // 6. Let trap be ? GetMethod(handler, \"has\").\n    let trap = GetMethod(realm, handler, \"has\");\n\n    // 7. If trap is undefined, then\n    if (trap instanceof UndefinedValue) {\n      // a. Return ? target.[[HasProperty]](P).\n      return target.$HasProperty(P);\n    }\n\n    // 8. Let booleanTrapResult be ToBoolean(? Call(trap, handler, « target, P »)).\n    let booleanTrapResult = To.ToBooleanPartial(\n      realm,\n      Call(realm, trap, handler, [target, typeof P === \"string\" ? new StringValue(realm, P) : P])\n    );\n\n    // 9. If booleanTrapResult is false, then\n    if (!booleanTrapResult) {\n      // a. Let targetDesc be ? target.[[GetOwnProperty]](P).\n      let targetDesc = target.$GetOwnProperty(P);\n\n      // b. If targetDesc is not undefined, then\n      if (targetDesc) {\n        Properties.ThrowIfMightHaveBeenDeleted(targetDesc);\n        targetDesc = targetDesc.throwIfNotConcrete(realm);\n\n        // i. If targetDesc.[[Configurable]] is false, throw a TypeError exception.\n        if (!targetDesc.configurable) {\n          throw realm.createErrorThrowCompletion(realm.intrinsics.TypeError);\n        }\n\n        // ii. Let extensibleTarget be ? IsExtensible(target).\n        let extensibleTarget = IsExtensible(realm, target);\n\n        // iii. If extensibleTarget is false, throw a TypeError exception.\n        if (!extensibleTarget) {\n          throw realm.createErrorThrowCompletion(realm.intrinsics.TypeError);\n        }\n      }\n    }\n\n    // 10. Return booleanTrapResult.\n    return booleanTrapResult;\n  }\n\n  // ECMA262 9.5.8\n  $Get(P: PropertyKeyValue, Receiver: Value): Value {\n    let realm = this.$Realm;\n\n    // 1. Assert: IsPropertyKey(P) is true.\n    invariant(IsPropertyKey(realm, P), \"expected property key\");\n\n    // 2. Let handler be the value of the [[ProxyHandler]] internal slot of O.\n    let handler = this.$ProxyHandler;\n\n    // 3. If handler is null, throw a TypeError exception.\n    if (handler instanceof NullValue) {\n      throw realm.createErrorThrowCompletion(realm.intrinsics.TypeError);\n    }\n\n    // 4. Assert: Type(handler) is Object.\n    invariant(handler instanceof ObjectValue, \"expected object\");\n\n    // 5. Let target be the value of the [[ProxyTarget]] internal slot of O.\n    let target = this.$ProxyTarget;\n    invariant(target instanceof ObjectValue);\n\n    // 6. Let trap be ? GetMethod(handler, \"get\").\n    let trap = GetMethod(realm, handler, \"get\");\n\n    // 7. If trap is undefined, then\n    if (trap instanceof UndefinedValue) {\n      // a. Return ? target.[[Get]](P, Receiver).\n      return target.$Get(P, Receiver);\n    }\n\n    // 8. Let trapResult be ? Call(trap, handler, « target, P, Receiver »).\n    let trapResult = Call(realm, trap, handler, [\n      target,\n      typeof P === \"string\" ? new StringValue(realm, P) : P,\n      Receiver,\n    ]);\n\n    // 9. Let targetDesc be ? target.[[GetOwnProperty]](P).\n    let targetDesc = target.$GetOwnProperty(P);\n\n    // 10. If targetDesc is not undefined, then\n    if (targetDesc) {\n      Properties.ThrowIfMightHaveBeenDeleted(targetDesc);\n\n      // a. If IsDataDescriptor(targetDesc) is true and targetDesc.[[Configurable]] is false and targetDesc.[[Writable]] is false, then\n      if (IsDataDescriptor(realm, targetDesc) && targetDesc.configurable === false && targetDesc.writable === false) {\n        // i. If SameValue(trapResult, targetDesc.[[Value]]) is false, throw a TypeError exception.\n        let targetValue = targetDesc.value || realm.intrinsics.undefined;\n        invariant(targetValue instanceof Value);\n        if (!SameValuePartial(realm, trapResult, targetValue)) {\n          throw realm.createErrorThrowCompletion(realm.intrinsics.TypeError);\n        }\n      }\n\n      // b. If IsAccessorDescriptor(targetDesc) is true and targetDesc.[[Configurable]] is false and targetDesc.[[Get]] is undefined, then\n      if (\n        IsAccessorDescriptor(realm, targetDesc) &&\n        targetDesc.configurable === false &&\n        (!targetDesc.get || targetDesc.get instanceof UndefinedValue)\n      ) {\n        // i. If trapResult is not undefined, throw a TypeError exception.\n        if (!(trapResult instanceof UndefinedValue)) {\n          throw realm.createErrorThrowCompletion(realm.intrinsics.TypeError);\n        }\n      }\n    }\n\n    // 11. Return trapResult.\n    return trapResult;\n  }\n\n  // ECMA262 9.5.9\n  $Set(P: PropertyKeyValue, V: Value, Receiver: Value): boolean {\n    let realm = this.$Realm;\n\n    // 1. Assert: IsPropertyKey(P) is true.\n    invariant(IsPropertyKey(realm, P), \"expected property key\");\n\n    // 2. Let handler be the value of the [[ProxyHandler]] internal slot of O.\n    let handler = this.$ProxyHandler;\n\n    // 3. If handler is null, throw a TypeError exception.\n    if (handler instanceof NullValue) {\n      throw realm.createErrorThrowCompletion(realm.intrinsics.TypeError);\n    }\n\n    // 4. Assert: Type(handler) is Object.\n    invariant(handler instanceof ObjectValue, \"expected object\");\n\n    // 5. Let target be the value of the [[ProxyTarget]] internal slot of O.\n    let target = this.$ProxyTarget;\n\n    // 6. Let trap be ? GetMethod(handler, \"set\").\n    let trap = GetMethod(realm, handler, \"set\");\n\n    // 7. If trap is undefined, then\n    if (trap instanceof UndefinedValue) {\n      // a. Return ? target.[[Set]](P, V, Receiver).\n      invariant(target instanceof ObjectValue);\n      return target.$Set(P, V, Receiver);\n    }\n\n    // 8. Let booleanTrapResult be ToBoolean(? Call(trap, handler, « target, P, V, Receiver »)).\n    let booleanTrapResult = To.ToBooleanPartial(\n      realm,\n      Call(realm, trap, handler, [target, typeof P === \"string\" ? new StringValue(realm, P) : P, V, Receiver])\n    );\n\n    // 9. If booleanTrapResult is false, return false.\n    if (!booleanTrapResult) return false;\n\n    // 10. Let targetDesc be ? target.[[GetOwnProperty]](P).\n    invariant(target instanceof ObjectValue);\n    let targetDesc = target.$GetOwnProperty(P);\n\n    // 11. If targetDesc is not undefined, then\n    if (targetDesc) {\n      Properties.ThrowIfMightHaveBeenDeleted(targetDesc);\n\n      // a. If IsDataDescriptor(targetDesc) is true and targetDesc.[[Configurable]] is false and targetDesc.[[Writable]] is false, then\n      if (IsDataDescriptor(realm, targetDesc) && !targetDesc.configurable && !targetDesc.writable) {\n        // i. If SameValue(V, targetDesc.[[Value]]) is false, throw a TypeError exception.\n        let targetValue = targetDesc.value || realm.intrinsics.undefined;\n        invariant(targetValue instanceof Value);\n        if (!SameValuePartial(realm, V, targetValue)) {\n          throw realm.createErrorThrowCompletion(realm.intrinsics.TypeError);\n        }\n      }\n\n      // b. If IsAccessorDescriptor(targetDesc) is true and targetDesc.[[Configurable]] is false, then\n      if (IsAccessorDescriptor(realm, targetDesc) && !targetDesc.configurable) {\n        // i. If targetDesc.[[Set]] is undefined, throw a TypeError exception.\n        if (!targetDesc.set || targetDesc.set instanceof UndefinedValue) {\n          throw realm.createErrorThrowCompletion(realm.intrinsics.TypeError);\n        }\n      }\n    }\n\n    // 12. Return true.\n    return true;\n  }\n\n  // ECMA262 9.5.10\n  $Delete(P: PropertyKeyValue): boolean {\n    let realm = this.$Realm;\n\n    // 1. Assert: IsPropertyKey(P) is true.\n    invariant(IsPropertyKey(realm, P), \"expected property key\");\n\n    // 2. Let handler be the value of the [[ProxyHandler]] internal slot of O.\n    let handler = this.$ProxyHandler;\n\n    // 3. If handler is null, throw a TypeError exception.\n    if (handler instanceof NullValue) {\n      throw realm.createErrorThrowCompletion(realm.intrinsics.TypeError);\n    }\n\n    // 4. Assert: Type(handler) is Object.\n    invariant(handler instanceof ObjectValue, \"expected object\");\n\n    // 5. Let target be the value of the [[ProxyTarget]] internal slot of O.\n    let target = this.$ProxyTarget;\n\n    // 6. Let trap be ? GetMethod(handler, \"deleteProperty\").\n    let trap = GetMethod(realm, handler, \"deleteProperty\");\n\n    // 7. If trap is undefined, then\n    if (trap instanceof UndefinedValue) {\n      // a. Return ? target.[[Delete]](P).\n      invariant(target instanceof ObjectValue);\n      return target.$Delete(P);\n    }\n\n    // 8. Let booleanTrapResult be ToBoolean(? Call(trap, handler, « target, P »)).\n    let booleanTrapResult = To.ToBooleanPartial(\n      realm,\n      Call(realm, trap, handler, [target, typeof P === \"string\" ? new StringValue(realm, P) : P])\n    );\n\n    // 9. If booleanTrapResult is false, return false.\n    if (!booleanTrapResult) return false;\n\n    // 10. Let targetDesc be ? target.[[GetOwnProperty]](P).\n    invariant(target instanceof ObjectValue);\n    let targetDesc = target.$GetOwnProperty(P);\n\n    // 11. If targetDesc is undefined, return true.\n    if (!targetDesc) return true;\n    Properties.ThrowIfMightHaveBeenDeleted(targetDesc);\n    targetDesc = targetDesc.throwIfNotConcrete(realm);\n\n    // 12. If targetDesc.[[Configurable]] is false, throw a TypeError exception.\n    if (!targetDesc.configurable) {\n      throw realm.createErrorThrowCompletion(realm.intrinsics.TypeError);\n    }\n\n    // 13. Return true.\n    return true;\n  }\n\n  // ECMA262 9.5.11\n  $OwnPropertyKeys(): Array<PropertyKeyValue> {\n    let realm = this.$Realm;\n\n    // 1. Let handler be the value of the [[ProxyHandler]] internal slot of O.\n    let handler = this.$ProxyHandler;\n\n    // 2. If handler is null, throw a TypeError exception.\n    if (handler instanceof NullValue) {\n      throw realm.createErrorThrowCompletion(realm.intrinsics.TypeError);\n    }\n\n    // 3. Assert: Type(handler) is Object.\n    invariant(handler instanceof ObjectValue, \"expected object\");\n\n    // 4. Let target be the value of the [[ProxyTarget]] internal slot of O.\n    let target = this.$ProxyTarget;\n    invariant(target instanceof ObjectValue);\n\n    // 5. Let trap be ? GetMethod(handler, \"ownKeys\").\n    let trap = GetMethod(realm, handler, \"ownKeys\");\n\n    // 6. If trap is undefined, then\n    if (trap instanceof UndefinedValue) {\n      // a. Return ? target.[[OwnPropertyKeys]]().\n      return target.$OwnPropertyKeys();\n    }\n\n    // 7. Let trapResultArray be ? Call(trap, handler, « target »).\n    let trapResultArray = Call(realm, trap, handler, [target]);\n\n    // 8. Let trapResult be ? CreateListFromArrayLike(trapResultArray, « String, Symbol »).\n    let trapResult: Array<PropertyKeyValue> = ((Create.CreateListFromArrayLike(realm, trapResultArray, [\n      \"String\",\n      \"Symbol\",\n    ]): any): Array<PropertyKeyValue>);\n\n    // 9. Let extensibleTarget be ? IsExtensible(target).\n    let extensibleTarget = IsExtensible(realm, target);\n\n    // 10. Let targetKeys be ? target.[[OwnPropertyKeys]]().\n    let targetKeys = target.$OwnPropertyKeys();\n\n    // 11. Assert: targetKeys is a List containing only String and Symbol values.\n    for (let key of targetKeys) {\n      invariant(key instanceof SymbolValue || key instanceof StringValue, \"expected string or symbol\");\n    }\n\n    // 12. Let targetConfigurableKeys be a new empty List.\n    let targetConfigurableKeys = [];\n\n    // 13. Let targetNonconfigurableKeys be a new empty List.\n    let targetNonconfigurableKeys = [];\n\n    // 14. Repeat, for each element key of targetKeys,\n    for (let key of targetKeys) {\n      // a. Let desc be ? target.[[GetOwnProperty]](key).\n      let desc = target.$GetOwnProperty(key);\n      if (desc) Properties.ThrowIfMightHaveBeenDeleted(desc);\n\n      // b. If desc is not undefined and desc.[[Configurable]] is false, then\n      if (desc && desc.throwIfNotConcrete(realm).configurable === false) {\n        // i. Append key as an element of targetNonconfigurableKeys.\n        targetNonconfigurableKeys.push(key);\n      } else {\n        // c. Else,\n        // i. Append key as an element of targetConfigurableKeys.\n        targetConfigurableKeys.push(key);\n      }\n    }\n\n    // 15. If extensibleTarget is true and targetNonconfigurableKeys is empty, then\n    if (extensibleTarget && !targetNonconfigurableKeys.length) {\n      // a. Return trapResult.\n      return trapResult;\n    }\n\n    // 16. Let uncheckedResultKeys be a new List which is a copy of trapResult.\n    let uncheckedResultKeys = trapResult.slice();\n\n    // 17. Repeat, for each key that is an element of targetNonconfigurableKeys,\n    for (let key of targetNonconfigurableKeys) {\n      // a. If key is not an element of uncheckedResultKeys, throw a TypeError exception.\n      let index = FindPropertyKey(realm, uncheckedResultKeys, key);\n      if (index < 0) {\n        throw realm.createErrorThrowCompletion(\n          realm.intrinsics.TypeError,\n          \"key is not an element of uncheckedResultKeys\"\n        );\n      }\n\n      // b. Remove key from uncheckedResultKeys.\n      uncheckedResultKeys.splice(index, 1);\n    }\n\n    // 18. If extensibleTarget is true, return trapResult.\n    if (extensibleTarget) return trapResult;\n\n    // 19. Repeat, for each key that is an element of targetConfigurableKeys,\n    for (let key of targetConfigurableKeys) {\n      // a. If key is not an element of uncheckedResultKeys, throw a TypeError exception.\n      let index = FindPropertyKey(realm, uncheckedResultKeys, key);\n      if (index < 0) {\n        throw realm.createErrorThrowCompletion(\n          realm.intrinsics.TypeError,\n          \"key is not an element of uncheckedResultKeys\"\n        );\n      }\n\n      // b. Remove key from uncheckedResultKeys.\n      uncheckedResultKeys.splice(index, 1);\n    }\n\n    // 20. If uncheckedResultKeys is not empty, throw a TypeError exception.\n    if (uncheckedResultKeys.length) {\n      throw realm.createErrorThrowCompletion(realm.intrinsics.TypeError);\n    }\n\n    // 21. Return trapResult.\n    return trapResult;\n  }\n}\n"
  },
  {
    "path": "src/values/StringExotic.js",
    "content": "/**\n * Copyright (c) 2017-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n/* @flow strict-local */\n\nimport type { Realm } from \"../realm.js\";\nimport type { PropertyKeyValue, Descriptor } from \"../types.js\";\nimport { ObjectValue, NumberValue, StringValue } from \"./index.js\";\nimport { IsInteger, IsArrayIndex } from \"../methods/is.js\";\nimport { Properties, To } from \"../singletons.js\";\nimport invariant from \"../invariant.js\";\nimport { PropertyDescriptor } from \"../descriptors.js\";\n\nexport default class StringExotic extends ObjectValue {\n  constructor(realm: Realm, intrinsicName?: string) {\n    super(realm, realm.intrinsics.StringPrototype, intrinsicName);\n  }\n\n  // ECMA262 9.4.3.1\n  $GetOwnProperty(P: PropertyKeyValue): Descriptor | void {\n    // 1. Assert: IsPropertyKey(P) is true.\n\n    // 2. Let desc be OrdinaryGetOwnProperty(S, P).\n    let desc = Properties.OrdinaryGetOwnProperty(this.$Realm, this, P);\n\n    // 3. If desc is not undefined, return desc.\n    if (desc !== undefined) {\n      Properties.ThrowIfMightHaveBeenDeleted(desc);\n      return desc;\n    }\n\n    // 4. If Type(P) is not String, return undefined.\n    if (typeof P !== \"string\" && !(P instanceof StringValue)) return undefined;\n\n    // 5. Let index be ! CanonicalNumericIndexString(P).\n    let index = To.CanonicalNumericIndexString(\n      this.$Realm,\n      typeof P === \"string\" ? new StringValue(this.$Realm, P) : P\n    );\n\n    // 6. If index is undefined, return undefined.\n    if (index === undefined || index === null) return undefined;\n\n    // 7. If IsInteger(index) is false, return undefined.\n    if (IsInteger(this.$Realm, index) === false) return undefined;\n\n    // 8. If index = -0, return undefined.\n    if (1.0 / index === -Infinity) return undefined;\n\n    // 9. Let str be the String value of S.[[StringData]].\n    let str = this.$StringData;\n    invariant(str);\n    str = str.throwIfNotConcreteString();\n\n    // 10. Let len be the number of elements in str.\n    let len = str.value.length;\n\n    // 11. If index < 0 or len ≤ index, return undefined.\n    if (index < 0 || len <= index) return undefined;\n\n    // 12. Let resultStr be a String value of length 1, containing one code unit from str, specifically the code unit at index index.\n    let resultStr = new StringValue(this.$Realm, str.value.charAt(index));\n\n    // 13. Return a PropertyDescriptor{[[Value]]: resultStr, [[Writable]]: false, [[Enumerable]]: true, [[Configurable]]: false}.\n    return new PropertyDescriptor({\n      value: resultStr,\n      writable: false,\n      enumerable: true,\n      configurable: false,\n    });\n  }\n\n  // ECMA262 9.4.3.2\n  $OwnPropertyKeys(): Array<PropertyKeyValue> {\n    // 1. Let keys be a new empty List.\n    let keys = [];\n\n    // 2. Let str be the String value of O.[[StringData]].\n    let str = this.$StringData;\n    invariant(str);\n    str = str.throwIfNotConcreteString();\n\n    // 3. Let len be the number of elements in str.\n    let len = str.value.length;\n\n    let realm = this.$Realm;\n    // 4. For each integer i starting with 0 such that i < len, in ascending order,\n    for (let i = 0; i < len; ++i) {\n      // a. Add ! ToString(i) as the last element of keys.\n      keys.push(new StringValue(realm, To.ToString(realm, new NumberValue(realm, i))));\n    }\n\n    // 5. For each own property key P of O such that P is an integer index and ToInteger(P) ≥ len, in ascending numeric index order,\n    let properties = Properties.GetOwnPropertyKeysArray(realm, this, false, false);\n    for (let key of properties\n      .filter(x => IsArrayIndex(realm, x))\n      .map(x => parseInt(x, 10))\n      .filter(x => To.ToInteger(realm, x) >= len)\n      .sort((x, y) => x - y)) {\n      // i. Add P as the last element of keys.\n      keys.push(new StringValue(realm, key + \"\"));\n    }\n\n    // 6. For each own property key P of O such that Type(P) is String and P is not an integer index, in ascending chronological order of property creation,\n    for (let key of properties.filter(x => !IsArrayIndex(realm, x))) {\n      // i. Add P as the last element of keys.\n      keys.push(new StringValue(realm, key));\n    }\n\n    // 7. For each own property key P of O such that Type(P) is Symbol, in ascending chronological order of property creation,\n    for (let key of this.symbols.keys()) {\n      // i. Add P as the last element of keys.\n      keys.push(key);\n    }\n\n    // 12. Return keys.\n    return keys;\n  }\n}\n"
  },
  {
    "path": "src/values/StringValue.js",
    "content": "/**\n * Copyright (c) 2017-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n/* @flow strict-local */\n\nimport { hashString } from \"../methods/index.js\";\nimport { PrimitiveValue, Value } from \"./index.js\";\nimport type { Realm } from \"../realm.js\";\n\nexport default class StringValue extends PrimitiveValue {\n  constructor(realm: Realm, value: string, intrinsicName?: string) {\n    super(realm, intrinsicName);\n    this.value = value;\n  }\n\n  value: string;\n\n  equals(x: Value): boolean {\n    return x instanceof StringValue && this.value === x.value;\n  }\n\n  getHash(): number {\n    return hashString(this.value);\n  }\n\n  mightBeFalse(): boolean {\n    return this.value.length === 0;\n  }\n\n  throwIfNotConcreteString(): StringValue {\n    return this;\n  }\n\n  _serialize(): string {\n    return this.value;\n  }\n\n  toDisplayString(): string {\n    return JSON.stringify(this.value);\n  }\n}\n"
  },
  {
    "path": "src/values/SymbolValue.js",
    "content": "/**\n * Copyright (c) 2017-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n/* @flow strict-local */\n\nimport { PrimitiveValue, Value } from \"./index.js\";\nimport type { Realm } from \"../realm.js\";\n\nexport default class SymbolValue extends PrimitiveValue {\n  constructor(realm: Realm, desc: void | Value, intrinsicName?: string) {\n    super(realm, intrinsicName);\n    this.$Description = desc;\n  }\n\n  $Description: void | Value;\n\n  hashValue: void | number;\n\n  equals(x: Value): boolean {\n    return this === x;\n  }\n\n  getHash(): number {\n    if (this.hashValue === undefined) {\n      this.hashValue = ++this.$Realm.symbolCount;\n    }\n    return this.hashValue;\n  }\n\n  mightBeFalse(): boolean {\n    return false;\n  }\n\n  throwIfNotConcreteSymbol(): SymbolValue {\n    return this;\n  }\n\n  _serialize(): Symbol {\n    return Symbol(this.$Description);\n  }\n\n  toDisplayString(): string {\n    if (this.$Description) {\n      if (this.$Description instanceof PrimitiveValue) {\n        return `Symbol(${this.$Description.toDisplayString()})`;\n      }\n    }\n    return \"Symbol(to be supported)\";\n  }\n}\n"
  },
  {
    "path": "src/values/UndefinedValue.js",
    "content": "/**\n * Copyright (c) 2017-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n/* @flow strict-local */\n\nimport { EmptyValue, PrimitiveValue, Value } from \"./index.js\";\n\nexport default class UndefinedValue extends PrimitiveValue {\n  _serialize() {\n    return undefined;\n  }\n\n  equals(x: Value): boolean {\n    return x instanceof UndefinedValue && !(x instanceof EmptyValue);\n  }\n\n  getHash(): number {\n    return 792057514635681;\n  }\n\n  mightBeFalse(): boolean {\n    return true;\n  }\n\n  toDisplayString(): string {\n    return \"undefined\";\n  }\n}\n"
  },
  {
    "path": "src/values/Value.js",
    "content": "/**\n * Copyright (c) 2017-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n/* @flow */\n\nimport type { BabelNodeSourceLocation } from \"@babel/types\";\nimport type { Realm } from \"../realm.js\";\nimport {\n  AbstractObjectValue,\n  AbstractValue,\n  BooleanValue,\n  ConcreteValue,\n  NumberValue,\n  ObjectValue,\n  PrimitiveValue,\n  StringValue,\n  SymbolValue,\n} from \"./index.js\";\nimport invariant from \"../invariant.js\";\n\nexport default class Value {\n  constructor(realm: Realm, intrinsicName?: string) {\n    invariant(realm, \"realm required\");\n\n    this.$Realm = realm;\n    this.intrinsicName = intrinsicName;\n    this.expressionLocation = realm.currentLocation;\n  }\n  // Name from original source if existant\n  __originalName: void | string;\n\n  toDisplayString(): string {\n    return (\n      \"[\" + this.constructor.name + \" originally; \" + (this.__originalName ? this.__originalName : \"undefined\") + \"]\"\n    );\n  }\n\n  equals(x: Value): boolean {\n    invariant(false, \"abstract method; please override\");\n  }\n\n  getHash(): number {\n    invariant(false, \"abstract method; please override\");\n  }\n\n  getType(): typeof Value {\n    return this.constructor;\n  }\n\n  static isTypeCompatibleWith(type: typeof Value, Constructor: typeof Value): boolean {\n    return (type: any).prototype instanceof Constructor || (type: any).prototype === Constructor.prototype;\n  }\n\n  intrinsicName: void | string;\n\n  // The source location of the expression that first produced this value.\n  expressionLocation: ?BabelNodeSourceLocation;\n  $Realm: Realm;\n\n  // this => val. A false value does not imply that !(this => val).\n  implies(val: AbstractValue, depth: number = 0): boolean {\n    if (!this.mightNotBeFalse()) return true;\n    if (this.equals(val)) return true;\n    return false;\n  }\n\n  // this => !val. A false value does not imply that !(this => !val).\n  impliesNot(val: AbstractValue, depth: number = 0): boolean {\n    if (!this.mightNotBeFalse()) return true;\n    if (this.equals(val)) return false;\n    return false;\n  }\n\n  isIntrinsic(): boolean {\n    return !!this.intrinsicName;\n  }\n\n  isTemporal() {\n    invariant(false, \"abstract method; please override\");\n  }\n\n  isPartialObject(): boolean {\n    return false;\n  }\n\n  isSimpleObject(): boolean {\n    return false;\n  }\n\n  mightBeFalse(): boolean {\n    invariant(false, \"abstract method; please override\");\n  }\n\n  mightNotBeFalse(): boolean {\n    invariant(false, \"abstract method; please override\");\n  }\n\n  mightBeNull(): boolean {\n    invariant(false, \"abstract method; please override\");\n  }\n\n  mightNotBeNull(): boolean {\n    invariant(false, \"abstract method; please override\");\n  }\n\n  mightBeNumber(): boolean {\n    invariant(false, \"abstract method; please override\");\n  }\n\n  mightNotBeNumber(): boolean {\n    invariant(false, \"abstract method; please override\");\n  }\n\n  mightNotBeObject(): boolean {\n    invariant(false, \"abstract method; please override\");\n  }\n\n  mightBeObject(): boolean {\n    invariant(false, \"abstract method; please override\");\n  }\n\n  mightBeString(): boolean {\n    invariant(false, \"abstract method; please override\");\n  }\n\n  mightNotBeString(): boolean {\n    invariant(false, \"abstract method; please override\");\n  }\n\n  mightBeTrue(): boolean {\n    return this.mightNotBeFalse();\n  }\n\n  mightNotBeTrue(): boolean {\n    return this.mightBeFalse();\n  }\n\n  mightBeUndefined(): boolean {\n    invariant(false, \"abstract method; please override\");\n  }\n\n  mightNotBeUndefined(): boolean {\n    invariant(false, \"abstract method; please override\");\n  }\n\n  mightHaveBeenDeleted(): boolean {\n    invariant(false, \"abstract method; please override\");\n  }\n\n  promoteEmptyToUndefined(): Value {\n    invariant(false, \"abstract method; please override\");\n  }\n\n  throwIfNotConcrete(): ConcreteValue {\n    invariant(false, \"abstract method; please override\");\n  }\n\n  throwIfNotConcreteNumber(): NumberValue {\n    invariant(false, \"abstract method; please override\");\n  }\n\n  throwIfNotConcreteString(): StringValue {\n    throw new Error(\"abstract method; please override\");\n  }\n\n  throwIfNotConcreteBoolean(): BooleanValue {\n    throw new Error(\"abstract method; please override\");\n  }\n\n  throwIfNotConcreteSymbol(): SymbolValue {\n    throw new Error(\"abstract method; please override\");\n  }\n\n  throwIfNotConcreteObject(): ObjectValue {\n    invariant(false, \"abstract method; please override\");\n  }\n\n  throwIfNotConcretePrimitive(): PrimitiveValue {\n    invariant(false, \"abstract method; please override\");\n  }\n\n  throwIfNotObject(): ObjectValue | AbstractObjectValue {\n    invariant(false, \"abstract method; please override\");\n  }\n\n  serialize(stack: Map<Value, any> = new Map()): any {\n    if (stack.has(this)) {\n      return stack.get(this);\n    } else {\n      let set = val => {\n        stack.set(this, val);\n        return val;\n      };\n\n      return set(this._serialize(set, stack));\n    }\n  }\n\n  _serialize(set: Function, stack: Map<Value, any>): any {\n    invariant(false, \"abstract method; please override\");\n  }\n\n  getDebugName(): string | void {\n    return this.intrinsicName || this.__originalName;\n  }\n}\n"
  },
  {
    "path": "src/values/index.js",
    "content": "/**\n * Copyright (c) 2017-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n/* @flow strict-local */\n\nexport { default as Value } from \"./Value.js\";\nexport { default as ConcreteValue } from \"./ConcreteValue.js\";\nexport { default as PrimitiveValue } from \"./PrimitiveValue.js\";\nexport { default as ObjectValue } from \"./ObjectValue.js\";\n\nexport { default as FunctionValue } from \"./FunctionValue.js\";\nexport { default as ECMAScriptFunctionValue } from \"./ECMAScriptFunctionValue.js\";\nexport { default as ECMAScriptSourceFunctionValue } from \"./ECMAScriptSourceFunctionValue.js\";\nexport { default as BoundFunctionValue } from \"./BoundFunctionValue.js\";\nexport { default as NativeFunctionValue, NativeFunctionCallback } from \"./NativeFunctionValue.js\";\n\nexport { default as ArrayValue } from \"./ArrayValue.js\";\n\nexport { default as UndefinedValue } from \"./UndefinedValue.js\";\nexport { default as EmptyValue } from \"./EmptyValue.js\";\nexport { default as NullValue } from \"./NullValue.js\";\n\nexport { NumberValue, IntegralValue } from \"./NumberValue.js\";\n\nexport { default as ProxyValue } from \"./ProxyValue.js\";\nexport { default as StringExotic } from \"./StringExotic.js\";\nexport { default as ArgumentsExotic } from \"./ArgumentsExotic.js\";\nexport { default as IntegerIndexedExotic } from \"./IntegerIndexedExotic.js\";\n\nexport { default as BooleanValue } from \"./BooleanValue.js\";\nexport { default as StringValue } from \"./StringValue.js\";\nexport { default as SymbolValue } from \"./SymbolValue.js\";\n\nexport { default as AbstractValue } from \"./AbstractValue.js\";\nexport type { AbstractValueKind } from \"./AbstractValue.js\";\nexport { default as AbstractObjectValue } from \"./AbstractObjectValue.js\";\n"
  },
  {
    "path": "test/error-handler/EmptyBuiltInArrayCycle.js",
    "content": "// instant render\n// expected errors: [{\"location\":{\"start\":{\"line\":5,\"column\":10},\"end\":{\"line\":5,\"column\":12},\"source\":\"test/error-handler/EmptyBuiltInArrayCycle.js\"},\"severity\":\"RecoverableError\",\"errorCode\":\"PP0039\"}]\n\n(function() {\n  var a = [];\n  var c = global.__abstract ? __abstract(\"boolean\", \"true\") : \"c\";\n  if (c) {\n    a[0] = a;\n  }\n  global.a = a;\n\n  inspect = function() {\n    return global.a.foo;\n  };\n})();\n"
  },
  {
    "path": "test/error-handler/EmptyBuiltInPropsCycle.js",
    "content": "// instant render\n// expected errors: [{\"location\":{\"start\":{\"line\":5,\"column\":10},\"end\":{\"line\":5,\"column\":12},\"source\":\"test/error-handler/EmptyBuiltInPropsCycle.js\"},\"severity\":\"RecoverableError\",\"errorCode\":\"PP0039\"}]\n\n(function() {\n  var a = {};\n  var c = global.__abstract ? __abstract(\"boolean\", \"true\") : \"c\";\n  if (c) {\n    a.foo = a;\n  }\n  global.a = a;\n\n  inspect = function() {\n    return global.a.foo;\n  };\n})();\n"
  },
  {
    "path": "test/error-handler/FinalObjectCannotBeMutated.js",
    "content": "// expected errors: [{\"location\":{\"start\":{\"line\":7,\"column\":12},\"end\":{\"line\":7,\"column\":14},\"source\":\"test/error-handler/FinalObjectCannotBeMutated.js\"},\"severity\":\"FatalError\",\"errorCode\":\"PP0026\",\"callStack\":\"Error\\n    \"}]\n(function() {\n  function f() {\n    let o = {};\n    o.foo = 23;\n    __makeFinal(o);\n    o.foo = 42; // <-- error expected here\n  }\n  __optimize(f);\n  global.inspect = f;\n})();\n"
  },
  {
    "path": "test/error-handler/InstantRenderArrayOps3.js",
    "content": "// instant render\n// expected errors:[{\"location\":{\"start\":{\"line\":8,\"column\":2},\"end\":{\"line\":10,\"column\":3},\"source\":\"test/error-handler/InstantRenderArrayOps3.js\"},\"severity\":\"RecoverableError\",\"errorCode\":\"PP0039\"}]\n\nfunction f(c) {\n  var arr = Array.from(c);\n  let x = 1;\n\n  function op(x) {\n    return x + 41;\n  }\n\n  let mapped = arr.map(op);\n  x = 2;\n  let mapped2 = mapped.map(op);\n\n  return mapped2;\n}\nglobal.__optimize && __optimize(f);\n\ninspect = () => f([0]);\n"
  },
  {
    "path": "test/error-handler/ModifiedObjectPropertyLimitation.js",
    "content": "// recover-from-errors\n// expected errors: [{\"severity\":\"Warning\",\"errorCode\":\"PP0023\",\"callStack\":\"Error\\n    \"}]\n(function() {\n  let p = {};\n  function f(c) {\n    let o = {};\n    if (c) {\n      o.__proto__ = p;\n      throw o;\n    }\n  }\n  if (global.__optimize) __optimize(f);\n  inspect = function() {\n    try {\n      f(true);\n    } catch (e) {\n      return e.$Prototype === p;\n    }\n  };\n})();\n"
  },
  {
    "path": "test/error-handler/PropertyAttributeConflict.js",
    "content": "// recover-from-errors\n// expected errors: [{location: {\"start\":{\"line\":7,\"column\":41},\"end\":{\"line\":7,\"column\":42},\"source\":\"test/error-handler/PropertyAttributeConflict.js\"}, errorCode: \"PP0038\", severity: \"RecoverableError\", message: \"unknown descriptor attributes on deleted property\"}]\n\nvar c = __abstract(\"boolean\", \"(true)\");\nvar obj = { x: 1 };\nif (c) delete obj.x;\nObject.defineProperty(obj, \"x\", { value: 2 });\ninspect = function() {\n  return Object.getOwnPropertyDescriptor(obj, \"x\").enumerable;\n};\n"
  },
  {
    "path": "test/error-handler/Set.js",
    "content": "// jsc\n// recover-from-errors\n// expected errors: [{\"location\":{\"start\":{\"line\":5,\"column\":22},\"end\":{\"line\":5,\"column\":25},\"source\":\"test/error-handler/Set.js\"},\"severity\":\"RecoverableError\",\"errorCode\":\"PP0001\"}]\n\nlet s = new Set([\"a\", \"a\"]);\n\ninspect = function() {\n  return s.size === 1;\n};\n"
  },
  {
    "path": "test/error-handler/abstract-value-check-dup-name-string.js",
    "content": "// expected errors: [{\"location\": {\"start\":{\"line\":4,\"column\":0},\"end\":{\"line\":4,\"column\":27},\"source\":\"test/error-handler/abstract-value-check-dup-name-string.js\"},\"severity\":\"FatalError\",\"errorCode\":\"PP0019\",\"message\":\"An abstract value with the same name exists\"}]\n\n__abstract(\"number\", \"foo\");\n__abstract(\"number\", \"foo\");\n"
  },
  {
    "path": "test/error-handler/bad-functions.js",
    "content": "// recover-from-errors\n// expected errors: [{\"severity\":\"Warning\",\"errorCode\":\"PP1007\",\"callStack\":\"Error\\n    \"},{\"severity\":\"Warning\",\"errorCode\":\"PP0023\",\"callStack\":\"Error\\n    \"},{\"severity\":\"Warning\",\"errorCode\":\"PP1007\",\"callStack\":\"Error\\n    \"},{\"location\":{\"start\":{\"line\":12,\"column\":13},\"end\":{\"line\":12,\"column\":18},\"source\":\"test/error-handler/bad-functions.js\"},\"severity\":\"RecoverableError\",\"errorCode\":\"PP1003\"},{\"location\":{\"start\":{\"line\":8,\"column\":13},\"end\":{\"line\":8,\"column\":18},\"source\":\"test/error-handler/bad-functions.js\"},\"severity\":\"RecoverableError\",\"errorCode\":\"PP1003\"}]\nvar wildcard = global.__abstract ? global.__abstract(\"number\", \"123\") : 123;\nglobal.a = \"\";\n\nfunction additional1() {\n  if (wildcard) throw new Error();\n  global.a = \"foo\";\n}\n\nfunction additional2() {\n  global.a = \"foo\";\n}\n\nif (global.__optimize) {\n  __optimize(additional1);\n  __optimize(additional2);\n}\n\ninspect = function() {\n  additional2();\n  additional1();\n  return global.a;\n};\n"
  },
  {
    "path": "test/error-handler/binaryExpression.js",
    "content": "// recover-from-errors\n// expected errors: [{location: {\"start\":{\"line\":15,\"column\":12},\"end\":{\"line\":15,\"column\":13},\"identifierName\":\"y\",\"source\":\"test/error-handler/binaryExpression.js\"}, errorCode: \"PP0002\", severity: \"RecoverableError\", message: \"might be an object with an unknown valueOf or toString or Symbol.toPrimitive method\"},{location: {\"start\":{\"line\":16,\"column\":6},\"end\":{\"line\":16,\"column\":7},\"identifierName\":\"y\",\"source\":\"test/error-handler/binaryExpression.js\"}, errorCode: \"PP0002\", severity: \"RecoverableError\", message: \"might be an object with an unknown valueOf or toString or Symbol.toPrimitive method\"}, {\"location\":{\"start\":{\"line\":21,\"column\":5},\"end\":{\"line\":21,\"column\":6},\"identifierName\":\"y\",\"source\":\"test/error-handler/binaryExpression.js\"},\"severity\":\"RecoverableError\",\"errorCode\":\"PP0002\"}, {\"location\":{\"start\":{\"line\":21,\"column\":55},\"end\":{\"line\":21,\"column\":56},\"identifierName\":\"y\",\"source\":\"test/error-handler/binaryExpression.js\"},\"severity\":\"RecoverableError\",\"errorCode\":\"PP0002\"}]\n\nvar b = global.__abstract ? __abstract(\"boolean\", \"true\") : true;\nvar x = global.__abstract ? __abstract(\"number\", \"123\") : 123;\nvar badOb = {\n  valueOf: function() {\n    throw 13;\n  },\n};\nvar ob = global.__makePartial ? __makePartial({}) : badOb;\nvar y = b ? ob : x;\n\ntry {\n  z = 100 + y;\n  z = y + 200;\n} catch (err) {\n  z = 300 + err;\n}\n\nz1 = y < 13 && x > 122 && 123 <= x && x >= 123 && x == y && x != 1 && x === x && x !== y;\n\ninspect = function() {\n  return \"\" + z + z1;\n};\n"
  },
  {
    "path": "test/error-handler/call.js",
    "content": "// recover-from-errors\n// expected errors: [{\"location\":{\"start\":{\"line\":10,\"column\":0},\"end\":{\"line\":10,\"column\":1},\"identifierName\":\"o\",\"source\":\"test/error-handler/call.js\"},\"severity\":\"RecoverableError\",\"errorCode\":\"PP0005\"}, {\"location\":{\"start\":{\"line\":11,\"column\":2},\"end\":{\"line\":11,\"column\":3},\"identifierName\":\"m\",\"source\":\"test/error-handler/call.js\"},\"severity\":\"RecoverableError\",\"errorCode\":\"PP0005\"}, {\"location\":{\"start\":{\"line\":14,\"column\":5},\"end\":{\"line\":14,\"column\":8},\"identifierName\":\"str\",\"source\":\"test/error-handler/call.js\"},\"severity\":\"RecoverableError\",\"errorCode\":\"PP0006\"}]\n\nfunction foo() {}\nvar f = global.__abstract ? __abstract(foo, \"foo\") : foo;\nvar o = global.__abstract ? __abstract({}, \"({})\") : {};\nif (global.__makeSimple) global.__makeSimple(o);\n\nfoo();\no();\no.m();\n\nvar str = global.__abstract ? __abstract(\"string\", \"('xxx')\") : \"xxx\";\neval(str);\n"
  },
  {
    "path": "test/error-handler/call2.js",
    "content": "// recover-from-errors\n// expected errors: [{\"location\":{\"start\":{\"line\":12,\"column\":4},\"end\":{\"line\":12,\"column\":13},\"source\":\"test/error-handler/call2.js\"},\"severity\":\"RecoverableError\",\"errorCode\":\"PP0017\"}]\n\nlet bar = { x: 1 };\nlet foo = global.__abstract\n  ? __abstract(\"function\", \"(function() { return this.x; })\")\n  : function() {\n      return this.x;\n    };\n\nbar.foo = foo;\nx = bar.foo();\nbar.foo = function() {\n  return \"abc\";\n};\ny = bar.foo();\n\ninspect = function() {\n  return \"\" + x + y;\n};\n"
  },
  {
    "path": "test/error-handler/class.js",
    "content": "// recover-from-errors\n// expected errors: [{\"location\":{\"start\":{\"line\":7,\"column\":18},\"end\":{\"line\":7,\"column\":26},\"identifierName\":\"absSuper\",\"source\":\"test/error-handler/class.js\"},\"severity\":\"RecoverableError\",\"errorCode\":\"PP0009\"}, {\"location\":{\"start\":{\"line\":11,\"column\":18},\"end\":{\"line\":11,\"column\":28},\"identifierName\":\"superClass\",\"source\":\"test/error-handler/class.js\"},\"severity\":\"RecoverableError\",\"errorCode\":\"PP0010\"}]\n\nlet superClass = function() {};\nlet absSuper = __abstract(\"object\");\n\nclass foo extends absSuper {}\n\nsuperClass.prototype = absSuper;\n\nclass bar extends superClass {}\n"
  },
  {
    "path": "test/error-handler/conditional-return.js",
    "content": "// recover-from-errors\n// expected errors: [{location: {\"start\":{\"line\":17,\"column\":14},\"end\":{\"line\":17,\"column\":16 },\"identifierName\":\"n1\",\"source\":\"test/error-handler/conditional-return.js\"}, errorCode: \"PP0002\", severity: \"RecoverableError\", message: \"might be an object with an unknown valueOf or toString or Symbol.toPrimitive method\"}]\nlet b = global.__abstract ? __abstract(\"boolean\", \"true\") : true;\nlet n1;\nif (b) n1 = 5;\nlet n2 = global.__abstract ? __abstract(\"number\", \"7\") : 7;\n\nfunction f() {\n  if (!b) return;\n  // should not fail\n  return n2 - n1;\n}\n\nfunction g() {\n  f();\n  //condition from line 7 should have been undone and this should fail.\n  return n2 - n1;\n}\n\ng();\n\ninspect = function() {\n  return true;\n};\n"
  },
  {
    "path": "test/error-handler/forInStatement.js",
    "content": "// expected errors: [{\"location\":{\"start\":{\"line\":6,\"column\":14},\"end\":{\"line\":6,\"column\":16},\"identifierName\":\"ob\",\"source\":\"test/error-handler/forInStatement.js\"},\"severity\":\"FatalError\",\"errorCode\":\"PP0013\"}]\n\nlet ob = global.__abstract ? __abstract(\"object\", \"({ x: 1 })\") : { x: 1 };\n\nlet tgt = {};\nfor (var p in ob) {\n}\n"
  },
  {
    "path": "test/error-handler/forOfStatement.js",
    "content": "// expected errors: [{\"location\":{\"start\":{\"line\":5,\"column\":14},\"end\":{\"line\":5,\"column\":16},\"identifierName\":\"ob\",\"source\":\"test/error-handler/forOfStatement.js\"},\"severity\":\"FatalError\",\"errorCode\":\"PP0014\"}]\n\nlet ob = global.__abstract ? __abstract(\"object\", \"([1, 2, 3])\") : [1, 2, 3];\n\nfor (let p of ob) {\n}\n"
  },
  {
    "path": "test/error-handler/in1.js",
    "content": "// recover-from-errors\n// expected errors: [{\"location\":{\"start\":{\"line\":9,\"column\":16},\"end\":{\"line\":9,\"column\":17},\"identifierName\":\"b\",\"source\":\"test/error-handler/in1.js\"},\"severity\":\"RecoverableError\",\"errorCode\":\"PP0003\"}, {\"location\":{\"start\":{\"line\":14,\"column\":12},\"end\":{\"line\":14,\"column\":13},\"identifierName\":\"b\",\"source\":\"test/error-handler/in1.js\"},\"severity\":\"RecoverableError\",\"errorCode\":\"PP0003\"}]\n\nvar b = global.__abstract ? __abstract(\"boolean\", \"true\") : true;\nvar p = global.__abstract ? __abstract(\"string\", '(\"abc\")') : \"abc\";\n\nx1 = \"xyz\" in {};\ntry {\n  x2 = \"xyz\" in b;\n} catch (err) {\n  if (err instanceof TypeError) x2 = true;\n}\ntry {\n  x3 = p in b;\n} catch (err) {\n  if (err instanceof TypeError) x3 = true;\n}\n\ninspect = function() {\n  return \"\" + x1 + x3;\n};\n"
  },
  {
    "path": "test/error-handler/in2.js",
    "content": "// recover-from-errors\n// expected errors: [{\"location\":{\"start\":{\"line\":13,\"column\":12},\"end\":{\"line\":13,\"column\":14},\"identifierName\":\"a2\",\"source\":\"test/error-handler/in2.js\"},\"severity\":\"RecoverableError\",\"errorCode\":\"PP0004\"}]\n\nvar b = global.__abstract ? __abstract(\"boolean\", \"true\") : true;\nvar a0 = { \"4\": 5 };\nvar a1 = global.__makeSimple ? __makeSimple({ \"4\": 5 }) : a0;\n\nvar tArr = new Int8Array(4);\nvar a2 = global.__abstract ? __abstract(\"object\", \"tArr\") : tArr;\n\nx0 = \"4\" in a0;\nx1 = \"4\" in a1;\nx2 = \"4\" in a2;\n\ninspect = function() {\n  return \"\" + x0 + x1 + x2;\n};\n"
  },
  {
    "path": "test/error-handler/instanceof.js",
    "content": "// recover-from-errors\n// expected errors: [{\"location\":{\"start\":{\"line\":15,\"column\":20},\"end\":{\"line\":15,\"column\":23},\"identifierName\":\"foo\",\"source\":\"test/error-handler/instanceof.js\"},\"severity\":\"RecoverableError\",\"errorCode\":\"PP0004\"}, {\"location\":{\"start\":{\"line\":21,\"column\":20},\"end\":{\"line\":21,\"column\":21},\"identifierName\":\"b\",\"source\":\"test/error-handler/instanceof.js\"},\"severity\":\"RecoverableError\",\"errorCode\":\"PP0003\"}, {\"location\":{\"start\":{\"line\":27,\"column\":20},\"end\":{\"line\":27,\"column\":21},\"identifierName\":\"f\",\"source\":\"test/error-handler/instanceof.js\"},\"severity\":\"RecoverableError\",\"errorCode\":\"PP0004\"}]\n\nvar b = global.__abstract ? __abstract(\"boolean\", \"true\") : true;\nfunction foo() {}\nObject.defineProperty(foo, Symbol.hasInstance, {\n  value: function() {\n    throw 123;\n  },\n});\nvar f = global.__abstract ? __abstract(\"object\", \"foo\") : foo;\nvar o = global.__abstract ? __abstract(\"object\", \"({})\") : {};\n\ntry {\n  x1 = o instanceof foo;\n} catch (err) {\n  x1 = err;\n}\n\ntry {\n  x2 = o instanceof b;\n} catch (err) {\n  x2 = err;\n}\n\ntry {\n  x3 = o instanceof f;\n} catch (err) {\n  x3 = err;\n}\n"
  },
  {
    "path": "test/error-handler/member.js",
    "content": "// recover-from-errors\n// expected errors: [{\"location\":{\"start\":{\"line\":8,\"column\":0},\"end\":{\"line\":8,\"column\":2},\"identifierName\":\"oq\",\"source\":\"test/error-handler/member.js\"},\"severity\":\"FatalError\",\"errorCode\":\"PP0012\"}]\n\nvar b = global.__abstract ? __abstract(\"boolean\", \"true\") : true;\nvar o = global.__abstract ? __abstract(\"object\", \"({})\") : {};\nvar oq = b ? o : null;\n\noq.foo = 123;\n"
  },
  {
    "path": "test/error-handler/member2.js",
    "content": "// recover-from-errors\n// expected errors: [{\"location\":{\"start\":{\"line\":8,\"column\":4},\"end\":{\"line\":8,\"column\":6},\"identifierName\":\"oq\",\"source\":\"test/error-handler/member2.js\"},\"severity\":\"FatalError\",\"errorCode\":\"PP0012\"}]\n\nvar b = global.__abstract ? __abstract(\"boolean\", \"true\") : true;\nvar o = global.__abstract ? __abstract(\"object\", \"({})\") : {};\nvar oq = b ? o : null;\n\nx = oq.foo;\n"
  },
  {
    "path": "test/error-handler/object-assign.js",
    "content": "// recover-from-errors\n// expected errors: [{\"location\":{\"start\":{\"line\":5,\"column\":34},\"end\":{\"line\":5,\"column\":37},\"identifierName\":\"obj\",\"source\":\"test/error-handler/object-assign.js\"},\"severity\":\"FatalError\",\"errorCode\":\"PP0001\"}]\n\nvar obj = global.__abstract && global.__makePartial ? __makePartial(__abstract({}, \"({foo:1})\")) : { foo: 1 };\nvar copyOfObj = Object.assign({}, obj);\n"
  },
  {
    "path": "test/error-handler/objectExpression.js",
    "content": "// recover-from-errors\n// expected errors: [{\"location\":{\"start\":{\"line\":7,\"column\":11},\"end\":{\"line\":7,\"column\":29},\"source\":\"test/error-handler/objectExpression.js\"},\"severity\":\"FatalError\",\"errorCode\":\"PP0011\"}, {\"location\":{\"start\":{\"line\":7,\"column\":31},\"end\":{\"line\":7,\"column\":37},\"source\":\"test/error-handler/objectExpression.js\"},\"severity\":\"FatalError\",\"errorCode\":\"PP0011\"}]\n\nlet x = __abstract(\"number\");\nlet y = __abstract(\"number\");\n\nlet ob = { [x]: function() {}, [y]: 2 };\n"
  },
  {
    "path": "test/error-handler/objectExpression2.js",
    "content": "// expected errors: [{\"location\":{\"start\":{\"line\":6,\"column\":11},\"end\":{\"line\":6,\"column\":29},\"source\":\"test/error-handler/objectExpression2.js\"},\"severity\":\"FatalError\",\"errorCode\":\"PP0011\"}]\n\nlet x = __abstract(\"number\");\nlet y = __abstract(\"number\");\n\nlet ob = { [x]: function() {}, [y]: 2 };\n"
  },
  {
    "path": "test/error-handler/objectpattern.js",
    "content": "// recover-from-errors\n// expected errors: [{\"location\":{\"start\":{\"line\":7,\"column\":3},\"end\":{\"line\":7,\"column\":10},\"source\":\"test/error-handler/objectpattern.js\"},\"severity\":\"FatalError\",\"errorCode\":\"PP0014\"}]\n\nlet p = __abstract(\"string\", \"foo\");\nlet foo = \"foo\";\n({ [foo]: q1 } = { foo: \"bar\" });\n({ [p]: q2 } = { foo: \"bar\" });\n"
  },
  {
    "path": "test/error-handler/stackOverflow.js",
    "content": "// expected errors: [{\"location\":{\"start\":{\"line\":3,\"column\":2},\"end\":{\"line\":3,\"column\":3},\"identifierName\":\"f\",\"source\":\"test/error-handler/stackOverflow.js\"},\"severity\":\"FatalError\",\"errorCode\":\"PP0045\"}]\nfunction f() {\n  f();\n}\nf();\n"
  },
  {
    "path": "test/error-handler/syntaxError.js",
    "content": "// recover-from-errors\n// expected errors: [{\"location\":{\"line\":4,\"column\":3,\"source\":\"test/error-handler/syntaxError.js\",\"start\":{\"line\":4,\"column\":3},\"end\":{\"line\":4,\"column\":3}},\"severity\":\"FatalError\",\"errorCode\":\"PP1004\",\"callStack\":\"Error\\n    \"}]\n\nif x then y\n"
  },
  {
    "path": "test/error-handler/testErrorHandlerCalled.js",
    "content": "// expected errors: [{errorCode: \"PP0001\", severity: \"FatalError\"}]\nlet l = __abstract(\"number\");\nlet a = new Array(l);\n"
  },
  {
    "path": "test/error-handler/try-and-access-abstract-property.js",
    "content": "// abstract effects\n// recover-from-errors\n// expected errors: [{location: {\"start\":{\"line\":19,\"column\":11},\"end\":{\"line\":19,\"column\":15},\"identifierName\":\"obj1\",\"source\":\"test/error-handler/try-and-access-abstract-property.js\"}, errorCode: \"PP0021\", severity: \"RecoverableError\", message: \"Possible throw inside try/catch is not yet supported\"},{location: {\"start\":{\"line\":27,\"column\":11},\"end\":{\"line\":27,\"column\":15},\"identifierName\":\"obj2\",\"source\":\"test/error-handler/try-and-access-abstract-property.js\"}, errorCode: \"PP0021\", severity: \"RecoverableError\", message: \"Possible throw inside try/catch is not yet supported\"}]\n\nlet obj1 = global.__abstract\n  ? __abstract(\"object\", '({get foo() { return \"bar\"; }})')\n  : {\n      get foo() {\n        return \"bar\";\n      },\n    };\nlet obj2 = global.__abstract ? __abstract(\"object\", '({foo:{bar:\"baz\"}})') : { foo: { bar: \"baz\" } };\nif (global.__makeSimple) {\n  __makeSimple(obj2);\n}\n\nfunction additional1() {\n  try {\n    return obj1.foo;\n  } catch (x) {\n    return 1;\n  }\n}\n\nfunction additional2() {\n  try {\n    return obj2.foo.bar;\n  } finally {\n    return 2;\n  }\n}\n\nif (global.__optimize) {\n  __optimize(additional1);\n  __optimize(additional2);\n}\n\ninspect = function() {\n  let ret1 = additional1();\n  let ret2 = additional2();\n  return JSON.stringify({ ret1, ret2 });\n};\n"
  },
  {
    "path": "test/error-handler/try-and-call-abstract-function.js",
    "content": "// abstract effects\n// expected errors: [{location: {\"start\":{\"line\":30,\"column\":11},\"end\":{\"line\":30,\"column\":21},\"identifierName\":\"abstractFn\",\"source\":\"test/error-handler/try-and-call-abstract-function.js\"}, errorCode: \"PP0021\", severity: \"RecoverableError\", message: \"Possible throw inside try/catch is not yet supported\"}]\n// recover-from-errors\n\nlet abstractFn = global.__abstract\n  ? __abstract(\"function\", \"(function() { return true; })\")\n  : function() {\n      return true;\n    };\n\nfunction concreteFunction() {\n  return true;\n}\n\nfunction additional1() {\n  let value;\n  try {\n    // This is ok.\n    value = concreteFunction();\n  } catch (x) {\n    value = false;\n  }\n  // This is ok.\n  return abstractFn(value);\n}\n\nfunction additional2() {\n  try {\n    // This is not ok.\n    return abstractFn();\n  } catch (x) {\n    return false;\n  }\n}\n\nif (global.__optimize) {\n  __optimize(additional1);\n  __optimize(additional2);\n}\n\ninspect = function() {\n  let ret1 = additional1();\n  let ret2 = additional2();\n  return JSON.stringify({ ret1, ret2 });\n};\n"
  },
  {
    "path": "test/error-handler/unaryExpression.js",
    "content": "// recover-from-errors\n// expected errors: [{\"location\":{\"start\":{\"line\":13,\"column\":10},\"end\":{\"line\":13,\"column\":19},\"identifierName\":\"mysteryOb\",\"source\":\"test/error-handler/unaryExpression.js\"},\"severity\":\"RecoverableError\",\"errorCode\":\"PP0008\"}, {\"location\":{\"start\":{\"line\":15,\"column\":10},\"end\":{\"line\":15,\"column\":19},\"identifierName\":\"mysteryOb\",\"source\":\"test/error-handler/unaryExpression.js\"},\"severity\":\"RecoverableError\",\"errorCode\":\"PP0008\"}, {\"location\":{\"start\":{\"line\":17,\"column\":10},\"end\":{\"line\":17,\"column\":19},\"identifierName\":\"mysteryOb\",\"source\":\"test/error-handler/unaryExpression.js\"},\"severity\":\"RecoverableError\",\"errorCode\":\"PP0008\"}]\n\nvar b = global.__abstract ? __abstract(\"boolean\", \"true\") : true;\nvar x = global.__abstract ? __abstract(\"number\", \"123\") : 123;\nvar badOb = {};\nif (global.__makeSimple) global.__makeSimple(badOb);\nbadOb[Symbol.toPrimitive] = function() {\n  throw 13;\n};\nvar mysteryOb = b ? null : badOb;\n\nvar x1 = +mysteryOb;\nvar x2 = +x;\nvar x3 = -mysteryOb;\nvar x4 = -x;\nvar x5 = ~mysteryOb;\nvar x6 = ~x;\nvar x7 = !b;\nvar x8 = !x7;\nvar x9 = !mysteryOb;\nvar x10 = typeof mysteryOb;\n"
  },
  {
    "path": "test/error-handler/updateExpression.js",
    "content": "// recover-from-errors\n// expected errors: [{\"location\":{\"start\":{\"line\":14,\"column\":0},\"end\":{\"line\":14,\"column\":1},\"identifierName\":\"y\",\"source\":\"test/error-handler/updateExpression.js\"},\"severity\":\"RecoverableError\",\"errorCode\":\"PP0008\"}, {\"location\":{\"start\":{\"line\":15,\"column\":2},\"end\":{\"line\":15,\"column\":4},\"identifierName\":\"ob\",\"source\":\"test/error-handler/updateExpression.js\"},\"severity\":\"RecoverableError\",\"errorCode\":\"PP0008\"}]\n\nvar b = global.__abstract ? __abstract(\"boolean\", \"true\") : true;\nvar x = global.__abstract ? __abstract(\"number\", \"123\") : 123;\nvar badOb = {\n  valueOf: function() {\n    throw 13;\n  },\n};\nvar ob = global.__abstract ? __abstract(\"object\", \"({ valueOf: function() { throw 13;} })\") : badOb;\nvar y = b ? ob : x;\n\ny++;\n--ob;\n"
  },
  {
    "path": "test/error-handler/with.js",
    "content": "// recover-from-errors\n// expected errors: [{\"location\":{\"start\":{\"line\":7,\"column\":6},\"end\":{\"line\":7,\"column\":9},\"identifierName\":\"obj\",\"source\":\"test/error-handler/with.js\"},\"severity\":\"RecoverableError\",\"errorCode\":\"PP0007\"}]\n\nlet obj = global.__abstract ? __makePartial({ x: 1, y: 3 }, \"({x:1,y:3})\") : { x: 1, y: 3 };\nif (global.__makeSimple) global.__makeSimple(obj);\nlet y = 2;\nwith (obj) {\n  z = x + y;\n}\ninspect = function() {\n  return z;\n};\n"
  },
  {
    "path": "test/error-handler/with2.js",
    "content": "// recover-from-errors\n// expected errors: [{\"location\":{\"start\":{\"line\":6,\"column\":6},\"end\":{\"line\":6,\"column\":9},\"identifierName\":\"obj\",\"source\":\"test/error-handler/with2.js\"},\"severity\":\"RecoverableError\",\"errorCode\":\"PP0007\"}, {\"location\":{\"start\":{\"line\":7,\"column\":2},\"end\":{\"line\":7,\"column\":3},\"identifierName\":\"z\",\"source\":\"test/error-handler/with2.js\"},\"severity\":\"FatalError\",\"errorCode\":\"PP0001\"}]\n\nlet obj = global.__abstract ? __makePartial({ x: 1, y: 3 }, \"({x:1,y:3})\") : { x: 1, y: 3 };\nlet y = 2;\nwith (obj) {\n  z = x + y;\n}\ninspect = function() {\n  return z;\n};\n"
  },
  {
    "path": "test/error-handler/write-forin-conflict.js",
    "content": "// recover-from-errors\n// expected errors: [{\"severity\":\"Warning\",\"errorCode\":\"PP1007\",\"callStack\":\"Error\\n    \"},{\"location\":{\"start\":{\"line\":9,\"column\":16},\"end\":{\"line\":9,\"column\":22},\"identifierName\":\"global\",\"source\":\"test/error-handler/write-forin-conflict.js\"},\"severity\":\"RecoverableError\",\"errorCode\":\"PP1003\"}]\n\nfunction additional1() {\n  global.a = { f: \"foo\" };\n}\n\nfunction additional2() {\n  for (let p in global.a) {\n  }\n}\n\nif (global.__optimize) {\n  __optimize(additional1);\n  __optimize(additional2);\n}\n\ninspect = function() {\n  additional2();\n  additional1();\n  return global.b;\n};\n"
  },
  {
    "path": "test/error-handler/write-in-conflict.js",
    "content": "// recover-from-errors\n// expected errors: [{\"severity\":\"Warning\",\"errorCode\":\"PP1007\",\"callStack\":\"Error\\n    \"},{\"severity\":\"Warning\",\"errorCode\":\"PP1007\",\"callStack\":\"Error\\n    \"},{\"location\":{\"start\":{\"line\":9,\"column\":20},\"end\":{\"line\":9,\"column\":26},\"identifierName\":\"global\",\"source\":\"test/error-handler/write-in-conflict.js\"},\"severity\":\"RecoverableError\",\"errorCode\":\"PP1003\"}]\n\nfunction additional1() {\n  global.a = \"foo\";\n}\n\nfunction additional2() {\n  global.b = \"a\" in global;\n}\n\nif (global.__optimize) {\n  __optimize(additional1);\n  __optimize(additional2);\n}\n\ninspect = function() {\n  additional2();\n  additional1();\n  return global.b;\n};\n"
  },
  {
    "path": "test/error-handler/write-reflect-conflict.js",
    "content": "// recover-from-errors\n// expected errors: [{\"severity\":\"Warning\",\"errorCode\":\"PP1007\",\"callStack\":\"Error\\n    \"},{\"severity\":\"Warning\",\"errorCode\":\"PP1007\",\"callStack\":\"Error\\n    \"},{\"location\":{\"start\":{\"line\":11,\"column\":29},\"end\":{\"line\":11,\"column\":30},\"identifierName\":\"a\",\"source\":\"test/error-handler/write-reflect-conflict.js\"},\"severity\":\"RecoverableError\",\"errorCode\":\"PP1003\"}]\n\na = {};\n\nfunction additional1() {\n  global.a = { f: \"foo\" };\n}\n\nfunction additional2() {\n  global.b = Reflect.ownKeys(a);\n}\n\nif (global.__optimize) {\n  __optimize(additional1);\n  __optimize(additional2);\n}\n\ninspect = function() {\n  additional2();\n  additional1();\n  return global.b;\n};\n"
  },
  {
    "path": "test/error-handler/write-write-conflict.js",
    "content": "// recover-from-errors\n// expected errors: [{\"severity\":\"Warning\",\"errorCode\":\"PP1007\",\"callStack\":\"Error\\n    \"},{\"severity\":\"Warning\",\"errorCode\":\"PP1007\",\"callStack\":\"Error\\n    \"},{\"location\":{\"start\":{\"line\":11,\"column\":13},\"end\":{\"line\":11,\"column\":18},\"source\":\"test/error-handler/write-write-conflict.js\"},\"severity\":\"RecoverableError\",\"errorCode\":\"PP1003\"},{\"location\":{\"start\":{\"line\":7,\"column\":13},\"end\":{\"line\":7,\"column\":18},\"source\":\"test/error-handler/write-write-conflict.js\"},\"severity\":\"RecoverableError\",\"errorCode\":\"PP1003\"}]\n\nglobal.a = \"\";\n\nfunction additional1() {\n  global.a = \"foo\";\n}\n\nfunction additional2() {\n  global.a = \"bar\";\n}\n\nif (global.__optimize) {\n  __optimize(additional1);\n  __optimize(additional2);\n}\n\ninspect = function() {\n  additional2();\n  additional1();\n  return global.a;\n};\n"
  },
  {
    "path": "test/error-handler/write-write-conflict2.js",
    "content": "// recover-from-errors\n// expected errors: [{\"severity\":\"Warning\",\"errorCode\":\"PP1007\",\"callStack\":\"Error\\n    \"},{\"severity\":\"Warning\",\"errorCode\":\"PP1007\",\"callStack\":\"Error\\n    \"},{\"location\":{\"start\":{\"line\":11,\"column\":13},\"end\":{\"line\":11,\"column\":18},\"source\":\"test/error-handler/write-write-conflict2.js\"},\"severity\":\"RecoverableError\",\"errorCode\":\"PP1003\"},{\"location\":{\"start\":{\"line\":7,\"column\":9},\"end\":{\"line\":7,\"column\":15},\"identifierName\":\"global\",\"source\":\"test/error-handler/write-write-conflict2.js\"},\"severity\":\"RecoverableError\",\"errorCode\":\"PP1003\"}]\n\nglobal.a = \"\";\n\nfunction additional1() {\n  delete global.a;\n}\n\nfunction additional2() {\n  global.a = \"bar\";\n}\n\nif (global.__optimize) {\n  __optimize(additional1);\n  __optimize(additional2);\n}\n\ninspect = function() {\n  additional2();\n  additional1();\n  return global.a;\n};\n"
  },
  {
    "path": "test/error-handler/write-write-conflict3.js",
    "content": "// recover-from-errors\n// expected errors: [{\"severity\":\"Warning\",\"errorCode\":\"PP1007\",\"callStack\":\"Error\\n    \"},{\"severity\":\"Warning\",\"errorCode\":\"PP1007\",\"callStack\":\"Error\\n    \"},{\"location\":{\"start\":{\"line\":11,\"column\":9},\"end\":{\"line\":11,\"column\":15},\"identifierName\":\"global\",\"source\":\"test/error-handler/write-write-conflict3.js\"},\"severity\":\"RecoverableError\",\"errorCode\":\"PP1003\"},{\"location\":{\"start\":{\"line\":7,\"column\":13},\"end\":{\"line\":7,\"column\":18},\"source\":\"test/error-handler/write-write-conflict3.js\"},\"severity\":\"RecoverableError\",\"errorCode\":\"PP1003\"}]\n\nglobal.a = \"\";\n\nfunction additional1() {\n  global.a = \"foo\";\n}\n\nfunction additional2() {\n  delete global.a;\n}\n\nif (global.__optimize) {\n  __optimize(additional1);\n  __optimize(additional2);\n}\n\ninspect = function() {\n  additional2();\n  additional1();\n  return global.a;\n};\n"
  },
  {
    "path": "test/error-handler/write-write-conflict4.js",
    "content": "// recover-from-errors\n// expected errors: [{\"severity\":\"Warning\",\"errorCode\":\"PP1007\",\"callStack\":\"Error\\n    \"},{\"severity\":\"Warning\",\"errorCode\":\"PP1007\",\"callStack\":\"Error\\n    \"},{\"location\":{\"start\":{\"line\":11,\"column\":13},\"end\":{\"line\":11,\"column\":18},\"source\":\"test/error-handler/write-write-conflict4.js\"},\"severity\":\"RecoverableError\",\"errorCode\":\"PP1003\"},{\"location\":{\"start\":{\"line\":7,\"column\":13},\"end\":{\"line\":7,\"column\":18},\"source\":\"test/error-handler/write-write-conflict4.js\"},\"severity\":\"RecoverableError\",\"errorCode\":\"PP1003\"}]\n\nglobal.a = \"\";\n\nfunction additional1() {\n  global.a = \"foo\";\n}\n\nfunction additional2() {\n  global.a = \"foo\";\n}\n\nif (global.__optimize) {\n  __optimize(additional1);\n  __optimize(additional2);\n}\n\ninspect = function() {\n  additional2();\n  additional1();\n  return global.a + global.b;\n};\n"
  },
  {
    "path": "test/error-handler/write-write-unknown-prop-conflict.js",
    "content": "// recover-from-errors\n// expected errors: [{\"severity\":\"Warning\",\"errorCode\":\"PP1007\",\"callStack\":\"Error\\n    \"},{\"severity\":\"Warning\",\"errorCode\":\"PP1007\",\"callStack\":\"Error\\n    \"},{\"severity\":\"Warning\",\"errorCode\":\"PP1007\",\"callStack\":\"Error\\n    \"},{\"severity\":\"Warning\",\"errorCode\":\"PP1007\",\"callStack\":\"Error\\n    \"},{\"location\":{\"start\":{\"line\":12,\"column\":16},\"end\":{\"line\":12,\"column\":21},\"source\":\"test/error-handler/write-write-unknown-prop-conflict.js\"},\"severity\":\"RecoverableError\",\"errorCode\":\"PP1003\"},{\"location\":{\"start\":{\"line\":8,\"column\":16},\"end\":{\"line\":8,\"column\":21},\"source\":\"test/error-handler/write-write-unknown-prop-conflict.js\"},\"severity\":\"RecoverableError\",\"errorCode\":\"PP1003\"}]\n\nlet i = global.__abstract ? __abstract(\"string\", \"x\") : \"x\";\nglobal.a = { x: \"\" };\n\nfunction additional1() {\n  global.a[i] = \"foo\";\n}\n\nfunction additional2() {\n  global.a[i] = \"bar\";\n}\n\nif (global.__optimize) {\n  __optimize(additional1);\n  __optimize(additional2);\n}\n\ninspect = function() {\n  additional2();\n  additional1();\n  return global.a.x;\n};\n"
  },
  {
    "path": "test/react/AssignSpread/simple-assign.js",
    "content": "var React = require(\"react\");\n\nfunction A(props) {\n  return <div>Hello {props.x}</div>;\n}\n\nfunction App(props) {\n  var copyOfProps = Object.assign({}, props);\n  return (\n    <div>\n      <A x={copyOfProps.x} />\n    </div>\n  );\n}\n\nApp.getTrials = function(renderer, Root) {\n  renderer.update(<Root x={10} />);\n  return [[\"simple render with object assign\", renderer.toJSON()]];\n};\n\nif (this.__optimizeReactComponentTree) {\n  __optimizeReactComponentTree(App);\n}\n\nmodule.exports = App;\n"
  },
  {
    "path": "test/react/AssignSpread/simple-assign2.js",
    "content": "var React = require(\"react\");\n\nfunction A(props) {\n  var copyOfProps = Object.assign({}, props.bag);\n  Object.defineProperty(copyOfProps, \"y\", {\n    get() {\n      return 30;\n    },\n  });\n  return (\n    <div>\n      Hello {copyOfProps.x} {copyOfProps.y}\n    </div>\n  );\n}\n\nfunction App(props) {\n  var copyOfProps = Object.assign({}, props, { x: 20 });\n  return <A bag={copyOfProps} />;\n}\n\nApp.getTrials = function(renderer, Root) {\n  renderer.update(<Root x={10} />);\n  return [[\"simple render with object assign\", renderer.toJSON()]];\n};\n\nif (this.__optimizeReactComponentTree) {\n  __optimizeReactComponentTree(App);\n}\n\nmodule.exports = App;\n"
  },
  {
    "path": "test/react/AssignSpread/simple-assign3.js",
    "content": "var React = require(\"react\");\n\nfunction App(props) {\n  var obj1 = Object.assign({}, props, { x: 20 });\n  var obj2 = Object.assign({}, obj1);\n  return (\n    <div>\n      {obj1.x}\n      {obj2.x}\n    </div>\n  );\n}\n\nApp.getTrials = function(renderer, Root) {\n  renderer.update(<Root x={10} />);\n  return [[\"simple render with object assign\", renderer.toJSON()]];\n};\n\nif (this.__optimizeReactComponentTree) {\n  __optimizeReactComponentTree(App);\n}\n\nmodule.exports = App;\n"
  },
  {
    "path": "test/react/AssignSpread/simple-assign4.js",
    "content": "var React = require(\"react\");\n\nfunction App(props) {\n  var obj = Object.assign({}, { x: 20 }, props);\n  return <div>{obj.x}</div>;\n}\n\nApp.getTrials = function(renderer, Root) {\n  renderer.update(<Root x={10} />);\n  return [[\"simple render with object assign\", renderer.toJSON()]];\n};\n\nif (this.__optimizeReactComponentTree) {\n  __optimizeReactComponentTree(App);\n}\n\nmodule.exports = App;\n"
  },
  {
    "path": "test/react/AssignSpread/simple-assign5.js",
    "content": "var React = require(\"react\");\n\nfunction App(props) {\n  var obj1 = {};\n  var obj2 = {};\n  Object.assign(obj1, props, obj2, { x: 20 });\n  obj2.foo = 2;\n  return (\n    <div>\n      {obj1.x}\n      {obj1.foo}\n    </div>\n  );\n}\n\nApp.getTrials = function(renderer, Root) {\n  renderer.update(<Root x={10} />);\n  return [[\"simple render with object assign\", renderer.toJSON()]];\n};\n\nif (this.__optimizeReactComponentTree) {\n  __optimizeReactComponentTree(App);\n}\n\nmodule.exports = App;\n"
  },
  {
    "path": "test/react/AssignSpread/simple-with-jsx-spread.js",
    "content": "var React = require(\"react\");\n\nfunction IWantThisToBeInlined(props) {\n  return (\n    <div>\n      {props.text} {props.name} {props.id}\n    </div>\n  );\n}\n\nfunction Button(props) {\n  return props.switch ? <IWantThisToBeInlined {...props} /> : null;\n}\n\nButton.defaultProps = {\n  name: \"Dominic\",\n};\n\nfunction App(props) {\n  return <Button {...props} id={\"5\"} {...props} switch={true} />;\n}\n\nApp.getTrials = function(renderer, Root) {\n  renderer.update(<Root text={\"Hello world\"} id=\"6\" switch={false} />);\n  return [[\"simple render with jsx spread\", renderer.toJSON()]];\n};\n\nif (this.__optimizeReactComponentTree) {\n  __optimizeReactComponentTree(App);\n}\n\nmodule.exports = App;\n"
  },
  {
    "path": "test/react/AssignSpread/simple-with-jsx-spread10.js",
    "content": "var React = require(\"react\");\n\nfunction Child2(props) {\n  return <span>{props.text}</span>;\n}\n\nfunction Child(props) {\n  return (\n    <div {...props}>\n      <Child2 text={props.item1} />\n      <Child2 text={props.item2} />\n    </div>\n  );\n}\n\nChild.defaultProps = {\n  className: \"foobar\",\n  children: null,\n};\n\nfunction App(props) {\n  return <Child {...props} />;\n}\n\nApp.getTrials = function(renderer, Root) {\n  renderer.update(<Root item1=\"foo\" item2=\"bar\" />);\n  return [[\"simple render with jsx spread 10\", renderer.toJSON()]];\n};\n\nif (this.__optimizeReactComponentTree) {\n  __optimizeReactComponentTree(App);\n}\n\nmodule.exports = App;\n"
  },
  {
    "path": "test/react/AssignSpread/simple-with-jsx-spread11.js",
    "content": "var React = require(\"react\");\n\nfunction Child2(props) {\n  return <span>{props.text}</span>;\n}\n\nfunction Child(props) {\n  var newProps = Object.assign({}, props, {\n    className: \"foobar2\",\n    children: \"should not display\",\n  });\n  return (\n    <div {...newProps}>\n      <Child2 text={props.item1} />\n      <Child2 text={props.item2} />\n    </div>\n  );\n}\n\nChild.defaultProps = {\n  className: \"foobar\",\n  children: null,\n};\n\nfunction App(props) {\n  return <Child {...props} />;\n}\n\nApp.getTrials = function(renderer, Root) {\n  renderer.update(<Root item1=\"foo\" item2=\"bar\" />);\n  return [[\"simple render with jsx spread 11\", renderer.toJSON()]];\n};\n\nif (this.__optimizeReactComponentTree) {\n  __optimizeReactComponentTree(App);\n}\n\nmodule.exports = App;\n"
  },
  {
    "path": "test/react/AssignSpread/simple-with-jsx-spread12.js",
    "content": "var React = require(\"react\");\n\nfunction Button(props) {\n  return (\n    <span>\n      {props.name}\n      {props.text}\n    </span>\n  );\n}\n\nButton.defaultProps = {\n  name: \"Dominic\",\n};\n\nfunction App(props) {\n  return <Button {...props} name={undefined} />;\n}\n\nApp.getTrials = function(renderer, Root) {\n  renderer.update(<Root text={\"Hello world\"} />);\n  return [[\"simple render with jsx spread 12\", renderer.toJSON()]];\n};\n\nif (this.__optimizeReactComponentTree) {\n  __optimizeReactComponentTree(App);\n}\n\nmodule.exports = App;\n"
  },
  {
    "path": "test/react/AssignSpread/simple-with-jsx-spread13.js",
    "content": "var React = require(\"react\");\n\nfunction Button(props) {\n  return (\n    <span>\n      {props.name}\n      {props.text}\n    </span>\n  );\n}\n\nButton.defaultProps = {\n  name: \"Dominic\",\n};\n\nfunction App(props) {\n  return <Button {...props} />;\n}\n\nfunction App2(_props) {\n  return <Button {..._props} />;\n}\n\nApp.getTrials = function(renderer, Root) {\n  renderer.update(<Root text={\"Hello world\"} />);\n  return [[\"simple render with jsx spread 12\", renderer.toJSON()]];\n};\n\nApp.App2 = App2;\n\nif (this.__optimizeReactComponentTree) {\n  __optimizeReactComponentTree(App);\n  __optimizeReactComponentTree(App2);\n}\n\nmodule.exports = App;\n"
  },
  {
    "path": "test/react/AssignSpread/simple-with-jsx-spread2.js",
    "content": "var React = require(\"react\");\n\nfunction IWantThisToBeInlined(props) {\n  return (\n    <div>\n      {props.text} {props.name} {props.id}\n    </div>\n  );\n}\n\nfunction Button(props) {\n  return props.switch ? <IWantThisToBeInlined {...props} /> : null;\n}\n\nButton.defaultProps = {\n  name: \"Dominic\",\n};\n\nfunction App(props) {\n  return <Button {...props} id={\"5\"} switch={true} />;\n}\n\nApp.getTrials = function(renderer, Root) {\n  renderer.update(<Root text={\"Hello world\"} id=\"6\" switch={false} />);\n  return [[\"simple render with jsx spread 2\", renderer.toJSON()]];\n};\n\nif (this.__optimizeReactComponentTree) {\n  __optimizeReactComponentTree(App);\n}\n\nmodule.exports = App;\n"
  },
  {
    "path": "test/react/AssignSpread/simple-with-jsx-spread3.js",
    "content": "var React = require(\"react\");\n\nfunction Button(props) {\n  return <div {...props} />;\n}\n\nButton.defaultProps = {\n  id: \"Dominic\",\n};\n\nfunction App(props) {\n  return <Button {...props} children=\"Hello world\" />;\n}\n\nApp.getTrials = function(renderer, Root) {\n  renderer.update(<Root className=\"div-thing\" />);\n  return [[\"simple render with jsx spread 3\", renderer.toJSON()]];\n};\n\nif (this.__optimizeReactComponentTree) {\n  __optimizeReactComponentTree(App);\n}\n\nmodule.exports = App;\n"
  },
  {
    "path": "test/react/AssignSpread/simple-with-jsx-spread4.js",
    "content": "var React = require(\"react\");\n\nfunction App(props) {\n  var divProps = {};\n  Object.defineProperty(divProps, \"className\", {\n    get() {\n      return \"hi\";\n    },\n  });\n  return <div {...divProps} />;\n}\n\nApp.getTrials = function(renderer, Root) {\n  renderer.update(<Root />);\n  return [[\"simple render with jsx spread 4\", renderer.toJSON()]];\n};\n\nif (this.__optimizeReactComponentTree) {\n  __optimizeReactComponentTree(App);\n}\n\nmodule.exports = App;\n"
  },
  {
    "path": "test/react/AssignSpread/simple-with-jsx-spread5.js",
    "content": "var React = require(\"react\");\n\nfunction App(props) {\n  return <div {...props} />;\n}\n\nApp.getTrials = function(renderer, Root) {\n  var props = {};\n  renderer.update(<Root {...props} />);\n  return [[\"simple render with jsx spread 5\", renderer.toJSON()]];\n};\n\nif (this.__optimizeReactComponentTree) {\n  __optimizeReactComponentTree(App);\n}\n\nmodule.exports = App;\n"
  },
  {
    "path": "test/react/AssignSpread/simple-with-jsx-spread6.js",
    "content": "var React = require(\"react\");\n\nfunction App(props) {\n  return <div {...props.inner} />;\n}\n\nApp.getTrials = function(renderer, Root) {\n  renderer.update(<Root inner={{ className: \"foo\" }} />);\n  return [[\"simple render with jsx spread 6\", renderer.toJSON()]];\n};\n\nif (this.__optimizeReactComponentTree) {\n  __optimizeReactComponentTree(App);\n}\n\nmodule.exports = App;\n"
  },
  {
    "path": "test/react/AssignSpread/simple-with-jsx-spread7.js",
    "content": "var React = require(\"React\");\n\nfunction App(props) {\n  return <div {...props.foo}>{props.bar}</div>;\n}\n\nApp.getTrials = function(renderer, Root) {\n  let results = [];\n  renderer.update(<Root foo={{ children: undefined }} bar={undefined} />);\n  results.push([\"jsx spread\", renderer.toJSON()]);\n  renderer.update(<Root foo={{ children: \"prop children text\" }} bar={undefined} />);\n  results.push([\"jsx spread\", renderer.toJSON()]);\n  renderer.update(<Root foo={{ children: undefined }} bar={\"children prop text\"} />);\n  results.push([\"jsx spread\", renderer.toJSON()]);\n  return results;\n};\n\nif (this.__optimizeReactComponentTree) {\n  __optimizeReactComponentTree(App, {\n    firstRenderOnly: true,\n  });\n}\n\nmodule.exports = App;\n"
  },
  {
    "path": "test/react/AssignSpread/simple-with-jsx-spread8.js",
    "content": "var React = require(\"React\");\n\nfunction App(props) {\n  var data = {\n    a: 1,\n    b: 2,\n  };\n  return (\n    <div {...props.foo} {...data}>\n      {props.bar}\n    </div>\n  );\n}\n\nApp.getTrials = function(renderer, Root) {\n  let results = [];\n  renderer.update(<Root foo={{ children: undefined }} bar={undefined} />);\n  results.push([\"jsx spread\", renderer.toJSON()]);\n  renderer.update(<Root foo={{ children: \"prop children text\" }} bar={undefined} />);\n  results.push([\"jsx spread\", renderer.toJSON()]);\n  renderer.update(<Root foo={{ children: undefined }} bar={\"children prop text\"} />);\n  results.push([\"jsx spread\", renderer.toJSON()]);\n  return results;\n};\n\nif (this.__optimizeReactComponentTree) {\n  __optimizeReactComponentTree(App, {\n    firstRenderOnly: true,\n  });\n}\n\nmodule.exports = App;\n"
  },
  {
    "path": "test/react/AssignSpread/simple-with-jsx-spread9.js",
    "content": "var React = require(\"react\");\n\nfunction Child2(props) {\n  return <span>{props.text}</span>;\n}\n\nfunction Child(props) {\n  return (\n    <div {...props}>\n      <Child2 text={props.item1} />\n      <Child2 text={props.item2} />\n    </div>\n  );\n}\n\nfunction App(props) {\n  return <Child {...props} />;\n}\n\nApp.getTrials = function(renderer, Root) {\n  renderer.update(<Root item1=\"foo\" item2=\"bar\" />);\n  return [[\"simple render with jsx spread 9\", renderer.toJSON()]];\n};\n\nif (this.__optimizeReactComponentTree) {\n  __optimizeReactComponentTree(App);\n}\n\nmodule.exports = App;\n"
  },
  {
    "path": "test/react/AssignSpread/unsafe-spread.js",
    "content": "var React = require(\"react\");\n\nclass Wat extends React.Component {\n  render() {\n    return <div {...this.props} />;\n  }\n}\n\nfunction App(props) {\n  return <Wat {...props.inner} />;\n}\n\nApp.getTrials = function(renderer, Root) {\n  var obj;\n  function ref(inst) {\n    obj = inst;\n  }\n  renderer.update(<Root inner={{ className: \"foo\", ref }} />);\n  return [[\"simple render with jsx spread 6\", renderer.toJSON()], [\"type\", Object.keys(obj).join(\",\")]];\n};\n\nif (this.__optimizeReactComponentTree) {\n  __optimizeReactComponentTree(App);\n}\n\nmodule.exports = App;\n"
  },
  {
    "path": "test/react/AssignSpread-test.js",
    "content": "/**\n * Copyright (c) 2017-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n/* @flow */\n\nconst React = require(\"react\");\nconst setupReactTests = require(\"./setupReactTests\");\nconst { runTest } = setupReactTests();\n\n/* eslint-disable no-undef */\nconst { expect, it } = global;\n\nit(\"Unsafe spread\", () => {\n  runTest(__dirname + \"/AssignSpread/unsafe-spread.js\", {\n    expectReconcilerError: true,\n    // Don't attempt to recover even from PP0025.\n    shouldRecover: () => false,\n  });\n});\n\nit(\"Simple with multiple JSX spreads\", () => {\n  runTest(__dirname + \"/AssignSpread/simple-with-jsx-spread.js\");\n});\n\nit(\"Simple with multiple JSX spreads #2\", () => {\n  runTest(__dirname + \"/AssignSpread/simple-with-jsx-spread2.js\");\n});\n\nit(\"Simple with multiple JSX spreads #3\", () => {\n  runTest(__dirname + \"/AssignSpread/simple-with-jsx-spread3.js\");\n});\n\nit(\"Simple with multiple JSX spreads #4\", () => {\n  runTest(__dirname + \"/AssignSpread/simple-with-jsx-spread4.js\");\n});\n\nit(\"Simple with multiple JSX spreads #5\", () => {\n  runTest(__dirname + \"/AssignSpread/simple-with-jsx-spread5.js\");\n});\n\nit(\"Simple with multiple JSX spreads #6\", () => {\n  runTest(__dirname + \"/AssignSpread/simple-with-jsx-spread6.js\");\n});\n\nit(\"Simple with multiple JSX spreads #7\", () => {\n  runTest(__dirname + \"/AssignSpread/simple-with-jsx-spread7.js\");\n});\n\nit(\"Simple with multiple JSX spreads #8\", () => {\n  runTest(__dirname + \"/AssignSpread/simple-with-jsx-spread8.js\");\n});\n\nit(\"Simple with multiple JSX spreads #9\", () => {\n  runTest(__dirname + \"/AssignSpread/simple-with-jsx-spread9.js\");\n});\n\nit(\"Simple with multiple JSX spreads #10\", () => {\n  runTest(__dirname + \"/AssignSpread/simple-with-jsx-spread10.js\");\n});\n\nit(\"Simple with multiple JSX spreads #11\", () => {\n  runTest(__dirname + \"/AssignSpread/simple-with-jsx-spread11.js\");\n});\n\nit(\"Simple with multiple JSX spreads #12\", () => {\n  runTest(__dirname + \"/AssignSpread/simple-with-jsx-spread12.js\");\n});\n\nit(\"Simple with multiple JSX spreads #13\", () => {\n  runTest(__dirname + \"/AssignSpread/simple-with-jsx-spread13.js\");\n});\n\nit(\"Simple with Object.assign\", () => {\n  runTest(__dirname + \"/AssignSpread/simple-assign.js\");\n});\n\nit(\"Simple with Object.assign #2\", () => {\n  runTest(__dirname + \"/AssignSpread/simple-assign2.js\");\n});\n\nit(\"Simple with Object.assign #3\", () => {\n  runTest(__dirname + \"/AssignSpread/simple-assign3.js\");\n});\n\nit(\"Simple with Object.assign #4\", () => {\n  runTest(__dirname + \"/AssignSpread/simple-assign4.js\");\n});\n\nit(\"Simple with Object.assign #5\", () => {\n  runTest(__dirname + \"/AssignSpread/simple-assign5.js\");\n});\n"
  },
  {
    "path": "test/react/ClassComponents/array-from.js",
    "content": "var React = require(\"react\");\n\nfunction A(props) {\n  return (\n    <span>\n      {props.title} {props.foo}\n    </span>\n  );\n}\n\nclass App extends React.Component {\n  render() {\n    return (\n      <div>\n        {Array.from(\n          this.props.items,\n          function(item) {\n            return <A title={item.title} key={item.id} foo={this.props.foo} />;\n          }.bind(this)\n        )}\n      </div>\n    );\n  }\n}\n\nApp.getTrials = function(renderer, Root) {\n  let items = [{ title: \"Hello world 1\", id: 0 }, { title: \"Hello world 2\", id: 1 }, { title: \"Hello world 3\", id: 2 }];\n  renderer.update(<Root items={items} foo={123} />);\n  return [[\"simple render array map\", renderer.toJSON()]];\n};\n\nif (this.__optimizeReactComponentTree) {\n  __optimizeReactComponentTree(App);\n}\n\nmodule.exports = App;\n"
  },
  {
    "path": "test/react/ClassComponents/array-from2.js",
    "content": "var React = require(\"react\");\n\nfunction A(props) {\n  return (\n    <span>\n      {props.title} {props.foo}\n    </span>\n  );\n}\n\nclass App extends React.Component {\n  render() {\n    let self = this;\n    return (\n      <div>\n        {Array.from(this.props.items, function(item) {\n          return <A title={item.title} key={item.id} foo={self.props.foo} />;\n        })}\n      </div>\n    );\n  }\n}\n\nApp.getTrials = function(renderer, Root) {\n  let items = [{ title: \"Hello world 1\", id: 0 }, { title: \"Hello world 2\", id: 1 }, { title: \"Hello world 3\", id: 2 }];\n  renderer.update(<Root items={items} foo={123} />);\n  return [[\"simple render array map\", renderer.toJSON()]];\n};\n\nif (this.__optimizeReactComponentTree) {\n  __optimizeReactComponentTree(App);\n}\n\nmodule.exports = App;\n"
  },
  {
    "path": "test/react/ClassComponents/classes-with-state.js",
    "content": "var React = require(\"react\");\n\nclass App extends React.Component {\n  constructor(props) {\n    super(props);\n    this.state = {\n      title: \"It works!\",\n    };\n  }\n  render() {\n    return <div>{this.state.title}</div>;\n  }\n}\n\nApp.getTrials = function(renderer, Root) {\n  renderer.update(<Root />);\n  return [[\"render with class with state\", renderer.toJSON()]];\n};\n\nif (this.__optimizeReactComponentTree) {\n  __optimizeReactComponentTree(App);\n}\n\nmodule.exports = App;\n"
  },
  {
    "path": "test/react/ClassComponents/complex-class-into-functional-root.js",
    "content": "const React = require(\"react\");\n\nclass Child extends React.Component {\n  constructor() {\n    super();\n    this.handleClick = this.handleClick.bind(this);\n  }\n  handleClick() {\n    // works\n  }\n  render() {\n    return (\n      <div onClick={this.handleClick}>\n        Numbers: {this.props.x} {this.props.y}\n      </div>\n    );\n  }\n}\n\nfunction App(props) {\n  return (\n    <div>\n      <Child x={10} y={props.y} />\n    </div>\n  );\n}\n\nApp.getTrials = function(renderer, Root) {\n  let results = [];\n\n  renderer.update(<Root y={20} />);\n  results.push([\"render complex class component into functional component\", renderer.toJSON()]);\n  renderer.update(<Root y={40} />);\n  results.push([\"update complex class component into functional component\", renderer.toJSON()]);\n\n  return results;\n};\n\nif (this.__optimizeReactComponentTree) {\n  __optimizeReactComponentTree(App);\n}\n\nmodule.exports = App;\n"
  },
  {
    "path": "test/react/ClassComponents/complex-class-into-functional-root2.js",
    "content": "const React = require(\"react\");\n\nfunction Child2(props) {\n  return <span>{props.status}</span>;\n}\n\nclass Child extends React.Component {\n  constructor() {\n    super();\n    this.state = {\n      status: null,\n    };\n  }\n  componentWillReceiveProps() {\n    this.setState({\n      status: \"componentWillReceiveProps\",\n    });\n  }\n  componentDidMount() {\n    this.setState({\n      status: \"componentDidMount\",\n    });\n  }\n  render() {\n    return (\n      <div>\n        <Child2 {...this.state} />\n      </div>\n    );\n  }\n}\n\nfunction App(props) {\n  return (\n    <div>\n      <Child />\n    </div>\n  );\n}\n\nApp.getTrials = function(renderer, Root) {\n  let results = [];\n\n  renderer.update(<Root />);\n  results.push([\"render complex class component into functional component\", renderer.toJSON()]);\n\n  return results;\n};\n\nif (this.__optimizeReactComponentTree) {\n  __optimizeReactComponentTree(App);\n}\n\nmodule.exports = App;\n"
  },
  {
    "path": "test/react/ClassComponents/complex-class-into-functional-root3.js",
    "content": "const React = require(\"react\");\n\nclass Child2 extends React.Component {\n  constructor() {\n    super();\n  }\n  render() {\n    return <span>{this.props.state}</span>;\n  }\n}\n\nclass Child extends React.Component {\n  constructor() {\n    super();\n    this.state = {\n      status: null,\n    };\n  }\n  componentWillReceiveProps() {\n    this.setState({\n      status: \"componentWillReceiveProps\",\n    });\n  }\n  componentDidMount() {\n    this.setState({\n      status: \"componentDidMount\",\n    });\n  }\n  render() {\n    return (\n      <div>\n        <Child2 {...this.state} />\n      </div>\n    );\n  }\n}\n\nfunction App(props) {\n  return (\n    <div>\n      <Child />\n    </div>\n  );\n}\n\nApp.getTrials = function(renderer, Root) {\n  let results = [];\n\n  renderer.update(<Root />);\n  results.push([\"render complex class component into functional component\", renderer.toJSON()]);\n  renderer.update(<Root />);\n  results.push([\"update complex class component into functional component\", renderer.toJSON()]);\n  renderer.update(<Root />);\n  results.push([\"update complex class component into functional component\", renderer.toJSON()]);\n\n  return results;\n};\n\nif (this.__optimizeReactComponentTree) {\n  __optimizeReactComponentTree(App);\n}\n\nmodule.exports = App;\n"
  },
  {
    "path": "test/react/ClassComponents/complex-class-into-functional-root4.js",
    "content": "const React = require(\"react\");\n\nclass Child extends React.Component {\n  constructor() {\n    super();\n    this.handleClick = this.handleClick.bind(this);\n  }\n  handleClick() {\n    // works\n  }\n  render() {\n    return (\n      <div onClick={this.handleClick}>\n        Numbers: {this.props.x} {this.props.y}\n      </div>\n    );\n  }\n}\n\nfunction App(props) {\n  let x = [];\n  for (let i = 0; i < 10; i++) {\n    x.push(<Child x={10} y={props.y} />);\n  }\n  return <div>{x}</div>;\n}\n\nApp.getTrials = function(renderer, Root) {\n  let results = [];\n\n  renderer.update(<Root y={20} />);\n  results.push([\"render complex class component into functional component\", renderer.toJSON()]);\n  renderer.update(<Root y={40} />);\n  results.push([\"update complex class component into functional component\", renderer.toJSON()]);\n\n  return results;\n};\n\nif (this.__optimizeReactComponentTree) {\n  __optimizeReactComponentTree(App);\n}\n\nmodule.exports = App;\n"
  },
  {
    "path": "test/react/ClassComponents/complex-class-into-functional-root5.js",
    "content": "const React = require(\"react\");\n\nfunction Child2(props) {\n  return <span {...props} />;\n}\n\nclass Child extends React.Component {\n  constructor() {\n    super();\n  }\n  componentDidMount() {\n    // NO-OP\n  }\n  componentDidUpdate() {\n    // NO-OP\n  }\n  render() {\n    return (\n      <div>\n        <Child2 {...this.props} />\n      </div>\n    );\n  }\n}\n\nChild.defaultProps = {\n  className: \"class-name\",\n};\n\nfunction App(props) {\n  return (\n    <div>\n      <Child {...props} />\n    </div>\n  );\n}\n\nApp.getTrials = function(renderer, Root) {\n  let results = [];\n\n  renderer.update(<Root children={\"Hello world\"} />);\n  results.push([\"render complex class component into functional component\", renderer.toJSON()]);\n  renderer.update(<Root children={\"Hello world\"} />);\n  results.push([\"update complex class component into functional component\", renderer.toJSON()]);\n  renderer.update(<Root children={\"Hello world\"} />);\n  results.push([\"update complex class component into functional component\", renderer.toJSON()]);\n\n  return results;\n};\n\nif (this.__optimizeReactComponentTree) {\n  __optimizeReactComponentTree(App);\n}\n\nmodule.exports = App;\n"
  },
  {
    "path": "test/react/ClassComponents/complex-class-proper-hoisting.js",
    "content": "const React = require(\"react\");\n\nfunction Tau(props) {\n  return React.createElement(\n    \"a\",\n    null,\n    React.createElement(\"b\", null),\n    React.createElement(Epsilon, null),\n    React.createElement(\"c\", null)\n  );\n}\n\nclass Epsilon extends React.Component {\n  constructor(props) {\n    super(props);\n    this.state = {};\n  }\n\n  render() {\n    return React.createElement(React.Fragment, null, React.createElement(\"d\", null), React.createElement(\"b\", null));\n  }\n}\n\nif (this.__optimizeReactComponentTree) __optimizeReactComponentTree(Tau);\n\nTau.getTrials = renderer => {\n  const trials = [];\n\n  renderer.update(<Epsilon />);\n  trials.push([\"render Epsilon\", renderer.toJSON()]);\n\n  renderer.update(<Tau />);\n  trials.push([\"render Tau\", renderer.toJSON()]);\n\n  const a = Tau().props.children[0];\n  const b = Epsilon.prototype.render.call(undefined).props.children[1];\n  if (a.type !== \"b\" || b.type !== \"b\") throw new Error(\"Expected <b>s\");\n  trials.push([\"different React elements\", JSON.stringify(a !== b)]);\n\n  return trials;\n};\n\nmodule.exports = Tau;\n"
  },
  {
    "path": "test/react/ClassComponents/complex-class-with-equivalent-node.js",
    "content": "const React = require(\"react\");\n\nfunction Tau(props) {\n  return React.createElement(\n    \"div\",\n    null,\n    React.createElement(Epsilon, {\n      a: props.z,\n    }),\n    React.createElement(Zeta, {\n      p: props.h,\n    })\n  );\n}\n\nclass Epsilon extends React.Component {\n  constructor(props) {\n    super(props);\n    this.state = {};\n  }\n\n  render() {\n    return React.createElement(Zeta, { p: this.props.a });\n  }\n}\n\nfunction Zeta(props) {\n  return props.p ? null : React.createElement(\"foobar\", null);\n}\n\nif (this.__optimizeReactComponentTree) __optimizeReactComponentTree(Tau);\n\nTau.getTrials = function(renderer, Root) {\n  const trials = [];\n\n  renderer.update(<Root z={false} p={false} />);\n  trials.push([\"render 1\", renderer.toJSON()]);\n\n  renderer.update(<Root z={true} p={false} />);\n  trials.push([\"render 2\", renderer.toJSON()]);\n\n  renderer.update(<Root z={false} p={true} />);\n  trials.push([\"render 3\", renderer.toJSON()]);\n\n  renderer.update(<Root z={true} p={true} />);\n  trials.push([\"render 4\", renderer.toJSON()]);\n\n  return trials;\n};\n\nmodule.exports = Tau;\n"
  },
  {
    "path": "test/react/ClassComponents/inheritance-chain.js",
    "content": "const React = require(\"react\");\n\nclass Parent extends React.Component {\n  constructor() {\n    super();\n    this.state = {\n      a: 100,\n    };\n  }\n  render() {\n    if (this.props.x === 5) {\n      return <span>{this.state.a}</span>;\n    } else {\n      return <span>Hello world</span>;\n    }\n  }\n}\n\nthis[\"Parent\"] = Parent;\n\nclass Child extends Parent {\n  constructor() {\n    super();\n  }\n}\n\nclass App extends React.Component {\n  render() {\n    return (\n      <div>\n        <Child x={10} />\n      </div>\n    );\n  }\n}\n\nApp.getTrials = function(renderer, Root) {\n  renderer.update(<Root />);\n  return [[\"inheritance chain\", renderer.toJSON()]];\n};\n\nif (this.__optimizeReactComponentTree) {\n  __optimizeReactComponentTree(App);\n}\n\nmodule.exports = App;\n"
  },
  {
    "path": "test/react/ClassComponents/simple-classes-2.js",
    "content": "var React = require(\"react\");\n\nclass App extends React.Component {\n  render() {\n    return <div>Hello world</div>;\n  }\n}\n\nApp.getTrials = function(renderer, Root) {\n  renderer.update(<Root />);\n  return [[\"render simple classes\", renderer.toJSON()]];\n};\n\nif (this.__optimizeReactComponentTree) {\n  __optimizeReactComponentTree(App);\n}\n\nmodule.exports = App;\n"
  },
  {
    "path": "test/react/ClassComponents/simple-classes-3.js",
    "content": "const React = require(\"react\");\n\nclass Child extends React.Component {\n  constructor() {\n    super();\n    this.state = {\n      a: 1,\n    };\n  }\n  render() {\n    if (this.props.x === 5) {\n      return <span>{this.state.a}</span>;\n    } else {\n      return <span>Hello world</span>;\n    }\n  }\n}\n\nclass App extends React.Component {\n  render() {\n    return (\n      <div>\n        <Child x={10} />\n      </div>\n    );\n  }\n}\n\nApp.getTrials = function(renderer, Root) {\n  renderer.update(<Root />);\n  return [[\"render simple classes\", renderer.toJSON()]];\n};\n\nif (this.__optimizeReactComponentTree) {\n  __optimizeReactComponentTree(App);\n}\n\nmodule.exports = App;\n"
  },
  {
    "path": "test/react/ClassComponents/simple-classes.js",
    "content": "var React = require(\"react\");\n\nvar Child = (function(superclass) {\n  function Child() {\n    superclass.apply(this, arguments);\n  }\n\n  if (superclass) {\n    Child.__proto__ = superclass;\n  }\n  Child.prototype = Object.create(superclass && superclass.prototype);\n  Child.prototype.constructor = Child;\n  Child.prototype.render = function render() {\n    return <div>Hello world</div>;\n  };\n\n  return Child;\n})(React.Component);\n\nvar App = (function(superclass) {\n  function App() {\n    superclass.apply(this, arguments);\n  }\n\n  if (superclass) {\n    App.__proto__ = superclass;\n  }\n  App.prototype = Object.create(superclass && superclass.prototype);\n  App.prototype.constructor = App;\n  App.prototype.render = function render() {\n    return <Child />;\n  };\n  App.getTrials = function(renderer, Root) {\n    renderer.update(<Root />);\n    return [[\"render simple classes\", renderer.toJSON()]];\n  };\n\n  return App;\n})(React.Component);\n\nif (this.__optimizeReactComponentTree) {\n  __optimizeReactComponentTree(App);\n}\n\nmodule.exports = App;\n"
  },
  {
    "path": "test/react/ClassComponents/simple.js",
    "content": "var React = require(\"React\");\n\nclass MyComponent extends React.Component {\n  render() {\n    return <div>123</div>;\n  }\n}\n\nMyComponent.getTrials = function(renderer, Root) {\n  return [[`do not test the output, rather ensure test doesn't break`, true]];\n};\n\nif (this.__optimizeReactComponentTree) {\n  __optimizeReactComponentTree(MyComponent);\n}\n\nmodule.exports = MyComponent;\n"
  },
  {
    "path": "test/react/ClassComponents-test.js",
    "content": "/**\n * Copyright (c) 2017-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n/* @flow */\n\nconst setupReactTests = require(\"./setupReactTests\");\nconst { runTest } = setupReactTests();\n\n/* eslint-disable no-undef */\nconst { it } = global;\n\nit(\"Simple\", () => {\n  runTest(__dirname + \"/ClassComponents/simple.js\");\n});\n\nit(\"Simple classes\", () => {\n  runTest(__dirname + \"/ClassComponents/simple-classes.js\");\n});\n\nit(\"Simple classes #2\", () => {\n  runTest(__dirname + \"/ClassComponents/simple-classes-2.js\");\n});\n\nit(\"Simple classes #3\", () => {\n  runTest(__dirname + \"/ClassComponents/simple-classes-3.js\");\n});\n\nit(\"Simple classes with Array.from\", () => {\n  runTest(__dirname + \"/ClassComponents/array-from.js\");\n});\n\nit(\"Simple classes with Array.from 2\", () => {\n  runTest(__dirname + \"/ClassComponents/array-from2.js\");\n});\n\nit(\"Inheritance chaining\", () => {\n  runTest(__dirname + \"/ClassComponents/inheritance-chain.js\");\n});\n\nit(\"Classes with state\", () => {\n  runTest(__dirname + \"/ClassComponents/classes-with-state.js\");\n});\n\nit(\"Complex class components folding into functional root component\", () => {\n  runTest(__dirname + \"/ClassComponents/complex-class-into-functional-root.js\");\n});\n\nit(\"Complex class components folding into functional root component #2\", () => {\n  runTest(__dirname + \"/ClassComponents/complex-class-into-functional-root2.js\");\n});\n\nit(\"Complex class components folding into functional root component #3\", () => {\n  runTest(__dirname + \"/ClassComponents/complex-class-into-functional-root3.js\");\n});\n\nit(\"Complex class components folding into functional root component #4\", () => {\n  runTest(__dirname + \"/ClassComponents/complex-class-into-functional-root4.js\");\n});\n\nit(\"Complex class components folding into functional root component #5\", () => {\n  runTest(__dirname + \"/ClassComponents/complex-class-into-functional-root5.js\");\n});\n\nit(\"Complex class component rendering equivalent node to functional root component\", () => {\n  runTest(__dirname + \"/ClassComponents/complex-class-with-equivalent-node.js\");\n});\n\nit(\"Complex class component hoists nodes independently of functional root component\", () => {\n  runTest(__dirname + \"/ClassComponents/complex-class-proper-hoisting.js\");\n});\n"
  },
  {
    "path": "test/react/FBMocks/fb1.js",
    "content": "var React = require(\"React\");\nvar { QueryRenderer, graphql } = require(\"RelayModern\");\n\nif (!this.__evaluatePureFunction) {\n  this.__evaluatePureFunction = function(f) {\n    return f();\n  };\n}\n\nmodule.exports = this.__evaluatePureFunction(() => {\n  var FBEnvironment = require(\"FBEnvironment\");\n\n  function App({ initialNumComments, someVariables, query, pageSize, onCommit }) {\n    return (\n      <QueryRenderer\n        environment={FBEnvironment}\n        query={graphql`\n          ${query}\n        `}\n        variables={someVariables}\n        render={data => {\n          return <span>Hello world</span>;\n        }}\n      />\n    );\n  }\n\n  App.getTrials = function(renderer, Root) {\n    renderer.update(<Root />);\n    return [[\"fb1 mocks\", renderer.toJSON()]];\n  };\n\n  if (this.__optimizeReactComponentTree) {\n    __optimizeReactComponentTree(App);\n  }\n\n  return App;\n});\n"
  },
  {
    "path": "test/react/FBMocks/fb10.js",
    "content": "var React = require(\"React\");\n\nif (!this.__evaluatePureFunction) {\n  this.__evaluatePureFunction = function(f) {\n    return f();\n  };\n}\n\nmodule.exports = this.__evaluatePureFunction(() => {\n  function A(props) {\n    return (\n      <React.Fragment>\n        <div>\n          Hello {props.x} {props.y}\n        </div>\n        <B />\n        <C />\n      </React.Fragment>\n    );\n  }\n\n  function B() {\n    return <div>World</div>;\n  }\n\n  function C() {\n    return \"!\";\n  }\n\n  function App(props) {\n    const propsCopyWithDeletedProp = babelHelpers.extends({}, props);\n    delete propsCopyWithDeletedProp.y;\n    return React.createElement(\"div\", null, React.createElement(A, propsCopyWithDeletedProp));\n  }\n\n  App.getTrials = function(renderer, Root) {\n    renderer.update(<Root x={10} y={20} />);\n    return [[\"simple render\", renderer.toJSON()]];\n  };\n\n  if (this.__optimizeReactComponentTree) {\n    __optimizeReactComponentTree(App);\n  }\n\n  return App;\n});\n"
  },
  {
    "path": "test/react/FBMocks/fb11.js",
    "content": "var React = require(\"React\");\n\nif (!this.__evaluatePureFunction) {\n  this.__evaluatePureFunction = function(f) {\n    return f();\n  };\n}\n\nmodule.exports = this.__evaluatePureFunction(() => {\n  function A(props) {\n    return (\n      <React.Fragment>\n        <div>\n          Hello {props.x} {props.y}\n        </div>\n        <B />\n        <C />\n      </React.Fragment>\n    );\n  }\n\n  function B() {\n    return <div>World</div>;\n  }\n\n  function C() {\n    return \"!\";\n  }\n\n  function App(props) {\n    const propsCopyWithDeletedProp = babelHelpers.extends({}, props);\n    delete propsCopyWithDeletedProp.y;\n    return React.createElement(\n      \"div\",\n      null,\n      // Feel free to comment out either of these children\n      // individually when debugging specific cases.\n      React.createElement(A, babelHelpers.objectWithoutProperties(props, [\"x\"])),\n      React.createElement(A, babelHelpers.extends({}, props, { x: 30 })),\n      React.createElement(A, propsCopyWithDeletedProp)\n    );\n  }\n\n  App.getTrials = function(renderer, Root) {\n    renderer.update(<Root x={10} y={20} />);\n    return [[\"simple render\", renderer.toJSON()]];\n  };\n\n  if (this.__optimizeReactComponentTree) {\n    __optimizeReactComponentTree(App);\n  }\n\n  return App;\n});\n"
  },
  {
    "path": "test/react/FBMocks/fb12.js",
    "content": "var React = require(\"React\");\n\nif (!this.__evaluatePureFunction) {\n  this.__evaluatePureFunction = function(f) {\n    return f();\n  };\n}\n\nmodule.exports = this.__evaluatePureFunction(() => {\n  function nullthrows(x) {\n    var message =\n      arguments.length <= 1 || arguments[1] === undefined ? \"Got unexpected null or undefined\" : arguments[1];\n    if (x != null) {\n      return x;\n    }\n    var error = new Error(message);\n\n    error.framesToPop = 1;\n    throw error;\n  }\n\n  function A(props) {\n    return (\n      <div className={props.className}>\n        <div>\n          Hello {props.x} {props.y}\n        </div>\n        <B />\n        <C />\n      </div>\n    );\n  }\n\n  function B() {\n    return <div>World</div>;\n  }\n\n  function C() {\n    return \"!\";\n  }\n\n  function App(props) {\n    nullthrows(props.className);\n    return <A className={props.className} />;\n  }\n\n  App.getTrials = function(renderer, Root) {\n    renderer.update(<Root className=\"Rooty McRootface\" />);\n    return [[\"simple render\", renderer.toJSON()]];\n  };\n\n  if (this.__optimizeReactComponentTree) {\n    __optimizeReactComponentTree(App);\n  }\n\n  return App;\n});\n"
  },
  {
    "path": "test/react/FBMocks/fb13.js",
    "content": "function func(x) {\n  if (x) {\n    Bootloader.loadModules([\"Foo\"], function() {}, \"Bar\");\n  }\n}\n\nif (window.__optimize) {\n  __optimize(func);\n}\n\nfunc.getTrials = function(_, fn) {\n  if (!fn.toString().includes(\"Bootloader.loadModules(\")) {\n    throw new Error(\"Expected to find Bootloader.loadModules() call.\");\n  }\n  return [];\n};\n\nmodule.exports = func;\n"
  },
  {
    "path": "test/react/FBMocks/fb14.js",
    "content": "var React = require(\"React\");\nvar { createFragmentContainer } = require(\"RelayModern\");\n\nif (!this.__evaluatePureFunction) {\n  this.__evaluatePureFunction = function(f) {\n    return f();\n  };\n}\n\nmodule.exports = this.__evaluatePureFunction(() => {\n  function Child(props) {\n    return <div className={props.className}>uid: {props.id}</div>;\n  }\n\n  var Node = {\n    kind: \"Fragment\",\n    name: \"Test_foo\",\n    type: \"Foo\",\n    metadata: null,\n    argumentDefinitions: [],\n    selections: [\n      {\n        kind: \"ScalarField\",\n        alias: null,\n        name: \"id\",\n        args: null,\n        storageKey: null,\n      },\n    ],\n  };\n\n  var WrappedApp = createFragmentContainer(Child, {\n    foo: function foo() {\n      return Node;\n    },\n  });\n\n  function App(props, context) {\n    return <WrappedApp {...props} />;\n  }\n\n  if (this.__optimizeReactComponentTree) {\n    __optimizeReactComponentTree(App, {\n      firstRenderOnly: true,\n    });\n  }\n\n  // this is a mocked out relay mock for this test\n  class RelayMock extends React.Component {\n    getChildContext() {\n      return {\n        relay: {\n          environment: {\n            [\"@@RelayModernEnvironment\"]: true,\n            check() {},\n            lookup() {},\n            retain() {},\n            sendQuery() {},\n            execute() {},\n            subscribe() {},\n            unstable_internal: {\n              getFragment() {},\n              createFragmentSpecResolver() {\n                return {\n                  resolve() {\n                    return {\n                      className: \"fb-class\",\n                      title: \"Hello world\",\n                    };\n                  },\n                  isLoading() {\n                    return false;\n                  },\n                };\n              },\n            },\n          },\n          variables: {},\n        },\n      };\n    }\n    render() {\n      return <App />;\n    }\n  }\n\n  RelayMock.childContextTypes = {\n    relay: () => {},\n  };\n\n  RelayMock.getTrials = function(renderer, Root) {\n    renderer.update(<Root />);\n    return [[\"fb14 mocks\", renderer.toJSON()]];\n  };\n\n  return RelayMock;\n});\n"
  },
  {
    "path": "test/react/FBMocks/fb15.js",
    "content": "var React = require(\"React\");\n\nif (!this.__evaluatePureFunction) {\n  this.__evaluatePureFunction = function(f) {\n    return f();\n  };\n}\n\nmodule.exports = this.__evaluatePureFunction(() => {\n  function memoize(f) {\n    var f1 = f;\n    var result = void 0;\n    return function() {\n      if (f1) {\n        result = f1();\n        f1 = null;\n      }\n      return result;\n    };\n  }\n\n  var getMemoizedArray = memoize(function() {\n    return [];\n  });\n\n  var React = require(\"react\");\n\n  var _React$Component, _superProto;\n  _React$Component = babelHelpers.inherits(Inner, React.Component);\n  _superProto = _React$Component && _React$Component.prototype;\n  function Inner() {\n    var _superProto$construct;\n    var _temp;\n    for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {\n      args[_key] = arguments[_key];\n    }\n    return (\n      (_temp = (_superProto$construct = _superProto.constructor).call.apply(\n        _superProto$construct,\n        [this].concat(args)\n      )),\n      (this.state = {}),\n      _temp\n    );\n  }\n  Inner.prototype.render = function() {\n    var res = \"Loading...\".split(\"\").map(getMemoizedArray);\n    return React.createElement(\"div\", null, res);\n  };\n\n  function Outer(props) {\n    var isChronologicalOrder = props.foo === 42;\n    var inner1 = React.createElement(Inner, props.bar);\n    var inner2 = React.createElement(Inner, props.bar);\n    return isChronologicalOrder ? inner1 : inner2;\n  }\n\n  Outer.getTrials = function(renderer, Root) {\n    renderer.update(<Root />);\n    return [[\"fb15 mocks\", renderer.toJSON()]];\n  };\n\n  if (this.__optimizeReactComponentTree) {\n    __optimizeReactComponentTree(Outer, {\n      firstRenderOnly: true,\n    });\n  }\n\n  return Outer;\n});\n"
  },
  {
    "path": "test/react/FBMocks/fb16.js",
    "content": "var React = require(\"React\");\n\nif (!this.__evaluatePureFunction) {\n  this.__evaluatePureFunction = function(f) {\n    return f();\n  };\n}\n\n__evaluatePureFunction(function() {\n  var fbt;\n  var _cachedFbtResults = {};\n\n  fbt = function fbt() {};\n\n  fbt._ = function(table, args) {\n    var allSubstitutions = {};\n    var pattern = table;\n    if (table.__vcg) {\n      args = args || [];\n    }\n    if (args) {\n      pattern = this._accessTable(table, allSubstitutions, args, 0);\n    }\n    var cachedFbt = _cachedFbtResults[pattern];\n    var hasSubstitutions;\n    if (cachedFbt && !hasSubstitutions) {\n      return cachedFbt;\n    } else {\n      var fbtContent;\n      var result;\n      if (!hasSubstitutions) {\n        _cachedFbtResults[pattern] = result;\n      }\n      return result;\n    }\n  };\n\n  fbt._accessTable = function(table, substitutions, args, argsIndex) {\n    if (argsIndex >= args.length) {\n      return table;\n    } else if (table == null) {\n      return null;\n    }\n    var pattern = null;\n    var arg = args[argsIndex];\n    var tableIndex = arg[0];\n\n    if (!Array.isArray(tableIndex)) {\n      table = tableIndex !== null ? table[tableIndex] : table;\n      pattern = this._accessTable(table, substitutions, args, argsIndex + 1);\n    }\n    return pattern;\n  };\n\n  function _getNumberVariations(number) {\n    var numberType;\n    if (number === 1) {\n      return [\"\", numberType, \"*\"];\n    }\n    return [numberType, \"*\"];\n  }\n\n  fbt._param = fbt.param = function(label, value, variations) {\n    return [null, {}];\n  };\n\n  fbt._plural = fbt.plural = function(count, label, value) {\n    var variation = _getNumberVariations(count);\n    return [variation, []];\n  };\n\n  var React = require(\"react\");\n  function ViewCount(props) {\n    return React.createElement(\n      \"div\",\n      null,\n      fbt._({ \"*\": \"{count} Views\", _1: \"{count} View\" }, [\n        fbt._param(\"count\", props.feedback.viewCountReduced),\n        fbt._plural(props.feedback.viewCount),\n      ])\n    );\n  }\n\n  ViewCount.getTrials = function(renderer, Root) {\n    renderer.update(<Root feedback={{ viewCountReduced: 0, viewCount: 0 }} />);\n    return [[\"fb16 mocks\", renderer.toJSON()]];\n  };\n\n  if (this.__optimizeReactComponentTree) {\n    __optimizeReactComponentTree(ViewCount, {\n      firstRenderOnly: true,\n    });\n  }\n\n  module.exports = ViewCount;\n});\n"
  },
  {
    "path": "test/react/FBMocks/fb17.js",
    "content": "var React = require(\"React\");\n\nif (!this.__evaluatePureFunction) {\n  this.__evaluatePureFunction = function(f) {\n    return f();\n  };\n}\n\n__evaluatePureFunction(function() {\n  function Inner(props) {\n    return props.children();\n  }\n\n  function Middle(props) {\n    var bar = props.bar;\n    if (!bar) {\n      return null;\n    }\n    return props.children();\n  }\n\n  function Outer(props) {\n    return React.createElement(\n      Middle,\n      {\n        bar: props.foo,\n      },\n      function() {\n        return React.createElement(Inner, props);\n      }\n    );\n  }\n\n  function App(props) {\n    return React.createElement(\n      Outer,\n      {\n        foo: props.foo,\n      },\n      function() {\n        return null;\n      }\n    );\n  }\n\n  App.getTrials = function(renderer, Root) {\n    renderer.update(<Root foo={true} />);\n    return [[\"fb17 mocks\", renderer.toJSON()]];\n  };\n\n  if (this.__optimizeReactComponentTree) {\n    __optimizeReactComponentTree(App, {\n      firstRenderOnly: true,\n    });\n  }\n\n  module.exports = App;\n});\n"
  },
  {
    "path": "test/react/FBMocks/fb18.js",
    "content": "var React = require(\"React\");\n\nif (!this.__evaluatePureFunction) {\n  this.__evaluatePureFunction = function(f) {\n    return f();\n  };\n}\n\n__evaluatePureFunction(function() {\n  function parse(unused, uri) {\n    if (!uri) {\n      return;\n    }\n    if (uri instanceof URI) {\n      uri.foo();\n    }\n    var uri2 = uri.toString().trim();\n    if (uri2.foo()) {\n      return;\n    }\n    try {\n      unused.bar();\n    } catch (err) {}\n  }\n\n  function URI() {}\n\n  function App(props) {\n    var input = \"http://hi/\" + props.foo;\n    parse(null, input);\n    new URI(input);\n  }\n\n  if (this.__optimizeReactComponentTree) {\n    __optimizeReactComponentTree(App, {\n      firstRenderOnly: true,\n    });\n  }\n\n  window.app = App;\n});\n"
  },
  {
    "path": "test/react/FBMocks/fb19.js",
    "content": "var React = require(\"React\");\n\nif (!this.__evaluatePureFunction) {\n  this.__evaluatePureFunction = function(f) {\n    return f();\n  };\n}\n\n__evaluatePureFunction(function() {\n  function FbtResult() {}\n  FbtResult.prototype.$$typeof = Symbol.for(\"react.element\");\n\n  function fbt() {}\n  function param() {}\n  function plural(shouldThrow) {\n    if (shouldThrow) {\n      throw new Error(\"no\");\n    }\n  }\n\n  var React = require(\"react\");\n\n  function App(props) {\n    return React.createElement(\"div\", new FbtResult({}, [param(props.foo), plural(props.bar)]));\n  }\n\n  App.getTrials = function(renderer, Root) {\n    renderer.update(<Root bar={false} />);\n    return [[\"fb19 mocks\", renderer.toJSON()]];\n  };\n\n  if (this.__optimizeReactComponentTree) {\n    __optimizeReactComponentTree(App, {\n      firstRenderOnly: true,\n    });\n  }\n\n  module.exports = App;\n});\n"
  },
  {
    "path": "test/react/FBMocks/fb2.js",
    "content": "var React = require(\"React\");\n\nvar obj = { a: 1, b: 2, c: 3 };\n\n// FB www class transform output\nconst _React$Component = babelHelpers.inherits(Hello, React.Component);\nHello.prototype.componentDidMount = function() {\n  // keep the lifecycle to prevent functional conversion\n};\nHello.prototype.render = function() {\n  return React.createElement(\n    \"h1\",\n    // Regression test for bad serialization of computed properties\n    babelHelpers[\"extends\"]({}, this.__unknownAbstract),\n    \"Hello world\",\n    Object.keys(babelHelpers.objectWithoutProperties(obj, [\"a\", \"c\"]))\n  );\n};\nfunction Hello() {\n  _React$Component.apply(this, arguments);\n}\n\nHello.getTrials = function(renderer, Root) {\n  renderer.update(<Root />);\n  return [[\"fb2 mocks\", renderer.toJSON()]];\n};\n\nif (window.__optimizeReactComponentTree) {\n  __optimizeReactComponentTree(Hello);\n}\n\nmodule.exports = Hello;\n"
  },
  {
    "path": "test/react/FBMocks/fb20.js",
    "content": "var React = require(\"React\");\n\nif (!this.__evaluatePureFunction) {\n  this.__evaluatePureFunction = function(f) {\n    return f();\n  };\n}\n\n__evaluatePureFunction(function() {\n  function URI() {}\n\n  URI.prototype.method = function() {\n    return 123;\n  };\n\n  function Child(props) {\n    return props.children();\n  }\n\n  function App(props) {\n    var obj = new URI();\n    if (props.cond1) {\n      return null;\n    }\n    if (props.cond2) {\n      obj = new URI();\n    }\n    return (\n      <Child>\n        {function() {\n          return obj.method();\n        }}\n      </Child>\n    );\n  }\n\n  App.getTrials = function(renderer, Root) {\n    renderer.update(<Root cond1={false} cond2={true} />);\n    return [[\"fb20 mocks\", renderer.toJSON()]];\n  };\n\n  if (this.__optimizeReactComponentTree) {\n    __optimizeReactComponentTree(App, {\n      firstRenderOnly: true,\n    });\n  }\n\n  module.exports = App;\n});\n"
  },
  {
    "path": "test/react/FBMocks/fb21.js",
    "content": "var React = require(\"react\");\nvar ReactDOM = require(\"react-dom\");\n\nfunction A(props) {\n  return <div>Hello {props.x}</div>;\n}\n\nfunction B() {\n  return <div>World</div>;\n}\n\nfunction C() {\n  return \"!\";\n}\n\nfunction App() {\n  return (\n    <div>\n      <A x={42} />\n      <B />\n      <C />\n    </div>\n  );\n}\n\nApp.getTrials = function(renderer, Root) {\n  renderer.update(<Root />);\n  return [[\"simple render\", renderer.toJSON()]];\n};\n\nif (this.__optimizeReactComponentTree) {\n  __optimizeReactComponentTree(App);\n}\n\nvar x = document.createElement(\"div\");\n\nReactDOM.render(App, x);\nReactDOM.hydrate(App, x);\n"
  },
  {
    "path": "test/react/FBMocks/fb22.js",
    "content": "var React = require(\"React\");\n\nif (!this.__evaluatePureFunction) {\n  this.__evaluatePureFunction = function(f) {\n    return f();\n  };\n}\n\n__evaluatePureFunction(function() {\n  var React = require(\"react\");\n\n  function App(props) {\n    return React.createElement(React.Fragment, null, \"123\");\n  }\n\n  App.getTrials = function(renderer, Root) {\n    renderer.update(<Root />);\n    return [[\"fb22 mocks\", renderer.toJSON()]];\n  };\n\n  if (this.__optimizeReactComponentTree) {\n    __optimizeReactComponentTree(App, {\n      firstRenderOnly: true,\n    });\n  }\n\n  module.exports = App;\n});\n"
  },
  {
    "path": "test/react/FBMocks/fb23.js",
    "content": "var React = require(\"react\");\nvar ReactDOMServer = require(\"react-dom/server\");\n\nfunction A(props) {\n  return <div>Hello {props.x}</div>;\n}\n\nfunction B() {\n  return <div>World</div>;\n}\n\nfunction C() {\n  return \"!\";\n}\n\nfunction App() {\n  return (\n    <div>\n      <A x={42} />\n      <B />\n      <C />\n    </div>\n  );\n}\n\nvar x = ReactDOMServer.renderToString(App);\nvar y = ReactDOMServer.renderToStaticMarkup(App);\n\nApp.getTrials = function(renderer, Root) {\n  let results = [];\n  renderer.update(<Root />);\n  results.push([\"fb23\", renderer.toJSON()]);\n  results.push([\"renderToString\", x]);\n  results.push([\"renderToStaticMarkup\", y]);\n  return results;\n};\n\nif (this.__optimizeReactComponentTree) {\n  __optimizeReactComponentTree(App);\n}\n"
  },
  {
    "path": "test/react/FBMocks/fb24.js",
    "content": "var React = require(\"react\");\n\nfunction App(props) {\n  var data = {};\n  var someProps = Object.assign(data, props, {\n    text: \"Text!\",\n  });\n  var propsWithout = babelHelpers.objectWithoutProperties(data, []);\n  return <div>{propsWithout.text}</div>;\n}\n\nApp.getTrials = function(renderer, Root, data, isCompiled) {\n  if (isCompiled) {\n    var a = App({});\n    var b = App({});\n    if (a !== b) {\n      throw new Error(\"The values should be the same!\");\n    }\n  }\n  renderer.update(<Root />);\n  return [[\"fb24\", renderer.toJSON()]];\n};\n\nif (this.__optimizeReactComponentTree) {\n  __optimizeReactComponentTree(App);\n}\n\nmodule.exports = App;\n"
  },
  {
    "path": "test/react/FBMocks/fb25.js",
    "content": "var React = require(\"react\");\n\nfunction App(props) {\n  var someProps = Object.assign({}, props, {\n    text: \"Text!\",\n  });\n  var propsWithout = babelHelpers.objectWithoutProperties(someProps, []);\n  return <div>{propsWithout.text}</div>;\n}\n\nApp.getTrials = function(renderer, Root, data, isCompiled) {\n  if (isCompiled) {\n    var a = App({});\n    var b = App({});\n    if (a !== b) {\n      throw new Error(\"The values should be the same!\");\n    }\n  }\n  renderer.update(<Root />);\n  return [[\"fb25\", renderer.toJSON()]];\n};\n\nif (this.__optimizeReactComponentTree) {\n  __optimizeReactComponentTree(App);\n}\n\nmodule.exports = App;\n"
  },
  {
    "path": "test/react/FBMocks/fb3.js",
    "content": "if (!window.__evaluatePureFunction) {\n  window.__evaluatePureFunction = function(f) {\n    return f();\n  };\n}\n\n(function() {\n  function App() {}\n  require(\"React\");\n\n  var ReactRelay = require(\"RelayModern\");\n\n  window.__evaluatePureFunction(() => {\n    ReactRelay.createFragmentContainer(App);\n  });\n})();\n"
  },
  {
    "path": "test/react/FBMocks/fb4.js",
    "content": "if (!this.__evaluatePureFunction) {\n  this.__evaluatePureFunction = function(f) {\n    return f();\n  };\n}\n\nfunction App() {}\nApp.prototype.hi = function() {};\n\nApp.arr = [1, 2, 3];\nApp.otherArray = [];\nApp.otherArray.length = 10;\n\nthis.WrappedApp = this.__evaluatePureFunction(() => {\n  require(\"React\");\n  return require(\"RelayModern\").createFragmentContainer(App);\n});\n"
  },
  {
    "path": "test/react/FBMocks/fb5.js",
    "content": "var React = require(\"React\");\n\nif (!this.__evaluatePureFunction) {\n  this.__evaluatePureFunction = function(f) {\n    return f();\n  };\n}\n\nmodule.exports = this.__evaluatePureFunction(() => {\n  if (!this.Bootloader) {\n    this.Bootloader = { loadModules() {} };\n  }\n\n  if (!this.JSResource) {\n    this.JSResource = { loadAll() {} };\n  }\n\n  if (!this.ix) {\n    this.ix = () => {};\n  }\n\n  // Verify that the generated code can still reference abstract values correctly.\n  this.abstractTrue = this.__abstract ? __abstract(\"boolean\", \"true\") : true;\n  this.abstractFalse = this.__abstract ? __abstract(\"boolean\", \"false\") : false;\n\n  function getClassNames() {\n    return [\n      cx(\"cx-one\"),\n      cx(\"cx-multi-1\", \"cx-multi-2\"),\n      cx({\n        \"cx-obj-1\": true,\n        \"cx-obj-2\": false,\n        \"cx-obj-3-true\": abstractTrue,\n        \"cx-obj-4-false\": abstractFalse,\n      }),\n    ];\n  }\n\n  JSResource.loadAll(\"hi\");\n  Bootloader.loadModules(\"somethingYes\", function() {});\n\n  // Hoist to force the init time calculation\n  var classNames = getClassNames();\n  function App() {\n    return <div className={classNames} />;\n  }\n  App.getClassNames = getClassNames;\n\n  function assertMatchesInSource(fn, regex, expectedCount) {\n    const matches = fn.toString().match(regex);\n    const count = matches ? matches.length : 0;\n    if (count !== expectedCount) {\n      throw new Error(\n        `Expected ${expectedCount} matches of ${regex} in the function ` +\n          `source but found ${count}:\\n\\n${fn.toString()}`\n      );\n    }\n  }\n\n  App.getTrials = function(renderer, Root) {\n    // Check that matches didn't get renamed\n    assertMatchesInSource(Root.getClassNames, /[^\\w]cx\\(/g, 3);\n\n    renderer.update(<Root />);\n    return [[\"fb5 mocks\", renderer.toJSON()]];\n  };\n\n  return App;\n});\n"
  },
  {
    "path": "test/react/FBMocks/fb6.js",
    "content": "var React = require(\"React\");\n\nvar div = <div data-ft={'{\"tn\": \"O\"}'} />;\n\nfunction App(props) {\n  return (\n    <div className={cx(\"yar/Jar\")}>\n      <span className={cx(\"foo/bar\", \"foo/bar\")}>\n        <a\n          href=\"#\"\n          className={cx({\n            \"foo/bar1\": true,\n            \"foo/bar2\": false,\n            \"foo/bar3\": props.val,\n            \"foo/bar4\": props.val + props.val,\n          })}\n        >\n          I am a link\n        </a>\n        {div}\n      </span>\n    </div>\n  );\n}\n\nfunction assertMatchesInSource(fn, regex, expectedCount) {\n  const matches = fn.toString().match(regex);\n  const count = matches ? matches.length : 0;\n  if (count !== expectedCount) {\n    throw new Error(\n      `Expected ${expectedCount} matches of ${regex} in the function ` +\n        `source but found ${count}:\\n\\n${fn.toString()}`\n    );\n  }\n}\n\nApp.getTrials = function(renderer, Root) {\n  // Check that matches didn't get renamed\n  assertMatchesInSource(Root, /[^\\w]cx\\(/g, 3);\n\n  renderer.update(<Root val={10} />);\n  return [[\"fb6 mocks\", renderer.toJSON()]];\n};\n\nmodule.exports = App;\n"
  },
  {
    "path": "test/react/FBMocks/fb7.js",
    "content": "var React = require(\"React\");\nvar { createFragmentContainer } = require(\"RelayModern\");\n\nif (!this.__evaluatePureFunction) {\n  this.__evaluatePureFunction = function(f) {\n    return f();\n  };\n}\n\nmodule.exports = this.__evaluatePureFunction(() => {\n  function App(props) {\n    return <div className={props.className}>uid: {props.id}</div>;\n  }\n\n  var Node = {\n    kind: \"Fragment\",\n    name: \"Test_foo\",\n    type: \"Foo\",\n    metadata: null,\n    argumentDefinitions: [],\n    selections: [\n      {\n        kind: \"ScalarField\",\n        alias: null,\n        name: \"id\",\n        args: null,\n        storageKey: null,\n      },\n    ],\n  };\n\n  var WrappedApp = createFragmentContainer(App, {\n    foo: function foo() {\n      return Node;\n    },\n  });\n\n  if (this.__optimizeReactComponentTree) {\n    __optimizeReactComponentTree(WrappedApp);\n  }\n\n  // this is a mocked out relay mock for this test\n  class RelayMock extends React.Component {\n    getChildContext() {\n      return {\n        relay: {\n          environment: {\n            [\"@@RelayModernEnvironment\"]: true,\n            check() {},\n            lookup() {},\n            retain() {},\n            sendQuery() {},\n            execute() {},\n            subscribe() {},\n            unstable_internal: {\n              getFragment() {},\n              createFragmentSpecResolver() {\n                return {\n                  resolve() {\n                    return {\n                      className: \"fb-class\",\n                      title: \"Hello world\",\n                    };\n                  },\n                  isLoading() {\n                    return false;\n                  },\n                };\n              },\n            },\n          },\n          variables: {},\n        },\n      };\n    }\n    render() {\n      return <WrappedApp />;\n    }\n  }\n\n  RelayMock.childContextTypes = {\n    relay: () => {},\n  };\n\n  RelayMock.getTrials = function(renderer, Root) {\n    renderer.update(<Root />);\n    return [[\"fb7 mocks\", renderer.toJSON()]];\n  };\n\n  return RelayMock;\n});\n"
  },
  {
    "path": "test/react/FBMocks/fb8.js",
    "content": "var React = require(\"React\");\nvar { createFragmentContainer } = require(\"RelayModern\");\n\nif (!this.__evaluatePureFunction) {\n  this.__evaluatePureFunction = function(f) {\n    return f();\n  };\n}\n\nmodule.exports = this.__evaluatePureFunction(() => {\n  function Child(props) {\n    return <div className={props.className}>uid: {props.id}</div>;\n  }\n\n  var Node = {\n    kind: \"Fragment\",\n    name: \"Test_foo\",\n    type: \"Foo\",\n    metadata: null,\n    argumentDefinitions: [],\n    selections: [\n      {\n        kind: \"ScalarField\",\n        alias: null,\n        name: \"id\",\n        args: null,\n        storageKey: null,\n      },\n    ],\n  };\n\n  var WrappedApp = createFragmentContainer(Child, {\n    foo: function foo() {\n      return Node;\n    },\n  });\n\n  function App() {\n    return (\n      <span>\n        This contains a ReactRelay container:<WrappedApp />\n      </span>\n    );\n  }\n\n  if (this.__optimizeReactComponentTree) {\n    __optimizeReactComponentTree(App);\n  }\n\n  // this is a mocked out relay mock for this test\n  class RelayMock extends React.Component {\n    getChildContext() {\n      return {\n        relay: {\n          environment: {\n            [\"@@RelayModernEnvironment\"]: true,\n            check() {},\n            lookup() {},\n            retain() {},\n            sendQuery() {},\n            execute() {},\n            subscribe() {},\n            unstable_internal: {\n              getFragment() {},\n              createFragmentSpecResolver() {\n                return {\n                  resolve() {\n                    return {\n                      className: \"fb-class\",\n                      title: \"Hello world\",\n                    };\n                  },\n                  isLoading() {\n                    return false;\n                  },\n                };\n              },\n            },\n          },\n          variables: {},\n        },\n      };\n    }\n    render() {\n      return <App />;\n    }\n  }\n\n  RelayMock.childContextTypes = {\n    relay: () => {},\n  };\n\n  RelayMock.getTrials = function(renderer, Root) {\n    renderer.update(<Root />);\n    return [[\"fb8 mocks\", renderer.toJSON()]];\n  };\n\n  return RelayMock;\n});\n"
  },
  {
    "path": "test/react/FBMocks/fb9.js",
    "content": "var React = require(\"React\");\n\nmodule.exports = this.__evaluatePureFunction(() => {\n  function A(props) {\n    return (\n      <React.Fragment>\n        <div>\n          Hello {props.x} {props.y}\n        </div>\n        <B />\n        <C />\n      </React.Fragment>\n    );\n  }\n\n  function B() {\n    return <div>World</div>;\n  }\n\n  function C() {\n    return \"!\";\n  }\n\n  function App(props) {\n    return React.createElement(\n      \"div\",\n      null,\n      React.createElement(A, babelHelpers.objectWithoutProperties(props, [\"x\"])),\n      React.createElement(A, babelHelpers.extends({}, props, { x: 30 }))\n    );\n  }\n\n  App.getTrials = function(renderer, Root) {\n    renderer.update(<Root x={10} y={20} />);\n    return [[\"simple render\", renderer.toJSON()]];\n  };\n\n  if (this.__optimizeReactComponentTree) {\n    __optimizeReactComponentTree(App);\n  }\n\n  return App;\n});\n"
  },
  {
    "path": "test/react/FBMocks/function-bind.js",
    "content": "var React = require(\"react\");\n\nvar _React$Component = babelHelpers.inherits(Middle, React.Component);\n_superProto = _React$Component && _React$Component.prototype;\n\nfunction Middle(props) {\n  _superProto.constructor.call(this, props);\n  this.$Middle_renderItem = function() {\n    return this.props.item;\n  }.bind(this);\n}\nMiddle.prototype.render = function() {\n  var children = this.props.children;\n  return children({\n    renderItem: this.$Middle_renderItem,\n  });\n};\n\nfunction App(props) {\n  return <Middle {...props} />;\n}\n\nApp.getTrials = function(renderer, Root) {\n  renderer.update(<Root item={<span>Hi</span>}>{obj => <h1>{obj.renderItem()}</h1>}</Root>);\n  return [[\"render with bound child function\", renderer.toJSON()]];\n};\n\nif (this.__optimizeReactComponentTree) {\n  __optimizeReactComponentTree(App, {\n    firstRenderOnly: true,\n  });\n}\n\nmodule.exports = App;\n"
  },
  {
    "path": "test/react/FBMocks/hacker-news.js",
    "content": "const React = require(\"React\");\nconst PropTypes = require(\"PropTypes\");\n\nif (!this.__evaluatePureFunction) {\n  this.__evaluatePureFunction = function(f) {\n    return f();\n  };\n}\n\nmodule.exports = this.__evaluatePureFunction(() => {\n  function timeAge(time) {\n    const now = new Date(2042, 1, 1).getTime() / 1000;\n    const minutes = (now - time) / 60;\n\n    if (minutes < 60) {\n      return Math.round(minutes) + \" minutes ago\";\n    }\n    return Math.round(minutes / 60) + \" hours ago\";\n  }\n\n  function getHostUrl(url) {\n    return (url + \"\")\n      .replace(\"https://\", \"\")\n      .replace(\"http://\", \"\")\n      .split(\"/\")[0];\n  }\n\n  function Story({ story, rank }) {\n    return (\n      <React.Fragment>\n        <tr className=\"athing\">\n          <td\n            style={{\n              verticalAlign: \"top\",\n              textAlign: \"right\",\n            }}\n            className=\"title\"\n          >\n            <span className=\"rank\">{rank + \".\"}</span>\n          </td>\n          <td\n            className=\"votelinks\"\n            style={{\n              verticalAlign: \"top\",\n            }}\n          >\n            <center>\n              <a href=\"#\">\n                <div className=\"votearrow\" titl=\"upvote\" />\n              </a>\n            </center>\n          </td>\n          <td className=\"title\">\n            <a href=\"#\" className=\"storylink\">\n              {story.title}\n            </a>\n            {story.url ? (\n              <span className=\"sitebit comhead\">\n                {\" (\"}\n                <a href=\"#\">{getHostUrl(story.url)}</a>)\n              </span>\n            ) : null}\n          </td>\n        </tr>\n        <tr>\n          <td colSpan=\"2\" />\n          <td className=\"subtext\">\n            <span className=\"score\">{story.score + \" points\"}</span>\n            {\" by \"}\n            <a href=\"#\" className=\"hnuser\">\n              {story.by}\n            </a>{\" \"}\n            <span className=\"age\">\n              <a href=\"#\">{timeAge(story.time)}</a>\n            </span>\n            {\" | \"}\n            <a href=\"#\">hide</a>\n            {\" | \"}\n            <a href=\"#\">{(story.descendants || 0) + \" comments\"}</a>\n          </td>\n        </tr>\n        <tr\n          style={{\n            height: 5,\n          }}\n          className=\"spacer\"\n        />\n      </React.Fragment>\n    );\n  }\n\n  Story.propTypes = {\n    story: PropTypes.shape({\n      title: PropTypes.string,\n      url: PropTypes.string,\n      score: PropTypes.number,\n      descendants: PropTypes.number,\n      by: PropTypes.string,\n      time: PropTypes.number,\n    }),\n    rank: PropTypes.number,\n  };\n\n  function StoryList({ stories }) {\n    return (\n      <tr>\n        <td>\n          <table cellPadding=\"0\" cellSpacing=\"0\" className=\"itemlist\">\n            <tbody>\n              {// we use Array.from to tell the compiler that this\n              // is definitely an array object\n              Array.from(stories).map((story, i) => <Story story={story} rank={++i} key={story.id} />)}\n            </tbody>\n          </table>\n        </td>\n      </tr>\n    );\n  }\n\n  function HeaderBar(props) {\n    return (\n      <tr style={{ backgroundColor: \"#222\" }}>\n        <table\n          style={{\n            padding: 4,\n          }}\n          width=\"100%\"\n          cellSpacing=\"0\"\n          cellPadding=\"0\"\n        >\n          <tbody>\n            <tr>\n              <td style={{ width: 18, paddingRight: 4 }}>\n                <a href=\"#\">\n                  <img\n                    src=\"logo.png\"\n                    width=\"16\"\n                    height=\"16\"\n                    style={{\n                      border: \"1px solid #00d8ff\",\n                    }}\n                  />\n                </a>\n              </td>\n              <td style={{ lineHeight: \"12pt\" }} height=\"10\">\n                <span className=\"pagetop\">\n                  <b className=\"hnname\">{props.title}</b>\n                  <a href=\"#\">new</a>\n                  {\" | \"}\n                  <a href=\"#\">comments</a>\n                  {\" | \"}\n                  <a href=\"#\">show</a>\n                  {\" | \"}\n                  <a href=\"#\">ask</a>\n                  {\" | \"}\n                  <a href=\"#\">jobs</a>\n                  {\" | \"}\n                  <a href=\"#\">submit</a>\n                </span>\n              </td>\n            </tr>\n          </tbody>\n        </table>\n      </tr>\n    );\n  }\n\n  HeaderBar.defaultProps = {\n    title: \"React HN Benchmark\",\n  };\n\n  class AppBody extends React.Component {\n    render() {\n      return (\n        <React.Fragment>\n          <HeaderBar />\n          <tr height=\"10\" />\n          <StoryList stories={this.props.stories} limit={this.props.storyLimit} />\n        </React.Fragment>\n      );\n    }\n  }\n\n  AppBody.defaultProps = {\n    storyLimit: 10,\n  };\n\n  function App({ stories }) {\n    return (\n      <center>\n        <table\n          id=\"hnmain\"\n          border=\"0\"\n          cellPadding=\"0\"\n          cellSpacing=\"0\"\n          width=\"85%\"\n          style={{\n            backgroundColor: \"#f6f6ef\",\n          }}\n        >\n          <tbody>{stories.length > 0 ? <AppBody stories={stories} /> : null}</tbody>\n        </table>\n      </center>\n    );\n  }\n\n  App.getTrials = function(renderer, Root, data) {\n    let results = [];\n    renderer.update(<Root stories={data} />);\n    results.push([\"hacker news\", renderer.toJSON()]);\n\n    return results;\n  };\n\n  // we run the getTrials from both version rather than\n  // from the non-compiled version\n  App.independent = true;\n\n  App.propTypes = {\n    stories: PropTypes.array.isRequired,\n  };\n\n  if (this.__optimizeReactComponentTree) {\n    __optimizeReactComponentTree(App);\n  }\n\n  return App;\n});\n"
  },
  {
    "path": "test/react/FBMocks/hacker-news.json",
    "content": "[{\"by\":\"rendx\",\"descendants\":49,\"id\":14201562,\"kids\":[14201704,14202297,14202233,14201771,14201765,14201897,14201750,14201913,14201854,14201667,14201759,14202073],\"score\":186,\"time\":1493197629,\"title\":\"Postal: Open source mail delivery platform, alternative to Mailgun or Sendgrid\",\"type\":\"story\",\"url\":\"https://github.com/atech/postal\"},{\"by\":\"rabyss\",\"descendants\":4,\"id\":14202124,\"kids\":[14202293,14202249],\"score\":16,\"time\":1493205989,\"title\":\"Show HN: BreakLock – A hybrid of Mastermind and the Android pattern lock\",\"type\":\"story\",\"url\":\"https://maxwellito.github.io/breaklock/\"},{\"by\":\"morid1n\",\"descendants\":137,\"id\":14200563,\"kids\":[14201274,14200711,14201147,14201365,14201499,14200618,14201169,14200911,14200734,14201083,14200706,14200785,14201032],\"score\":178,\"time\":1493183234,\"title\":\"My Hackintosh Hardware Spec – clean, based on a 2013 iMac\",\"type\":\"story\",\"url\":\"https://infinitediaries.net/my-exact-hackintosh-spec/\"},{\"by\":\"robertwiblin\",\"descendants\":203,\"id\":14196731,\"kids\":[14201298,14201838,14201381,14197574,14201398,14199764,14198491,14197000,14198224,14200614,14201983,14200697,14199252,14201214,14198923,14200224,14197509,14200859,14200064,14200114,14197256,14197220,14200653,14197186,14199258,14197155,14197344,14198361,14197969,14199813,14197259,14197503],\"score\":562,\"time\":1493145853,\"title\":\"Evidence-based advice we've found on how to be successful in a job\",\"type\":\"story\",\"url\":\"https://80000hours.org/career-guide/how-to-be-successful/\"},{\"by\":\"ryan_j_naughton\",\"descendants\":565,\"id\":14196812,\"kids\":[14198306,14197339,14200899,14198165,14198750,14202199,14201432,14197619,14197471,14201113,14202214,14202043,14197313,14197751,14197332,14198050,14201616,14197404,14199730,14198007,14197358,14197283,14200959,14197891,14198203,14197312,14200796,14201528,14197249,14198271,14197989,14198842,14197205,14199148,14197458,14200457,14197330,14199993,14197855,14200102,14197378,14199315,14198240,14198397,14199326,14200159,14198798,14201296,14198173,14197323,14197383,14197459,14197275,14198305,14198005,14198015,14199380,14199079,14198413,14197334,14197327,14197234],\"score\":385,\"time\":1493146342,\"title\":\"Is Every Speed Limit Too Low?\",\"type\":\"story\",\"url\":\"https://priceonomics.com/is-every-speed-limit-too-low/\"},{\"by\":\"monort\",\"descendants\":63,\"id\":14196322,\"kids\":[14197628,14200026,14197457,14197486,14202126,14201266,14197227,14199404,14199338,14196382,14200598,14197377,14199689,14198538,14196905,14200404,14198781,14197278,14197888,14197742,14197764],\"score\":316,\"time\":1493143464,\"title\":\"Experimental Nighttime Photography with Nexus and Pixel\",\"type\":\"story\",\"url\":\"https://research.googleblog.com/2017/04/experimental-nighttime-photography-with.html\"},{\"by\":\"networked\",\"descendants\":9,\"id\":14199028,\"kids\":[14201588,14200361,14200314,14200338],\"score\":121,\"time\":1493161601,\"title\":\"JPEG Huffman Coding Tutorial\",\"type\":\"story\",\"url\":\"http://www.impulseadventure.com/photo/jpeg-huffman-coding.html\"},{\"by\":\"jasontan\",\"id\":14202227,\"score\":1,\"time\":1493207865,\"title\":\"Are you adept at understanding concurrency problems? Sift Science is hiring\",\"type\":\"job\",\"url\":\"https://boards.greenhouse.io/siftscience/jobs/550699#.WPUZhlMrLfY\"},{\"by\":\"pouwerkerk\",\"descendants\":80,\"id\":14196077,\"kids\":[14199434,14196279,14196604,14197440,14201734,14200922,14200452,14197115,14199837,14199894,14196596,14198243,14196565,14197400,14197049,14197686,14198545,14198475],\"score\":717,\"time\":1493142008,\"title\":\"Painting with Code: Introducing our new open source library React Sketch.app\",\"type\":\"story\",\"url\":\"http://airbnb.design/painting-with-code/\"},{\"by\":\"mromnia\",\"descendants\":16,\"id\":14201670,\"kids\":[14201835,14202115,14202176,14201890,14202325,14201859,14202158,14201763,14201902],\"score\":62,\"time\":1493198949,\"title\":\"How to mod a Porsche 911 to run Doom [video]\",\"type\":\"story\",\"url\":\"https://www.youtube.com/watch?v=NRMpNA86e8Q\"},{\"by\":\"rbanffy\",\"descendants\":16,\"id\":14192383,\"kids\":[14197494,14201805,14197484],\"score\":194,\"time\":1493118160,\"title\":\"Go programming language secure coding practices guide\",\"type\":\"story\",\"url\":\"https://github.com/Checkmarx/Go-SCP\"},{\"by\":\"intous\",\"descendants\":0,\"id\":14200446,\"score\":39,\"time\":1493181245,\"title\":\"Building Functional Chatbot for Messenger with Ruby on Rails\",\"type\":\"story\",\"url\":\"https://tutorials.botsfloor.com/chatbot-development-tutorial-how-to-build-a-fully-functional-weather-bot-on-facebook-messenger-c94ac7c59185\"},{\"by\":\"nanospeck\",\"descendants\":23,\"id\":14201207,\"kids\":[14202252,14201646,14201620,14202076,14201511,14201324,14201940,14201425,14201505,14201304,14201435,14201287,14201739,14202031,14202018],\"score\":57,\"text\":\"This question was asked on both 2015 &amp; 2016 in HN. I would like to ask it again today to know what are the newest options for this.<p>Q: What would you recommend as a reasonably priced (sub 150$) quad-copter&#x2F;drone, that has a camera, the ability to be programmed (so that I can process video&#x2F;write my own stability algorithms for it), good range, and reasonable flying time?\\nIn the event nothing fits that price point, any pointers on what the state of the art is?<p>Thanks!\",\"time\":1493192641,\"title\":\"Ask HN (again): What is the best affordable programmable drone?\",\"type\":\"story\"},{\"by\":\"geuis\",\"descendants\":57,\"id\":14196708,\"kids\":[14197480,14198523,14198705,14200969,14200079,14197605,14198979,14202203,14197679,14198461,14200389,14198065,14197883,14197908],\"score\":123,\"time\":1493145655,\"title\":\"Hackpad shutting down\",\"type\":\"story\",\"url\":\"https://hackpad.com/\"},{\"by\":\"jfoutz\",\"descendants\":55,\"id\":14195956,\"kids\":[14199594,14196972,14202101,14198197,14196771,14197326,14196956,14200842,14201529,14198581,14196777,14200177,14200422,14198571],\"score\":167,\"time\":1493141367,\"title\":\"Linkerd 1.0\",\"type\":\"story\",\"url\":\"https://blog.buoyant.io/2017/04/25/announcing-linkerd-1.0/index.html\"},{\"by\":\"DavidBuchanan\",\"descendants\":19,\"id\":14199364,\"kids\":[14199735,14200889,14202245,14200205,14200104,14201697,14200061,14199996,14199867],\"score\":66,\"time\":1493164755,\"title\":\"Show HN: TARDIS – Warp a process's perspective of time by hooking syscalls\",\"type\":\"story\",\"url\":\"https://github.com/DavidBuchanan314/TARDIS\"},{\"by\":\"rchen8\",\"descendants\":121,\"id\":14195664,\"kids\":[14196654,14196206,14196677,14197035,14196041,14196399,14196200,14196140,14196216,14196421,14196370,14196146,14197601,14197107,14196866,14196691,14197704,14196772,14200089,14198588,14196937,14198530,14197119,14197247,14198632,14196137,14200323,14196346],\"score\":486,\"time\":1493139957,\"title\":\"How to Become Well-Connected\",\"type\":\"story\",\"url\":\"http://firstround.com/review/how-to-become-insanely-well-connected/\"},{\"by\":\"dbrgn\",\"descendants\":89,\"id\":14191186,\"kids\":[14200855,14200035,14200110,14201408,14202159,14197876,14200348,14198720,14198183,14199824,14198281,14201643,14201591,14199541,14198423,14201738,14200037,14201349,14200028,14201206,14197995,14197830,14199603],\"score\":135,\"time\":1493100791,\"title\":\"How to Say (Almost) Everything in a Hundred-Word Language (2015)\",\"type\":\"story\",\"url\":\"https://www.theatlantic.com/technology/archive/2015/07/toki-pona-smallest-language/398363/?single_page=true\"},{\"by\":\"runesoerensen\",\"descendants\":62,\"id\":14198866,\"kids\":[14199494,14199495,14200288,14201118,14199599],\"score\":155,\"time\":1493160263,\"title\":\"Nginx 1.13 released with TLS 1.3 support\",\"type\":\"story\",\"url\":\"http://mailman.nginx.org/pipermail/nginx-announce/2017/000195.html\"},{\"by\":\"bcherny\",\"descendants\":20,\"id\":14199299,\"kids\":[14200694,14201832,14200517,14201760,14200966,14200558,14201815,14201231,14201073,14201124],\"score\":54,\"time\":1493163960,\"title\":\"Show HN: JSONSchema to TypeScript compiler\",\"type\":\"story\",\"url\":\"https://github.com/bcherny/json-schema-to-typescript\"},{\"by\":\"tormeh\",\"descendants\":37,\"id\":14198557,\"kids\":[14201027,14199082,14201023,14201160,14200367,14200647],\"score\":70,\"time\":1493158034,\"title\":\"A practitioner’s guide to hedonism (2007)\",\"type\":\"story\",\"url\":\"https://www.1843magazine.com/story/a-practitioners-guide-to-hedonism\"},{\"by\":\"nickreiner\",\"descendants\":33,\"id\":14199125,\"kids\":[14202332,14201634,14201200,14201215,14201157,14201898,14201969,14201125],\"score\":52,\"time\":1493162517,\"title\":\"Best Linux Distros for Gaming in 2017\",\"type\":\"story\",\"url\":\"https://thishosting.rocks/best-linux-distros-for-gaming/\"},{\"by\":\"BinaryIdiot\",\"descendants\":170,\"id\":14200486,\"kids\":[14200680,14200677,14201515,14200793,14200534,14200908,14200649,14200633,14200701,14202295,14200578,14200709,14200580,14201107,14201779,14200773,14200804,14200720,14202060,14200948,14200903,14200748,14200875,14200750,14200821,14200756,14201707,14201689,14200669,14200997,14200818,14201586,14200603,14201054,14201457,14200616,14201095,14200915,14200878,14200629,14201523,14200620,14202099],\"score\":316,\"time\":1493181945,\"title\":\"Suicide of an Uber engineer: Widow blames job stress\",\"type\":\"story\",\"url\":\"http://www.sfchronicle.com/business/article/Suicide-of-an-Uber-engineer-widow-blames-job-11095807.php?t=7e40d1f554&cmpid=fb-premium&cmpid=twitter-premium\"},{\"by\":\"catc\",\"descendants\":34,\"id\":14195522,\"kids\":[14202316,14202278,14197167,14199152,14202077,14197239,14197721,14197632,14197219,14198296,14197245,14197201,14197403,14198051,14196747],\"score\":87,\"time\":1493139414,\"title\":\"Show HN: React Timekeeper – Time picker based on the style of Google Keep\",\"type\":\"story\",\"url\":\"https://catc.github.io/react-timekeeper/\"},{\"by\":\"Integer\",\"descendants\":152,\"id\":14192353,\"kids\":[14197671,14197754,14199091,14198533,14201249,14198626,14198263,14198009,14195130,14199551,14197663,14198285,14199611,14199835,14197482,14198924,14198943],\"score\":273,\"time\":1493117771,\"title\":\"Windows Is Bloated, Thanks to Adobe’s Extensible Metadata Platform\",\"type\":\"story\",\"url\":\"https://www.thurrott.com/windows/109962/windows-bloated-thanks-adobes-extensible-metadata-platform\"},{\"by\":\"craigcannon\",\"descendants\":23,\"id\":14197852,\"kids\":[14200024,14199986,14202106,14198011,14199228,14202138,14198917,14198607],\"score\":58,\"time\":1493153342,\"title\":\"New England Lost Ski Areas Project\",\"type\":\"story\",\"url\":\"http://www.nelsap.org/\"},{\"by\":\"golfer\",\"descendants\":105,\"id\":14198229,\"kids\":[14200202,14198948,14199770,14198634,14200263,14198797,14198919,14200447,14198645,14199267,14199124,14198833,14199059],\"score\":282,\"time\":1493155745,\"title\":\"Uber must turn over information about its acquisition of Otto to Waymo\",\"type\":\"story\",\"url\":\"https://techcrunch.com/2017/04/25/uber-must-turn-over-information-about-its-acquisition-of-otto-to-waymo-court-rules/\"},{\"by\":\"JoshTriplett\",\"descendants\":116,\"id\":14198403,\"kids\":[14199771,14199980,14198664,14198764,14201086,14200307,14199294,14198860,14198817],\"score\":139,\"time\":1493156882,\"title\":\"Shutting down public FTP services\",\"type\":\"story\",\"url\":\"https://lists.debian.org/debian-announce/2017/msg00001.html\"},{\"by\":\"mabynogy\",\"descendants\":50,\"id\":14191577,\"kids\":[14194021,14195402,14193886,14193792,14194355,14197136,14200386,14194151,14193989,14193798,14194042,14197100,14198984,14193925,14194170],\"score\":365,\"time\":1493107104,\"title\":\"A Primer on Bézier Curves\",\"type\":\"story\",\"url\":\"https://pomax.github.io/bezierinfo#preface\"},{\"by\":\"robertothais\",\"descendants\":29,\"id\":14192946,\"kids\":[14202311,14202299,14201900,14200029,14198260,14198605,14201850,14199858,14198223,14198610],\"score\":61,\"time\":1493124627,\"title\":\"Consciousness as a State of Matter (2014)\",\"type\":\"story\",\"url\":\"https://arxiv.org/abs/1401.1219\"},{\"by\":\"leephillips\",\"descendants\":2,\"id\":14202078,\"kids\":[14202122],\"score\":5,\"time\":1493205152,\"title\":\"The Republican Lawmaker Who Secretly Created Reddit’s Women-Hating ‘Red Pill’\",\"type\":\"story\",\"url\":\"http://www.thedailybeast.com/articles/2017/04/25/the-republican-lawmaker-who-secretly-created-reddit-s-women-hating-red-pill.html\"},{\"by\":\"anguswithgusto\",\"descendants\":55,\"id\":14196325,\"kids\":[14197131,14196789,14197299,14197466,14196737,14199929,14197550,14197511,14196888,14200109,14197101],\"score\":80,\"time\":1493143475,\"title\":\"Gett in advanced talks to buy Juno for $250M as Uber rivals consolidate\",\"type\":\"story\",\"url\":\"https://techcrunch.com/2017/04/25/gett-in-advanced-talks-to-buy-juno-for-250m-as-uber-rivals-consolidate/\"},{\"by\":\"fabuzaid\",\"descendants\":2,\"id\":14196339,\"kids\":[14201557,14201170],\"score\":46,\"time\":1493143560,\"title\":\"Implementing a Fast Research Compiler in Rust\",\"type\":\"story\",\"url\":\"http://dawn.cs.stanford.edu/blog/weld.html\"},{\"by\":\"bluesilver07\",\"descendants\":61,\"id\":14196154,\"kids\":[14197614,14196853,14197074,14197050,14200090,14197731,14196352,14197442],\"score\":72,\"time\":1493142448,\"title\":\"Xenko Game Engine 2.0 released\",\"type\":\"story\",\"url\":\"http://xenko.com/blog/release-xenko-2-0-0/\"},{\"by\":\"molecule\",\"descendants\":254,\"id\":14189392,\"kids\":[14190198,14190800,14193591,14190274,14189796,14190118,14190405,14190006,14189430,14190244,14189877,14190064,14190211,14189918,14190071,14191312,14195969,14190542,14194775,14189900,14190032,14189847,14192128,14191737,14191047,14190992,14192759,14191405,14190815,14194136,14190737,14190552,14191385,14189816,14191316,14193780,14193979,14190768,14192973,14191217,14190879,14190780,14189914,14190925,14192906,14190528,14189893,14190007,14189929,14190049,14191859,14191304,14190177,14193355,14193352,14190324,14190846,14189803],\"score\":630,\"time\":1493076480,\"title\":\"Robert M. Pirsig has died\",\"type\":\"story\",\"url\":\"http://www.npr.org/sections/thetwo-way/2017/04/24/525443040/-zen-and-the-art-of-motorcycle-maintenance-author-robert-m-pirsig-dies-at-88\"},{\"by\":\"artsandsci\",\"descendants\":67,\"id\":14194422,\"kids\":[14199418,14196266,14197226,14196647,14196324,14201761,14196265,14195599,14199054,14196057],\"score\":127,\"time\":1493134376,\"title\":\"An extra-uterine system to physiologically support the extreme premature lamb\",\"type\":\"story\",\"url\":\"https://www.nature.com/articles/ncomms15112\"},{\"by\":\"miobrien\",\"descendants\":9,\"id\":14198261,\"kids\":[14199610,14199447,14199862,14201753,14199068],\"score\":30,\"time\":1493155969,\"title\":\"Prior Indigenous Technological Species\",\"type\":\"story\",\"url\":\"https://arxiv.org/abs/1704.07263\"},{\"by\":\"zdw\",\"descendants\":2,\"id\":14199197,\"kids\":[14200610],\"score\":12,\"time\":1493163087,\"title\":\"Should Curve25519 keys be validated?\",\"type\":\"story\",\"url\":\"https://research.kudelskisecurity.com/2017/04/25/should-ecdh-keys-be-validated/\"},{\"by\":\"spearo77\",\"descendants\":213,\"id\":14189688,\"kids\":[14191654,14192373,14190683,14192095,14191856,14190771,14190570,14190599,14190721,14192049,14189694,14191430,14193610,14190543,14190372,14191818,14192171,14192177,14192135,14191483,14190560,14190341,14190362,14190452,14192563,14190458,14195245,14190809,14192706,14192959,14190636,14190634,14190368,14191163,14191379,14190668,14191673,14190884,14192565,14190480,14190442],\"score\":447,\"time\":1493079289,\"title\":\"WikiTribune – Evidence-based journalism\",\"type\":\"story\",\"url\":\"https://www.wikitribune.com\"},{\"by\":\"adbrebs\",\"descendants\":294,\"id\":14182262,\"kids\":[14183335,14183715,14182725,14183897,14185812,14184510,14182468,14183231,14182580,14183996,14182449,14185671,14182428,14182666,14186599,14182519,14185571,14185159,14182636,14185864,14188340,14183433,14183146,14184034,14184363,14183368,14183098,14182495,14182753,14184720,14188085,14187692,14183633,14188137,14182606,14186796,14196166,14185084,14185899,14188219,14186885,14183406,14185561,14183388,14191457,14183281,14183399,14183674,14183236,14183990,14183760,14183248,14184114,14183318,14183457,14186509,14186900,14186695,14188405,14184636,14184630,14188301,14184144,14183023,14184555,14185946,14184611,14184490,14183653,14183881,14182715,14184440,14182573,14183251,14184962,14187249,14182545,14192314],\"score\":1356,\"time\":1493014335,\"title\":\"Lyrebird – An API to copy the voice of anyone\",\"type\":\"story\",\"url\":\"https://lyrebird.ai/demo\"},{\"by\":\"mathgenius\",\"descendants\":6,\"id\":14192442,\"kids\":[14197265,14195645],\"score\":43,\"time\":1493118936,\"title\":\"Quantum – Open journal for quantum science\",\"type\":\"story\",\"url\":\"http://quantum-journal.org/papers/\"},{\"by\":\"tjalfi\",\"descendants\":5,\"id\":14190937,\"kids\":[14199744,14197114,14190946],\"score\":107,\"time\":1493097061,\"title\":\"A Seven Dimensional Analysis of Hashing Methods [pdf]\",\"type\":\"story\",\"url\":\"http://www.vldb.org/pvldb/vol9/p96-richter.pdf\"},{\"by\":\"mxstbr\",\"descendants\":0,\"id\":14196935,\"score\":24,\"time\":1493147015,\"title\":\"One GraphQL Client for JavaScript, iOS, and Android\",\"type\":\"story\",\"url\":\"https://dev-blog.apollodata.com/one-graphql-client-for-javascript-ios-and-android-64993c1b7991\"},{\"by\":\"uptown\",\"descendants\":166,\"id\":14192817,\"kids\":[14197690,14195597,14196750,14195237,14196320,14195150,14198816,14194916,14197746,14196332,14194695,14196726,14194947,14199715,14195059,14195778,14196204,14200435,14194780,14195030,14198452,14199023,14194852,14197577,14197778,14195361,14196368,14194948,14199024,14195060,14199498],\"score\":226,\"time\":1493123621,\"title\":\"How Yahoo Killed Flickr (2012)\",\"type\":\"story\",\"url\":\"https://gizmodo.com/5910223/how-yahoo-killed-flickr-and-lost-the-internet\"},{\"by\":\"mattklein123\",\"descendants\":42,\"id\":14194026,\"kids\":[14194573,14195577,14194430,14195407,14194569,14195298,14200054,14194456,14198329,14199198],\"score\":167,\"time\":1493131921,\"title\":\"Envoy: 7 months later\",\"type\":\"story\",\"url\":\"https://eng.lyft.com/envoy-7-months-later-41986c2fd443\"},{\"by\":\"misnamed\",\"descendants\":2,\"id\":14191333,\"kids\":[14197296],\"score\":29,\"time\":1493103250,\"title\":\"Modern Hieroglyphs: Binary Logic Behind the Universal “Power Symbol”\",\"type\":\"story\",\"url\":\"http://99percentinvisible.org/article/modern-hieroglyphics-binary-logic-behind-universal-power-symbol/\"},{\"by\":\"LaFolle\",\"descendants\":92,\"id\":14191681,\"kids\":[14192477,14194490,14192316,14193364,14192065,14193499,14194324,14192622,14192020,14195866,14192496,14196391,14192138,14192714,14195151,14195094,14192110,14192155],\"score\":138,\"time\":1493108371,\"title\":\"Feynman Algorithm (2014)\",\"type\":\"story\",\"url\":\"http://wiki.c2.com/?FeynmanAlgorithm\"},{\"by\":\"Thevet\",\"descendants\":18,\"id\":14190736,\"kids\":[14197744,14195753,14197880,14197735,14195874,14197023,14196660],\"score\":81,\"time\":1493093860,\"title\":\"The legend of the Legion\",\"type\":\"story\",\"url\":\"https://aeon.co/essays/why-young-men-queue-up-to-die-in-the-french-foreign-legion\"},{\"by\":\"bufordsharkley\",\"descendants\":92,\"id\":14197013,\"kids\":[14197983,14197168,14197701,14198239,14197514,14198064,14197476,14198489,14197761,14197080,14198905,14198068,14198579],\"score\":69,\"time\":1493147532,\"title\":\"Cracking the Mystery of Labor's Falling Share of GDP\",\"type\":\"story\",\"url\":\"https://www.bloomberg.com/view/articles/2017-04-24/cracking-the-mystery-of-labor-s-falling-share-of-gdp\"},{\"by\":\"rbanffy\",\"descendants\":27,\"id\":14198470,\"kids\":[14199443,14201987,14199461,14199729,14201519,14198762,14199524],\"score\":52,\"time\":1493157378,\"title\":\"How the Internet Gave Mail-Order Brides the Power\",\"type\":\"story\",\"url\":\"https://backchannel.com/how-the-internet-gave-mail-order-brides-the-power-1af8c8a40562\"}]"
  },
  {
    "path": "test/react/FBMocks/pe-functional-benchmark.js",
    "content": "var React = require(\"react\");\n\nvar ReactImage0 = function(props) {\n  if (props.x === 0) {\n    return React.createElement(\"i\", {\n      alt: \"\",\n      className: \"_3-99 img sp_i534r85sjIn sx_538591\",\n      src: null,\n    });\n  }\n  if (props.x === 15) {\n    return React.createElement(\"i\", {\n      className: \"_3ut_ img sp_i534r85sjIn sx_e8ac93\",\n      src: null,\n      alt: \"\",\n    });\n  }\n  if (props.x === 22) {\n    return React.createElement(\"i\", {\n      alt: \"\",\n      className: \"_3-8_ img sp_i534r85sjIn sx_7b15bc\",\n      src: null,\n    });\n  }\n  if (props.x === 29) {\n    return React.createElement(\"i\", {\n      className: \"_1m1s _4540 _p img sp_i534r85sjIn sx_f40b1c\",\n      src: null,\n      alt: \"\",\n    });\n  }\n  if (props.x === 42) {\n    return React.createElement(\n      \"i\",\n      {\n        alt: \"Warning\",\n        className: \"_585p img sp_i534r85sjIn sx_20273d\",\n        src: null,\n      },\n      React.createElement(\"u\", null, \"Warning\")\n    );\n  }\n  if (props.x === 67) {\n    return React.createElement(\"i\", {\n      alt: \"\",\n      className: \"_3-8_ img sp_i534r85sjIn sx_b5d079\",\n      src: null,\n    });\n  }\n  if (props.x === 70) {\n    return React.createElement(\"i\", {\n      src: null,\n      alt: \"\",\n      className: \"img sp_i534r85sjIn sx_29f8c9\",\n    });\n  }\n  if (props.x === 76) {\n    return React.createElement(\"i\", {\n      alt: \"\",\n      className: \"_3-8_ img sp_i534r85sjIn sx_ef6a9c\",\n      src: null,\n    });\n  }\n  if (props.x === 79) {\n    return React.createElement(\"i\", {\n      src: null,\n      alt: \"\",\n      className: \"img sp_i534r85sjIn sx_6f8c43\",\n    });\n  }\n  if (props.x === 88) {\n    return React.createElement(\"i\", {\n      src: null,\n      alt: \"\",\n      className: \"img sp_i534r85sjIn sx_e94a2d\",\n    });\n  }\n  if (props.x === 91) {\n    return React.createElement(\"i\", {\n      src: null,\n      alt: \"\",\n      className: \"img sp_i534r85sjIn sx_7ed7d4\",\n    });\n  }\n  if (props.x === 94) {\n    return React.createElement(\"i\", {\n      src: null,\n      alt: \"\",\n      className: \"img sp_i534r85sjIn sx_930440\",\n    });\n  }\n  if (props.x === 98) {\n    return React.createElement(\"i\", {\n      src: null,\n      alt: \"\",\n      className: \"img sp_i534r85sjIn sx_750c83\",\n    });\n  }\n  if (props.x === 108) {\n    return React.createElement(\"i\", {\n      src: null,\n      alt: \"\",\n      className: \"img sp_i534r85sjIn sx_73c1bb\",\n    });\n  }\n  if (props.x === 111) {\n    return React.createElement(\"i\", {\n      src: null,\n      alt: \"\",\n      className: \"img sp_i534r85sjIn sx_29f28d\",\n    });\n  }\n  if (props.x === 126) {\n    return React.createElement(\"i\", {\n      src: null,\n      alt: \"\",\n      className: \"_3-8_ img sp_i534r85sjIn sx_91c59e\",\n    });\n  }\n  if (props.x === 127) {\n    return React.createElement(\"i\", {\n      alt: \"\",\n      className: \"_3-99 img sp_i534r85sjIn sx_538591\",\n      src: null,\n    });\n  }\n  if (props.x === 134) {\n    return React.createElement(\"i\", {\n      src: null,\n      alt: \"\",\n      className: \"_3-8_ img sp_i534r85sjIn sx_c8eb75\",\n    });\n  }\n  if (props.x === 135) {\n    return React.createElement(\"i\", {\n      alt: \"\",\n      className: \"_3-99 img sp_i534r85sjIn sx_538591\",\n      src: null,\n    });\n  }\n  if (props.x === 148) {\n    return React.createElement(\"i\", {\n      className: \"_3yz6 _5whs img sp_i534r85sjIn sx_896996\",\n      src: null,\n      alt: \"\",\n    });\n  }\n  if (props.x === 152) {\n    return React.createElement(\"i\", {\n      className: \"_5b5p _4gem img sp_i534r85sjIn sx_896996\",\n      src: null,\n      alt: \"\",\n    });\n  }\n  if (props.x === 153) {\n    return React.createElement(\"i\", {\n      className: \"_541d img sp_i534r85sjIn sx_2f396a\",\n      src: null,\n      alt: \"\",\n    });\n  }\n  if (props.x === 160) {\n    return React.createElement(\"i\", {\n      src: null,\n      alt: \"\",\n      className: \"img sp_i534r85sjIn sx_31d9b0\",\n    });\n  }\n  if (props.x === 177) {\n    return React.createElement(\"i\", {\n      alt: \"\",\n      className: \"_3-99 img sp_i534r85sjIn sx_2c18b7\",\n      src: null,\n    });\n  }\n  if (props.x === 186) {\n    return React.createElement(\"i\", {\n      src: null,\n      alt: \"\",\n      className: \"img sp_i534r85sjIn sx_0a681f\",\n    });\n  }\n  if (props.x === 195) {\n    return React.createElement(\"i\", {\n      className: \"_1-lx img sp_OkER5ktbEyg sx_b369b4\",\n      src: null,\n      alt: \"\",\n    });\n  }\n  if (props.x === 198) {\n    return React.createElement(\"i\", {\n      className: \"_1-lx img sp_i534r85sjIn sx_96948e\",\n      src: null,\n      alt: \"\",\n    });\n  }\n  if (props.x === 237) {\n    return React.createElement(\"i\", {\n      className: \"_541d img sp_i534r85sjIn sx_2f396a\",\n      src: null,\n      alt: \"\",\n    });\n  }\n  if (props.x === 266) {\n    return React.createElement(\"i\", {\n      alt: \"\",\n      className: \"_3-99 img sp_i534r85sjIn sx_538591\",\n      src: null,\n    });\n  }\n  if (props.x === 314) {\n    return React.createElement(\"i\", {\n      className: \"_1cie _1cif img sp_i534r85sjIn sx_6e6820\",\n      src: null,\n      alt: \"\",\n    });\n  }\n  if (props.x === 345) {\n    return React.createElement(\"i\", {\n      className: \"_1cie img sp_i534r85sjIn sx_e896cf\",\n      src: null,\n      alt: \"\",\n    });\n  }\n  if (props.x === 351) {\n    return React.createElement(\"i\", {\n      className: \"_1cie img sp_i534r85sjIn sx_38fed8\",\n      src: null,\n      alt: \"\",\n    });\n  }\n};\n\nvar AbstractLink1 = function(props) {\n  if (props.x === 1) {\n    return React.createElement(\n      \"a\",\n      {\n        className: \"_387r _55pi _2agf _4jy0 _4jy4 _517h _51sy _42ft\",\n        style: { width: 250, maxWidth: \"250px\" },\n        disabled: null,\n        label: null,\n        href: \"#\",\n        rel: undefined,\n        onClick: function() {},\n      },\n      null,\n      React.createElement(\n        \"span\",\n        { className: \"_55pe\", style: { maxWidth: \"236px\" } },\n        null,\n        React.createElement(\n          \"span\",\n          null,\n          React.createElement(\"span\", { className: \"_48u-\" }, \"Account:\"),\n          \" \",\n          \"Dick Madanson (10149999073643408)\"\n        )\n      ),\n      React.createElement(ReactImage0, { x: 0 })\n    );\n  }\n  if (props.x === 43) {\n    return React.createElement(\n      \"a\",\n      {\n        className: \"_585q _50zy _50-0 _50z- _5upp _42ft\",\n        size: \"medium\",\n        type: null,\n        title: \"Remove\",\n        \"data-hover\": undefined,\n        \"data-tooltip-alignh\": undefined,\n        \"data-tooltip-content\": undefined,\n        disabled: null,\n        label: null,\n        href: \"#\",\n        rel: undefined,\n        onClick: function() {},\n      },\n      undefined,\n      \"Remove\",\n      undefined\n    );\n  }\n  if (props.x === 49) {\n    return React.createElement(\n      \"a\",\n      {\n        target: \"_blank\",\n        href: \"/ads/manage/billing.php?act=10149999073643408\",\n        rel: undefined,\n        onClick: function() {},\n      },\n      React.createElement(XUIText29, { x: 48 })\n    );\n  }\n  if (props.x === 128) {\n    return React.createElement(\n      \"a\",\n      {\n        className: \" _5bbf _55pi _2agf _4jy0 _4jy4 _517h _51sy _42ft\",\n        style: { maxWidth: \"200px\" },\n        disabled: null,\n        label: null,\n        href: \"#\",\n        rel: undefined,\n        onClick: function() {},\n      },\n      null,\n      React.createElement(\n        \"span\",\n        { className: \"_55pe\", style: { maxWidth: \"186px\" } },\n        React.createElement(ReactImage0, { x: 126 }),\n        \"Search\"\n      ),\n      React.createElement(ReactImage0, { x: 127 })\n    );\n  }\n  if (props.x === 136) {\n    return React.createElement(\n      \"a\",\n      {\n        className: \" _5bbf _55pi _2agf _4jy0 _4jy4 _517h _51sy _42ft\",\n        style: { maxWidth: \"200px\" },\n        disabled: null,\n        label: null,\n        href: \"#\",\n        rel: undefined,\n        onClick: function() {},\n      },\n      null,\n      React.createElement(\n        \"span\",\n        { className: \"_55pe\", style: { maxWidth: \"186px\" } },\n        React.createElement(ReactImage0, { x: 134 }),\n        \"Filters\"\n      ),\n      React.createElement(ReactImage0, { x: 135 })\n    );\n  }\n  if (props.x === 178) {\n    return React.createElement(\n      \"a\",\n      {\n        className: \"_1_-t _1_-v _42ft\",\n        disabled: null,\n        height: \"medium\",\n        role: \"button\",\n        label: null,\n        href: \"#\",\n        rel: undefined,\n        onClick: function() {},\n      },\n      undefined,\n      \"Lifetime\",\n      React.createElement(ReactImage0, { x: 177 })\n    );\n  }\n  if (props.x === 207) {\n    return React.createElement(\"a\", { href: \"#\", rel: undefined, onClick: function() {} }, \"Create Ad Set\");\n  }\n  if (props.x === 209) {\n    return React.createElement(\"a\", { href: \"#\", rel: undefined, onClick: function() {} }, \"View Ad Set\");\n  }\n  if (props.x === 241) {\n    return React.createElement(\"a\", { href: \"#\", rel: undefined, onClick: function() {} }, \"Set a Limit\");\n  }\n  if (props.x === 267) {\n    return React.createElement(\n      \"a\",\n      {\n        className: \"_p _55pi _2agf _4jy0 _4jy3 _517h _51sy _42ft\",\n        style: { maxWidth: \"200px\" },\n        disabled: null,\n        label: null,\n        href: \"#\",\n        rel: undefined,\n        onClick: function() {},\n      },\n      null,\n      React.createElement(\"span\", { className: \"_55pe\", style: { maxWidth: \"186px\" } }, null, \"Links\"),\n      React.createElement(ReactImage0, { x: 266 })\n    );\n  }\n};\n\nvar Link2 = function(props) {\n  if (props.x === 2) {\n    return React.createElement(AbstractLink1, { x: 1 });\n  }\n  if (props.x === 44) {\n    return React.createElement(AbstractLink1, { x: 43 });\n  }\n  if (props.x === 50) {\n    return React.createElement(AbstractLink1, { x: 49 });\n  }\n  if (props.x === 129) {\n    return React.createElement(AbstractLink1, { x: 128 });\n  }\n  if (props.x === 137) {\n    return React.createElement(AbstractLink1, { x: 136 });\n  }\n  if (props.x === 179) {\n    return React.createElement(AbstractLink1, { x: 178 });\n  }\n  if (props.x === 208) {\n    return React.createElement(AbstractLink1, { x: 207 });\n  }\n  if (props.x === 210) {\n    return React.createElement(AbstractLink1, { x: 209 });\n  }\n  if (props.x === 242) {\n    return React.createElement(AbstractLink1, { x: 241 });\n  }\n  if (props.x === 268) {\n    return React.createElement(AbstractLink1, { x: 267 });\n  }\n};\n\nvar AbstractButton3 = function(props) {\n  if (props.x === 3) {\n    return React.createElement(Link2, { x: 2 });\n  }\n  if (props.x === 20) {\n    return React.createElement(\n      \"button\",\n      {\n        className: \"_5n7z _4jy0 _4jy4 _517h _51sy _42ft\",\n        onClick: function() {},\n        label: null,\n        type: \"submit\",\n        value: \"1\",\n      },\n      undefined,\n      \"Discard Changes\",\n      undefined\n    );\n  }\n  if (props.x === 23) {\n    return React.createElement(\n      \"button\",\n      {\n        className: \"_5n7z _2yak _4lj- _4jy0 _4jy4 _517h _51sy _42ft _42fr\",\n        disabled: true,\n        onClick: function() {},\n        \"data-tooltip-content\": \"You have no changes to publish\",\n        \"data-hover\": \"tooltip\",\n        label: null,\n        type: \"submit\",\n        value: \"1\",\n      },\n      React.createElement(ReactImage0, { x: 22 }),\n      \"Review Changes\",\n      undefined\n    );\n  }\n  if (props.x === 45) {\n    return React.createElement(Link2, { x: 44 });\n  }\n  if (props.x === 68) {\n    return React.createElement(\n      \"button\",\n      {\n        className: \"_u_k _4jy0 _4jy4 _517h _51sy _42ft\",\n        onClick: function() {},\n        label: null,\n        type: \"submit\",\n        value: \"1\",\n      },\n      React.createElement(ReactImage0, { x: 67 }),\n      \"Create Campaign\",\n      undefined\n    );\n  }\n  if (props.x === 71) {\n    return React.createElement(\n      \"button\",\n      {\n        className: \"_u_k _3qx6 _p _4jy0 _4jy4 _517h _51sy _42ft\",\n        label: null,\n        type: \"submit\",\n        value: \"1\",\n      },\n      React.createElement(ReactImage0, { x: 70 }),\n      undefined,\n      undefined\n    );\n  }\n  if (props.x === 77) {\n    return React.createElement(\n      \"button\",\n      {\n        \"aria-label\": \"Edit\",\n        \"data-tooltip-content\": \"Edit Campaigns (Ctrl+U)\",\n        \"data-hover\": \"tooltip\",\n        className: \"_d2_ _u_k noMargin _4jy0 _4jy4 _517h _51sy _42ft\",\n        disabled: false,\n        onClick: function() {},\n        label: null,\n        type: \"submit\",\n        value: \"1\",\n      },\n      React.createElement(ReactImage0, { x: 76 }),\n      \"Edit\",\n      undefined\n    );\n  }\n  if (props.x === 80) {\n    return React.createElement(\n      \"button\",\n      {\n        className: \"_u_k _3qx6 _p _4jy0 _4jy4 _517h _51sy _42ft\",\n        disabled: false,\n        label: null,\n        type: \"submit\",\n        value: \"1\",\n      },\n      React.createElement(ReactImage0, { x: 79 }),\n      undefined,\n      undefined\n    );\n  }\n  if (props.x === 89) {\n    return React.createElement(\n      \"button\",\n      {\n        \"aria-label\": \"Revert\",\n        className: \"_u_k _4jy0 _4jy4 _517h _51sy _42ft _42fr\",\n        \"data-hover\": \"tooltip\",\n        \"data-tooltip-content\": \"Revert\",\n        disabled: true,\n        onClick: function() {},\n        label: null,\n        type: \"submit\",\n        value: \"1\",\n      },\n      React.createElement(ReactImage0, { x: 88 }),\n      undefined,\n      undefined\n    );\n  }\n  if (props.x === 92) {\n    return React.createElement(\n      \"button\",\n      {\n        \"aria-label\": \"Delete\",\n        className: \"_u_k _4jy0 _4jy4 _517h _51sy _42ft\",\n        \"data-hover\": \"tooltip\",\n        \"data-tooltip-content\": \"Delete\",\n        disabled: false,\n        onClick: function() {},\n        label: null,\n        type: \"submit\",\n        value: \"1\",\n      },\n      React.createElement(ReactImage0, { x: 91 }),\n      undefined,\n      undefined\n    );\n  }\n  if (props.x === 95) {\n    return React.createElement(\n      \"button\",\n      {\n        \"aria-label\": \"Duplicate\",\n        className: \"_u_k _4jy0 _4jy4 _517h _51sy _42ft\",\n        \"data-hover\": \"tooltip\",\n        \"data-tooltip-content\": \"Duplicate\",\n        disabled: false,\n        onClick: function() {},\n        label: null,\n        type: \"submit\",\n        value: \"1\",\n      },\n      React.createElement(ReactImage0, { x: 94 }),\n      undefined,\n      undefined\n    );\n  }\n  if (props.x === 99) {\n    return React.createElement(\n      \"button\",\n      {\n        \"aria-label\": \"Export & Import\",\n        className: \"_u_k noMargin _p _4jy0 _4jy4 _517h _51sy _42ft\",\n        \"data-hover\": \"tooltip\",\n        \"data-tooltip-content\": \"Export & Import\",\n        onClick: function() {},\n        label: null,\n        type: \"submit\",\n        value: \"1\",\n      },\n      React.createElement(ReactImage0, { x: 98 }),\n      undefined,\n      undefined\n    );\n  }\n  if (props.x === 109) {\n    return React.createElement(\n      \"button\",\n      {\n        \"aria-label\": \"Create Report\",\n        className: \"_u_k _5n7z _4jy0 _4jy4 _517h _51sy _42ft\",\n        \"data-hover\": \"tooltip\",\n        \"data-tooltip-content\": \"Create Report\",\n        disabled: false,\n        style: { boxSizing: \"border-box\", height: \"28px\", width: \"48px\" },\n        onClick: function() {},\n        label: null,\n        type: \"submit\",\n        value: \"1\",\n      },\n      React.createElement(ReactImage0, { x: 108 }),\n      undefined,\n      undefined\n    );\n  }\n  if (props.x === 112) {\n    return React.createElement(\n      \"button\",\n      {\n        \"aria-label\": \"Campaign Tags\",\n        className: \" _5uy7 _4jy0 _4jy4 _517h _51sy _42ft\",\n        \"data-hover\": \"tooltip\",\n        \"data-tooltip-content\": \"Campaign Tags\",\n        disabled: false,\n        onClick: function() {},\n        label: null,\n        type: \"submit\",\n        value: \"1\",\n      },\n      React.createElement(ReactImage0, { x: 111 }),\n      undefined,\n      undefined\n    );\n  }\n  if (props.x === 130) {\n    return React.createElement(Link2, { x: 129 });\n  }\n  if (props.x === 138) {\n    return React.createElement(Link2, { x: 137 });\n  }\n  if (props.x === 149) {\n    return React.createElement(\n      \"button\",\n      {\n        className: \"_3yz9 _1t-2 _50z- _50zy _50zz _50z- _5upp _42ft\",\n        size: \"small\",\n        onClick: function() {},\n        type: \"button\",\n        title: \"Remove\",\n        \"data-hover\": undefined,\n        \"data-tooltip-alignh\": undefined,\n        \"data-tooltip-content\": undefined,\n        label: null,\n      },\n      undefined,\n      \"Remove\",\n      undefined\n    );\n  }\n  if (props.x === 156) {\n    return React.createElement(\n      \"button\",\n      {\n        className: \"_5b5u _5b5v _4jy0 _4jy3 _517h _51sy _42ft\",\n        onClick: function() {},\n        label: null,\n        type: \"submit\",\n        value: \"1\",\n      },\n      undefined,\n      \"Apply\",\n      undefined\n    );\n  }\n  if (props.x === 161) {\n    return React.createElement(\n      \"button\",\n      {\n        className: \"_1wdf _4jy0 _517i _517h _51sy _42ft\",\n        onClick: function() {},\n        label: null,\n        type: \"submit\",\n        value: \"1\",\n      },\n      React.createElement(ReactImage0, { x: 160 }),\n      undefined,\n      undefined\n    );\n  }\n  if (props.x === 180) {\n    return React.createElement(Link2, { x: 179 });\n  }\n  if (props.x === 187) {\n    return React.createElement(\n      \"button\",\n      {\n        \"aria-label\": \"List Settings\",\n        className: \"_u_k _3c5o _1-r0 _4jy0 _4jy4 _517h _51sy _42ft\",\n        \"data-hover\": \"tooltip\",\n        \"data-tooltip-content\": \"List Settings\",\n        onClick: function() {},\n        label: null,\n        type: \"submit\",\n        value: \"1\",\n      },\n      React.createElement(ReactImage0, { x: 186 }),\n      undefined,\n      undefined\n    );\n  }\n  if (props.x === 269) {\n    return React.createElement(Link2, { x: 268 });\n  }\n  if (props.x === 303) {\n    return React.createElement(\n      \"button\",\n      {\n        className: \"_tm3 _tm6 _tm7 _4jy0 _4jy6 _517h _51sy _42ft\",\n        \"data-tooltip-position\": \"right\",\n        \"data-tooltip-content\": \"Campaigns\",\n        \"data-hover\": \"tooltip\",\n        onClick: function() {},\n        label: null,\n        type: \"submit\",\n        value: \"1\",\n      },\n      undefined,\n      React.createElement(\n        \"div\",\n        null,\n        React.createElement(\"div\", { className: \"_tma\" }),\n        React.createElement(\"div\", { className: \"_tm8\" }),\n        React.createElement(\"div\", { className: \"_tm9\" }, 1)\n      ),\n      undefined\n    );\n  }\n  if (props.x === 305) {\n    return React.createElement(\n      \"button\",\n      {\n        className: \"_tm4 _tm6 _4jy0 _4jy6 _517h _51sy _42ft\",\n        \"data-tooltip-position\": \"right\",\n        \"data-tooltip-content\": \"Ad Sets\",\n        \"data-hover\": \"tooltip\",\n        onClick: function() {},\n        label: null,\n        type: \"submit\",\n        value: \"1\",\n      },\n      undefined,\n      React.createElement(\n        \"div\",\n        null,\n        React.createElement(\"div\", { className: \"_tma\" }),\n        React.createElement(\"div\", { className: \"_tm8\" }),\n        React.createElement(\"div\", { className: \"_tm9\" }, 1)\n      ),\n      undefined\n    );\n  }\n  if (props.x === 307) {\n    return React.createElement(\n      \"button\",\n      {\n        className: \"_tm5 _tm6 _4jy0 _4jy6 _517h _51sy _42ft\",\n        \"data-tooltip-position\": \"right\",\n        \"data-tooltip-content\": \"Ads\",\n        \"data-hover\": \"tooltip\",\n        onClick: function() {},\n        label: null,\n        type: \"submit\",\n        value: \"1\",\n      },\n      undefined,\n      React.createElement(\n        \"div\",\n        null,\n        React.createElement(\"div\", { className: \"_tma\" }),\n        React.createElement(\"div\", { className: \"_tm8\" }),\n        React.createElement(\"div\", { className: \"_tm9\" }, 1)\n      ),\n      undefined\n    );\n  }\n};\n\nvar XUIButton4 = function(props) {\n  if (props.x === 4) {\n    return React.createElement(AbstractButton3, { x: 3 });\n  }\n  if (props.x === 21) {\n    return React.createElement(AbstractButton3, { x: 20 });\n  }\n  if (props.x === 24) {\n    return React.createElement(AbstractButton3, { x: 23 });\n  }\n  if (props.x === 69) {\n    return React.createElement(AbstractButton3, { x: 68 });\n  }\n  if (props.x === 72) {\n    return React.createElement(AbstractButton3, { x: 71 });\n  }\n  if (props.x === 78) {\n    return React.createElement(AbstractButton3, { x: 77 });\n  }\n  if (props.x === 81) {\n    return React.createElement(AbstractButton3, { x: 80 });\n  }\n  if (props.x === 90) {\n    return React.createElement(AbstractButton3, { x: 89 });\n  }\n  if (props.x === 93) {\n    return React.createElement(AbstractButton3, { x: 92 });\n  }\n  if (props.x === 96) {\n    return React.createElement(AbstractButton3, { x: 95 });\n  }\n  if (props.x === 100) {\n    return React.createElement(AbstractButton3, { x: 99 });\n  }\n  if (props.x === 110) {\n    return React.createElement(AbstractButton3, { x: 109 });\n  }\n  if (props.x === 113) {\n    return React.createElement(AbstractButton3, { x: 112 });\n  }\n  if (props.x === 131) {\n    return React.createElement(AbstractButton3, { x: 130 });\n  }\n  if (props.x === 139) {\n    return React.createElement(AbstractButton3, { x: 138 });\n  }\n  if (props.x === 157) {\n    return React.createElement(AbstractButton3, { x: 156 });\n  }\n  if (props.x === 162) {\n    return React.createElement(AbstractButton3, { x: 161 });\n  }\n  if (props.x === 188) {\n    return React.createElement(AbstractButton3, { x: 187 });\n  }\n  if (props.x === 270) {\n    return React.createElement(AbstractButton3, { x: 269 });\n  }\n  if (props.x === 304) {\n    return React.createElement(AbstractButton3, { x: 303 });\n  }\n  if (props.x === 306) {\n    return React.createElement(AbstractButton3, { x: 305 });\n  }\n  if (props.x === 308) {\n    return React.createElement(AbstractButton3, { x: 307 });\n  }\n};\n\nvar AbstractPopoverButton5 = function(props) {\n  if (props.x === 5) {\n    return React.createElement(XUIButton4, { x: 4 });\n  }\n  if (props.x === 132) {\n    return React.createElement(XUIButton4, { x: 131 });\n  }\n  if (props.x === 140) {\n    return React.createElement(XUIButton4, { x: 139 });\n  }\n  if (props.x === 271) {\n    return React.createElement(XUIButton4, { x: 270 });\n  }\n};\n\nvar ReactXUIPopoverButton6 = function(props) {\n  if (props.x === 6) {\n    return React.createElement(AbstractPopoverButton5, { x: 5 });\n  }\n  if (props.x === 133) {\n    return React.createElement(AbstractPopoverButton5, { x: 132 });\n  }\n  if (props.x === 141) {\n    return React.createElement(AbstractPopoverButton5, { x: 140 });\n  }\n  if (props.x === 272) {\n    return React.createElement(AbstractPopoverButton5, { x: 271 });\n  }\n};\n\nvar BIGAdAccountSelector7 = function(props) {\n  if (props.x === 7) {\n    return React.createElement(\"div\", null, React.createElement(ReactXUIPopoverButton6, { x: 6 }), null);\n  }\n};\n\nvar FluxContainer_AdsPEBIGAdAccountSelectorContainer_8 = function(props) {\n  if (props.x === 8) {\n    return React.createElement(BIGAdAccountSelector7, { x: 7 });\n  }\n};\n\nvar ErrorBoundary9 = function(props) {\n  if (props.x === 9) {\n    return React.createElement(FluxContainer_AdsPEBIGAdAccountSelectorContainer_8, { x: 8 });\n  }\n  if (props.x === 13) {\n    return React.createElement(FluxContainer_AdsPENavigationBarContainer_12, {\n      x: 12,\n    });\n  }\n  if (props.x === 27) {\n    return React.createElement(FluxContainer_AdsPEPublishButtonContainer_18, {\n      x: 26,\n    });\n  }\n  if (props.x === 32) {\n    return React.createElement(ReactPopoverMenu20, { x: 31 });\n  }\n  if (props.x === 38) {\n    return React.createElement(AdsPEResetDialog24, { x: 37 });\n  }\n  if (props.x === 57) {\n    return React.createElement(FluxContainer_AdsPETopErrorContainer_35, {\n      x: 56,\n    });\n  }\n  if (props.x === 60) {\n    return React.createElement(FluxContainer_AdsGuidanceChannel_36, { x: 59 });\n  }\n  if (props.x === 64) {\n    return React.createElement(FluxContainer_AdsBulkEditDialogContainer_38, {\n      x: 63,\n    });\n  }\n  if (props.x === 124) {\n    return React.createElement(AdsPECampaignGroupToolbarContainer57, {\n      x: 123,\n    });\n  }\n  if (props.x === 170) {\n    return React.createElement(AdsPEFilterContainer72, { x: 169 });\n  }\n  if (props.x === 175) {\n    return React.createElement(AdsPETablePagerContainer75, { x: 174 });\n  }\n  if (props.x === 193) {\n    return React.createElement(AdsPEStatRangeContainer81, { x: 192 });\n  }\n  if (props.x === 301) {\n    return React.createElement(FluxContainer_AdsPEMultiTabDrawerContainer_137, { x: 300 });\n  }\n  if (props.x === 311) {\n    return React.createElement(AdsPEOrganizerContainer139, { x: 310 });\n  }\n  if (props.x === 471) {\n    return React.createElement(AdsPECampaignGroupTableContainer159, { x: 470 });\n  }\n  if (props.x === 475) {\n    return React.createElement(AdsPEContentContainer161, { x: 474 });\n  }\n};\n\nvar AdsErrorBoundary10 = function(props) {\n  if (props.x === 10) {\n    return React.createElement(ErrorBoundary9, { x: 9 });\n  }\n  if (props.x === 14) {\n    return React.createElement(ErrorBoundary9, { x: 13 });\n  }\n  if (props.x === 28) {\n    return React.createElement(ErrorBoundary9, { x: 27 });\n  }\n  if (props.x === 33) {\n    return React.createElement(ErrorBoundary9, { x: 32 });\n  }\n  if (props.x === 39) {\n    return React.createElement(ErrorBoundary9, { x: 38 });\n  }\n  if (props.x === 58) {\n    return React.createElement(ErrorBoundary9, { x: 57 });\n  }\n  if (props.x === 61) {\n    return React.createElement(ErrorBoundary9, { x: 60 });\n  }\n  if (props.x === 65) {\n    return React.createElement(ErrorBoundary9, { x: 64 });\n  }\n  if (props.x === 125) {\n    return React.createElement(ErrorBoundary9, { x: 124 });\n  }\n  if (props.x === 171) {\n    return React.createElement(ErrorBoundary9, { x: 170 });\n  }\n  if (props.x === 176) {\n    return React.createElement(ErrorBoundary9, { x: 175 });\n  }\n  if (props.x === 194) {\n    return React.createElement(ErrorBoundary9, { x: 193 });\n  }\n  if (props.x === 302) {\n    return React.createElement(ErrorBoundary9, { x: 301 });\n  }\n  if (props.x === 312) {\n    return React.createElement(ErrorBoundary9, { x: 311 });\n  }\n  if (props.x === 472) {\n    return React.createElement(ErrorBoundary9, { x: 471 });\n  }\n  if (props.x === 476) {\n    return React.createElement(ErrorBoundary9, { x: 475 });\n  }\n};\n\nvar AdsPENavigationBar11 = function(props) {\n  if (props.x === 11) {\n    return React.createElement(\"div\", { className: \"_4t_9\" });\n  }\n};\n\nvar FluxContainer_AdsPENavigationBarContainer_12 = function(props) {\n  if (props.x === 12) {\n    return React.createElement(AdsPENavigationBar11, { x: 11 });\n  }\n};\n\nvar AdsPEDraftSyncStatus13 = function(props) {\n  if (props.x === 16) {\n    return React.createElement(\n      \"div\",\n      { className: \"_3ut-\", onClick: function() {} },\n      React.createElement(\"span\", { className: \"_3uu0\" }, React.createElement(ReactImage0, { x: 15 }))\n    );\n  }\n};\n\nvar FluxContainer_AdsPEDraftSyncStatusContainer_14 = function(props) {\n  if (props.x === 17) {\n    return React.createElement(AdsPEDraftSyncStatus13, { x: 16 });\n  }\n};\n\nvar AdsPEDraftErrorsStatus15 = function(props) {\n  if (props.x === 18) {\n    return null;\n  }\n};\n\nvar FluxContainer_viewFn_16 = function(props) {\n  if (props.x === 19) {\n    return React.createElement(AdsPEDraftErrorsStatus15, { x: 18 });\n  }\n};\n\nvar AdsPEPublishButton17 = function(props) {\n  if (props.x === 25) {\n    return React.createElement(\n      \"div\",\n      { className: \"_5533\" },\n      React.createElement(FluxContainer_AdsPEDraftSyncStatusContainer_14, {\n        x: 17,\n      }),\n      React.createElement(FluxContainer_viewFn_16, { x: 19 }),\n      null,\n      React.createElement(XUIButton4, { x: 21, key: \"discard\" }),\n      React.createElement(XUIButton4, { x: 24 })\n    );\n  }\n};\n\nvar FluxContainer_AdsPEPublishButtonContainer_18 = function(props) {\n  if (props.x === 26) {\n    return React.createElement(AdsPEPublishButton17, { x: 25 });\n  }\n};\n\nvar InlineBlock19 = function(props) {\n  if (props.x === 30) {\n    return React.createElement(\n      \"div\",\n      { className: \"uiPopover _6a _6b\", disabled: null },\n      React.createElement(ReactImage0, { x: 29, key: \".0\" })\n    );\n  }\n  if (props.x === 73) {\n    return React.createElement(\n      \"div\",\n      { className: \"uiPopover _6a _6b\", disabled: null },\n      React.createElement(XUIButton4, { x: 72, key: \".0\" })\n    );\n  }\n  if (props.x === 82) {\n    return React.createElement(\n      \"div\",\n      { className: \"_1nwm uiPopover _6a _6b\", disabled: null },\n      React.createElement(XUIButton4, { x: 81, key: \".0\" })\n    );\n  }\n  if (props.x === 101) {\n    return React.createElement(\n      \"div\",\n      { size: \"large\", className: \"uiPopover _6a _6b\", disabled: null },\n      React.createElement(XUIButton4, { x: 100, key: \".0\" })\n    );\n  }\n  if (props.x === 273) {\n    return React.createElement(\n      \"div\",\n      {\n        className: \"_3-90 uiPopover _6a _6b\",\n        style: { marginTop: 2 },\n        disabled: null,\n      },\n      React.createElement(ReactXUIPopoverButton6, { x: 272, key: \".0\" })\n    );\n  }\n};\n\nvar ReactPopoverMenu20 = function(props) {\n  if (props.x === 31) {\n    return React.createElement(InlineBlock19, { x: 30 });\n  }\n  if (props.x === 74) {\n    return React.createElement(InlineBlock19, { x: 73 });\n  }\n  if (props.x === 83) {\n    return React.createElement(InlineBlock19, { x: 82 });\n  }\n  if (props.x === 102) {\n    return React.createElement(InlineBlock19, { x: 101 });\n  }\n  if (props.x === 274) {\n    return React.createElement(InlineBlock19, { x: 273 });\n  }\n};\n\nvar LeftRight21 = function(props) {\n  if (props.x === 34) {\n    return React.createElement(\n      \"div\",\n      { className: \"clearfix\" },\n      React.createElement(\n        \"div\",\n        { key: \"left\", className: \"_ohe lfloat\" },\n        React.createElement(\n          \"div\",\n          { className: \"_34_j\" },\n          React.createElement(\"div\", { className: \"_34_k\" }, React.createElement(AdsErrorBoundary10, { x: 10 })),\n          React.createElement(\"div\", { className: \"_2u-6\" }, React.createElement(AdsErrorBoundary10, { x: 14 }))\n        )\n      ),\n      React.createElement(\n        \"div\",\n        { key: \"right\", className: \"_ohf rfloat\" },\n        React.createElement(\n          \"div\",\n          { className: \"_34_m\" },\n          React.createElement(\n            \"div\",\n            { key: \"0\", className: \"_5ju2\" },\n            React.createElement(AdsErrorBoundary10, { x: 28 })\n          ),\n          React.createElement(\n            \"div\",\n            { key: \"1\", className: \"_5ju2\" },\n            React.createElement(AdsErrorBoundary10, { x: 33 })\n          )\n        )\n      )\n    );\n  }\n  if (props.x === 232) {\n    return React.createElement(\n      \"div\",\n      { direction: \"left\", className: \"clearfix\" },\n      React.createElement(\n        \"div\",\n        { key: \"left\", className: \"_ohe lfloat\" },\n        React.createElement(AdsLabeledField104, { x: 231 })\n      ),\n      React.createElement(\n        \"div\",\n        { key: \"right\", className: \"\" },\n        React.createElement(\n          \"div\",\n          { className: \"_42ef\" },\n          React.createElement(\"div\", { className: \"_2oc7\" }, \"Clicks to Website\")\n        )\n      )\n    );\n  }\n  if (props.x === 235) {\n    return React.createElement(\n      \"div\",\n      { className: \"_3-8x clearfix\", direction: \"left\" },\n      React.createElement(\n        \"div\",\n        { key: \"left\", className: \"_ohe lfloat\" },\n        React.createElement(AdsLabeledField104, { x: 234 })\n      ),\n      React.createElement(\n        \"div\",\n        { key: \"right\", className: \"\" },\n        React.createElement(\n          \"div\",\n          { className: \"_42ef\" },\n          React.createElement(\"div\", { className: \"_2oc7\" }, \"Auction\")\n        )\n      )\n    );\n  }\n  if (props.x === 245) {\n    return React.createElement(\n      \"div\",\n      { className: \"_3-8y clearfix\", direction: \"left\" },\n      React.createElement(\n        \"div\",\n        { key: \"left\", className: \"_ohe lfloat\" },\n        React.createElement(AdsLabeledField104, { x: 240 })\n      ),\n      React.createElement(\n        \"div\",\n        { key: \"right\", className: \"\" },\n        React.createElement(\n          \"div\",\n          { className: \"_42ef\" },\n          React.createElement(FluxContainer_AdsCampaignGroupSpendCapContainer_107, { x: 244 })\n        )\n      )\n    );\n  }\n  if (props.x === 277) {\n    return React.createElement(\n      \"div\",\n      { className: \"_5dw9 _5dwa clearfix\" },\n      React.createElement(\n        \"div\",\n        { key: \"left\", className: \"_ohe lfloat\" },\n        React.createElement(XUICardHeaderTitle100, { x: 265, key: \".0\" })\n      ),\n      React.createElement(\n        \"div\",\n        { key: \"right\", className: \"_ohf rfloat\" },\n        React.createElement(FluxContainer_AdsPluginizedLinksMenuContainer_121, { x: 276, key: \".1\" })\n      )\n    );\n  }\n};\n\nvar AdsUnifiedNavigationLocalNav22 = function(props) {\n  if (props.x === 35) {\n    return React.createElement(\"div\", { className: \"_34_i\" }, React.createElement(LeftRight21, { x: 34 }));\n  }\n};\n\nvar XUIDialog23 = function(props) {\n  if (props.x === 36) {\n    return null;\n  }\n};\n\nvar AdsPEResetDialog24 = function(props) {\n  if (props.x === 37) {\n    return React.createElement(\"span\", null, React.createElement(XUIDialog23, { x: 36, key: \"dialog/.0\" }));\n  }\n};\n\nvar AdsPETopNav25 = function(props) {\n  if (props.x === 40) {\n    return React.createElement(\n      \"div\",\n      { style: { width: 1306 } },\n      React.createElement(AdsUnifiedNavigationLocalNav22, { x: 35 }),\n      React.createElement(AdsErrorBoundary10, { x: 39 })\n    );\n  }\n};\n\nvar FluxContainer_AdsPETopNavContainer_26 = function(props) {\n  if (props.x === 41) {\n    return React.createElement(AdsPETopNav25, { x: 40 });\n  }\n};\n\nvar XUIAbstractGlyphButton27 = function(props) {\n  if (props.x === 46) {\n    return React.createElement(AbstractButton3, { x: 45 });\n  }\n  if (props.x === 150) {\n    return React.createElement(AbstractButton3, { x: 149 });\n  }\n};\n\nvar XUICloseButton28 = function(props) {\n  if (props.x === 47) {\n    return React.createElement(XUIAbstractGlyphButton27, { x: 46 });\n  }\n  if (props.x === 151) {\n    return React.createElement(XUIAbstractGlyphButton27, { x: 150 });\n  }\n};\n\nvar XUIText29 = function(props) {\n  if (props.x === 48) {\n    return React.createElement(\"span\", { display: \"inline\", className: \" _50f7\" }, \"Ads Manager\");\n  }\n  if (props.x === 205) {\n    return React.createElement(\"span\", { className: \"_2x9f  _50f5 _50f7\", display: \"inline\" }, \"Editing Campaign\");\n  }\n  if (props.x === 206) {\n    return React.createElement(\"span\", { display: \"inline\", className: \" _50f5 _50f7\" }, \"Test Campaign\");\n  }\n};\n\nvar XUINotice30 = function(props) {\n  if (props.x === 51) {\n    return React.createElement(\n      \"div\",\n      { size: \"medium\", className: \"_585n _585o _2wdd\" },\n      React.createElement(ReactImage0, { x: 42 }),\n      React.createElement(XUICloseButton28, { x: 47 }),\n      React.createElement(\n        \"div\",\n        { className: \"_585r _2i-a _50f4\" },\n        \"Please go to \",\n        React.createElement(Link2, { x: 50 }),\n        \" to set up a payment method for this ad account.\"\n      )\n    );\n  }\n};\n\nvar ReactCSSTransitionGroupChild31 = function(props) {\n  if (props.x === 52) {\n    return React.createElement(XUINotice30, { x: 51 });\n  }\n};\n\nvar ReactTransitionGroup32 = function(props) {\n  if (props.x === 53) {\n    return React.createElement(\"span\", null, React.createElement(ReactCSSTransitionGroupChild31, { x: 52, key: \".0\" }));\n  }\n};\n\nvar ReactCSSTransitionGroup33 = function(props) {\n  if (props.x === 54) {\n    return React.createElement(ReactTransitionGroup32, { x: 53 });\n  }\n};\n\nvar AdsPETopError34 = function(props) {\n  if (props.x === 55) {\n    return React.createElement(\n      \"div\",\n      { className: \"_2wdc\" },\n      React.createElement(ReactCSSTransitionGroup33, { x: 54 })\n    );\n  }\n};\n\nvar FluxContainer_AdsPETopErrorContainer_35 = function(props) {\n  if (props.x === 56) {\n    return React.createElement(AdsPETopError34, { x: 55 });\n  }\n};\n\nvar FluxContainer_AdsGuidanceChannel_36 = function(props) {\n  if (props.x === 59) {\n    return null;\n  }\n};\n\nvar ResponsiveBlock37 = function(props) {\n  if (props.x === 62) {\n    return React.createElement(\n      \"div\",\n      { className: \"_4u-c\" },\n      [\n        React.createElement(AdsErrorBoundary10, { x: 58, key: 1 }),\n        React.createElement(AdsErrorBoundary10, { x: 61, key: 2 }),\n      ],\n      React.createElement(\n        \"div\",\n        { key: \"sensor\", className: \"_4u-f\" },\n        React.createElement(\"iframe\", {\n          \"aria-hidden\": \"true\",\n          className: \"_1_xb\",\n          tabIndex: \"-1\",\n        })\n      )\n    );\n  }\n  if (props.x === 469) {\n    return React.createElement(\n      \"div\",\n      { className: \"_4u-c\" },\n      React.createElement(AdsPEDataTableContainer158, { x: 468 }),\n      React.createElement(\n        \"div\",\n        { key: \"sensor\", className: \"_4u-f\" },\n        React.createElement(\"iframe\", {\n          \"aria-hidden\": \"true\",\n          className: \"_1_xb\",\n          tabIndex: \"-1\",\n        })\n      )\n    );\n  }\n};\n\nvar FluxContainer_AdsBulkEditDialogContainer_38 = function(props) {\n  if (props.x === 63) {\n    return null;\n  }\n};\n\nvar Column39 = function(props) {\n  if (props.x === 66) {\n    return React.createElement(\n      \"div\",\n      { className: \"_4bl8 _4bl7\" },\n      React.createElement(\n        \"div\",\n        { className: \"_3c5f\" },\n        null,\n        null,\n        React.createElement(\"div\", { className: \"_3c5i\" }),\n        null\n      )\n    );\n  }\n};\n\nvar XUIButtonGroup40 = function(props) {\n  if (props.x === 75) {\n    return React.createElement(\n      \"div\",\n      { className: \"_5n7z _51xa\" },\n      React.createElement(XUIButton4, { x: 69 }),\n      React.createElement(ReactPopoverMenu20, { x: 74 })\n    );\n  }\n  if (props.x === 84) {\n    return React.createElement(\n      \"div\",\n      { className: \"_5n7z _51xa\" },\n      React.createElement(XUIButton4, { x: 78, key: \"edit\" }),\n      React.createElement(ReactPopoverMenu20, { x: 83, key: \"editMenu\" })\n    );\n  }\n  if (props.x === 97) {\n    return React.createElement(\n      \"div\",\n      { className: \"_5n7z _51xa\" },\n      React.createElement(XUIButton4, { x: 90, key: \"revert\" }),\n      React.createElement(XUIButton4, { x: 93, key: \"delete\" }),\n      React.createElement(XUIButton4, { x: 96, key: \"duplicate\" })\n    );\n  }\n  if (props.x === 117) {\n    return React.createElement(\n      \"div\",\n      { className: \"_5n7z _51xa\" },\n      React.createElement(AdsPEExportImportMenuContainer48, { x: 107 }),\n      React.createElement(XUIButton4, { x: 110, key: \"createReport\" }),\n      React.createElement(AdsPECampaignGroupTagContainer51, {\n        x: 116,\n        key: \"tags\",\n      })\n    );\n  }\n};\n\nvar AdsPEEditToolbarButton41 = function(props) {\n  if (props.x === 85) {\n    return React.createElement(XUIButtonGroup40, { x: 84 });\n  }\n};\n\nvar FluxContainer_AdsPEEditCampaignGroupToolbarButtonContainer_42 = function(props) {\n  if (props.x === 86) {\n    return React.createElement(AdsPEEditToolbarButton41, { x: 85 });\n  }\n};\n\nvar FluxContainer_AdsPEEditToolbarButtonContainer_43 = function(props) {\n  if (props.x === 87) {\n    return React.createElement(FluxContainer_AdsPEEditCampaignGroupToolbarButtonContainer_42, { x: 86 });\n  }\n};\n\nvar AdsPEExportImportMenu44 = function(props) {\n  if (props.x === 103) {\n    return React.createElement(ReactPopoverMenu20, { x: 102, key: \"export\" });\n  }\n};\n\nvar FluxContainer_AdsPECustomizeExportContainer_45 = function(props) {\n  if (props.x === 104) {\n    return null;\n  }\n};\n\nvar AdsPEExportAsTextDialog46 = function(props) {\n  if (props.x === 105) {\n    return null;\n  }\n};\n\nvar FluxContainer_AdsPEExportAsTextDialogContainer_47 = function(props) {\n  if (props.x === 106) {\n    return React.createElement(AdsPEExportAsTextDialog46, { x: 105 });\n  }\n};\n\nvar AdsPEExportImportMenuContainer48 = function(props) {\n  if (props.x === 107) {\n    return React.createElement(\n      \"span\",\n      null,\n      React.createElement(AdsPEExportImportMenu44, { x: 103 }),\n      React.createElement(FluxContainer_AdsPECustomizeExportContainer_45, {\n        x: 104,\n      }),\n      React.createElement(FluxContainer_AdsPEExportAsTextDialogContainer_47, {\n        x: 106,\n      }),\n      null,\n      null\n    );\n  }\n};\n\nvar Constructor49 = function(props) {\n  if (props.x === 114) {\n    return null;\n  }\n  if (props.x === 142) {\n    return null;\n  }\n  if (props.x === 143) {\n    return null;\n  }\n  if (props.x === 183) {\n    return null;\n  }\n};\n\nvar TagSelectorPopover50 = function(props) {\n  if (props.x === 115) {\n    return React.createElement(\n      \"span\",\n      { className: \" _3d6e\" },\n      React.createElement(XUIButton4, { x: 113 }),\n      React.createElement(Constructor49, { x: 114, key: \"layer\" })\n    );\n  }\n};\n\nvar AdsPECampaignGroupTagContainer51 = function(props) {\n  if (props.x === 116) {\n    return React.createElement(TagSelectorPopover50, {\n      x: 115,\n      key: \"98010048849317\",\n    });\n  }\n};\n\nvar AdsRuleToolbarMenu52 = function(props) {\n  if (props.x === 118) {\n    return null;\n  }\n};\n\nvar FluxContainer_AdsPERuleToolbarMenuContainer_53 = function(props) {\n  if (props.x === 119) {\n    return React.createElement(AdsRuleToolbarMenu52, { x: 118 });\n  }\n};\n\nvar FillColumn54 = function(props) {\n  if (props.x === 120) {\n    return React.createElement(\n      \"div\",\n      { className: \"_4bl9\" },\n      React.createElement(\n        \"span\",\n        { className: \"_3c5e\" },\n        React.createElement(\n          \"span\",\n          null,\n          React.createElement(XUIButtonGroup40, { x: 75 }),\n          React.createElement(FluxContainer_AdsPEEditToolbarButtonContainer_43, { x: 87 }),\n          null,\n          React.createElement(XUIButtonGroup40, { x: 97 })\n        ),\n        React.createElement(XUIButtonGroup40, { x: 117 }),\n        React.createElement(FluxContainer_AdsPERuleToolbarMenuContainer_53, {\n          x: 119,\n        })\n      )\n    );\n  }\n};\n\nvar Layout55 = function(props) {\n  if (props.x === 121) {\n    return React.createElement(\n      \"div\",\n      { className: \"clearfix\" },\n      React.createElement(Column39, { x: 66, key: \"1\" }),\n      React.createElement(FillColumn54, { x: 120, key: \"0\" })\n    );\n  }\n};\n\nvar AdsPEMainPaneToolbar56 = function(props) {\n  if (props.x === 122) {\n    return React.createElement(\"div\", { className: \"_3c5b clearfix\" }, React.createElement(Layout55, { x: 121 }));\n  }\n};\n\nvar AdsPECampaignGroupToolbarContainer57 = function(props) {\n  if (props.x === 123) {\n    return React.createElement(AdsPEMainPaneToolbar56, { x: 122 });\n  }\n};\n\nvar AdsPEFiltersPopover58 = function(props) {\n  if (props.x === 144) {\n    return React.createElement(\n      \"span\",\n      { className: \"_5b-l  _5bbe\" },\n      React.createElement(ReactXUIPopoverButton6, { x: 133 }),\n      React.createElement(ReactXUIPopoverButton6, { x: 141 }),\n      [\n        React.createElement(Constructor49, { x: 142, key: \"filterMenu/.0\" }),\n        React.createElement(Constructor49, { x: 143, key: \"searchMenu/.0\" }),\n      ]\n    );\n  }\n};\n\nvar AbstractCheckboxInput59 = function(props) {\n  if (props.x === 145) {\n    return React.createElement(\n      \"label\",\n      { className: \"uiInputLabelInput _55sg _kv1\" },\n      React.createElement(\"input\", {\n        checked: true,\n        disabled: true,\n        name: \"filterUnpublished\",\n        value: \"on\",\n        onClick: function() {},\n        className: null,\n        id: \"js_input_label_21\",\n        type: \"checkbox\",\n      }),\n      React.createElement(\"span\", {\n        \"data-hover\": null,\n        \"data-tooltip-content\": undefined,\n      })\n    );\n  }\n  if (props.x === 336) {\n    return React.createElement(\n      \"label\",\n      { className: \"_4h2r _55sg _kv1\" },\n      React.createElement(\"input\", {\n        checked: undefined,\n        onChange: function() {},\n        className: null,\n        type: \"checkbox\",\n      }),\n      React.createElement(\"span\", {\n        \"data-hover\": null,\n        \"data-tooltip-content\": undefined,\n      })\n    );\n  }\n};\n\nvar XUICheckboxInput60 = function(props) {\n  if (props.x === 146) {\n    return React.createElement(AbstractCheckboxInput59, { x: 145 });\n  }\n  if (props.x === 337) {\n    return React.createElement(AbstractCheckboxInput59, { x: 336 });\n  }\n};\n\nvar InputLabel61 = function(props) {\n  if (props.x === 147) {\n    return React.createElement(\n      \"div\",\n      { display: \"block\", className: \"uiInputLabel clearfix\" },\n      React.createElement(XUICheckboxInput60, { x: 146 }),\n      React.createElement(\n        \"label\",\n        { className: \"uiInputLabelLabel\", htmlFor: \"js_input_label_21\" },\n        \"Always show new items\"\n      )\n    );\n  }\n};\n\nvar AdsPopoverLink62 = function(props) {\n  if (props.x === 154) {\n    return React.createElement(\n      \"span\",\n      null,\n      React.createElement(\n        \"span\",\n        {\n          onMouseEnter: function() {},\n          onMouseLeave: function() {},\n          onMouseUp: undefined,\n        },\n        React.createElement(\"span\", { className: \"_3o_j\" }),\n        React.createElement(ReactImage0, { x: 153 })\n      ),\n      null\n    );\n  }\n  if (props.x === 238) {\n    return React.createElement(\n      \"span\",\n      null,\n      React.createElement(\n        \"span\",\n        {\n          onMouseEnter: function() {},\n          onMouseLeave: function() {},\n          onMouseUp: undefined,\n        },\n        React.createElement(\"span\", { className: \"_3o_j\" }),\n        React.createElement(ReactImage0, { x: 237 })\n      ),\n      null\n    );\n  }\n};\n\nvar AdsHelpLink63 = function(props) {\n  if (props.x === 155) {\n    return React.createElement(AdsPopoverLink62, { x: 154 });\n  }\n  if (props.x === 239) {\n    return React.createElement(AdsPopoverLink62, { x: 238 });\n  }\n};\n\nvar BUIFilterTokenInput64 = function(props) {\n  if (props.x === 158) {\n    return React.createElement(\n      \"div\",\n      { className: \"_5b5o _3yz3 _4cld\" },\n      React.createElement(\n        \"div\",\n        { className: \"_5b5t _2d2k\" },\n        React.createElement(ReactImage0, { x: 152 }),\n        React.createElement(\n          \"div\",\n          { className: \"_5b5r\" },\n          \"Campaigns: (1)\",\n          React.createElement(AdsHelpLink63, { x: 155 })\n        )\n      ),\n      React.createElement(XUIButton4, { x: 157 })\n    );\n  }\n};\n\nvar BUIFilterToken65 = function(props) {\n  if (props.x === 159) {\n    return React.createElement(\n      \"div\",\n      { className: \"_3yz1 _3yz2 _3dad\" },\n      React.createElement(\n        \"div\",\n        { className: \"_3yz4\", \"aria-hidden\": false },\n        React.createElement(\n          \"div\",\n          { onClick: function() {}, className: \"_3yz5\" },\n          React.createElement(ReactImage0, { x: 148 }),\n          React.createElement(\"div\", { className: \"_3yz7\" }, \"Campaigns:\"),\n          React.createElement(\n            \"div\",\n            {\n              className: \"ellipsis _3yz8\",\n              \"data-hover\": \"tooltip\",\n              \"data-tooltip-display\": \"overflow\",\n            },\n            \"(1)\"\n          )\n        ),\n        null,\n        React.createElement(XUICloseButton28, { x: 151 })\n      ),\n      React.createElement(BUIFilterTokenInput64, { x: 158 })\n    );\n  }\n};\n\nvar BUIFilterTokenCreateButton66 = function(props) {\n  if (props.x === 163) {\n    return React.createElement(\"div\", { className: \"_1tc\" }, React.createElement(XUIButton4, { x: 162 }));\n  }\n};\n\nvar BUIFilterTokenizer67 = function(props) {\n  if (props.x === 164) {\n    return React.createElement(\n      \"div\",\n      { className: \"_5b-m  clearfix\" },\n      undefined,\n      [],\n      React.createElement(BUIFilterToken65, { x: 159, key: \"token0\" }),\n      React.createElement(BUIFilterTokenCreateButton66, { x: 163 }),\n      null,\n      React.createElement(\"div\", { className: \"_49u3\" })\n    );\n  }\n};\n\nvar XUIAmbientNUX68 = function(props) {\n  if (props.x === 165) {\n    return null;\n  }\n  if (props.x === 189) {\n    return null;\n  }\n  if (props.x === 200) {\n    return null;\n  }\n};\n\nvar XUIAmbientNUX69 = function(props) {\n  if (props.x === 166) {\n    return React.createElement(XUIAmbientNUX68, { x: 165 });\n  }\n  if (props.x === 190) {\n    return React.createElement(XUIAmbientNUX68, { x: 189 });\n  }\n  if (props.x === 201) {\n    return React.createElement(XUIAmbientNUX68, { x: 200 });\n  }\n};\n\nvar AdsPEAmbientNUXMegaphone70 = function(props) {\n  if (props.x === 167) {\n    return React.createElement(\n      \"span\",\n      null,\n      React.createElement(\"span\", {}),\n      React.createElement(XUIAmbientNUX69, { x: 166, key: \"nux\" })\n    );\n  }\n};\n\nvar AdsPEFilters71 = function(props) {\n  if (props.x === 168) {\n    return React.createElement(\n      \"div\",\n      { className: \"_4rw_\" },\n      React.createElement(AdsPEFiltersPopover58, { x: 144 }),\n      React.createElement(\"div\", { className: \"_1eo\" }, React.createElement(InputLabel61, { x: 147 })),\n      React.createElement(BUIFilterTokenizer67, { x: 164 }),\n      \"\",\n      React.createElement(AdsPEAmbientNUXMegaphone70, { x: 167 })\n    );\n  }\n};\n\nvar AdsPEFilterContainer72 = function(props) {\n  if (props.x === 169) {\n    return React.createElement(AdsPEFilters71, { x: 168 });\n  }\n};\n\nvar AdsPETablePager73 = function(props) {\n  if (props.x === 172) {\n    return null;\n  }\n};\n\nvar AdsPECampaignGroupTablePagerContainer74 = function(props) {\n  if (props.x === 173) {\n    return React.createElement(AdsPETablePager73, { x: 172 });\n  }\n};\n\nvar AdsPETablePagerContainer75 = function(props) {\n  if (props.x === 174) {\n    return React.createElement(AdsPECampaignGroupTablePagerContainer74, {\n      x: 173,\n    });\n  }\n};\n\nvar ReactXUIError76 = function(props) {\n  if (props.x === 181) {\n    return React.createElement(AbstractButton3, { x: 180 });\n  }\n  if (props.x === 216) {\n    return React.createElement(\n      \"div\",\n      { className: \"_40bf _2vl4 _1h18\" },\n      null,\n      null,\n      React.createElement(\n        \"div\",\n        { className: \"_2vl9 _1h1f\", style: { backgroundColor: \"#fff\" } },\n        React.createElement(\n          \"div\",\n          { className: \"_2vla _1h1g\" },\n          React.createElement(\n            \"div\",\n            null,\n            null,\n            React.createElement(\"textarea\", {\n              className: \"_2vli _2vlj _1h26 _1h27\",\n              dir: \"auto\",\n              disabled: undefined,\n              id: undefined,\n              maxLength: null,\n              value: \"Test Campaign\",\n              onBlur: function() {},\n              onChange: function() {},\n              onFocus: function() {},\n              onKeyDown: function() {},\n            }),\n            null\n          ),\n          React.createElement(\"div\", {\n            \"aria-hidden\": \"true\",\n            className: \"_2vlk\",\n          })\n        )\n      ),\n      null\n    );\n  }\n  if (props.x === 221) {\n    return React.createElement(XUICard94, { x: 220 });\n  }\n  if (props.x === 250) {\n    return React.createElement(XUICard94, { x: 249 });\n  }\n  if (props.x === 280) {\n    return React.createElement(XUICard94, { x: 279 });\n  }\n};\n\nvar BUIPopoverButton77 = function(props) {\n  if (props.x === 182) {\n    return React.createElement(ReactXUIError76, { x: 181 });\n  }\n};\n\nvar BUIDateRangePicker78 = function(props) {\n  if (props.x === 184) {\n    return React.createElement(\"span\", null, React.createElement(BUIPopoverButton77, { x: 182 }), [\n      React.createElement(Constructor49, { x: 183, key: \"layer/.0\" }),\n    ]);\n  }\n};\n\nvar AdsPEStatsRangePicker79 = function(props) {\n  if (props.x === 185) {\n    return React.createElement(BUIDateRangePicker78, { x: 184 });\n  }\n};\n\nvar AdsPEStatRange80 = function(props) {\n  if (props.x === 191) {\n    return React.createElement(\n      \"div\",\n      { className: \"_3c5k\" },\n      React.createElement(\"span\", { className: \"_3c5j\" }, \"Stats:\"),\n      React.createElement(\n        \"span\",\n        { className: \"_3c5l\" },\n        React.createElement(AdsPEStatsRangePicker79, { x: 185 }),\n        React.createElement(XUIButton4, { x: 188, key: \"settings\" })\n      ),\n      [React.createElement(XUIAmbientNUX69, { x: 190, key: \"roasNUX/.0\" })]\n    );\n  }\n};\n\nvar AdsPEStatRangeContainer81 = function(props) {\n  if (props.x === 192) {\n    return React.createElement(AdsPEStatRange80, { x: 191 });\n  }\n};\n\nvar AdsPESideTrayTabButton82 = function(props) {\n  if (props.x === 196) {\n    return React.createElement(\n      \"div\",\n      { className: \"_1-ly _59j9 _d9a\", onClick: function() {} },\n      React.createElement(ReactImage0, { x: 195 }),\n      React.createElement(\"div\", { className: \"_vf7\" }),\n      React.createElement(\"div\", { className: \"_vf8\" })\n    );\n  }\n  if (props.x === 199) {\n    return React.createElement(\n      \"div\",\n      { className: \" _1-lz _d9a\", onClick: function() {} },\n      React.createElement(ReactImage0, { x: 198 }),\n      React.createElement(\"div\", { className: \"_vf7\" }),\n      React.createElement(\"div\", { className: \"_vf8\" })\n    );\n  }\n  if (props.x === 203) {\n    return null;\n  }\n};\n\nvar AdsPEEditorTrayTabButton83 = function(props) {\n  if (props.x === 197) {\n    return React.createElement(AdsPESideTrayTabButton82, { x: 196 });\n  }\n};\n\nvar AdsPEInsightsTrayTabButton84 = function(props) {\n  if (props.x === 202) {\n    return React.createElement(\n      \"span\",\n      null,\n      React.createElement(AdsPESideTrayTabButton82, { x: 199 }),\n      React.createElement(XUIAmbientNUX69, { x: 201, key: \"roasNUX\" })\n    );\n  }\n};\n\nvar AdsPENekoDebuggerTrayTabButton85 = function(props) {\n  if (props.x === 204) {\n    return React.createElement(AdsPESideTrayTabButton82, { x: 203 });\n  }\n};\n\nvar AdsPEEditorChildLink86 = function(props) {\n  if (props.x === 211) {\n    return React.createElement(\n      \"div\",\n      { className: \"_3ywr\" },\n      React.createElement(Link2, { x: 208 }),\n      React.createElement(\"span\", { className: \"_3ywq\" }, \"|\"),\n      React.createElement(Link2, { x: 210 })\n    );\n  }\n};\n\nvar AdsPEEditorChildLinkContainer87 = function(props) {\n  if (props.x === 212) {\n    return React.createElement(AdsPEEditorChildLink86, { x: 211 });\n  }\n};\n\nvar AdsPEHeaderSection88 = function(props) {\n  if (props.x === 213) {\n    return React.createElement(\n      \"div\",\n      { className: \"_yke\" },\n      React.createElement(\"div\", { className: \"_2x9d _pr-\" }),\n      React.createElement(XUIText29, { x: 205 }),\n      React.createElement(\n        \"div\",\n        { className: \"_3a-a\" },\n        React.createElement(\"div\", { className: \"_3a-b\" }, React.createElement(XUIText29, { x: 206 }))\n      ),\n      React.createElement(AdsPEEditorChildLinkContainer87, { x: 212 })\n    );\n  }\n};\n\nvar AdsPECampaignGroupHeaderSectionContainer89 = function(props) {\n  if (props.x === 214) {\n    return React.createElement(AdsPEHeaderSection88, { x: 213 });\n  }\n};\n\nvar AdsEditorLoadingErrors90 = function(props) {\n  if (props.x === 215) {\n    return null;\n  }\n};\n\nvar AdsTextInput91 = function(props) {\n  if (props.x === 217) {\n    return React.createElement(ReactXUIError76, { x: 216 });\n  }\n};\n\nvar BUIFormElement92 = function(props) {\n  if (props.x === 218) {\n    return React.createElement(\n      \"div\",\n      { className: \"_5521 clearfix\" },\n      React.createElement(\n        \"div\",\n        { className: \"_5522 _3w5q\" },\n        React.createElement(\n          \"label\",\n          {\n            onClick: undefined,\n            htmlFor: \"1467872040612:1961945894\",\n            className: \"_5523 _3w5r\",\n          },\n          \"Campaign Name\",\n          null\n        )\n      ),\n      React.createElement(\n        \"div\",\n        { className: \"_5527\" },\n        React.createElement(\n          \"div\",\n          { className: \"_5528\" },\n          React.createElement(\n            \"span\",\n            { key: \".0\", className: \"_40bg\", id: \"1467872040612:1961945894\" },\n            React.createElement(AdsTextInput91, {\n              x: 217,\n              key: \"nameEditor98010048849317\",\n            }),\n            null\n          )\n        ),\n        null\n      )\n    );\n  }\n};\n\nvar BUIForm93 = function(props) {\n  if (props.x === 219) {\n    return React.createElement(\n      \"div\",\n      { className: \"_5ks1 _550r  _550t _550y _3w5n\" },\n      React.createElement(BUIFormElement92, { x: 218, key: \".0\" })\n    );\n  }\n};\n\nvar XUICard94 = function(props) {\n  if (props.x === 220) {\n    return React.createElement(\n      \"div\",\n      { className: \"_40bc _12k2 _4-u2  _4-u8\" },\n      React.createElement(BUIForm93, { x: 219 })\n    );\n  }\n  if (props.x === 249) {\n    return React.createElement(\n      \"div\",\n      { className: \"_12k2 _4-u2  _4-u8\" },\n      React.createElement(AdsCardHeader103, { x: 230 }),\n      React.createElement(AdsCardSection108, { x: 248 })\n    );\n  }\n  if (props.x === 279) {\n    return React.createElement(\n      \"div\",\n      { className: \"_12k2 _4-u2  _4-u8\" },\n      React.createElement(AdsCardLeftRightHeader122, { x: 278 })\n    );\n  }\n};\n\nvar AdsCard95 = function(props) {\n  if (props.x === 222) {\n    return React.createElement(ReactXUIError76, { x: 221 });\n  }\n  if (props.x === 251) {\n    return React.createElement(ReactXUIError76, { x: 250 });\n  }\n  if (props.x === 281) {\n    return React.createElement(ReactXUIError76, { x: 280 });\n  }\n};\n\nvar AdsEditorNameSection96 = function(props) {\n  if (props.x === 223) {\n    return React.createElement(AdsCard95, { x: 222 });\n  }\n};\n\nvar AdsCampaignGroupNameSectionContainer97 = function(props) {\n  if (props.x === 224) {\n    return React.createElement(AdsEditorNameSection96, {\n      x: 223,\n      key: \"nameSection98010048849317\",\n    });\n  }\n};\n\nvar _render98 = function(props) {\n  if (props.x === 225) {\n    return React.createElement(AdsCampaignGroupNameSectionContainer97, {\n      x: 224,\n    });\n  }\n};\n\nvar AdsPluginWrapper99 = function(props) {\n  if (props.x === 226) {\n    return React.createElement(_render98, { x: 225 });\n  }\n  if (props.x === 255) {\n    return React.createElement(_render111, { x: 254 });\n  }\n  if (props.x === 258) {\n    return React.createElement(_render113, { x: 257 });\n  }\n  if (props.x === 287) {\n    return React.createElement(_render127, { x: 286 });\n  }\n  if (props.x === 291) {\n    return React.createElement(_render130, { x: 290 });\n  }\n};\n\nvar XUICardHeaderTitle100 = function(props) {\n  if (props.x === 227) {\n    return React.createElement(\n      \"span\",\n      { className: \"_38my\" },\n      \"Campaign Details\",\n      null,\n      React.createElement(\"span\", { className: \"_c1c\" })\n    );\n  }\n  if (props.x === 265) {\n    return React.createElement(\n      \"span\",\n      { className: \"_38my\" },\n      [\n        React.createElement(\"span\", { key: 1 }, \"Campaign ID\", \": \", \"98010048849317\"),\n        React.createElement(\n          \"div\",\n          { className: \"_5lh9\", key: 2 },\n          React.createElement(FluxContainer_AdsCampaignGroupStatusSwitchContainer_119, { x: 264 })\n        ),\n      ],\n      null,\n      React.createElement(\"span\", { className: \"_c1c\" })\n    );\n  }\n};\n\nvar XUICardSection101 = function(props) {\n  if (props.x === 228) {\n    return React.createElement(\n      \"div\",\n      { className: \"_5dw9 _5dwa _4-u3\" },\n      [React.createElement(XUICardHeaderTitle100, { x: 227, key: \".0\" })],\n      undefined,\n      undefined,\n      React.createElement(\"div\", { className: \"_3s3-\" })\n    );\n  }\n  if (props.x === 247) {\n    return React.createElement(\n      \"div\",\n      { className: \"_12jy _4-u3\" },\n      React.createElement(\n        \"div\",\n        { className: \"_3-8j\" },\n        React.createElement(FlexibleBlock105, { x: 233 }),\n        React.createElement(FlexibleBlock105, { x: 236 }),\n        React.createElement(FlexibleBlock105, { x: 246 }),\n        null,\n        null\n      )\n    );\n  }\n};\n\nvar XUICardHeader102 = function(props) {\n  if (props.x === 229) {\n    return React.createElement(XUICardSection101, { x: 228 });\n  }\n};\n\nvar AdsCardHeader103 = function(props) {\n  if (props.x === 230) {\n    return React.createElement(XUICardHeader102, { x: 229 });\n  }\n};\n\nvar AdsLabeledField104 = function(props) {\n  if (props.x === 231) {\n    return React.createElement(\n      \"div\",\n      { className: \"_2oc6 _3bvz\", label: \"Objective\" },\n      React.createElement(\"label\", { className: \"_4el4 _3qwj _3hy-\", htmlFor: undefined }, \"Objective \"),\n      null,\n      React.createElement(\"div\", { className: \"_3bv-\" })\n    );\n  }\n  if (props.x === 234) {\n    return React.createElement(\n      \"div\",\n      { className: \"_2oc6 _3bvz\", label: \"Buying Type\" },\n      React.createElement(\"label\", { className: \"_4el4 _3qwj _3hy-\", htmlFor: undefined }, \"Buying Type \"),\n      null,\n      React.createElement(\"div\", { className: \"_3bv-\" })\n    );\n  }\n  if (props.x === 240) {\n    return React.createElement(\n      \"div\",\n      { className: \"_2oc6 _3bvz\" },\n      React.createElement(\"label\", { className: \"_4el4 _3qwj _3hy-\", htmlFor: undefined }, \"Campaign Spending Limit \"),\n      React.createElement(AdsHelpLink63, { x: 239 }),\n      React.createElement(\"div\", { className: \"_3bv-\" })\n    );\n  }\n};\n\nvar FlexibleBlock105 = function(props) {\n  if (props.x === 233) {\n    return React.createElement(LeftRight21, { x: 232 });\n  }\n  if (props.x === 236) {\n    return React.createElement(LeftRight21, { x: 235 });\n  }\n  if (props.x === 246) {\n    return React.createElement(LeftRight21, { x: 245 });\n  }\n};\n\nvar AdsBulkCampaignSpendCapField106 = function(props) {\n  if (props.x === 243) {\n    return React.createElement(\n      \"div\",\n      { className: \"_33dv\" },\n      \"\",\n      React.createElement(Link2, { x: 242 }),\n      \" (optional)\"\n    );\n  }\n};\n\nvar FluxContainer_AdsCampaignGroupSpendCapContainer_107 = function(props) {\n  if (props.x === 244) {\n    return React.createElement(AdsBulkCampaignSpendCapField106, { x: 243 });\n  }\n};\n\nvar AdsCardSection108 = function(props) {\n  if (props.x === 248) {\n    return React.createElement(XUICardSection101, { x: 247 });\n  }\n};\n\nvar AdsEditorCampaignGroupDetailsSection109 = function(props) {\n  if (props.x === 252) {\n    return React.createElement(AdsCard95, { x: 251 });\n  }\n};\n\nvar AdsEditorCampaignGroupDetailsSectionContainer110 = function(props) {\n  if (props.x === 253) {\n    return React.createElement(AdsEditorCampaignGroupDetailsSection109, {\n      x: 252,\n      key: \"campaignGroupDetailsSection98010048849317\",\n    });\n  }\n};\n\nvar _render111 = function(props) {\n  if (props.x === 254) {\n    return React.createElement(AdsEditorCampaignGroupDetailsSectionContainer110, { x: 253 });\n  }\n};\n\nvar FluxContainer_AdsEditorToplineDetailsSectionContainer_112 = function(props) {\n  if (props.x === 256) {\n    return null;\n  }\n};\n\nvar _render113 = function(props) {\n  if (props.x === 257) {\n    return React.createElement(FluxContainer_AdsEditorToplineDetailsSectionContainer_112, { x: 256 });\n  }\n};\n\nvar AdsStickyArea114 = function(props) {\n  if (props.x === 259) {\n    return React.createElement(\"div\", {}, React.createElement(\"div\", { onWheel: function() {} }));\n  }\n  if (props.x === 292) {\n    return React.createElement(\n      \"div\",\n      {},\n      React.createElement(\"div\", { onWheel: function() {} }, [\n        React.createElement(\n          \"div\",\n          { key: \"campaign_group_errors_section98010048849317\" },\n          React.createElement(AdsPluginWrapper99, { x: 291 })\n        ),\n      ])\n    );\n  }\n};\n\nvar FluxContainer_AdsEditorColumnContainer_115 = function(props) {\n  if (props.x === 260) {\n    return React.createElement(\n      \"div\",\n      null,\n      [\n        React.createElement(\n          \"div\",\n          { key: \"campaign_group_name_section98010048849317\" },\n          React.createElement(AdsPluginWrapper99, { x: 226 })\n        ),\n        React.createElement(\n          \"div\",\n          { key: \"campaign_group_basic_section98010048849317\" },\n          React.createElement(AdsPluginWrapper99, { x: 255 })\n        ),\n        React.createElement(\n          \"div\",\n          { key: \"campaign_group_topline_section98010048849317\" },\n          React.createElement(AdsPluginWrapper99, { x: 258 })\n        ),\n      ],\n      React.createElement(AdsStickyArea114, { x: 259 })\n    );\n  }\n  if (props.x === 293) {\n    return React.createElement(\n      \"div\",\n      null,\n      [\n        React.createElement(\n          \"div\",\n          { key: \"campaign_group_navigation_section98010048849317\" },\n          React.createElement(AdsPluginWrapper99, { x: 287 })\n        ),\n      ],\n      React.createElement(AdsStickyArea114, { x: 292 })\n    );\n  }\n};\n\nvar BUISwitch116 = function(props) {\n  if (props.x === 261) {\n    return React.createElement(\n      \"div\",\n      {\n        \"data-hover\": \"tooltip\",\n        \"data-tooltip-content\": \"Currently active. Click this switch to deactivate it.\",\n        \"data-tooltip-position\": \"below\",\n        disabled: false,\n        value: true,\n        onToggle: function() {},\n        className: \"_128j _128k _128n\",\n        role: \"checkbox\",\n        \"aria-checked\": \"true\",\n      },\n      React.createElement(\n        \"div\",\n        {\n          className: \"_128o\",\n          onClick: function() {},\n          onKeyDown: function() {},\n          onMouseDown: function() {},\n          tabIndex: \"0\",\n        },\n        React.createElement(\"div\", { className: \"_128p\" })\n      ),\n      null\n    );\n  }\n};\n\nvar AdsStatusSwitchInternal117 = function(props) {\n  if (props.x === 262) {\n    return React.createElement(BUISwitch116, { x: 261 });\n  }\n};\n\nvar AdsStatusSwitch118 = function(props) {\n  if (props.x === 263) {\n    return React.createElement(AdsStatusSwitchInternal117, { x: 262 });\n  }\n};\n\nvar FluxContainer_AdsCampaignGroupStatusSwitchContainer_119 = function(props) {\n  if (props.x === 264) {\n    return React.createElement(AdsStatusSwitch118, {\n      x: 263,\n      key: \"status98010048849317\",\n    });\n  }\n};\n\nvar AdsLinksMenu120 = function(props) {\n  if (props.x === 275) {\n    return React.createElement(ReactPopoverMenu20, { x: 274 });\n  }\n};\n\nvar FluxContainer_AdsPluginizedLinksMenuContainer_121 = function(props) {\n  if (props.x === 276) {\n    return React.createElement(\"div\", null, null, React.createElement(AdsLinksMenu120, { x: 275 }));\n  }\n};\n\nvar AdsCardLeftRightHeader122 = function(props) {\n  if (props.x === 278) {\n    return React.createElement(LeftRight21, { x: 277 });\n  }\n};\n\nvar AdsPEIDSection123 = function(props) {\n  if (props.x === 282) {\n    return React.createElement(AdsCard95, { x: 281 });\n  }\n};\n\nvar FluxContainer_AdsPECampaignGroupIDSectionContainer_124 = function(props) {\n  if (props.x === 283) {\n    return React.createElement(AdsPEIDSection123, { x: 282 });\n  }\n};\n\nvar DeferredComponent125 = function(props) {\n  if (props.x === 284) {\n    return React.createElement(FluxContainer_AdsPECampaignGroupIDSectionContainer_124, { x: 283 });\n  }\n};\n\nvar BootloadedComponent126 = function(props) {\n  if (props.x === 285) {\n    return React.createElement(DeferredComponent125, { x: 284 });\n  }\n};\n\nvar _render127 = function(props) {\n  if (props.x === 286) {\n    return React.createElement(BootloadedComponent126, { x: 285 });\n  }\n};\n\nvar AdsEditorErrorsCard128 = function(props) {\n  if (props.x === 288) {\n    return null;\n  }\n};\n\nvar FluxContainer_FunctionalContainer_129 = function(props) {\n  if (props.x === 289) {\n    return React.createElement(AdsEditorErrorsCard128, { x: 288 });\n  }\n};\n\nvar _render130 = function(props) {\n  if (props.x === 290) {\n    return React.createElement(FluxContainer_FunctionalContainer_129, {\n      x: 289,\n    });\n  }\n};\n\nvar AdsEditorMultiColumnLayout131 = function(props) {\n  if (props.x === 294) {\n    return React.createElement(\n      \"div\",\n      { className: \"_psh\" },\n      React.createElement(\n        \"div\",\n        { className: \"_3cc0\" },\n        React.createElement(\n          \"div\",\n          null,\n          React.createElement(AdsEditorLoadingErrors90, { x: 215, key: \".0\" }),\n          React.createElement(\n            \"div\",\n            { className: \"_3ms3\" },\n            React.createElement(\n              \"div\",\n              { className: \"_3ms4\" },\n              React.createElement(FluxContainer_AdsEditorColumnContainer_115, { x: 260, key: \".1\" })\n            ),\n            React.createElement(\n              \"div\",\n              { className: \"_3pvg\" },\n              React.createElement(FluxContainer_AdsEditorColumnContainer_115, { x: 293, key: \".2\" })\n            )\n          )\n        )\n      )\n    );\n  }\n};\n\nvar AdsPECampaignGroupEditor132 = function(props) {\n  if (props.x === 295) {\n    return React.createElement(\n      \"div\",\n      null,\n      React.createElement(AdsPECampaignGroupHeaderSectionContainer89, {\n        x: 214,\n      }),\n      React.createElement(AdsEditorMultiColumnLayout131, { x: 294 })\n    );\n  }\n};\n\nvar AdsPECampaignGroupEditorContainer133 = function(props) {\n  if (props.x === 296) {\n    return React.createElement(AdsPECampaignGroupEditor132, { x: 295 });\n  }\n};\n\nvar AdsPESideTrayTabContent134 = function(props) {\n  if (props.x === 297) {\n    return React.createElement(\n      \"div\",\n      { className: \"_1o_8 _44ra _5cyn\" },\n      React.createElement(AdsPECampaignGroupEditorContainer133, { x: 296 })\n    );\n  }\n};\n\nvar AdsPEEditorTrayTabContentContainer135 = function(props) {\n  if (props.x === 298) {\n    return React.createElement(AdsPESideTrayTabContent134, { x: 297 });\n  }\n};\n\nvar AdsPEMultiTabDrawer136 = function(props) {\n  if (props.x === 299) {\n    return React.createElement(\n      \"div\",\n      { className: \"_2kev _2kex\" },\n      React.createElement(\n        \"div\",\n        { className: \"_5yno\" },\n        React.createElement(AdsPEEditorTrayTabButton83, {\n          x: 197,\n          key: \"editor_tray_button\",\n        }),\n        React.createElement(AdsPEInsightsTrayTabButton84, {\n          x: 202,\n          key: \"insights_tray_button\",\n        }),\n        React.createElement(AdsPENekoDebuggerTrayTabButton85, {\n          x: 204,\n          key: \"neko_debugger_tray_button\",\n        })\n      ),\n      React.createElement(\n        \"div\",\n        { className: \"_5ynn\" },\n        React.createElement(AdsPEEditorTrayTabContentContainer135, {\n          x: 298,\n          key: \"EDITOR_DRAWER\",\n        }),\n        null\n      )\n    );\n  }\n};\n\nvar FluxContainer_AdsPEMultiTabDrawerContainer_137 = function(props) {\n  if (props.x === 300) {\n    return React.createElement(AdsPEMultiTabDrawer136, { x: 299 });\n  }\n};\n\nvar AdsPESimpleOrganizer138 = function(props) {\n  if (props.x === 309) {\n    return React.createElement(\n      \"div\",\n      { className: \"_tm2\" },\n      React.createElement(XUIButton4, { x: 304 }),\n      React.createElement(XUIButton4, { x: 306 }),\n      React.createElement(XUIButton4, { x: 308 })\n    );\n  }\n};\n\nvar AdsPEOrganizerContainer139 = function(props) {\n  if (props.x === 310) {\n    return React.createElement(\"div\", null, React.createElement(AdsPESimpleOrganizer138, { x: 309 }));\n  }\n};\n\nvar FixedDataTableColumnResizeHandle140 = function(props) {\n  if (props.x === 313) {\n    return React.createElement(\n      \"div\",\n      {\n        className: \"_3487 _3488 _3489\",\n        style: { width: 0, height: 25, left: 0 },\n      },\n      React.createElement(\"div\", { className: \"_348a\", style: { height: 25 } })\n    );\n  }\n};\n\nvar AdsPETableHeader141 = function(props) {\n  if (props.x === 315) {\n    return React.createElement(\n      \"div\",\n      { className: \"_1cig _1ksv _1vd7 _4h2r\", id: undefined },\n      React.createElement(ReactImage0, { x: 314 }),\n      React.createElement(\"span\", { className: \"_1cid\" }, \"Campaigns\")\n    );\n  }\n  if (props.x === 320) {\n    return React.createElement(\n      \"div\",\n      { className: \"_1cig _1vd7 _4h2r\", id: undefined },\n      null,\n      React.createElement(\"span\", { className: \"_1cid\" }, \"Performance\")\n    );\n  }\n  if (props.x === 323) {\n    return React.createElement(\n      \"div\",\n      { className: \"_1cig _1vd7 _4h2r\", id: undefined },\n      null,\n      React.createElement(\"span\", { className: \"_1cid\" }, \"Overview\")\n    );\n  }\n  if (props.x === 326) {\n    return React.createElement(\n      \"div\",\n      { className: \"_1cig _1vd7 _4h2r\", id: undefined },\n      null,\n      React.createElement(\"span\", { className: \"_1cid\" }, \"Toplines\")\n    );\n  }\n  if (props.x === 329) {\n    return React.createElement(\"div\", {\n      className: \"_1cig _1vd7 _4h2r\",\n      id: undefined,\n    });\n  }\n  if (props.x === 340) {\n    return React.createElement(\n      \"div\",\n      { className: \"_1cig _25fg\", id: undefined },\n      null,\n      React.createElement(\"span\", { className: \"_1cid\" }, \"Campaign Name\")\n    );\n  }\n  if (props.x === 346) {\n    return React.createElement(\n      \"div\",\n      {\n        className: \"_1cig _25fg\",\n        id: undefined,\n        \"data-tooltip-content\": \"Changed\",\n        \"data-hover\": \"tooltip\",\n      },\n      React.createElement(ReactImage0, { x: 345 }),\n      null\n    );\n  }\n  if (props.x === 352) {\n    return React.createElement(\n      \"div\",\n      {\n        className: \"_1cig _25fg\",\n        id: \"ads_pe_table_error_header\",\n        \"data-tooltip-content\": \"Errors\",\n        \"data-hover\": \"tooltip\",\n      },\n      React.createElement(ReactImage0, { x: 351 }),\n      null\n    );\n  }\n  if (props.x === 357) {\n    return React.createElement(\n      \"div\",\n      { className: \"_1cig _25fg\", id: undefined },\n      null,\n      React.createElement(\"span\", { className: \"_1cid\" }, \"Status\")\n    );\n  }\n  if (props.x === 362) {\n    return React.createElement(\n      \"div\",\n      { className: \"_1cig _25fg\", id: undefined },\n      null,\n      React.createElement(\"span\", { className: \"_1cid\" }, \"Delivery\")\n    );\n  }\n  if (props.x === 369) {\n    return React.createElement(\n      \"div\",\n      { className: \"_1cig _25fg\", id: undefined },\n      null,\n      React.createElement(\"span\", { className: \"_1cid\" }, \"Results\")\n    );\n  }\n  if (props.x === 374) {\n    return React.createElement(\n      \"div\",\n      { className: \"_1cig _25fg\", id: undefined },\n      null,\n      React.createElement(\"span\", { className: \"_1cid\" }, \"Cost\")\n    );\n  }\n  if (props.x === 379) {\n    return React.createElement(\n      \"div\",\n      { className: \"_1cig _25fg\", id: undefined },\n      null,\n      React.createElement(\"span\", { className: \"_1cid\" }, \"Reach\")\n    );\n  }\n  if (props.x === 384) {\n    return React.createElement(\n      \"div\",\n      { className: \"_1cig _25fg\", id: undefined },\n      null,\n      React.createElement(\"span\", { className: \"_1cid\" }, \"Impressions\")\n    );\n  }\n  if (props.x === 389) {\n    return React.createElement(\n      \"div\",\n      { className: \"_1cig _25fg\", id: undefined },\n      null,\n      React.createElement(\"span\", { className: \"_1cid\" }, \"Clicks\")\n    );\n  }\n  if (props.x === 394) {\n    return React.createElement(\n      \"div\",\n      { className: \"_1cig _25fg\", id: undefined },\n      null,\n      React.createElement(\"span\", { className: \"_1cid\" }, \"Avg. CPM\")\n    );\n  }\n  if (props.x === 399) {\n    return React.createElement(\n      \"div\",\n      { className: \"_1cig _25fg\", id: undefined },\n      null,\n      React.createElement(\"span\", { className: \"_1cid\" }, \"Avg. CPC\")\n    );\n  }\n  if (props.x === 404) {\n    return React.createElement(\n      \"div\",\n      { className: \"_1cig _25fg\", id: undefined },\n      null,\n      React.createElement(\"span\", { className: \"_1cid\" }, \"CTR %\")\n    );\n  }\n  if (props.x === 409) {\n    return React.createElement(\n      \"div\",\n      { className: \"_1cig _25fg\", id: undefined },\n      null,\n      React.createElement(\"span\", { className: \"_1cid\" }, \"Spent\")\n    );\n  }\n  if (props.x === 414) {\n    return React.createElement(\n      \"div\",\n      { className: \"_1cig _25fg\", id: undefined },\n      null,\n      React.createElement(\"span\", { className: \"_1cid\" }, \"Objective\")\n    );\n  }\n  if (props.x === 419) {\n    return React.createElement(\n      \"div\",\n      { className: \"_1cig _25fg\", id: undefined },\n      null,\n      React.createElement(\"span\", { className: \"_1cid\" }, \"Buying Type\")\n    );\n  }\n  if (props.x === 424) {\n    return React.createElement(\n      \"div\",\n      { className: \"_1cig _25fg\", id: undefined },\n      null,\n      React.createElement(\"span\", { className: \"_1cid\" }, \"Campaign ID\")\n    );\n  }\n  if (props.x === 429) {\n    return React.createElement(\n      \"div\",\n      { className: \"_1cig _25fg\", id: undefined },\n      null,\n      React.createElement(\"span\", { className: \"_1cid\" }, \"Start\")\n    );\n  }\n  if (props.x === 434) {\n    return React.createElement(\n      \"div\",\n      { className: \"_1cig _25fg\", id: undefined },\n      null,\n      React.createElement(\"span\", { className: \"_1cid\" }, \"End\")\n    );\n  }\n  if (props.x === 439) {\n    return React.createElement(\n      \"div\",\n      { className: \"_1cig _25fg\", id: undefined },\n      null,\n      React.createElement(\"span\", { className: \"_1cid\" }, \"Date created\")\n    );\n  }\n  if (props.x === 444) {\n    return React.createElement(\n      \"div\",\n      { className: \"_1cig _25fg\", id: undefined },\n      null,\n      React.createElement(\"span\", { className: \"_1cid\" }, \"Date last edited\")\n    );\n  }\n  if (props.x === 449) {\n    return React.createElement(\n      \"div\",\n      { className: \"_1cig _25fg _4h2r\", id: undefined },\n      null,\n      React.createElement(\"span\", { className: \"_1cid\" }, \"Tags\")\n    );\n  }\n  if (props.x === 452) {\n    return React.createElement(\"div\", {\n      className: \"_1cig _25fg _4h2r\",\n      id: undefined,\n    });\n  }\n};\n\nvar TransitionCell142 = function(props) {\n  if (props.x === 316) {\n    return React.createElement(\n      \"div\",\n      {\n        label: \"Campaigns\",\n        height: 40,\n        width: 721,\n        className: \"_4lgc _4h2u\",\n        style: { height: 40, width: 721 },\n      },\n      React.createElement(\n        \"div\",\n        { className: \"_4lgd _4h2w\" },\n        React.createElement(\"div\", { className: \"_4lge _4h2x\" }, React.createElement(AdsPETableHeader141, { x: 315 }))\n      )\n    );\n  }\n  if (props.x === 321) {\n    return React.createElement(\n      \"div\",\n      {\n        label: \"Performance\",\n        height: 40,\n        width: 798,\n        className: \"_4lgc _4h2u\",\n        style: { height: 40, width: 798 },\n      },\n      React.createElement(\n        \"div\",\n        { className: \"_4lgd _4h2w\" },\n        React.createElement(\"div\", { className: \"_4lge _4h2x\" }, React.createElement(AdsPETableHeader141, { x: 320 }))\n      )\n    );\n  }\n  if (props.x === 324) {\n    return React.createElement(\n      \"div\",\n      {\n        label: \"Overview\",\n        height: 40,\n        width: 1022,\n        className: \"_4lgc _4h2u\",\n        style: { height: 40, width: 1022 },\n      },\n      React.createElement(\n        \"div\",\n        { className: \"_4lgd _4h2w\" },\n        React.createElement(\"div\", { className: \"_4lge _4h2x\" }, React.createElement(AdsPETableHeader141, { x: 323 }))\n      )\n    );\n  }\n  if (props.x === 327) {\n    return React.createElement(\n      \"div\",\n      {\n        label: \"Toplines\",\n        height: 40,\n        width: 0,\n        className: \"_4lgc _4h2u\",\n        style: { height: 40, width: 0 },\n      },\n      React.createElement(\n        \"div\",\n        { className: \"_4lgd _4h2w\" },\n        React.createElement(\"div\", { className: \"_4lge _4h2x\" }, React.createElement(AdsPETableHeader141, { x: 326 }))\n      )\n    );\n  }\n  if (props.x === 330) {\n    return React.createElement(\n      \"div\",\n      {\n        label: \"\",\n        height: 40,\n        width: 25,\n        className: \"_4lgc _4h2u\",\n        style: { height: 40, width: 25 },\n      },\n      React.createElement(\n        \"div\",\n        { className: \"_4lgd _4h2w\" },\n        React.createElement(\"div\", { className: \"_4lge _4h2x\" }, React.createElement(AdsPETableHeader141, { x: 329 }))\n      )\n    );\n  }\n  if (props.x === 338) {\n    return React.createElement(\n      \"div\",\n      {\n        label: undefined,\n        width: 42,\n        className: \"_4lgc _4h2u\",\n        height: 25,\n        style: { height: 25, width: 42 },\n      },\n      React.createElement(\n        \"div\",\n        { className: \"_4lgd _4h2w\" },\n        React.createElement(\"div\", { className: \"_4lge _4h2x\" }, React.createElement(XUICheckboxInput60, { x: 337 }))\n      )\n    );\n  }\n  if (props.x === 343) {\n    return React.createElement(\n      \"div\",\n      {\n        label: \"Campaign Name\",\n        width: 400,\n        className: \"_4lgc _4h2u\",\n        height: 25,\n        style: { height: 25, width: 400 },\n      },\n      React.createElement(\n        \"div\",\n        { className: \"_4lgd _4h2w\" },\n        React.createElement(\n          \"div\",\n          { className: \"_4lge _4h2x\" },\n          React.createElement(FixedDataTableSortableHeader149, { x: 342 })\n        )\n      )\n    );\n  }\n  if (props.x === 349) {\n    return React.createElement(\n      \"div\",\n      {\n        label: undefined,\n        width: 33,\n        className: \"_4lgc _4h2u\",\n        height: 25,\n        style: { height: 25, width: 33 },\n      },\n      React.createElement(\n        \"div\",\n        { className: \"_4lgd _4h2w\" },\n        React.createElement(\n          \"div\",\n          { className: \"_4lge _4h2x\" },\n          React.createElement(FixedDataTableSortableHeader149, { x: 348 })\n        )\n      )\n    );\n  }\n  if (props.x === 355) {\n    return React.createElement(\n      \"div\",\n      {\n        label: undefined,\n        width: 36,\n        className: \"_4lgc _4h2u\",\n        height: 25,\n        style: { height: 25, width: 36 },\n      },\n      React.createElement(\n        \"div\",\n        { className: \"_4lgd _4h2w\" },\n        React.createElement(\n          \"div\",\n          { className: \"_4lge _4h2x\" },\n          React.createElement(FixedDataTableSortableHeader149, { x: 354 })\n        )\n      )\n    );\n  }\n  if (props.x === 360) {\n    return React.createElement(\n      \"div\",\n      {\n        label: \"Status\",\n        width: 60,\n        className: \"_4lgc _4h2u\",\n        height: 25,\n        style: { height: 25, width: 60 },\n      },\n      React.createElement(\n        \"div\",\n        { className: \"_4lgd _4h2w\" },\n        React.createElement(\n          \"div\",\n          { className: \"_4lge _4h2x\" },\n          React.createElement(FixedDataTableSortableHeader149, { x: 359 })\n        )\n      )\n    );\n  }\n  if (props.x === 365) {\n    return React.createElement(\n      \"div\",\n      {\n        label: \"Delivery\",\n        width: 150,\n        className: \"_4lgc _4h2u\",\n        height: 25,\n        style: { height: 25, width: 150 },\n      },\n      React.createElement(\n        \"div\",\n        { className: \"_4lgd _4h2w\" },\n        React.createElement(\n          \"div\",\n          { className: \"_4lge _4h2x\" },\n          React.createElement(FixedDataTableSortableHeader149, { x: 364 })\n        )\n      )\n    );\n  }\n  if (props.x === 372) {\n    return React.createElement(\n      \"div\",\n      {\n        label: \"Results\",\n        width: 140,\n        className: \"_4lgc _4h2u\",\n        height: 25,\n        style: { height: 25, width: 140 },\n      },\n      React.createElement(\n        \"div\",\n        { className: \"_4lgd _4h2w\" },\n        React.createElement(\n          \"div\",\n          { className: \"_4lge _4h2x\" },\n          React.createElement(FixedDataTableSortableHeader149, { x: 371 })\n        )\n      )\n    );\n  }\n  if (props.x === 377) {\n    return React.createElement(\n      \"div\",\n      {\n        label: \"Cost\",\n        width: 140,\n        className: \"_4lgc _4h2u\",\n        height: 25,\n        style: { height: 25, width: 140 },\n      },\n      React.createElement(\n        \"div\",\n        { className: \"_4lgd _4h2w\" },\n        React.createElement(\n          \"div\",\n          { className: \"_4lge _4h2x\" },\n          React.createElement(FixedDataTableSortableHeader149, { x: 376 })\n        )\n      )\n    );\n  }\n  if (props.x === 382) {\n    return React.createElement(\n      \"div\",\n      {\n        label: \"Reach\",\n        width: 80,\n        className: \"_4lgc _4h2u\",\n        height: 25,\n        style: { height: 25, width: 80 },\n      },\n      React.createElement(\n        \"div\",\n        { className: \"_4lgd _4h2w\" },\n        React.createElement(\n          \"div\",\n          { className: \"_4lge _4h2x\" },\n          React.createElement(FixedDataTableSortableHeader149, { x: 381 })\n        )\n      )\n    );\n  }\n  if (props.x === 387) {\n    return React.createElement(\n      \"div\",\n      {\n        label: \"Impressions\",\n        width: 80,\n        className: \"_4lgc _4h2u\",\n        height: 25,\n        style: { height: 25, width: 80 },\n      },\n      React.createElement(\n        \"div\",\n        { className: \"_4lgd _4h2w\" },\n        React.createElement(\n          \"div\",\n          { className: \"_4lge _4h2x\" },\n          React.createElement(FixedDataTableSortableHeader149, { x: 386 })\n        )\n      )\n    );\n  }\n  if (props.x === 392) {\n    return React.createElement(\n      \"div\",\n      {\n        label: \"Clicks\",\n        width: 60,\n        className: \"_4lgc _4h2u\",\n        height: 25,\n        style: { height: 25, width: 60 },\n      },\n      React.createElement(\n        \"div\",\n        { className: \"_4lgd _4h2w\" },\n        React.createElement(\n          \"div\",\n          { className: \"_4lge _4h2x\" },\n          React.createElement(FixedDataTableSortableHeader149, { x: 391 })\n        )\n      )\n    );\n  }\n  if (props.x === 397) {\n    return React.createElement(\n      \"div\",\n      {\n        label: \"Avg. CPM\",\n        width: 80,\n        className: \"_4lgc _4h2u\",\n        height: 25,\n        style: { height: 25, width: 80 },\n      },\n      React.createElement(\n        \"div\",\n        { className: \"_4lgd _4h2w\" },\n        React.createElement(\n          \"div\",\n          { className: \"_4lge _4h2x\" },\n          React.createElement(FixedDataTableSortableHeader149, { x: 396 })\n        )\n      )\n    );\n  }\n  if (props.x === 402) {\n    return React.createElement(\n      \"div\",\n      {\n        label: \"Avg. CPC\",\n        width: 78,\n        className: \"_4lgc _4h2u\",\n        height: 25,\n        style: { height: 25, width: 78 },\n      },\n      React.createElement(\n        \"div\",\n        { className: \"_4lgd _4h2w\" },\n        React.createElement(\n          \"div\",\n          { className: \"_4lge _4h2x\" },\n          React.createElement(FixedDataTableSortableHeader149, { x: 401 })\n        )\n      )\n    );\n  }\n  if (props.x === 407) {\n    return React.createElement(\n      \"div\",\n      {\n        label: \"CTR %\",\n        width: 70,\n        className: \"_4lgc _4h2u\",\n        height: 25,\n        style: { height: 25, width: 70 },\n      },\n      React.createElement(\n        \"div\",\n        { className: \"_4lgd _4h2w\" },\n        React.createElement(\n          \"div\",\n          { className: \"_4lge _4h2x\" },\n          React.createElement(FixedDataTableSortableHeader149, { x: 406 })\n        )\n      )\n    );\n  }\n  if (props.x === 412) {\n    return React.createElement(\n      \"div\",\n      {\n        label: \"Spent\",\n        width: 70,\n        className: \"_4lgc _4h2u\",\n        height: 25,\n        style: { height: 25, width: 70 },\n      },\n      React.createElement(\n        \"div\",\n        { className: \"_4lgd _4h2w\" },\n        React.createElement(\n          \"div\",\n          { className: \"_4lge _4h2x\" },\n          React.createElement(FixedDataTableSortableHeader149, { x: 411 })\n        )\n      )\n    );\n  }\n  if (props.x === 417) {\n    return React.createElement(\n      \"div\",\n      {\n        label: \"Objective\",\n        width: 200,\n        className: \"_4lgc _4h2u\",\n        height: 25,\n        style: { height: 25, width: 200 },\n      },\n      React.createElement(\n        \"div\",\n        { className: \"_4lgd _4h2w\" },\n        React.createElement(\n          \"div\",\n          { className: \"_4lge _4h2x\" },\n          React.createElement(FixedDataTableSortableHeader149, { x: 416 })\n        )\n      )\n    );\n  }\n  if (props.x === 422) {\n    return React.createElement(\n      \"div\",\n      {\n        label: \"Buying Type\",\n        width: 100,\n        className: \"_4lgc _4h2u\",\n        height: 25,\n        style: { height: 25, width: 100 },\n      },\n      React.createElement(\n        \"div\",\n        { className: \"_4lgd _4h2w\" },\n        React.createElement(\n          \"div\",\n          { className: \"_4lge _4h2x\" },\n          React.createElement(FixedDataTableSortableHeader149, { x: 421 })\n        )\n      )\n    );\n  }\n  if (props.x === 427) {\n    return React.createElement(\n      \"div\",\n      {\n        label: \"Campaign ID\",\n        width: 120,\n        className: \"_4lgc _4h2u\",\n        height: 25,\n        style: { height: 25, width: 120 },\n      },\n      React.createElement(\n        \"div\",\n        { className: \"_4lgd _4h2w\" },\n        React.createElement(\n          \"div\",\n          { className: \"_4lge _4h2x\" },\n          React.createElement(FixedDataTableSortableHeader149, { x: 426 })\n        )\n      )\n    );\n  }\n  if (props.x === 432) {\n    return React.createElement(\n      \"div\",\n      {\n        label: \"Start\",\n        width: 113,\n        className: \"_4lgc _4h2u\",\n        height: 25,\n        style: { height: 25, width: 113 },\n      },\n      React.createElement(\n        \"div\",\n        { className: \"_4lgd _4h2w\" },\n        React.createElement(\n          \"div\",\n          { className: \"_4lge _4h2x\" },\n          React.createElement(FixedDataTableSortableHeader149, { x: 431 })\n        )\n      )\n    );\n  }\n  if (props.x === 437) {\n    return React.createElement(\n      \"div\",\n      {\n        label: \"End\",\n        width: 113,\n        className: \"_4lgc _4h2u\",\n        height: 25,\n        style: { height: 25, width: 113 },\n      },\n      React.createElement(\n        \"div\",\n        { className: \"_4lgd _4h2w\" },\n        React.createElement(\n          \"div\",\n          { className: \"_4lge _4h2x\" },\n          React.createElement(FixedDataTableSortableHeader149, { x: 436 })\n        )\n      )\n    );\n  }\n  if (props.x === 442) {\n    return React.createElement(\n      \"div\",\n      {\n        label: \"Date created\",\n        width: 113,\n        className: \"_4lgc _4h2u\",\n        height: 25,\n        style: { height: 25, width: 113 },\n      },\n      React.createElement(\n        \"div\",\n        { className: \"_4lgd _4h2w\" },\n        React.createElement(\n          \"div\",\n          { className: \"_4lge _4h2x\" },\n          React.createElement(FixedDataTableSortableHeader149, { x: 441 })\n        )\n      )\n    );\n  }\n  if (props.x === 447) {\n    return React.createElement(\n      \"div\",\n      {\n        label: \"Date last edited\",\n        width: 113,\n        className: \"_4lgc _4h2u\",\n        height: 25,\n        style: { height: 25, width: 113 },\n      },\n      React.createElement(\n        \"div\",\n        { className: \"_4lgd _4h2w\" },\n        React.createElement(\n          \"div\",\n          { className: \"_4lge _4h2x\" },\n          React.createElement(FixedDataTableSortableHeader149, { x: 446 })\n        )\n      )\n    );\n  }\n  if (props.x === 450) {\n    return React.createElement(\n      \"div\",\n      {\n        label: \"Tags\",\n        width: 150,\n        className: \"_4lgc _4h2u\",\n        height: 25,\n        style: { height: 25, width: 150 },\n      },\n      React.createElement(\n        \"div\",\n        { className: \"_4lgd _4h2w\" },\n        React.createElement(\"div\", { className: \"_4lge _4h2x\" }, React.createElement(AdsPETableHeader141, { x: 449 }))\n      )\n    );\n  }\n  if (props.x === 453) {\n    return React.createElement(\n      \"div\",\n      {\n        label: \"\",\n        width: 25,\n        className: \"_4lgc _4h2u\",\n        height: 25,\n        style: { height: 25, width: 25 },\n      },\n      React.createElement(\n        \"div\",\n        { className: \"_4lgd _4h2w\" },\n        React.createElement(\"div\", { className: \"_4lge _4h2x\" }, React.createElement(AdsPETableHeader141, { x: 452 }))\n      )\n    );\n  }\n};\n\nvar FixedDataTableCell143 = function(props) {\n  if (props.x === 317) {\n    return React.createElement(\n      \"div\",\n      { className: \"_4lg0 _4h2m\", style: { height: 40, width: 721, left: 0 } },\n      undefined,\n      React.createElement(TransitionCell142, { x: 316 })\n    );\n  }\n  if (props.x === 322) {\n    return React.createElement(\n      \"div\",\n      { className: \"_4lg0 _4h2m\", style: { height: 40, width: 798, left: 0 } },\n      undefined,\n      React.createElement(TransitionCell142, { x: 321 })\n    );\n  }\n  if (props.x === 325) {\n    return React.createElement(\n      \"div\",\n      { className: \"_4lg0 _4h2m\", style: { height: 40, width: 1022, left: 798 } },\n      undefined,\n      React.createElement(TransitionCell142, { x: 324 })\n    );\n  }\n  if (props.x === 328) {\n    return React.createElement(\n      \"div\",\n      { className: \"_4lg0 _4h2m\", style: { height: 40, width: 0, left: 1820 } },\n      undefined,\n      React.createElement(TransitionCell142, { x: 327 })\n    );\n  }\n  if (props.x === 331) {\n    return React.createElement(\n      \"div\",\n      { className: \"_4lg0 _4h2m\", style: { height: 40, width: 25, left: 1820 } },\n      undefined,\n      React.createElement(TransitionCell142, { x: 330 })\n    );\n  }\n  if (props.x === 339) {\n    return React.createElement(\n      \"div\",\n      {\n        className: \"_4lg0 _4lg6 _4h2m\",\n        style: { height: 25, width: 42, left: 0 },\n      },\n      undefined,\n      React.createElement(TransitionCell142, { x: 338 })\n    );\n  }\n  if (props.x === 344) {\n    return React.createElement(\n      \"div\",\n      { className: \"_4lg0 _4h2m\", style: { height: 25, width: 400, left: 42 } },\n      React.createElement(\n        \"div\",\n        { className: \"_4lg9\", style: { height: 25 }, onMouseDown: function() {} },\n        React.createElement(\"div\", {\n          className: \"_4lga _4lgb\",\n          style: { height: 25 },\n        })\n      ),\n      React.createElement(TransitionCell142, { x: 343 })\n    );\n  }\n  if (props.x === 350) {\n    return React.createElement(\n      \"div\",\n      { className: \"_4lg0 _4h2m\", style: { height: 25, width: 33, left: 442 } },\n      undefined,\n      React.createElement(TransitionCell142, { x: 349 })\n    );\n  }\n  if (props.x === 356) {\n    return React.createElement(\n      \"div\",\n      { className: \"_4lg0 _4h2m\", style: { height: 25, width: 36, left: 475 } },\n      undefined,\n      React.createElement(TransitionCell142, { x: 355 })\n    );\n  }\n  if (props.x === 361) {\n    return React.createElement(\n      \"div\",\n      { className: \"_4lg0 _4h2m\", style: { height: 25, width: 60, left: 511 } },\n      undefined,\n      React.createElement(TransitionCell142, { x: 360 })\n    );\n  }\n  if (props.x === 366) {\n    return React.createElement(\n      \"div\",\n      { className: \"_4lg0 _4h2m\", style: { height: 25, width: 150, left: 571 } },\n      React.createElement(\n        \"div\",\n        { className: \"_4lg9\", style: { height: 25 }, onMouseDown: function() {} },\n        React.createElement(\"div\", {\n          className: \"_4lga _4lgb\",\n          style: { height: 25 },\n        })\n      ),\n      React.createElement(TransitionCell142, { x: 365 })\n    );\n  }\n  if (props.x === 373) {\n    return React.createElement(\n      \"div\",\n      {\n        className: \"_4lg0 _4lg5 _4h2p _4h2m\",\n        style: { height: 25, width: 140, left: 0 },\n      },\n      React.createElement(\n        \"div\",\n        { className: \"_4lg9\", style: { height: 25 }, onMouseDown: function() {} },\n        React.createElement(\"div\", {\n          className: \"_4lga _4lgb\",\n          style: { height: 25 },\n        })\n      ),\n      React.createElement(TransitionCell142, { x: 372 })\n    );\n  }\n  if (props.x === 378) {\n    return React.createElement(\n      \"div\",\n      {\n        className: \"_4lg0 _4lg5 _4h2p _4h2m\",\n        style: { height: 25, width: 140, left: 140 },\n      },\n      React.createElement(\n        \"div\",\n        { className: \"_4lg9\", style: { height: 25 }, onMouseDown: function() {} },\n        React.createElement(\"div\", {\n          className: \"_4lga _4lgb\",\n          style: { height: 25 },\n        })\n      ),\n      React.createElement(TransitionCell142, { x: 377 })\n    );\n  }\n  if (props.x === 383) {\n    return React.createElement(\n      \"div\",\n      {\n        className: \"_4lg0 _4lg5 _4h2p _4h2m\",\n        style: { height: 25, width: 80, left: 280 },\n      },\n      React.createElement(\n        \"div\",\n        { className: \"_4lg9\", style: { height: 25 }, onMouseDown: function() {} },\n        React.createElement(\"div\", {\n          className: \"_4lga _4lgb\",\n          style: { height: 25 },\n        })\n      ),\n      React.createElement(TransitionCell142, { x: 382 })\n    );\n  }\n  if (props.x === 388) {\n    return React.createElement(\n      \"div\",\n      {\n        className: \"_4lg0 _4lg5 _4h2p _4h2m\",\n        style: { height: 25, width: 80, left: 360 },\n      },\n      React.createElement(\n        \"div\",\n        { className: \"_4lg9\", style: { height: 25 }, onMouseDown: function() {} },\n        React.createElement(\"div\", {\n          className: \"_4lga _4lgb\",\n          style: { height: 25 },\n        })\n      ),\n      React.createElement(TransitionCell142, { x: 387 })\n    );\n  }\n  if (props.x === 393) {\n    return React.createElement(\n      \"div\",\n      {\n        className: \"_4lg0 _4lg5 _4h2p _4h2m\",\n        style: { height: 25, width: 60, left: 440 },\n      },\n      React.createElement(\n        \"div\",\n        { className: \"_4lg9\", style: { height: 25 }, onMouseDown: function() {} },\n        React.createElement(\"div\", {\n          className: \"_4lga _4lgb\",\n          style: { height: 25 },\n        })\n      ),\n      React.createElement(TransitionCell142, { x: 392 })\n    );\n  }\n  if (props.x === 398) {\n    return React.createElement(\n      \"div\",\n      {\n        className: \"_4lg0 _4lg5 _4h2p _4h2m\",\n        style: { height: 25, width: 80, left: 500 },\n      },\n      React.createElement(\n        \"div\",\n        { className: \"_4lg9\", style: { height: 25 }, onMouseDown: function() {} },\n        React.createElement(\"div\", {\n          className: \"_4lga _4lgb\",\n          style: { height: 25 },\n        })\n      ),\n      React.createElement(TransitionCell142, { x: 397 })\n    );\n  }\n  if (props.x === 403) {\n    return React.createElement(\n      \"div\",\n      {\n        className: \"_4lg0 _4lg5 _4h2p _4h2m\",\n        style: { height: 25, width: 78, left: 580 },\n      },\n      React.createElement(\n        \"div\",\n        { className: \"_4lg9\", style: { height: 25 }, onMouseDown: function() {} },\n        React.createElement(\"div\", {\n          className: \"_4lga _4lgb\",\n          style: { height: 25 },\n        })\n      ),\n      React.createElement(TransitionCell142, { x: 402 })\n    );\n  }\n  if (props.x === 408) {\n    return React.createElement(\n      \"div\",\n      {\n        className: \"_4lg0 _4lg5 _4h2p _4h2m\",\n        style: { height: 25, width: 70, left: 658 },\n      },\n      React.createElement(\n        \"div\",\n        { className: \"_4lg9\", style: { height: 25 }, onMouseDown: function() {} },\n        React.createElement(\"div\", {\n          className: \"_4lga _4lgb\",\n          style: { height: 25 },\n        })\n      ),\n      React.createElement(TransitionCell142, { x: 407 })\n    );\n  }\n  if (props.x === 413) {\n    return React.createElement(\n      \"div\",\n      {\n        className: \"_4lg0 _4lg5 _4h2p _4h2m\",\n        style: { height: 25, width: 70, left: 728 },\n      },\n      React.createElement(\n        \"div\",\n        { className: \"_4lg9\", style: { height: 25 }, onMouseDown: function() {} },\n        React.createElement(\"div\", {\n          className: \"_4lga _4lgb\",\n          style: { height: 25 },\n        })\n      ),\n      React.createElement(TransitionCell142, { x: 412 })\n    );\n  }\n  if (props.x === 418) {\n    return React.createElement(\n      \"div\",\n      { className: \"_4lg0 _4h2m\", style: { height: 25, width: 200, left: 798 } },\n      React.createElement(\n        \"div\",\n        { className: \"_4lg9\", style: { height: 25 }, onMouseDown: function() {} },\n        React.createElement(\"div\", {\n          className: \"_4lga _4lgb\",\n          style: { height: 25 },\n        })\n      ),\n      React.createElement(TransitionCell142, { x: 417 })\n    );\n  }\n  if (props.x === 423) {\n    return React.createElement(\n      \"div\",\n      { className: \"_4lg0 _4h2m\", style: { height: 25, width: 100, left: 998 } },\n      React.createElement(\n        \"div\",\n        { className: \"_4lg9\", style: { height: 25 }, onMouseDown: function() {} },\n        React.createElement(\"div\", {\n          className: \"_4lga _4lgb\",\n          style: { height: 25 },\n        })\n      ),\n      React.createElement(TransitionCell142, { x: 422 })\n    );\n  }\n  if (props.x === 428) {\n    return React.createElement(\n      \"div\",\n      { className: \"_4lg0 _4h2m\", style: { height: 25, width: 120, left: 1098 } },\n      React.createElement(\n        \"div\",\n        { className: \"_4lg9\", style: { height: 25 }, onMouseDown: function() {} },\n        React.createElement(\"div\", {\n          className: \"_4lga _4lgb\",\n          style: { height: 25 },\n        })\n      ),\n      React.createElement(TransitionCell142, { x: 427 })\n    );\n  }\n  if (props.x === 433) {\n    return React.createElement(\n      \"div\",\n      { className: \"_4lg0 _4h2m\", style: { height: 25, width: 113, left: 1218 } },\n      React.createElement(\n        \"div\",\n        { className: \"_4lg9\", style: { height: 25 }, onMouseDown: function() {} },\n        React.createElement(\"div\", {\n          className: \"_4lga _4lgb\",\n          style: { height: 25 },\n        })\n      ),\n      React.createElement(TransitionCell142, { x: 432 })\n    );\n  }\n  if (props.x === 438) {\n    return React.createElement(\n      \"div\",\n      { className: \"_4lg0 _4h2m\", style: { height: 25, width: 113, left: 1331 } },\n      React.createElement(\n        \"div\",\n        { className: \"_4lg9\", style: { height: 25 }, onMouseDown: function() {} },\n        React.createElement(\"div\", {\n          className: \"_4lga _4lgb\",\n          style: { height: 25 },\n        })\n      ),\n      React.createElement(TransitionCell142, { x: 437 })\n    );\n  }\n  if (props.x === 443) {\n    return React.createElement(\n      \"div\",\n      { className: \"_4lg0 _4h2m\", style: { height: 25, width: 113, left: 1444 } },\n      React.createElement(\n        \"div\",\n        { className: \"_4lg9\", style: { height: 25 }, onMouseDown: function() {} },\n        React.createElement(\"div\", {\n          className: \"_4lga _4lgb\",\n          style: { height: 25 },\n        })\n      ),\n      React.createElement(TransitionCell142, { x: 442 })\n    );\n  }\n  if (props.x === 448) {\n    return React.createElement(\n      \"div\",\n      { className: \"_4lg0 _4h2m\", style: { height: 25, width: 113, left: 1557 } },\n      React.createElement(\n        \"div\",\n        { className: \"_4lg9\", style: { height: 25 }, onMouseDown: function() {} },\n        React.createElement(\"div\", {\n          className: \"_4lga _4lgb\",\n          style: { height: 25 },\n        })\n      ),\n      React.createElement(TransitionCell142, { x: 447 })\n    );\n  }\n  if (props.x === 451) {\n    return React.createElement(\n      \"div\",\n      { className: \"_4lg0 _4h2m\", style: { height: 25, width: 150, left: 1670 } },\n      React.createElement(\n        \"div\",\n        { className: \"_4lg9\", style: { height: 25 }, onMouseDown: function() {} },\n        React.createElement(\"div\", {\n          className: \"_4lga _4lgb\",\n          style: { height: 25 },\n        })\n      ),\n      React.createElement(TransitionCell142, { x: 450 })\n    );\n  }\n  if (props.x === 454) {\n    return React.createElement(\n      \"div\",\n      { className: \"_4lg0 _4h2m\", style: { height: 25, width: 25, left: 1820 } },\n      undefined,\n      React.createElement(TransitionCell142, { x: 453 })\n    );\n  }\n};\n\nvar FixedDataTableCellGroupImpl144 = function(props) {\n  if (props.x === 318) {\n    return React.createElement(\n      \"div\",\n      {\n        className: \"_3pzj\",\n        style: {\n          height: 40,\n          position: \"absolute\",\n          width: 721,\n          zIndex: 2,\n          transform: \"translate3d(0px,0px,0)\",\n          backfaceVisibility: \"hidden\",\n        },\n      },\n      React.createElement(FixedDataTableCell143, { x: 317, key: \"cell_0\" })\n    );\n  }\n  if (props.x === 332) {\n    return React.createElement(\n      \"div\",\n      {\n        className: \"_3pzj\",\n        style: {\n          height: 40,\n          position: \"absolute\",\n          width: 1845,\n          zIndex: 0,\n          transform: \"translate3d(0px,0px,0)\",\n          backfaceVisibility: \"hidden\",\n        },\n      },\n      React.createElement(FixedDataTableCell143, { x: 322, key: \"cell_0\" }),\n      React.createElement(FixedDataTableCell143, { x: 325, key: \"cell_1\" }),\n      React.createElement(FixedDataTableCell143, { x: 328, key: \"cell_2\" }),\n      React.createElement(FixedDataTableCell143, { x: 331, key: \"cell_3\" })\n    );\n  }\n  if (props.x === 367) {\n    return React.createElement(\n      \"div\",\n      {\n        className: \"_3pzj\",\n        style: {\n          height: 25,\n          position: \"absolute\",\n          width: 721,\n          zIndex: 2,\n          transform: \"translate3d(0px,0px,0)\",\n          backfaceVisibility: \"hidden\",\n        },\n      },\n      React.createElement(FixedDataTableCell143, { x: 339, key: \"cell_0\" }),\n      React.createElement(FixedDataTableCell143, { x: 344, key: \"cell_1\" }),\n      React.createElement(FixedDataTableCell143, { x: 350, key: \"cell_2\" }),\n      React.createElement(FixedDataTableCell143, { x: 356, key: \"cell_3\" }),\n      React.createElement(FixedDataTableCell143, { x: 361, key: \"cell_4\" }),\n      React.createElement(FixedDataTableCell143, { x: 366, key: \"cell_5\" })\n    );\n  }\n  if (props.x === 455) {\n    return React.createElement(\n      \"div\",\n      {\n        className: \"_3pzj\",\n        style: {\n          height: 25,\n          position: \"absolute\",\n          width: 1845,\n          zIndex: 0,\n          transform: \"translate3d(0px,0px,0)\",\n          backfaceVisibility: \"hidden\",\n        },\n      },\n      React.createElement(FixedDataTableCell143, { x: 373, key: \"cell_0\" }),\n      React.createElement(FixedDataTableCell143, { x: 378, key: \"cell_1\" }),\n      React.createElement(FixedDataTableCell143, { x: 383, key: \"cell_2\" }),\n      React.createElement(FixedDataTableCell143, { x: 388, key: \"cell_3\" }),\n      React.createElement(FixedDataTableCell143, { x: 393, key: \"cell_4\" }),\n      React.createElement(FixedDataTableCell143, { x: 398, key: \"cell_5\" }),\n      React.createElement(FixedDataTableCell143, { x: 403, key: \"cell_6\" }),\n      React.createElement(FixedDataTableCell143, { x: 408, key: \"cell_7\" }),\n      React.createElement(FixedDataTableCell143, { x: 413, key: \"cell_8\" }),\n      React.createElement(FixedDataTableCell143, { x: 418, key: \"cell_9\" }),\n      React.createElement(FixedDataTableCell143, { x: 423, key: \"cell_10\" }),\n      React.createElement(FixedDataTableCell143, { x: 428, key: \"cell_11\" }),\n      React.createElement(FixedDataTableCell143, { x: 433, key: \"cell_12\" }),\n      React.createElement(FixedDataTableCell143, { x: 438, key: \"cell_13\" }),\n      React.createElement(FixedDataTableCell143, { x: 443, key: \"cell_14\" }),\n      React.createElement(FixedDataTableCell143, { x: 448, key: \"cell_15\" }),\n      React.createElement(FixedDataTableCell143, { x: 451, key: \"cell_16\" }),\n      React.createElement(FixedDataTableCell143, { x: 454, key: \"cell_17\" })\n    );\n  }\n};\n\nvar FixedDataTableCellGroup145 = function(props) {\n  if (props.x === 319) {\n    return React.createElement(\n      \"div\",\n      { style: { height: 40, left: 0 }, className: \"_3pzk\" },\n      React.createElement(FixedDataTableCellGroupImpl144, { x: 318 })\n    );\n  }\n  if (props.x === 333) {\n    return React.createElement(\n      \"div\",\n      { style: { height: 40, left: 721 }, className: \"_3pzk\" },\n      React.createElement(FixedDataTableCellGroupImpl144, { x: 332 })\n    );\n  }\n  if (props.x === 368) {\n    return React.createElement(\n      \"div\",\n      { style: { height: 25, left: 0 }, className: \"_3pzk\" },\n      React.createElement(FixedDataTableCellGroupImpl144, { x: 367 })\n    );\n  }\n  if (props.x === 456) {\n    return React.createElement(\n      \"div\",\n      { style: { height: 25, left: 721 }, className: \"_3pzk\" },\n      React.createElement(FixedDataTableCellGroupImpl144, { x: 455 })\n    );\n  }\n};\n\nvar FixedDataTableRowImpl146 = function(props) {\n  if (props.x === 334) {\n    return React.createElement(\n      \"div\",\n      {\n        className: \"_1gd4 _4li _52no _3h1a _1mib\",\n        onClick: null,\n        onDoubleClick: null,\n        onMouseDown: null,\n        onMouseEnter: null,\n        onMouseLeave: null,\n        style: { width: 1209, height: 40 },\n      },\n      React.createElement(\n        \"div\",\n        { className: \"_1gd5\" },\n        React.createElement(FixedDataTableCellGroup145, {\n          x: 319,\n          key: \"fixed_cells\",\n        }),\n        React.createElement(FixedDataTableCellGroup145, {\n          x: 333,\n          key: \"scrollable_cells\",\n        }),\n        React.createElement(\"div\", {\n          className: \"_1gd6 _1gd8\",\n          style: { left: 721, height: 40 },\n        })\n      )\n    );\n  }\n  if (props.x === 457) {\n    return React.createElement(\n      \"div\",\n      {\n        className: \"_1gd4 _4li _3h1a _1mib\",\n        onClick: null,\n        onDoubleClick: null,\n        onMouseDown: null,\n        onMouseEnter: null,\n        onMouseLeave: null,\n        style: { width: 1209, height: 25 },\n      },\n      React.createElement(\n        \"div\",\n        { className: \"_1gd5\" },\n        React.createElement(FixedDataTableCellGroup145, {\n          x: 368,\n          key: \"fixed_cells\",\n        }),\n        React.createElement(FixedDataTableCellGroup145, {\n          x: 456,\n          key: \"scrollable_cells\",\n        }),\n        React.createElement(\"div\", {\n          className: \"_1gd6 _1gd8\",\n          style: { left: 721, height: 25 },\n        })\n      )\n    );\n  }\n};\n\nvar FixedDataTableRow147 = function(props) {\n  if (props.x === 335) {\n    return React.createElement(\n      \"div\",\n      {\n        style: {\n          width: 1209,\n          height: 40,\n          zIndex: 1,\n          transform: \"translate3d(0px,0px,0)\",\n          backfaceVisibility: \"hidden\",\n        },\n        className: \"_1gda\",\n      },\n      React.createElement(FixedDataTableRowImpl146, { x: 334 })\n    );\n  }\n  if (props.x === 458) {\n    return React.createElement(\n      \"div\",\n      {\n        style: {\n          width: 1209,\n          height: 25,\n          zIndex: 1,\n          transform: \"translate3d(0px,40px,0)\",\n          backfaceVisibility: \"hidden\",\n        },\n        className: \"_1gda\",\n      },\n      React.createElement(FixedDataTableRowImpl146, { x: 457 })\n    );\n  }\n};\n\nvar FixedDataTableAbstractSortableHeader148 = function(props) {\n  if (props.x === 341) {\n    return React.createElement(\n      \"div\",\n      { onClick: function() {}, className: \"_54_8 _4h2r _2wzx\" },\n      React.createElement(\"div\", { className: \"_2eq6\" }, null, React.createElement(AdsPETableHeader141, { x: 340 }))\n    );\n  }\n  if (props.x === 347) {\n    return React.createElement(\n      \"div\",\n      { onClick: function() {}, className: \"_54_8 _1kst _4h2r _2wzx\" },\n      React.createElement(\"div\", { className: \"_2eq6\" }, null, React.createElement(AdsPETableHeader141, { x: 346 }))\n    );\n  }\n  if (props.x === 353) {\n    return React.createElement(\n      \"div\",\n      { onClick: function() {}, className: \"_54_8 _1kst _4h2r _2wzx\" },\n      React.createElement(\"div\", { className: \"_2eq6\" }, null, React.createElement(AdsPETableHeader141, { x: 352 }))\n    );\n  }\n  if (props.x === 358) {\n    return React.createElement(\n      \"div\",\n      { onClick: function() {}, className: \"_54_8 _4h2r _2wzx\" },\n      React.createElement(\"div\", { className: \"_2eq6\" }, null, React.createElement(AdsPETableHeader141, { x: 357 }))\n    );\n  }\n  if (props.x === 363) {\n    return React.createElement(\n      \"div\",\n      { onClick: function() {}, className: \"_54_8 _54_9 _4h2r _2wzx\" },\n      React.createElement(\"div\", { className: \"_2eq6\" }, null, React.createElement(AdsPETableHeader141, { x: 362 }))\n    );\n  }\n  if (props.x === 370) {\n    return React.createElement(\n      \"div\",\n      { onClick: function() {}, className: \"_54_8 _4h2r _2wzx\" },\n      React.createElement(\"div\", { className: \"_2eq6\" }, null, React.createElement(AdsPETableHeader141, { x: 369 }))\n    );\n  }\n  if (props.x === 375) {\n    return React.createElement(\n      \"div\",\n      { onClick: function() {}, className: \"_54_8 _4h2r _2wzx\" },\n      React.createElement(\"div\", { className: \"_2eq6\" }, null, React.createElement(AdsPETableHeader141, { x: 374 }))\n    );\n  }\n  if (props.x === 380) {\n    return React.createElement(\n      \"div\",\n      { onClick: function() {}, className: \"_54_8 _4h2r _2wzx\" },\n      React.createElement(\"div\", { className: \"_2eq6\" }, null, React.createElement(AdsPETableHeader141, { x: 379 }))\n    );\n  }\n  if (props.x === 385) {\n    return React.createElement(\n      \"div\",\n      { onClick: function() {}, className: \"_54_8 _4h2r _2wzx\" },\n      React.createElement(\"div\", { className: \"_2eq6\" }, null, React.createElement(AdsPETableHeader141, { x: 384 }))\n    );\n  }\n  if (props.x === 390) {\n    return React.createElement(\n      \"div\",\n      { onClick: function() {}, className: \"_54_8 _4h2r _2wzx\" },\n      React.createElement(\"div\", { className: \"_2eq6\" }, null, React.createElement(AdsPETableHeader141, { x: 389 }))\n    );\n  }\n  if (props.x === 395) {\n    return React.createElement(\n      \"div\",\n      { onClick: function() {}, className: \"_54_8 _4h2r _2wzx\" },\n      React.createElement(\"div\", { className: \"_2eq6\" }, null, React.createElement(AdsPETableHeader141, { x: 394 }))\n    );\n  }\n  if (props.x === 400) {\n    return React.createElement(\n      \"div\",\n      { onClick: function() {}, className: \"_54_8 _4h2r _2wzx\" },\n      React.createElement(\"div\", { className: \"_2eq6\" }, null, React.createElement(AdsPETableHeader141, { x: 399 }))\n    );\n  }\n  if (props.x === 405) {\n    return React.createElement(\n      \"div\",\n      { onClick: function() {}, className: \"_54_8 _4h2r _2wzx\" },\n      React.createElement(\"div\", { className: \"_2eq6\" }, null, React.createElement(AdsPETableHeader141, { x: 404 }))\n    );\n  }\n  if (props.x === 410) {\n    return React.createElement(\n      \"div\",\n      { onClick: function() {}, className: \"_54_8 _4h2r _2wzx\" },\n      React.createElement(\"div\", { className: \"_2eq6\" }, null, React.createElement(AdsPETableHeader141, { x: 409 }))\n    );\n  }\n  if (props.x === 415) {\n    return React.createElement(\n      \"div\",\n      { onClick: function() {}, className: \"_54_8 _4h2r _2wzx\" },\n      React.createElement(\"div\", { className: \"_2eq6\" }, null, React.createElement(AdsPETableHeader141, { x: 414 }))\n    );\n  }\n  if (props.x === 420) {\n    return React.createElement(\n      \"div\",\n      { onClick: function() {}, className: \"_54_8 _4h2r _2wzx\" },\n      React.createElement(\"div\", { className: \"_2eq6\" }, null, React.createElement(AdsPETableHeader141, { x: 419 }))\n    );\n  }\n  if (props.x === 425) {\n    return React.createElement(\n      \"div\",\n      { onClick: function() {}, className: \"_54_8 _4h2r _2wzx\" },\n      React.createElement(\"div\", { className: \"_2eq6\" }, null, React.createElement(AdsPETableHeader141, { x: 424 }))\n    );\n  }\n  if (props.x === 430) {\n    return React.createElement(\n      \"div\",\n      { onClick: function() {}, className: \"_54_8 _4h2r _2wzx\" },\n      React.createElement(\"div\", { className: \"_2eq6\" }, null, React.createElement(AdsPETableHeader141, { x: 429 }))\n    );\n  }\n  if (props.x === 435) {\n    return React.createElement(\n      \"div\",\n      { onClick: function() {}, className: \"_54_8 _4h2r _2wzx\" },\n      React.createElement(\"div\", { className: \"_2eq6\" }, null, React.createElement(AdsPETableHeader141, { x: 434 }))\n    );\n  }\n  if (props.x === 440) {\n    return React.createElement(\n      \"div\",\n      { onClick: function() {}, className: \"_54_8 _4h2r _2wzx\" },\n      React.createElement(\"div\", { className: \"_2eq6\" }, null, React.createElement(AdsPETableHeader141, { x: 439 }))\n    );\n  }\n  if (props.x === 445) {\n    return React.createElement(\n      \"div\",\n      { onClick: function() {}, className: \"_54_8 _4h2r _2wzx\" },\n      React.createElement(\"div\", { className: \"_2eq6\" }, null, React.createElement(AdsPETableHeader141, { x: 444 }))\n    );\n  }\n};\n\nvar FixedDataTableSortableHeader149 = function(props) {\n  if (props.x === 342) {\n    return React.createElement(FixedDataTableAbstractSortableHeader148, {\n      x: 341,\n    });\n  }\n  if (props.x === 348) {\n    return React.createElement(FixedDataTableAbstractSortableHeader148, {\n      x: 347,\n    });\n  }\n  if (props.x === 354) {\n    return React.createElement(FixedDataTableAbstractSortableHeader148, {\n      x: 353,\n    });\n  }\n  if (props.x === 359) {\n    return React.createElement(FixedDataTableAbstractSortableHeader148, {\n      x: 358,\n    });\n  }\n  if (props.x === 364) {\n    return React.createElement(FixedDataTableAbstractSortableHeader148, {\n      x: 363,\n    });\n  }\n  if (props.x === 371) {\n    return React.createElement(FixedDataTableAbstractSortableHeader148, {\n      x: 370,\n    });\n  }\n  if (props.x === 376) {\n    return React.createElement(FixedDataTableAbstractSortableHeader148, {\n      x: 375,\n    });\n  }\n  if (props.x === 381) {\n    return React.createElement(FixedDataTableAbstractSortableHeader148, {\n      x: 380,\n    });\n  }\n  if (props.x === 386) {\n    return React.createElement(FixedDataTableAbstractSortableHeader148, {\n      x: 385,\n    });\n  }\n  if (props.x === 391) {\n    return React.createElement(FixedDataTableAbstractSortableHeader148, {\n      x: 390,\n    });\n  }\n  if (props.x === 396) {\n    return React.createElement(FixedDataTableAbstractSortableHeader148, {\n      x: 395,\n    });\n  }\n  if (props.x === 401) {\n    return React.createElement(FixedDataTableAbstractSortableHeader148, {\n      x: 400,\n    });\n  }\n  if (props.x === 406) {\n    return React.createElement(FixedDataTableAbstractSortableHeader148, {\n      x: 405,\n    });\n  }\n  if (props.x === 411) {\n    return React.createElement(FixedDataTableAbstractSortableHeader148, {\n      x: 410,\n    });\n  }\n  if (props.x === 416) {\n    return React.createElement(FixedDataTableAbstractSortableHeader148, {\n      x: 415,\n    });\n  }\n  if (props.x === 421) {\n    return React.createElement(FixedDataTableAbstractSortableHeader148, {\n      x: 420,\n    });\n  }\n  if (props.x === 426) {\n    return React.createElement(FixedDataTableAbstractSortableHeader148, {\n      x: 425,\n    });\n  }\n  if (props.x === 431) {\n    return React.createElement(FixedDataTableAbstractSortableHeader148, {\n      x: 430,\n    });\n  }\n  if (props.x === 436) {\n    return React.createElement(FixedDataTableAbstractSortableHeader148, {\n      x: 435,\n    });\n  }\n  if (props.x === 441) {\n    return React.createElement(FixedDataTableAbstractSortableHeader148, {\n      x: 440,\n    });\n  }\n  if (props.x === 446) {\n    return React.createElement(FixedDataTableAbstractSortableHeader148, {\n      x: 445,\n    });\n  }\n};\n\nvar FixedDataTableBufferedRows150 = function(props) {\n  if (props.x === 459) {\n    return React.createElement(\"div\", {\n      style: {\n        position: \"absolute\",\n        pointerEvents: \"auto\",\n        transform: \"translate3d(0px,65px,0)\",\n        backfaceVisibility: \"hidden\",\n      },\n    });\n  }\n};\n\nvar Scrollbar151 = function(props) {\n  if (props.x === 460) {\n    return null;\n  }\n  if (props.x === 461) {\n    return React.createElement(\n      \"div\",\n      {\n        onFocus: function() {},\n        onBlur: function() {},\n        onKeyDown: function() {},\n        onMouseDown: function() {},\n        onWheel: function() {},\n        className: \"_1t0r _1t0t _4jdr _1t0u\",\n        style: { width: 1209, zIndex: 99 },\n        tabIndex: 0,\n      },\n      React.createElement(\"div\", {\n        className: \"_1t0w _1t0y _1t0_\",\n        style: {\n          width: 561.6340607950117,\n          transform: \"translate3d(4px,0px,0)\",\n          backfaceVisibility: \"hidden\",\n        },\n      })\n    );\n  }\n};\n\nvar HorizontalScrollbar152 = function(props) {\n  if (props.x === 462) {\n    return React.createElement(\n      \"div\",\n      { className: \"_3h1k _3h1m\", style: { height: 15, width: 1209 } },\n      React.createElement(\n        \"div\",\n        {\n          style: {\n            height: 15,\n            position: \"absolute\",\n            overflow: \"hidden\",\n            width: 1209,\n            transform: \"translate3d(0px,0px,0)\",\n            backfaceVisibility: \"hidden\",\n          },\n        },\n        React.createElement(Scrollbar151, { x: 461 })\n      )\n    );\n  }\n};\n\nvar FixedDataTable153 = function(props) {\n  if (props.x === 463) {\n    return React.createElement(\n      \"div\",\n      {\n        className: \"_3h1i _1mie\",\n        onWheel: function() {},\n        style: { height: 25, width: 1209 },\n      },\n      React.createElement(\n        \"div\",\n        { className: \"_3h1j\", style: { height: 8, width: 1209 } },\n        React.createElement(FixedDataTableColumnResizeHandle140, { x: 313 }),\n        React.createElement(FixedDataTableRow147, {\n          x: 335,\n          key: \"group_header\",\n        }),\n        React.createElement(FixedDataTableRow147, { x: 458, key: \"header\" }),\n        React.createElement(FixedDataTableBufferedRows150, { x: 459 }),\n        null,\n        undefined,\n        React.createElement(\"div\", {\n          className: \"_3h1e _3h1h\",\n          style: { top: 8 },\n        })\n      ),\n      React.createElement(Scrollbar151, { x: 460 }),\n      React.createElement(HorizontalScrollbar152, { x: 462 })\n    );\n  }\n};\n\nvar TransitionTable154 = function(props) {\n  if (props.x === 464) {\n    return React.createElement(FixedDataTable153, { x: 463 });\n  }\n};\n\nvar AdsSelectableFixedDataTable155 = function(props) {\n  if (props.x === 465) {\n    return React.createElement(\"div\", { className: \"_5hht\" }, React.createElement(TransitionTable154, { x: 464 }));\n  }\n};\n\nvar AdsDataTableKeyboardSupportDecorator156 = function(props) {\n  if (props.x === 466) {\n    return React.createElement(\n      \"div\",\n      { className: \"_5d6f\", tabIndex: \"0\", onKeyDown: function() {} },\n      React.createElement(AdsSelectableFixedDataTable155, { x: 465 })\n    );\n  }\n};\n\nvar AdsEditableDataTableDecorator157 = function(props) {\n  if (props.x === 467) {\n    return React.createElement(\n      \"div\",\n      { onCopy: function() {} },\n      React.createElement(AdsDataTableKeyboardSupportDecorator156, { x: 466 })\n    );\n  }\n};\n\nvar AdsPEDataTableContainer158 = function(props) {\n  if (props.x === 468) {\n    return React.createElement(\n      \"div\",\n      { className: \"_35l_ _1hr clearfix\" },\n      null,\n      null,\n      null,\n      React.createElement(AdsEditableDataTableDecorator157, { x: 467 })\n    );\n  }\n};\n\nvar AdsPECampaignGroupTableContainer159 = function(props) {\n  if (props.x === 470) {\n    return React.createElement(ResponsiveBlock37, { x: 469 });\n  }\n};\n\nvar AdsPEManageAdsPaneContainer160 = function(props) {\n  if (props.x === 473) {\n    return React.createElement(\n      \"div\",\n      null,\n      React.createElement(AdsErrorBoundary10, { x: 65 }),\n      React.createElement(\"div\", { className: \"_2uty\" }, React.createElement(AdsErrorBoundary10, { x: 125 })),\n      React.createElement(\n        \"div\",\n        { className: \"_2utx _21oc\" },\n        React.createElement(AdsErrorBoundary10, { x: 171 }),\n        React.createElement(\n          \"div\",\n          { className: \"_41tu\" },\n          React.createElement(AdsErrorBoundary10, { x: 176 }),\n          React.createElement(AdsErrorBoundary10, { x: 194 })\n        )\n      ),\n      React.createElement(\n        \"div\",\n        { className: \"_2utz\", style: { height: 25 } },\n        React.createElement(AdsErrorBoundary10, { x: 302 }),\n        React.createElement(\"div\", { className: \"_2ut-\" }, React.createElement(AdsErrorBoundary10, { x: 312 })),\n        React.createElement(\"div\", { className: \"_2ut_\" }, React.createElement(AdsErrorBoundary10, { x: 472 }))\n      )\n    );\n  }\n};\n\nvar AdsPEContentContainer161 = function(props) {\n  if (props.x === 474) {\n    return React.createElement(AdsPEManageAdsPaneContainer160, { x: 473 });\n  }\n};\n\nvar FluxContainer_AdsPEWorkspaceContainer_162 = function(props) {\n  if (props.x === 477) {\n    return React.createElement(\n      \"div\",\n      { className: \"_49wu\", style: { height: 177, top: 43, width: 1306 } },\n      React.createElement(ResponsiveBlock37, { x: 62, key: \"0\" }),\n      React.createElement(AdsErrorBoundary10, { x: 476, key: \"1\" }),\n      null\n    );\n  }\n};\n\nvar FluxContainer_AdsSessionExpiredDialogContainer_163 = function(props) {\n  if (props.x === 478) {\n    return null;\n  }\n};\n\nvar FluxContainer_AdsPEUploadDialogLazyContainer_164 = function(props) {\n  if (props.x === 479) {\n    return null;\n  }\n};\n\nvar FluxContainer_DialogContainer_165 = function(props) {\n  if (props.x === 480) {\n    return null;\n  }\n};\n\nvar AdsBugReportContainer166 = function(props) {\n  if (props.x === 481) {\n    return React.createElement(\"span\", null);\n  }\n};\n\nvar AdsPEAudienceSplittingDialog167 = function(props) {\n  if (props.x === 482) {\n    return null;\n  }\n};\n\nvar AdsPEAudienceSplittingDialogContainer168 = function(props) {\n  if (props.x === 483) {\n    return React.createElement(\"div\", null, React.createElement(AdsPEAudienceSplittingDialog167, { x: 482 }));\n  }\n};\n\nvar FluxContainer_AdsRuleDialogBootloadContainer_169 = function(props) {\n  if (props.x === 484) {\n    return null;\n  }\n};\n\nvar FluxContainer_AdsPECFTrayContainer_170 = function(props) {\n  if (props.x === 485) {\n    return null;\n  }\n};\n\nvar FluxContainer_AdsPEDeleteDraftContainer_171 = function(props) {\n  if (props.x === 486) {\n    return null;\n  }\n};\n\nvar FluxContainer_AdsPEInitialDraftPublishDialogContainer_172 = function(props) {\n  if (props.x === 487) {\n    return null;\n  }\n};\n\nvar FluxContainer_AdsPEReachFrequencyStatusTransitionDialogBootloadContainer_173 = function(props) {\n  if (props.x === 488) {\n    return null;\n  }\n};\n\nvar FluxContainer_AdsPEPurgeArchiveDialogContainer_174 = function(props) {\n  if (props.x === 489) {\n    return null;\n  }\n};\n\nvar AdsPECreateDialogContainer175 = function(props) {\n  if (props.x === 490) {\n    return React.createElement(\"span\", null);\n  }\n};\n\nvar FluxContainer_AdsPEModalStatusContainer_176 = function(props) {\n  if (props.x === 491) {\n    return null;\n  }\n};\n\nvar FluxContainer_AdsBrowserExtensionErrorDialogContainer_177 = function(props) {\n  if (props.x === 492) {\n    return null;\n  }\n};\n\nvar FluxContainer_AdsPESortByErrorTipContainer_178 = function(props) {\n  if (props.x === 493) {\n    return null;\n  }\n};\n\nvar LeadDownloadDialogSelector179 = function(props) {\n  if (props.x === 494) {\n    return null;\n  }\n};\n\nvar FluxContainer_AdsPELeadDownloadDialogContainerClass_180 = function(props) {\n  if (props.x === 495) {\n    return React.createElement(LeadDownloadDialogSelector179, { x: 494 });\n  }\n};\n\nvar AdsPEContainer181 = function(props) {\n  if (props.x === 496) {\n    return React.createElement(\n      \"div\",\n      { id: \"ads_pe_container\" },\n      React.createElement(FluxContainer_AdsPETopNavContainer_26, { x: 41 }),\n      null,\n      React.createElement(FluxContainer_AdsPEWorkspaceContainer_162, {\n        x: 477,\n      }),\n      React.createElement(FluxContainer_AdsSessionExpiredDialogContainer_163, { x: 478 }),\n      React.createElement(FluxContainer_AdsPEUploadDialogLazyContainer_164, {\n        x: 479,\n      }),\n      React.createElement(FluxContainer_DialogContainer_165, { x: 480 }),\n      React.createElement(AdsBugReportContainer166, { x: 481 }),\n      React.createElement(AdsPEAudienceSplittingDialogContainer168, { x: 483 }),\n      React.createElement(FluxContainer_AdsRuleDialogBootloadContainer_169, {\n        x: 484,\n      }),\n      React.createElement(FluxContainer_AdsPECFTrayContainer_170, { x: 485 }),\n      React.createElement(\n        \"span\",\n        null,\n        React.createElement(FluxContainer_AdsPEDeleteDraftContainer_171, {\n          x: 486,\n        }),\n        React.createElement(FluxContainer_AdsPEInitialDraftPublishDialogContainer_172, { x: 487 }),\n        React.createElement(FluxContainer_AdsPEReachFrequencyStatusTransitionDialogBootloadContainer_173, { x: 488 })\n      ),\n      React.createElement(FluxContainer_AdsPEPurgeArchiveDialogContainer_174, { x: 489 }),\n      React.createElement(AdsPECreateDialogContainer175, { x: 490 }),\n      React.createElement(FluxContainer_AdsPEModalStatusContainer_176, {\n        x: 491,\n      }),\n      React.createElement(FluxContainer_AdsBrowserExtensionErrorDialogContainer_177, { x: 492 }),\n      React.createElement(FluxContainer_AdsPESortByErrorTipContainer_178, {\n        x: 493,\n      }),\n      React.createElement(FluxContainer_AdsPELeadDownloadDialogContainerClass_180, { x: 495 }),\n      React.createElement(\"div\", { id: \"web_ads_guidance_tips\" })\n    );\n  }\n};\n\nfunction Benchmark(props) {\n  if (props.x === undefined) {\n    return React.createElement(AdsPEContainer181, { x: 496 });\n  }\n}\n\nBenchmark.getTrials = function(renderer, Root) {\n  renderer.update(<Root />);\n  return [[\"pe-functional-components\", renderer.toJSON()]];\n};\n\nif (this.__optimizeReactComponentTree) {\n  __optimizeReactComponentTree(Benchmark);\n}\n\nmodule.exports = Benchmark;\n"
  },
  {
    "path": "test/react/FBMocks/repl-example.js",
    "content": "var React = require(\"React\");\n\nfunction Yar(props) {\n  return (\n    <a href={props.href}>\n      <em>{props.name}</em>\n    </a>\n  );\n}\n\nfunction Bar(props) {\n  return (\n    <div>\n      <span style={{ color: \"red\" }}>Here's a link</span>: <Yar {...props} />\n    </div>\n  );\n}\n\n// for now, we require inline Flow type annotations on the root component\n// for its props (if it has any)\nfunction Foo(props: { href: string }) {\n  var collection = [\n    { href: props.href, name: \"First Item\" },\n    { href: props.href, name: \"Second Item\" },\n    { href: props.href, name: \"Third Item\" },\n  ];\n\n  return <div>{collection.map(item => <Bar {...item} />)}</div>;\n}\n\n// this is a special Prepack function hook\n// that tells Prepack the root of a React component tree\nif (this.__optimizeReactComponentTree) {\n  __optimizeReactComponentTree(Foo);\n}\n\nwindow.Foo = Foo;\n"
  },
  {
    "path": "test/react/FBMocks-test.js",
    "content": "/**\n * Copyright (c) 2017-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n/* @flow */\n\nconst fs = require(\"fs\");\nconst setupReactTests = require(\"./setupReactTests\");\nconst { runTest, stubReactRelay } = setupReactTests();\n\n/* eslint-disable no-undef */\nconst { it } = global;\n\nit(\"fb-www\", () => {\n  stubReactRelay(() => {\n    runTest(__dirname + \"/FBMocks/fb1.js\");\n  });\n});\n\nit(\"fb-www 2\", () => {\n  runTest(__dirname + \"/FBMocks/fb2.js\");\n});\n\nit(\"fb-www 3\", () => {\n  stubReactRelay(() => {\n    runTest(__dirname + \"/FBMocks/fb3.js\");\n  });\n});\n\nit(\"fb-www 4\", () => {\n  stubReactRelay(() => {\n    runTest(__dirname + \"/FBMocks/fb4.js\");\n  });\n});\n\nit(\"fb-www 5\", () => {\n  runTest(__dirname + \"/FBMocks/fb5.js\");\n});\n\nit(\"fb-www 6\", () => {\n  runTest(__dirname + \"/FBMocks/fb6.js\");\n});\n\nit(\"fb-www 7\", () => {\n  runTest(__dirname + \"/FBMocks/fb7.js\");\n});\n\nit(\"fb-www 8\", () => {\n  runTest(__dirname + \"/FBMocks/fb8.js\");\n});\n\nit(\"fb-www 9\", () => {\n  runTest(__dirname + \"/FBMocks/fb9.js\");\n});\n\nit(\"fb-www 10\", () => {\n  runTest(__dirname + \"/FBMocks/fb10.js\");\n});\n\nit(\"fb-www 11\", () => {\n  runTest(__dirname + \"/FBMocks/fb11.js\");\n});\n\nit(\"fb-www 12\", () => {\n  runTest(__dirname + \"/FBMocks/fb12.js\", {\n    expectReconcilerError: true,\n  });\n});\n\nit(\"fb-www 13\", () => {\n  runTest(__dirname + \"/FBMocks/fb13.js\");\n});\n\nit(\"fb-www 14\", () => {\n  runTest(__dirname + \"/FBMocks/fb14.js\");\n});\n\nit(\"fb-www 15\", () => {\n  runTest(__dirname + \"/FBMocks/fb15.js\", {\n    expectReconcilerError: true,\n  });\n});\n\nit(\"fb-www 16\", () => {\n  runTest(__dirname + \"/FBMocks/fb16.js\", {\n    expectReconcilerError: true,\n  });\n});\n\nit(\"fb-www 17\", () => {\n  runTest(__dirname + \"/FBMocks/fb17.js\");\n});\n\n// Test fails for two reasons:\n// - \"uri.foo\" on abstract string does not exist\n// - unused.bar() does not exist (even if in try/catch)\nit(\"fb-www 18\", () => {\n  runTest(__dirname + \"/FBMocks/fb18.js\", {\n    expectReconcilerError: true,\n  });\n});\n\nit(\"fb-www 19\", () => {\n  runTest(__dirname + \"/FBMocks/fb19.js\", {\n    expectReconcilerError: true,\n  });\n});\n\nit(\"fb-www 20\", () => {\n  runTest(__dirname + \"/FBMocks/fb20.js\");\n});\n\nit(\"fb-www 21\", () => {\n  runTest(__dirname + \"/FBMocks/fb21.js\");\n});\n\nit(\"fb-www 22\", () => {\n  runTest(__dirname + \"/FBMocks/fb22.js\");\n});\n\nit(\"fb-www 23\", () => {\n  runTest(__dirname + \"/FBMocks/fb23.js\");\n});\n\nit(\"fb-www 24\", () => {\n  runTest(__dirname + \"/FBMocks/fb24.js\");\n});\n\nit(\"fb-www 25\", () => {\n  runTest(__dirname + \"/FBMocks/fb25.js\");\n});\n\nit(\"repl example\", () => {\n  runTest(__dirname + \"/FBMocks/repl-example.js\");\n});\n\nit(\"Hacker News app\", () => {\n  let data = JSON.parse(fs.readFileSync(__dirname + \"/FBMocks/hacker-news.json\").toString());\n  runTest(__dirname + \"/FBMocks/hacker-news.js\", { data });\n});\n\nit(\"Function bind\", () => {\n  runTest(__dirname + \"/FBMocks/function-bind.js\");\n});\n\nit(\"PE Functional Components benchmark\", () => {\n  runTest(__dirname + \"/FBMocks/pe-functional-benchmark.js\");\n});\n"
  },
  {
    "path": "test/react/FactoryComponents/simple.js",
    "content": "var React = require(\"react\");\n\nfunction FactoryComponent(props) {\n  return {\n    render() {\n      return <div>{props.title}</div>;\n    },\n  };\n}\n\nFactoryComponent.getTrials = function(renderer, Root) {\n  renderer.update(<Root />);\n  return [[\"render simple factory classes\", renderer.toJSON()]];\n};\n\nif (this.__optimizeReactComponentTree) {\n  __optimizeReactComponentTree(FactoryComponent);\n}\n\nmodule.exports = FactoryComponent;\n"
  },
  {
    "path": "test/react/FactoryComponents/simple2.js",
    "content": "var React = require(\"react\");\n\nfunction FactoryComponent(props) {\n  return {\n    render() {\n      return <div>{props.title}</div>;\n    },\n  };\n}\n\nfunction App(props) {\n  return (\n    <div>\n      Hello, <FactoryComponent title={props.title} />\n    </div>\n  );\n}\n\nApp.getTrials = function(renderer, Root) {\n  renderer.update(<Root />);\n  return [[\"render simple factory classes #2\", renderer.toJSON()]];\n};\n\nif (this.__optimizeReactComponentTree) {\n  __optimizeReactComponentTree(App);\n}\n\nmodule.exports = App;\n"
  },
  {
    "path": "test/react/FactoryComponents-test.js",
    "content": "/**\n * Copyright (c) 2017-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n/* @flow */\n\nconst setupReactTests = require(\"./setupReactTests\");\nconst { runTest } = setupReactTests();\n\n/* eslint-disable no-undef */\nconst { it } = global;\n\nit(\"Simple factory classes\", () => {\n  runTest(__dirname + \"/FactoryComponents/simple.js\");\n});\n\nit(\"Simple factory classes 2\", () => {\n  runTest(__dirname + \"/FactoryComponents/simple2.js\");\n});\n"
  },
  {
    "path": "test/react/FirstRenderOnly/equivalence.js",
    "content": "var React = require(\"react\");\n\nfunction App(props) {\n  var foo = Object.assign({}, props);\n  var a = <span {...foo} key={null} />;\n  var b = <span {...foo} key={null} />;\n  return [a, b];\n}\n\nApp.getTrials = function(renderer, Root, data, isCompiled) {\n  if (isCompiled) {\n    const [a, b] = Root({});\n    if (a !== b) {\n      throw new Error(\"Equivalence check failed\");\n    }\n  }\n  renderer.update(<Root />);\n  return [[\"equivalence render\", renderer.toJSON()]];\n};\n\nif (this.__optimizeReactComponentTree) {\n  __optimizeReactComponentTree(App, {\n    firstRenderOnly: true,\n  });\n}\n\nmodule.exports = App;\n"
  },
  {
    "path": "test/react/FirstRenderOnly/equivalence2.js",
    "content": "var React = require(\"react\");\n\nfunction App(props) {\n  var foo = { children: <div /> };\n  var foo2 = Object.assign({}, props, foo);\n  var a = <span {...foo2} key={null} />;\n  var b = <span {...foo2} key={null} />;\n  return [a, b];\n}\n\nApp.getTrials = function(renderer, Root, data, isCompiled) {\n  if (isCompiled) {\n    const [a, b] = Root({});\n    if (a !== b) {\n      throw new Error(\"Equivalence check failed\");\n    }\n  }\n  renderer.update(<Root />);\n  return [[\"equivalence render\", renderer.toJSON()]];\n};\n\nif (this.__optimizeReactComponentTree) {\n  __optimizeReactComponentTree(App, {\n    firstRenderOnly: true,\n  });\n}\n\nmodule.exports = App;\n"
  },
  {
    "path": "test/react/FirstRenderOnly/equivalence3.js",
    "content": "var React = require(\"react\");\n\nfunction App(props) {\n  var foo = props.foo;\n  var x = {\n    val: 1,\n  };\n  var y = {\n    val: 1,\n  };\n  var foo = Object.assign({}, props, foo ? x : y);\n  var a = <span {...foo} key={null} />;\n  var b = <span {...foo} key={null} />;\n  return [a, b];\n}\n\nApp.getTrials = function(renderer, Root, data, isCompiled) {\n  if (isCompiled) {\n    const [a, b] = Root({ foo: false });\n    if (a !== b) {\n      throw new Error(\"Equivalence check failed\");\n    }\n  }\n  renderer.update(<Root foo={false} />);\n  return [[\"equivalence render\", renderer.toJSON()]];\n};\n\nif (this.__optimizeReactComponentTree) {\n  __optimizeReactComponentTree(App, {\n    firstRenderOnly: true,\n  });\n}\n\nmodule.exports = App;\n"
  },
  {
    "path": "test/react/FirstRenderOnly/equivalence4.js",
    "content": "var React = require(\"react\");\n\nfunction App(props) {\n  var foo = Object.assign({}, props);\n\n  if (props.x) {\n    return <span {...foo} key={null} />;\n  } else {\n    return <span {...foo} key={null} />;\n  }\n}\n\nApp.getTrials = function(renderer, Root, data, isCompiled) {\n  renderer.update(<Root x={false} className={\"test\"} />);\n  return [[\"equivalence render\", renderer.toJSON()]];\n};\n\nif (this.__optimizeReactComponentTree) {\n  __optimizeReactComponentTree(App, {\n    firstRenderOnly: true,\n  });\n}\n\nmodule.exports = App;\n"
  },
  {
    "path": "test/react/FirstRenderOnly/equivalence5.js",
    "content": "var React = require(\"react\");\n\nfunction App(props) {\n  var foo = Object.assign({}, props);\n\n  if (props.x) {\n    return [<span {...foo} key={null} />, <span {...foo} key={null} />];\n  } else {\n    return [<span {...foo} key={null} />, <span {...foo} key={null} />];\n  }\n}\n\nApp.getTrials = function(renderer, Root, data, isCompiled) {\n  if (isCompiled) {\n    const [a, b] = Root({ x: false });\n    if (a !== b) {\n      throw new Error(\"Equivalence check failed\");\n    }\n  }\n  renderer.update(<Root x={false} className={\"test\"} />);\n  return [[\"equivalence render\", renderer.toJSON()]];\n};\n\nif (this.__optimizeReactComponentTree) {\n  __optimizeReactComponentTree(App, {\n    firstRenderOnly: true,\n  });\n}\n\nmodule.exports = App;\n"
  },
  {
    "path": "test/react/FirstRenderOnly/get-derived-state-from-props.js",
    "content": "var React = require(\"React\");\n\nfunction Child3(props) {\n  return <span>{props.data.text}</span>;\n}\n\nclass Child2 extends React.Component {\n  constructor() {\n    super();\n    this.randomVar = {\n      text: \"Hello world\",\n    };\n  }\n  render() {\n    return (\n      <React.Fragment>\n        {Array.from(this.props.items).map(item => <Child3 data={item} key={item.id} />)}\n        <span>{this.randomVar.text}</span>\n      </React.Fragment>\n    );\n  }\n  componentWillMount() {\n    this.randomVar.text = \"It worked!\";\n  }\n}\n\nclass Child1 extends React.Component {\n  constructor() {\n    super();\n    this.state = {\n      counter: 0,\n    };\n    this.handleClick = () => {\n      this.setState({ counter: this.state.counter + 1 });\n    };\n  }\n  render() {\n    return (\n      <div onClick={this.handleClick}>\n        <Child2 items={this.props.items} />\n        <span>Counter is at: {this.state.counter}</span>\n        <span>{this.state.title}</span>\n      </div>\n    );\n  }\n  static getDerivedStateFromProps(nextProps, prevState) {\n    return Object.assign({}, prevState, { title: \"Hello world\" });\n  }\n}\n\nfunction App(props) {\n  return <Child1 {...props} />;\n}\n\nApp.getTrials = function(renderer, Root) {\n  var items = [{ id: 0, text: \"Item 1\" }, { id: 1, text: \"Item 2\" }, { id: 2, text: \"Item 3\" }];\n  renderer.update(<Root items={items} />);\n  return [[\"render simple first render only tree\", renderer.toJSON()]];\n};\n\nif (this.__optimizeReactComponentTree) {\n  __optimizeReactComponentTree(App, {\n    firstRenderOnly: true,\n  });\n}\n\nmodule.exports = App;\n"
  },
  {
    "path": "test/react/FirstRenderOnly/get-derived-state-from-props2.js",
    "content": "var React = require(\"React\");\n\nfunction Child3(props) {\n  return <span>{props.data.text}</span>;\n}\n\nclass Child2 extends React.Component {\n  constructor() {\n    super();\n    this.randomVar = {\n      text: \"Hello world\",\n    };\n  }\n  render() {\n    return (\n      <React.Fragment>\n        {Array.from(this.props.items).map(item => <Child3 data={item} key={item.id} />)}\n        <span>{this.randomVar.text}</span>\n      </React.Fragment>\n    );\n  }\n  componentWillMount() {\n    this.randomVar.text = \"It worked!\";\n  }\n}\n\nclass Child1 extends React.Component {\n  constructor() {\n    super();\n    this.state = {\n      counter: 0,\n    };\n    this.handleClick = () => {\n      this.setState({ counter: this.state.counter + 1 });\n    };\n  }\n  render() {\n    return (\n      <div onClick={this.handleClick}>\n        <Child2 items={this.props.items} />\n        <span>Counter is at: {this.state.counter}</span>\n        <span>{this.state.title}</span>\n      </div>\n    );\n  }\n  static getDerivedStateFromProps(nextProps, prevState) {\n    if (nextProps.a !== nextProps.b) {\n      return Object.assign({}, prevState, { title: \"Hello world\" });\n    }\n    return null;\n  }\n}\n\nfunction App(props) {\n  return <Child1 {...props} />;\n}\n\nApp.getTrials = function(renderer, Root) {\n  var items = [{ id: 0, text: \"Item 1\" }, { id: 1, text: \"Item 2\" }, { id: 2, text: \"Item 3\" }];\n  let results = [];\n\n  renderer.update(<Root items={items} a={true} b={true} />);\n  results.push([\"render simple first render only tree (true true)\", renderer.toJSON()]);\n  renderer.update(<Root items={items} a={true} b={false} />);\n  results.push([\"render simple first render only tree (true false)\", renderer.toJSON()]);\n\n  return results;\n};\n\nif (this.__optimizeReactComponentTree) {\n  __optimizeReactComponentTree(App, {\n    firstRenderOnly: true,\n  });\n}\n\nmodule.exports = App;\n"
  },
  {
    "path": "test/react/FirstRenderOnly/get-derived-state-from-props3.js",
    "content": "var React = require(\"React\");\n\nfunction Child3(props) {\n  return <span>{props.data.text}</span>;\n}\n\nclass Child2 extends React.Component {\n  constructor() {\n    super();\n    this.randomVar = {\n      text: \"Hello world\",\n    };\n  }\n  render() {\n    return (\n      <React.Fragment>\n        {Array.from(this.props.items).map(item => <Child3 data={item} key={item.id} />)}\n        <span>{this.randomVar.text}</span>\n      </React.Fragment>\n    );\n  }\n  componentWillMount() {\n    this.randomVar.text = \"It worked!\";\n  }\n}\n\nclass Child1 extends React.Component {\n  constructor() {\n    super();\n    this.state = {\n      counter: 0,\n    };\n    this.handleClick = () => {\n      this.setState({ counter: this.state.counter + 1 });\n    };\n  }\n  render() {\n    return (\n      <div onClick={this.handleClick}>\n        <Child2 items={this.props.items} />\n        <span>Counter is at: {this.state.counter}</span>\n        <span>{this.state.title}</span>\n      </div>\n    );\n  }\n  static getDerivedStateFromProps(nextProps, prevState) {\n    return nextProps.a || Object.assign({}, prevState, { title: \"Hello world\" });\n  }\n}\n\nfunction App(props) {\n  return <Child1 {...props} />;\n}\n\nApp.getTrials = function(renderer, Root) {\n  var items = [{ id: 0, text: \"Item 1\" }, { id: 1, text: \"Item 2\" }, { id: 2, text: \"Item 3\" }];\n  let results = [];\n\n  // have to add keys so we don't update the same component (this is firstRenderOnly)\n  renderer.update(<Root key=\"0\" items={items} a={null} />);\n  results.push([\"render simple first render only tree (null)\", renderer.toJSON()]);\n  renderer.update(<Root key=\"1\" items={items} a={{ counter: 1 }} />);\n  results.push([\"render simple first render only tree ({counter: 1})\", renderer.toJSON()]);\n\n  return results;\n};\n\nif (this.__optimizeReactComponentTree) {\n  __optimizeReactComponentTree(App, {\n    firstRenderOnly: true,\n  });\n}\n\nmodule.exports = App;\n"
  },
  {
    "path": "test/react/FirstRenderOnly/get-derived-state-from-props4.js",
    "content": "var React = require(\"React\");\n\nfunction Child3(props) {\n  return <span>{props.data.text}</span>;\n}\n\nclass Child2 extends React.Component {\n  constructor() {\n    super();\n    this.randomVar = {\n      text: \"Hello world\",\n    };\n  }\n  render() {\n    return (\n      <React.Fragment>\n        {Array.from(this.props.items).map(item => <Child3 data={item} key={item.id} />)}\n        <span>{this.randomVar.text}</span>\n      </React.Fragment>\n    );\n  }\n  componentWillMount() {\n    this.randomVar.text = \"It worked!\";\n  }\n}\n\nclass Child1 extends React.Component {\n  constructor() {\n    super();\n    this.state = {\n      counter: 0,\n    };\n    this.handleClick = () => {\n      this.setState({ counter: this.state.counter + 1 });\n    };\n  }\n  render() {\n    return (\n      <div onClick={this.handleClick}>\n        <Child2 items={this.props.items} />\n        <span>Counter is at: {this.state.counter}</span>\n        <span>{this.state.title}</span>\n      </div>\n    );\n  }\n  static getDerivedStateFromProps(nextProps, prevState) {\n    return nextProps.a && Object.assign({}, prevState, { title: \"Hello world\" });\n  }\n}\n\nfunction App(props) {\n  return <Child1 {...props} />;\n}\n\nApp.getTrials = function(renderer, Root) {\n  var items = [{ id: 0, text: \"Item 1\" }, { id: 1, text: \"Item 2\" }, { id: 2, text: \"Item 3\" }];\n  let results = [];\n\n  renderer.update(<Root items={items} a={{ counter: 1 }} />);\n  results.push([\"render simple first render only tree ({counter: 1})\", renderer.toJSON()]);\n  renderer.update(<Root items={items} a={{ counter: 2 }} />);\n  results.push([\"render simple first render only tree ({counter: 2})\", renderer.toJSON()]);\n\n  return results;\n};\n\nif (this.__optimizeReactComponentTree) {\n  __optimizeReactComponentTree(App, {\n    firstRenderOnly: true,\n  });\n}\n\nmodule.exports = App;\n"
  },
  {
    "path": "test/react/FirstRenderOnly/get-derived-state-from-props5.js",
    "content": "var React = require(\"React\");\n\nfunction shallowEqual(objA, objB) {\n  var keysA = Object.keys(objA);\n  var keysB = Object.keys(objB);\n  if (keysA.length !== keysB.length) {\n    return false;\n  }\n  return true;\n}\n\nvar _React$PureComponent, _superProto;\n\nfunction getStateForProps(props) {\n  if (!props.feedback.is_awesome) {\n    return { label: null, visible: false };\n  }\n  return { label: null, visible: false };\n}\n_React$PureComponent = babelHelpers.inherits(MyComponent, React.PureComponent);\n\n_superProto = _React$PureComponent && _React$PureComponent.prototype;\nfunction MyComponent() {\n  var _superProto$construct;\n  var _temp;\n  for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {\n    args[_key] = arguments[_key];\n  }\n  return (\n    (_temp = (_superProto$construct = _superProto.constructor).call.apply(_superProto$construct, [this].concat(args))),\n    (this.state = getStateForProps(this.props)),\n    _temp\n  );\n}\nMyComponent.getDerivedStateFromProps = function(nextProps, prevState) {\n  var state = getStateForProps(nextProps);\n  return shallowEqual(state, prevState) ? null : state;\n};\nMyComponent.prototype.render = function() {\n  return null;\n};\n\nMyComponent.getTrials = function(renderer, Root) {\n  renderer.update(<Root feedback={{ is_awesome: true }} />);\n  return [[\"render\", renderer.toJSON()]];\n};\n\nif (this.__optimizeReactComponentTree) {\n  __optimizeReactComponentTree(MyComponent, {\n    firstRenderOnly: true,\n  });\n}\n\nmodule.exports = MyComponent;\n"
  },
  {
    "path": "test/react/FirstRenderOnly/react-context.js",
    "content": "var React = require(\"React\");\n\nvar { Provider, Consumer } = React.createContext(null);\n\nfunction Child(props) {\n  return (\n    <div>\n      <Consumer>\n        {context => {\n          return <span>123</span>;\n        }}\n      </Consumer>\n    </div>\n  );\n}\n\nfunction App(props) {\n  return (\n    <Provider>\n      <Child />\n    </Provider>\n  );\n}\n\nApp.getTrials = function(renderer, Root) {\n  renderer.update(<Root />);\n  return [[\"render props context\", renderer.toJSON()]];\n};\n\nif (this.__optimizeReactComponentTree) {\n  __optimizeReactComponentTree(App, {\n    firstRenderOnly: true,\n  });\n}\n\nmodule.exports = App;\n"
  },
  {
    "path": "test/react/FirstRenderOnly/react-context2.js",
    "content": "var React = require(\"React\");\n\nvar { Provider, Consumer } = React.createContext(null);\n\nfunction Child(props) {\n  return (\n    <div>\n      <Consumer>\n        {value => {\n          return <span>{value}</span>;\n        }}\n      </Consumer>\n    </div>\n  );\n}\n\nfunction App(props) {\n  return (\n    <Provider value={5}>\n      <Child />\n    </Provider>\n  );\n}\n\nApp.getTrials = function(renderer, Root) {\n  renderer.update(<Root />);\n  return [[\"render props context\", renderer.toJSON()]];\n};\n\nif (this.__optimizeReactComponentTree) {\n  __optimizeReactComponentTree(App, {\n    firstRenderOnly: true,\n  });\n}\n\nmodule.exports = App;\n"
  },
  {
    "path": "test/react/FirstRenderOnly/react-context3.js",
    "content": "var React = require(\"React\");\nvar Ctx = React.createContext(null);\n\nfunction Child(props) {\n  return (\n    <div>\n      <Ctx.Consumer>\n        {value => {\n          return <span>{value}</span>;\n        }}\n      </Ctx.Consumer>\n    </div>\n  );\n}\n\nfunction App(props) {\n  return (\n    <div>\n      <Child />\n    </div>\n  );\n}\n\nApp.Ctx = Ctx;\n\nApp.getTrials = function(renderer, Root) {\n  renderer.update(\n    <Root.Ctx.Provider value={5}>\n      <Root />\n    </Root.Ctx.Provider>\n  );\n  return [[\"render props context\", renderer.toJSON()]];\n};\n\nif (this.__optimizeReactComponentTree) {\n  __optimizeReactComponentTree(App, {\n    firstRenderOnly: true,\n  });\n}\n\nmodule.exports = App;\n"
  },
  {
    "path": "test/react/FirstRenderOnly/react-context4.js",
    "content": "var React = require(\"React\");\n\nvar Ctx = React.createContext(null);\n\nfunction Child(props) {\n  return (\n    <div>\n      <Ctx.Consumer>\n        {value => {\n          return <span>{value}</span>;\n        }}\n      </Ctx.Consumer>\n    </div>\n  );\n}\n\nfunction App(props) {\n  return (\n    <Ctx.Provider value=\"a\">\n      <Ctx.Provider value=\"b\">\n        <Child />\n      </Ctx.Provider>\n      <Child />\n    </Ctx.Provider>\n  );\n}\n\nApp.getTrials = function(renderer, Root) {\n  renderer.update(<Root />);\n  return [[\"render props context\", renderer.toJSON()]];\n};\n\nif (this.__optimizeReactComponentTree) {\n  __optimizeReactComponentTree(App, {\n    firstRenderOnly: true,\n  });\n}\n\nmodule.exports = App;\n"
  },
  {
    "path": "test/react/FirstRenderOnly/react-context5.js",
    "content": "var React = require(\"React\");\n\nvar Ctx = React.createContext(null);\n\nfunction Child(props) {\n  return (\n    <div>\n      <Ctx.Consumer>\n        {value => {\n          return <span>{value}</span>;\n        }}\n      </Ctx.Consumer>\n    </div>\n  );\n}\n\nfunction App(props) {\n  return (\n    <div>\n      <Ctx.Provider value=\"b\">\n        <Child />\n      </Ctx.Provider>\n      <Child />\n    </div>\n  );\n}\n\nApp.getTrials = function(renderer, Root) {\n  renderer.update(<Root />);\n  return [[\"render props context\", renderer.toJSON()]];\n};\n\nif (this.__optimizeReactComponentTree) {\n  __optimizeReactComponentTree(App, {\n    firstRenderOnly: true,\n  });\n}\n\nmodule.exports = App;\n"
  },
  {
    "path": "test/react/FirstRenderOnly/react-context6.js",
    "content": "var React = require(\"React\");\n\nvar { Provider, Consumer } = React.createContext(null);\n\nfunction Child2(props) {\n  return <span>{props.title}</span>;\n}\n\nfunction Child(props) {\n  return (\n    <div>\n      <Consumer>\n        {value => {\n          return (\n            <span>\n              <Child2 title={value} />\n            </span>\n          );\n        }}\n      </Consumer>\n    </div>\n  );\n}\n\nfunction App(props) {\n  return (\n    <div>\n      <Provider value=\"b\">\n        <Child />\n      </Provider>\n      <Child />\n    </div>\n  );\n}\n\nApp.getTrials = function(renderer, Root) {\n  renderer.update(<Root />);\n  return [[\"render props context\", renderer.toJSON()]];\n};\n\nif (this.__optimizeReactComponentTree) {\n  __optimizeReactComponentTree(App, {\n    firstRenderOnly: true,\n  });\n}\n\nmodule.exports = App;\n"
  },
  {
    "path": "test/react/FirstRenderOnly/replace-this-in-callbacks.js",
    "content": "var React = require(\"React\");\n\nclass Child1 extends React.Component {\n  constructor() {\n    super();\n    this.someMethod = () => {\n      return this.props.bar;\n    };\n  }\n  render() {\n    let DeOptComponent = this.props.DeOptComponent;\n    return (\n      <div>\n        <DeOptComponent someMethod={this.someMethod} />\n      </div>\n    );\n  }\n}\n\nfunction App(props) {\n  return <Child1 {...props} />;\n}\n\nApp.getTrials = function(renderer, Root) {\n  function DeOptComponent(props) {\n    return <span>{props.someMethod()}</span>;\n  }\n  renderer.update(<Root DeOptComponent={DeOptComponent} bar=\"123\" />);\n  return [[\"render replace this in callbacks\", renderer.toJSON()]];\n};\n\nif (this.__optimizeReactComponentTree) {\n  __optimizeReactComponentTree(App, {\n    firstRenderOnly: true,\n  });\n}\n\nmodule.exports = App;\n"
  },
  {
    "path": "test/react/FirstRenderOnly/replace-this-in-callbacks2.js",
    "content": "var React = require(\"React\");\n\nclass Child1 extends React.Component {\n  constructor() {\n    super();\n    var self = this;\n    this.someMethod = function() {\n      return self.props.bar;\n    };\n  }\n  render() {\n    let DeOptComponent = this.props.DeOptComponent;\n    return (\n      <div>\n        <DeOptComponent someMethod={this.someMethod} />\n      </div>\n    );\n  }\n}\n\nfunction App(props) {\n  return <Child1 {...props} />;\n}\n\nApp.getTrials = function(renderer, Root) {\n  function DeOptComponent(props) {\n    return <span>{props.someMethod()}</span>;\n  }\n  renderer.update(<Root DeOptComponent={DeOptComponent} bar=\"123\" />);\n  return [[\"render replace this in callbacks\", renderer.toJSON()]];\n};\n\nif (this.__optimizeReactComponentTree) {\n  __optimizeReactComponentTree(App, {\n    firstRenderOnly: true,\n  });\n}\n\nmodule.exports = App;\n"
  },
  {
    "path": "test/react/FirstRenderOnly/replace-this-in-callbacks3.js",
    "content": "var React = require(\"React\");\n\nclass Child1 extends React.Component {\n  constructor() {\n    super();\n    this.someMethod = function() {\n      return this.props.bar;\n    }.bind(this);\n  }\n  render() {\n    let DeOptComponent = this.props.DeOptComponent;\n    return (\n      <div>\n        <DeOptComponent someMethod={this.someMethod} />\n      </div>\n    );\n  }\n}\n\nfunction App(props) {\n  return <Child1 {...props} />;\n}\n\nApp.getTrials = function(renderer, Root) {\n  function DeOptComponent(props) {\n    return <span>{props.someMethod()}</span>;\n  }\n  renderer.update(<Root DeOptComponent={DeOptComponent} bar=\"123\" />);\n  return [[\"render replace this in callbacks\", renderer.toJSON()]];\n};\n\nif (this.__optimizeReactComponentTree) {\n  __optimizeReactComponentTree(App, {\n    firstRenderOnly: true,\n  });\n}\n\nmodule.exports = App;\n"
  },
  {
    "path": "test/react/FirstRenderOnly/simple-2.js",
    "content": "var React = require(\"react\");\n\nfunction A(props) {\n  return <div>Hello {props.x}</div>;\n}\n\nfunction App(props) {\n  return (\n    <div>\n      <A x={props.x.toString()} />\n    </div>\n  );\n}\n\nApp.getTrials = function(renderer, Root) {\n  renderer.update(<Root x={10} />);\n  return [[\"simple render\", renderer.toJSON()]];\n};\n\nif (this.__optimizeReactComponentTree) {\n  __optimizeReactComponentTree(App, {\n    firstRenderOnly: true,\n  });\n}\n\nmodule.exports = App;\n"
  },
  {
    "path": "test/react/FirstRenderOnly/simple-3.js",
    "content": "var React = require(\"react\");\nvar isOptimizedForFirstRender = false;\n\nfunction App(props) {\n  function fn() {\n    // should not be here\n  }\n  function fn2() {\n    return props.bar(fn);\n  }\n  return <div onClick={fn} ref={fn2} />;\n}\n\nApp.getTrials = function(renderer, Root) {\n  let val;\n  function func(_val) {\n    val = _val;\n  }\n  renderer.update(<Root bar={func} />);\n  let results = [];\n  results.push([\"simple render\", renderer.toJSON()]);\n  if (isOptimizedForFirstRender === true && val !== undefined) {\n    throw new Error(\"Ref was found! :(\");\n  }\n  return results;\n};\n\nif (this.__optimizeReactComponentTree) {\n  isOptimizedForFirstRender = true;\n  __optimizeReactComponentTree(App, {\n    firstRenderOnly: true,\n  });\n}\n\nmodule.exports = App;\n"
  },
  {
    "path": "test/react/FirstRenderOnly/simple-4.js",
    "content": "var React = require(\"react\");\nvar isOptimizedForFirstRender = false;\n\nfunction App(props) {\n  function fn() {\n    // should not be here\n  }\n  function fn2() {\n    return props.bar(fn);\n  }\n  var data = Object.assign({}, { x: 1 }, props, {\n    onClick: fn,\n    ref: fn2,\n    someAbstractThing: function() {\n      // do something\n    },\n  });\n  data.someAbstractThing();\n  return <div {...data} />;\n}\n\nApp.getTrials = function(renderer, Root) {\n  let val;\n  function func(_val) {\n    val = _val;\n  }\n  renderer.update(<Root bar={func} />);\n  let results = [];\n  results.push([\"simple render\", renderer.toJSON()]);\n  if (isOptimizedForFirstRender === true && val !== undefined) {\n    throw new Error(\"Ref was found! :(\");\n  }\n  return results;\n};\n\nif (this.__optimizeReactComponentTree) {\n  isOptimizedForFirstRender = true;\n  __optimizeReactComponentTree(App, {\n    firstRenderOnly: true,\n  });\n}\n\nmodule.exports = App;\n"
  },
  {
    "path": "test/react/FirstRenderOnly/simple.js",
    "content": "var React = require(\"React\");\n\nfunction Child3(props) {\n  return <span>{props.data.text}</span>;\n}\n\nclass Child2 extends React.Component {\n  constructor() {\n    super();\n    this.randomVar = {\n      text: \"Hello world\",\n    };\n  }\n  render() {\n    return (\n      <React.Fragment>\n        {Array.from(this.props.items).map(item => <Child3 data={item} key={item.id} />)}\n        <span>{this.randomVar.text}</span>\n      </React.Fragment>\n    );\n  }\n}\n\nclass Child1 extends React.Component {\n  constructor() {\n    super();\n    this.state = {\n      counter: 0,\n    };\n    this.handleClick = () => {\n      this.setState({ counter: this.state.counter + 1 });\n    };\n  }\n  render() {\n    return (\n      <div onClick={this.handleClick}>\n        <Child2 items={this.props.items} />\n        <span>Counter is at: {this.state.counter}</span>\n      </div>\n    );\n  }\n}\n\nfunction App(props) {\n  return <Child1 {...props} />;\n}\n\nApp.getTrials = function(renderer, Root) {\n  var items = [{ id: 0, text: \"Item 1\" }, { id: 1, text: \"Item 2\" }, { id: 2, text: \"Item 3\" }];\n  renderer.update(<Root items={items} />);\n  return [[\"render simple first render only tree\", renderer.toJSON()]];\n};\n\nif (this.__optimizeReactComponentTree) {\n  __optimizeReactComponentTree(App, {\n    firstRenderOnly: true,\n  });\n}\n\nmodule.exports = App;\n"
  },
  {
    "path": "test/react/FirstRenderOnly/will-mount.js",
    "content": "var React = require(\"React\");\n\nfunction Child3(props) {\n  return <span>{props.data.text}</span>;\n}\n\nclass Child2 extends React.Component {\n  constructor() {\n    super();\n    this.randomVar = {\n      text: \"Hello world\",\n    };\n  }\n  render() {\n    return (\n      <React.Fragment>\n        {Array.from(this.props.items).map(item => <Child3 data={item} key={item.id} />)}\n        <span>{this.randomVar.text}</span>\n      </React.Fragment>\n    );\n  }\n  componentWillMount() {\n    this.randomVar.text = \"It worked!\";\n  }\n}\n\nclass Child1 extends React.Component {\n  constructor() {\n    super();\n    this.state = {\n      counter: 0,\n    };\n    this.handleClick = () => {\n      this.setState({ counter: this.state.counter + 1 });\n    };\n  }\n  render() {\n    return (\n      <div onClick={this.handleClick}>\n        <Child2 items={this.props.items} />\n        <span>Counter is at: {this.state.counter}</span>\n      </div>\n    );\n  }\n  componentWillMount() {\n    this.setState({\n      counter: this.state.counter + 1,\n    });\n  }\n}\n\nfunction App(props) {\n  return <Child1 {...props} />;\n}\n\nApp.getTrials = function(renderer, Root) {\n  var items = [{ id: 0, text: \"Item 1\" }, { id: 1, text: \"Item 2\" }, { id: 2, text: \"Item 3\" }];\n  renderer.update(<Root items={items} />);\n  return [[\"render simple first render only tree\", renderer.toJSON()]];\n};\n\nif (this.__optimizeReactComponentTree) {\n  __optimizeReactComponentTree(App, {\n    firstRenderOnly: true,\n  });\n}\n\nmodule.exports = App;\n"
  },
  {
    "path": "test/react/FirstRenderOnly-test.js",
    "content": "/**\n * Copyright (c) 2017-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n/* @flow */\n\nconst setupReactTests = require(\"./setupReactTests\");\nconst { runTest } = setupReactTests();\n\n/* eslint-disable no-undef */\nconst { it } = global;\n\nit(\"Simple\", () => {\n  runTest(__dirname + \"/FirstRenderOnly/simple.js\", { firstRenderOnly: true });\n});\n\nit(\"Simple #2\", () => {\n  runTest(__dirname + \"/FirstRenderOnly/simple-2.js\", { firstRenderOnly: true });\n});\n\nit(\"Simple #3\", () => {\n  runTest(__dirname + \"/FirstRenderOnly/simple-3.js\", { firstRenderOnly: true });\n});\n\n// Should be refined in a follow up PR to check for\n// functions and keys on deep referenced objects linking\n// to host components\nit(\"Simple #4\", () => {\n  runTest(__dirname + \"/FirstRenderOnly/simple-4.js\", { firstRenderOnly: true });\n});\n\nit(\"componentWillMount\", () => {\n  runTest(__dirname + \"/FirstRenderOnly/will-mount.js\", { firstRenderOnly: true });\n});\n\nit(\"getDerivedStateFromProps\", () => {\n  runTest(__dirname + \"/FirstRenderOnly/get-derived-state-from-props.js\", { firstRenderOnly: true });\n});\n\nit(\"getDerivedStateFromProps 2\", () => {\n  runTest(__dirname + \"/FirstRenderOnly/get-derived-state-from-props2.js\", { firstRenderOnly: true });\n});\n\nit(\"getDerivedStateFromProps 3\", () => {\n  runTest(__dirname + \"/FirstRenderOnly/get-derived-state-from-props3.js\", { firstRenderOnly: true });\n});\n\nit(\"getDerivedStateFromProps 4\", () => {\n  runTest(__dirname + \"/FirstRenderOnly/get-derived-state-from-props4.js\", { firstRenderOnly: true });\n});\n\nit(\"getDerivedStateFromProps 5\", () => {\n  runTest(__dirname + \"/FirstRenderOnly/get-derived-state-from-props5.js\", { firstRenderOnly: true });\n});\n\nit(\"React Context\", () => {\n  runTest(__dirname + \"/FirstRenderOnly/react-context.js\", { firstRenderOnly: true });\n});\n\nit(\"React Context 2\", () => {\n  runTest(__dirname + \"/FirstRenderOnly/react-context2.js\", { firstRenderOnly: true });\n});\n\nit(\"React Context 3\", () => {\n  runTest(__dirname + \"/FirstRenderOnly/react-context3.js\", { firstRenderOnly: true });\n});\n\nit(\"React Context 4\", () => {\n  runTest(__dirname + \"/FirstRenderOnly/react-context4.js\", { firstRenderOnly: true });\n});\n\nit(\"React Context 5\", () => {\n  runTest(__dirname + \"/FirstRenderOnly/react-context5.js\", { firstRenderOnly: true });\n});\n\nit(\"React Context 6\", () => {\n  runTest(__dirname + \"/FirstRenderOnly/react-context6.js\", { firstRenderOnly: true });\n});\n\n// Known to be broken due to incomplete arrow function support.\nit.skip(\"Replace this in callbacks\", () => {\n  runTest(__dirname + \"/FirstRenderOnly/replace-this-in-callbacks.js\", { firstRenderOnly: true });\n});\n\nit(\"Replace this in callbacks 2\", () => {\n  runTest(__dirname + \"/FirstRenderOnly/replace-this-in-callbacks2.js\", { firstRenderOnly: true });\n});\n\nit(\"Replace this in callbacks 3\", () => {\n  runTest(__dirname + \"/FirstRenderOnly/replace-this-in-callbacks3.js\", { firstRenderOnly: true });\n});\n\nit(\"Equivalence of snapshotted node\", () => {\n  runTest(__dirname + \"/FirstRenderOnly/equivalence.js\", { firstRenderOnly: true });\n});\n\nit(\"Equivalence of snapshotted node 2\", () => {\n  runTest(__dirname + \"/FirstRenderOnly/equivalence2.js\", { firstRenderOnly: true });\n});\n\nit(\"Equivalence of snapshotted node 3\", () => {\n  runTest(__dirname + \"/FirstRenderOnly/equivalence3.js\", { firstRenderOnly: true });\n});\n\nit(\"Equivalence of snapshotted node 4\", () => {\n  runTest(__dirname + \"/FirstRenderOnly/equivalence4.js\", { firstRenderOnly: true });\n});\n\nit(\"Equivalence of snapshotted node 5\", () => {\n  runTest(__dirname + \"/FirstRenderOnly/equivalence5.js\", { firstRenderOnly: true });\n});\n"
  },
  {
    "path": "test/react/FunctionalComponents/additional-function-regression.js",
    "content": "var React = require(\"react\");\n\nfunction Component2() {\n  // nothing here\n}\n\nfunction App() {\n  return (\n    <div\n      ref={() => {\n        var foo = <Component2 />;\n      }}\n    />\n  );\n}\n\nApp.getTrials = function(renderer, Root) {\n  renderer.update(<Root />);\n  return [[\"simple render\", renderer.toJSON()]];\n};\n\nif (this.__optimizeReactComponentTree) {\n  __optimizeReactComponentTree(App);\n}\n\nmodule.exports = App;\n"
  },
  {
    "path": "test/react/FunctionalComponents/array-from.js",
    "content": "var React = require(\"react\");\n\nfunction App(props) {\n  var _ref8;\n  var value =\n    (_ref8 = props.feedback) != null ? ((_ref8 = _ref8.display_comments) != null ? _ref8.ordering_mode : _ref8) : _ref8;\n\n  var items = props.items;\n  var collection = Array.from(items).map(function() {\n    return <span>{value}</span>;\n  });\n\n  return <div>{collection}</div>;\n}\n\nApp.getTrials = function(renderer, Root) {\n  let items = [{ title: \"Hello world 1\", id: 0 }, { title: \"Hello world 2\", id: 1 }, { title: \"Hello world 3\", id: 2 }];\n  renderer.update(<Root items={items} feedback={{ display_comments: { ordering_mode: 10 } }} />);\n  return [[\"simple render array map\", renderer.toJSON()]];\n};\n\nif (this.__optimizeReactComponentTree) {\n  __optimizeReactComponentTree(App);\n}\n\nmodule.exports = App;\n"
  },
  {
    "path": "test/react/FunctionalComponents/array-map.js",
    "content": "var React = require(\"react\");\n\nfunction A(props) {\n  return <span>{props.title}</span>;\n}\n\nfunction App(props) {\n  return <div>{Array.from(props.items).map(item => <A title={item.title} key={item.id} />)}</div>;\n}\n\nApp.getTrials = function(renderer, Root) {\n  let items = [{ title: \"Hello world 1\", id: 0 }, { title: \"Hello world 2\", id: 1 }, { title: \"Hello world 3\", id: 2 }];\n  renderer.update(<Root items={items} />);\n  return [[\"simple render array map\", renderer.toJSON()]];\n};\n\nif (this.__optimizeReactComponentTree) {\n  __optimizeReactComponentTree(App);\n}\n\nmodule.exports = App;\n"
  },
  {
    "path": "test/react/FunctionalComponents/array-map2.js",
    "content": "var React = require(\"react\");\n\nfunction A(props) {\n  return <span>{props.title}</span>;\n}\n\nfunction App(props) {\n  return <div>{Array.from(props.items, item => <A title={item.title} key={item.id} />)}</div>;\n}\n\nApp.getTrials = function(renderer, Root) {\n  let items = [{ title: \"Hello world 1\", id: 0 }, { title: \"Hello world 2\", id: 1 }, { title: \"Hello world 3\", id: 2 }];\n  renderer.update(<Root items={items} />);\n  return [[\"simple render array map\", renderer.toJSON()]];\n};\n\nif (this.__optimizeReactComponentTree) {\n  __optimizeReactComponentTree(App);\n}\n\nmodule.exports = App;\n"
  },
  {
    "path": "test/react/FunctionalComponents/array-map3.js",
    "content": "var React = require(\"react\");\n\nfunction App(props) {\n  var items = Array.from(props.items);\n\n  var nested = function(item) {\n    return item;\n  };\n\n  return items.map(nested);\n}\n\nApp.getTrials = function(renderer, Root) {\n  let items = [0, 0];\n  renderer.update(<Root items={items} />);\n  return [[\"simple render array map\", renderer.toJSON()]];\n};\n\nif (this.__optimizeReactComponentTree) {\n  __optimizeReactComponentTree(App);\n}\n\nmodule.exports = App;\n"
  },
  {
    "path": "test/react/FunctionalComponents/array-twice.js",
    "content": "var React = require(\"react\");\n\nfunction A(props) {\n  return (\n    <div>\n      {props.children}\n      {props.children}\n    </div>\n  );\n}\n\nfunction App() {\n  return (\n    <div>\n      <A>{[\"hello\"]}</A>\n    </div>\n  );\n}\n\nApp.getTrials = function(renderer, Root) {\n  renderer.update(<Root />);\n  return [[\"render array twice\", renderer.toJSON()]];\n};\n\nif (this.__optimizeReactComponentTree) {\n  __optimizeReactComponentTree(App);\n}\n\nmodule.exports = App;\n"
  },
  {
    "path": "test/react/FunctionalComponents/bound-type.js",
    "content": "var React = require(\"react\");\n\nfunction Child(props) {\n  return (\n    <div>\n      {props.x}\n      {this.y}\n    </div>\n  );\n}\n\nvar foo = { y: \" world\" };\nconst BoundChild = Child.bind(foo);\n\nfunction App(props) {\n  return <BoundChild x={props.x} />;\n}\n\nApp.getTrials = function(renderer, Root) {\n  renderer.update(<Root />);\n  return [[\"simple bound function\", renderer.toJSON()]];\n};\n\nif (this.__optimizeReactComponentTree) {\n  __optimizeReactComponentTree(App);\n}\n\nmodule.exports = App;\n"
  },
  {
    "path": "test/react/FunctionalComponents/bound-type2.js",
    "content": "var React = require(\"react\");\n\nfunction App(props) {\n  return (\n    <div>\n      {props.x}\n      {this.y}\n    </div>\n  );\n}\n\nvar foo = { y: \" world\" };\nconst BoundApp = App.bind(foo);\n\nBoundApp.getTrials = function(renderer, Root) {\n  renderer.update(<Root x={\"Hello\"} />);\n  return [[\"simple bound function\", renderer.toJSON()]];\n};\n\nif (this.__optimizeReactComponentTree) {\n  __optimizeReactComponentTree(BoundApp);\n}\n\nmodule.exports = BoundApp;\n"
  },
  {
    "path": "test/react/FunctionalComponents/circular-reference.js",
    "content": "var React = require(\"React\");\n\nfunction App() {\n  // A circular reference\n  let selfRef = {};\n  selfRef.selfRef = selfRef;\n\n  // A cycle between two references\n  let mutualRefA = {};\n  let mutualRefB = {};\n  mutualRefA.indirect = { b: mutualRefB };\n  mutualRefB.indirect = { a: mutualRefA };\n\n  return (\n    <div\n      data-x={selfRef}\n      data-y={mutualRefA}\n      data-z={mutualRefB}\n      data-a={mutualRefA === mutualRefA.indirect.b.indirect.a}\n      data-b={mutualRefB === mutualRefB.indirect.a.indirect.b}\n      data-c={selfRef === selfRef.selfRef}\n    />\n  );\n}\n\nApp.getTrials = function(renderer, Root) {\n  renderer.update(<Root />);\n  return [[\"circular-reference\", renderer.toJSON()]];\n};\n\nif (this.__optimizeReactComponentTree) {\n  __optimizeReactComponentTree(App);\n}\n\nmodule.exports = App;\n"
  },
  {
    "path": "test/react/FunctionalComponents/class-root-with-instance-vars-2.js",
    "content": "var React = require(\"react\");\n\nfunction SubChild(props) {\n  return <span>{props.deepObject.foo.bar}</span>;\n}\n\nfunction Child(props) {\n  return (\n    <span>\n      <SubChild deepObject={props.deepObject} />\n    </span>\n  );\n}\n\n// we can't use ES2015 classes in Prepack yet (they don't serialize)\n// so we have to use ES5 instead\nvar App = (function(superclass) {\n  function App(props) {\n    superclass.apply(this, arguments);\n    this.deepObject = {\n      foo: {\n        bar: \"Hello world\",\n      },\n    };\n  }\n\n  if (superclass) {\n    App.__proto__ = superclass;\n  }\n  App.prototype = Object.create(superclass && superclass.prototype);\n  App.prototype.constructor = App;\n  App.prototype.render = function render() {\n    return <Child deepObject={this.deepObject} />;\n  };\n  App.getTrials = function(renderer, Root) {\n    renderer.update(<Root title=\"Hello world\" />);\n    return [[\"render with class root and instance vars\", renderer.toJSON()]];\n  };\n\n  return App;\n})(React.Component);\n\nif (this.__optimizeReactComponentTree) {\n  __optimizeReactComponentTree(App);\n}\n\nmodule.exports = App;\n"
  },
  {
    "path": "test/react/FunctionalComponents/class-root-with-instance-vars.js",
    "content": "var React = require(\"react\");\nthis[\"abstractVal\"] = null;\n\nfunction SubChild(props) {\n  return (\n    <span>\n      {props.title}\n      <div>{props.abstractVal}</div>\n    </span>\n  );\n}\n\nfunction Child(props) {\n  return (\n    <span>\n      <SubChild title={props.title} abstractVal={props.abstractVal} />\n    </span>\n  );\n}\n\n// we can't use ES2015 classes in Prepack yet (they don't serialize)\n// so we have to use ES5 instead\nvar App = (function(superclass) {\n  function App(props) {\n    superclass.apply(this, arguments);\n    this.title = props.title;\n    // side-effectful\n    this.abstractVal = abstractVal;\n  }\n\n  if (superclass) {\n    App.__proto__ = superclass;\n  }\n  App.prototype = Object.create(superclass && superclass.prototype);\n  App.prototype.constructor = App;\n  App.prototype.render = function render() {\n    return <Child title={this.title} abstractVal={this.abstractVal} />;\n  };\n  App.getTrials = function(renderer, Root) {\n    abstractVal = \"It works!\";\n    renderer.update(<Root title=\"Hello world\" />);\n    return [[\"render with class root and instance vars\", renderer.toJSON()]];\n  };\n\n  return App;\n})(React.Component);\n\nif (this.__optimizeReactComponentTree) {\n  __optimizeReactComponentTree(App);\n}\n\nmodule.exports = App;\n"
  },
  {
    "path": "test/react/FunctionalComponents/class-root-with-props.js",
    "content": "var React = require(\"react\");\n\nfunction SubChild(props) {\n  return <span>{props.title}</span>;\n}\n\nfunction Child(props) {\n  return (\n    <span>\n      <SubChild title={props.title} />\n    </span>\n  );\n}\n\n// we can't use ES2015 classes in Prepack yet (they don't serialize)\n// so we have to use ES5 instead\nvar App = (function(superclass) {\n  function App() {\n    superclass.apply(this, arguments);\n  }\n\n  if (superclass) {\n    App.__proto__ = superclass;\n  }\n  App.prototype = Object.create(superclass && superclass.prototype);\n  App.prototype.constructor = App;\n  App.prototype.render = function render() {\n    return <Child title={this.props.title} />;\n  };\n  App.getTrials = function(renderer, Root) {\n    renderer.update(<Root title=\"Hello world\" />);\n    return [[\"render with class root and props\", renderer.toJSON()]];\n  };\n\n  return App;\n})(React.Component);\n\nif (this.__optimizeReactComponentTree) {\n  __optimizeReactComponentTree(App);\n}\n\nmodule.exports = App;\n"
  },
  {
    "path": "test/react/FunctionalComponents/class-root-with-refs.js",
    "content": "var React = require(\"react\");\n\nfunction SubChild() {\n  return <span>Hello world</span>;\n}\n\nfunction Child() {\n  return (\n    <span>\n      <SubChild />\n    </span>\n  );\n}\n\n// we can't use ES2015 classes in Prepack yet (they don't serialize)\n// so we have to use ES5 instead\nvar App = (function(superclass) {\n  function App() {\n    superclass.apply(this, arguments);\n    this.divRefWorked = null;\n  }\n\n  if (superclass) {\n    App.__proto__ = superclass;\n  }\n  App.prototype = Object.create(superclass && superclass.prototype);\n  App.prototype.constructor = App;\n  App.prototype._renderChild = function() {\n    return <Child />;\n  };\n  App.prototype.divRefFunc = function divRefFunc(ref) {\n    this.divRefWorked = true;\n  };\n  App.prototype.render = function render() {\n    return <div ref={this.divRefFunc}>{this._renderChild()}</div>;\n  };\n  App.getTrials = function(renderer, Root) {\n    renderer.update(<Root />);\n    let results = [];\n    results.push([\"render with class root\", renderer.toJSON()]);\n    results.push([\"get the ref\", renderer.getInstance().divRefWorked]);\n    return results;\n  };\n\n  return App;\n})(React.Component);\n\nif (this.__optimizeReactComponentTree) {\n  __optimizeReactComponentTree(App);\n}\n\nmodule.exports = App;\n"
  },
  {
    "path": "test/react/FunctionalComponents/class-root-with-render-methods.js",
    "content": "var React = require(\"react\");\n\nfunction SubChild() {\n  return <span>Hello world</span>;\n}\n\nfunction Child() {\n  return (\n    <span>\n      <SubChild />\n    </span>\n  );\n}\n\n// we can't use ES2015 classes in Prepack yet (they don't serialize)\n// so we have to use ES5 instead\nvar App = (function(superclass) {\n  function App() {\n    superclass.apply(this, arguments);\n  }\n\n  if (superclass) {\n    App.__proto__ = superclass;\n  }\n  App.prototype = Object.create(superclass && superclass.prototype);\n  App.prototype.constructor = App;\n  App.prototype._renderChild = function() {\n    return <Child />;\n  };\n  App.prototype.render = function render() {\n    return <div>{this._renderChild()}</div>;\n  };\n  App.getTrials = function(renderer, Root) {\n    renderer.update(<Root />);\n    return [[\"render with class root\", renderer.toJSON()]];\n  };\n\n  return App;\n})(React.Component);\n\nif (this.__optimizeReactComponentTree) {\n  __optimizeReactComponentTree(App);\n}\n\nmodule.exports = App;\n"
  },
  {
    "path": "test/react/FunctionalComponents/class-root-with-state.js",
    "content": "var React = require(\"react\");\n\nfunction SubChild(props) {\n  return <span>{props.title}</span>;\n}\n\nfunction Child(props) {\n  return (\n    <span>\n      <SubChild title={props.title} />\n    </span>\n  );\n}\n\nclass App extends React.Component {\n  constructor(props) {\n    super(props);\n    this.state = {\n      title: \"It works!\",\n    };\n  }\n  render() {\n    return <Child title={this.state.title} />;\n  }\n}\n\nApp.getTrials = function(renderer, Root) {\n  renderer.update(<Root />);\n  return [[\"render with class root and props\", renderer.toJSON()]];\n};\n\nif (this.__optimizeReactComponentTree) {\n  __optimizeReactComponentTree(App);\n}\n\nmodule.exports = App;\n"
  },
  {
    "path": "test/react/FunctionalComponents/class-root.js",
    "content": "var React = require(\"react\");\n\nfunction SubChild() {\n  return <span>Hello world</span>;\n}\n\nfunction Child() {\n  return (\n    <span>\n      <SubChild />\n    </span>\n  );\n}\n\n// we can't use ES2015 classes in Prepack yet (they don't serialize)\n// so we have to use ES5 instead\nvar App = (function(superclass) {\n  function App() {\n    superclass.apply(this, arguments);\n  }\n\n  if (superclass) {\n    App.__proto__ = superclass;\n  }\n  App.prototype = Object.create(superclass && superclass.prototype);\n  App.prototype.constructor = App;\n  App.prototype.render = function render() {\n    return <Child />;\n  };\n  App.getTrials = function(renderer, Root) {\n    renderer.update(<Root />);\n    return [[\"render with class root\", renderer.toJSON()]];\n  };\n\n  return App;\n})(React.Component);\n\nif (this.__optimizeReactComponentTree) {\n  __optimizeReactComponentTree(App);\n}\n\nmodule.exports = App;\n"
  },
  {
    "path": "test/react/FunctionalComponents/clone-element.js",
    "content": "var React = require(\"react\");\n\nfunction MaybeShow(props) {\n  if (props.show) {\n    return props.children;\n  }\n  return null;\n}\n\nfunction Override(props) {\n  var child = props.children;\n  var shouldShow = props.overrideShow;\n  return React.cloneElement(child, {\n    show: shouldShow,\n  });\n}\n\nfunction App(props) {\n  return (\n    <Override overrideShow={props.show}>\n      <MaybeShow show={true}>\n        <h1>Hi</h1>\n      </MaybeShow>\n    </Override>\n  );\n}\n\nApp.getTrials = function(renderer, Root) {\n  let results = [];\n  renderer.update(<Root show={true} />);\n  results.push([\"clone element (true)\", renderer.toJSON()]);\n\n  renderer.update(<Root show={false} />);\n  results.push([\"clone element (false)\", renderer.toJSON()]);\n  return results;\n};\n\nif (this.__optimizeReactComponentTree) {\n  __optimizeReactComponentTree(App);\n}\n\nmodule.exports = App;\n"
  },
  {
    "path": "test/react/FunctionalComponents/clone-element2.js",
    "content": "var React = require(\"react\");\n\nfunction App(props) {\n  var a = <div className=\"123\" />;\n  return React.cloneElement(a, { id: \"456\" }, \"Hello world!\");\n}\n\nApp.getTrials = function(renderer, Root) {\n  renderer.update(<Root />);\n  return [[\"clone element 2\", renderer.toJSON()]];\n};\n\nif (this.__optimizeReactComponentTree) {\n  __optimizeReactComponentTree(App);\n}\n\nmodule.exports = App;\n"
  },
  {
    "path": "test/react/FunctionalComponents/conditional.js",
    "content": "var React = require(\"react\");\n\nfunction MaybeShow(props) {\n  if (props.show) {\n    return props.children;\n  }\n  return null;\n}\n\nfunction App() {\n  return (\n    <MaybeShow show={true}>\n      <h1>Hi</h1>\n    </MaybeShow>\n  );\n}\n\nApp.getTrials = function(renderer, Root) {\n  renderer.update(<Root />);\n  return [[\"conditional render\", renderer.toJSON()]];\n};\n\nif (this.__optimizeReactComponentTree) {\n  __optimizeReactComponentTree(App);\n}\n\nmodule.exports = App;\n"
  },
  {
    "path": "test/react/FunctionalComponents/default-props.js",
    "content": "var React = require(\"React\");\n\nfunction Child(props) {\n  return <span>{props.children}</span>;\n}\n\nChild.defaultProps = {\n  children: \"default text\",\n};\n\nfunction App(props) {\n  return <Child {...props.foo}>{props.bar}</Child>;\n}\n\nApp.getTrials = function(renderer, Root) {\n  let results = [];\n  renderer.update(<Root foo={{ children: undefined }} bar={undefined} />);\n  results.push([\"defaultProps\", renderer.toJSON()]);\n  renderer.update(<Root foo={{ children: \"prop children text\" }} bar={undefined} />);\n  results.push([\"defaultProps\", renderer.toJSON()]);\n  renderer.update(<Root foo={{ children: undefined }} bar={\"children prop text\"} />);\n  results.push([\"defaultProps\", renderer.toJSON()]);\n  return results;\n};\n\nif (this.__optimizeReactComponentTree) {\n  __optimizeReactComponentTree(App);\n}\n\nmodule.exports = App;\n"
  },
  {
    "path": "test/react/FunctionalComponents/default-props2.js",
    "content": "var React = require(\"React\");\n\nfunction Child(props) {\n  return <span>{props.children}</span>;\n}\n\nvar defaultProps = {\n  children: \"default text\",\n};\n\nthis.__makePartial && __makePartial(defaultProps);\n\nChild.defaultProps = defaultProps;\n\nfunction App(props) {\n  var newProps = Object.assign({}, props, { children: undefined });\n  return <Child {...newProps} />;\n}\n\nApp.getTrials = function(renderer, Root) {\n  let results = [];\n  renderer.update(<Root foo={{ children: undefined }} bar={\"children prop text\"} />);\n  results.push([\"defaultProps 2\", renderer.toJSON()]);\n  return results;\n};\n\nif (this.__optimizeReactComponentTree) {\n  __optimizeReactComponentTree(App);\n}\n\nmodule.exports = App;\n"
  },
  {
    "path": "test/react/FunctionalComponents/delete-element-prop-key.js",
    "content": "var React = require(\"react\");\n\nfunction A(props) {\n  return <div>Hello {props.x.b}</div>;\n}\n\nfunction B() {\n  return <div>World</div>;\n}\n\nfunction C() {\n  return \"!\";\n}\n\nfunction App() {\n  var x = { a: 1, b: \"World\" };\n\n  delete x.a;\n\n  return (\n    <div>\n      <A x={x} />\n      <B />\n      <C />\n    </div>\n  );\n}\n\nApp.getTrials = function(renderer, Root) {\n  renderer.update(<Root />);\n  return [[\"simple render with delete on props key\", renderer.toJSON()]];\n};\n\nif (this.__optimizeReactComponentTree) {\n  __optimizeReactComponentTree(App);\n}\n\nmodule.exports = App;\n"
  },
  {
    "path": "test/react/FunctionalComponents/do-not-optimize.js",
    "content": "var React = require(\"React\");\n\nfunction Child() {\n  return <div>{[1, 2, 3]}</div>;\n}\n\nChild.__reactCompilerDoNotOptimize = true;\n\nfunction App() {\n  return <Child />;\n}\n\nApp.getTrials = function(renderer, Root) {\n  renderer.update(<Root />);\n  var render = renderer.toJSON();\n  return [[\"do not optimize\", render.children.length]];\n};\n\nif (this.__optimizeReactComponentTree) {\n  __optimizeReactComponentTree(App, {\n    firstRenderOnly: true,\n  });\n}\n\nmodule.exports = App;\n"
  },
  {
    "path": "test/react/FunctionalComponents/dynamic-context.js",
    "content": "var React = require(\"react\");\n\nfunction SubChild(props, context) {\n  return <span>The context title is: {context.title}</span>;\n}\n\nfunction Child(props, context) {\n  return (\n    <span>\n      <SubChild />\n    </span>\n  );\n}\n\n// we can't use ES2015 classes in Prepack yet (they don't serialize)\n// so we have to use ES5 instead\nvar StatefulComponent = (function(superclass) {\n  function StatefulComponent() {\n    superclass.apply(this, arguments);\n  }\n\n  if (superclass) {\n    StatefulComponent.__proto__ = superclass;\n  }\n  StatefulComponent.prototype = Object.create(superclass && superclass.prototype);\n  StatefulComponent.prototype.constructor = StatefulComponent;\n  StatefulComponent.prototype.getChildContext = function getChildContext() {\n    return {\n      title: \"Hello world!\",\n    };\n  };\n  StatefulComponent.prototype.render = function render() {\n    return <Child />;\n  };\n  StatefulComponent.childContextTypes = {\n    title: () => {},\n  };\n\n  return StatefulComponent;\n})(React.Component);\n\nfunction App() {\n  return <StatefulComponent />;\n}\n\nApp.getTrials = function(renderer, Root) {\n  renderer.update(<Root />);\n  return [[\"render with dynamic context access\", renderer.toJSON()]];\n};\n\nif (this.__optimizeReactComponentTree) {\n  __optimizeReactComponentTree(Child);\n}\n\nmodule.exports = App;\n"
  },
  {
    "path": "test/react/FunctionalComponents/dynamic-props.js",
    "content": "var React = require(\"react\");\n\nfunction Fn(props) {\n  return <div>Hello {props[props.dynamicKey]}</div>;\n}\n\nfunction App(props) {\n  return <Fn foo=\"World\" dynamicKey={props.dynamicKey} />;\n}\n\nApp.getTrials = function(renderer, Root) {\n  renderer.update(<Root dynamicKey=\"foo\" />);\n  return [[\"render with dynamic prop access\", renderer.toJSON()]];\n};\n\nif (this.__optimizeReactComponentTree) {\n  __optimizeReactComponentTree(App);\n}\n\nmodule.exports = App;\n"
  },
  {
    "path": "test/react/FunctionalComponents/dynamic-type.js",
    "content": "var React = require(\"react\");\n\nfunction Foo(props) {\n  return <span>{props.name}</span>;\n}\n\nfunction Bar(props) {\n  return <div>{props.name}</div>;\n}\n\nfunction App(props) {\n  let Type = props.switch ? Foo : Bar;\n\n  return <Type name={\"Dominic\"} />;\n}\n\nApp.getTrials = function(renderer, Root) {\n  let results = [];\n  renderer.update(<Root switch={false} />);\n  results.push([\"render with dynamic type\", renderer.toJSON()]);\n  renderer.update(<Root switch={true} />);\n  results.push([\"render with dynamic type update\", renderer.toJSON()]);\n  renderer.update(<Root switch={false} />);\n  results.push([\"render with dynamic type update\", renderer.toJSON()]);\n  return results;\n};\n\nif (this.__optimizeReactComponentTree) {\n  __optimizeReactComponentTree(App);\n}\n\nmodule.exports = App;\n"
  },
  {
    "path": "test/react/FunctionalComponents/dynamic-type2.js",
    "content": "var React = require(\"react\");\n\nfunction Foo(props) {\n  return <span>{props.name}</span>;\n}\n\nfunction Bar(props) {\n  return <div>{props.name}</div>;\n}\n\nfunction App(props) {\n  let Type = props.switch ? (props.switch ? Foo : Bar) : Bar;\n\n  return <Type name={\"Dan\"} />;\n}\n\nApp.getTrials = function(renderer, Root) {\n  let results = [];\n  renderer.update(<Root switch={false} />);\n  results.push([\"render with dynamic type\", renderer.toJSON()]);\n  renderer.update(<Root switch={true} />);\n  results.push([\"render with dynamic type update\", renderer.toJSON()]);\n  renderer.update(<Root switch={false} />);\n  results.push([\"render with dynamic type update\", renderer.toJSON()]);\n  return results;\n};\n\nif (this.__optimizeReactComponentTree) {\n  __optimizeReactComponentTree(App);\n}\n\nmodule.exports = App;\n"
  },
  {
    "path": "test/react/FunctionalComponents/dynamic-type3.js",
    "content": "var React = require(\"react\");\n\nfunction Foo(props) {\n  return <span>{props.name}</span>;\n}\n\nFoo.defaultProps = {\n  name: \"Hello world 1\",\n};\n\nfunction Bar(props) {\n  return <div>{props.name}</div>;\n}\n\nBar.defaultProps = {\n  name: \"Hello world 2\",\n};\n\nfunction App(props) {\n  let Type = props.switch ? Foo : Bar;\n\n  return <Type />;\n}\n\nApp.getTrials = function(renderer, Root) {\n  let results = [];\n  renderer.update(<Root switch={false} />);\n  results.push([\"render with dynamic type\", renderer.toJSON()]);\n  renderer.update(<Root switch={true} />);\n  results.push([\"render with dynamic type update\", renderer.toJSON()]);\n  renderer.update(<Root switch={false} />);\n  results.push([\"render with dynamic type update\", renderer.toJSON()]);\n  return results;\n};\n\nif (this.__optimizeReactComponentTree) {\n  __optimizeReactComponentTree(App);\n}\n\nmodule.exports = App;\n"
  },
  {
    "path": "test/react/FunctionalComponents/dynamic-type4.js",
    "content": "var React = require(\"react\");\n\nfunction Foo(props) {\n  return <span>{props.name}</span>;\n}\n\nfunction App(props) {\n  var Type;\n\n  if (props.switch) {\n    var x = Object.assign({}, props.data, {\n      name: Foo,\n    });\n    Type = x.name;\n  } else {\n    return null;\n  }\n\n  return <Type name={\"Dan\"} />;\n}\n\nApp.getTrials = function(renderer, Root) {\n  let results = [];\n  renderer.update(<Root switch={false} data={{}} />);\n  results.push([\"render with dynamic type\", renderer.toJSON()]);\n  renderer.update(<Root switch={true} data={{}} />);\n  results.push([\"render with dynamic type update\", renderer.toJSON()]);\n  renderer.update(<Root switch={false} data={{}} />);\n  results.push([\"render with dynamic type update\", renderer.toJSON()]);\n  return results;\n};\n\nif (this.__optimizeReactComponentTree) {\n  __optimizeReactComponentTree(App);\n}\n\nmodule.exports = App;\n"
  },
  {
    "path": "test/react/FunctionalComponents/equivalence.js",
    "content": "var React = require(\"React\");\n\nfunction App(props) {\n  return React.createElement(\n    \"div\",\n    { className: \"test\" },\n    React.createElement(\n      \"div\",\n      {\n        className: \"foo/wrapper\",\n      },\n      React.createElement(\"span\", {\n        className: \"public/foo/dot\",\n      }),\n\n      React.createElement(\"span\", {\n        className: \"public/foo/dot\",\n      }),\n\n      React.createElement(\"span\", {\n        className: \"public/foo/dot\",\n      })\n    ),\n    React.createElement(\"div\", null, React.createElement(\"span\")),\n    React.createElement(\"a\", null, React.createElement(\"span\"))\n  );\n}\n\nApp.getTrials = function(renderer, Root) {\n  let results = [];\n  renderer.update(<Root x={true} a=\"1\" />);\n  results.push([\"ReactElement children equivalence\", renderer.toJSON()]);\n  renderer.update(<Root x={false} a=\"1\" />);\n  results.push([\"ReactElement children equivalence update\", renderer.toJSON()]);\n  return results;\n};\n\nif (this.__optimizeReactComponentTree) {\n  __optimizeReactComponentTree(App);\n}\n\nmodule.exports = App;\n"
  },
  {
    "path": "test/react/FunctionalComponents/event-handlers.js",
    "content": "var React = require(\"React\");\n\nfunction App(props) {\n  // This being a named function is a regression test for a bug\n  // that emitted a global.onClick assignment.\n  return (\n    <div\n      onClick={function onClick(x) {\n        props.onClick(x * 2);\n      }}\n    />\n  );\n}\n\nApp.getTrials = function(renderer, Root) {\n  let result;\n  renderer.update(\n    <Root\n      onClick={res => {\n        result = res;\n      }}\n    />\n  );\n  renderer.root.findByType(\"div\").props.onClick(10);\n  return [[\"onClick gets called\", result], [\"regression: onClick is not global\", typeof this.onClick]];\n};\n\nif (this.__optimizeReactComponentTree) {\n  __optimizeReactComponentTree(App);\n}\n\nmodule.exports = App;\n"
  },
  {
    "path": "test/react/FunctionalComponents/hoist-fragment.js",
    "content": "const React = require(\"react\");\n\nfunction Root(props) {\n  return (\n    <React.Fragment>\n      <React.Fragment>\n        <div />\n      </React.Fragment>\n    </React.Fragment>\n  );\n}\n\nRoot.getTrials = function(renderer, Root) {\n  renderer.update(<Root />);\n  return [[\"hoist fragments render\", renderer.toJSON()]];\n};\n\nif (this.__optimizeReactComponentTree) {\n  __optimizeReactComponentTree(Root);\n}\n\nmodule.exports = Root;\n"
  },
  {
    "path": "test/react/FunctionalComponents/keyed-non-element.js",
    "content": "const React = require(\"react\");\n\nfunction Upsilon(props) {\n  return [<Delta key=\"0\" />, <Delta key=\"1\" />];\n}\n\nfunction Delta(props) {\n  return [];\n}\n\nif (this.__optimizeReactComponentTree) __optimizeReactComponentTree(Upsilon);\n\nUpsilon.getTrials = function(renderer, Root) {\n  renderer.update(<Root />);\n  return [[\"render\", renderer.toJSON()]];\n};\n\nmodule.exports = Upsilon;\n"
  },
  {
    "path": "test/react/FunctionalComponents/keyed-unnecessarily.js",
    "content": "const React = require(\"react\");\n\nfunction Lambda(props) {\n  return (\n    <div>\n      <div key=\"0\" />\n      {this.__optimizeReactComponentTree ? <Omega key=\"1\" /> : <Omega />}\n      {this.__optimizeReactComponentTree ? <Omega key=\"2\" /> : <Omega />}\n    </div>\n  );\n}\n\nfunction Omega(props) {\n  return <div />;\n}\n\nif (this.__optimizeReactComponentTree) __optimizeReactComponentTree(Lambda);\n\nLambda.getTrials = function(renderer, Root) {\n  renderer.update(<Root />);\n  return [\n    [\"render\", renderer.toJSON()],\n    [\"keys are not added\", JSON.stringify(Lambda().props.children.map(element => element.key))],\n  ];\n};\n\nmodule.exports = Lambda;\n"
  },
  {
    "path": "test/react/FunctionalComponents/keyed.js",
    "content": "const React = require(\"react\");\n\nfunction Lambda(props) {\n  return [<div key=\"0\" />, <Omega key=\"1\" />, <Omega key=\"2\" />];\n}\n\nfunction Omega(props) {\n  return <div />;\n}\n\nif (this.__optimizeReactComponentTree) __optimizeReactComponentTree(Lambda);\n\nLambda.getTrials = function(renderer, Root) {\n  renderer.update(<Root />);\n  return [[\"render\", renderer.toJSON()], [\"keys are maintained\", JSON.stringify(Lambda().map(element => element.key))]];\n};\n\nmodule.exports = Lambda;\n"
  },
  {
    "path": "test/react/FunctionalComponents/model-props.js",
    "content": "var React = require(\"React\");\n\nfunction App(props) {\n  return (\n    <div>\n      <h1>{props.header.toString()}</h1>\n      <ul>{props.items && props.items.map(item => <li key={item.id}>{item.title.toString()}</li>)}</ul>\n    </div>\n  );\n}\n\nApp.getTrials = function(renderer, Root) {\n  var items = [{ id: 0, title: \"Item 1\" }, { id: 1, title: \"Item 2\" }, { id: 2, title: \"Item 3\" }];\n  renderer.update(<Root items={items} header={\"Hello world!\"} />);\n  return [[\"render simple with props model\", renderer.toJSON()]];\n};\n\nif (this.__optimizeReactComponentTree) {\n  let universe = {\n    Item: {\n      kind: \"object\",\n      jsType: \"object\",\n      properties: {\n        id: {\n          shape: {\n            kind: \"scalar\",\n            jsType: \"integral\",\n          },\n          optional: false,\n        },\n        title: {\n          shape: {\n            kind: \"scalar\",\n            jsType: \"string\",\n          },\n          optional: false,\n        },\n      },\n    },\n    Props: {\n      kind: \"object\",\n      jsType: \"object\",\n      properties: {\n        header: {\n          shape: {\n            kind: \"scalar\",\n            jsType: \"string\",\n          },\n          optional: false,\n        },\n        items: {\n          shape: {\n            kind: \"array\",\n            jsType: \"array\",\n            elementShape: {\n              shape: {\n                kind: \"link\",\n                shapeName: \"Item\",\n              },\n              optional: false,\n            },\n          },\n          optional: true,\n        },\n      },\n    },\n  };\n\n  let appModel = {\n    component: {\n      props: \"Props\",\n    },\n    universe,\n  };\n\n  __optimizeReactComponentTree(App, {\n    model: JSON.stringify(appModel),\n  });\n}\n\nmodule.exports = App;\n"
  },
  {
    "path": "test/react/FunctionalComponents/nested-array-children.js",
    "content": "var React = require(\"react\");\n\nfunction A(props) {\n  return <div>{[[[[[\"Hello\"], \"world\"], 1, <span>A span</span>], 2], null, <div>A div</div>]}</div>;\n}\n\nfunction App() {\n  return (\n    <div>\n      <A />\n    </div>\n  );\n}\n\nApp.getTrials = function(renderer, Root) {\n  renderer.update(<Root />);\n  return [[\"render nested array children\", renderer.toJSON()]];\n};\n\nif (this.__optimizeReactComponentTree) {\n  __optimizeReactComponentTree(App);\n}\n\nmodule.exports = App;\n"
  },
  {
    "path": "test/react/FunctionalComponents/not-safe.js",
    "content": "var x = 0;\n\nfunction foo() {\n  x++; // not safe\n}\nfunction Bar() {\n  foo();\n  return null;\n}\n\nif (this.__optimizeReactComponentTree) {\n  __optimizeReactComponentTree(Bar);\n}\n"
  },
  {
    "path": "test/react/FunctionalComponents/not-safe2.js",
    "content": "var x = 0;\n\nfunction foo() {\n  function foo2() {\n    x++; // not safe\n  }\n  foo2();\n}\nfunction Bar() {\n  foo();\n  return null;\n}\n\nif (this.__optimizeReactComponentTree) {\n  __optimizeReactComponentTree(Bar);\n}\n"
  },
  {
    "path": "test/react/FunctionalComponents/null-or-undefined-props.js",
    "content": "var React = require(\"react\");\n\nfunction App() {\n  return (\n    <div>\n      {React.createElement(\"div\")}\n      {React.createElement(\"div\", undefined)}\n      {React.createElement(\"div\", null)}\n    </div>\n  );\n}\n\nApp.getTrials = function(renderer, Root) {\n  renderer.update(<Root />);\n  return [[\"null or undefined props\", renderer.toJSON()]];\n};\n\nif (this.__optimizeReactComponentTree) {\n  __optimizeReactComponentTree(App);\n}\n\nmodule.exports = App;\n"
  },
  {
    "path": "test/react/FunctionalComponents/pathological-case.js",
    "content": "const React = require(\"react\");\n\nfunction Gamma(props) {\n  return React.createElement(\n    React.Fragment,\n    null,\n    React.createElement(Theta, {\n      n: props.c,\n      w: props.c,\n      s: props.c,\n      q: props.x,\n      g: null,\n      a: props.x,\n      f: props.c,\n    }),\n    [\n      React.createElement(\n        \"div\",\n        {\n          key: \"0\",\n          \"data-c\": props.c,\n        },\n        React.createElement(Iota, {\n          d: props.c,\n          w: props.x,\n          u: props.c,\n        })\n      ),\n      React.createElement(\n        \"div\",\n        {\n          key: \"1\",\n        },\n        React.createElement(Xi, {\n          v: props.x,\n          c: props.x,\n          e: props.c,\n          a: props.c,\n          z: props.x,\n          s: 3,\n          u: props.x,\n          n: props.x,\n          o: props.c,\n          j: true,\n        }),\n        React.createElement(Zeta, {\n          m: props.c,\n          u: props.c,\n          s: props.x,\n        }),\n        React.createElement(Epsilon, {\n          s: props.x,\n          c: props.c,\n          r: props.c,\n          q: props.c,\n          e: props.x,\n          g: props.c,\n          o: props.x,\n          h: props.c,\n          x: props.x,\n        })\n      ),\n    ],\n    React.createElement(\n      \"div\",\n      {\n        \"data-x\": props.x,\n      },\n      React.createElement(\n        \"div\",\n        {\n          \"data-x\": props.x,\n        },\n        React.createElement(Delta, {\n          l: null,\n        }),\n        React.createElement(Delta, {\n          l: props.x,\n        })\n      ),\n      React.createElement(Xi, {\n        v: 1,\n        c: props.c,\n        e: props.c,\n        a: props.x,\n        z: props.x,\n        s: props.x,\n        u: props.c,\n        n: props.c,\n        o: props.c,\n        j: props.x,\n      }),\n      React.createElement(\"div\", {\n        \"data-x\": props.x,\n        \"data-c\": props.c,\n      }),\n      React.createElement(Xi, {\n        v: props.c,\n        c: props.c,\n        e: props.c,\n        a: props.c,\n        z: null,\n        s: props.x,\n        u: props.x,\n        n: 3,\n        o: props.x,\n        j: -3,\n      })\n    ),\n    React.createElement(\n      \"div\",\n      {\n        \"data-c\": props.c,\n      },\n      React.createElement(Iota, {\n        d: props.c,\n        w: props.c,\n        u: true,\n      }),\n      React.createElement(Delta, {\n        l: props.c,\n      }),\n      React.createElement(Iota, {\n        d: props.c,\n        w: -4,\n        u: props.c,\n      }),\n      React.createElement(Xi, {\n        v: props.c,\n        c: props.x,\n        e: props.x,\n        a: props.c,\n        z: props.c,\n        s: props.c,\n        u: props.c,\n        n: props.c,\n        o: null,\n        j: props.x,\n      })\n    ),\n    React.createElement(\"div\", {\n      \"data-x\": props.x,\n    })\n  );\n}\n\nfunction Delta(props) {\n  return React.createElement(\n    React.Fragment,\n    null,\n    React.createElement(\n      \"div\",\n      {},\n      React.createElement(Iota, {\n        d: props.l,\n        w: props.l,\n        u: props.l,\n      }),\n      React.createElement(Mu, {\n        v: props.l,\n        m: props.l,\n      }),\n      React.createElement(Epsilon, {\n        s: 6,\n        c: props.l,\n        r: props.l,\n        q: props.l,\n        e: props.l,\n        g: props.l,\n        o: props.l,\n        h: props.l,\n        x: props.l,\n      })\n    ),\n    React.createElement(Pi, {\n      a: props.l,\n      h: props.l,\n      c: true,\n      z: props.l,\n    }),\n    null\n  );\n}\n\nfunction Iota(props) {\n  return React.createElement(\n    React.Fragment,\n    null,\n    React.createElement(\n      React.Fragment,\n      null,\n      React.createElement(\n        \"div\",\n        {},\n        React.createElement(\n          \"div\",\n          {\n            \"data-w\": props.w,\n            \"data-d\": props.d,\n          },\n          [\n            React.createElement(Pi, {\n              key: \"0\",\n              a: props.d,\n              h: props.u,\n              c: -13,\n              z: props.w,\n            }),\n          ],\n          React.createElement(\"div\", {\n            \"data-d\": props.d,\n          })\n        )\n      )\n    ),\n    React.createElement(\n      \"div\",\n      {\n        \"data-u\": props.u,\n        \"data-w\": props.w,\n        \"data-d\": props.d,\n      },\n      React.createElement(Lambda, {\n        m: props.u,\n        v: props.w,\n        r: props.u,\n      }),\n      React.createElement(Xi, {\n        v: props.u,\n        c: props.d,\n        e: props.d,\n        a: -4,\n        z: props.u,\n        s: props.d,\n        u: props.u,\n        n: props.w,\n        o: props.u,\n        j: props.w,\n      }),\n      React.createElement(Xi, {\n        v: props.d,\n        c: 7,\n        e: props.u,\n        a: null,\n        z: props.u,\n        s: props.u,\n        u: props.u,\n        n: props.d,\n        o: -10,\n        j: props.w,\n      })\n    ),\n    React.createElement(\n      React.Fragment,\n      null,\n      React.createElement(Zeta, {\n        m: props.d,\n        u: props.d,\n        s: props.u,\n      })\n    )\n  );\n}\n\nfunction Lambda(props) {\n  return React.createElement(Theta, {\n    n: props.m,\n    w: props.r,\n    s: props.v,\n    q: props.m,\n    g: props.v,\n    a: props.m,\n    f: props.r,\n  });\n}\n\nfunction Eta(props) {\n  return React.createElement(Theta, {\n    n: props.v,\n    w: props.s,\n    s: props.p,\n    q: props.q,\n    g: props.s,\n    a: null,\n    f: props.p,\n  });\n}\n\nfunction Epsilon(props) {\n  return React.createElement(\n    \"div\",\n    {\n      \"data-x\": props.x,\n      \"data-e\": props.e,\n      \"data-c\": props.c,\n      \"data-s\": props.s,\n      \"data-q\": props.q,\n      \"data-h\": props.h,\n      \"data-g\": props.g,\n      \"data-o\": props.o,\n    },\n    React.createElement(\"div\", {\n      \"data-g\": props.g,\n    }),\n    React.createElement(React.Fragment, null, null),\n    React.createElement(Pi, {\n      a: props.c,\n      h: props.c,\n      c: props.r,\n      z: props.e,\n    })\n  );\n}\n\nfunction Pi(props) {\n  return React.createElement(\n    \"div\",\n    {\n      \"data-a\": props.a,\n      \"data-h\": props.h,\n      \"data-c\": props.c,\n    },\n    React.createElement(\"div\", {\n      \"data-h\": props.h,\n      \"data-z\": props.z,\n      \"data-c\": props.c,\n      \"data-a\": props.a,\n    }),\n    React.createElement(Zeta, {\n      m: props.z,\n      u: props.z,\n      s: props.c,\n    })\n  );\n}\n\nfunction Theta(props) {\n  return React.createElement(React.Fragment, null, null);\n}\n\nfunction Xi(props) {\n  return React.createElement(\n    \"div\",\n    {\n      \"data-j\": props.j,\n      \"data-v\": props.v,\n    },\n    React.createElement(\n      \"div\",\n      {\n        \"data-v\": props.v,\n        \"data-c\": props.c,\n        \"data-e\": props.e,\n        \"data-n\": props.n,\n        \"data-u\": props.u,\n        \"data-s\": props.s,\n        \"data-o\": props.o,\n      },\n      React.createElement(\n        React.Fragment,\n        null,\n        React.createElement(\"div\", {\n          \"data-j\": props.j,\n          \"data-n\": props.n,\n        })\n      )\n    )\n  );\n}\n\nfunction Zeta(props) {\n  return React.createElement(\n    \"div\",\n    {\n      \"data-u\": props.u,\n    },\n    React.createElement(\"div\", {\n      \"data-u\": props.u,\n      \"data-s\": props.s,\n    }),\n    React.createElement(\n      \"div\",\n      {},\n      React.createElement(\n        \"div\",\n        {},\n        React.createElement(Mu, {\n          v: props.s,\n          m: props.s,\n        }),\n        React.createElement(Mu, {\n          v: props.u,\n          m: props.m,\n        }),\n        React.createElement(Mu, {\n          v: props.u,\n          m: props.s,\n        })\n      )\n    ),\n    React.createElement(\n      \"div\",\n      {\n        \"data-m\": props.m,\n        \"data-s\": props.s,\n      },\n      React.createElement(\"div\", {}),\n      React.createElement(\n        \"div\",\n        {},\n        React.createElement(\n          \"div\",\n          {\n            \"data-s\": props.s,\n          },\n          []\n        )\n      )\n    )\n  );\n}\n\nfunction Mu(props) {\n  return React.createElement(\"div\", {}, null, React.createElement(\"div\", {}, null));\n}\n\nif (this.__optimizeReactComponentTree) {\n  __optimizeReactComponentTree(Gamma);\n}\n\nGamma.getTrials = function(renderer, Gamma) {\n  let results = [];\n  renderer.update(<Gamma c={null} x={12} />);\n  results.push([\"render pathological case\", renderer.toJSON()]);\n  return results;\n};\n\nmodule.exports = Gamma;\n"
  },
  {
    "path": "test/react/FunctionalComponents/react-children-map.js",
    "content": "var React = require(\"react\");\n\nfunction Child(props) {\n  return React.Children.map(props.children, function(child) {\n    return <span>{child}</span>;\n  });\n}\n\nfunction App() {\n  return (\n    <div>\n      <Child>{[1, 2, 3]}</Child>\n    </div>\n  );\n}\n\nApp.getTrials = function(renderer, Root) {\n  renderer.update(<Root />);\n  return [[\"simple conditions #3\", renderer.toJSON()]];\n};\n\nif (this.__optimizeReactComponentTree) {\n  __optimizeReactComponentTree(App);\n}\n\nmodule.exports = App;\n"
  },
  {
    "path": "test/react/FunctionalComponents/react-element-havoc.js",
    "content": "var React = require(\"react\");\n\nfunction App(props) {\n  \"use strict\";\n  var b = props.b !== null ? (props.b.x !== null ? props.b.x : null) : null;\n  var x = <div a={1} b={b} c={props.c} />;\n  props.someAbstractFunction(x);\n  return x;\n}\n\nApp.getTrials = function(renderer, Root) {\n  function someAbstractFunction() {\n    // NO-OP\n  }\n  renderer.update(<Root someAbstractFunction={someAbstractFunction} b={null} c={3} />);\n  return [[\"react element havoc\", renderer.toJSON()]];\n};\n\nif (this.__optimizeReactComponentTree) {\n  __optimizeReactComponentTree(App);\n}\n\nmodule.exports = App;\n"
  },
  {
    "path": "test/react/FunctionalComponents/refs-typeof.js",
    "content": "const React = require(\"react\");\n\nfunction Text(props, forwardedRef) {\n  return <div forwardedRef={forwardedRef}>{props.children}</div>;\n}\n\nconst TextForwardRef = React.forwardRef(Text);\n\n// This condition has relevance as it cannot be `function` for the invariant in React Native’s\n// `Animated.createAnimatedComponent`.\n//\n// https://github.com/facebook/react-native/blob/22cf5dc5660f19b16de3592ccae4c42cc16ace69/Libraries/Animated/src/createAnimatedComponent.js#L20-L25\n\nconst type = typeof TextForwardRef;\n\nmodule.exports = {\n  independent: true,\n  getTrials: () => [[\"typeof `React.forwardRef`\", type]],\n};\n"
  },
  {
    "path": "test/react/FunctionalComponents/refs.js",
    "content": "var React = require(\"react\");\n\nfunction Child(props) {\n  return <div ref={props.forwardedRef} />;\n}\n\nconst WrappedComponent = React.forwardRef((props, ref) => {\n  return <Child {...props} forwardedRef={ref} />;\n});\n\nfunction App() {\n  var x = React.createRef();\n\n  return <WrappedComponent ref={x} />;\n}\n\nApp.getTrials = function(renderer, Root) {\n  renderer.update(<Root />);\n  return [[\"simple render with refs\", renderer.toJSON()]];\n};\n\nif (this.__optimizeReactComponentTree) {\n  __optimizeReactComponentTree(App);\n}\n\nmodule.exports = App;\n"
  },
  {
    "path": "test/react/FunctionalComponents/refs2.js",
    "content": "var React = require(\"react\");\n\nfunction Child(props) {\n  return <div ref={props.forwardedRef} />;\n}\n\nconst WrappedComponent = React.forwardRef((props, ref) => {\n  return <Child {...props} forwardedRef={ref} />;\n});\n\nfunction App(props) {\n  return <WrappedComponent ref={props.x} />;\n}\n\nApp.getTrials = function(renderer, Root) {\n  let results = [];\n  var refValue = null;\n  renderer.update(<Root x={val => (refValue = val)} />);\n  results.push([\"simple render with refs\", renderer.toJSON()]);\n  results.push([\"ref node is of div\", refValue.type]);\n  return results;\n};\n\nif (this.__optimizeReactComponentTree) {\n  __optimizeReactComponentTree(App);\n}\n\nmodule.exports = App;\n"
  },
  {
    "path": "test/react/FunctionalComponents/refs3.js",
    "content": "var React = require(\"react\");\n\nclass ClassComponent extends React.Component {\n  constructor() {\n    super();\n    this.state = {};\n  }\n  getValue() {\n    return this.props.value;\n  }\n  render() {\n    return <div />;\n  }\n}\n\nfunction Child(props) {\n  return <ClassComponent ref={props.forwardedRef} value={props.value} />;\n}\n\nconst WrappedComponent = React.forwardRef((props, ref) => {\n  return <Child {...props} forwardedRef={ref} />;\n});\n\nfunction App(props) {\n  return <WrappedComponent {...props} ref={props.x} />;\n}\n\nApp.getTrials = function(renderer, Root) {\n  let results = [];\n  var ref = React.createRef();\n  var value = \"Hello world!!!\";\n  renderer.update(<Root x={ref} value={value} />);\n  results.push([\"simple render with refs\", renderer.toJSON()]);\n  results.push([\"ref node is a method of the class\", ref.current.getValue()]);\n  return results;\n};\n\nif (this.__optimizeReactComponentTree) {\n  __optimizeReactComponentTree(App);\n}\n\nmodule.exports = App;\n"
  },
  {
    "path": "test/react/FunctionalComponents/return-text.js",
    "content": "var React = require(\"react\");\n\nfunction A(props) {\n  return \"Hello, \";\n}\n\nfunction B(props) {\n  return \"world!\";\n}\n\nfunction App() {\n  return [<A key=\"1\" />, <B key=\"2\" />];\n}\n\nApp.getTrials = function(renderer, Root) {\n  renderer.update(<Root />);\n  return [[\"render text\", renderer.toJSON()]];\n};\n\nif (this.__optimizeReactComponentTree) {\n  __optimizeReactComponentTree(App);\n}\n\nmodule.exports = App;\n"
  },
  {
    "path": "test/react/FunctionalComponents/return-undefined.js",
    "content": "var React = require(\"react\");\n\nfunction A() {}\n\nfunction App() {\n  return (\n    <div>\n      <A />\n    </div>\n  );\n}\n\nApp.getTrials = function(renderer, Root) {\n  let didError = false;\n  try {\n    renderer.update(<Root />);\n  } catch (err) {\n    didError = true;\n  }\n  return [[\"error rendering\", didError]];\n};\n\nif (this.__optimizeReactComponentTree) {\n  __optimizeReactComponentTree(App);\n}\n\nmodule.exports = App;\n"
  },
  {
    "path": "test/react/FunctionalComponents/runtime-error.js",
    "content": "var React = require(\"react\");\n\nfunction App() {\n  var x = undefined;\n  x.push();\n}\n\nApp.getTrials = function(renderer, Root) {\n  renderer.update(<Root />);\n  return [[\"runtime error\", renderer.toJSON()]];\n};\n\nif (this.__optimizeReactComponentTree) {\n  __optimizeReactComponentTree(App);\n}\n\nmodule.exports = App;\n"
  },
  {
    "path": "test/react/FunctionalComponents/safe.js",
    "content": "function foo() {\n  var x = 0;\n  function foo2() {\n    x++; // safe\n  }\n  foo2();\n}\nfunction Bar() {\n  foo();\n  return null;\n}\n\nif (this.__optimizeReactComponentTree) {\n  __optimizeReactComponentTree(Bar);\n}\n"
  },
  {
    "path": "test/react/FunctionalComponents/safe2.js",
    "content": "function foo() {\n  var x = 0;\n  function foo2() {\n    function foo3() {\n      x++; // safe\n    }\n    foo3();\n  }\n  foo2();\n}\nfunction Bar() {\n  foo();\n}\n\nif (this.__optimizeReactComponentTree) {\n  __optimizeReactComponentTree(Bar);\n}\n"
  },
  {
    "path": "test/react/FunctionalComponents/safe3.js",
    "content": "function Bar(props) {\n  if (props.arg) return undefined;\n  let f = 42;\n  return f;\n}\n\nif (this.__optimizeReactComponentTree) {\n  __optimizeReactComponentTree(Bar);\n}\n"
  },
  {
    "path": "test/react/FunctionalComponents/simple-10.js",
    "content": "var React = require(\"react\");\n\nlet lazyVariable = null;\n\nfunction A(props) {\n  if (!lazyVariable) {\n    lazyVariable = 123;\n  }\n  return <div>Hello {lazyVariable}</div>;\n}\n\nfunction App() {\n  return (\n    <div>\n      <A />\n    </div>\n  );\n}\n\nfunction App2() {\n  return (\n    <div>\n      <A />\n    </div>\n  );\n}\n\n// keep a reference to the other root that also\n// writes to the same variable\nApp.App2 = App2;\n\nApp.getTrials = function(renderer, Root) {\n  renderer.update(<Root />);\n  return [[\"simple render\", renderer.toJSON()]];\n};\n\nif (this.__optimizeReactComponentTree) {\n  __optimizeReactComponentTree(App);\n  __optimizeReactComponentTree(App2);\n}\n\nmodule.exports = App;\n"
  },
  {
    "path": "test/react/FunctionalComponents/simple-11.js",
    "content": "var React = require(\"react\");\n\nlet lazyVariable = null;\n\nfunction A(props) {\n  if (!lazyVariable) {\n    lazyVariable = 123;\n  }\n  return <div>Hello {lazyVariable}</div>;\n}\n\nfunction App(props) {\n  if (props.x) {\n    throw new Error(\"I am an error\");\n  }\n  return (\n    <div>\n      <A />\n    </div>\n  );\n}\n\nfunction App2(props) {\n  if (props.x) {\n    throw new Error(\"I am an error\");\n  }\n  return (\n    <div>\n      <A />\n    </div>\n  );\n}\n\n// keep a reference to the other root that also\n// writes to the same variable\nApp.App2 = App2;\n\nApp.getTrials = function(renderer, Root) {\n  renderer.update(<Root />);\n  return [[\"simple render\", renderer.toJSON()]];\n};\n\nif (this.__optimizeReactComponentTree) {\n  __optimizeReactComponentTree(App);\n  __optimizeReactComponentTree(App2);\n}\n\nmodule.exports = App;\n"
  },
  {
    "path": "test/react/FunctionalComponents/simple-12.js",
    "content": "var React = require(\"react\");\n\nfunction Author(props) {\n  return props.author.name || \"Unnamed\";\n}\n\nfunction App(props) {\n  var comment = props.comment;\n  var author = comment != null ? comment.author : null;\n  return author ? React.createElement(Author, { author: author }) : \"Unknown\";\n}\n\nApp.getTrials = function(renderer, Root) {\n  let results = [];\n  renderer.update(<Root comment={{ author: { name: \"Jo\" } }} />);\n  results.push([\"full\", renderer.toJSON()]);\n  renderer.update(<Root comment={{ author: {} }} />);\n  results.push([\"no name\", renderer.toJSON()]);\n  renderer.update(<Root comment={{ author: null }} />);\n  results.push([\"no author\", renderer.toJSON()]);\n  renderer.update(<Root comment={null} />);\n  results.push([\"no comment\", renderer.toJSON()]);\n  return results;\n};\n\nif (this.__optimizeReactComponentTree) {\n  __optimizeReactComponentTree(App);\n}\n\nmodule.exports = App;\n"
  },
  {
    "path": "test/react/FunctionalComponents/simple-13.js",
    "content": "var React = require(\"react\");\n\nfunction URI(other) {\n  if (!other) {\n    return;\n  }\n  if (other.foo) {\n    if (other.baz) {\n      throw new Error();\n    }\n    this.bar = other;\n    throw new Error();\n  }\n  throw new Error();\n}\n\nfunction App(props) {\n  var first = new URI(props.initial);\n  return React.createElement(Child, null, function() {\n    new URI(first.bar);\n    return null;\n  });\n}\n\nfunction Child(props) {\n  var children = props.children;\n  return children();\n}\n\nif (this.__optimizeReactComponentTree) __optimizeReactComponentTree(App);\n\nApp.getTrials = function(renderer, Root) {\n  // Just compile, don't run\n  return [];\n};\n\nmodule.exports = App;\n"
  },
  {
    "path": "test/react/FunctionalComponents/simple-14.js",
    "content": "var React = require(\"React\");\n\nfunction App(props) {\n  var items = new Array(10);\n  items[0] = \"div\";\n  return React.createElement(\"div\", null, items);\n}\n\nApp.getTrials = function(renderer, Root) {\n  renderer.update(<Root />);\n  return [[\"hoely children\", renderer.toJSON()]];\n};\n\nif (this.__optimizeReactComponentTree) {\n  __optimizeReactComponentTree(App);\n}\n\nmodule.exports = App;\n"
  },
  {
    "path": "test/react/FunctionalComponents/simple-15.js",
    "content": "var React = require(\"React\");\n\nfunction App(props) {\n  return React.createElement(\"div\", null, [, , , , , , \"div\"]);\n}\n\nApp.getTrials = function(renderer, Root) {\n  renderer.update(<Root />);\n  return [[\"hoely children #2\", renderer.toJSON()]];\n};\n\nif (this.__optimizeReactComponentTree) {\n  __optimizeReactComponentTree(App);\n}\n\nmodule.exports = App;\n"
  },
  {
    "path": "test/react/FunctionalComponents/simple-16.js",
    "content": "var React = require(\"React\");\n\nfunction App(props) {\n  return <div children={\"hi\"}>{undefined}</div>;\n}\n\nApp.getTrials = function(renderer, Root) {\n  renderer.update(<Root />);\n  return [[\"undefined children\", renderer.toJSON()]];\n};\n\nif (this.__optimizeReactComponentTree) {\n  __optimizeReactComponentTree(App);\n}\n\nmodule.exports = App;\n"
  },
  {
    "path": "test/react/FunctionalComponents/simple-17.js",
    "content": "var React = require(\"React\");\n\nfunction App(props) {\n  var externalFunc = props.externalFunc;\n\n  var x = <span a=\"1\" b=\"2\" />;\n  externalFunc(x);\n  externalFunc(x.props);\n  return <div>{x}</div>;\n}\n\nApp.getTrials = function(renderer, Root) {\n  function externalFunc() {\n    // NO-OP\n  }\n  renderer.update(<Root externalFunc={externalFunc} />);\n  return [[\"with havoc functions\", renderer.toJSON()]];\n};\n\nif (this.__optimizeReactComponentTree) {\n  __optimizeReactComponentTree(App);\n}\n\nmodule.exports = App;\n"
  },
  {
    "path": "test/react/FunctionalComponents/simple-18.js",
    "content": "var React = require(\"React\");\n\nfunction App(props) {\n  return (\n    <div>\n      {props.x || <div />}\n      {props.y && <span />}\n    </div>\n  );\n}\n\nApp.getTrials = function(renderer, Root) {\n  let results = [];\n  renderer.update(<Root x={<span />} y={true} />);\n  results.push([\"deals with logical expression 1\", renderer.toJSON()]);\n  renderer.update(<Root x={false} y={true} />);\n  results.push([\"deals with logical expression 2\", renderer.toJSON()]);\n  renderer.update(<Root x={false} y={<div />} />);\n  results.push([\"deals with logical expression 3\", renderer.toJSON()]);\n  return results;\n};\n\nif (this.__optimizeReactComponentTree) {\n  __optimizeReactComponentTree(App);\n}\n\nmodule.exports = App;\n"
  },
  {
    "path": "test/react/FunctionalComponents/simple-19.js",
    "content": "var React = require(\"React\");\n\nfunction Child(props) {\n  var x = Object.assign({}, props, {\n    a: 1,\n    b: 2,\n  });\n  return (\n    <span>\n      {x.a}\n      {x.b}\n      {x.c}\n    </span>\n  );\n}\n\nfunction App(props) {\n  return (\n    <div>\n      {props.x || <Child {...props} />}\n      {props.y && <Child {...props} />}\n    </div>\n  );\n}\n\nApp.getTrials = function(renderer, Root) {\n  let results = [];\n  renderer.update(<Root x={<span />} y={true} c={3} />);\n  results.push([\"deals with logical expression 1\", renderer.toJSON()]);\n  renderer.update(<Root x={false} y={true} c={4} />);\n  results.push([\"deals with logical expression 2\", renderer.toJSON()]);\n  renderer.update(<Root x={false} y={<div />} c={5} />);\n  results.push([\"deals with logical expression 3\", renderer.toJSON()]);\n  return results;\n};\n\nif (this.__optimizeReactComponentTree) {\n  __optimizeReactComponentTree(App);\n}\n\nmodule.exports = App;\n"
  },
  {
    "path": "test/react/FunctionalComponents/simple-2.js",
    "content": "var React = require(\"react\");\n\nfunction A(props) {\n  return <div>Hello {props.x}</div>;\n}\n\nfunction App(props) {\n  return (\n    <div>\n      <A x={props.x.toString()} />\n    </div>\n  );\n}\n\nApp.getTrials = function(renderer, Root) {\n  renderer.update(<Root x={10} />);\n  return [[\"simple render\", renderer.toJSON()]];\n};\n\nif (this.__optimizeReactComponentTree) {\n  __optimizeReactComponentTree(App);\n}\n\nmodule.exports = App;\n"
  },
  {
    "path": "test/react/FunctionalComponents/simple-20.js",
    "content": "var React = require(\"React\");\n\nfunction Child(props) {\n  var x = Object.assign({}, props, {\n    a: 1,\n    b: 2,\n  });\n  return (\n    <span>\n      {x.a}\n      {x.b}\n      {x.c}\n    </span>\n  );\n}\n\nfunction App(props) {\n  var foo = props.x ? props.y : props.z;\n  return (\n    <div>\n      {foo || <Child {...props} />}\n      {foo && <Child {...props} />}\n    </div>\n  );\n}\n\nApp.getTrials = function(renderer, Root) {\n  let results = [];\n  renderer.update(<Root x={true} y={true} z={true} c={3} />);\n  results.push([\"deals with logical expression 1\", renderer.toJSON()]);\n  renderer.update(<Root x={true} y={true} z={false} c={3} />);\n  results.push([\"deals with logical expression 2\", renderer.toJSON()]);\n  renderer.update(<Root x={true} y={false} z={true} c={3} />);\n  results.push([\"deals with logical expression 3\", renderer.toJSON()]);\n  renderer.update(<Root x={false} y={true} z={true} c={3} />);\n  results.push([\"deals with logical expression 4\", renderer.toJSON()]);\n  return results;\n};\n\nif (this.__optimizeReactComponentTree) {\n  __optimizeReactComponentTree(App);\n}\n\nmodule.exports = App;\n"
  },
  {
    "path": "test/react/FunctionalComponents/simple-21.js",
    "content": "var React = require(\"React\");\n\nfunction Child(props) {\n  return <span>{props.x.toString()}</span>;\n}\n\nfunction App(props) {\n  return <div>{props.x !== null && <Child {...props} />}</div>;\n}\n\nApp.getTrials = function(renderer, Root) {\n  let results = [];\n  renderer.update(<Root x={null} />);\n  results.push([\"deals with logical expression 1\", renderer.toJSON()]);\n  renderer.update(<Root x={5} />);\n  results.push([\"deals with logical expression 2\", renderer.toJSON()]);\n  renderer.update(<Root x={\"hello world\"} />);\n  results.push([\"deals with logical expression 3\", renderer.toJSON()]);\n  return results;\n};\n\nif (this.__optimizeReactComponentTree) {\n  __optimizeReactComponentTree(App);\n}\n\nmodule.exports = App;\n"
  },
  {
    "path": "test/react/FunctionalComponents/simple-22.js",
    "content": "var React = require(\"react\");\n\nfunction Child() {\n  return <div>This should be inlined</div>;\n}\n\nfunction Child2() {\n  return <span>This should be inlined too</span>;\n}\n\nfunction App(props) {\n  var a = props.x ? null : <Child2 />;\n  return a && <Child />;\n}\n\nApp.getTrials = function(renderer, Root) {\n  renderer.update(<Root />);\n  return [[\"simple conditions\", renderer.toJSON()]];\n};\n\nif (this.__optimizeReactComponentTree) {\n  __optimizeReactComponentTree(App);\n}\n\nmodule.exports = App;\n"
  },
  {
    "path": "test/react/FunctionalComponents/simple-23.js",
    "content": "var React = require(\"react\");\n\nfunction Child() {\n  return <div>This should be inlined</div>;\n}\n\nfunction App(props) {\n  var a = props.x ? null : function() {};\n  return a && <Child />;\n}\n\nApp.getTrials = function(renderer, Root) {\n  renderer.update(<Root />);\n  return [[\"simple conditions #2\", renderer.toJSON()]];\n};\n\nif (this.__optimizeReactComponentTree) {\n  __optimizeReactComponentTree(App);\n}\n\nmodule.exports = App;\n"
  },
  {
    "path": "test/react/FunctionalComponents/simple-24.js",
    "content": "var React = require(\"react\");\n\nfunction App(props) {\n  if (props.neverHappens) {\n    return <Bad />;\n  }\n  return null;\n}\n\nfunction Bad() {\n  return {}; // Invalid\n}\nApp.getTrials = function(renderer, Root) {\n  renderer.update(<Root />);\n  return [[\"simple conditions #3\", renderer.toJSON()]];\n};\n\nif (this.__optimizeReactComponentTree) {\n  __optimizeReactComponentTree(App);\n}\n\nmodule.exports = App;\n"
  },
  {
    "path": "test/react/FunctionalComponents/simple-25.js",
    "content": "var React = require(\"react\");\n\nfunction Child() {\n  return <div>This should be inlined</div>;\n}\n\nfunction App(props) {\n  var a = props.x ? null : { foo: <Child /> };\n  return a.foo;\n}\n\nApp.getTrials = function(renderer, Root) {\n  renderer.update(<Root />);\n  return [[\"simple conditions #2\", renderer.toJSON()]];\n};\n\nif (this.__optimizeReactComponentTree) {\n  __optimizeReactComponentTree(App);\n}\n\nmodule.exports = App;\n"
  },
  {
    "path": "test/react/FunctionalComponents/simple-26.js",
    "content": "var React = require(\"react\");\n\nfunction App(props) {\n  var arr = [1, 2, 3];\n\n  if (props.cond) {\n    arr.push(4);\n  } else {\n    arr.pop();\n  }\n  return (\n    <div>\n      <span x={arr} />\n      <span x={arr} />\n    </div>\n  );\n}\n\nApp.getTrials = function(renderer, Root) {\n  let results = [];\n  renderer.update(<Root cond={true} />);\n  results.push([\"abstract array length on prop (cond: true)\", renderer.toJSON()]);\n  renderer.update(<Root cond={false} />);\n  results.push([\"abstract array length on prop (cond: false)\", renderer.toJSON()]);\n  return results;\n};\n\nif (this.__optimizeReactComponentTree) {\n  __optimizeReactComponentTree(App);\n}\n\nmodule.exports = App;\n"
  },
  {
    "path": "test/react/FunctionalComponents/simple-27.js",
    "content": "var React = require(\"react\");\n\nfunction App(props) {\n  var arr = [1, 2, 3];\n\n  if (props.cond) {\n    arr.push(4);\n  } else {\n    arr.pop();\n  }\n  return (\n    <div>\n      <span>{arr}</span>\n      <span>{arr}</span>\n    </div>\n  );\n}\n\nApp.getTrials = function(renderer, Root) {\n  let results = [];\n  renderer.update(<Root cond={true} />);\n  results.push([\"abstract array length on prop (cond: true)\", renderer.toJSON()]);\n  renderer.update(<Root cond={false} />);\n  results.push([\"abstract array length on prop (cond: false)\", renderer.toJSON()]);\n  return results;\n};\n\nif (this.__optimizeReactComponentTree) {\n  __optimizeReactComponentTree(App);\n}\n\nmodule.exports = App;\n"
  },
  {
    "path": "test/react/FunctionalComponents/simple-28.js",
    "content": "var React = require(\"react\");\n\nfunction App(props) {\n  var arr = [1, 2, 3];\n\n  if (props.cond) {\n    arr.push(4);\n  } else {\n    arr.pop();\n  }\n  arr.reverse();\n  return (\n    <div>\n      <span>{arr[0]}</span>\n      <span>{arr[1]}</span>\n      <span>{arr[2]}</span>\n    </div>\n  );\n}\n\nApp.getTrials = function(renderer, Root) {\n  let results = [];\n  renderer.update(<Root cond={true} />);\n  results.push([\"abstract array length on prop (cond: true)\", renderer.toJSON()]);\n  renderer.update(<Root cond={false} />);\n  results.push([\"abstract array length on prop (cond: false)\", renderer.toJSON()]);\n  return results;\n};\n\nif (this.__optimizeReactComponentTree) {\n  __optimizeReactComponentTree(App);\n}\n\nmodule.exports = App;\n"
  },
  {
    "path": "test/react/FunctionalComponents/simple-29.js",
    "content": "var React = require(\"react\");\n\nfunction App(props) {\n  var arr = [1, 2, 3];\n\n  if (props.cond) {\n    arr.push(4);\n  } else {\n    arr.pop();\n  }\n  var arr1 = Array.from(arr);\n  arr1.reverse();\n  var arr2 = Array.from(arr).join(\", \");\n  var arr3 = Array.from(arr).map(x => x);\n  return (\n    <div>\n      <span>{arr1}</span>\n      <span>{arr2}</span>\n      <span>{arr3}</span>\n    </div>\n  );\n}\n\nApp.getTrials = function(renderer, Root) {\n  let results = [];\n  renderer.update(<Root cond={true} />);\n  results.push([\"abstract array length on prop (cond: true)\", renderer.toJSON()]);\n  renderer.update(<Root cond={false} />);\n  results.push([\"abstract array length on prop (cond: false)\", renderer.toJSON()]);\n  return results;\n};\n\nif (this.__optimizeReactComponentTree) {\n  __optimizeReactComponentTree(App);\n}\n\nmodule.exports = App;\n"
  },
  {
    "path": "test/react/FunctionalComponents/simple-3.js",
    "content": "var React = require(\"react\");\n\nfunction A(props) {\n  return <div>Hello {props.x}</div>;\n}\n\nfunction App(props) {\n  return (\n    <div>\n      <A x={props.toString()} />\n    </div>\n  );\n}\n\nApp.getTrials = function(renderer, Root) {\n  renderer.update(<Root x={10} />);\n  return [[\"simple render\", renderer.toJSON()]];\n};\n\nif (this.__optimizeReactComponentTree) {\n  __optimizeReactComponentTree(App);\n}\n\nmodule.exports = App;\n"
  },
  {
    "path": "test/react/FunctionalComponents/simple-4.js",
    "content": "var React = require(\"react\");\n\nclass Child extends React.Component {\n  constructor(props) {\n    super(props);\n    this.state = {\n      title: \"It works!\",\n    };\n  }\n  render() {\n    return <div>{this.state.title}</div>;\n  }\n}\n\nfunction App() {\n  return <Child />;\n}\n\nApp.getTrials = function(renderer, Root) {\n  renderer.update(<Root />);\n  return [[\"simple render 4\", renderer.toJSON()]];\n};\n\nif (this.__optimizeReactComponentTree) {\n  __optimizeReactComponentTree(App);\n}\n\nmodule.exports = App;\n"
  },
  {
    "path": "test/react/FunctionalComponents/simple-5.js",
    "content": "var React = require(\"react\");\n\nclass Child extends React.Component {\n  constructor() {\n    super();\n    this.state = {\n      id: 5,\n    };\n  }\n  render() {\n    return <span>{this.state.id}</span>;\n  }\n}\n\nfunction App() {\n  return (\n    <div>\n      <Child />\n    </div>\n  );\n}\n\nApp.getTrials = function(renderer, Root) {\n  renderer.update(<Root />);\n  return [[\"simple render\", renderer.toJSON()]];\n};\n\nif (this.__optimizeReactComponentTree) {\n  __optimizeReactComponentTree(App);\n}\n\nif (this.__optimizeReactComponentTree) {\n  __optimizeReactComponentTree(Child);\n}\n\nmodule.exports = App;\n"
  },
  {
    "path": "test/react/FunctionalComponents/simple-6.js",
    "content": "var React = require(\"react\");\n\nfunction App(props) {\n  return <div>{String(props.title)}</div>;\n}\n\nApp.getTrials = function(renderer, Root) {\n  renderer.update(<Root />);\n  return [[\"simple render\", renderer.toJSON()]];\n};\n\nif (this.__optimizeReactComponentTree) {\n  __optimizeReactComponentTree(App);\n}\n\nmodule.exports = App;\n"
  },
  {
    "path": "test/react/FunctionalComponents/simple-7.js",
    "content": "var React = require(\"react\");\n\nfunction App(_ref) {\n  return <div>{String(_ref.title)}</div>;\n}\n\nApp.getTrials = function(renderer, Root) {\n  renderer.update(<Root />);\n  return [[\"simple render\", renderer.toJSON()]];\n};\n\nif (this.__optimizeReactComponentTree) {\n  __optimizeReactComponentTree(App);\n}\n\nmodule.exports = App;\n"
  },
  {
    "path": "test/react/FunctionalComponents/simple-8.js",
    "content": "var React = require(\"react\");\n\nlet lazyVariable = null;\n\nfunction A(props) {\n  if (!lazyVariable) {\n    lazyVariable = 123;\n  }\n  return <div>Hello {lazyVariable}</div>;\n}\n\nfunction App() {\n  return (\n    <div>\n      <A />\n      <A />\n      <A />\n    </div>\n  );\n}\n\nApp.getTrials = function(renderer, Root) {\n  renderer.update(<Root />);\n  return [[\"simple render\", renderer.toJSON()]];\n};\n\nif (this.__optimizeReactComponentTree) {\n  __optimizeReactComponentTree(App);\n}\n\nmodule.exports = App;\n"
  },
  {
    "path": "test/react/FunctionalComponents/simple-9.js",
    "content": "var React = require(\"react\");\n\nlet lazyVariable = null;\n\nfunction A(props) {\n  if (!lazyVariable) {\n    lazyVariable = props.x;\n  }\n  return <div>Hello {lazyVariable}</div>;\n}\n\nfunction App(props) {\n  return (\n    <div>\n      <A {...props} />\n      <A {...props} />\n      <A {...props} />\n    </div>\n  );\n}\n\nApp.getTrials = function(renderer, Root) {\n  renderer.update(<Root />);\n  return [[\"simple render\", renderer.toJSON()]];\n};\n\nif (this.__optimizeReactComponentTree) {\n  __optimizeReactComponentTree(App);\n}\n\nmodule.exports = App;\n"
  },
  {
    "path": "test/react/FunctionalComponents/simple-children.js",
    "content": "var React = require(\"react\");\n\nfunction A(props) {\n  return props.children;\n}\n\nfunction App(props) {\n  return (\n    <A>\n      <A>Hi</A>\n    </A>\n  );\n}\n\nApp.getTrials = function(renderer, Root) {\n  renderer.update(<Root />);\n  return [[\"simple children\", renderer.toJSON()]];\n};\n\nif (this.__optimizeReactComponentTree) {\n  __optimizeReactComponentTree(App);\n}\n\nmodule.exports = App;\n"
  },
  {
    "path": "test/react/FunctionalComponents/simple-fragments.js",
    "content": "var React = require(\"react\");\n\nfunction A(props) {\n  return <div>Hello {props.x}</div>;\n}\n\nfunction B() {\n  return <div>World</div>;\n}\n\nfunction C() {\n  return \"!\";\n}\n\nfunction App() {\n  return (\n    <React.Fragment>\n      <A x={42} />\n      <B />\n      <C />\n    </React.Fragment>\n  );\n}\n\nApp.getTrials = function(renderer, Root) {\n  renderer.update(<Root />);\n  return [[\"simple fragments render\", renderer.toJSON()]];\n};\n\nif (this.__optimizeReactComponentTree) {\n  __optimizeReactComponentTree(App);\n}\n\nmodule.exports = App;\n"
  },
  {
    "path": "test/react/FunctionalComponents/simple-refs.js",
    "content": "var React = require(\"react\");\n\nlet refB = false;\n\nfunction A(foo) {\n  return (\n    <div>\n      <span className=\"findMe\" ref={foo.rootRef} />,\n      <span ref={() => (refB = true)} />,\n    </div>\n  );\n}\n\nfunction App({ rootRef }) {\n  return (\n    <div>\n      <A rootRef={rootRef} />\n    </div>\n  );\n}\n\nApp.getTrials = function(renderer, Root) {\n  let refA = false;\n  let rootRef = () => {\n    refA = true;\n  };\n  renderer.update(<Root rootRef={rootRef} />);\n  let results = [];\n  results.push([\"simple refs\", renderer.toJSON()]);\n  results.push([\"ref A\", refA]);\n  results.push([\"ref B\", refB]);\n  return results;\n};\n\nif (this.__optimizeReactComponentTree) {\n  __optimizeReactComponentTree(App);\n}\n\nmodule.exports = App;\n"
  },
  {
    "path": "test/react/FunctionalComponents/simple-with-abstract-props.js",
    "content": "var React = require(\"react\");\n\nfunction IWantThisToBeInlined(props) {\n  return <div>{props.text}</div>;\n}\n\nfunction Button(props) {\n  return <IWantThisToBeInlined {...props} />;\n}\n\nfunction App(props) {\n  return <Button {...props} />;\n}\n\nApp.getTrials = function(renderer, Root) {\n  renderer.update(<Root text={\"Hello world\"} />);\n  return [[\"simple render\", renderer.toJSON()]];\n};\n\nif (this.__optimizeReactComponentTree) {\n  __optimizeReactComponentTree(App);\n}\n\nmodule.exports = App;\n"
  },
  {
    "path": "test/react/FunctionalComponents/simple-with-new-expression.js",
    "content": "const React = require(\"react\");\n\nif (!this.__evaluatePureFunction) {\n  this.__evaluatePureFunction = function(f) {\n    return f();\n  };\n}\n\nmodule.exports = __evaluatePureFunction(() => {\n  var URI = require(\"URI\");\n\n  function App(props) {\n    var _ref, _ref2;\n    var _props = props;\n    var className = _props.className;\n    var text = _props.text;\n    var feedback = _props.feedback;\n    var trackingInfo = _props.trackingInfo;\n\n    var url = (_ref2 = feedback) != null ? _ref2.url : _ref2;\n\n    var href = new URI(url).addQueryData({ comment_tracking: trackingInfo }).makeString();\n\n    return (\n      <a href={href} className={className}>\n        {text}\n      </a>\n    );\n  }\n\n  App.getTrials = function(renderer, Root) {\n    renderer.update(\n      <Root className=\"link-class\" title=\"Click me!\" feedback={{ url: \"http://fb.com\" }} trackingInfo={null} />\n    );\n    return [[\"simple render with new expression\", renderer.toJSON()]];\n  };\n\n  if (this.__optimizeReactComponentTree) {\n    __optimizeReactComponentTree(App);\n  }\n\n  return App;\n});\n"
  },
  {
    "path": "test/react/FunctionalComponents/simple-with-unary.js",
    "content": "var React = require(\"react\");\n\nfunction Child({ targetNumCommentsToDisplay, pageSize, offset }) {\n  return <span>{~targetNumCommentsToDisplay + +pageSize + -offset}</span>;\n}\n\nfunction App(props) {\n  return (\n    <div>\n      <Child {...props} />\n    </div>\n  );\n}\n\nApp.getTrials = function(renderer, Root) {\n  let results = [];\n  renderer.update(<Root targetNumCommentsToDisplay={1} pageSize={2} offset={3} />);\n  results.push([\"simple render\", renderer.toJSON()]);\n  renderer.update(<Root targetNumCommentsToDisplay={3} pageSize={2} offset={1} />);\n  results.push([\"update render\", renderer.toJSON()]);\n  return results;\n};\n\nif (this.__optimizeReactComponentTree) {\n  __optimizeReactComponentTree(App);\n}\n\nmodule.exports = App;\n"
  },
  {
    "path": "test/react/FunctionalComponents/simple.js",
    "content": "var React = require(\"react\");\n\nfunction A(props) {\n  return <div>Hello {props.x}</div>;\n}\n\nfunction B() {\n  return <div>World</div>;\n}\n\nfunction C() {\n  return \"!\";\n}\n\nfunction App() {\n  return (\n    <div>\n      <A x={42} />\n      <B />\n      <C />\n    </div>\n  );\n}\n\nApp.getTrials = function(renderer, Root) {\n  renderer.update(<Root />);\n  return [[\"simple render\", renderer.toJSON()]];\n};\n\nif (this.__optimizeReactComponentTree) {\n  __optimizeReactComponentTree(App);\n}\n\nmodule.exports = App;\n"
  },
  {
    "path": "test/react/FunctionalComponents/two-roots.js",
    "content": "function A(props) {\n  return props.toString();\n}\n\nfunction B(props) {\n  return props.toString();\n}\n\nif (this.__optimizeReactComponentTree) {\n  __optimizeReactComponentTree(A);\n  __optimizeReactComponentTree(B);\n}\n\nthis.A = A;\nthis.B = B;\n"
  },
  {
    "path": "test/react/FunctionalComponents-test.js",
    "content": "/**\n * Copyright (c) 2017-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n/* @flow */\n\nconst React = require(\"react\");\nconst setupReactTests = require(\"./setupReactTests\");\nconst { runTest } = setupReactTests();\n\n/* eslint-disable no-undef */\nconst { expect, it } = global;\n\nit(\"Simple\", () => {\n  runTest(__dirname + \"/FunctionalComponents/simple.js\");\n});\n\nit(\"Simple 2\", () => {\n  runTest(__dirname + \"/FunctionalComponents/simple-2.js\");\n});\n\nit(\"Simple 3\", () => {\n  runTest(__dirname + \"/FunctionalComponents/simple-3.js\");\n});\n\nit(\"Simple 4\", () => {\n  runTest(__dirname + \"/FunctionalComponents/simple-4.js\");\n});\n\nit(\"Simple 5\", () => {\n  runTest(__dirname + \"/FunctionalComponents/simple-5.js\");\n});\n\nit(\"Simple 6\", () => {\n  runTest(__dirname + \"/FunctionalComponents/simple-6.js\");\n});\n\nit(\"Simple 7\", () => {\n  runTest(__dirname + \"/FunctionalComponents/simple-7.js\");\n});\n\nit(\"Simple 8\", () => {\n  runTest(__dirname + \"/FunctionalComponents/simple-8.js\", {\n    expectReconcilerError: true,\n  });\n});\n\nit(\"Simple 9\", () => {\n  runTest(__dirname + \"/FunctionalComponents/simple-9.js\", {\n    expectReconcilerError: true,\n  });\n});\n\nit(\"Simple 10\", () => {\n  runTest(__dirname + \"/FunctionalComponents/simple-10.js\", {\n    expectReconcilerError: true,\n  });\n});\n\nit(\"Simple 11\", () => {\n  runTest(__dirname + \"/FunctionalComponents/simple-11.js\", {\n    expectReconcilerError: true,\n  });\n});\n\nit(\"Simple 12\", () => {\n  runTest(__dirname + \"/FunctionalComponents/simple-12.js\");\n});\n\nit(\"Runtime error\", () => {\n  runTest(__dirname + \"/FunctionalComponents/runtime-error.js\", {\n    expectRuntimeError: true,\n  });\n});\n\nit(\"Simple 13\", () => {\n  runTest(__dirname + \"/FunctionalComponents/simple-13.js\", {\n    expectReconcilerError: true,\n  });\n});\n\nit(\"Simple 14\", () => {\n  runTest(__dirname + \"/FunctionalComponents/simple-14.js\");\n});\n\nit(\"Simple 15\", () => {\n  runTest(__dirname + \"/FunctionalComponents/simple-15.js\");\n});\n\nit(\"Simple 16\", () => {\n  runTest(__dirname + \"/FunctionalComponents/simple-16.js\");\n});\n\nit(\"Simple 17\", () => {\n  runTest(__dirname + \"/FunctionalComponents/simple-17.js\");\n});\n\nit(\"Simple 18\", () => {\n  runTest(__dirname + \"/FunctionalComponents/simple-18.js\");\n});\n\nit(\"Simple 19\", () => {\n  runTest(__dirname + \"/FunctionalComponents/simple-19.js\");\n});\n\nit(\"Simple 20\", () => {\n  runTest(__dirname + \"/FunctionalComponents/simple-20.js\");\n});\n\nit(\"Simple 21\", () => {\n  runTest(__dirname + \"/FunctionalComponents/simple-21.js\");\n});\n\nit(\"Simple 22\", () => {\n  runTest(__dirname + \"/FunctionalComponents/simple-22.js\");\n});\n\nit(\"Simple 23\", () => {\n  runTest(__dirname + \"/FunctionalComponents/simple-23.js\");\n});\n\nit(\"Simple 24\", () => {\n  runTest(__dirname + \"/FunctionalComponents/simple-24.js\");\n});\n\nit(\"Simple 25\", () => {\n  runTest(__dirname + \"/FunctionalComponents/simple-25.js\");\n});\n\nit(\"Simple 26\", () => {\n  runTest(__dirname + \"/FunctionalComponents/simple-26.js\");\n});\n\nit(\"Simple 27\", () => {\n  runTest(__dirname + \"/FunctionalComponents/simple-27.js\");\n});\n\nit(\"Simple 28\", () => {\n  runTest(__dirname + \"/FunctionalComponents/simple-28.js\");\n});\n\nit(\"Simple 29\", () => {\n  runTest(__dirname + \"/FunctionalComponents/simple-29.js\");\n});\n\nit(\"Bound type\", () => {\n  runTest(__dirname + \"/FunctionalComponents/bound-type.js\");\n});\n\nit(\"Bound type 2\", () => {\n  runTest(__dirname + \"/FunctionalComponents/bound-type2.js\");\n});\n\nit(\"React.Children.map\", () => {\n  runTest(__dirname + \"/FunctionalComponents/react-children-map.js\");\n});\n\nit(\"Two roots\", () => {\n  runTest(__dirname + \"/FunctionalComponents/two-roots.js\");\n});\n\nit(\"Havocing of ReactElements should not result in property assignments\", () => {\n  runTest(__dirname + \"/FunctionalComponents/react-element-havoc.js\");\n});\n\nit(\"__reactCompilerDoNotOptimize\", () => {\n  runTest(__dirname + \"/FunctionalComponents/do-not-optimize.js\");\n});\n\nit(\"Mutations - not-safe 1\", () => {\n  runTest(__dirname + \"/FunctionalComponents/not-safe.js\", {\n    expectReconcilerError: true,\n  });\n});\n\nit(\"Mutations - not-safe 2\", () => {\n  runTest(__dirname + \"/FunctionalComponents/not-safe2.js\", {\n    expectReconcilerError: true,\n  });\n});\n\nit(\"Mutations - safe 1\", () => {\n  runTest(__dirname + \"/FunctionalComponents/safe.js\");\n});\n\nit(\"Mutations - safe 2\", () => {\n  runTest(__dirname + \"/FunctionalComponents/safe2.js\");\n});\n\nit(\"Mutations - safe 3\", () => {\n  runTest(__dirname + \"/FunctionalComponents/safe3.js\");\n});\n\nit(\"Handle mapped arrays\", () => {\n  runTest(__dirname + \"/FunctionalComponents/array-map.js\");\n});\n\nit(\"Handle mapped arrays 2\", () => {\n  runTest(__dirname + \"/FunctionalComponents/array-map2.js\");\n});\n\nit(\"Handle mapped arrays 3\", () => {\n  runTest(__dirname + \"/FunctionalComponents/array-map3.js\");\n});\n\nit(\"Handle mapped arrays from Array.from\", () => {\n  runTest(__dirname + \"/FunctionalComponents/array-from.js\");\n});\n\nit(\"Simple fragments\", () => {\n  runTest(__dirname + \"/FunctionalComponents/simple-fragments.js\");\n});\n\nit(\"Simple children\", () => {\n  runTest(__dirname + \"/FunctionalComponents/simple-children.js\");\n});\n\nit(\"Simple with new expression\", () => {\n  runTest(__dirname + \"/FunctionalComponents/simple-with-new-expression.js\");\n});\n\nit(\"Simple refs\", () => {\n  runTest(__dirname + \"/FunctionalComponents/simple-refs.js\");\n});\n\nit(\"16.3 refs\", () => {\n  runTest(__dirname + \"/FunctionalComponents/refs.js\");\n});\n\nit(\"16.3 refs 2\", () => {\n  runTest(__dirname + \"/FunctionalComponents/refs2.js\");\n});\n\nit(\"16.3 refs 3\", () => {\n  runTest(__dirname + \"/FunctionalComponents/refs3.js\");\n});\n\nit(\"refs typeof\", () => {\n  runTest(__dirname + \"/FunctionalComponents/refs-typeof.js\");\n});\n\nit(\"defaultProps\", () => {\n  runTest(__dirname + \"/FunctionalComponents/default-props.js\");\n});\n\nit(\"defaultProps 2\", () => {\n  runTest(__dirname + \"/FunctionalComponents/default-props2.js\");\n});\n\nit(\"Simple with abstract props\", () => {\n  runTest(__dirname + \"/FunctionalComponents/simple-with-abstract-props.js\");\n});\n\nit(\"Simple with unary expressions\", () => {\n  runTest(__dirname + \"/FunctionalComponents/simple-with-unary.js\");\n});\n\nit(\"Circular reference\", () => {\n  runTest(__dirname + \"/FunctionalComponents/circular-reference.js\");\n});\n\nit(\"Conditional\", () => {\n  runTest(__dirname + \"/FunctionalComponents/conditional.js\");\n});\n\nit(\"Equivalence\", () => {\n  runTest(__dirname + \"/FunctionalComponents/equivalence.js\", {\n    expectedCreateElementCalls: /* original */ 20 + /* prepacked: many deduplicated */ 8,\n  });\n});\n\nit(\"Delete element prop key\", () => {\n  runTest(__dirname + \"/FunctionalComponents/delete-element-prop-key.js\");\n});\n\nit(\"Dynamic props\", () => {\n  runTest(__dirname + \"/FunctionalComponents/dynamic-props.js\");\n});\n\nit(\"Dynamic context\", () => {\n  runTest(__dirname + \"/FunctionalComponents/dynamic-context.js\");\n});\n\nit(\"React.cloneElement\", () => {\n  runTest(__dirname + \"/FunctionalComponents/clone-element.js\");\n});\n\nit(\"React.cloneElement 2\", () => {\n  runTest(__dirname + \"/FunctionalComponents/clone-element2.js\");\n});\n\nit(\"Return text\", () => {\n  runTest(__dirname + \"/FunctionalComponents/return-text.js\");\n});\n\nit(\"Render array twice\", () => {\n  runTest(__dirname + \"/FunctionalComponents/array-twice.js\");\n});\n\nit(\"Render nested array children\", () => {\n  runTest(__dirname + \"/FunctionalComponents/nested-array-children.js\");\n});\n\nit(\"Return undefined\", () => {\n  runTest(__dirname + \"/FunctionalComponents/return-undefined.js\");\n});\n\nit(\"Null or undefined props\", () => {\n  runTest(__dirname + \"/FunctionalComponents/null-or-undefined-props.js\");\n});\n\nit(\"Event handlers\", () => {\n  runTest(__dirname + \"/FunctionalComponents/event-handlers.js\");\n});\n\nit(\"Class component as root\", () => {\n  runTest(__dirname + \"/FunctionalComponents/class-root.js\");\n});\n\nit(\"Class component as root with multiple render methods\", () => {\n  runTest(__dirname + \"/FunctionalComponents/class-root-with-render-methods.js\");\n});\n\nit(\"Class component as root with props\", () => {\n  runTest(__dirname + \"/FunctionalComponents/class-root-with-props.js\");\n});\n\nit(\"Class component as root with state\", () => {\n  runTest(__dirname + \"/FunctionalComponents/class-root-with-state.js\");\n});\n\nit(\"Class component as root with refs\", () => {\n  runTest(__dirname + \"/FunctionalComponents/class-root-with-refs.js\");\n});\n\nit(\"Class component as root with instance variables\", () => {\n  runTest(__dirname + \"/FunctionalComponents/class-root-with-instance-vars.js\");\n});\n\nit(\"Class component as root with instance variables #2\", () => {\n  runTest(__dirname + \"/FunctionalComponents/class-root-with-instance-vars-2.js\");\n});\n\nit(\"Additional functions closure scope capturing\", () => {\n  runTest(__dirname + \"/FunctionalComponents/additional-function-regression.js\");\n});\n\nit(\"Dynamic ReactElement type\", () => {\n  runTest(__dirname + \"/FunctionalComponents/dynamic-type.js\");\n});\n\nit(\"Dynamic ReactElement type #2\", () => {\n  runTest(__dirname + \"/FunctionalComponents/dynamic-type2.js\");\n});\n\nit(\"Dynamic ReactElement type #3\", () => {\n  runTest(__dirname + \"/FunctionalComponents/dynamic-type3.js\");\n});\n\nit(\"Dynamic ReactElement type #4\", () => {\n  runTest(__dirname + \"/FunctionalComponents/dynamic-type4.js\");\n});\n\nit(\"Hoist Fragment\", () => {\n  runTest(__dirname + \"/FunctionalComponents/hoist-fragment.js\");\n});\n\nit(\"Pathological case\", () => {\n  runTest(__dirname + \"/FunctionalComponents/pathological-case.js\");\n});\n\nit(\"Model props\", () => {\n  runTest(__dirname + \"/FunctionalComponents/model-props.js\");\n});\n\nit(\"Inline keys\", () => {\n  runTest(__dirname + \"/FunctionalComponents/keyed.js\");\n});\n\nit(\"Inline unnecessary keys\", () => {\n  runTest(__dirname + \"/FunctionalComponents/keyed-unnecessarily.js\");\n});\n\nit(\"Inline key on component that does not return element\", () => {\n  runTest(__dirname + \"/FunctionalComponents/keyed-non-element.js\");\n});\n"
  },
  {
    "path": "test/react/ReactDOM/create-portal.js",
    "content": "var React = require(\"react\");\nvar ReactDOM = require(\"react-dom\");\n\nvar b = document.createElement(\"div\");\n\nfunction Foo() {\n  return <span>Inlined</span>;\n}\n\nfunction Child(props) {\n  var x = ReactDOM.createPortal(<Foo />, b);\n  return <div>{x}</div>;\n}\n\nfunction App(props) {\n  return <Child />;\n}\n\nApp.getTrials = function(renderer, Root) {\n  var a = document.createElement(\"div\");\n  ReactDOM.render(<Root />, a);\n  var results = [];\n  results.push([\"render props A\", a.innerHTML]);\n  results.push([\"render props B\", b.innerHTML]);\n  return results;\n};\n\nif (this.__optimizeReactComponentTree) {\n  __optimizeReactComponentTree(App);\n}\n\nmodule.exports = App;\n"
  },
  {
    "path": "test/react/ReactDOM-test.js",
    "content": "/**\n * Copyright (c) 2017-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n/* @flow */\n\nconst setupReactTests = require(\"./setupReactTests\");\nconst { runTest } = setupReactTests();\n\n/* eslint-disable no-undef */\nconst { it } = global;\n\nit(\"createPortal\", () => {\n  runTest(__dirname + \"/ReactDOM/create-portal.js\");\n});\n"
  },
  {
    "path": "test/react/ReactNative/simple.js",
    "content": "var React = require(\"React\");\nvar { StyleSheet, Text, View } = require(\"ReactNative\");\n\nconst styles = StyleSheet.create({\n  container: {\n    alignItems: \"center\",\n    backgroundColor: \"#F5FCFF\",\n    flex: 1,\n    justifyContent: \"center\",\n  },\n  instructions: {\n    color: \"#333333\",\n    marginBottom: 5,\n    textAlign: \"center\",\n  },\n  welcome: {\n    fontSize: 20,\n    margin: 10,\n    textAlign: \"center\",\n  },\n});\n\nclass App extends React.Component {\n  render() {\n    return (\n      <View style={styles.container}>\n        <Text style={styles.welcome}>Welcome to React Native!</Text>\n        <Text style={styles.instructions}>This is a React Native test.</Text>\n      </View>\n    );\n  }\n}\n\nApp.getTrials = function(renderer, Root) {\n  renderer.update(<Root />);\n  return [[\"render simple\", renderer.toJSON()]];\n};\n\nif (this.__optimizeReactComponentTree) {\n  __optimizeReactComponentTree(App, {\n    isRoot: true,\n  });\n}\n\nmodule.exports = App;\n"
  },
  {
    "path": "test/react/ReactNative/simple2.js",
    "content": "var React = require(\"React\");\nvar { StyleSheet, Text, View } = require(\"ReactNative\");\n\nconst styles = StyleSheet.create({\n  container: {\n    alignItems: \"center\",\n    backgroundColor: \"#F5FCFF\",\n    flex: 1,\n    justifyContent: \"center\",\n  },\n  instructions: {\n    color: \"#333333\",\n    marginBottom: 5,\n    textAlign: \"center\",\n  },\n  welcome: {\n    fontSize: 20,\n    margin: 10,\n    textAlign: \"center\",\n  },\n});\n\nclass App extends React.Component {\n  render() {\n    return (\n      <View style={styles.container}>\n        <Text style={styles.welcome}>Welcome to React Native!</Text>\n        <Text style={styles.instructions}>\n          <Text>Foo</Text>\n          This is a React Native test.\n        </Text>\n      </View>\n    );\n  }\n}\n\nApp.getTrials = function(renderer, Root) {\n  renderer.update(<Root />);\n  return [[\"render simple\", renderer.toJSON()]];\n};\n\nif (this.__optimizeReactComponentTree) {\n  __optimizeReactComponentTree(App, {\n    isRoot: true,\n  });\n}\n\nmodule.exports = App;\n"
  },
  {
    "path": "test/react/ReactNative-test.js",
    "content": "/**\n * Copyright (c) 2017-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n/* @flow */\n\nconst setupReactTests = require(\"./setupReactTests\");\nconst { runTest } = setupReactTests();\n\n// $FlowFixMe: Jest is already defined globally\njest.unmock(\"../../node_modules/react-native/Libraries/Components/View/View.js\");\n// $FlowFixMe: Jest is already defined globally\njest.unmock(\"../../node_modules/react-native/Libraries/Text/Text.js\");\n\n/* eslint-disable no-undef */\nconst { it } = global;\n\nit(\"Simple\", async () => {\n  runTest(__dirname + \"/ReactNative/simple.js\");\n});\n\nit(\"Simple 2\", async () => {\n  runTest(__dirname + \"/ReactNative/simple2.js\");\n});\n"
  },
  {
    "path": "test/react/Reconciliation/key-change-fragments.js",
    "content": "var React = require(\"react\");\n\n// we can't use ES2015 classes in Prepack yet (they don't serialize)\n// so we have to use ES5 instead\nvar Stateful = (function(superclass) {\n  function Stateful() {\n    superclass.apply(this, arguments);\n    this.state = { updated: false };\n  }\n\n  if (superclass) {\n    Stateful.__proto__ = superclass;\n  }\n  Stateful.prototype = Object.create(superclass && superclass.prototype);\n  Stateful.prototype.constructor = Stateful;\n  Stateful.prototype.componentWillReceiveProps = function componentWillReceiveProps() {\n    this.setState({ updated: true });\n  };\n  Stateful.prototype.render = function render() {\n    return (\n      <div>\n        {this.props.children}\n        (is update: {String(this.state.updated)})\n      </div>\n    );\n  };\n\n  return Stateful;\n})(React.Component);\n\nfunction App(props) {\n  if (props.switch) {\n    return (\n      <React.Fragment>\n        <Stateful key=\"hi\" x={props.x}>\n          Hi\n        </Stateful>\n      </React.Fragment>\n    );\n  }\n  return [\n    <Stateful key=\"bye\" x={props.x}>\n      Bye\n    </Stateful>,\n  ];\n}\n\nApp.getTrials = function(renderer, Root) {\n  let results = [];\n  renderer.update(<Root switch={false} />);\n  results.push([\"mount\", renderer.toJSON()]);\n\n  renderer.update(<Root switch={false} />);\n  results.push([\"update with same key\", renderer.toJSON()]);\n\n  renderer.update(<Root switch={true} />);\n  results.push([\"update with different key\", renderer.toJSON()]);\n\n  renderer.update(<Root switch={true} />);\n  results.push([\"update with same key (again)\", renderer.toJSON()]);\n\n  renderer.update(<Root switch={false} />);\n  results.push([\"update with different key (again)\", renderer.toJSON()]);\n  return results;\n};\n\nif (this.__optimizeReactComponentTree) {\n  __optimizeReactComponentTree(App);\n}\n\nmodule.exports = App;\n"
  },
  {
    "path": "test/react/Reconciliation/key-change.js",
    "content": "var React = require(\"react\");\n\n// we can't use ES2015 classes in Prepack yet (they don't serialize)\n// so we have to use ES5 instead\nvar Stateful = (function(superclass) {\n  function Stateful() {\n    superclass.apply(this, arguments);\n    this.state = { updated: false };\n  }\n\n  if (superclass) {\n    Stateful.__proto__ = superclass;\n  }\n  Stateful.prototype = Object.create(superclass && superclass.prototype);\n  Stateful.prototype.constructor = Stateful;\n  Stateful.prototype.componentWillReceiveProps = function componentWillReceiveProps() {\n    this.setState({ updated: true });\n  };\n  Stateful.prototype.render = function render() {\n    return (\n      <div>\n        {this.props.children}\n        (is update: {String(this.state.updated)})\n      </div>\n    );\n  };\n\n  return Stateful;\n})(React.Component);\n\nfunction App(props) {\n  if (props.switch) {\n    return (\n      <div>\n        <Stateful key=\"hi\" x={props.x}>\n          Hi\n        </Stateful>\n      </div>\n    );\n  }\n  return (\n    <div>\n      <Stateful key=\"bye\" x={props.x}>\n        Bye\n      </Stateful>\n    </div>\n  );\n}\n\nApp.getTrials = function(renderer, Root) {\n  let results = [];\n  renderer.update(<Root switch={false} />);\n  results.push([\"mount\", renderer.toJSON()]);\n\n  renderer.update(<Root switch={false} />);\n  results.push([\"update with same key\", renderer.toJSON()]);\n\n  renderer.update(<Root switch={true} />);\n  results.push([\"update with different key\", renderer.toJSON()]);\n\n  renderer.update(<Root switch={true} />);\n  results.push([\"update with same key (again)\", renderer.toJSON()]);\n\n  renderer.update(<Root switch={false} />);\n  results.push([\"update with different key (again)\", renderer.toJSON()]);\n  return results;\n};\n\nif (this.__optimizeReactComponentTree) {\n  __optimizeReactComponentTree(App);\n}\n\nmodule.exports = App;\n"
  },
  {
    "path": "test/react/Reconciliation/key-nesting-2.js",
    "content": "var React = require(\"react\");\n\nfunction Child() {\n  return [<span key=\"a\" />, <span key=\"b\" />];\n}\n\nfunction App() {\n  return (\n    <div>\n      <span />\n      <Child />\n      <Child />\n      <span />\n    </div>\n  );\n}\n\nApp.getTrials = function(renderer, Root) {\n  renderer.update(<Root />);\n  return [[\"key nesting 2\", renderer.toJSON()]];\n};\n\nif (this.__optimizeReactComponentTree) {\n  __optimizeReactComponentTree(App);\n}\n\nmodule.exports = App;\n"
  },
  {
    "path": "test/react/Reconciliation/key-nesting-3.js",
    "content": "var React = require(\"react\");\n\nfunction Child() {\n  var x = [];\n\n  for (let i = 0; i < 10; i++) {\n    x.push(<span key={i} />);\n  }\n  return x;\n}\n\nfunction App() {\n  return (\n    <div>\n      <span />\n      <Child />\n      <Child />\n      <span />\n    </div>\n  );\n}\n\nApp.getTrials = function(renderer, Root) {\n  renderer.update(<Root />);\n  return [[\"key nesting 3\", renderer.toJSON()]];\n};\n\nif (this.__optimizeReactComponentTree) {\n  __optimizeReactComponentTree(App);\n}\n\nmodule.exports = App;\n"
  },
  {
    "path": "test/react/Reconciliation/key-nesting-4.js",
    "content": "var React = require(\"react\");\n\nfunction Foo(props) {\n  return [<div ref={props.callback} key=\"0\" />];\n}\n\nfunction Bar(props) {\n  return [<div ref={props.callback} key=\"0\" />];\n}\n\nfunction App(props) {\n  return props.foo ? <Foo {...props} /> : <Bar {...props} />;\n}\n\nif (this.__optimizeReactComponentTree) {\n  __optimizeReactComponentTree(App);\n}\n\nApp.getTrials = function(renderer, Root) {\n  let counter = 0;\n  let nodes = [];\n  function callback(node) {\n    nodes.push(node);\n    counter++;\n  }\n  renderer.update(<Root callback={callback} foo={true} />);\n  renderer.update(<Root callback={callback} foo={true} />);\n  renderer.update(<Root callback={callback} foo={false} />);\n  renderer.update(<Root callback={callback} foo={false} />);\n  renderer.update(<Root callback={callback} foo={true} />);\n  renderer.update(<Root callback={callback} foo={true} />);\n  let results = [];\n  results.push([\"ensure ref is called on every change\", counter]);\n  results.push([\"ensure refs are cleared\", nodes.map(Boolean)]);\n  results.push([\"ensure refs are different\", new Set(nodes).size]);\n  return results;\n};\n\nmodule.exports = App;\n"
  },
  {
    "path": "test/react/Reconciliation/key-nesting-5.js",
    "content": "var React = require(\"react\");\n\nfunction Foo(props) {\n  return [<div ref={props.callback} key=\"0\" />];\n}\n\nfunction Bar(props) {\n  return <div ref={props.callback} key=\"0\" />;\n}\n\nfunction App(props) {\n  return props.foo ? <Foo {...props} /> : <Bar {...props} />;\n}\n\nif (this.__optimizeReactComponentTree) {\n  __optimizeReactComponentTree(App);\n}\n\nApp.getTrials = function(renderer, Root) {\n  let counter = 0;\n  let nodes = [];\n  function callback(node) {\n    nodes.push(node);\n    counter++;\n  }\n  renderer.update(<Root callback={callback} foo={true} />);\n  renderer.update(<Root callback={callback} foo={true} />);\n  renderer.update(<Root callback={callback} foo={false} />);\n  renderer.update(<Root callback={callback} foo={false} />);\n  renderer.update(<Root callback={callback} foo={true} />);\n  renderer.update(<Root callback={callback} foo={true} />);\n  let results = [];\n  results.push([\"ensure ref is called on every change\", counter]);\n  results.push([\"ensure refs are cleared\", nodes.map(Boolean)]);\n  results.push([\"ensure refs are different\", new Set(nodes).size]);\n  return results;\n};\n\nmodule.exports = App;\n"
  },
  {
    "path": "test/react/Reconciliation/key-nesting-6.js",
    "content": "var React = require(\"react\");\n\nfunction Foo(props) {\n  return [[<div ref={props.callback} key=\"0\" />]];\n}\n\nfunction Bar(props) {\n  return [[<div ref={props.callback} key=\"0\" />]];\n}\n\nfunction App(props) {\n  return props.foo ? <Foo {...props} /> : <Bar {...props} />;\n}\n\nif (this.__optimizeReactComponentTree) {\n  __optimizeReactComponentTree(App);\n}\n\nApp.getTrials = function(renderer, Root) {\n  let counter = 0;\n  let nodes = [];\n  function callback(node) {\n    nodes.push(node);\n    counter++;\n  }\n  renderer.update(<Root callback={callback} foo={true} />);\n  renderer.update(<Root callback={callback} foo={true} />);\n  renderer.update(<Root callback={callback} foo={false} />);\n  renderer.update(<Root callback={callback} foo={false} />);\n  renderer.update(<Root callback={callback} foo={true} />);\n  renderer.update(<Root callback={callback} foo={true} />);\n  let results = [];\n  results.push([\"ensure ref is called on every change\", counter]);\n  results.push([\"ensure refs are cleared\", nodes.map(Boolean)]);\n  results.push([\"ensure refs are different\", new Set(nodes).size]);\n  return results;\n};\n\nmodule.exports = App;\n"
  },
  {
    "path": "test/react/Reconciliation/key-nesting-7.js",
    "content": "var React = require(\"react\");\n\nfunction Foo(props) {\n  return [[<div ref={props.callback} key=\"0\" />]];\n}\n\nfunction Bar(props) {\n  return [<div ref={props.callback} key=\"0\" />];\n}\n\nfunction App(props) {\n  return props.foo ? <Foo {...props} /> : <Bar {...props} />;\n}\n\nif (this.__optimizeReactComponentTree) {\n  __optimizeReactComponentTree(App);\n}\n\nApp.getTrials = function(renderer, Root) {\n  let counter = 0;\n  let nodes = [];\n  function callback(node) {\n    nodes.push(node);\n    counter++;\n  }\n  renderer.update(<Root callback={callback} foo={true} />);\n  renderer.update(<Root callback={callback} foo={true} />);\n  renderer.update(<Root callback={callback} foo={false} />);\n  renderer.update(<Root callback={callback} foo={false} />);\n  renderer.update(<Root callback={callback} foo={true} />);\n  renderer.update(<Root callback={callback} foo={true} />);\n  let results = [];\n  results.push([\"ensure ref is called on every change\", counter]);\n  results.push([\"ensure refs are cleared\", nodes.map(Boolean)]);\n  results.push([\"ensure refs are different\", new Set(nodes).size]);\n  return results;\n};\n\nmodule.exports = App;\n"
  },
  {
    "path": "test/react/Reconciliation/key-nesting-8.js",
    "content": "var React = require(\"react\");\n\nfunction Foo(props) {\n  return [<div ref={props.callback} key=\"0\" />];\n}\n\nfunction Bar(props) {\n  return props.bar ? [<div ref={props.callback} key=\"0\" />] : [<div ref={props.callback} key=\"0\" />];\n}\n\nfunction App(props) {\n  return props.foo ? <Foo {...props} /> : <Bar {...props} />;\n}\n\nif (this.__optimizeReactComponentTree) {\n  __optimizeReactComponentTree(App);\n}\n\nApp.getTrials = function(renderer, Root) {\n  let counter = 0;\n  let nodes = [];\n  function callback(node) {\n    nodes.push(node);\n    counter++;\n  }\n  renderer.update(<Root callback={callback} foo={true} />);\n  renderer.update(<Root callback={callback} foo={true} />);\n  renderer.update(<Root callback={callback} foo={false} />);\n  renderer.update(<Root callback={callback} foo={false} />);\n  renderer.update(<Root callback={callback} foo={true} />);\n  renderer.update(<Root callback={callback} foo={true} />);\n  let results = [];\n  results.push([\"ensure ref is called on every change\", counter]);\n  results.push([\"ensure refs are cleared\", nodes.map(Boolean)]);\n  results.push([\"ensure refs are different\", new Set(nodes).size]);\n  return results;\n};\n\nmodule.exports = App;\n"
  },
  {
    "path": "test/react/Reconciliation/key-nesting-9.js",
    "content": "var React = require(\"react\");\n\nfunction Foo(props) {\n  return [<div ref={props.deepProperty.callback} key=\"0\" />];\n}\n\nfunction Bar(props) {\n  return [<div ref={props.deepProperty.callback} key=\"0\" />];\n}\n\nfunction App(props) {\n  return props.foo ? <Foo {...props} /> : <Bar {...props} />;\n}\n\nif (this.__optimizeReactComponentTree) {\n  __optimizeReactComponentTree(App);\n}\n\nApp.getTrials = function(renderer, Root) {\n  let counter = 0;\n  let nodes = [];\n  function callback(node) {\n    nodes.push(node);\n    counter++;\n  }\n  renderer.update(<Root deepProperty={{ callback: callback }} foo={true} />);\n  renderer.update(<Root deepProperty={{ callback: callback }} foo={true} />);\n  renderer.update(<Root deepProperty={{ callback: callback }} foo={false} />);\n  renderer.update(<Root deepProperty={{ callback: callback }} foo={false} />);\n  renderer.update(<Root deepProperty={{ callback: callback }} foo={true} />);\n  renderer.update(<Root deepProperty={{ callback: callback }} foo={true} />);\n  let results = [];\n  results.push([\"ensure ref is called on every change\", counter]);\n  results.push([\"ensure refs are cleared\", nodes.map(Boolean)]);\n  results.push([\"ensure refs are different\", new Set(nodes).size]);\n  return results;\n};\n\nmodule.exports = App;\n"
  },
  {
    "path": "test/react/Reconciliation/key-nesting.js",
    "content": "var React = require(\"react\");\n\n// we can't use ES2015 classes in Prepack yet (they don't serialize)\n// so we have to use ES5 instead\nvar Stateful = (function(superclass) {\n  function Stateful() {\n    superclass.apply(this, arguments);\n    this.state = { updated: false };\n  }\n\n  if (superclass) {\n    Stateful.__proto__ = superclass;\n  }\n  Stateful.prototype = Object.create(superclass && superclass.prototype);\n  Stateful.prototype.constructor = Stateful;\n  Stateful.prototype.componentWillReceiveProps = function componentWillReceiveProps() {\n    this.setState({ updated: true });\n  };\n  Stateful.prototype.render = function render() {\n    return <div>(is update: {String(this.state.updated)})</div>;\n  };\n\n  return Stateful;\n})(React.Component);\n\nfunction MessagePane(props) {\n  return (\n    <div key=\"ha\">\n      <Stateful x={props.x} />\n    </div>\n  );\n}\n\nfunction SettingsPane(props) {\n  return (\n    <div key=\"ha\">\n      <Stateful x={props.x} />\n    </div>\n  );\n}\n\nfunction App(props) {\n  if (props.switch) {\n    return (\n      <div>\n        <MessagePane x={props.x} />\n      </div>\n    );\n  }\n  return (\n    <div>\n      <SettingsPane x={props.x} />\n    </div>\n  );\n}\n\nApp.getTrials = function(renderer, Root) {\n  let results = [];\n  renderer.update(<Root switch={false} />);\n  results.push([\"mount\", renderer.toJSON()]);\n\n  renderer.update(<Root switch={false} />);\n  results.push([\"update with same type\", renderer.toJSON()]);\n\n  renderer.update(<Root switch={true} />);\n  results.push([\"update with different type\", renderer.toJSON()]);\n\n  renderer.update(<Root switch={true} />);\n  results.push([\"update with same type (again)\", renderer.toJSON()]);\n\n  renderer.update(<Root switch={false} />);\n  results.push([\"update with different type (again)\", renderer.toJSON()]);\n  return results;\n};\n\nif (this.__optimizeReactComponentTree) {\n  __optimizeReactComponentTree(App);\n}\n\nmodule.exports = App;\n"
  },
  {
    "path": "test/react/Reconciliation/key-not-change-fragments.js",
    "content": "var React = require(\"react\");\n\n// we can't use ES2015 classes in Prepack yet (they don't serialize)\n// so we have to use ES5 instead\nvar Stateful = (function(superclass) {\n  function Stateful() {\n    superclass.apply(this, arguments);\n    this.state = { updated: false };\n  }\n\n  if (superclass) {\n    Stateful.__proto__ = superclass;\n  }\n  Stateful.prototype = Object.create(superclass && superclass.prototype);\n  Stateful.prototype.constructor = Stateful;\n  Stateful.prototype.componentWillReceiveProps = function componentWillReceiveProps() {\n    this.setState({ updated: true });\n  };\n  Stateful.prototype.render = function render() {\n    return (\n      <div>\n        {this.props.children}\n        (is update: {String(this.state.updated)})\n      </div>\n    );\n  };\n\n  return Stateful;\n})(React.Component);\n\nfunction App(props) {\n  if (props.switch) {\n    return (\n      <React.Fragment>\n        <Stateful key=\"hi\" x={props.x}>\n          Hi\n        </Stateful>\n      </React.Fragment>\n    );\n  }\n  return [\n    <Stateful key=\"hi\" x={props.x}>\n      Bye\n    </Stateful>,\n  ];\n}\n\nApp.getTrials = function(renderer, Root) {\n  let results = [];\n  renderer.update(<Root switch={false} />);\n  results.push([\"mount\", renderer.toJSON()]);\n\n  renderer.update(<Root switch={false} />);\n  results.push([\"update with same array\", renderer.toJSON()]);\n\n  renderer.update(<Root switch={true} />);\n  results.push([\"update with different fragment\", renderer.toJSON()]);\n\n  renderer.update(<Root switch={true} />);\n  results.push([\"update with same fragment (again)\", renderer.toJSON()]);\n\n  renderer.update(<Root switch={false} />);\n  results.push([\"update with different array (again)\", renderer.toJSON()]);\n  return results;\n};\n\nif (this.__optimizeReactComponentTree) {\n  __optimizeReactComponentTree(App);\n}\n\nmodule.exports = App;\n"
  },
  {
    "path": "test/react/Reconciliation/lazy-branched-elements.js",
    "content": "var React = require(\"React\");\n\nfunction App(props) {\n  return props.x ? <span a={props.a} /> : <div a={props.a} />;\n}\n\nApp.getTrials = function(renderer, Root) {\n  let results = [];\n  renderer.update(<Root x={true} a=\"1\" />);\n  results.push([\"lazy branched elements output\", renderer.toJSON()]);\n  renderer.update(<Root x={false} a=\"1\" />);\n  results.push([\"lazy branched elements output\", renderer.toJSON()]);\n  return results;\n};\n\nif (this.__optimizeReactComponentTree) {\n  __optimizeReactComponentTree(App);\n}\n\nmodule.exports = App;\n"
  },
  {
    "path": "test/react/Reconciliation/lazy-branched-elements2.js",
    "content": "var React = require(\"React\");\n\nfunction Button(props) {\n  return props.x ? <span a={props.a} /> : <div a={props.a} />;\n}\n\nfunction App(props) {\n  return props.foo ? <Button {...props} /> : <div />;\n}\n\nApp.getTrials = function(renderer, Root) {\n  let results = [];\n  renderer.update(<Root x={true} a=\"1\" />);\n  results.push([\"lazy branched elements output\", renderer.toJSON()]);\n  renderer.update(<Root x={false} a=\"1\" />);\n  results.push([\"lazy branched elements output\", renderer.toJSON()]);\n  return results;\n};\n\nif (this.__optimizeReactComponentTree) {\n  __optimizeReactComponentTree(App);\n}\n\nmodule.exports = App;\n"
  },
  {
    "path": "test/react/Reconciliation/type-change.js",
    "content": "var React = require(\"react\");\n\n// we can't use ES2015 classes in Prepack yet (they don't serialize)\n// so we have to use ES5 instead\nvar Stateful = (function(superclass) {\n  function Stateful() {\n    superclass.apply(this, arguments);\n    this.state = { updated: false };\n  }\n\n  if (superclass) {\n    Stateful.__proto__ = superclass;\n  }\n  Stateful.prototype = Object.create(superclass && superclass.prototype);\n  Stateful.prototype.constructor = Stateful;\n  Stateful.prototype.componentWillReceiveProps = function componentWillReceiveProps() {\n    this.setState({ updated: true });\n  };\n  Stateful.prototype.render = function render() {\n    return (\n      <div>\n        {this.props.children}\n        (is update: {String(this.state.updated)})\n      </div>\n    );\n  };\n\n  return Stateful;\n})(React.Component);\n\nfunction MessagePane(props) {\n  return <Stateful x={props.x}>Hi</Stateful>;\n}\n\nfunction SettingsPane(props) {\n  return <Stateful x={props.x}>Bye</Stateful>;\n}\n\nfunction App(props) {\n  if (props.switch) {\n    return (\n      <div>\n        <MessagePane x={props.x} />\n      </div>\n    );\n  }\n  return (\n    <div>\n      <SettingsPane x={props.x} />\n    </div>\n  );\n}\n\nApp.getTrials = function(renderer, Root) {\n  renderer.update(<Root switch={false} />);\n  let results = [];\n  results.push([\"mount\", renderer.toJSON()]);\n  renderer.update(<Root switch={false} />);\n\n  results.push([\"update with same type\", renderer.toJSON()]);\n\n  renderer.update(<Root switch={true} />);\n  results.push([\"update with different type\", renderer.toJSON()]);\n\n  renderer.update(<Root switch={true} />);\n  results.push([\"update with same type (again)\", renderer.toJSON()]);\n\n  renderer.update(<Root switch={false} />);\n  results.push([\"update with different type (again)\", renderer.toJSON()]);\n  return results;\n};\n\nif (this.__optimizeReactComponentTree) {\n  __optimizeReactComponentTree(App);\n}\n\nmodule.exports = App;\n"
  },
  {
    "path": "test/react/Reconciliation/type-change10.js",
    "content": "var React = require(\"react\");\n\nfunction App(props) {\n  if (props.foo) {\n    return (\n      <div>\n        <Foo callback={props.callback} x={props.x} />\n      </div>\n    );\n  }\n  return (\n    <div>\n      <Bar callback={props.callback} x={props.x} />\n    </div>\n  );\n}\n\nfunction Foo(props) {\n  return props.x ? <input ref={props.callback} /> : <input ref={props.callback} />;\n}\n\nfunction Bar(props) {\n  return props.x ? <input ref={props.callback} /> : <input ref={props.callback} />;\n}\n\nif (this.__optimizeReactComponentTree) {\n  __optimizeReactComponentTree(App);\n}\n\nApp.getTrials = function(renderer, Root) {\n  let counter = 0;\n  let nodes = [];\n  function callback(node) {\n    nodes.push(node);\n    counter++;\n  }\n  renderer.update(<Root callback={callback} foo={true} x={true} />);\n  renderer.update(<Root callback={callback} foo={true} x={false} />);\n  renderer.update(<Root callback={callback} foo={false} x={false} />);\n  renderer.update(<Root callback={callback} foo={false} x={true} />);\n\n  let results = [];\n  results.push([\"ensure refs was called 3 times\", counter]);\n  results.push([\"ensure refs at 0 is not null\", nodes[0] !== null]);\n  return results;\n};\n\nmodule.exports = App;\n"
  },
  {
    "path": "test/react/Reconciliation/type-change11.js",
    "content": "var React = require(\"react\");\n\nfunction App(props) {\n  if (props.foo) {\n    return (\n      <div>\n        <Foo callback={props.callback} x={props.x} />\n      </div>\n    );\n  }\n  return (\n    <div>\n      <Bar callback={props.callback} x={props.x} />\n    </div>\n  );\n}\n\nfunction Foo(props) {\n  return props.x || <input ref={props.callback} />;\n}\n\nfunction Bar(props) {\n  return props.x && <input ref={props.callback} />;\n}\n\nif (this.__optimizeReactComponentTree) {\n  __optimizeReactComponentTree(App);\n}\n\nApp.getTrials = function(renderer, Root) {\n  let counter = 0;\n  let nodes = [];\n  function callback(node) {\n    nodes.push(node);\n    counter++;\n  }\n  renderer.update(<Root callback={callback} foo={true} x={true} />);\n  renderer.update(<Root callback={callback} foo={true} x={false} />);\n  renderer.update(<Root callback={callback} foo={false} x={false} />);\n  renderer.update(<Root callback={callback} foo={false} x={true} />);\n\n  let results = [];\n  results.push([\"ensure refs was called 3 times\", counter]);\n  results.push([\"ensure refs at 0 is not null\", nodes[0] !== null]);\n  return results;\n};\n\nmodule.exports = App;\n"
  },
  {
    "path": "test/react/Reconciliation/type-change2.js",
    "content": "var React = require(\"react\");\n\nfunction App(props) {\n  if (props.foo) {\n    return <Foo callback={props.callback} />;\n  }\n  return <Bar callback={props.callback} />;\n}\n\nfunction Foo(props) {\n  return <input ref={props.callback} />;\n}\n\nfunction Bar(props) {\n  return <input ref={props.callback} />;\n}\n\nif (this.__optimizeReactComponentTree) {\n  __optimizeReactComponentTree(App);\n}\n\nApp.getTrials = function(renderer, Root) {\n  let counter = 0;\n  let nodes = [];\n  function callback(node) {\n    nodes.push(node);\n    counter++;\n  }\n  renderer.update(<Root callback={callback} foo={true} />);\n  renderer.update(<Root callback={callback} foo={false} />);\n\n  let results = [];\n  results.push([\"ensure refs was called 3 times\", counter]);\n  results.push([\"ensure refs at 0 is not null\", nodes[0] !== null]);\n  results.push([\"ensure refs at 1 is null\", nodes[1] === null]);\n  results.push([\"ensure refs at 2 is not null\", nodes[2] !== null]);\n  results.push([\"ensure refs at 2 is not null\", nodes[0] !== nodes[2]]);\n  return results;\n};\n\nmodule.exports = App;\n"
  },
  {
    "path": "test/react/Reconciliation/type-change3.js",
    "content": "var React = require(\"react\");\n\nfunction App(props) {\n  if (props.foo) {\n    return <Foo callback={props.callback} />;\n  }\n  return <Foo callback={props.callback} />;\n}\n\nfunction Foo(props) {\n  return <input ref={props.callback} />;\n}\n\nif (this.__optimizeReactComponentTree) {\n  __optimizeReactComponentTree(App);\n}\n\nApp.getTrials = function(renderer, Root) {\n  let counter = 0;\n  let nodes = [];\n  function callback(node) {\n    nodes.push(node);\n    counter++;\n  }\n  renderer.update(<Root callback={callback} foo={true} />);\n  renderer.update(<Root callback={callback} foo={false} />);\n\n  let results = [];\n  results.push([\"ensure refs was called 3 times\", counter]);\n  results.push([\"ensure refs at 0 is not null\", nodes[0] !== null]);\n  return results;\n};\n\nmodule.exports = App;\n"
  },
  {
    "path": "test/react/Reconciliation/type-change4.js",
    "content": "var React = require(\"react\");\n\nfunction App(props) {\n  if (props.foo) {\n    return (\n      <div>\n        <Foo callback={props.callback} />\n        <Foo callback={props.callback} />\n      </div>\n    );\n  }\n  return (\n    <div>\n      <Foo callback={props.callback} />\n      <Foo callback={props.callback} />\n    </div>\n  );\n}\n\nfunction Foo(props) {\n  return <input ref={props.callback} />;\n}\n\nif (this.__optimizeReactComponentTree) {\n  __optimizeReactComponentTree(App);\n}\n\nApp.getTrials = function(renderer, Root) {\n  let counter = 0;\n  let nodes = [];\n  function callback(node) {\n    nodes.push(node);\n    counter++;\n  }\n  renderer.update(<Root callback={callback} foo={true} />);\n  renderer.update(<Root callback={callback} foo={false} />);\n\n  let results = [];\n  results.push([\"ensure refs was called 3 times\", counter]);\n  results.push([\"ensure refs at 0 is not null\", nodes[0] !== null]);\n  return results;\n};\n\nmodule.exports = App;\n"
  },
  {
    "path": "test/react/Reconciliation/type-change5.js",
    "content": "var React = require(\"react\");\n\nfunction App(props) {\n  if (props.foo) {\n    return (\n      <div>\n        <Foo callback={props.callback} />\n        <Foo callback={props.callback} />\n      </div>\n    );\n  }\n  return (\n    <div>\n      <Bar callback={props.callback} />\n      <Bar callback={props.callback} />\n    </div>\n  );\n}\n\nfunction Foo(props) {\n  return <input ref={props.callback} />;\n}\n\nfunction Bar(props) {\n  return <input ref={props.callback} />;\n}\n\nif (this.__optimizeReactComponentTree) {\n  __optimizeReactComponentTree(App);\n}\n\nApp.getTrials = function(renderer, Root) {\n  let counter = 0;\n  let nodes = [];\n  function callback(node) {\n    nodes.push(node);\n    counter++;\n  }\n  renderer.update(<Root callback={callback} foo={true} />);\n  renderer.update(<Root callback={callback} foo={false} />);\n\n  let results = [];\n  results.push([\"ensure refs was called 6 times\", counter]);\n  return results;\n};\n\nmodule.exports = App;\n"
  },
  {
    "path": "test/react/Reconciliation/type-change6.js",
    "content": "var React = require(\"react\");\n\nfunction App(props) {\n  if (props.foo) {\n    return (\n      <div>\n        {null}\n        <Foo callback={props.callback} />\n      </div>\n    );\n  }\n  return (\n    <div>\n      {null}\n      <Foo callback={props.callback} />\n    </div>\n  );\n}\n\nfunction Foo(props) {\n  return <input ref={props.callback} />;\n}\n\nif (this.__optimizeReactComponentTree) {\n  __optimizeReactComponentTree(App);\n}\n\nApp.getTrials = function(renderer, Root) {\n  let counter = 0;\n  let nodes = [];\n  function callback(node) {\n    nodes.push(node);\n    counter++;\n  }\n  renderer.update(<Root callback={callback} foo={true} />);\n  renderer.update(<Root callback={callback} foo={false} />);\n\n  let results = [];\n  results.push([\"ensure refs was called 1 time\", counter]);\n  return results;\n};\n\nmodule.exports = App;\n"
  },
  {
    "path": "test/react/Reconciliation/type-change7.js",
    "content": "var React = require(\"react\");\n\nfunction App(props) {\n  if (props.foo) {\n    return <div>{[<Foo callback={props.callback} />]}</div>;\n  }\n  return (\n    <div>\n      <Foo callback={props.callback} />\n    </div>\n  );\n}\n\nfunction Foo(props) {\n  return <input ref={props.callback} />;\n}\n\nif (this.__optimizeReactComponentTree) {\n  __optimizeReactComponentTree(App);\n}\n\nApp.getTrials = function(renderer, Root) {\n  let counter = 0;\n  let nodes = [];\n  function callback(node) {\n    nodes.push(node);\n    counter++;\n  }\n  renderer.update(<Root callback={callback} foo={true} />);\n  renderer.update(<Root callback={callback} foo={false} />);\n\n  let results = [];\n  results.push([\"ensure refs was called 1 time\", counter]);\n  return results;\n};\n\nmodule.exports = App;\n"
  },
  {
    "path": "test/react/Reconciliation/type-change8.js",
    "content": "var React = require(\"react\");\n\nfunction App(props) {\n  if (props.foo) {\n    return <div>{[<Bar callback={props.callback} />]}</div>;\n  }\n  return (\n    <div>\n      <Foo callback={props.callback} />\n    </div>\n  );\n}\n\nfunction Foo(props) {\n  return <input ref={props.callback} />;\n}\n\nfunction Bar(props) {\n  return <input ref={props.callback} />;\n}\n\nif (this.__optimizeReactComponentTree) {\n  __optimizeReactComponentTree(App);\n}\n\nApp.getTrials = function(renderer, Root) {\n  let counter = 0;\n  let nodes = [];\n  function callback(node) {\n    nodes.push(node);\n    counter++;\n  }\n  renderer.update(<Root callback={callback} foo={true} />);\n  renderer.update(<Root callback={callback} foo={false} />);\n\n  let results = [];\n  results.push([\"ensure refs was called 3 times\", counter === 3]);\n  results.push([\"ensure refs at 0 is not null\", nodes[0] !== null]);\n  results.push([\"ensure refs at 1 is null\", nodes[1] === null]);\n  results.push([\"ensure refs at 2 is not null\", nodes[2] !== null]);\n  results.push([\"ensure refs at 2 is not null\", nodes[0] !== nodes[2]]);\n  return results;\n};\n\nmodule.exports = App;\n"
  },
  {
    "path": "test/react/Reconciliation/type-change9.js",
    "content": "var React = require(\"react\");\n\nfunction App(props) {\n  if (props.foo) {\n    return (\n      <div>\n        <Foo callback={props.callback} x={props.x} />\n      </div>\n    );\n  }\n  return (\n    <div>\n      <Foo callback={props.callback} x={props.x} />\n    </div>\n  );\n}\n\nfunction Foo(props) {\n  return props.x ? <input ref={props.callback} /> : <input ref={props.callback} />;\n}\n\nif (this.__optimizeReactComponentTree) {\n  __optimizeReactComponentTree(App);\n}\n\nApp.getTrials = function(renderer, Root) {\n  let counter = 0;\n  let nodes = [];\n  function callback(node) {\n    nodes.push(node);\n    counter++;\n  }\n  renderer.update(<Root callback={callback} foo={true} x={true} />);\n  renderer.update(<Root callback={callback} foo={true} x={false} />);\n  renderer.update(<Root callback={callback} foo={false} x={false} />);\n  renderer.update(<Root callback={callback} foo={false} x={true} />);\n\n  let results = [];\n  results.push([\"ensure refs was called 3 times\", counter]);\n  results.push([\"ensure refs at 0 is not null\", nodes[0] !== null]);\n  return results;\n};\n\nmodule.exports = App;\n"
  },
  {
    "path": "test/react/Reconciliation/type-same.js",
    "content": "var React = require(\"react\");\n\nfunction Foo() {\n  return <div>123</div>;\n}\n\nfunction App(props) {\n  return <div>{props.yar ? <Foo arg={1} /> : <Foo arg={2} />}</div>;\n}\n\nApp.getTrials = function(renderer, Root) {\n  renderer.update(<Root />);\n  let childKey = renderer.toTree().rendered.props.children.key;\n  return [[\"no added keys to child components\", childKey]];\n};\n\nif (this.__optimizeReactComponentTree) {\n  __optimizeReactComponentTree(App);\n}\n\nmodule.exports = App;\n"
  },
  {
    "path": "test/react/Reconciliation-test.js",
    "content": "/**\n * Copyright (c) 2017-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n/* @flow */\n\nconst React = require(\"react\");\nconst setupReactTests = require(\"./setupReactTests\");\nconst { runTest } = setupReactTests();\n\n/* eslint-disable no-undef */\nconst { expect, it } = global;\n\nit(\"Key nesting\", () => {\n  runTest(__dirname + \"/Reconciliation/key-nesting.js\");\n});\n\nit(\"Key nesting 2\", () => {\n  runTest(__dirname + \"/Reconciliation/key-nesting-2.js\");\n});\n\nit(\"Key nesting 3\", () => {\n  runTest(__dirname + \"/Reconciliation/key-nesting-3.js\");\n});\n\nit(\"Key nesting 4\", () => {\n  runTest(__dirname + \"/Reconciliation/key-nesting-4.js\");\n});\n\nit(\"Key nesting 5\", () => {\n  runTest(__dirname + \"/Reconciliation/key-nesting-5.js\");\n});\n\nit(\"Key nesting 6\", () => {\n  runTest(__dirname + \"/Reconciliation/key-nesting-6.js\");\n});\n\nit(\"Key nesting 7\", () => {\n  runTest(__dirname + \"/Reconciliation/key-nesting-7.js\");\n});\n\nit(\"Key nesting 8\", () => {\n  runTest(__dirname + \"/Reconciliation/key-nesting-8.js\");\n});\n\nit(\"Key nesting 9\", () => {\n  runTest(__dirname + \"/Reconciliation/key-nesting-9.js\", {\n    expectedCreateElementCalls:\n      /* original 3 reactElements for 6 test cases */ 18 +\n      /* prepacked: one removed by inlining, but we have 6 test cases */ 12,\n  });\n});\n\nit(\"Key change\", () => {\n  runTest(__dirname + \"/Reconciliation/key-change.js\");\n});\n\nit(\"Key change with fragments\", () => {\n  runTest(__dirname + \"/Reconciliation/key-change-fragments.js\");\n});\n\nit(\"Key not changing with fragments\", () => {\n  runTest(__dirname + \"/Reconciliation/key-not-change-fragments.js\");\n});\n\nit(\"Component type change\", () => {\n  runTest(__dirname + \"/Reconciliation/type-change.js\");\n});\n\nit(\"Component type change 2\", () => {\n  runTest(__dirname + \"/Reconciliation/type-change2.js\");\n});\n\nit(\"Component type change 3\", () => {\n  runTest(__dirname + \"/Reconciliation/type-change3.js\");\n});\n\nit(\"Component type change 4\", () => {\n  runTest(__dirname + \"/Reconciliation/type-change4.js\");\n});\n\nit(\"Component type change 5\", () => {\n  runTest(__dirname + \"/Reconciliation/type-change5.js\");\n});\n\nit(\"Component type change 6\", () => {\n  runTest(__dirname + \"/Reconciliation/type-change6.js\");\n});\n\nit(\"Component type change 7\", () => {\n  runTest(__dirname + \"/Reconciliation/type-change7.js\");\n});\n\nit(\"Component type change 8\", () => {\n  runTest(__dirname + \"/Reconciliation/type-change8.js\");\n});\n\nit(\"Component type change 9\", () => {\n  runTest(__dirname + \"/Reconciliation/type-change9.js\");\n});\n\nit(\"Component type change 10\", () => {\n  runTest(__dirname + \"/Reconciliation/type-change10.js\");\n});\n\nit(\"Component type change 11\", () => {\n  runTest(__dirname + \"/Reconciliation/type-change11.js\");\n});\n\nit(\"Component type same\", () => {\n  runTest(__dirname + \"/Reconciliation/type-same.js\");\n});\n\nit(\"Lazy branched elements\", () => {\n  runTest(__dirname + \"/Reconciliation/lazy-branched-elements.js\", {\n    expectedCreateElementCalls: /* original */ 4 + /* prepacked */ 4,\n  });\n});\n\nit(\"Lazy branched elements 2\", () => {\n  runTest(__dirname + \"/Reconciliation/lazy-branched-elements2.js\", {\n    expectedCreateElementCalls: /* original */ 4 + /* prepacked: one removed by inlining */ 3,\n  });\n});\n"
  },
  {
    "path": "test/react/RenderProps/react-context.js",
    "content": "var React = require(\"React\");\n\nvar { Provider, Consumer } = React.createContext(\"bar\");\n\nfunction Child(props) {\n  return (\n    <div>\n      <Consumer>\n        {context => {\n          return <span>{context}</span>;\n        }}\n      </Consumer>\n    </div>\n  );\n}\n\nfunction App(props) {\n  return (\n    <Provider value={\"foo\"}>\n      <Child />\n    </Provider>\n  );\n}\n\nApp.getTrials = function(renderer, Root) {\n  let results = [];\n  renderer.update(<Root />);\n  results.push([\"render props context\", renderer.toJSON()]);\n  renderer.update(<Root />);\n  results.push([\"render props context\", renderer.toJSON()]);\n  return results;\n};\n\nif (this.__optimizeReactComponentTree) {\n  __optimizeReactComponentTree(App);\n}\n\nmodule.exports = App;\n"
  },
  {
    "path": "test/react/RenderProps/react-context2.js",
    "content": "var React = require(\"React\");\n\nvar { Provider, Consumer } = React.createContext(\"foo\");\n\nfunction Child(props) {\n  return (\n    <div>\n      <Consumer>\n        {value => {\n          return <span>{value}</span>;\n        }}\n      </Consumer>\n    </div>\n  );\n}\n\nfunction App(props) {\n  return (\n    <Provider value={5}>\n      <Child />\n    </Provider>\n  );\n}\n\nApp.getTrials = function(renderer, Root) {\n  let results = [];\n  renderer.update(<Root />);\n  results.push([\"render props context\", renderer.toJSON()]);\n  renderer.update(<Root />);\n  results.push([\"render props context\", renderer.toJSON()]);\n  return results;\n};\n\nif (this.__optimizeReactComponentTree) {\n  __optimizeReactComponentTree(App);\n}\n\nmodule.exports = App;\n"
  },
  {
    "path": "test/react/RenderProps/react-context3.js",
    "content": "var React = require(\"React\");\nvar Ctx = React.createContext(null);\n\nfunction Child(props) {\n  return (\n    <div>\n      <Ctx.Consumer>\n        {value => {\n          return <span>{value}</span>;\n        }}\n      </Ctx.Consumer>\n    </div>\n  );\n}\n\nfunction App(props) {\n  return (\n    <div>\n      <Child />\n    </div>\n  );\n}\n\nApp.Ctx = Ctx;\n\nApp.getTrials = function(renderer, Root) {\n  let results = [];\n  renderer.update(\n    <Root.Ctx.Provider value={5}>\n      <Root />\n    </Root.Ctx.Provider>\n  );\n  results.push([\"render props context\", renderer.toJSON()]);\n  renderer.update(\n    <Root.Ctx.Provider value={5}>\n      <Root />\n    </Root.Ctx.Provider>\n  );\n  results.push([\"render props context\", renderer.toJSON()]);\n  return results;\n};\n\nif (this.__optimizeReactComponentTree) {\n  __optimizeReactComponentTree(App);\n}\n\nmodule.exports = App;\n"
  },
  {
    "path": "test/react/RenderProps/react-context4.js",
    "content": "var React = require(\"React\");\n\nvar Ctx = React.createContext(null);\n\nfunction Child(props) {\n  return (\n    <div>\n      <Ctx.Consumer>\n        {value => {\n          return <span>{value}</span>;\n        }}\n      </Ctx.Consumer>\n    </div>\n  );\n}\n\nfunction App(props) {\n  return (\n    <Ctx.Provider value=\"a\">\n      <Ctx.Provider value=\"b\">\n        <Child />\n      </Ctx.Provider>\n      <Child />\n    </Ctx.Provider>\n  );\n}\n\nApp.getTrials = function(renderer, Root) {\n  let results = [];\n  renderer.update(<Root />);\n  results.push([\"render props context\", renderer.toJSON()]);\n  renderer.update(<Root />);\n  results.push([\"render props context\", renderer.toJSON()]);\n  return results;\n};\n\nif (this.__optimizeReactComponentTree) {\n  __optimizeReactComponentTree(App);\n}\n\nmodule.exports = App;\n"
  },
  {
    "path": "test/react/RenderProps/react-context5.js",
    "content": "var React = require(\"React\");\n\nvar Ctx = React.createContext(null);\n\nfunction Child(props) {\n  return (\n    <div>\n      <Ctx.Consumer>\n        {value => {\n          return <span>{value}</span>;\n        }}\n      </Ctx.Consumer>\n    </div>\n  );\n}\n\nfunction App(props) {\n  return (\n    <div>\n      <Ctx.Provider value=\"b\">\n        <Child />\n      </Ctx.Provider>\n      <Child />\n    </div>\n  );\n}\n\nApp.getTrials = function(renderer, Root) {\n  let results = [];\n  renderer.update(<Root />);\n  results.push([\"render props context\", renderer.toJSON()]);\n  renderer.update(<Root />);\n  results.push([\"render props context\", renderer.toJSON()]);\n  return results;\n};\n\nif (this.__optimizeReactComponentTree) {\n  __optimizeReactComponentTree(App);\n}\n\nmodule.exports = App;\n"
  },
  {
    "path": "test/react/RenderProps/react-context6.js",
    "content": "var React = require(\"React\");\n\nvar { Provider, Consumer } = React.createContext(null);\n\nfunction Child(props) {\n  var x = function(context) {\n    var click = function() {\n      return x;\n    };\n\n    return <span onClick={click}>{props.x}</span>;\n  };\n\n  return (\n    <div>\n      <Consumer>{x}</Consumer>\n    </div>\n  );\n}\n\nfunction App(props) {\n  return (\n    <Provider>\n      <Child />\n    </Provider>\n  );\n}\n\nApp.getTrials = function(renderer, Root) {\n  let results = [];\n  renderer.update(<Root />);\n  results.push([\"render props context\", renderer.toJSON()]);\n  renderer.update(<Root />);\n  results.push([\"render props context\", renderer.toJSON()]);\n  return results;\n};\n\nif (this.__optimizeReactComponentTree) {\n  __optimizeReactComponentTree(App);\n}\n\nmodule.exports = App;\n"
  },
  {
    "path": "test/react/RenderProps/react-context7.js",
    "content": "var React = require(\"React\");\n\nvar { Provider, Consumer } = React.createContext(null);\n\nfunction Child(props) {\n  var renderProp = function(value) {\n    return <span>{value}</span>;\n  };\n\n  return (\n    <div>\n      <Consumer>{renderProp}</Consumer>\n    </div>\n  );\n}\n\nfunction App(props) {\n  return (\n    <Provider value={props.dynamicValue}>\n      <Child />\n    </Provider>\n  );\n}\n\nApp.getTrials = function(renderer, Root) {\n  let results = [];\n  renderer.update(<Root dynamicValue={5} />);\n  results.push([\"render props context\", renderer.toJSON()]);\n  renderer.update(<Root dynamicValue={7} />);\n  results.push([\"render props context\", renderer.toJSON()]);\n  return results;\n};\n\nif (this.__optimizeReactComponentTree) {\n  __optimizeReactComponentTree(App);\n}\n\nmodule.exports = App;\n"
  },
  {
    "path": "test/react/RenderProps/react-root-context.js",
    "content": "var React = require(\"React\");\n\nvar { Provider, Consumer } = React.createContext(\"bar\");\n\nfunction Child(props) {\n  var x = function(context) {\n    var click = function() {\n      return x;\n    };\n\n    return <span onClick={click}>{props.x}</span>;\n  };\n\n  return (\n    <div>\n      <Consumer>{x}</Consumer>\n    </div>\n  );\n}\n\nfunction App(props) {\n  return (\n    <div>\n      <Provider value={\"foo\"}>\n        <Child />\n      </Provider>\n      <Child />\n    </div>\n  );\n}\n\nApp.getTrials = function(renderer, Root) {\n  let results = [];\n  renderer.update(<Root />);\n  results.push([\"render props context\", renderer.toJSON()]);\n  renderer.update(<Root />);\n  results.push([\"render props context\", renderer.toJSON()]);\n  return results;\n};\n\nif (this.__optimizeReactComponentTree) {\n  __optimizeReactComponentTree(App, {\n    isRoot: true,\n  });\n}\n\nmodule.exports = App;\n"
  },
  {
    "path": "test/react/RenderProps/react-root-context2.js",
    "content": "var React = require(\"React\");\n\nvar { Provider, Consumer } = React.createContext(\"bar\");\n\nfunction Child(props) {\n  return (\n    <div>\n      <Consumer>\n        {value => {\n          return <span>{value}</span>;\n        }}\n      </Consumer>\n    </div>\n  );\n}\n\nfunction App(props) {\n  return (\n    <Provider value=\"a\">\n      <Provider value=\"b\">\n        <Child />\n      </Provider>\n      <Child />\n    </Provider>\n  );\n}\n\nApp.getTrials = function(renderer, Root) {\n  let results = [];\n  renderer.update(<Root />);\n  results.push([\"render props context\", renderer.toJSON()]);\n  renderer.update(<Root />);\n  results.push([\"render props context\", renderer.toJSON()]);\n  return results;\n};\n\nif (this.__optimizeReactComponentTree) {\n  __optimizeReactComponentTree(App, {\n    isRoot: true,\n  });\n}\n\nmodule.exports = App;\n"
  },
  {
    "path": "test/react/RenderProps/react-root-context3.js",
    "content": "var React = require(\"React\");\n\nvar { Provider, Consumer } = React.createContext(\"bar\");\n\nfunction Child(props) {\n  return (\n    <div>\n      <Consumer>\n        {value => {\n          return <span>{value}</span>;\n        }}\n      </Consumer>\n    </div>\n  );\n}\n\nvar x = (\n  <Provider value=\"a\">\n    <Provider value=\"b\">\n      <Child />\n    </Provider>\n    <Child />\n  </Provider>\n);\n\nfunction App(props) {\n  return x;\n}\n\nApp.getTrials = function(renderer, Root) {\n  let results = [];\n  renderer.update(<Root />);\n  results.push([\"render props context\", renderer.toJSON()]);\n  renderer.update(<Root />);\n  results.push([\"render props context\", renderer.toJSON()]);\n  return results;\n};\n\nif (this.__optimizeReactComponentTree) {\n  __optimizeReactComponentTree(App, {\n    isRoot: true,\n  });\n}\n\nmodule.exports = App;\n"
  },
  {
    "path": "test/react/RenderProps/react-root-context4.js",
    "content": "var React = require(\"React\");\n\nvar { Provider, Consumer } = React.createContext(null);\n\nfunction Child(props) {\n  var renderProp = function(value) {\n    return <span>{value}</span>;\n  };\n\n  return (\n    <div>\n      <Consumer>{renderProp}</Consumer>\n    </div>\n  );\n}\n\nfunction App(props) {\n  return (\n    <Provider value={props.dynamicValue}>\n      <Child />\n    </Provider>\n  );\n}\n\nApp.getTrials = function(renderer, Root) {\n  let results = [];\n  renderer.update(<Root dynamicValue={5} />);\n  results.push([\"render props context\", renderer.toJSON()]);\n  renderer.update(<Root dynamicValue={7} />);\n  results.push([\"render props context\", renderer.toJSON()]);\n  return results;\n};\n\nif (this.__optimizeReactComponentTree) {\n  __optimizeReactComponentTree(App, {\n    isRoot: true,\n  });\n}\n\nmodule.exports = App;\n"
  },
  {
    "path": "test/react/RenderProps/relay-query-renderer.js",
    "content": "var React = require(\"React\");\nvar { QueryRenderer } = require(\"RelayModern\");\n// this is needed otherwise QueryRenderer gets inlined\nthis[\"QueryRenderer\"] = QueryRenderer;\n\nfunction App(props) {\n  return (\n    <QueryRenderer\n      render={data => {\n        return <span>Hello world</span>;\n      }}\n    />\n  );\n}\n\nApp.getTrials = function(renderer, Root) {\n  renderer.update(<Root />);\n  return [[\"render props relay\", renderer.toJSON()]];\n};\n\nif (this.__optimizeReactComponentTree) {\n  __optimizeReactComponentTree(App);\n}\n\nmodule.exports = App;\n"
  },
  {
    "path": "test/react/RenderProps/relay-query-renderer2.js",
    "content": "var React = require(\"React\");\nvar { QueryRenderer } = require(\"RelayModern\");\n// this is needed otherwise QueryRenderer gets inlined\nthis[\"QueryRenderer\"] = QueryRenderer;\n\nfunction App(props) {\n  return (\n    <QueryRenderer\n      render={data => {\n        return <span>Hello world {props.foo}</span>;\n      }}\n    />\n  );\n}\n\nApp.getTrials = function(renderer, Root) {\n  renderer.update(<Root />);\n  return [[\"render props relay\", renderer.toJSON()]];\n};\n\nif (this.__optimizeReactComponentTree) {\n  __optimizeReactComponentTree(App);\n}\n\nmodule.exports = App;\n"
  },
  {
    "path": "test/react/RenderProps/relay-query-renderer3.js",
    "content": "var React = require(\"React\");\nvar { QueryRenderer } = require(\"RelayModern\");\n// this is needed otherwise QueryRenderer gets inlined\nthis[\"QueryRenderer\"] = QueryRenderer;\n\nclass SomeClassThatShouldNotMakeRootAClass extends React.Component {\n  constructor() {\n    super();\n    this.state = {\n      foo: 1,\n    };\n  }\n  render() {\n    return <span>{this.state.foo}</span>;\n  }\n}\n\nfunction App(props) {\n  return (\n    <QueryRenderer\n      render={data => {\n        return <SomeClassThatShouldNotMakeRootAClass />;\n      }}\n    />\n  );\n}\n\nApp.getTrials = function(renderer, Root) {\n  renderer.update(<Root />);\n  return [[\"render props relay\", renderer.toJSON()]];\n};\n\nif (this.__optimizeReactComponentTree) {\n  __optimizeReactComponentTree(App);\n}\n\nmodule.exports = App;\n"
  },
  {
    "path": "test/react/RenderProps-test.js",
    "content": "/**\n * Copyright (c) 2017-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n/* @flow */\n\nconst setupReactTests = require(\"./setupReactTests\");\nconst { runTest } = setupReactTests();\n\n/* eslint-disable no-undef */\nconst { it } = global;\n\nit(\"Relay QueryRenderer\", () => {\n  runTest(__dirname + \"/RenderProps/relay-query-renderer.js\");\n});\n\nit(\"Relay QueryRenderer 2\", () => {\n  runTest(__dirname + \"/RenderProps/relay-query-renderer2.js\");\n});\n\nit(\"Relay QueryRenderer 3\", () => {\n  runTest(__dirname + \"/RenderProps/relay-query-renderer3.js\");\n});\n\nit(\"React Context\", () => {\n  runTest(__dirname + \"/RenderProps/react-context.js\");\n});\n\nit(\"React Context 2\", () => {\n  runTest(__dirname + \"/RenderProps/react-context2.js\");\n});\n\nit(\"React Context 3\", () => {\n  runTest(__dirname + \"/RenderProps/react-context3.js\");\n});\n\nit(\"React Context 4\", () => {\n  runTest(__dirname + \"/RenderProps/react-context4.js\");\n});\n\nit(\"React Context 5\", () => {\n  runTest(__dirname + \"/RenderProps/react-context5.js\");\n});\n\nit(\"React Context 6\", () => {\n  runTest(__dirname + \"/RenderProps/react-context6.js\");\n});\n\nit(\"React Context 7\", () => {\n  runTest(__dirname + \"/RenderProps/react-context7.js\");\n});\n\nit(\"React Context from root tree\", () => {\n  runTest(__dirname + \"/RenderProps/react-root-context.js\");\n});\n\nit(\"React Context from root tree 2\", () => {\n  runTest(__dirname + \"/RenderProps/react-root-context2.js\");\n});\n\nit(\"React Context from root tree 3\", () => {\n  runTest(__dirname + \"/RenderProps/react-root-context3.js\");\n});\n\nit(\"React Context from root tree 4\", () => {\n  runTest(__dirname + \"/RenderProps/react-root-context4.js\");\n});\n"
  },
  {
    "path": "test/react/ServerRendering/hacker-news.js",
    "content": "var React = require(\"react\");\nvar ReactDOMServer = require(\"react-dom/server\");\nvar PropTypes = require(\"PropTypes\");\n\nfunction timeAge(time) {\n  const now = new Date(2042, 1, 1).getTime() / 1000;\n  const minutes = (now - time) / 60;\n\n  if (minutes < 60) {\n    return Math.round(minutes) + \" minutes ago\";\n  }\n  return Math.round(minutes / 60) + \" hours ago\";\n}\n\nfunction getHostUrl(url) {\n  return (url + \"\")\n    .replace(\"https://\", \"\")\n    .replace(\"http://\", \"\")\n    .split(\"/\")[0];\n}\n\nfunction Story({ story, rank }) {\n  return (\n    <React.Fragment>\n      <tr className=\"athing\">\n        <td\n          style={{\n            verticalAlign: \"top\",\n            textAlign: \"right\",\n          }}\n          className=\"title\"\n        >\n          <span className=\"rank\">{rank + \".\"}</span>\n        </td>\n        <td\n          className=\"votelinks\"\n          style={{\n            verticalAlign: \"top\",\n          }}\n        >\n          <center>\n            <a href=\"#\">\n              <div className=\"votearrow\" titl=\"upvote\" />\n            </a>\n          </center>\n        </td>\n        <td className=\"title\">\n          <a href=\"#\" className=\"storylink\">\n            {story.title}\n          </a>\n          {story.url ? (\n            <span className=\"sitebit comhead\">\n              {\" (\"}\n              <a href=\"#\">{getHostUrl(story.url)}</a>)\n            </span>\n          ) : null}\n        </td>\n      </tr>\n      <tr>\n        <td colSpan=\"2\" />\n        <td className=\"subtext\">\n          <span className=\"score\">{story.score + \" points\"}</span>\n          {\" by \"}\n          <a href=\"#\" className=\"hnuser\">\n            {story.by}\n          </a>{\" \"}\n          <span className=\"age\">\n            <a href=\"#\">{timeAge(story.time)}</a>\n          </span>\n          {\" | \"}\n          <a href=\"#\">hide</a>\n          {\" | \"}\n          <a href=\"#\">{(story.descendants || 0) + \" comments\"}</a>\n        </td>\n      </tr>\n      <tr\n        style={{\n          height: 5,\n        }}\n        className=\"spacer\"\n      />\n    </React.Fragment>\n  );\n}\n\nStory.propTypes = {\n  story: PropTypes.shape({\n    title: PropTypes.string,\n    url: PropTypes.string,\n    score: PropTypes.number,\n    descendants: PropTypes.number,\n    by: PropTypes.string,\n    time: PropTypes.number,\n  }),\n  rank: PropTypes.number,\n};\n\nfunction StoryList({ stories }) {\n  return (\n    <tr>\n      <td>\n        <table cellPadding=\"0\" cellSpacing=\"0\" className=\"itemlist\">\n          <tbody>\n            {// we use Array.from to tell the compiler that this\n            // is definitely an array object\n            Array.from(stories).map((story, i) => <Story story={story} rank={++i} key={story.id} />)}\n          </tbody>\n        </table>\n      </td>\n    </tr>\n  );\n}\n\nfunction HeaderBar(props) {\n  return (\n    <tr style={{ backgroundColor: \"#222\" }}>\n      <table\n        style={{\n          padding: 4,\n        }}\n        width=\"100%\"\n        cellSpacing=\"0\"\n        cellPadding=\"0\"\n      >\n        <tbody>\n          <tr>\n            <td style={{ width: 18, paddingRight: 4 }}>\n              <a href=\"#\">\n                <img\n                  src=\"logo.png\"\n                  width=\"16\"\n                  height=\"16\"\n                  style={{\n                    border: \"1px solid #00d8ff\",\n                  }}\n                />\n              </a>\n            </td>\n            <td style={{ lineHeight: \"12pt\" }} height=\"10\">\n              <span className=\"pagetop\">\n                <b className=\"hnname\">{props.title}</b>\n                <a href=\"#\">new</a>\n                {\" | \"}\n                <a href=\"#\">comments</a>\n                {\" | \"}\n                <a href=\"#\">show</a>\n                {\" | \"}\n                <a href=\"#\">ask</a>\n                {\" | \"}\n                <a href=\"#\">jobs</a>\n                {\" | \"}\n                <a href=\"#\">submit</a>\n              </span>\n            </td>\n          </tr>\n        </tbody>\n      </table>\n    </tr>\n  );\n}\n\nHeaderBar.defaultProps = {\n  title: \"React HN Benchmark\",\n};\n\nclass AppBody extends React.Component {\n  render() {\n    return (\n      <React.Fragment>\n        <HeaderBar />\n        <tr height=\"10\" />\n        <StoryList stories={this.props.stories} limit={this.props.storyLimit} />\n      </React.Fragment>\n    );\n  }\n}\n\nAppBody.defaultProps = {\n  storyLimit: 10,\n};\n\nfunction App({ stories }) {\n  return (\n    <center>\n      <table\n        id=\"hnmain\"\n        border=\"0\"\n        cellPadding=\"0\"\n        cellSpacing=\"0\"\n        width=\"85%\"\n        style={{\n          backgroundColor: \"#f6f6ef\",\n        }}\n      >\n        <tbody>{stories.length > 0 ? <AppBody stories={stories} /> : null}</tbody>\n      </table>\n    </center>\n  );\n}\n\nApp.propTypes = {\n  stories: PropTypes.array.isRequired,\n};\n\nfunction runCompileVersion(renderer, Root, data) {\n  return [[\"server render\", ReactDOMServer.renderToString(<App stories={data} />)]];\n}\n\nfunction runNonCompiledVersion(renderer, Root, data) {\n  return [[\"server render\", ReactDOMServer.renderToString(<App stories={data} />)]];\n}\n\nfunction getTrialsA(renderer, Root, data) {\n  // console.time(\"server render\");\n  var result = runNonCompiledVersion(renderer, Root, data);\n  // console.timeEnd(\"server render\");\n  return result;\n}\n\nfunction getTrialsB(renderer, Root, data) {\n  // console.time(\"compiled server render\");\n  var result = runCompileVersion(renderer, Root, data);\n  // console.timeEnd(\"compiled server render\");\n  return result;\n}\nif (this.__optimize) {\n  // this is only for the compiled route\n  __optimize(runCompileVersion);\n  App.getTrials = getTrialsB;\n} else {\n  App.getTrials = getTrialsA;\n}\n\n// we run the getTrials from both version rather than\n// from the non-compiled version\nApp.independent = true;\n\nmodule.exports = App;\n"
  },
  {
    "path": "test/react/ServerRendering/hacker-news.json",
    "content": "[{\"by\":\"rendx\",\"descendants\":49,\"id\":14201562,\"kids\":[14201704,14202297,14202233,14201771,14201765,14201897,14201750,14201913,14201854,14201667,14201759,14202073],\"score\":186,\"time\":1493197629,\"title\":\"Postal: Open source mail delivery platform, alternative to Mailgun or Sendgrid\",\"type\":\"story\",\"url\":\"https://github.com/atech/postal\"},{\"by\":\"rabyss\",\"descendants\":4,\"id\":14202124,\"kids\":[14202293,14202249],\"score\":16,\"time\":1493205989,\"title\":\"Show HN: BreakLock – A hybrid of Mastermind and the Android pattern lock\",\"type\":\"story\",\"url\":\"https://maxwellito.github.io/breaklock/\"},{\"by\":\"morid1n\",\"descendants\":137,\"id\":14200563,\"kids\":[14201274,14200711,14201147,14201365,14201499,14200618,14201169,14200911,14200734,14201083,14200706,14200785,14201032],\"score\":178,\"time\":1493183234,\"title\":\"My Hackintosh Hardware Spec – clean, based on a 2013 iMac\",\"type\":\"story\",\"url\":\"https://infinitediaries.net/my-exact-hackintosh-spec/\"},{\"by\":\"robertwiblin\",\"descendants\":203,\"id\":14196731,\"kids\":[14201298,14201838,14201381,14197574,14201398,14199764,14198491,14197000,14198224,14200614,14201983,14200697,14199252,14201214,14198923,14200224,14197509,14200859,14200064,14200114,14197256,14197220,14200653,14197186,14199258,14197155,14197344,14198361,14197969,14199813,14197259,14197503],\"score\":562,\"time\":1493145853,\"title\":\"Evidence-based advice we've found on how to be successful in a job\",\"type\":\"story\",\"url\":\"https://80000hours.org/career-guide/how-to-be-successful/\"},{\"by\":\"ryan_j_naughton\",\"descendants\":565,\"id\":14196812,\"kids\":[14198306,14197339,14200899,14198165,14198750,14202199,14201432,14197619,14197471,14201113,14202214,14202043,14197313,14197751,14197332,14198050,14201616,14197404,14199730,14198007,14197358,14197283,14200959,14197891,14198203,14197312,14200796,14201528,14197249,14198271,14197989,14198842,14197205,14199148,14197458,14200457,14197330,14199993,14197855,14200102,14197378,14199315,14198240,14198397,14199326,14200159,14198798,14201296,14198173,14197323,14197383,14197459,14197275,14198305,14198005,14198015,14199380,14199079,14198413,14197334,14197327,14197234],\"score\":385,\"time\":1493146342,\"title\":\"Is Every Speed Limit Too Low?\",\"type\":\"story\",\"url\":\"https://priceonomics.com/is-every-speed-limit-too-low/\"},{\"by\":\"monort\",\"descendants\":63,\"id\":14196322,\"kids\":[14197628,14200026,14197457,14197486,14202126,14201266,14197227,14199404,14199338,14196382,14200598,14197377,14199689,14198538,14196905,14200404,14198781,14197278,14197888,14197742,14197764],\"score\":316,\"time\":1493143464,\"title\":\"Experimental Nighttime Photography with Nexus and Pixel\",\"type\":\"story\",\"url\":\"https://research.googleblog.com/2017/04/experimental-nighttime-photography-with.html\"},{\"by\":\"networked\",\"descendants\":9,\"id\":14199028,\"kids\":[14201588,14200361,14200314,14200338],\"score\":121,\"time\":1493161601,\"title\":\"JPEG Huffman Coding Tutorial\",\"type\":\"story\",\"url\":\"http://www.impulseadventure.com/photo/jpeg-huffman-coding.html\"},{\"by\":\"jasontan\",\"id\":14202227,\"score\":1,\"time\":1493207865,\"title\":\"Are you adept at understanding concurrency problems? Sift Science is hiring\",\"type\":\"job\",\"url\":\"https://boards.greenhouse.io/siftscience/jobs/550699#.WPUZhlMrLfY\"},{\"by\":\"pouwerkerk\",\"descendants\":80,\"id\":14196077,\"kids\":[14199434,14196279,14196604,14197440,14201734,14200922,14200452,14197115,14199837,14199894,14196596,14198243,14196565,14197400,14197049,14197686,14198545,14198475],\"score\":717,\"time\":1493142008,\"title\":\"Painting with Code: Introducing our new open source library React Sketch.app\",\"type\":\"story\",\"url\":\"http://airbnb.design/painting-with-code/\"},{\"by\":\"mromnia\",\"descendants\":16,\"id\":14201670,\"kids\":[14201835,14202115,14202176,14201890,14202325,14201859,14202158,14201763,14201902],\"score\":62,\"time\":1493198949,\"title\":\"How to mod a Porsche 911 to run Doom [video]\",\"type\":\"story\",\"url\":\"https://www.youtube.com/watch?v=NRMpNA86e8Q\"},{\"by\":\"rbanffy\",\"descendants\":16,\"id\":14192383,\"kids\":[14197494,14201805,14197484],\"score\":194,\"time\":1493118160,\"title\":\"Go programming language secure coding practices guide\",\"type\":\"story\",\"url\":\"https://github.com/Checkmarx/Go-SCP\"},{\"by\":\"intous\",\"descendants\":0,\"id\":14200446,\"score\":39,\"time\":1493181245,\"title\":\"Building Functional Chatbot for Messenger with Ruby on Rails\",\"type\":\"story\",\"url\":\"https://tutorials.botsfloor.com/chatbot-development-tutorial-how-to-build-a-fully-functional-weather-bot-on-facebook-messenger-c94ac7c59185\"},{\"by\":\"nanospeck\",\"descendants\":23,\"id\":14201207,\"kids\":[14202252,14201646,14201620,14202076,14201511,14201324,14201940,14201425,14201505,14201304,14201435,14201287,14201739,14202031,14202018],\"score\":57,\"text\":\"This question was asked on both 2015 &amp; 2016 in HN. I would like to ask it again today to know what are the newest options for this.<p>Q: What would you recommend as a reasonably priced (sub 150$) quad-copter&#x2F;drone, that has a camera, the ability to be programmed (so that I can process video&#x2F;write my own stability algorithms for it), good range, and reasonable flying time?\\nIn the event nothing fits that price point, any pointers on what the state of the art is?<p>Thanks!\",\"time\":1493192641,\"title\":\"Ask HN (again): What is the best affordable programmable drone?\",\"type\":\"story\"},{\"by\":\"geuis\",\"descendants\":57,\"id\":14196708,\"kids\":[14197480,14198523,14198705,14200969,14200079,14197605,14198979,14202203,14197679,14198461,14200389,14198065,14197883,14197908],\"score\":123,\"time\":1493145655,\"title\":\"Hackpad shutting down\",\"type\":\"story\",\"url\":\"https://hackpad.com/\"},{\"by\":\"jfoutz\",\"descendants\":55,\"id\":14195956,\"kids\":[14199594,14196972,14202101,14198197,14196771,14197326,14196956,14200842,14201529,14198581,14196777,14200177,14200422,14198571],\"score\":167,\"time\":1493141367,\"title\":\"Linkerd 1.0\",\"type\":\"story\",\"url\":\"https://blog.buoyant.io/2017/04/25/announcing-linkerd-1.0/index.html\"},{\"by\":\"DavidBuchanan\",\"descendants\":19,\"id\":14199364,\"kids\":[14199735,14200889,14202245,14200205,14200104,14201697,14200061,14199996,14199867],\"score\":66,\"time\":1493164755,\"title\":\"Show HN: TARDIS – Warp a process's perspective of time by hooking syscalls\",\"type\":\"story\",\"url\":\"https://github.com/DavidBuchanan314/TARDIS\"},{\"by\":\"rchen8\",\"descendants\":121,\"id\":14195664,\"kids\":[14196654,14196206,14196677,14197035,14196041,14196399,14196200,14196140,14196216,14196421,14196370,14196146,14197601,14197107,14196866,14196691,14197704,14196772,14200089,14198588,14196937,14198530,14197119,14197247,14198632,14196137,14200323,14196346],\"score\":486,\"time\":1493139957,\"title\":\"How to Become Well-Connected\",\"type\":\"story\",\"url\":\"http://firstround.com/review/how-to-become-insanely-well-connected/\"},{\"by\":\"dbrgn\",\"descendants\":89,\"id\":14191186,\"kids\":[14200855,14200035,14200110,14201408,14202159,14197876,14200348,14198720,14198183,14199824,14198281,14201643,14201591,14199541,14198423,14201738,14200037,14201349,14200028,14201206,14197995,14197830,14199603],\"score\":135,\"time\":1493100791,\"title\":\"How to Say (Almost) Everything in a Hundred-Word Language (2015)\",\"type\":\"story\",\"url\":\"https://www.theatlantic.com/technology/archive/2015/07/toki-pona-smallest-language/398363/?single_page=true\"},{\"by\":\"runesoerensen\",\"descendants\":62,\"id\":14198866,\"kids\":[14199494,14199495,14200288,14201118,14199599],\"score\":155,\"time\":1493160263,\"title\":\"Nginx 1.13 released with TLS 1.3 support\",\"type\":\"story\",\"url\":\"http://mailman.nginx.org/pipermail/nginx-announce/2017/000195.html\"},{\"by\":\"bcherny\",\"descendants\":20,\"id\":14199299,\"kids\":[14200694,14201832,14200517,14201760,14200966,14200558,14201815,14201231,14201073,14201124],\"score\":54,\"time\":1493163960,\"title\":\"Show HN: JSONSchema to TypeScript compiler\",\"type\":\"story\",\"url\":\"https://github.com/bcherny/json-schema-to-typescript\"},{\"by\":\"tormeh\",\"descendants\":37,\"id\":14198557,\"kids\":[14201027,14199082,14201023,14201160,14200367,14200647],\"score\":70,\"time\":1493158034,\"title\":\"A practitioner’s guide to hedonism (2007)\",\"type\":\"story\",\"url\":\"https://www.1843magazine.com/story/a-practitioners-guide-to-hedonism\"},{\"by\":\"nickreiner\",\"descendants\":33,\"id\":14199125,\"kids\":[14202332,14201634,14201200,14201215,14201157,14201898,14201969,14201125],\"score\":52,\"time\":1493162517,\"title\":\"Best Linux Distros for Gaming in 2017\",\"type\":\"story\",\"url\":\"https://thishosting.rocks/best-linux-distros-for-gaming/\"},{\"by\":\"BinaryIdiot\",\"descendants\":170,\"id\":14200486,\"kids\":[14200680,14200677,14201515,14200793,14200534,14200908,14200649,14200633,14200701,14202295,14200578,14200709,14200580,14201107,14201779,14200773,14200804,14200720,14202060,14200948,14200903,14200748,14200875,14200750,14200821,14200756,14201707,14201689,14200669,14200997,14200818,14201586,14200603,14201054,14201457,14200616,14201095,14200915,14200878,14200629,14201523,14200620,14202099],\"score\":316,\"time\":1493181945,\"title\":\"Suicide of an Uber engineer: Widow blames job stress\",\"type\":\"story\",\"url\":\"http://www.sfchronicle.com/business/article/Suicide-of-an-Uber-engineer-widow-blames-job-11095807.php?t=7e40d1f554&cmpid=fb-premium&cmpid=twitter-premium\"},{\"by\":\"catc\",\"descendants\":34,\"id\":14195522,\"kids\":[14202316,14202278,14197167,14199152,14202077,14197239,14197721,14197632,14197219,14198296,14197245,14197201,14197403,14198051,14196747],\"score\":87,\"time\":1493139414,\"title\":\"Show HN: React Timekeeper – Time picker based on the style of Google Keep\",\"type\":\"story\",\"url\":\"https://catc.github.io/react-timekeeper/\"},{\"by\":\"Integer\",\"descendants\":152,\"id\":14192353,\"kids\":[14197671,14197754,14199091,14198533,14201249,14198626,14198263,14198009,14195130,14199551,14197663,14198285,14199611,14199835,14197482,14198924,14198943],\"score\":273,\"time\":1493117771,\"title\":\"Windows Is Bloated, Thanks to Adobe’s Extensible Metadata Platform\",\"type\":\"story\",\"url\":\"https://www.thurrott.com/windows/109962/windows-bloated-thanks-adobes-extensible-metadata-platform\"},{\"by\":\"craigcannon\",\"descendants\":23,\"id\":14197852,\"kids\":[14200024,14199986,14202106,14198011,14199228,14202138,14198917,14198607],\"score\":58,\"time\":1493153342,\"title\":\"New England Lost Ski Areas Project\",\"type\":\"story\",\"url\":\"http://www.nelsap.org/\"},{\"by\":\"golfer\",\"descendants\":105,\"id\":14198229,\"kids\":[14200202,14198948,14199770,14198634,14200263,14198797,14198919,14200447,14198645,14199267,14199124,14198833,14199059],\"score\":282,\"time\":1493155745,\"title\":\"Uber must turn over information about its acquisition of Otto to Waymo\",\"type\":\"story\",\"url\":\"https://techcrunch.com/2017/04/25/uber-must-turn-over-information-about-its-acquisition-of-otto-to-waymo-court-rules/\"},{\"by\":\"JoshTriplett\",\"descendants\":116,\"id\":14198403,\"kids\":[14199771,14199980,14198664,14198764,14201086,14200307,14199294,14198860,14198817],\"score\":139,\"time\":1493156882,\"title\":\"Shutting down public FTP services\",\"type\":\"story\",\"url\":\"https://lists.debian.org/debian-announce/2017/msg00001.html\"},{\"by\":\"mabynogy\",\"descendants\":50,\"id\":14191577,\"kids\":[14194021,14195402,14193886,14193792,14194355,14197136,14200386,14194151,14193989,14193798,14194042,14197100,14198984,14193925,14194170],\"score\":365,\"time\":1493107104,\"title\":\"A Primer on Bézier Curves\",\"type\":\"story\",\"url\":\"https://pomax.github.io/bezierinfo#preface\"},{\"by\":\"robertothais\",\"descendants\":29,\"id\":14192946,\"kids\":[14202311,14202299,14201900,14200029,14198260,14198605,14201850,14199858,14198223,14198610],\"score\":61,\"time\":1493124627,\"title\":\"Consciousness as a State of Matter (2014)\",\"type\":\"story\",\"url\":\"https://arxiv.org/abs/1401.1219\"},{\"by\":\"leephillips\",\"descendants\":2,\"id\":14202078,\"kids\":[14202122],\"score\":5,\"time\":1493205152,\"title\":\"The Republican Lawmaker Who Secretly Created Reddit’s Women-Hating ‘Red Pill’\",\"type\":\"story\",\"url\":\"http://www.thedailybeast.com/articles/2017/04/25/the-republican-lawmaker-who-secretly-created-reddit-s-women-hating-red-pill.html\"},{\"by\":\"anguswithgusto\",\"descendants\":55,\"id\":14196325,\"kids\":[14197131,14196789,14197299,14197466,14196737,14199929,14197550,14197511,14196888,14200109,14197101],\"score\":80,\"time\":1493143475,\"title\":\"Gett in advanced talks to buy Juno for $250M as Uber rivals consolidate\",\"type\":\"story\",\"url\":\"https://techcrunch.com/2017/04/25/gett-in-advanced-talks-to-buy-juno-for-250m-as-uber-rivals-consolidate/\"},{\"by\":\"fabuzaid\",\"descendants\":2,\"id\":14196339,\"kids\":[14201557,14201170],\"score\":46,\"time\":1493143560,\"title\":\"Implementing a Fast Research Compiler in Rust\",\"type\":\"story\",\"url\":\"http://dawn.cs.stanford.edu/blog/weld.html\"},{\"by\":\"bluesilver07\",\"descendants\":61,\"id\":14196154,\"kids\":[14197614,14196853,14197074,14197050,14200090,14197731,14196352,14197442],\"score\":72,\"time\":1493142448,\"title\":\"Xenko Game Engine 2.0 released\",\"type\":\"story\",\"url\":\"http://xenko.com/blog/release-xenko-2-0-0/\"},{\"by\":\"molecule\",\"descendants\":254,\"id\":14189392,\"kids\":[14190198,14190800,14193591,14190274,14189796,14190118,14190405,14190006,14189430,14190244,14189877,14190064,14190211,14189918,14190071,14191312,14195969,14190542,14194775,14189900,14190032,14189847,14192128,14191737,14191047,14190992,14192759,14191405,14190815,14194136,14190737,14190552,14191385,14189816,14191316,14193780,14193979,14190768,14192973,14191217,14190879,14190780,14189914,14190925,14192906,14190528,14189893,14190007,14189929,14190049,14191859,14191304,14190177,14193355,14193352,14190324,14190846,14189803],\"score\":630,\"time\":1493076480,\"title\":\"Robert M. Pirsig has died\",\"type\":\"story\",\"url\":\"http://www.npr.org/sections/thetwo-way/2017/04/24/525443040/-zen-and-the-art-of-motorcycle-maintenance-author-robert-m-pirsig-dies-at-88\"},{\"by\":\"artsandsci\",\"descendants\":67,\"id\":14194422,\"kids\":[14199418,14196266,14197226,14196647,14196324,14201761,14196265,14195599,14199054,14196057],\"score\":127,\"time\":1493134376,\"title\":\"An extra-uterine system to physiologically support the extreme premature lamb\",\"type\":\"story\",\"url\":\"https://www.nature.com/articles/ncomms15112\"},{\"by\":\"miobrien\",\"descendants\":9,\"id\":14198261,\"kids\":[14199610,14199447,14199862,14201753,14199068],\"score\":30,\"time\":1493155969,\"title\":\"Prior Indigenous Technological Species\",\"type\":\"story\",\"url\":\"https://arxiv.org/abs/1704.07263\"},{\"by\":\"zdw\",\"descendants\":2,\"id\":14199197,\"kids\":[14200610],\"score\":12,\"time\":1493163087,\"title\":\"Should Curve25519 keys be validated?\",\"type\":\"story\",\"url\":\"https://research.kudelskisecurity.com/2017/04/25/should-ecdh-keys-be-validated/\"},{\"by\":\"spearo77\",\"descendants\":213,\"id\":14189688,\"kids\":[14191654,14192373,14190683,14192095,14191856,14190771,14190570,14190599,14190721,14192049,14189694,14191430,14193610,14190543,14190372,14191818,14192171,14192177,14192135,14191483,14190560,14190341,14190362,14190452,14192563,14190458,14195245,14190809,14192706,14192959,14190636,14190634,14190368,14191163,14191379,14190668,14191673,14190884,14192565,14190480,14190442],\"score\":447,\"time\":1493079289,\"title\":\"WikiTribune – Evidence-based journalism\",\"type\":\"story\",\"url\":\"https://www.wikitribune.com\"},{\"by\":\"adbrebs\",\"descendants\":294,\"id\":14182262,\"kids\":[14183335,14183715,14182725,14183897,14185812,14184510,14182468,14183231,14182580,14183996,14182449,14185671,14182428,14182666,14186599,14182519,14185571,14185159,14182636,14185864,14188340,14183433,14183146,14184034,14184363,14183368,14183098,14182495,14182753,14184720,14188085,14187692,14183633,14188137,14182606,14186796,14196166,14185084,14185899,14188219,14186885,14183406,14185561,14183388,14191457,14183281,14183399,14183674,14183236,14183990,14183760,14183248,14184114,14183318,14183457,14186509,14186900,14186695,14188405,14184636,14184630,14188301,14184144,14183023,14184555,14185946,14184611,14184490,14183653,14183881,14182715,14184440,14182573,14183251,14184962,14187249,14182545,14192314],\"score\":1356,\"time\":1493014335,\"title\":\"Lyrebird – An API to copy the voice of anyone\",\"type\":\"story\",\"url\":\"https://lyrebird.ai/demo\"},{\"by\":\"mathgenius\",\"descendants\":6,\"id\":14192442,\"kids\":[14197265,14195645],\"score\":43,\"time\":1493118936,\"title\":\"Quantum – Open journal for quantum science\",\"type\":\"story\",\"url\":\"http://quantum-journal.org/papers/\"},{\"by\":\"tjalfi\",\"descendants\":5,\"id\":14190937,\"kids\":[14199744,14197114,14190946],\"score\":107,\"time\":1493097061,\"title\":\"A Seven Dimensional Analysis of Hashing Methods [pdf]\",\"type\":\"story\",\"url\":\"http://www.vldb.org/pvldb/vol9/p96-richter.pdf\"},{\"by\":\"mxstbr\",\"descendants\":0,\"id\":14196935,\"score\":24,\"time\":1493147015,\"title\":\"One GraphQL Client for JavaScript, iOS, and Android\",\"type\":\"story\",\"url\":\"https://dev-blog.apollodata.com/one-graphql-client-for-javascript-ios-and-android-64993c1b7991\"},{\"by\":\"uptown\",\"descendants\":166,\"id\":14192817,\"kids\":[14197690,14195597,14196750,14195237,14196320,14195150,14198816,14194916,14197746,14196332,14194695,14196726,14194947,14199715,14195059,14195778,14196204,14200435,14194780,14195030,14198452,14199023,14194852,14197577,14197778,14195361,14196368,14194948,14199024,14195060,14199498],\"score\":226,\"time\":1493123621,\"title\":\"How Yahoo Killed Flickr (2012)\",\"type\":\"story\",\"url\":\"https://gizmodo.com/5910223/how-yahoo-killed-flickr-and-lost-the-internet\"},{\"by\":\"mattklein123\",\"descendants\":42,\"id\":14194026,\"kids\":[14194573,14195577,14194430,14195407,14194569,14195298,14200054,14194456,14198329,14199198],\"score\":167,\"time\":1493131921,\"title\":\"Envoy: 7 months later\",\"type\":\"story\",\"url\":\"https://eng.lyft.com/envoy-7-months-later-41986c2fd443\"},{\"by\":\"misnamed\",\"descendants\":2,\"id\":14191333,\"kids\":[14197296],\"score\":29,\"time\":1493103250,\"title\":\"Modern Hieroglyphs: Binary Logic Behind the Universal “Power Symbol”\",\"type\":\"story\",\"url\":\"http://99percentinvisible.org/article/modern-hieroglyphics-binary-logic-behind-universal-power-symbol/\"},{\"by\":\"LaFolle\",\"descendants\":92,\"id\":14191681,\"kids\":[14192477,14194490,14192316,14193364,14192065,14193499,14194324,14192622,14192020,14195866,14192496,14196391,14192138,14192714,14195151,14195094,14192110,14192155],\"score\":138,\"time\":1493108371,\"title\":\"Feynman Algorithm (2014)\",\"type\":\"story\",\"url\":\"http://wiki.c2.com/?FeynmanAlgorithm\"},{\"by\":\"Thevet\",\"descendants\":18,\"id\":14190736,\"kids\":[14197744,14195753,14197880,14197735,14195874,14197023,14196660],\"score\":81,\"time\":1493093860,\"title\":\"The legend of the Legion\",\"type\":\"story\",\"url\":\"https://aeon.co/essays/why-young-men-queue-up-to-die-in-the-french-foreign-legion\"},{\"by\":\"bufordsharkley\",\"descendants\":92,\"id\":14197013,\"kids\":[14197983,14197168,14197701,14198239,14197514,14198064,14197476,14198489,14197761,14197080,14198905,14198068,14198579],\"score\":69,\"time\":1493147532,\"title\":\"Cracking the Mystery of Labor's Falling Share of GDP\",\"type\":\"story\",\"url\":\"https://www.bloomberg.com/view/articles/2017-04-24/cracking-the-mystery-of-labor-s-falling-share-of-gdp\"},{\"by\":\"rbanffy\",\"descendants\":27,\"id\":14198470,\"kids\":[14199443,14201987,14199461,14199729,14201519,14198762,14199524],\"score\":52,\"time\":1493157378,\"title\":\"How the Internet Gave Mail-Order Brides the Power\",\"type\":\"story\",\"url\":\"https://backchannel.com/how-the-internet-gave-mail-order-brides-the-power-1af8c8a40562\"}]"
  },
  {
    "path": "test/react/ServerRendering/pe-functional-benchmark.js",
    "content": "var React = require(\"react\");\nvar ReactDOMServer = require(\"react-dom/server\");\n\nvar ReactImage0 = function(props) {\n  if (props.x === 0) {\n    return React.createElement(\"i\", {\n      alt: \"\",\n      className: \"_3-99 img sp_i534r85sjIn sx_538591\",\n      src: null,\n    });\n  }\n  if (props.x === 15) {\n    return React.createElement(\"i\", {\n      className: \"_3ut_ img sp_i534r85sjIn sx_e8ac93\",\n      src: null,\n      alt: \"\",\n    });\n  }\n  if (props.x === 22) {\n    return React.createElement(\"i\", {\n      alt: \"\",\n      className: \"_3-8_ img sp_i534r85sjIn sx_7b15bc\",\n      src: null,\n    });\n  }\n  if (props.x === 29) {\n    return React.createElement(\"i\", {\n      className: \"_1m1s _4540 _p img sp_i534r85sjIn sx_f40b1c\",\n      src: null,\n      alt: \"\",\n    });\n  }\n  if (props.x === 42) {\n    return React.createElement(\n      \"i\",\n      {\n        alt: \"Warning\",\n        className: \"_585p img sp_i534r85sjIn sx_20273d\",\n        src: null,\n      },\n      React.createElement(\"u\", null, \"Warning\")\n    );\n  }\n  if (props.x === 67) {\n    return React.createElement(\"i\", {\n      alt: \"\",\n      className: \"_3-8_ img sp_i534r85sjIn sx_b5d079\",\n      src: null,\n    });\n  }\n  if (props.x === 70) {\n    return React.createElement(\"i\", {\n      src: null,\n      alt: \"\",\n      className: \"img sp_i534r85sjIn sx_29f8c9\",\n    });\n  }\n  if (props.x === 76) {\n    return React.createElement(\"i\", {\n      alt: \"\",\n      className: \"_3-8_ img sp_i534r85sjIn sx_ef6a9c\",\n      src: null,\n    });\n  }\n  if (props.x === 79) {\n    return React.createElement(\"i\", {\n      src: null,\n      alt: \"\",\n      className: \"img sp_i534r85sjIn sx_6f8c43\",\n    });\n  }\n  if (props.x === 88) {\n    return React.createElement(\"i\", {\n      src: null,\n      alt: \"\",\n      className: \"img sp_i534r85sjIn sx_e94a2d\",\n    });\n  }\n  if (props.x === 91) {\n    return React.createElement(\"i\", {\n      src: null,\n      alt: \"\",\n      className: \"img sp_i534r85sjIn sx_7ed7d4\",\n    });\n  }\n  if (props.x === 94) {\n    return React.createElement(\"i\", {\n      src: null,\n      alt: \"\",\n      className: \"img sp_i534r85sjIn sx_930440\",\n    });\n  }\n  if (props.x === 98) {\n    return React.createElement(\"i\", {\n      src: null,\n      alt: \"\",\n      className: \"img sp_i534r85sjIn sx_750c83\",\n    });\n  }\n  if (props.x === 108) {\n    return React.createElement(\"i\", {\n      src: null,\n      alt: \"\",\n      className: \"img sp_i534r85sjIn sx_73c1bb\",\n    });\n  }\n  if (props.x === 111) {\n    return React.createElement(\"i\", {\n      src: null,\n      alt: \"\",\n      className: \"img sp_i534r85sjIn sx_29f28d\",\n    });\n  }\n  if (props.x === 126) {\n    return React.createElement(\"i\", {\n      src: null,\n      alt: \"\",\n      className: \"_3-8_ img sp_i534r85sjIn sx_91c59e\",\n    });\n  }\n  if (props.x === 127) {\n    return React.createElement(\"i\", {\n      alt: \"\",\n      className: \"_3-99 img sp_i534r85sjIn sx_538591\",\n      src: null,\n    });\n  }\n  if (props.x === 134) {\n    return React.createElement(\"i\", {\n      src: null,\n      alt: \"\",\n      className: \"_3-8_ img sp_i534r85sjIn sx_c8eb75\",\n    });\n  }\n  if (props.x === 135) {\n    return React.createElement(\"i\", {\n      alt: \"\",\n      className: \"_3-99 img sp_i534r85sjIn sx_538591\",\n      src: null,\n    });\n  }\n  if (props.x === 148) {\n    return React.createElement(\"i\", {\n      className: \"_3yz6 _5whs img sp_i534r85sjIn sx_896996\",\n      src: null,\n      alt: \"\",\n    });\n  }\n  if (props.x === 152) {\n    return React.createElement(\"i\", {\n      className: \"_5b5p _4gem img sp_i534r85sjIn sx_896996\",\n      src: null,\n      alt: \"\",\n    });\n  }\n  if (props.x === 153) {\n    return React.createElement(\"i\", {\n      className: \"_541d img sp_i534r85sjIn sx_2f396a\",\n      src: null,\n      alt: \"\",\n    });\n  }\n  if (props.x === 160) {\n    return React.createElement(\"i\", {\n      src: null,\n      alt: \"\",\n      className: \"img sp_i534r85sjIn sx_31d9b0\",\n    });\n  }\n  if (props.x === 177) {\n    return React.createElement(\"i\", {\n      alt: \"\",\n      className: \"_3-99 img sp_i534r85sjIn sx_2c18b7\",\n      src: null,\n    });\n  }\n  if (props.x === 186) {\n    return React.createElement(\"i\", {\n      src: null,\n      alt: \"\",\n      className: \"img sp_i534r85sjIn sx_0a681f\",\n    });\n  }\n  if (props.x === 195) {\n    return React.createElement(\"i\", {\n      className: \"_1-lx img sp_OkER5ktbEyg sx_b369b4\",\n      src: null,\n      alt: \"\",\n    });\n  }\n  if (props.x === 198) {\n    return React.createElement(\"i\", {\n      className: \"_1-lx img sp_i534r85sjIn sx_96948e\",\n      src: null,\n      alt: \"\",\n    });\n  }\n  if (props.x === 237) {\n    return React.createElement(\"i\", {\n      className: \"_541d img sp_i534r85sjIn sx_2f396a\",\n      src: null,\n      alt: \"\",\n    });\n  }\n  if (props.x === 266) {\n    return React.createElement(\"i\", {\n      alt: \"\",\n      className: \"_3-99 img sp_i534r85sjIn sx_538591\",\n      src: null,\n    });\n  }\n  if (props.x === 314) {\n    return React.createElement(\"i\", {\n      className: \"_1cie _1cif img sp_i534r85sjIn sx_6e6820\",\n      src: null,\n      alt: \"\",\n    });\n  }\n  if (props.x === 345) {\n    return React.createElement(\"i\", {\n      className: \"_1cie img sp_i534r85sjIn sx_e896cf\",\n      src: null,\n      alt: \"\",\n    });\n  }\n  if (props.x === 351) {\n    return React.createElement(\"i\", {\n      className: \"_1cie img sp_i534r85sjIn sx_38fed8\",\n      src: null,\n      alt: \"\",\n    });\n  }\n};\n\nvar AbstractLink1 = function(props) {\n  if (props.x === 1) {\n    return React.createElement(\n      \"a\",\n      {\n        className: \"_387r _55pi _2agf _4jy0 _4jy4 _517h _51sy _42ft\",\n        style: { width: 250, maxWidth: \"250px\" },\n        disabled: null,\n        label: null,\n        href: \"#\",\n        rel: undefined,\n        onClick: function() {},\n      },\n      null,\n      React.createElement(\n        \"span\",\n        { className: \"_55pe\", style: { maxWidth: \"236px\" } },\n        null,\n        React.createElement(\n          \"span\",\n          null,\n          React.createElement(\"span\", { className: \"_48u-\" }, \"Account:\"),\n          \" \",\n          \"Dick Madanson (10149999073643408)\"\n        )\n      ),\n      React.createElement(ReactImage0, { x: 0 })\n    );\n  }\n  if (props.x === 43) {\n    return React.createElement(\n      \"a\",\n      {\n        className: \"_585q _50zy _50-0 _50z- _5upp _42ft\",\n        size: \"medium\",\n        type: null,\n        title: \"Remove\",\n        \"data-hover\": undefined,\n        \"data-tooltip-alignh\": undefined,\n        \"data-tooltip-content\": undefined,\n        disabled: null,\n        label: null,\n        href: \"#\",\n        rel: undefined,\n        onClick: function() {},\n      },\n      undefined,\n      \"Remove\",\n      undefined\n    );\n  }\n  if (props.x === 49) {\n    return React.createElement(\n      \"a\",\n      {\n        target: \"_blank\",\n        href: \"/ads/manage/billing.php?act=10149999073643408\",\n        rel: undefined,\n        onClick: function() {},\n      },\n      React.createElement(XUIText29, { x: 48 })\n    );\n  }\n  if (props.x === 128) {\n    return React.createElement(\n      \"a\",\n      {\n        className: \" _5bbf _55pi _2agf _4jy0 _4jy4 _517h _51sy _42ft\",\n        style: { maxWidth: \"200px\" },\n        disabled: null,\n        label: null,\n        href: \"#\",\n        rel: undefined,\n        onClick: function() {},\n      },\n      null,\n      React.createElement(\n        \"span\",\n        { className: \"_55pe\", style: { maxWidth: \"186px\" } },\n        React.createElement(ReactImage0, { x: 126 }),\n        \"Search\"\n      ),\n      React.createElement(ReactImage0, { x: 127 })\n    );\n  }\n  if (props.x === 136) {\n    return React.createElement(\n      \"a\",\n      {\n        className: \" _5bbf _55pi _2agf _4jy0 _4jy4 _517h _51sy _42ft\",\n        style: { maxWidth: \"200px\" },\n        disabled: null,\n        label: null,\n        href: \"#\",\n        rel: undefined,\n        onClick: function() {},\n      },\n      null,\n      React.createElement(\n        \"span\",\n        { className: \"_55pe\", style: { maxWidth: \"186px\" } },\n        React.createElement(ReactImage0, { x: 134 }),\n        \"Filters\"\n      ),\n      React.createElement(ReactImage0, { x: 135 })\n    );\n  }\n  if (props.x === 178) {\n    return React.createElement(\n      \"a\",\n      {\n        className: \"_1_-t _1_-v _42ft\",\n        disabled: null,\n        height: \"medium\",\n        role: \"button\",\n        label: null,\n        href: \"#\",\n        rel: undefined,\n        onClick: function() {},\n      },\n      undefined,\n      \"Lifetime\",\n      React.createElement(ReactImage0, { x: 177 })\n    );\n  }\n  if (props.x === 207) {\n    return React.createElement(\"a\", { href: \"#\", rel: undefined, onClick: function() {} }, \"Create Ad Set\");\n  }\n  if (props.x === 209) {\n    return React.createElement(\"a\", { href: \"#\", rel: undefined, onClick: function() {} }, \"View Ad Set\");\n  }\n  if (props.x === 241) {\n    return React.createElement(\"a\", { href: \"#\", rel: undefined, onClick: function() {} }, \"Set a Limit\");\n  }\n  if (props.x === 267) {\n    return React.createElement(\n      \"a\",\n      {\n        className: \"_p _55pi _2agf _4jy0 _4jy3 _517h _51sy _42ft\",\n        style: { maxWidth: \"200px\" },\n        disabled: null,\n        label: null,\n        href: \"#\",\n        rel: undefined,\n        onClick: function() {},\n      },\n      null,\n      React.createElement(\"span\", { className: \"_55pe\", style: { maxWidth: \"186px\" } }, null, \"Links\"),\n      React.createElement(ReactImage0, { x: 266 })\n    );\n  }\n};\n\nvar Link2 = function(props) {\n  if (props.x === 2) {\n    return React.createElement(AbstractLink1, { x: 1 });\n  }\n  if (props.x === 44) {\n    return React.createElement(AbstractLink1, { x: 43 });\n  }\n  if (props.x === 50) {\n    return React.createElement(AbstractLink1, { x: 49 });\n  }\n  if (props.x === 129) {\n    return React.createElement(AbstractLink1, { x: 128 });\n  }\n  if (props.x === 137) {\n    return React.createElement(AbstractLink1, { x: 136 });\n  }\n  if (props.x === 179) {\n    return React.createElement(AbstractLink1, { x: 178 });\n  }\n  if (props.x === 208) {\n    return React.createElement(AbstractLink1, { x: 207 });\n  }\n  if (props.x === 210) {\n    return React.createElement(AbstractLink1, { x: 209 });\n  }\n  if (props.x === 242) {\n    return React.createElement(AbstractLink1, { x: 241 });\n  }\n  if (props.x === 268) {\n    return React.createElement(AbstractLink1, { x: 267 });\n  }\n};\n\nvar AbstractButton3 = function(props) {\n  if (props.x === 3) {\n    return React.createElement(Link2, { x: 2 });\n  }\n  if (props.x === 20) {\n    return React.createElement(\n      \"button\",\n      {\n        className: \"_5n7z _4jy0 _4jy4 _517h _51sy _42ft\",\n        onClick: function() {},\n        label: null,\n        type: \"submit\",\n        value: \"1\",\n      },\n      undefined,\n      \"Discard Changes\",\n      undefined\n    );\n  }\n  if (props.x === 23) {\n    return React.createElement(\n      \"button\",\n      {\n        className: \"_5n7z _2yak _4lj- _4jy0 _4jy4 _517h _51sy _42ft _42fr\",\n        disabled: true,\n        onClick: function() {},\n        \"data-tooltip-content\": \"You have no changes to publish\",\n        \"data-hover\": \"tooltip\",\n        label: null,\n        type: \"submit\",\n        value: \"1\",\n      },\n      React.createElement(ReactImage0, { x: 22 }),\n      \"Review Changes\",\n      undefined\n    );\n  }\n  if (props.x === 45) {\n    return React.createElement(Link2, { x: 44 });\n  }\n  if (props.x === 68) {\n    return React.createElement(\n      \"button\",\n      {\n        className: \"_u_k _4jy0 _4jy4 _517h _51sy _42ft\",\n        onClick: function() {},\n        label: null,\n        type: \"submit\",\n        value: \"1\",\n      },\n      React.createElement(ReactImage0, { x: 67 }),\n      \"Create Campaign\",\n      undefined\n    );\n  }\n  if (props.x === 71) {\n    return React.createElement(\n      \"button\",\n      {\n        className: \"_u_k _3qx6 _p _4jy0 _4jy4 _517h _51sy _42ft\",\n        label: null,\n        type: \"submit\",\n        value: \"1\",\n      },\n      React.createElement(ReactImage0, { x: 70 }),\n      undefined,\n      undefined\n    );\n  }\n  if (props.x === 77) {\n    return React.createElement(\n      \"button\",\n      {\n        \"aria-label\": \"Edit\",\n        \"data-tooltip-content\": \"Edit Campaigns (Ctrl+U)\",\n        \"data-hover\": \"tooltip\",\n        className: \"_d2_ _u_k noMargin _4jy0 _4jy4 _517h _51sy _42ft\",\n        disabled: false,\n        onClick: function() {},\n        label: null,\n        type: \"submit\",\n        value: \"1\",\n      },\n      React.createElement(ReactImage0, { x: 76 }),\n      \"Edit\",\n      undefined\n    );\n  }\n  if (props.x === 80) {\n    return React.createElement(\n      \"button\",\n      {\n        className: \"_u_k _3qx6 _p _4jy0 _4jy4 _517h _51sy _42ft\",\n        disabled: false,\n        label: null,\n        type: \"submit\",\n        value: \"1\",\n      },\n      React.createElement(ReactImage0, { x: 79 }),\n      undefined,\n      undefined\n    );\n  }\n  if (props.x === 89) {\n    return React.createElement(\n      \"button\",\n      {\n        \"aria-label\": \"Revert\",\n        className: \"_u_k _4jy0 _4jy4 _517h _51sy _42ft _42fr\",\n        \"data-hover\": \"tooltip\",\n        \"data-tooltip-content\": \"Revert\",\n        disabled: true,\n        onClick: function() {},\n        label: null,\n        type: \"submit\",\n        value: \"1\",\n      },\n      React.createElement(ReactImage0, { x: 88 }),\n      undefined,\n      undefined\n    );\n  }\n  if (props.x === 92) {\n    return React.createElement(\n      \"button\",\n      {\n        \"aria-label\": \"Delete\",\n        className: \"_u_k _4jy0 _4jy4 _517h _51sy _42ft\",\n        \"data-hover\": \"tooltip\",\n        \"data-tooltip-content\": \"Delete\",\n        disabled: false,\n        onClick: function() {},\n        label: null,\n        type: \"submit\",\n        value: \"1\",\n      },\n      React.createElement(ReactImage0, { x: 91 }),\n      undefined,\n      undefined\n    );\n  }\n  if (props.x === 95) {\n    return React.createElement(\n      \"button\",\n      {\n        \"aria-label\": \"Duplicate\",\n        className: \"_u_k _4jy0 _4jy4 _517h _51sy _42ft\",\n        \"data-hover\": \"tooltip\",\n        \"data-tooltip-content\": \"Duplicate\",\n        disabled: false,\n        onClick: function() {},\n        label: null,\n        type: \"submit\",\n        value: \"1\",\n      },\n      React.createElement(ReactImage0, { x: 94 }),\n      undefined,\n      undefined\n    );\n  }\n  if (props.x === 99) {\n    return React.createElement(\n      \"button\",\n      {\n        \"aria-label\": \"Export & Import\",\n        className: \"_u_k noMargin _p _4jy0 _4jy4 _517h _51sy _42ft\",\n        \"data-hover\": \"tooltip\",\n        \"data-tooltip-content\": \"Export & Import\",\n        onClick: function() {},\n        label: null,\n        type: \"submit\",\n        value: \"1\",\n      },\n      React.createElement(ReactImage0, { x: 98 }),\n      undefined,\n      undefined\n    );\n  }\n  if (props.x === 109) {\n    return React.createElement(\n      \"button\",\n      {\n        \"aria-label\": \"Create Report\",\n        className: \"_u_k _5n7z _4jy0 _4jy4 _517h _51sy _42ft\",\n        \"data-hover\": \"tooltip\",\n        \"data-tooltip-content\": \"Create Report\",\n        disabled: false,\n        style: { boxSizing: \"border-box\", height: \"28px\", width: \"48px\" },\n        onClick: function() {},\n        label: null,\n        type: \"submit\",\n        value: \"1\",\n      },\n      React.createElement(ReactImage0, { x: 108 }),\n      undefined,\n      undefined\n    );\n  }\n  if (props.x === 112) {\n    return React.createElement(\n      \"button\",\n      {\n        \"aria-label\": \"Campaign Tags\",\n        className: \" _5uy7 _4jy0 _4jy4 _517h _51sy _42ft\",\n        \"data-hover\": \"tooltip\",\n        \"data-tooltip-content\": \"Campaign Tags\",\n        disabled: false,\n        onClick: function() {},\n        label: null,\n        type: \"submit\",\n        value: \"1\",\n      },\n      React.createElement(ReactImage0, { x: 111 }),\n      undefined,\n      undefined\n    );\n  }\n  if (props.x === 130) {\n    return React.createElement(Link2, { x: 129 });\n  }\n  if (props.x === 138) {\n    return React.createElement(Link2, { x: 137 });\n  }\n  if (props.x === 149) {\n    return React.createElement(\n      \"button\",\n      {\n        className: \"_3yz9 _1t-2 _50z- _50zy _50zz _50z- _5upp _42ft\",\n        size: \"small\",\n        onClick: function() {},\n        type: \"button\",\n        title: \"Remove\",\n        \"data-hover\": undefined,\n        \"data-tooltip-alignh\": undefined,\n        \"data-tooltip-content\": undefined,\n        label: null,\n      },\n      undefined,\n      \"Remove\",\n      undefined\n    );\n  }\n  if (props.x === 156) {\n    return React.createElement(\n      \"button\",\n      {\n        className: \"_5b5u _5b5v _4jy0 _4jy3 _517h _51sy _42ft\",\n        onClick: function() {},\n        label: null,\n        type: \"submit\",\n        value: \"1\",\n      },\n      undefined,\n      \"Apply\",\n      undefined\n    );\n  }\n  if (props.x === 161) {\n    return React.createElement(\n      \"button\",\n      {\n        className: \"_1wdf _4jy0 _517i _517h _51sy _42ft\",\n        onClick: function() {},\n        label: null,\n        type: \"submit\",\n        value: \"1\",\n      },\n      React.createElement(ReactImage0, { x: 160 }),\n      undefined,\n      undefined\n    );\n  }\n  if (props.x === 180) {\n    return React.createElement(Link2, { x: 179 });\n  }\n  if (props.x === 187) {\n    return React.createElement(\n      \"button\",\n      {\n        \"aria-label\": \"List Settings\",\n        className: \"_u_k _3c5o _1-r0 _4jy0 _4jy4 _517h _51sy _42ft\",\n        \"data-hover\": \"tooltip\",\n        \"data-tooltip-content\": \"List Settings\",\n        onClick: function() {},\n        label: null,\n        type: \"submit\",\n        value: \"1\",\n      },\n      React.createElement(ReactImage0, { x: 186 }),\n      undefined,\n      undefined\n    );\n  }\n  if (props.x === 269) {\n    return React.createElement(Link2, { x: 268 });\n  }\n  if (props.x === 303) {\n    return React.createElement(\n      \"button\",\n      {\n        className: \"_tm3 _tm6 _tm7 _4jy0 _4jy6 _517h _51sy _42ft\",\n        \"data-tooltip-position\": \"right\",\n        \"data-tooltip-content\": \"Campaigns\",\n        \"data-hover\": \"tooltip\",\n        onClick: function() {},\n        label: null,\n        type: \"submit\",\n        value: \"1\",\n      },\n      undefined,\n      React.createElement(\n        \"div\",\n        null,\n        React.createElement(\"div\", { className: \"_tma\" }),\n        React.createElement(\"div\", { className: \"_tm8\" }),\n        React.createElement(\"div\", { className: \"_tm9\" }, 1)\n      ),\n      undefined\n    );\n  }\n  if (props.x === 305) {\n    return React.createElement(\n      \"button\",\n      {\n        className: \"_tm4 _tm6 _4jy0 _4jy6 _517h _51sy _42ft\",\n        \"data-tooltip-position\": \"right\",\n        \"data-tooltip-content\": \"Ad Sets\",\n        \"data-hover\": \"tooltip\",\n        onClick: function() {},\n        label: null,\n        type: \"submit\",\n        value: \"1\",\n      },\n      undefined,\n      React.createElement(\n        \"div\",\n        null,\n        React.createElement(\"div\", { className: \"_tma\" }),\n        React.createElement(\"div\", { className: \"_tm8\" }),\n        React.createElement(\"div\", { className: \"_tm9\" }, 1)\n      ),\n      undefined\n    );\n  }\n  if (props.x === 307) {\n    return React.createElement(\n      \"button\",\n      {\n        className: \"_tm5 _tm6 _4jy0 _4jy6 _517h _51sy _42ft\",\n        \"data-tooltip-position\": \"right\",\n        \"data-tooltip-content\": \"Ads\",\n        \"data-hover\": \"tooltip\",\n        onClick: function() {},\n        label: null,\n        type: \"submit\",\n        value: \"1\",\n      },\n      undefined,\n      React.createElement(\n        \"div\",\n        null,\n        React.createElement(\"div\", { className: \"_tma\" }),\n        React.createElement(\"div\", { className: \"_tm8\" }),\n        React.createElement(\"div\", { className: \"_tm9\" }, 1)\n      ),\n      undefined\n    );\n  }\n};\n\nvar XUIButton4 = function(props) {\n  if (props.x === 4) {\n    return React.createElement(AbstractButton3, { x: 3 });\n  }\n  if (props.x === 21) {\n    return React.createElement(AbstractButton3, { x: 20 });\n  }\n  if (props.x === 24) {\n    return React.createElement(AbstractButton3, { x: 23 });\n  }\n  if (props.x === 69) {\n    return React.createElement(AbstractButton3, { x: 68 });\n  }\n  if (props.x === 72) {\n    return React.createElement(AbstractButton3, { x: 71 });\n  }\n  if (props.x === 78) {\n    return React.createElement(AbstractButton3, { x: 77 });\n  }\n  if (props.x === 81) {\n    return React.createElement(AbstractButton3, { x: 80 });\n  }\n  if (props.x === 90) {\n    return React.createElement(AbstractButton3, { x: 89 });\n  }\n  if (props.x === 93) {\n    return React.createElement(AbstractButton3, { x: 92 });\n  }\n  if (props.x === 96) {\n    return React.createElement(AbstractButton3, { x: 95 });\n  }\n  if (props.x === 100) {\n    return React.createElement(AbstractButton3, { x: 99 });\n  }\n  if (props.x === 110) {\n    return React.createElement(AbstractButton3, { x: 109 });\n  }\n  if (props.x === 113) {\n    return React.createElement(AbstractButton3, { x: 112 });\n  }\n  if (props.x === 131) {\n    return React.createElement(AbstractButton3, { x: 130 });\n  }\n  if (props.x === 139) {\n    return React.createElement(AbstractButton3, { x: 138 });\n  }\n  if (props.x === 157) {\n    return React.createElement(AbstractButton3, { x: 156 });\n  }\n  if (props.x === 162) {\n    return React.createElement(AbstractButton3, { x: 161 });\n  }\n  if (props.x === 188) {\n    return React.createElement(AbstractButton3, { x: 187 });\n  }\n  if (props.x === 270) {\n    return React.createElement(AbstractButton3, { x: 269 });\n  }\n  if (props.x === 304) {\n    return React.createElement(AbstractButton3, { x: 303 });\n  }\n  if (props.x === 306) {\n    return React.createElement(AbstractButton3, { x: 305 });\n  }\n  if (props.x === 308) {\n    return React.createElement(AbstractButton3, { x: 307 });\n  }\n};\n\nvar AbstractPopoverButton5 = function(props) {\n  if (props.x === 5) {\n    return React.createElement(XUIButton4, { x: 4 });\n  }\n  if (props.x === 132) {\n    return React.createElement(XUIButton4, { x: 131 });\n  }\n  if (props.x === 140) {\n    return React.createElement(XUIButton4, { x: 139 });\n  }\n  if (props.x === 271) {\n    return React.createElement(XUIButton4, { x: 270 });\n  }\n};\n\nvar ReactXUIPopoverButton6 = function(props) {\n  if (props.x === 6) {\n    return React.createElement(AbstractPopoverButton5, { x: 5 });\n  }\n  if (props.x === 133) {\n    return React.createElement(AbstractPopoverButton5, { x: 132 });\n  }\n  if (props.x === 141) {\n    return React.createElement(AbstractPopoverButton5, { x: 140 });\n  }\n  if (props.x === 272) {\n    return React.createElement(AbstractPopoverButton5, { x: 271 });\n  }\n};\n\nvar BIGAdAccountSelector7 = function(props) {\n  if (props.x === 7) {\n    return React.createElement(\"div\", null, React.createElement(ReactXUIPopoverButton6, { x: 6 }), null);\n  }\n};\n\nvar FluxContainer_AdsPEBIGAdAccountSelectorContainer_8 = function(props) {\n  if (props.x === 8) {\n    return React.createElement(BIGAdAccountSelector7, { x: 7 });\n  }\n};\n\nvar ErrorBoundary9 = function(props) {\n  if (props.x === 9) {\n    return React.createElement(FluxContainer_AdsPEBIGAdAccountSelectorContainer_8, { x: 8 });\n  }\n  if (props.x === 13) {\n    return React.createElement(FluxContainer_AdsPENavigationBarContainer_12, {\n      x: 12,\n    });\n  }\n  if (props.x === 27) {\n    return React.createElement(FluxContainer_AdsPEPublishButtonContainer_18, {\n      x: 26,\n    });\n  }\n  if (props.x === 32) {\n    return React.createElement(ReactPopoverMenu20, { x: 31 });\n  }\n  if (props.x === 38) {\n    return React.createElement(AdsPEResetDialog24, { x: 37 });\n  }\n  if (props.x === 57) {\n    return React.createElement(FluxContainer_AdsPETopErrorContainer_35, {\n      x: 56,\n    });\n  }\n  if (props.x === 60) {\n    return React.createElement(FluxContainer_AdsGuidanceChannel_36, { x: 59 });\n  }\n  if (props.x === 64) {\n    return React.createElement(FluxContainer_AdsBulkEditDialogContainer_38, {\n      x: 63,\n    });\n  }\n  if (props.x === 124) {\n    return React.createElement(AdsPECampaignGroupToolbarContainer57, {\n      x: 123,\n    });\n  }\n  if (props.x === 170) {\n    return React.createElement(AdsPEFilterContainer72, { x: 169 });\n  }\n  if (props.x === 175) {\n    return React.createElement(AdsPETablePagerContainer75, { x: 174 });\n  }\n  if (props.x === 193) {\n    return React.createElement(AdsPEStatRangeContainer81, { x: 192 });\n  }\n  if (props.x === 301) {\n    return React.createElement(FluxContainer_AdsPEMultiTabDrawerContainer_137, { x: 300 });\n  }\n  if (props.x === 311) {\n    return React.createElement(AdsPEOrganizerContainer139, { x: 310 });\n  }\n  if (props.x === 471) {\n    return React.createElement(AdsPECampaignGroupTableContainer159, { x: 470 });\n  }\n  if (props.x === 475) {\n    return React.createElement(AdsPEContentContainer161, { x: 474 });\n  }\n};\n\nvar AdsErrorBoundary10 = function(props) {\n  if (props.x === 10) {\n    return React.createElement(ErrorBoundary9, { x: 9 });\n  }\n  if (props.x === 14) {\n    return React.createElement(ErrorBoundary9, { x: 13 });\n  }\n  if (props.x === 28) {\n    return React.createElement(ErrorBoundary9, { x: 27 });\n  }\n  if (props.x === 33) {\n    return React.createElement(ErrorBoundary9, { x: 32 });\n  }\n  if (props.x === 39) {\n    return React.createElement(ErrorBoundary9, { x: 38 });\n  }\n  if (props.x === 58) {\n    return React.createElement(ErrorBoundary9, { x: 57 });\n  }\n  if (props.x === 61) {\n    return React.createElement(ErrorBoundary9, { x: 60 });\n  }\n  if (props.x === 65) {\n    return React.createElement(ErrorBoundary9, { x: 64 });\n  }\n  if (props.x === 125) {\n    return React.createElement(ErrorBoundary9, { x: 124 });\n  }\n  if (props.x === 171) {\n    return React.createElement(ErrorBoundary9, { x: 170 });\n  }\n  if (props.x === 176) {\n    return React.createElement(ErrorBoundary9, { x: 175 });\n  }\n  if (props.x === 194) {\n    return React.createElement(ErrorBoundary9, { x: 193 });\n  }\n  if (props.x === 302) {\n    return React.createElement(ErrorBoundary9, { x: 301 });\n  }\n  if (props.x === 312) {\n    return React.createElement(ErrorBoundary9, { x: 311 });\n  }\n  if (props.x === 472) {\n    return React.createElement(ErrorBoundary9, { x: 471 });\n  }\n  if (props.x === 476) {\n    return React.createElement(ErrorBoundary9, { x: 475 });\n  }\n};\n\nvar AdsPENavigationBar11 = function(props) {\n  if (props.x === 11) {\n    return React.createElement(\"div\", { className: \"_4t_9\" });\n  }\n};\n\nvar FluxContainer_AdsPENavigationBarContainer_12 = function(props) {\n  if (props.x === 12) {\n    return React.createElement(AdsPENavigationBar11, { x: 11 });\n  }\n};\n\nvar AdsPEDraftSyncStatus13 = function(props) {\n  if (props.x === 16) {\n    return React.createElement(\n      \"div\",\n      { className: \"_3ut-\", onClick: function() {} },\n      React.createElement(\"span\", { className: \"_3uu0\" }, React.createElement(ReactImage0, { x: 15 }))\n    );\n  }\n};\n\nvar FluxContainer_AdsPEDraftSyncStatusContainer_14 = function(props) {\n  if (props.x === 17) {\n    return React.createElement(AdsPEDraftSyncStatus13, { x: 16 });\n  }\n};\n\nvar AdsPEDraftErrorsStatus15 = function(props) {\n  if (props.x === 18) {\n    return null;\n  }\n};\n\nvar FluxContainer_viewFn_16 = function(props) {\n  if (props.x === 19) {\n    return React.createElement(AdsPEDraftErrorsStatus15, { x: 18 });\n  }\n};\n\nvar AdsPEPublishButton17 = function(props) {\n  if (props.x === 25) {\n    return React.createElement(\n      \"div\",\n      { className: \"_5533\" },\n      React.createElement(FluxContainer_AdsPEDraftSyncStatusContainer_14, {\n        x: 17,\n      }),\n      React.createElement(FluxContainer_viewFn_16, { x: 19 }),\n      null,\n      React.createElement(XUIButton4, { x: 21, key: \"discard\" }),\n      React.createElement(XUIButton4, { x: 24 })\n    );\n  }\n};\n\nvar FluxContainer_AdsPEPublishButtonContainer_18 = function(props) {\n  if (props.x === 26) {\n    return React.createElement(AdsPEPublishButton17, { x: 25 });\n  }\n};\n\nvar InlineBlock19 = function(props) {\n  if (props.x === 30) {\n    return React.createElement(\n      \"div\",\n      { className: \"uiPopover _6a _6b\", disabled: null },\n      React.createElement(ReactImage0, { x: 29, key: \".0\" })\n    );\n  }\n  if (props.x === 73) {\n    return React.createElement(\n      \"div\",\n      { className: \"uiPopover _6a _6b\", disabled: null },\n      React.createElement(XUIButton4, { x: 72, key: \".0\" })\n    );\n  }\n  if (props.x === 82) {\n    return React.createElement(\n      \"div\",\n      { className: \"_1nwm uiPopover _6a _6b\", disabled: null },\n      React.createElement(XUIButton4, { x: 81, key: \".0\" })\n    );\n  }\n  if (props.x === 101) {\n    return React.createElement(\n      \"div\",\n      { size: \"large\", className: \"uiPopover _6a _6b\", disabled: null },\n      React.createElement(XUIButton4, { x: 100, key: \".0\" })\n    );\n  }\n  if (props.x === 273) {\n    return React.createElement(\n      \"div\",\n      {\n        className: \"_3-90 uiPopover _6a _6b\",\n        style: { marginTop: 2 },\n        disabled: null,\n      },\n      React.createElement(ReactXUIPopoverButton6, { x: 272, key: \".0\" })\n    );\n  }\n};\n\nvar ReactPopoverMenu20 = function(props) {\n  if (props.x === 31) {\n    return React.createElement(InlineBlock19, { x: 30 });\n  }\n  if (props.x === 74) {\n    return React.createElement(InlineBlock19, { x: 73 });\n  }\n  if (props.x === 83) {\n    return React.createElement(InlineBlock19, { x: 82 });\n  }\n  if (props.x === 102) {\n    return React.createElement(InlineBlock19, { x: 101 });\n  }\n  if (props.x === 274) {\n    return React.createElement(InlineBlock19, { x: 273 });\n  }\n};\n\nvar LeftRight21 = function(props) {\n  if (props.x === 34) {\n    return React.createElement(\n      \"div\",\n      { className: \"clearfix\" },\n      React.createElement(\n        \"div\",\n        { key: \"left\", className: \"_ohe lfloat\" },\n        React.createElement(\n          \"div\",\n          { className: \"_34_j\" },\n          React.createElement(\"div\", { className: \"_34_k\" }, React.createElement(AdsErrorBoundary10, { x: 10 })),\n          React.createElement(\"div\", { className: \"_2u-6\" }, React.createElement(AdsErrorBoundary10, { x: 14 }))\n        )\n      ),\n      React.createElement(\n        \"div\",\n        { key: \"right\", className: \"_ohf rfloat\" },\n        React.createElement(\n          \"div\",\n          { className: \"_34_m\" },\n          React.createElement(\n            \"div\",\n            { key: \"0\", className: \"_5ju2\" },\n            React.createElement(AdsErrorBoundary10, { x: 28 })\n          ),\n          React.createElement(\n            \"div\",\n            { key: \"1\", className: \"_5ju2\" },\n            React.createElement(AdsErrorBoundary10, { x: 33 })\n          )\n        )\n      )\n    );\n  }\n  if (props.x === 232) {\n    return React.createElement(\n      \"div\",\n      { direction: \"left\", className: \"clearfix\" },\n      React.createElement(\n        \"div\",\n        { key: \"left\", className: \"_ohe lfloat\" },\n        React.createElement(AdsLabeledField104, { x: 231 })\n      ),\n      React.createElement(\n        \"div\",\n        { key: \"right\", className: \"\" },\n        React.createElement(\n          \"div\",\n          { className: \"_42ef\" },\n          React.createElement(\"div\", { className: \"_2oc7\" }, \"Clicks to Website\")\n        )\n      )\n    );\n  }\n  if (props.x === 235) {\n    return React.createElement(\n      \"div\",\n      { className: \"_3-8x clearfix\", direction: \"left\" },\n      React.createElement(\n        \"div\",\n        { key: \"left\", className: \"_ohe lfloat\" },\n        React.createElement(AdsLabeledField104, { x: 234 })\n      ),\n      React.createElement(\n        \"div\",\n        { key: \"right\", className: \"\" },\n        React.createElement(\n          \"div\",\n          { className: \"_42ef\" },\n          React.createElement(\"div\", { className: \"_2oc7\" }, \"Auction\")\n        )\n      )\n    );\n  }\n  if (props.x === 245) {\n    return React.createElement(\n      \"div\",\n      { className: \"_3-8y clearfix\", direction: \"left\" },\n      React.createElement(\n        \"div\",\n        { key: \"left\", className: \"_ohe lfloat\" },\n        React.createElement(AdsLabeledField104, { x: 240 })\n      ),\n      React.createElement(\n        \"div\",\n        { key: \"right\", className: \"\" },\n        React.createElement(\n          \"div\",\n          { className: \"_42ef\" },\n          React.createElement(FluxContainer_AdsCampaignGroupSpendCapContainer_107, { x: 244 })\n        )\n      )\n    );\n  }\n  if (props.x === 277) {\n    return React.createElement(\n      \"div\",\n      { className: \"_5dw9 _5dwa clearfix\" },\n      React.createElement(\n        \"div\",\n        { key: \"left\", className: \"_ohe lfloat\" },\n        React.createElement(XUICardHeaderTitle100, { x: 265, key: \".0\" })\n      ),\n      React.createElement(\n        \"div\",\n        { key: \"right\", className: \"_ohf rfloat\" },\n        React.createElement(FluxContainer_AdsPluginizedLinksMenuContainer_121, { x: 276, key: \".1\" })\n      )\n    );\n  }\n};\n\nvar AdsUnifiedNavigationLocalNav22 = function(props) {\n  if (props.x === 35) {\n    return React.createElement(\"div\", { className: \"_34_i\" }, React.createElement(LeftRight21, { x: 34 }));\n  }\n};\n\nvar XUIDialog23 = function(props) {\n  if (props.x === 36) {\n    return null;\n  }\n};\n\nvar AdsPEResetDialog24 = function(props) {\n  if (props.x === 37) {\n    return React.createElement(\"span\", null, React.createElement(XUIDialog23, { x: 36, key: \"dialog/.0\" }));\n  }\n};\n\nvar AdsPETopNav25 = function(props) {\n  if (props.x === 40) {\n    return React.createElement(\n      \"div\",\n      { style: { width: 1306 } },\n      React.createElement(AdsUnifiedNavigationLocalNav22, { x: 35 }),\n      React.createElement(AdsErrorBoundary10, { x: 39 })\n    );\n  }\n};\n\nvar FluxContainer_AdsPETopNavContainer_26 = function(props) {\n  if (props.x === 41) {\n    return React.createElement(AdsPETopNav25, { x: 40 });\n  }\n};\n\nvar XUIAbstractGlyphButton27 = function(props) {\n  if (props.x === 46) {\n    return React.createElement(AbstractButton3, { x: 45 });\n  }\n  if (props.x === 150) {\n    return React.createElement(AbstractButton3, { x: 149 });\n  }\n};\n\nvar XUICloseButton28 = function(props) {\n  if (props.x === 47) {\n    return React.createElement(XUIAbstractGlyphButton27, { x: 46 });\n  }\n  if (props.x === 151) {\n    return React.createElement(XUIAbstractGlyphButton27, { x: 150 });\n  }\n};\n\nvar XUIText29 = function(props) {\n  if (props.x === 48) {\n    return React.createElement(\"span\", { display: \"inline\", className: \" _50f7\" }, \"Ads Manager\");\n  }\n  if (props.x === 205) {\n    return React.createElement(\"span\", { className: \"_2x9f  _50f5 _50f7\", display: \"inline\" }, \"Editing Campaign\");\n  }\n  if (props.x === 206) {\n    return React.createElement(\"span\", { display: \"inline\", className: \" _50f5 _50f7\" }, \"Test Campaign\");\n  }\n};\n\nvar XUINotice30 = function(props) {\n  if (props.x === 51) {\n    return React.createElement(\n      \"div\",\n      { size: \"medium\", className: \"_585n _585o _2wdd\" },\n      React.createElement(ReactImage0, { x: 42 }),\n      React.createElement(XUICloseButton28, { x: 47 }),\n      React.createElement(\n        \"div\",\n        { className: \"_585r _2i-a _50f4\" },\n        \"Please go to \",\n        React.createElement(Link2, { x: 50 }),\n        \" to set up a payment method for this ad account.\"\n      )\n    );\n  }\n};\n\nvar ReactCSSTransitionGroupChild31 = function(props) {\n  if (props.x === 52) {\n    return React.createElement(XUINotice30, { x: 51 });\n  }\n};\n\nvar ReactTransitionGroup32 = function(props) {\n  if (props.x === 53) {\n    return React.createElement(\"span\", null, React.createElement(ReactCSSTransitionGroupChild31, { x: 52, key: \".0\" }));\n  }\n};\n\nvar ReactCSSTransitionGroup33 = function(props) {\n  if (props.x === 54) {\n    return React.createElement(ReactTransitionGroup32, { x: 53 });\n  }\n};\n\nvar AdsPETopError34 = function(props) {\n  if (props.x === 55) {\n    return React.createElement(\n      \"div\",\n      { className: \"_2wdc\" },\n      React.createElement(ReactCSSTransitionGroup33, { x: 54 })\n    );\n  }\n};\n\nvar FluxContainer_AdsPETopErrorContainer_35 = function(props) {\n  if (props.x === 56) {\n    return React.createElement(AdsPETopError34, { x: 55 });\n  }\n};\n\nvar FluxContainer_AdsGuidanceChannel_36 = function(props) {\n  if (props.x === 59) {\n    return null;\n  }\n};\n\nvar ResponsiveBlock37 = function(props) {\n  if (props.x === 62) {\n    return React.createElement(\n      \"div\",\n      { className: \"_4u-c\" },\n      [\n        React.createElement(AdsErrorBoundary10, { x: 58, key: 1 }),\n        React.createElement(AdsErrorBoundary10, { x: 61, key: 2 }),\n      ],\n      React.createElement(\n        \"div\",\n        { key: \"sensor\", className: \"_4u-f\" },\n        React.createElement(\"iframe\", {\n          \"aria-hidden\": \"true\",\n          className: \"_1_xb\",\n          tabIndex: \"-1\",\n        })\n      )\n    );\n  }\n  if (props.x === 469) {\n    return React.createElement(\n      \"div\",\n      { className: \"_4u-c\" },\n      React.createElement(AdsPEDataTableContainer158, { x: 468 }),\n      React.createElement(\n        \"div\",\n        { key: \"sensor\", className: \"_4u-f\" },\n        React.createElement(\"iframe\", {\n          \"aria-hidden\": \"true\",\n          className: \"_1_xb\",\n          tabIndex: \"-1\",\n        })\n      )\n    );\n  }\n};\n\nvar FluxContainer_AdsBulkEditDialogContainer_38 = function(props) {\n  if (props.x === 63) {\n    return null;\n  }\n};\n\nvar Column39 = function(props) {\n  if (props.x === 66) {\n    return React.createElement(\n      \"div\",\n      { className: \"_4bl8 _4bl7\" },\n      React.createElement(\n        \"div\",\n        { className: \"_3c5f\" },\n        null,\n        null,\n        React.createElement(\"div\", { className: \"_3c5i\" }),\n        null\n      )\n    );\n  }\n};\n\nvar XUIButtonGroup40 = function(props) {\n  if (props.x === 75) {\n    return React.createElement(\n      \"div\",\n      { className: \"_5n7z _51xa\" },\n      React.createElement(XUIButton4, { x: 69 }),\n      React.createElement(ReactPopoverMenu20, { x: 74 })\n    );\n  }\n  if (props.x === 84) {\n    return React.createElement(\n      \"div\",\n      { className: \"_5n7z _51xa\" },\n      React.createElement(XUIButton4, { x: 78, key: \"edit\" }),\n      React.createElement(ReactPopoverMenu20, { x: 83, key: \"editMenu\" })\n    );\n  }\n  if (props.x === 97) {\n    return React.createElement(\n      \"div\",\n      { className: \"_5n7z _51xa\" },\n      React.createElement(XUIButton4, { x: 90, key: \"revert\" }),\n      React.createElement(XUIButton4, { x: 93, key: \"delete\" }),\n      React.createElement(XUIButton4, { x: 96, key: \"duplicate\" })\n    );\n  }\n  if (props.x === 117) {\n    return React.createElement(\n      \"div\",\n      { className: \"_5n7z _51xa\" },\n      React.createElement(AdsPEExportImportMenuContainer48, { x: 107 }),\n      React.createElement(XUIButton4, { x: 110, key: \"createReport\" }),\n      React.createElement(AdsPECampaignGroupTagContainer51, {\n        x: 116,\n        key: \"tags\",\n      })\n    );\n  }\n};\n\nvar AdsPEEditToolbarButton41 = function(props) {\n  if (props.x === 85) {\n    return React.createElement(XUIButtonGroup40, { x: 84 });\n  }\n};\n\nvar FluxContainer_AdsPEEditCampaignGroupToolbarButtonContainer_42 = function(props) {\n  if (props.x === 86) {\n    return React.createElement(AdsPEEditToolbarButton41, { x: 85 });\n  }\n};\n\nvar FluxContainer_AdsPEEditToolbarButtonContainer_43 = function(props) {\n  if (props.x === 87) {\n    return React.createElement(FluxContainer_AdsPEEditCampaignGroupToolbarButtonContainer_42, { x: 86 });\n  }\n};\n\nvar AdsPEExportImportMenu44 = function(props) {\n  if (props.x === 103) {\n    return React.createElement(ReactPopoverMenu20, { x: 102, key: \"export\" });\n  }\n};\n\nvar FluxContainer_AdsPECustomizeExportContainer_45 = function(props) {\n  if (props.x === 104) {\n    return null;\n  }\n};\n\nvar AdsPEExportAsTextDialog46 = function(props) {\n  if (props.x === 105) {\n    return null;\n  }\n};\n\nvar FluxContainer_AdsPEExportAsTextDialogContainer_47 = function(props) {\n  if (props.x === 106) {\n    return React.createElement(AdsPEExportAsTextDialog46, { x: 105 });\n  }\n};\n\nvar AdsPEExportImportMenuContainer48 = function(props) {\n  if (props.x === 107) {\n    return React.createElement(\n      \"span\",\n      null,\n      React.createElement(AdsPEExportImportMenu44, { x: 103 }),\n      React.createElement(FluxContainer_AdsPECustomizeExportContainer_45, {\n        x: 104,\n      }),\n      React.createElement(FluxContainer_AdsPEExportAsTextDialogContainer_47, {\n        x: 106,\n      }),\n      null,\n      null\n    );\n  }\n};\n\nvar Constructor49 = function(props) {\n  if (props.x === 114) {\n    return null;\n  }\n  if (props.x === 142) {\n    return null;\n  }\n  if (props.x === 143) {\n    return null;\n  }\n  if (props.x === 183) {\n    return null;\n  }\n};\n\nvar TagSelectorPopover50 = function(props) {\n  if (props.x === 115) {\n    return React.createElement(\n      \"span\",\n      { className: \" _3d6e\" },\n      React.createElement(XUIButton4, { x: 113 }),\n      React.createElement(Constructor49, { x: 114, key: \"layer\" })\n    );\n  }\n};\n\nvar AdsPECampaignGroupTagContainer51 = function(props) {\n  if (props.x === 116) {\n    return React.createElement(TagSelectorPopover50, {\n      x: 115,\n      key: \"98010048849317\",\n    });\n  }\n};\n\nvar AdsRuleToolbarMenu52 = function(props) {\n  if (props.x === 118) {\n    return null;\n  }\n};\n\nvar FluxContainer_AdsPERuleToolbarMenuContainer_53 = function(props) {\n  if (props.x === 119) {\n    return React.createElement(AdsRuleToolbarMenu52, { x: 118 });\n  }\n};\n\nvar FillColumn54 = function(props) {\n  if (props.x === 120) {\n    return React.createElement(\n      \"div\",\n      { className: \"_4bl9\" },\n      React.createElement(\n        \"span\",\n        { className: \"_3c5e\" },\n        React.createElement(\n          \"span\",\n          null,\n          React.createElement(XUIButtonGroup40, { x: 75 }),\n          React.createElement(FluxContainer_AdsPEEditToolbarButtonContainer_43, { x: 87 }),\n          null,\n          React.createElement(XUIButtonGroup40, { x: 97 })\n        ),\n        React.createElement(XUIButtonGroup40, { x: 117 }),\n        React.createElement(FluxContainer_AdsPERuleToolbarMenuContainer_53, {\n          x: 119,\n        })\n      )\n    );\n  }\n};\n\nvar Layout55 = function(props) {\n  if (props.x === 121) {\n    return React.createElement(\n      \"div\",\n      { className: \"clearfix\" },\n      React.createElement(Column39, { x: 66, key: \"1\" }),\n      React.createElement(FillColumn54, { x: 120, key: \"0\" })\n    );\n  }\n};\n\nvar AdsPEMainPaneToolbar56 = function(props) {\n  if (props.x === 122) {\n    return React.createElement(\"div\", { className: \"_3c5b clearfix\" }, React.createElement(Layout55, { x: 121 }));\n  }\n};\n\nvar AdsPECampaignGroupToolbarContainer57 = function(props) {\n  if (props.x === 123) {\n    return React.createElement(AdsPEMainPaneToolbar56, { x: 122 });\n  }\n};\n\nvar AdsPEFiltersPopover58 = function(props) {\n  if (props.x === 144) {\n    return React.createElement(\n      \"span\",\n      { className: \"_5b-l  _5bbe\" },\n      React.createElement(ReactXUIPopoverButton6, { x: 133 }),\n      React.createElement(ReactXUIPopoverButton6, { x: 141 }),\n      [\n        React.createElement(Constructor49, { x: 142, key: \"filterMenu/.0\" }),\n        React.createElement(Constructor49, { x: 143, key: \"searchMenu/.0\" }),\n      ]\n    );\n  }\n};\n\nvar AbstractCheckboxInput59 = function(props) {\n  if (props.x === 145) {\n    return React.createElement(\n      \"label\",\n      { className: \"uiInputLabelInput _55sg _kv1\" },\n      React.createElement(\"input\", {\n        checked: true,\n        disabled: true,\n        name: \"filterUnpublished\",\n        value: \"on\",\n        onClick: function() {},\n        className: null,\n        id: \"js_input_label_21\",\n        type: \"checkbox\",\n      }),\n      React.createElement(\"span\", {\n        \"data-hover\": null,\n        \"data-tooltip-content\": undefined,\n      })\n    );\n  }\n  if (props.x === 336) {\n    return React.createElement(\n      \"label\",\n      { className: \"_4h2r _55sg _kv1\" },\n      React.createElement(\"input\", {\n        checked: undefined,\n        onChange: function() {},\n        className: null,\n        type: \"checkbox\",\n      }),\n      React.createElement(\"span\", {\n        \"data-hover\": null,\n        \"data-tooltip-content\": undefined,\n      })\n    );\n  }\n};\n\nvar XUICheckboxInput60 = function(props) {\n  if (props.x === 146) {\n    return React.createElement(AbstractCheckboxInput59, { x: 145 });\n  }\n  if (props.x === 337) {\n    return React.createElement(AbstractCheckboxInput59, { x: 336 });\n  }\n};\n\nvar InputLabel61 = function(props) {\n  if (props.x === 147) {\n    return React.createElement(\n      \"div\",\n      { display: \"block\", className: \"uiInputLabel clearfix\" },\n      React.createElement(XUICheckboxInput60, { x: 146 }),\n      React.createElement(\n        \"label\",\n        { className: \"uiInputLabelLabel\", htmlFor: \"js_input_label_21\" },\n        \"Always show new items\"\n      )\n    );\n  }\n};\n\nvar AdsPopoverLink62 = function(props) {\n  if (props.x === 154) {\n    return React.createElement(\n      \"span\",\n      null,\n      React.createElement(\n        \"span\",\n        {\n          onMouseEnter: function() {},\n          onMouseLeave: function() {},\n          onMouseUp: undefined,\n        },\n        React.createElement(\"span\", { className: \"_3o_j\" }),\n        React.createElement(ReactImage0, { x: 153 })\n      ),\n      null\n    );\n  }\n  if (props.x === 238) {\n    return React.createElement(\n      \"span\",\n      null,\n      React.createElement(\n        \"span\",\n        {\n          onMouseEnter: function() {},\n          onMouseLeave: function() {},\n          onMouseUp: undefined,\n        },\n        React.createElement(\"span\", { className: \"_3o_j\" }),\n        React.createElement(ReactImage0, { x: 237 })\n      ),\n      null\n    );\n  }\n};\n\nvar AdsHelpLink63 = function(props) {\n  if (props.x === 155) {\n    return React.createElement(AdsPopoverLink62, { x: 154 });\n  }\n  if (props.x === 239) {\n    return React.createElement(AdsPopoverLink62, { x: 238 });\n  }\n};\n\nvar BUIFilterTokenInput64 = function(props) {\n  if (props.x === 158) {\n    return React.createElement(\n      \"div\",\n      { className: \"_5b5o _3yz3 _4cld\" },\n      React.createElement(\n        \"div\",\n        { className: \"_5b5t _2d2k\" },\n        React.createElement(ReactImage0, { x: 152 }),\n        React.createElement(\n          \"div\",\n          { className: \"_5b5r\" },\n          \"Campaigns: (1)\",\n          React.createElement(AdsHelpLink63, { x: 155 })\n        )\n      ),\n      React.createElement(XUIButton4, { x: 157 })\n    );\n  }\n};\n\nvar BUIFilterToken65 = function(props) {\n  if (props.x === 159) {\n    return React.createElement(\n      \"div\",\n      { className: \"_3yz1 _3yz2 _3dad\" },\n      React.createElement(\n        \"div\",\n        { className: \"_3yz4\", \"aria-hidden\": false },\n        React.createElement(\n          \"div\",\n          { onClick: function() {}, className: \"_3yz5\" },\n          React.createElement(ReactImage0, { x: 148 }),\n          React.createElement(\"div\", { className: \"_3yz7\" }, \"Campaigns:\"),\n          React.createElement(\n            \"div\",\n            {\n              className: \"ellipsis _3yz8\",\n              \"data-hover\": \"tooltip\",\n              \"data-tooltip-display\": \"overflow\",\n            },\n            \"(1)\"\n          )\n        ),\n        null,\n        React.createElement(XUICloseButton28, { x: 151 })\n      ),\n      React.createElement(BUIFilterTokenInput64, { x: 158 })\n    );\n  }\n};\n\nvar BUIFilterTokenCreateButton66 = function(props) {\n  if (props.x === 163) {\n    return React.createElement(\"div\", { className: \"_1tc\" }, React.createElement(XUIButton4, { x: 162 }));\n  }\n};\n\nvar BUIFilterTokenizer67 = function(props) {\n  if (props.x === 164) {\n    return React.createElement(\n      \"div\",\n      { className: \"_5b-m  clearfix\" },\n      undefined,\n      [],\n      React.createElement(BUIFilterToken65, { x: 159, key: \"token0\" }),\n      React.createElement(BUIFilterTokenCreateButton66, { x: 163 }),\n      null,\n      React.createElement(\"div\", { className: \"_49u3\" })\n    );\n  }\n};\n\nvar XUIAmbientNUX68 = function(props) {\n  if (props.x === 165) {\n    return null;\n  }\n  if (props.x === 189) {\n    return null;\n  }\n  if (props.x === 200) {\n    return null;\n  }\n};\n\nvar XUIAmbientNUX69 = function(props) {\n  if (props.x === 166) {\n    return React.createElement(XUIAmbientNUX68, { x: 165 });\n  }\n  if (props.x === 190) {\n    return React.createElement(XUIAmbientNUX68, { x: 189 });\n  }\n  if (props.x === 201) {\n    return React.createElement(XUIAmbientNUX68, { x: 200 });\n  }\n};\n\nvar AdsPEAmbientNUXMegaphone70 = function(props) {\n  if (props.x === 167) {\n    return React.createElement(\n      \"span\",\n      null,\n      React.createElement(\"span\", {}),\n      React.createElement(XUIAmbientNUX69, { x: 166, key: \"nux\" })\n    );\n  }\n};\n\nvar AdsPEFilters71 = function(props) {\n  if (props.x === 168) {\n    return React.createElement(\n      \"div\",\n      { className: \"_4rw_\" },\n      React.createElement(AdsPEFiltersPopover58, { x: 144 }),\n      React.createElement(\"div\", { className: \"_1eo\" }, React.createElement(InputLabel61, { x: 147 })),\n      React.createElement(BUIFilterTokenizer67, { x: 164 }),\n      \"\",\n      React.createElement(AdsPEAmbientNUXMegaphone70, { x: 167 })\n    );\n  }\n};\n\nvar AdsPEFilterContainer72 = function(props) {\n  if (props.x === 169) {\n    return React.createElement(AdsPEFilters71, { x: 168 });\n  }\n};\n\nvar AdsPETablePager73 = function(props) {\n  if (props.x === 172) {\n    return null;\n  }\n};\n\nvar AdsPECampaignGroupTablePagerContainer74 = function(props) {\n  if (props.x === 173) {\n    return React.createElement(AdsPETablePager73, { x: 172 });\n  }\n};\n\nvar AdsPETablePagerContainer75 = function(props) {\n  if (props.x === 174) {\n    return React.createElement(AdsPECampaignGroupTablePagerContainer74, {\n      x: 173,\n    });\n  }\n};\n\nvar ReactXUIError76 = function(props) {\n  if (props.x === 181) {\n    return React.createElement(AbstractButton3, { x: 180 });\n  }\n  if (props.x === 216) {\n    return React.createElement(\n      \"div\",\n      { className: \"_40bf _2vl4 _1h18\" },\n      null,\n      null,\n      React.createElement(\n        \"div\",\n        { className: \"_2vl9 _1h1f\", style: { backgroundColor: \"#fff\" } },\n        React.createElement(\n          \"div\",\n          { className: \"_2vla _1h1g\" },\n          React.createElement(\n            \"div\",\n            null,\n            null,\n            React.createElement(\"textarea\", {\n              className: \"_2vli _2vlj _1h26 _1h27\",\n              dir: \"auto\",\n              disabled: undefined,\n              id: undefined,\n              maxLength: null,\n              value: \"Test Campaign\",\n              onBlur: function() {},\n              onChange: function() {},\n              onFocus: function() {},\n              onKeyDown: function() {},\n            }),\n            null\n          ),\n          React.createElement(\"div\", {\n            \"aria-hidden\": \"true\",\n            className: \"_2vlk\",\n          })\n        )\n      ),\n      null\n    );\n  }\n  if (props.x === 221) {\n    return React.createElement(XUICard94, { x: 220 });\n  }\n  if (props.x === 250) {\n    return React.createElement(XUICard94, { x: 249 });\n  }\n  if (props.x === 280) {\n    return React.createElement(XUICard94, { x: 279 });\n  }\n};\n\nvar BUIPopoverButton77 = function(props) {\n  if (props.x === 182) {\n    return React.createElement(ReactXUIError76, { x: 181 });\n  }\n};\n\nvar BUIDateRangePicker78 = function(props) {\n  if (props.x === 184) {\n    return React.createElement(\"span\", null, React.createElement(BUIPopoverButton77, { x: 182 }), [\n      React.createElement(Constructor49, { x: 183, key: \"layer/.0\" }),\n    ]);\n  }\n};\n\nvar AdsPEStatsRangePicker79 = function(props) {\n  if (props.x === 185) {\n    return React.createElement(BUIDateRangePicker78, { x: 184 });\n  }\n};\n\nvar AdsPEStatRange80 = function(props) {\n  if (props.x === 191) {\n    return React.createElement(\n      \"div\",\n      { className: \"_3c5k\" },\n      React.createElement(\"span\", { className: \"_3c5j\" }, \"Stats:\"),\n      React.createElement(\n        \"span\",\n        { className: \"_3c5l\" },\n        React.createElement(AdsPEStatsRangePicker79, { x: 185 }),\n        React.createElement(XUIButton4, { x: 188, key: \"settings\" })\n      ),\n      [React.createElement(XUIAmbientNUX69, { x: 190, key: \"roasNUX/.0\" })]\n    );\n  }\n};\n\nvar AdsPEStatRangeContainer81 = function(props) {\n  if (props.x === 192) {\n    return React.createElement(AdsPEStatRange80, { x: 191 });\n  }\n};\n\nvar AdsPESideTrayTabButton82 = function(props) {\n  if (props.x === 196) {\n    return React.createElement(\n      \"div\",\n      { className: \"_1-ly _59j9 _d9a\", onClick: function() {} },\n      React.createElement(ReactImage0, { x: 195 }),\n      React.createElement(\"div\", { className: \"_vf7\" }),\n      React.createElement(\"div\", { className: \"_vf8\" })\n    );\n  }\n  if (props.x === 199) {\n    return React.createElement(\n      \"div\",\n      { className: \" _1-lz _d9a\", onClick: function() {} },\n      React.createElement(ReactImage0, { x: 198 }),\n      React.createElement(\"div\", { className: \"_vf7\" }),\n      React.createElement(\"div\", { className: \"_vf8\" })\n    );\n  }\n  if (props.x === 203) {\n    return null;\n  }\n};\n\nvar AdsPEEditorTrayTabButton83 = function(props) {\n  if (props.x === 197) {\n    return React.createElement(AdsPESideTrayTabButton82, { x: 196 });\n  }\n};\n\nvar AdsPEInsightsTrayTabButton84 = function(props) {\n  if (props.x === 202) {\n    return React.createElement(\n      \"span\",\n      null,\n      React.createElement(AdsPESideTrayTabButton82, { x: 199 }),\n      React.createElement(XUIAmbientNUX69, { x: 201, key: \"roasNUX\" })\n    );\n  }\n};\n\nvar AdsPENekoDebuggerTrayTabButton85 = function(props) {\n  if (props.x === 204) {\n    return React.createElement(AdsPESideTrayTabButton82, { x: 203 });\n  }\n};\n\nvar AdsPEEditorChildLink86 = function(props) {\n  if (props.x === 211) {\n    return React.createElement(\n      \"div\",\n      { className: \"_3ywr\" },\n      React.createElement(Link2, { x: 208 }),\n      React.createElement(\"span\", { className: \"_3ywq\" }, \"|\"),\n      React.createElement(Link2, { x: 210 })\n    );\n  }\n};\n\nvar AdsPEEditorChildLinkContainer87 = function(props) {\n  if (props.x === 212) {\n    return React.createElement(AdsPEEditorChildLink86, { x: 211 });\n  }\n};\n\nvar AdsPEHeaderSection88 = function(props) {\n  if (props.x === 213) {\n    return React.createElement(\n      \"div\",\n      { className: \"_yke\" },\n      React.createElement(\"div\", { className: \"_2x9d _pr-\" }),\n      React.createElement(XUIText29, { x: 205 }),\n      React.createElement(\n        \"div\",\n        { className: \"_3a-a\" },\n        React.createElement(\"div\", { className: \"_3a-b\" }, React.createElement(XUIText29, { x: 206 }))\n      ),\n      React.createElement(AdsPEEditorChildLinkContainer87, { x: 212 })\n    );\n  }\n};\n\nvar AdsPECampaignGroupHeaderSectionContainer89 = function(props) {\n  if (props.x === 214) {\n    return React.createElement(AdsPEHeaderSection88, { x: 213 });\n  }\n};\n\nvar AdsEditorLoadingErrors90 = function(props) {\n  if (props.x === 215) {\n    return null;\n  }\n};\n\nvar AdsTextInput91 = function(props) {\n  if (props.x === 217) {\n    return React.createElement(ReactXUIError76, { x: 216 });\n  }\n};\n\nvar BUIFormElement92 = function(props) {\n  if (props.x === 218) {\n    return React.createElement(\n      \"div\",\n      { className: \"_5521 clearfix\" },\n      React.createElement(\n        \"div\",\n        { className: \"_5522 _3w5q\" },\n        React.createElement(\n          \"label\",\n          {\n            onClick: undefined,\n            htmlFor: \"1467872040612:1961945894\",\n            className: \"_5523 _3w5r\",\n          },\n          \"Campaign Name\",\n          null\n        )\n      ),\n      React.createElement(\n        \"div\",\n        { className: \"_5527\" },\n        React.createElement(\n          \"div\",\n          { className: \"_5528\" },\n          React.createElement(\n            \"span\",\n            { key: \".0\", className: \"_40bg\", id: \"1467872040612:1961945894\" },\n            React.createElement(AdsTextInput91, {\n              x: 217,\n              key: \"nameEditor98010048849317\",\n            }),\n            null\n          )\n        ),\n        null\n      )\n    );\n  }\n};\n\nvar BUIForm93 = function(props) {\n  if (props.x === 219) {\n    return React.createElement(\n      \"div\",\n      { className: \"_5ks1 _550r  _550t _550y _3w5n\" },\n      React.createElement(BUIFormElement92, { x: 218, key: \".0\" })\n    );\n  }\n};\n\nvar XUICard94 = function(props) {\n  if (props.x === 220) {\n    return React.createElement(\n      \"div\",\n      { className: \"_40bc _12k2 _4-u2  _4-u8\" },\n      React.createElement(BUIForm93, { x: 219 })\n    );\n  }\n  if (props.x === 249) {\n    return React.createElement(\n      \"div\",\n      { className: \"_12k2 _4-u2  _4-u8\" },\n      React.createElement(AdsCardHeader103, { x: 230 }),\n      React.createElement(AdsCardSection108, { x: 248 })\n    );\n  }\n  if (props.x === 279) {\n    return React.createElement(\n      \"div\",\n      { className: \"_12k2 _4-u2  _4-u8\" },\n      React.createElement(AdsCardLeftRightHeader122, { x: 278 })\n    );\n  }\n};\n\nvar AdsCard95 = function(props) {\n  if (props.x === 222) {\n    return React.createElement(ReactXUIError76, { x: 221 });\n  }\n  if (props.x === 251) {\n    return React.createElement(ReactXUIError76, { x: 250 });\n  }\n  if (props.x === 281) {\n    return React.createElement(ReactXUIError76, { x: 280 });\n  }\n};\n\nvar AdsEditorNameSection96 = function(props) {\n  if (props.x === 223) {\n    return React.createElement(AdsCard95, { x: 222 });\n  }\n};\n\nvar AdsCampaignGroupNameSectionContainer97 = function(props) {\n  if (props.x === 224) {\n    return React.createElement(AdsEditorNameSection96, {\n      x: 223,\n      key: \"nameSection98010048849317\",\n    });\n  }\n};\n\nvar _render98 = function(props) {\n  if (props.x === 225) {\n    return React.createElement(AdsCampaignGroupNameSectionContainer97, {\n      x: 224,\n    });\n  }\n};\n\nvar AdsPluginWrapper99 = function(props) {\n  if (props.x === 226) {\n    return React.createElement(_render98, { x: 225 });\n  }\n  if (props.x === 255) {\n    return React.createElement(_render111, { x: 254 });\n  }\n  if (props.x === 258) {\n    return React.createElement(_render113, { x: 257 });\n  }\n  if (props.x === 287) {\n    return React.createElement(_render127, { x: 286 });\n  }\n  if (props.x === 291) {\n    return React.createElement(_render130, { x: 290 });\n  }\n};\n\nvar XUICardHeaderTitle100 = function(props) {\n  if (props.x === 227) {\n    return React.createElement(\n      \"span\",\n      { className: \"_38my\" },\n      \"Campaign Details\",\n      null,\n      React.createElement(\"span\", { className: \"_c1c\" })\n    );\n  }\n  if (props.x === 265) {\n    return React.createElement(\n      \"span\",\n      { className: \"_38my\" },\n      [\n        React.createElement(\"span\", { key: 1 }, \"Campaign ID\", \": \", \"98010048849317\"),\n        React.createElement(\n          \"div\",\n          { className: \"_5lh9\", key: 2 },\n          React.createElement(FluxContainer_AdsCampaignGroupStatusSwitchContainer_119, { x: 264 })\n        ),\n      ],\n      null,\n      React.createElement(\"span\", { className: \"_c1c\" })\n    );\n  }\n};\n\nvar XUICardSection101 = function(props) {\n  if (props.x === 228) {\n    return React.createElement(\n      \"div\",\n      { className: \"_5dw9 _5dwa _4-u3\" },\n      [React.createElement(XUICardHeaderTitle100, { x: 227, key: \".0\" })],\n      undefined,\n      undefined,\n      React.createElement(\"div\", { className: \"_3s3-\" })\n    );\n  }\n  if (props.x === 247) {\n    return React.createElement(\n      \"div\",\n      { className: \"_12jy _4-u3\" },\n      React.createElement(\n        \"div\",\n        { className: \"_3-8j\" },\n        React.createElement(FlexibleBlock105, { x: 233 }),\n        React.createElement(FlexibleBlock105, { x: 236 }),\n        React.createElement(FlexibleBlock105, { x: 246 }),\n        null,\n        null\n      )\n    );\n  }\n};\n\nvar XUICardHeader102 = function(props) {\n  if (props.x === 229) {\n    return React.createElement(XUICardSection101, { x: 228 });\n  }\n};\n\nvar AdsCardHeader103 = function(props) {\n  if (props.x === 230) {\n    return React.createElement(XUICardHeader102, { x: 229 });\n  }\n};\n\nvar AdsLabeledField104 = function(props) {\n  if (props.x === 231) {\n    return React.createElement(\n      \"div\",\n      { className: \"_2oc6 _3bvz\", label: \"Objective\" },\n      React.createElement(\"label\", { className: \"_4el4 _3qwj _3hy-\", htmlFor: undefined }, \"Objective \"),\n      null,\n      React.createElement(\"div\", { className: \"_3bv-\" })\n    );\n  }\n  if (props.x === 234) {\n    return React.createElement(\n      \"div\",\n      { className: \"_2oc6 _3bvz\", label: \"Buying Type\" },\n      React.createElement(\"label\", { className: \"_4el4 _3qwj _3hy-\", htmlFor: undefined }, \"Buying Type \"),\n      null,\n      React.createElement(\"div\", { className: \"_3bv-\" })\n    );\n  }\n  if (props.x === 240) {\n    return React.createElement(\n      \"div\",\n      { className: \"_2oc6 _3bvz\" },\n      React.createElement(\"label\", { className: \"_4el4 _3qwj _3hy-\", htmlFor: undefined }, \"Campaign Spending Limit \"),\n      React.createElement(AdsHelpLink63, { x: 239 }),\n      React.createElement(\"div\", { className: \"_3bv-\" })\n    );\n  }\n};\n\nvar FlexibleBlock105 = function(props) {\n  if (props.x === 233) {\n    return React.createElement(LeftRight21, { x: 232 });\n  }\n  if (props.x === 236) {\n    return React.createElement(LeftRight21, { x: 235 });\n  }\n  if (props.x === 246) {\n    return React.createElement(LeftRight21, { x: 245 });\n  }\n};\n\nvar AdsBulkCampaignSpendCapField106 = function(props) {\n  if (props.x === 243) {\n    return React.createElement(\n      \"div\",\n      { className: \"_33dv\" },\n      \"\",\n      React.createElement(Link2, { x: 242 }),\n      \" (optional)\"\n    );\n  }\n};\n\nvar FluxContainer_AdsCampaignGroupSpendCapContainer_107 = function(props) {\n  if (props.x === 244) {\n    return React.createElement(AdsBulkCampaignSpendCapField106, { x: 243 });\n  }\n};\n\nvar AdsCardSection108 = function(props) {\n  if (props.x === 248) {\n    return React.createElement(XUICardSection101, { x: 247 });\n  }\n};\n\nvar AdsEditorCampaignGroupDetailsSection109 = function(props) {\n  if (props.x === 252) {\n    return React.createElement(AdsCard95, { x: 251 });\n  }\n};\n\nvar AdsEditorCampaignGroupDetailsSectionContainer110 = function(props) {\n  if (props.x === 253) {\n    return React.createElement(AdsEditorCampaignGroupDetailsSection109, {\n      x: 252,\n      key: \"campaignGroupDetailsSection98010048849317\",\n    });\n  }\n};\n\nvar _render111 = function(props) {\n  if (props.x === 254) {\n    return React.createElement(AdsEditorCampaignGroupDetailsSectionContainer110, { x: 253 });\n  }\n};\n\nvar FluxContainer_AdsEditorToplineDetailsSectionContainer_112 = function(props) {\n  if (props.x === 256) {\n    return null;\n  }\n};\n\nvar _render113 = function(props) {\n  if (props.x === 257) {\n    return React.createElement(FluxContainer_AdsEditorToplineDetailsSectionContainer_112, { x: 256 });\n  }\n};\n\nvar AdsStickyArea114 = function(props) {\n  if (props.x === 259) {\n    return React.createElement(\"div\", {}, React.createElement(\"div\", { onWheel: function() {} }));\n  }\n  if (props.x === 292) {\n    return React.createElement(\n      \"div\",\n      {},\n      React.createElement(\"div\", { onWheel: function() {} }, [\n        React.createElement(\n          \"div\",\n          { key: \"campaign_group_errors_section98010048849317\" },\n          React.createElement(AdsPluginWrapper99, { x: 291 })\n        ),\n      ])\n    );\n  }\n};\n\nvar FluxContainer_AdsEditorColumnContainer_115 = function(props) {\n  if (props.x === 260) {\n    return React.createElement(\n      \"div\",\n      null,\n      [\n        React.createElement(\n          \"div\",\n          { key: \"campaign_group_name_section98010048849317\" },\n          React.createElement(AdsPluginWrapper99, { x: 226 })\n        ),\n        React.createElement(\n          \"div\",\n          { key: \"campaign_group_basic_section98010048849317\" },\n          React.createElement(AdsPluginWrapper99, { x: 255 })\n        ),\n        React.createElement(\n          \"div\",\n          { key: \"campaign_group_topline_section98010048849317\" },\n          React.createElement(AdsPluginWrapper99, { x: 258 })\n        ),\n      ],\n      React.createElement(AdsStickyArea114, { x: 259 })\n    );\n  }\n  if (props.x === 293) {\n    return React.createElement(\n      \"div\",\n      null,\n      [\n        React.createElement(\n          \"div\",\n          { key: \"campaign_group_navigation_section98010048849317\" },\n          React.createElement(AdsPluginWrapper99, { x: 287 })\n        ),\n      ],\n      React.createElement(AdsStickyArea114, { x: 292 })\n    );\n  }\n};\n\nvar BUISwitch116 = function(props) {\n  if (props.x === 261) {\n    return React.createElement(\n      \"div\",\n      {\n        \"data-hover\": \"tooltip\",\n        \"data-tooltip-content\": \"Currently active. Click this switch to deactivate it.\",\n        \"data-tooltip-position\": \"below\",\n        disabled: false,\n        value: true,\n        onToggle: function() {},\n        className: \"_128j _128k _128n\",\n        role: \"checkbox\",\n        \"aria-checked\": \"true\",\n      },\n      React.createElement(\n        \"div\",\n        {\n          className: \"_128o\",\n          onClick: function() {},\n          onKeyDown: function() {},\n          onMouseDown: function() {},\n          tabIndex: \"0\",\n        },\n        React.createElement(\"div\", { className: \"_128p\" })\n      ),\n      null\n    );\n  }\n};\n\nvar AdsStatusSwitchInternal117 = function(props) {\n  if (props.x === 262) {\n    return React.createElement(BUISwitch116, { x: 261 });\n  }\n};\n\nvar AdsStatusSwitch118 = function(props) {\n  if (props.x === 263) {\n    return React.createElement(AdsStatusSwitchInternal117, { x: 262 });\n  }\n};\n\nvar FluxContainer_AdsCampaignGroupStatusSwitchContainer_119 = function(props) {\n  if (props.x === 264) {\n    return React.createElement(AdsStatusSwitch118, {\n      x: 263,\n      key: \"status98010048849317\",\n    });\n  }\n};\n\nvar AdsLinksMenu120 = function(props) {\n  if (props.x === 275) {\n    return React.createElement(ReactPopoverMenu20, { x: 274 });\n  }\n};\n\nvar FluxContainer_AdsPluginizedLinksMenuContainer_121 = function(props) {\n  if (props.x === 276) {\n    return React.createElement(\"div\", null, null, React.createElement(AdsLinksMenu120, { x: 275 }));\n  }\n};\n\nvar AdsCardLeftRightHeader122 = function(props) {\n  if (props.x === 278) {\n    return React.createElement(LeftRight21, { x: 277 });\n  }\n};\n\nvar AdsPEIDSection123 = function(props) {\n  if (props.x === 282) {\n    return React.createElement(AdsCard95, { x: 281 });\n  }\n};\n\nvar FluxContainer_AdsPECampaignGroupIDSectionContainer_124 = function(props) {\n  if (props.x === 283) {\n    return React.createElement(AdsPEIDSection123, { x: 282 });\n  }\n};\n\nvar DeferredComponent125 = function(props) {\n  if (props.x === 284) {\n    return React.createElement(FluxContainer_AdsPECampaignGroupIDSectionContainer_124, { x: 283 });\n  }\n};\n\nvar BootloadedComponent126 = function(props) {\n  if (props.x === 285) {\n    return React.createElement(DeferredComponent125, { x: 284 });\n  }\n};\n\nvar _render127 = function(props) {\n  if (props.x === 286) {\n    return React.createElement(BootloadedComponent126, { x: 285 });\n  }\n};\n\nvar AdsEditorErrorsCard128 = function(props) {\n  if (props.x === 288) {\n    return null;\n  }\n};\n\nvar FluxContainer_FunctionalContainer_129 = function(props) {\n  if (props.x === 289) {\n    return React.createElement(AdsEditorErrorsCard128, { x: 288 });\n  }\n};\n\nvar _render130 = function(props) {\n  if (props.x === 290) {\n    return React.createElement(FluxContainer_FunctionalContainer_129, {\n      x: 289,\n    });\n  }\n};\n\nvar AdsEditorMultiColumnLayout131 = function(props) {\n  if (props.x === 294) {\n    return React.createElement(\n      \"div\",\n      { className: \"_psh\" },\n      React.createElement(\n        \"div\",\n        { className: \"_3cc0\" },\n        React.createElement(\n          \"div\",\n          null,\n          React.createElement(AdsEditorLoadingErrors90, { x: 215, key: \".0\" }),\n          React.createElement(\n            \"div\",\n            { className: \"_3ms3\" },\n            React.createElement(\n              \"div\",\n              { className: \"_3ms4\" },\n              React.createElement(FluxContainer_AdsEditorColumnContainer_115, { x: 260, key: \".1\" })\n            ),\n            React.createElement(\n              \"div\",\n              { className: \"_3pvg\" },\n              React.createElement(FluxContainer_AdsEditorColumnContainer_115, { x: 293, key: \".2\" })\n            )\n          )\n        )\n      )\n    );\n  }\n};\n\nvar AdsPECampaignGroupEditor132 = function(props) {\n  if (props.x === 295) {\n    return React.createElement(\n      \"div\",\n      null,\n      React.createElement(AdsPECampaignGroupHeaderSectionContainer89, {\n        x: 214,\n      }),\n      React.createElement(AdsEditorMultiColumnLayout131, { x: 294 })\n    );\n  }\n};\n\nvar AdsPECampaignGroupEditorContainer133 = function(props) {\n  if (props.x === 296) {\n    return React.createElement(AdsPECampaignGroupEditor132, { x: 295 });\n  }\n};\n\nvar AdsPESideTrayTabContent134 = function(props) {\n  if (props.x === 297) {\n    return React.createElement(\n      \"div\",\n      { className: \"_1o_8 _44ra _5cyn\" },\n      React.createElement(AdsPECampaignGroupEditorContainer133, { x: 296 })\n    );\n  }\n};\n\nvar AdsPEEditorTrayTabContentContainer135 = function(props) {\n  if (props.x === 298) {\n    return React.createElement(AdsPESideTrayTabContent134, { x: 297 });\n  }\n};\n\nvar AdsPEMultiTabDrawer136 = function(props) {\n  if (props.x === 299) {\n    return React.createElement(\n      \"div\",\n      { className: \"_2kev _2kex\" },\n      React.createElement(\n        \"div\",\n        { className: \"_5yno\" },\n        React.createElement(AdsPEEditorTrayTabButton83, {\n          x: 197,\n          key: \"editor_tray_button\",\n        }),\n        React.createElement(AdsPEInsightsTrayTabButton84, {\n          x: 202,\n          key: \"insights_tray_button\",\n        }),\n        React.createElement(AdsPENekoDebuggerTrayTabButton85, {\n          x: 204,\n          key: \"neko_debugger_tray_button\",\n        })\n      ),\n      React.createElement(\n        \"div\",\n        { className: \"_5ynn\" },\n        React.createElement(AdsPEEditorTrayTabContentContainer135, {\n          x: 298,\n          key: \"EDITOR_DRAWER\",\n        }),\n        null\n      )\n    );\n  }\n};\n\nvar FluxContainer_AdsPEMultiTabDrawerContainer_137 = function(props) {\n  if (props.x === 300) {\n    return React.createElement(AdsPEMultiTabDrawer136, { x: 299 });\n  }\n};\n\nvar AdsPESimpleOrganizer138 = function(props) {\n  if (props.x === 309) {\n    return React.createElement(\n      \"div\",\n      { className: \"_tm2\" },\n      React.createElement(XUIButton4, { x: 304 }),\n      React.createElement(XUIButton4, { x: 306 }),\n      React.createElement(XUIButton4, { x: 308 })\n    );\n  }\n};\n\nvar AdsPEOrganizerContainer139 = function(props) {\n  if (props.x === 310) {\n    return React.createElement(\"div\", null, React.createElement(AdsPESimpleOrganizer138, { x: 309 }));\n  }\n};\n\nvar FixedDataTableColumnResizeHandle140 = function(props) {\n  if (props.x === 313) {\n    return React.createElement(\n      \"div\",\n      {\n        className: \"_3487 _3488 _3489\",\n        style: { width: 0, height: 25, left: 0 },\n      },\n      React.createElement(\"div\", { className: \"_348a\", style: { height: 25 } })\n    );\n  }\n};\n\nvar AdsPETableHeader141 = function(props) {\n  if (props.x === 315) {\n    return React.createElement(\n      \"div\",\n      { className: \"_1cig _1ksv _1vd7 _4h2r\", id: undefined },\n      React.createElement(ReactImage0, { x: 314 }),\n      React.createElement(\"span\", { className: \"_1cid\" }, \"Campaigns\")\n    );\n  }\n  if (props.x === 320) {\n    return React.createElement(\n      \"div\",\n      { className: \"_1cig _1vd7 _4h2r\", id: undefined },\n      null,\n      React.createElement(\"span\", { className: \"_1cid\" }, \"Performance\")\n    );\n  }\n  if (props.x === 323) {\n    return React.createElement(\n      \"div\",\n      { className: \"_1cig _1vd7 _4h2r\", id: undefined },\n      null,\n      React.createElement(\"span\", { className: \"_1cid\" }, \"Overview\")\n    );\n  }\n  if (props.x === 326) {\n    return React.createElement(\n      \"div\",\n      { className: \"_1cig _1vd7 _4h2r\", id: undefined },\n      null,\n      React.createElement(\"span\", { className: \"_1cid\" }, \"Toplines\")\n    );\n  }\n  if (props.x === 329) {\n    return React.createElement(\"div\", {\n      className: \"_1cig _1vd7 _4h2r\",\n      id: undefined,\n    });\n  }\n  if (props.x === 340) {\n    return React.createElement(\n      \"div\",\n      { className: \"_1cig _25fg\", id: undefined },\n      null,\n      React.createElement(\"span\", { className: \"_1cid\" }, \"Campaign Name\")\n    );\n  }\n  if (props.x === 346) {\n    return React.createElement(\n      \"div\",\n      {\n        className: \"_1cig _25fg\",\n        id: undefined,\n        \"data-tooltip-content\": \"Changed\",\n        \"data-hover\": \"tooltip\",\n      },\n      React.createElement(ReactImage0, { x: 345 }),\n      null\n    );\n  }\n  if (props.x === 352) {\n    return React.createElement(\n      \"div\",\n      {\n        className: \"_1cig _25fg\",\n        id: \"ads_pe_table_error_header\",\n        \"data-tooltip-content\": \"Errors\",\n        \"data-hover\": \"tooltip\",\n      },\n      React.createElement(ReactImage0, { x: 351 }),\n      null\n    );\n  }\n  if (props.x === 357) {\n    return React.createElement(\n      \"div\",\n      { className: \"_1cig _25fg\", id: undefined },\n      null,\n      React.createElement(\"span\", { className: \"_1cid\" }, \"Status\")\n    );\n  }\n  if (props.x === 362) {\n    return React.createElement(\n      \"div\",\n      { className: \"_1cig _25fg\", id: undefined },\n      null,\n      React.createElement(\"span\", { className: \"_1cid\" }, \"Delivery\")\n    );\n  }\n  if (props.x === 369) {\n    return React.createElement(\n      \"div\",\n      { className: \"_1cig _25fg\", id: undefined },\n      null,\n      React.createElement(\"span\", { className: \"_1cid\" }, \"Results\")\n    );\n  }\n  if (props.x === 374) {\n    return React.createElement(\n      \"div\",\n      { className: \"_1cig _25fg\", id: undefined },\n      null,\n      React.createElement(\"span\", { className: \"_1cid\" }, \"Cost\")\n    );\n  }\n  if (props.x === 379) {\n    return React.createElement(\n      \"div\",\n      { className: \"_1cig _25fg\", id: undefined },\n      null,\n      React.createElement(\"span\", { className: \"_1cid\" }, \"Reach\")\n    );\n  }\n  if (props.x === 384) {\n    return React.createElement(\n      \"div\",\n      { className: \"_1cig _25fg\", id: undefined },\n      null,\n      React.createElement(\"span\", { className: \"_1cid\" }, \"Impressions\")\n    );\n  }\n  if (props.x === 389) {\n    return React.createElement(\n      \"div\",\n      { className: \"_1cig _25fg\", id: undefined },\n      null,\n      React.createElement(\"span\", { className: \"_1cid\" }, \"Clicks\")\n    );\n  }\n  if (props.x === 394) {\n    return React.createElement(\n      \"div\",\n      { className: \"_1cig _25fg\", id: undefined },\n      null,\n      React.createElement(\"span\", { className: \"_1cid\" }, \"Avg. CPM\")\n    );\n  }\n  if (props.x === 399) {\n    return React.createElement(\n      \"div\",\n      { className: \"_1cig _25fg\", id: undefined },\n      null,\n      React.createElement(\"span\", { className: \"_1cid\" }, \"Avg. CPC\")\n    );\n  }\n  if (props.x === 404) {\n    return React.createElement(\n      \"div\",\n      { className: \"_1cig _25fg\", id: undefined },\n      null,\n      React.createElement(\"span\", { className: \"_1cid\" }, \"CTR %\")\n    );\n  }\n  if (props.x === 409) {\n    return React.createElement(\n      \"div\",\n      { className: \"_1cig _25fg\", id: undefined },\n      null,\n      React.createElement(\"span\", { className: \"_1cid\" }, \"Spent\")\n    );\n  }\n  if (props.x === 414) {\n    return React.createElement(\n      \"div\",\n      { className: \"_1cig _25fg\", id: undefined },\n      null,\n      React.createElement(\"span\", { className: \"_1cid\" }, \"Objective\")\n    );\n  }\n  if (props.x === 419) {\n    return React.createElement(\n      \"div\",\n      { className: \"_1cig _25fg\", id: undefined },\n      null,\n      React.createElement(\"span\", { className: \"_1cid\" }, \"Buying Type\")\n    );\n  }\n  if (props.x === 424) {\n    return React.createElement(\n      \"div\",\n      { className: \"_1cig _25fg\", id: undefined },\n      null,\n      React.createElement(\"span\", { className: \"_1cid\" }, \"Campaign ID\")\n    );\n  }\n  if (props.x === 429) {\n    return React.createElement(\n      \"div\",\n      { className: \"_1cig _25fg\", id: undefined },\n      null,\n      React.createElement(\"span\", { className: \"_1cid\" }, \"Start\")\n    );\n  }\n  if (props.x === 434) {\n    return React.createElement(\n      \"div\",\n      { className: \"_1cig _25fg\", id: undefined },\n      null,\n      React.createElement(\"span\", { className: \"_1cid\" }, \"End\")\n    );\n  }\n  if (props.x === 439) {\n    return React.createElement(\n      \"div\",\n      { className: \"_1cig _25fg\", id: undefined },\n      null,\n      React.createElement(\"span\", { className: \"_1cid\" }, \"Date created\")\n    );\n  }\n  if (props.x === 444) {\n    return React.createElement(\n      \"div\",\n      { className: \"_1cig _25fg\", id: undefined },\n      null,\n      React.createElement(\"span\", { className: \"_1cid\" }, \"Date last edited\")\n    );\n  }\n  if (props.x === 449) {\n    return React.createElement(\n      \"div\",\n      { className: \"_1cig _25fg _4h2r\", id: undefined },\n      null,\n      React.createElement(\"span\", { className: \"_1cid\" }, \"Tags\")\n    );\n  }\n  if (props.x === 452) {\n    return React.createElement(\"div\", {\n      className: \"_1cig _25fg _4h2r\",\n      id: undefined,\n    });\n  }\n};\n\nvar TransitionCell142 = function(props) {\n  if (props.x === 316) {\n    return React.createElement(\n      \"div\",\n      {\n        label: \"Campaigns\",\n        height: 40,\n        width: 721,\n        className: \"_4lgc _4h2u\",\n        style: { height: 40, width: 721 },\n      },\n      React.createElement(\n        \"div\",\n        { className: \"_4lgd _4h2w\" },\n        React.createElement(\"div\", { className: \"_4lge _4h2x\" }, React.createElement(AdsPETableHeader141, { x: 315 }))\n      )\n    );\n  }\n  if (props.x === 321) {\n    return React.createElement(\n      \"div\",\n      {\n        label: \"Performance\",\n        height: 40,\n        width: 798,\n        className: \"_4lgc _4h2u\",\n        style: { height: 40, width: 798 },\n      },\n      React.createElement(\n        \"div\",\n        { className: \"_4lgd _4h2w\" },\n        React.createElement(\"div\", { className: \"_4lge _4h2x\" }, React.createElement(AdsPETableHeader141, { x: 320 }))\n      )\n    );\n  }\n  if (props.x === 324) {\n    return React.createElement(\n      \"div\",\n      {\n        label: \"Overview\",\n        height: 40,\n        width: 1022,\n        className: \"_4lgc _4h2u\",\n        style: { height: 40, width: 1022 },\n      },\n      React.createElement(\n        \"div\",\n        { className: \"_4lgd _4h2w\" },\n        React.createElement(\"div\", { className: \"_4lge _4h2x\" }, React.createElement(AdsPETableHeader141, { x: 323 }))\n      )\n    );\n  }\n  if (props.x === 327) {\n    return React.createElement(\n      \"div\",\n      {\n        label: \"Toplines\",\n        height: 40,\n        width: 0,\n        className: \"_4lgc _4h2u\",\n        style: { height: 40, width: 0 },\n      },\n      React.createElement(\n        \"div\",\n        { className: \"_4lgd _4h2w\" },\n        React.createElement(\"div\", { className: \"_4lge _4h2x\" }, React.createElement(AdsPETableHeader141, { x: 326 }))\n      )\n    );\n  }\n  if (props.x === 330) {\n    return React.createElement(\n      \"div\",\n      {\n        label: \"\",\n        height: 40,\n        width: 25,\n        className: \"_4lgc _4h2u\",\n        style: { height: 40, width: 25 },\n      },\n      React.createElement(\n        \"div\",\n        { className: \"_4lgd _4h2w\" },\n        React.createElement(\"div\", { className: \"_4lge _4h2x\" }, React.createElement(AdsPETableHeader141, { x: 329 }))\n      )\n    );\n  }\n  if (props.x === 338) {\n    return React.createElement(\n      \"div\",\n      {\n        label: undefined,\n        width: 42,\n        className: \"_4lgc _4h2u\",\n        height: 25,\n        style: { height: 25, width: 42 },\n      },\n      React.createElement(\n        \"div\",\n        { className: \"_4lgd _4h2w\" },\n        React.createElement(\"div\", { className: \"_4lge _4h2x\" }, React.createElement(XUICheckboxInput60, { x: 337 }))\n      )\n    );\n  }\n  if (props.x === 343) {\n    return React.createElement(\n      \"div\",\n      {\n        label: \"Campaign Name\",\n        width: 400,\n        className: \"_4lgc _4h2u\",\n        height: 25,\n        style: { height: 25, width: 400 },\n      },\n      React.createElement(\n        \"div\",\n        { className: \"_4lgd _4h2w\" },\n        React.createElement(\n          \"div\",\n          { className: \"_4lge _4h2x\" },\n          React.createElement(FixedDataTableSortableHeader149, { x: 342 })\n        )\n      )\n    );\n  }\n  if (props.x === 349) {\n    return React.createElement(\n      \"div\",\n      {\n        label: undefined,\n        width: 33,\n        className: \"_4lgc _4h2u\",\n        height: 25,\n        style: { height: 25, width: 33 },\n      },\n      React.createElement(\n        \"div\",\n        { className: \"_4lgd _4h2w\" },\n        React.createElement(\n          \"div\",\n          { className: \"_4lge _4h2x\" },\n          React.createElement(FixedDataTableSortableHeader149, { x: 348 })\n        )\n      )\n    );\n  }\n  if (props.x === 355) {\n    return React.createElement(\n      \"div\",\n      {\n        label: undefined,\n        width: 36,\n        className: \"_4lgc _4h2u\",\n        height: 25,\n        style: { height: 25, width: 36 },\n      },\n      React.createElement(\n        \"div\",\n        { className: \"_4lgd _4h2w\" },\n        React.createElement(\n          \"div\",\n          { className: \"_4lge _4h2x\" },\n          React.createElement(FixedDataTableSortableHeader149, { x: 354 })\n        )\n      )\n    );\n  }\n  if (props.x === 360) {\n    return React.createElement(\n      \"div\",\n      {\n        label: \"Status\",\n        width: 60,\n        className: \"_4lgc _4h2u\",\n        height: 25,\n        style: { height: 25, width: 60 },\n      },\n      React.createElement(\n        \"div\",\n        { className: \"_4lgd _4h2w\" },\n        React.createElement(\n          \"div\",\n          { className: \"_4lge _4h2x\" },\n          React.createElement(FixedDataTableSortableHeader149, { x: 359 })\n        )\n      )\n    );\n  }\n  if (props.x === 365) {\n    return React.createElement(\n      \"div\",\n      {\n        label: \"Delivery\",\n        width: 150,\n        className: \"_4lgc _4h2u\",\n        height: 25,\n        style: { height: 25, width: 150 },\n      },\n      React.createElement(\n        \"div\",\n        { className: \"_4lgd _4h2w\" },\n        React.createElement(\n          \"div\",\n          { className: \"_4lge _4h2x\" },\n          React.createElement(FixedDataTableSortableHeader149, { x: 364 })\n        )\n      )\n    );\n  }\n  if (props.x === 372) {\n    return React.createElement(\n      \"div\",\n      {\n        label: \"Results\",\n        width: 140,\n        className: \"_4lgc _4h2u\",\n        height: 25,\n        style: { height: 25, width: 140 },\n      },\n      React.createElement(\n        \"div\",\n        { className: \"_4lgd _4h2w\" },\n        React.createElement(\n          \"div\",\n          { className: \"_4lge _4h2x\" },\n          React.createElement(FixedDataTableSortableHeader149, { x: 371 })\n        )\n      )\n    );\n  }\n  if (props.x === 377) {\n    return React.createElement(\n      \"div\",\n      {\n        label: \"Cost\",\n        width: 140,\n        className: \"_4lgc _4h2u\",\n        height: 25,\n        style: { height: 25, width: 140 },\n      },\n      React.createElement(\n        \"div\",\n        { className: \"_4lgd _4h2w\" },\n        React.createElement(\n          \"div\",\n          { className: \"_4lge _4h2x\" },\n          React.createElement(FixedDataTableSortableHeader149, { x: 376 })\n        )\n      )\n    );\n  }\n  if (props.x === 382) {\n    return React.createElement(\n      \"div\",\n      {\n        label: \"Reach\",\n        width: 80,\n        className: \"_4lgc _4h2u\",\n        height: 25,\n        style: { height: 25, width: 80 },\n      },\n      React.createElement(\n        \"div\",\n        { className: \"_4lgd _4h2w\" },\n        React.createElement(\n          \"div\",\n          { className: \"_4lge _4h2x\" },\n          React.createElement(FixedDataTableSortableHeader149, { x: 381 })\n        )\n      )\n    );\n  }\n  if (props.x === 387) {\n    return React.createElement(\n      \"div\",\n      {\n        label: \"Impressions\",\n        width: 80,\n        className: \"_4lgc _4h2u\",\n        height: 25,\n        style: { height: 25, width: 80 },\n      },\n      React.createElement(\n        \"div\",\n        { className: \"_4lgd _4h2w\" },\n        React.createElement(\n          \"div\",\n          { className: \"_4lge _4h2x\" },\n          React.createElement(FixedDataTableSortableHeader149, { x: 386 })\n        )\n      )\n    );\n  }\n  if (props.x === 392) {\n    return React.createElement(\n      \"div\",\n      {\n        label: \"Clicks\",\n        width: 60,\n        className: \"_4lgc _4h2u\",\n        height: 25,\n        style: { height: 25, width: 60 },\n      },\n      React.createElement(\n        \"div\",\n        { className: \"_4lgd _4h2w\" },\n        React.createElement(\n          \"div\",\n          { className: \"_4lge _4h2x\" },\n          React.createElement(FixedDataTableSortableHeader149, { x: 391 })\n        )\n      )\n    );\n  }\n  if (props.x === 397) {\n    return React.createElement(\n      \"div\",\n      {\n        label: \"Avg. CPM\",\n        width: 80,\n        className: \"_4lgc _4h2u\",\n        height: 25,\n        style: { height: 25, width: 80 },\n      },\n      React.createElement(\n        \"div\",\n        { className: \"_4lgd _4h2w\" },\n        React.createElement(\n          \"div\",\n          { className: \"_4lge _4h2x\" },\n          React.createElement(FixedDataTableSortableHeader149, { x: 396 })\n        )\n      )\n    );\n  }\n  if (props.x === 402) {\n    return React.createElement(\n      \"div\",\n      {\n        label: \"Avg. CPC\",\n        width: 78,\n        className: \"_4lgc _4h2u\",\n        height: 25,\n        style: { height: 25, width: 78 },\n      },\n      React.createElement(\n        \"div\",\n        { className: \"_4lgd _4h2w\" },\n        React.createElement(\n          \"div\",\n          { className: \"_4lge _4h2x\" },\n          React.createElement(FixedDataTableSortableHeader149, { x: 401 })\n        )\n      )\n    );\n  }\n  if (props.x === 407) {\n    return React.createElement(\n      \"div\",\n      {\n        label: \"CTR %\",\n        width: 70,\n        className: \"_4lgc _4h2u\",\n        height: 25,\n        style: { height: 25, width: 70 },\n      },\n      React.createElement(\n        \"div\",\n        { className: \"_4lgd _4h2w\" },\n        React.createElement(\n          \"div\",\n          { className: \"_4lge _4h2x\" },\n          React.createElement(FixedDataTableSortableHeader149, { x: 406 })\n        )\n      )\n    );\n  }\n  if (props.x === 412) {\n    return React.createElement(\n      \"div\",\n      {\n        label: \"Spent\",\n        width: 70,\n        className: \"_4lgc _4h2u\",\n        height: 25,\n        style: { height: 25, width: 70 },\n      },\n      React.createElement(\n        \"div\",\n        { className: \"_4lgd _4h2w\" },\n        React.createElement(\n          \"div\",\n          { className: \"_4lge _4h2x\" },\n          React.createElement(FixedDataTableSortableHeader149, { x: 411 })\n        )\n      )\n    );\n  }\n  if (props.x === 417) {\n    return React.createElement(\n      \"div\",\n      {\n        label: \"Objective\",\n        width: 200,\n        className: \"_4lgc _4h2u\",\n        height: 25,\n        style: { height: 25, width: 200 },\n      },\n      React.createElement(\n        \"div\",\n        { className: \"_4lgd _4h2w\" },\n        React.createElement(\n          \"div\",\n          { className: \"_4lge _4h2x\" },\n          React.createElement(FixedDataTableSortableHeader149, { x: 416 })\n        )\n      )\n    );\n  }\n  if (props.x === 422) {\n    return React.createElement(\n      \"div\",\n      {\n        label: \"Buying Type\",\n        width: 100,\n        className: \"_4lgc _4h2u\",\n        height: 25,\n        style: { height: 25, width: 100 },\n      },\n      React.createElement(\n        \"div\",\n        { className: \"_4lgd _4h2w\" },\n        React.createElement(\n          \"div\",\n          { className: \"_4lge _4h2x\" },\n          React.createElement(FixedDataTableSortableHeader149, { x: 421 })\n        )\n      )\n    );\n  }\n  if (props.x === 427) {\n    return React.createElement(\n      \"div\",\n      {\n        label: \"Campaign ID\",\n        width: 120,\n        className: \"_4lgc _4h2u\",\n        height: 25,\n        style: { height: 25, width: 120 },\n      },\n      React.createElement(\n        \"div\",\n        { className: \"_4lgd _4h2w\" },\n        React.createElement(\n          \"div\",\n          { className: \"_4lge _4h2x\" },\n          React.createElement(FixedDataTableSortableHeader149, { x: 426 })\n        )\n      )\n    );\n  }\n  if (props.x === 432) {\n    return React.createElement(\n      \"div\",\n      {\n        label: \"Start\",\n        width: 113,\n        className: \"_4lgc _4h2u\",\n        height: 25,\n        style: { height: 25, width: 113 },\n      },\n      React.createElement(\n        \"div\",\n        { className: \"_4lgd _4h2w\" },\n        React.createElement(\n          \"div\",\n          { className: \"_4lge _4h2x\" },\n          React.createElement(FixedDataTableSortableHeader149, { x: 431 })\n        )\n      )\n    );\n  }\n  if (props.x === 437) {\n    return React.createElement(\n      \"div\",\n      {\n        label: \"End\",\n        width: 113,\n        className: \"_4lgc _4h2u\",\n        height: 25,\n        style: { height: 25, width: 113 },\n      },\n      React.createElement(\n        \"div\",\n        { className: \"_4lgd _4h2w\" },\n        React.createElement(\n          \"div\",\n          { className: \"_4lge _4h2x\" },\n          React.createElement(FixedDataTableSortableHeader149, { x: 436 })\n        )\n      )\n    );\n  }\n  if (props.x === 442) {\n    return React.createElement(\n      \"div\",\n      {\n        label: \"Date created\",\n        width: 113,\n        className: \"_4lgc _4h2u\",\n        height: 25,\n        style: { height: 25, width: 113 },\n      },\n      React.createElement(\n        \"div\",\n        { className: \"_4lgd _4h2w\" },\n        React.createElement(\n          \"div\",\n          { className: \"_4lge _4h2x\" },\n          React.createElement(FixedDataTableSortableHeader149, { x: 441 })\n        )\n      )\n    );\n  }\n  if (props.x === 447) {\n    return React.createElement(\n      \"div\",\n      {\n        label: \"Date last edited\",\n        width: 113,\n        className: \"_4lgc _4h2u\",\n        height: 25,\n        style: { height: 25, width: 113 },\n      },\n      React.createElement(\n        \"div\",\n        { className: \"_4lgd _4h2w\" },\n        React.createElement(\n          \"div\",\n          { className: \"_4lge _4h2x\" },\n          React.createElement(FixedDataTableSortableHeader149, { x: 446 })\n        )\n      )\n    );\n  }\n  if (props.x === 450) {\n    return React.createElement(\n      \"div\",\n      {\n        label: \"Tags\",\n        width: 150,\n        className: \"_4lgc _4h2u\",\n        height: 25,\n        style: { height: 25, width: 150 },\n      },\n      React.createElement(\n        \"div\",\n        { className: \"_4lgd _4h2w\" },\n        React.createElement(\"div\", { className: \"_4lge _4h2x\" }, React.createElement(AdsPETableHeader141, { x: 449 }))\n      )\n    );\n  }\n  if (props.x === 453) {\n    return React.createElement(\n      \"div\",\n      {\n        label: \"\",\n        width: 25,\n        className: \"_4lgc _4h2u\",\n        height: 25,\n        style: { height: 25, width: 25 },\n      },\n      React.createElement(\n        \"div\",\n        { className: \"_4lgd _4h2w\" },\n        React.createElement(\"div\", { className: \"_4lge _4h2x\" }, React.createElement(AdsPETableHeader141, { x: 452 }))\n      )\n    );\n  }\n};\n\nvar FixedDataTableCell143 = function(props) {\n  if (props.x === 317) {\n    return React.createElement(\n      \"div\",\n      { className: \"_4lg0 _4h2m\", style: { height: 40, width: 721, left: 0 } },\n      undefined,\n      React.createElement(TransitionCell142, { x: 316 })\n    );\n  }\n  if (props.x === 322) {\n    return React.createElement(\n      \"div\",\n      { className: \"_4lg0 _4h2m\", style: { height: 40, width: 798, left: 0 } },\n      undefined,\n      React.createElement(TransitionCell142, { x: 321 })\n    );\n  }\n  if (props.x === 325) {\n    return React.createElement(\n      \"div\",\n      { className: \"_4lg0 _4h2m\", style: { height: 40, width: 1022, left: 798 } },\n      undefined,\n      React.createElement(TransitionCell142, { x: 324 })\n    );\n  }\n  if (props.x === 328) {\n    return React.createElement(\n      \"div\",\n      { className: \"_4lg0 _4h2m\", style: { height: 40, width: 0, left: 1820 } },\n      undefined,\n      React.createElement(TransitionCell142, { x: 327 })\n    );\n  }\n  if (props.x === 331) {\n    return React.createElement(\n      \"div\",\n      { className: \"_4lg0 _4h2m\", style: { height: 40, width: 25, left: 1820 } },\n      undefined,\n      React.createElement(TransitionCell142, { x: 330 })\n    );\n  }\n  if (props.x === 339) {\n    return React.createElement(\n      \"div\",\n      {\n        className: \"_4lg0 _4lg6 _4h2m\",\n        style: { height: 25, width: 42, left: 0 },\n      },\n      undefined,\n      React.createElement(TransitionCell142, { x: 338 })\n    );\n  }\n  if (props.x === 344) {\n    return React.createElement(\n      \"div\",\n      { className: \"_4lg0 _4h2m\", style: { height: 25, width: 400, left: 42 } },\n      React.createElement(\n        \"div\",\n        { className: \"_4lg9\", style: { height: 25 }, onMouseDown: function() {} },\n        React.createElement(\"div\", {\n          className: \"_4lga _4lgb\",\n          style: { height: 25 },\n        })\n      ),\n      React.createElement(TransitionCell142, { x: 343 })\n    );\n  }\n  if (props.x === 350) {\n    return React.createElement(\n      \"div\",\n      { className: \"_4lg0 _4h2m\", style: { height: 25, width: 33, left: 442 } },\n      undefined,\n      React.createElement(TransitionCell142, { x: 349 })\n    );\n  }\n  if (props.x === 356) {\n    return React.createElement(\n      \"div\",\n      { className: \"_4lg0 _4h2m\", style: { height: 25, width: 36, left: 475 } },\n      undefined,\n      React.createElement(TransitionCell142, { x: 355 })\n    );\n  }\n  if (props.x === 361) {\n    return React.createElement(\n      \"div\",\n      { className: \"_4lg0 _4h2m\", style: { height: 25, width: 60, left: 511 } },\n      undefined,\n      React.createElement(TransitionCell142, { x: 360 })\n    );\n  }\n  if (props.x === 366) {\n    return React.createElement(\n      \"div\",\n      { className: \"_4lg0 _4h2m\", style: { height: 25, width: 150, left: 571 } },\n      React.createElement(\n        \"div\",\n        { className: \"_4lg9\", style: { height: 25 }, onMouseDown: function() {} },\n        React.createElement(\"div\", {\n          className: \"_4lga _4lgb\",\n          style: { height: 25 },\n        })\n      ),\n      React.createElement(TransitionCell142, { x: 365 })\n    );\n  }\n  if (props.x === 373) {\n    return React.createElement(\n      \"div\",\n      {\n        className: \"_4lg0 _4lg5 _4h2p _4h2m\",\n        style: { height: 25, width: 140, left: 0 },\n      },\n      React.createElement(\n        \"div\",\n        { className: \"_4lg9\", style: { height: 25 }, onMouseDown: function() {} },\n        React.createElement(\"div\", {\n          className: \"_4lga _4lgb\",\n          style: { height: 25 },\n        })\n      ),\n      React.createElement(TransitionCell142, { x: 372 })\n    );\n  }\n  if (props.x === 378) {\n    return React.createElement(\n      \"div\",\n      {\n        className: \"_4lg0 _4lg5 _4h2p _4h2m\",\n        style: { height: 25, width: 140, left: 140 },\n      },\n      React.createElement(\n        \"div\",\n        { className: \"_4lg9\", style: { height: 25 }, onMouseDown: function() {} },\n        React.createElement(\"div\", {\n          className: \"_4lga _4lgb\",\n          style: { height: 25 },\n        })\n      ),\n      React.createElement(TransitionCell142, { x: 377 })\n    );\n  }\n  if (props.x === 383) {\n    return React.createElement(\n      \"div\",\n      {\n        className: \"_4lg0 _4lg5 _4h2p _4h2m\",\n        style: { height: 25, width: 80, left: 280 },\n      },\n      React.createElement(\n        \"div\",\n        { className: \"_4lg9\", style: { height: 25 }, onMouseDown: function() {} },\n        React.createElement(\"div\", {\n          className: \"_4lga _4lgb\",\n          style: { height: 25 },\n        })\n      ),\n      React.createElement(TransitionCell142, { x: 382 })\n    );\n  }\n  if (props.x === 388) {\n    return React.createElement(\n      \"div\",\n      {\n        className: \"_4lg0 _4lg5 _4h2p _4h2m\",\n        style: { height: 25, width: 80, left: 360 },\n      },\n      React.createElement(\n        \"div\",\n        { className: \"_4lg9\", style: { height: 25 }, onMouseDown: function() {} },\n        React.createElement(\"div\", {\n          className: \"_4lga _4lgb\",\n          style: { height: 25 },\n        })\n      ),\n      React.createElement(TransitionCell142, { x: 387 })\n    );\n  }\n  if (props.x === 393) {\n    return React.createElement(\n      \"div\",\n      {\n        className: \"_4lg0 _4lg5 _4h2p _4h2m\",\n        style: { height: 25, width: 60, left: 440 },\n      },\n      React.createElement(\n        \"div\",\n        { className: \"_4lg9\", style: { height: 25 }, onMouseDown: function() {} },\n        React.createElement(\"div\", {\n          className: \"_4lga _4lgb\",\n          style: { height: 25 },\n        })\n      ),\n      React.createElement(TransitionCell142, { x: 392 })\n    );\n  }\n  if (props.x === 398) {\n    return React.createElement(\n      \"div\",\n      {\n        className: \"_4lg0 _4lg5 _4h2p _4h2m\",\n        style: { height: 25, width: 80, left: 500 },\n      },\n      React.createElement(\n        \"div\",\n        { className: \"_4lg9\", style: { height: 25 }, onMouseDown: function() {} },\n        React.createElement(\"div\", {\n          className: \"_4lga _4lgb\",\n          style: { height: 25 },\n        })\n      ),\n      React.createElement(TransitionCell142, { x: 397 })\n    );\n  }\n  if (props.x === 403) {\n    return React.createElement(\n      \"div\",\n      {\n        className: \"_4lg0 _4lg5 _4h2p _4h2m\",\n        style: { height: 25, width: 78, left: 580 },\n      },\n      React.createElement(\n        \"div\",\n        { className: \"_4lg9\", style: { height: 25 }, onMouseDown: function() {} },\n        React.createElement(\"div\", {\n          className: \"_4lga _4lgb\",\n          style: { height: 25 },\n        })\n      ),\n      React.createElement(TransitionCell142, { x: 402 })\n    );\n  }\n  if (props.x === 408) {\n    return React.createElement(\n      \"div\",\n      {\n        className: \"_4lg0 _4lg5 _4h2p _4h2m\",\n        style: { height: 25, width: 70, left: 658 },\n      },\n      React.createElement(\n        \"div\",\n        { className: \"_4lg9\", style: { height: 25 }, onMouseDown: function() {} },\n        React.createElement(\"div\", {\n          className: \"_4lga _4lgb\",\n          style: { height: 25 },\n        })\n      ),\n      React.createElement(TransitionCell142, { x: 407 })\n    );\n  }\n  if (props.x === 413) {\n    return React.createElement(\n      \"div\",\n      {\n        className: \"_4lg0 _4lg5 _4h2p _4h2m\",\n        style: { height: 25, width: 70, left: 728 },\n      },\n      React.createElement(\n        \"div\",\n        { className: \"_4lg9\", style: { height: 25 }, onMouseDown: function() {} },\n        React.createElement(\"div\", {\n          className: \"_4lga _4lgb\",\n          style: { height: 25 },\n        })\n      ),\n      React.createElement(TransitionCell142, { x: 412 })\n    );\n  }\n  if (props.x === 418) {\n    return React.createElement(\n      \"div\",\n      { className: \"_4lg0 _4h2m\", style: { height: 25, width: 200, left: 798 } },\n      React.createElement(\n        \"div\",\n        { className: \"_4lg9\", style: { height: 25 }, onMouseDown: function() {} },\n        React.createElement(\"div\", {\n          className: \"_4lga _4lgb\",\n          style: { height: 25 },\n        })\n      ),\n      React.createElement(TransitionCell142, { x: 417 })\n    );\n  }\n  if (props.x === 423) {\n    return React.createElement(\n      \"div\",\n      { className: \"_4lg0 _4h2m\", style: { height: 25, width: 100, left: 998 } },\n      React.createElement(\n        \"div\",\n        { className: \"_4lg9\", style: { height: 25 }, onMouseDown: function() {} },\n        React.createElement(\"div\", {\n          className: \"_4lga _4lgb\",\n          style: { height: 25 },\n        })\n      ),\n      React.createElement(TransitionCell142, { x: 422 })\n    );\n  }\n  if (props.x === 428) {\n    return React.createElement(\n      \"div\",\n      { className: \"_4lg0 _4h2m\", style: { height: 25, width: 120, left: 1098 } },\n      React.createElement(\n        \"div\",\n        { className: \"_4lg9\", style: { height: 25 }, onMouseDown: function() {} },\n        React.createElement(\"div\", {\n          className: \"_4lga _4lgb\",\n          style: { height: 25 },\n        })\n      ),\n      React.createElement(TransitionCell142, { x: 427 })\n    );\n  }\n  if (props.x === 433) {\n    return React.createElement(\n      \"div\",\n      { className: \"_4lg0 _4h2m\", style: { height: 25, width: 113, left: 1218 } },\n      React.createElement(\n        \"div\",\n        { className: \"_4lg9\", style: { height: 25 }, onMouseDown: function() {} },\n        React.createElement(\"div\", {\n          className: \"_4lga _4lgb\",\n          style: { height: 25 },\n        })\n      ),\n      React.createElement(TransitionCell142, { x: 432 })\n    );\n  }\n  if (props.x === 438) {\n    return React.createElement(\n      \"div\",\n      { className: \"_4lg0 _4h2m\", style: { height: 25, width: 113, left: 1331 } },\n      React.createElement(\n        \"div\",\n        { className: \"_4lg9\", style: { height: 25 }, onMouseDown: function() {} },\n        React.createElement(\"div\", {\n          className: \"_4lga _4lgb\",\n          style: { height: 25 },\n        })\n      ),\n      React.createElement(TransitionCell142, { x: 437 })\n    );\n  }\n  if (props.x === 443) {\n    return React.createElement(\n      \"div\",\n      { className: \"_4lg0 _4h2m\", style: { height: 25, width: 113, left: 1444 } },\n      React.createElement(\n        \"div\",\n        { className: \"_4lg9\", style: { height: 25 }, onMouseDown: function() {} },\n        React.createElement(\"div\", {\n          className: \"_4lga _4lgb\",\n          style: { height: 25 },\n        })\n      ),\n      React.createElement(TransitionCell142, { x: 442 })\n    );\n  }\n  if (props.x === 448) {\n    return React.createElement(\n      \"div\",\n      { className: \"_4lg0 _4h2m\", style: { height: 25, width: 113, left: 1557 } },\n      React.createElement(\n        \"div\",\n        { className: \"_4lg9\", style: { height: 25 }, onMouseDown: function() {} },\n        React.createElement(\"div\", {\n          className: \"_4lga _4lgb\",\n          style: { height: 25 },\n        })\n      ),\n      React.createElement(TransitionCell142, { x: 447 })\n    );\n  }\n  if (props.x === 451) {\n    return React.createElement(\n      \"div\",\n      { className: \"_4lg0 _4h2m\", style: { height: 25, width: 150, left: 1670 } },\n      React.createElement(\n        \"div\",\n        { className: \"_4lg9\", style: { height: 25 }, onMouseDown: function() {} },\n        React.createElement(\"div\", {\n          className: \"_4lga _4lgb\",\n          style: { height: 25 },\n        })\n      ),\n      React.createElement(TransitionCell142, { x: 450 })\n    );\n  }\n  if (props.x === 454) {\n    return React.createElement(\n      \"div\",\n      { className: \"_4lg0 _4h2m\", style: { height: 25, width: 25, left: 1820 } },\n      undefined,\n      React.createElement(TransitionCell142, { x: 453 })\n    );\n  }\n};\n\nvar FixedDataTableCellGroupImpl144 = function(props) {\n  if (props.x === 318) {\n    return React.createElement(\n      \"div\",\n      {\n        className: \"_3pzj\",\n        style: {\n          height: 40,\n          position: \"absolute\",\n          width: 721,\n          zIndex: 2,\n          transform: \"translate3d(0px,0px,0)\",\n          backfaceVisibility: \"hidden\",\n        },\n      },\n      React.createElement(FixedDataTableCell143, { x: 317, key: \"cell_0\" })\n    );\n  }\n  if (props.x === 332) {\n    return React.createElement(\n      \"div\",\n      {\n        className: \"_3pzj\",\n        style: {\n          height: 40,\n          position: \"absolute\",\n          width: 1845,\n          zIndex: 0,\n          transform: \"translate3d(0px,0px,0)\",\n          backfaceVisibility: \"hidden\",\n        },\n      },\n      React.createElement(FixedDataTableCell143, { x: 322, key: \"cell_0\" }),\n      React.createElement(FixedDataTableCell143, { x: 325, key: \"cell_1\" }),\n      React.createElement(FixedDataTableCell143, { x: 328, key: \"cell_2\" }),\n      React.createElement(FixedDataTableCell143, { x: 331, key: \"cell_3\" })\n    );\n  }\n  if (props.x === 367) {\n    return React.createElement(\n      \"div\",\n      {\n        className: \"_3pzj\",\n        style: {\n          height: 25,\n          position: \"absolute\",\n          width: 721,\n          zIndex: 2,\n          transform: \"translate3d(0px,0px,0)\",\n          backfaceVisibility: \"hidden\",\n        },\n      },\n      React.createElement(FixedDataTableCell143, { x: 339, key: \"cell_0\" }),\n      React.createElement(FixedDataTableCell143, { x: 344, key: \"cell_1\" }),\n      React.createElement(FixedDataTableCell143, { x: 350, key: \"cell_2\" }),\n      React.createElement(FixedDataTableCell143, { x: 356, key: \"cell_3\" }),\n      React.createElement(FixedDataTableCell143, { x: 361, key: \"cell_4\" }),\n      React.createElement(FixedDataTableCell143, { x: 366, key: \"cell_5\" })\n    );\n  }\n  if (props.x === 455) {\n    return React.createElement(\n      \"div\",\n      {\n        className: \"_3pzj\",\n        style: {\n          height: 25,\n          position: \"absolute\",\n          width: 1845,\n          zIndex: 0,\n          transform: \"translate3d(0px,0px,0)\",\n          backfaceVisibility: \"hidden\",\n        },\n      },\n      React.createElement(FixedDataTableCell143, { x: 373, key: \"cell_0\" }),\n      React.createElement(FixedDataTableCell143, { x: 378, key: \"cell_1\" }),\n      React.createElement(FixedDataTableCell143, { x: 383, key: \"cell_2\" }),\n      React.createElement(FixedDataTableCell143, { x: 388, key: \"cell_3\" }),\n      React.createElement(FixedDataTableCell143, { x: 393, key: \"cell_4\" }),\n      React.createElement(FixedDataTableCell143, { x: 398, key: \"cell_5\" }),\n      React.createElement(FixedDataTableCell143, { x: 403, key: \"cell_6\" }),\n      React.createElement(FixedDataTableCell143, { x: 408, key: \"cell_7\" }),\n      React.createElement(FixedDataTableCell143, { x: 413, key: \"cell_8\" }),\n      React.createElement(FixedDataTableCell143, { x: 418, key: \"cell_9\" }),\n      React.createElement(FixedDataTableCell143, { x: 423, key: \"cell_10\" }),\n      React.createElement(FixedDataTableCell143, { x: 428, key: \"cell_11\" }),\n      React.createElement(FixedDataTableCell143, { x: 433, key: \"cell_12\" }),\n      React.createElement(FixedDataTableCell143, { x: 438, key: \"cell_13\" }),\n      React.createElement(FixedDataTableCell143, { x: 443, key: \"cell_14\" }),\n      React.createElement(FixedDataTableCell143, { x: 448, key: \"cell_15\" }),\n      React.createElement(FixedDataTableCell143, { x: 451, key: \"cell_16\" }),\n      React.createElement(FixedDataTableCell143, { x: 454, key: \"cell_17\" })\n    );\n  }\n};\n\nvar FixedDataTableCellGroup145 = function(props) {\n  if (props.x === 319) {\n    return React.createElement(\n      \"div\",\n      { style: { height: 40, left: 0 }, className: \"_3pzk\" },\n      React.createElement(FixedDataTableCellGroupImpl144, { x: 318 })\n    );\n  }\n  if (props.x === 333) {\n    return React.createElement(\n      \"div\",\n      { style: { height: 40, left: 721 }, className: \"_3pzk\" },\n      React.createElement(FixedDataTableCellGroupImpl144, { x: 332 })\n    );\n  }\n  if (props.x === 368) {\n    return React.createElement(\n      \"div\",\n      { style: { height: 25, left: 0 }, className: \"_3pzk\" },\n      React.createElement(FixedDataTableCellGroupImpl144, { x: 367 })\n    );\n  }\n  if (props.x === 456) {\n    return React.createElement(\n      \"div\",\n      { style: { height: 25, left: 721 }, className: \"_3pzk\" },\n      React.createElement(FixedDataTableCellGroupImpl144, { x: 455 })\n    );\n  }\n};\n\nvar FixedDataTableRowImpl146 = function(props) {\n  if (props.x === 334) {\n    return React.createElement(\n      \"div\",\n      {\n        className: \"_1gd4 _4li _52no _3h1a _1mib\",\n        onClick: null,\n        onDoubleClick: null,\n        onMouseDown: null,\n        onMouseEnter: null,\n        onMouseLeave: null,\n        style: { width: 1209, height: 40 },\n      },\n      React.createElement(\n        \"div\",\n        { className: \"_1gd5\" },\n        React.createElement(FixedDataTableCellGroup145, {\n          x: 319,\n          key: \"fixed_cells\",\n        }),\n        React.createElement(FixedDataTableCellGroup145, {\n          x: 333,\n          key: \"scrollable_cells\",\n        }),\n        React.createElement(\"div\", {\n          className: \"_1gd6 _1gd8\",\n          style: { left: 721, height: 40 },\n        })\n      )\n    );\n  }\n  if (props.x === 457) {\n    return React.createElement(\n      \"div\",\n      {\n        className: \"_1gd4 _4li _3h1a _1mib\",\n        onClick: null,\n        onDoubleClick: null,\n        onMouseDown: null,\n        onMouseEnter: null,\n        onMouseLeave: null,\n        style: { width: 1209, height: 25 },\n      },\n      React.createElement(\n        \"div\",\n        { className: \"_1gd5\" },\n        React.createElement(FixedDataTableCellGroup145, {\n          x: 368,\n          key: \"fixed_cells\",\n        }),\n        React.createElement(FixedDataTableCellGroup145, {\n          x: 456,\n          key: \"scrollable_cells\",\n        }),\n        React.createElement(\"div\", {\n          className: \"_1gd6 _1gd8\",\n          style: { left: 721, height: 25 },\n        })\n      )\n    );\n  }\n};\n\nvar FixedDataTableRow147 = function(props) {\n  if (props.x === 335) {\n    return React.createElement(\n      \"div\",\n      {\n        style: {\n          width: 1209,\n          height: 40,\n          zIndex: 1,\n          transform: \"translate3d(0px,0px,0)\",\n          backfaceVisibility: \"hidden\",\n        },\n        className: \"_1gda\",\n      },\n      React.createElement(FixedDataTableRowImpl146, { x: 334 })\n    );\n  }\n  if (props.x === 458) {\n    return React.createElement(\n      \"div\",\n      {\n        style: {\n          width: 1209,\n          height: 25,\n          zIndex: 1,\n          transform: \"translate3d(0px,40px,0)\",\n          backfaceVisibility: \"hidden\",\n        },\n        className: \"_1gda\",\n      },\n      React.createElement(FixedDataTableRowImpl146, { x: 457 })\n    );\n  }\n};\n\nvar FixedDataTableAbstractSortableHeader148 = function(props) {\n  if (props.x === 341) {\n    return React.createElement(\n      \"div\",\n      { onClick: function() {}, className: \"_54_8 _4h2r _2wzx\" },\n      React.createElement(\"div\", { className: \"_2eq6\" }, null, React.createElement(AdsPETableHeader141, { x: 340 }))\n    );\n  }\n  if (props.x === 347) {\n    return React.createElement(\n      \"div\",\n      { onClick: function() {}, className: \"_54_8 _1kst _4h2r _2wzx\" },\n      React.createElement(\"div\", { className: \"_2eq6\" }, null, React.createElement(AdsPETableHeader141, { x: 346 }))\n    );\n  }\n  if (props.x === 353) {\n    return React.createElement(\n      \"div\",\n      { onClick: function() {}, className: \"_54_8 _1kst _4h2r _2wzx\" },\n      React.createElement(\"div\", { className: \"_2eq6\" }, null, React.createElement(AdsPETableHeader141, { x: 352 }))\n    );\n  }\n  if (props.x === 358) {\n    return React.createElement(\n      \"div\",\n      { onClick: function() {}, className: \"_54_8 _4h2r _2wzx\" },\n      React.createElement(\"div\", { className: \"_2eq6\" }, null, React.createElement(AdsPETableHeader141, { x: 357 }))\n    );\n  }\n  if (props.x === 363) {\n    return React.createElement(\n      \"div\",\n      { onClick: function() {}, className: \"_54_8 _54_9 _4h2r _2wzx\" },\n      React.createElement(\"div\", { className: \"_2eq6\" }, null, React.createElement(AdsPETableHeader141, { x: 362 }))\n    );\n  }\n  if (props.x === 370) {\n    return React.createElement(\n      \"div\",\n      { onClick: function() {}, className: \"_54_8 _4h2r _2wzx\" },\n      React.createElement(\"div\", { className: \"_2eq6\" }, null, React.createElement(AdsPETableHeader141, { x: 369 }))\n    );\n  }\n  if (props.x === 375) {\n    return React.createElement(\n      \"div\",\n      { onClick: function() {}, className: \"_54_8 _4h2r _2wzx\" },\n      React.createElement(\"div\", { className: \"_2eq6\" }, null, React.createElement(AdsPETableHeader141, { x: 374 }))\n    );\n  }\n  if (props.x === 380) {\n    return React.createElement(\n      \"div\",\n      { onClick: function() {}, className: \"_54_8 _4h2r _2wzx\" },\n      React.createElement(\"div\", { className: \"_2eq6\" }, null, React.createElement(AdsPETableHeader141, { x: 379 }))\n    );\n  }\n  if (props.x === 385) {\n    return React.createElement(\n      \"div\",\n      { onClick: function() {}, className: \"_54_8 _4h2r _2wzx\" },\n      React.createElement(\"div\", { className: \"_2eq6\" }, null, React.createElement(AdsPETableHeader141, { x: 384 }))\n    );\n  }\n  if (props.x === 390) {\n    return React.createElement(\n      \"div\",\n      { onClick: function() {}, className: \"_54_8 _4h2r _2wzx\" },\n      React.createElement(\"div\", { className: \"_2eq6\" }, null, React.createElement(AdsPETableHeader141, { x: 389 }))\n    );\n  }\n  if (props.x === 395) {\n    return React.createElement(\n      \"div\",\n      { onClick: function() {}, className: \"_54_8 _4h2r _2wzx\" },\n      React.createElement(\"div\", { className: \"_2eq6\" }, null, React.createElement(AdsPETableHeader141, { x: 394 }))\n    );\n  }\n  if (props.x === 400) {\n    return React.createElement(\n      \"div\",\n      { onClick: function() {}, className: \"_54_8 _4h2r _2wzx\" },\n      React.createElement(\"div\", { className: \"_2eq6\" }, null, React.createElement(AdsPETableHeader141, { x: 399 }))\n    );\n  }\n  if (props.x === 405) {\n    return React.createElement(\n      \"div\",\n      { onClick: function() {}, className: \"_54_8 _4h2r _2wzx\" },\n      React.createElement(\"div\", { className: \"_2eq6\" }, null, React.createElement(AdsPETableHeader141, { x: 404 }))\n    );\n  }\n  if (props.x === 410) {\n    return React.createElement(\n      \"div\",\n      { onClick: function() {}, className: \"_54_8 _4h2r _2wzx\" },\n      React.createElement(\"div\", { className: \"_2eq6\" }, null, React.createElement(AdsPETableHeader141, { x: 409 }))\n    );\n  }\n  if (props.x === 415) {\n    return React.createElement(\n      \"div\",\n      { onClick: function() {}, className: \"_54_8 _4h2r _2wzx\" },\n      React.createElement(\"div\", { className: \"_2eq6\" }, null, React.createElement(AdsPETableHeader141, { x: 414 }))\n    );\n  }\n  if (props.x === 420) {\n    return React.createElement(\n      \"div\",\n      { onClick: function() {}, className: \"_54_8 _4h2r _2wzx\" },\n      React.createElement(\"div\", { className: \"_2eq6\" }, null, React.createElement(AdsPETableHeader141, { x: 419 }))\n    );\n  }\n  if (props.x === 425) {\n    return React.createElement(\n      \"div\",\n      { onClick: function() {}, className: \"_54_8 _4h2r _2wzx\" },\n      React.createElement(\"div\", { className: \"_2eq6\" }, null, React.createElement(AdsPETableHeader141, { x: 424 }))\n    );\n  }\n  if (props.x === 430) {\n    return React.createElement(\n      \"div\",\n      { onClick: function() {}, className: \"_54_8 _4h2r _2wzx\" },\n      React.createElement(\"div\", { className: \"_2eq6\" }, null, React.createElement(AdsPETableHeader141, { x: 429 }))\n    );\n  }\n  if (props.x === 435) {\n    return React.createElement(\n      \"div\",\n      { onClick: function() {}, className: \"_54_8 _4h2r _2wzx\" },\n      React.createElement(\"div\", { className: \"_2eq6\" }, null, React.createElement(AdsPETableHeader141, { x: 434 }))\n    );\n  }\n  if (props.x === 440) {\n    return React.createElement(\n      \"div\",\n      { onClick: function() {}, className: \"_54_8 _4h2r _2wzx\" },\n      React.createElement(\"div\", { className: \"_2eq6\" }, null, React.createElement(AdsPETableHeader141, { x: 439 }))\n    );\n  }\n  if (props.x === 445) {\n    return React.createElement(\n      \"div\",\n      { onClick: function() {}, className: \"_54_8 _4h2r _2wzx\" },\n      React.createElement(\"div\", { className: \"_2eq6\" }, null, React.createElement(AdsPETableHeader141, { x: 444 }))\n    );\n  }\n};\n\nvar FixedDataTableSortableHeader149 = function(props) {\n  if (props.x === 342) {\n    return React.createElement(FixedDataTableAbstractSortableHeader148, {\n      x: 341,\n    });\n  }\n  if (props.x === 348) {\n    return React.createElement(FixedDataTableAbstractSortableHeader148, {\n      x: 347,\n    });\n  }\n  if (props.x === 354) {\n    return React.createElement(FixedDataTableAbstractSortableHeader148, {\n      x: 353,\n    });\n  }\n  if (props.x === 359) {\n    return React.createElement(FixedDataTableAbstractSortableHeader148, {\n      x: 358,\n    });\n  }\n  if (props.x === 364) {\n    return React.createElement(FixedDataTableAbstractSortableHeader148, {\n      x: 363,\n    });\n  }\n  if (props.x === 371) {\n    return React.createElement(FixedDataTableAbstractSortableHeader148, {\n      x: 370,\n    });\n  }\n  if (props.x === 376) {\n    return React.createElement(FixedDataTableAbstractSortableHeader148, {\n      x: 375,\n    });\n  }\n  if (props.x === 381) {\n    return React.createElement(FixedDataTableAbstractSortableHeader148, {\n      x: 380,\n    });\n  }\n  if (props.x === 386) {\n    return React.createElement(FixedDataTableAbstractSortableHeader148, {\n      x: 385,\n    });\n  }\n  if (props.x === 391) {\n    return React.createElement(FixedDataTableAbstractSortableHeader148, {\n      x: 390,\n    });\n  }\n  if (props.x === 396) {\n    return React.createElement(FixedDataTableAbstractSortableHeader148, {\n      x: 395,\n    });\n  }\n  if (props.x === 401) {\n    return React.createElement(FixedDataTableAbstractSortableHeader148, {\n      x: 400,\n    });\n  }\n  if (props.x === 406) {\n    return React.createElement(FixedDataTableAbstractSortableHeader148, {\n      x: 405,\n    });\n  }\n  if (props.x === 411) {\n    return React.createElement(FixedDataTableAbstractSortableHeader148, {\n      x: 410,\n    });\n  }\n  if (props.x === 416) {\n    return React.createElement(FixedDataTableAbstractSortableHeader148, {\n      x: 415,\n    });\n  }\n  if (props.x === 421) {\n    return React.createElement(FixedDataTableAbstractSortableHeader148, {\n      x: 420,\n    });\n  }\n  if (props.x === 426) {\n    return React.createElement(FixedDataTableAbstractSortableHeader148, {\n      x: 425,\n    });\n  }\n  if (props.x === 431) {\n    return React.createElement(FixedDataTableAbstractSortableHeader148, {\n      x: 430,\n    });\n  }\n  if (props.x === 436) {\n    return React.createElement(FixedDataTableAbstractSortableHeader148, {\n      x: 435,\n    });\n  }\n  if (props.x === 441) {\n    return React.createElement(FixedDataTableAbstractSortableHeader148, {\n      x: 440,\n    });\n  }\n  if (props.x === 446) {\n    return React.createElement(FixedDataTableAbstractSortableHeader148, {\n      x: 445,\n    });\n  }\n};\n\nvar FixedDataTableBufferedRows150 = function(props) {\n  if (props.x === 459) {\n    return React.createElement(\"div\", {\n      style: {\n        position: \"absolute\",\n        pointerEvents: \"auto\",\n        transform: \"translate3d(0px,65px,0)\",\n        backfaceVisibility: \"hidden\",\n      },\n    });\n  }\n};\n\nvar Scrollbar151 = function(props) {\n  if (props.x === 460) {\n    return null;\n  }\n  if (props.x === 461) {\n    return React.createElement(\n      \"div\",\n      {\n        onFocus: function() {},\n        onBlur: function() {},\n        onKeyDown: function() {},\n        onMouseDown: function() {},\n        onWheel: function() {},\n        className: \"_1t0r _1t0t _4jdr _1t0u\",\n        style: { width: 1209, zIndex: 99 },\n        tabIndex: 0,\n      },\n      React.createElement(\"div\", {\n        className: \"_1t0w _1t0y _1t0_\",\n        style: {\n          width: 561.6340607950117,\n          transform: \"translate3d(4px,0px,0)\",\n          backfaceVisibility: \"hidden\",\n        },\n      })\n    );\n  }\n};\n\nvar HorizontalScrollbar152 = function(props) {\n  if (props.x === 462) {\n    return React.createElement(\n      \"div\",\n      { className: \"_3h1k _3h1m\", style: { height: 15, width: 1209 } },\n      React.createElement(\n        \"div\",\n        {\n          style: {\n            height: 15,\n            position: \"absolute\",\n            overflow: \"hidden\",\n            width: 1209,\n            transform: \"translate3d(0px,0px,0)\",\n            backfaceVisibility: \"hidden\",\n          },\n        },\n        React.createElement(Scrollbar151, { x: 461 })\n      )\n    );\n  }\n};\n\nvar FixedDataTable153 = function(props) {\n  if (props.x === 463) {\n    return React.createElement(\n      \"div\",\n      {\n        className: \"_3h1i _1mie\",\n        onWheel: function() {},\n        style: { height: 25, width: 1209 },\n      },\n      React.createElement(\n        \"div\",\n        { className: \"_3h1j\", style: { height: 8, width: 1209 } },\n        React.createElement(FixedDataTableColumnResizeHandle140, { x: 313 }),\n        React.createElement(FixedDataTableRow147, {\n          x: 335,\n          key: \"group_header\",\n        }),\n        React.createElement(FixedDataTableRow147, { x: 458, key: \"header\" }),\n        React.createElement(FixedDataTableBufferedRows150, { x: 459 }),\n        null,\n        undefined,\n        React.createElement(\"div\", {\n          className: \"_3h1e _3h1h\",\n          style: { top: 8 },\n        })\n      ),\n      React.createElement(Scrollbar151, { x: 460 }),\n      React.createElement(HorizontalScrollbar152, { x: 462 })\n    );\n  }\n};\n\nvar TransitionTable154 = function(props) {\n  if (props.x === 464) {\n    return React.createElement(FixedDataTable153, { x: 463 });\n  }\n};\n\nvar AdsSelectableFixedDataTable155 = function(props) {\n  if (props.x === 465) {\n    return React.createElement(\"div\", { className: \"_5hht\" }, React.createElement(TransitionTable154, { x: 464 }));\n  }\n};\n\nvar AdsDataTableKeyboardSupportDecorator156 = function(props) {\n  if (props.x === 466) {\n    return React.createElement(\n      \"div\",\n      { className: \"_5d6f\", tabIndex: \"0\", onKeyDown: function() {} },\n      React.createElement(AdsSelectableFixedDataTable155, { x: 465 })\n    );\n  }\n};\n\nvar AdsEditableDataTableDecorator157 = function(props) {\n  if (props.x === 467) {\n    return React.createElement(\n      \"div\",\n      { onCopy: function() {} },\n      React.createElement(AdsDataTableKeyboardSupportDecorator156, { x: 466 })\n    );\n  }\n};\n\nvar AdsPEDataTableContainer158 = function(props) {\n  if (props.x === 468) {\n    return React.createElement(\n      \"div\",\n      { className: \"_35l_ _1hr clearfix\" },\n      null,\n      null,\n      null,\n      React.createElement(AdsEditableDataTableDecorator157, { x: 467 })\n    );\n  }\n};\n\nvar AdsPECampaignGroupTableContainer159 = function(props) {\n  if (props.x === 470) {\n    return React.createElement(ResponsiveBlock37, { x: 469 });\n  }\n};\n\nvar AdsPEManageAdsPaneContainer160 = function(props) {\n  if (props.x === 473) {\n    return React.createElement(\n      \"div\",\n      null,\n      React.createElement(AdsErrorBoundary10, { x: 65 }),\n      React.createElement(\"div\", { className: \"_2uty\" }, React.createElement(AdsErrorBoundary10, { x: 125 })),\n      React.createElement(\n        \"div\",\n        { className: \"_2utx _21oc\" },\n        React.createElement(AdsErrorBoundary10, { x: 171 }),\n        React.createElement(\n          \"div\",\n          { className: \"_41tu\" },\n          React.createElement(AdsErrorBoundary10, { x: 176 }),\n          React.createElement(AdsErrorBoundary10, { x: 194 })\n        )\n      ),\n      React.createElement(\n        \"div\",\n        { className: \"_2utz\", style: { height: 25 } },\n        React.createElement(AdsErrorBoundary10, { x: 302 }),\n        React.createElement(\"div\", { className: \"_2ut-\" }, React.createElement(AdsErrorBoundary10, { x: 312 })),\n        React.createElement(\"div\", { className: \"_2ut_\" }, React.createElement(AdsErrorBoundary10, { x: 472 }))\n      )\n    );\n  }\n};\n\nvar AdsPEContentContainer161 = function(props) {\n  if (props.x === 474) {\n    return React.createElement(AdsPEManageAdsPaneContainer160, { x: 473 });\n  }\n};\n\nvar FluxContainer_AdsPEWorkspaceContainer_162 = function(props) {\n  if (props.x === 477) {\n    return React.createElement(\n      \"div\",\n      { className: \"_49wu\", style: { height: 177, top: 43, width: 1306 } },\n      React.createElement(ResponsiveBlock37, { x: 62, key: \"0\" }),\n      React.createElement(AdsErrorBoundary10, { x: 476, key: \"1\" }),\n      null\n    );\n  }\n};\n\nvar FluxContainer_AdsSessionExpiredDialogContainer_163 = function(props) {\n  if (props.x === 478) {\n    return null;\n  }\n};\n\nvar FluxContainer_AdsPEUploadDialogLazyContainer_164 = function(props) {\n  if (props.x === 479) {\n    return null;\n  }\n};\n\nvar FluxContainer_DialogContainer_165 = function(props) {\n  if (props.x === 480) {\n    return null;\n  }\n};\n\nvar AdsBugReportContainer166 = function(props) {\n  if (props.x === 481) {\n    return React.createElement(\"span\", null);\n  }\n};\n\nvar AdsPEAudienceSplittingDialog167 = function(props) {\n  if (props.x === 482) {\n    return null;\n  }\n};\n\nvar AdsPEAudienceSplittingDialogContainer168 = function(props) {\n  if (props.x === 483) {\n    return React.createElement(\"div\", null, React.createElement(AdsPEAudienceSplittingDialog167, { x: 482 }));\n  }\n};\n\nvar FluxContainer_AdsRuleDialogBootloadContainer_169 = function(props) {\n  if (props.x === 484) {\n    return null;\n  }\n};\n\nvar FluxContainer_AdsPECFTrayContainer_170 = function(props) {\n  if (props.x === 485) {\n    return null;\n  }\n};\n\nvar FluxContainer_AdsPEDeleteDraftContainer_171 = function(props) {\n  if (props.x === 486) {\n    return null;\n  }\n};\n\nvar FluxContainer_AdsPEInitialDraftPublishDialogContainer_172 = function(props) {\n  if (props.x === 487) {\n    return null;\n  }\n};\n\nvar FluxContainer_AdsPEReachFrequencyStatusTransitionDialogBootloadContainer_173 = function(props) {\n  if (props.x === 488) {\n    return null;\n  }\n};\n\nvar FluxContainer_AdsPEPurgeArchiveDialogContainer_174 = function(props) {\n  if (props.x === 489) {\n    return null;\n  }\n};\n\nvar AdsPECreateDialogContainer175 = function(props) {\n  if (props.x === 490) {\n    return React.createElement(\"span\", null);\n  }\n};\n\nvar FluxContainer_AdsPEModalStatusContainer_176 = function(props) {\n  if (props.x === 491) {\n    return null;\n  }\n};\n\nvar FluxContainer_AdsBrowserExtensionErrorDialogContainer_177 = function(props) {\n  if (props.x === 492) {\n    return null;\n  }\n};\n\nvar FluxContainer_AdsPESortByErrorTipContainer_178 = function(props) {\n  if (props.x === 493) {\n    return null;\n  }\n};\n\nvar LeadDownloadDialogSelector179 = function(props) {\n  if (props.x === 494) {\n    return null;\n  }\n};\n\nvar FluxContainer_AdsPELeadDownloadDialogContainerClass_180 = function(props) {\n  if (props.x === 495) {\n    return React.createElement(LeadDownloadDialogSelector179, { x: 494 });\n  }\n};\n\nvar AdsPEContainer181 = function(props) {\n  if (props.x === 496) {\n    return React.createElement(\n      \"div\",\n      { id: \"ads_pe_container\" },\n      React.createElement(FluxContainer_AdsPETopNavContainer_26, { x: 41 }),\n      null,\n      React.createElement(FluxContainer_AdsPEWorkspaceContainer_162, {\n        x: 477,\n      }),\n      React.createElement(FluxContainer_AdsSessionExpiredDialogContainer_163, { x: 478 }),\n      React.createElement(FluxContainer_AdsPEUploadDialogLazyContainer_164, {\n        x: 479,\n      }),\n      React.createElement(FluxContainer_DialogContainer_165, { x: 480 }),\n      React.createElement(AdsBugReportContainer166, { x: 481 }),\n      React.createElement(AdsPEAudienceSplittingDialogContainer168, { x: 483 }),\n      React.createElement(FluxContainer_AdsRuleDialogBootloadContainer_169, {\n        x: 484,\n      }),\n      React.createElement(FluxContainer_AdsPECFTrayContainer_170, { x: 485 }),\n      React.createElement(\n        \"span\",\n        null,\n        React.createElement(FluxContainer_AdsPEDeleteDraftContainer_171, {\n          x: 486,\n        }),\n        React.createElement(FluxContainer_AdsPEInitialDraftPublishDialogContainer_172, { x: 487 }),\n        React.createElement(FluxContainer_AdsPEReachFrequencyStatusTransitionDialogBootloadContainer_173, { x: 488 })\n      ),\n      React.createElement(FluxContainer_AdsPEPurgeArchiveDialogContainer_174, { x: 489 }),\n      React.createElement(AdsPECreateDialogContainer175, { x: 490 }),\n      React.createElement(FluxContainer_AdsPEModalStatusContainer_176, {\n        x: 491,\n      }),\n      React.createElement(FluxContainer_AdsBrowserExtensionErrorDialogContainer_177, { x: 492 }),\n      React.createElement(FluxContainer_AdsPESortByErrorTipContainer_178, {\n        x: 493,\n      }),\n      React.createElement(FluxContainer_AdsPELeadDownloadDialogContainerClass_180, { x: 495 }),\n      React.createElement(\"div\", { id: \"web_ads_guidance_tips\" })\n    );\n  }\n};\n\nfunction Benchmark(props) {\n  if (props.x === undefined) {\n    return React.createElement(AdsPEContainer181, { x: 496 });\n  }\n}\n\nfunction runCompileVersion(renderer, Root) {\n  return [[\"server render\", ReactDOMServer.renderToString(<Benchmark />)]];\n}\n\nfunction runNonCompiledVersion(renderer, Root) {\n  return [[\"server render\", ReactDOMServer.renderToString(<Benchmark />)]];\n}\n\nfunction getTrialsA(renderer, Root, data) {\n  // console.time(\"server render\");\n  var result = runNonCompiledVersion(renderer, Root, data);\n  // console.timeEnd(\"server render\");\n  return result;\n}\n\nfunction getTrialsB(renderer, Root, data) {\n  // console.time(\"compiled server render\");\n  var result = runCompileVersion(renderer, Root, data);\n  // console.timeEnd(\"compiled server render\");\n  return result;\n}\nif (this.__optimize) {\n  // this is only for the compiled route\n  __optimize(runCompileVersion);\n  Benchmark.getTrials = getTrialsB;\n} else {\n  Benchmark.getTrials = getTrialsA;\n}\n\n// we run the getTrials from both version rather than\n// from the non-compiled version\nBenchmark.independent = true;\n\nmodule.exports = Benchmark;\n"
  },
  {
    "path": "test/react/ServerRendering-test.js",
    "content": "/**\n * Copyright (c) 2017-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n/* @flow */\n\nconst fs = require(\"fs\");\nconst setupReactTests = require(\"./setupReactTests\");\nconst { runTest } = setupReactTests();\n\n/* eslint-disable no-undef */\nconst { it } = global;\n\nit(\"Hacker News app\", () => {\n  let data = JSON.parse(fs.readFileSync(__dirname + \"/ServerRendering/hacker-news.json\").toString());\n  runTest(__dirname + \"/ServerRendering/hacker-news.js\", { data });\n});\n\nit(\"PE Functional Components benchmark\", () => {\n  runTest(__dirname + \"/ServerRendering/pe-functional-benchmark.js\");\n});\n"
  },
  {
    "path": "test/react/Throw/throw-conditional.js",
    "content": "const React = require(\"react\");\n\nfunction MyComponent(props) {\n  if (props.b) throw new Error(\"abrupt\");\n  return 42;\n}\n\nif (global.__optimizeReactComponentTree) global.__optimizeReactComponentTree(MyComponent);\n\nMyComponent.getTrials = renderer => {\n  renderer.update(<MyComponent b={false} />);\n  return [[\"simple render\", renderer.toJSON()]];\n};\n\nmodule.exports = MyComponent;\n"
  },
  {
    "path": "test/react/Throw/throw.js",
    "content": "const React = require(\"react\");\n\nfunction MyComponent() {\n  throw new Error(\"abrupt\");\n}\n\nif (global.__optimizeReactComponentTree) global.__optimizeReactComponentTree(MyComponent);\n\nMyComponent.getTrials = renderer => {\n  let error = false;\n  try {\n    MyComponent({});\n  } catch (error) {\n    error = true;\n  }\n  return [[\"component errors\", error]];\n};\n\nmodule.exports = MyComponent;\n"
  },
  {
    "path": "test/react/Throw-test.js",
    "content": "/**\n * Copyright (c) 2017-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n/* @flow */\n\nconst path = require(\"path\");\nconst fs = require(\"fs\");\nconst setupReactTests = require(\"./setupReactTests\");\nconst { runTest } = setupReactTests();\n\nconst customConfig = new Map();\n\nfs.readdirSync(path.resolve(__dirname, \"Throw\")).forEach(file => {\n  test(file, () => {\n    runTest(path.resolve(__dirname, \"Throw\", file), customConfig.get(file));\n  });\n});\n"
  },
  {
    "path": "test/react/__snapshots__/AssignSpread-test.js.snap",
    "content": "// Jest Snapshot v1, https://goo.gl/fbAQLP\n\nexports[`Simple with Object.assign #2: (JSX => JSX) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 2,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [],\n          \"message\": \"\",\n          \"name\": \"A\",\n          \"status\": \"INLINED\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 1,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`Simple with Object.assign #2: (JSX => createElement) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 2,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [],\n          \"message\": \"\",\n          \"name\": \"A\",\n          \"status\": \"INLINED\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 1,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`Simple with Object.assign #2: (createElement => JSX) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 2,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [],\n          \"message\": \"\",\n          \"name\": \"A\",\n          \"status\": \"INLINED\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 1,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`Simple with Object.assign #2: (createElement => createElement) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 2,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [],\n          \"message\": \"\",\n          \"name\": \"A\",\n          \"status\": \"INLINED\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 1,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`Simple with Object.assign #3: (JSX => JSX) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 1,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 0,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`Simple with Object.assign #3: (JSX => createElement) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 1,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 0,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`Simple with Object.assign #3: (createElement => JSX) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 1,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 0,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`Simple with Object.assign #3: (createElement => createElement) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 1,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 0,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`Simple with Object.assign #4: (JSX => JSX) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 1,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 0,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`Simple with Object.assign #4: (JSX => createElement) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 1,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 0,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`Simple with Object.assign #4: (createElement => JSX) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 1,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 0,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`Simple with Object.assign #4: (createElement => createElement) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 1,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 0,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`Simple with Object.assign #5: (JSX => JSX) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 1,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 0,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`Simple with Object.assign #5: (JSX => createElement) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 1,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 0,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`Simple with Object.assign #5: (createElement => JSX) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 1,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 0,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`Simple with Object.assign #5: (createElement => createElement) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 1,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 0,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`Simple with Object.assign: (JSX => JSX) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 2,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [],\n          \"message\": \"\",\n          \"name\": \"A\",\n          \"status\": \"INLINED\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 1,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`Simple with Object.assign: (JSX => createElement) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 2,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [],\n          \"message\": \"\",\n          \"name\": \"A\",\n          \"status\": \"INLINED\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 1,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`Simple with Object.assign: (createElement => JSX) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 2,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [],\n          \"message\": \"\",\n          \"name\": \"A\",\n          \"status\": \"INLINED\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 1,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`Simple with Object.assign: (createElement => createElement) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 2,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [],\n          \"message\": \"\",\n          \"name\": \"A\",\n          \"status\": \"INLINED\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 1,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`Simple with multiple JSX spreads #2: (JSX => JSX) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 3,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [\n            Object {\n              \"children\": Array [],\n              \"message\": \"\",\n              \"name\": \"IWantThisToBeInlined\",\n              \"status\": \"INLINED\",\n            },\n          ],\n          \"message\": \"\",\n          \"name\": \"Button\",\n          \"status\": \"INLINED\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 2,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`Simple with multiple JSX spreads #2: (JSX => createElement) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 3,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [\n            Object {\n              \"children\": Array [],\n              \"message\": \"\",\n              \"name\": \"IWantThisToBeInlined\",\n              \"status\": \"INLINED\",\n            },\n          ],\n          \"message\": \"\",\n          \"name\": \"Button\",\n          \"status\": \"INLINED\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 2,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`Simple with multiple JSX spreads #2: (createElement => JSX) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 3,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [\n            Object {\n              \"children\": Array [],\n              \"message\": \"\",\n              \"name\": \"IWantThisToBeInlined\",\n              \"status\": \"INLINED\",\n            },\n          ],\n          \"message\": \"\",\n          \"name\": \"Button\",\n          \"status\": \"INLINED\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 2,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`Simple with multiple JSX spreads #2: (createElement => createElement) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 3,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [\n            Object {\n              \"children\": Array [],\n              \"message\": \"\",\n              \"name\": \"IWantThisToBeInlined\",\n              \"status\": \"INLINED\",\n            },\n          ],\n          \"message\": \"\",\n          \"name\": \"Button\",\n          \"status\": \"INLINED\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 2,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`Simple with multiple JSX spreads #3: (JSX => JSX) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 2,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [],\n          \"message\": \"\",\n          \"name\": \"Button\",\n          \"status\": \"INLINED\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 1,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`Simple with multiple JSX spreads #3: (JSX => createElement) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 2,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [],\n          \"message\": \"\",\n          \"name\": \"Button\",\n          \"status\": \"INLINED\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 1,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`Simple with multiple JSX spreads #3: (createElement => JSX) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 2,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [],\n          \"message\": \"\",\n          \"name\": \"Button\",\n          \"status\": \"INLINED\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 1,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`Simple with multiple JSX spreads #3: (createElement => createElement) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 2,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [],\n          \"message\": \"\",\n          \"name\": \"Button\",\n          \"status\": \"INLINED\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 1,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`Simple with multiple JSX spreads #4: (JSX => JSX) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 1,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 0,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`Simple with multiple JSX spreads #4: (JSX => createElement) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 1,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 0,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`Simple with multiple JSX spreads #4: (createElement => JSX) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 1,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 0,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`Simple with multiple JSX spreads #4: (createElement => createElement) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 1,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 0,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`Simple with multiple JSX spreads #5: (JSX => JSX) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 1,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 0,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`Simple with multiple JSX spreads #5: (JSX => createElement) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 1,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 0,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`Simple with multiple JSX spreads #5: (createElement => JSX) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 1,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 0,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`Simple with multiple JSX spreads #5: (createElement => createElement) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 1,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 0,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`Simple with multiple JSX spreads #6: (JSX => JSX) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 1,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 0,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`Simple with multiple JSX spreads #6: (JSX => createElement) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 1,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 0,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`Simple with multiple JSX spreads #6: (createElement => JSX) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 1,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 0,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`Simple with multiple JSX spreads #6: (createElement => createElement) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 1,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 0,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`Simple with multiple JSX spreads #7: (JSX => JSX) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 1,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 0,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`Simple with multiple JSX spreads #7: (JSX => createElement) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 1,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 0,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`Simple with multiple JSX spreads #7: (createElement => JSX) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 1,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 0,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`Simple with multiple JSX spreads #7: (createElement => createElement) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 1,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 0,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`Simple with multiple JSX spreads #8: (JSX => JSX) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 1,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 0,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`Simple with multiple JSX spreads #8: (JSX => createElement) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 1,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 0,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`Simple with multiple JSX spreads #8: (createElement => JSX) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 1,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 0,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`Simple with multiple JSX spreads #8: (createElement => createElement) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 1,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 0,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`Simple with multiple JSX spreads #9: (JSX => JSX) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 4,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [\n            Object {\n              \"children\": Array [],\n              \"message\": \"\",\n              \"name\": \"Child2\",\n              \"status\": \"INLINED\",\n            },\n            Object {\n              \"children\": Array [],\n              \"message\": \"\",\n              \"name\": \"Child2\",\n              \"status\": \"INLINED\",\n            },\n          ],\n          \"message\": \"\",\n          \"name\": \"Child\",\n          \"status\": \"INLINED\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 3,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`Simple with multiple JSX spreads #9: (JSX => createElement) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 4,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [\n            Object {\n              \"children\": Array [],\n              \"message\": \"\",\n              \"name\": \"Child2\",\n              \"status\": \"INLINED\",\n            },\n            Object {\n              \"children\": Array [],\n              \"message\": \"\",\n              \"name\": \"Child2\",\n              \"status\": \"INLINED\",\n            },\n          ],\n          \"message\": \"\",\n          \"name\": \"Child\",\n          \"status\": \"INLINED\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 3,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`Simple with multiple JSX spreads #9: (createElement => JSX) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 4,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [\n            Object {\n              \"children\": Array [],\n              \"message\": \"\",\n              \"name\": \"Child2\",\n              \"status\": \"INLINED\",\n            },\n            Object {\n              \"children\": Array [],\n              \"message\": \"\",\n              \"name\": \"Child2\",\n              \"status\": \"INLINED\",\n            },\n          ],\n          \"message\": \"\",\n          \"name\": \"Child\",\n          \"status\": \"INLINED\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 3,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`Simple with multiple JSX spreads #9: (createElement => createElement) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 4,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [\n            Object {\n              \"children\": Array [],\n              \"message\": \"\",\n              \"name\": \"Child2\",\n              \"status\": \"INLINED\",\n            },\n            Object {\n              \"children\": Array [],\n              \"message\": \"\",\n              \"name\": \"Child2\",\n              \"status\": \"INLINED\",\n            },\n          ],\n          \"message\": \"\",\n          \"name\": \"Child\",\n          \"status\": \"INLINED\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 3,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`Simple with multiple JSX spreads #10: (JSX => JSX) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 4,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [\n            Object {\n              \"children\": Array [],\n              \"message\": \"\",\n              \"name\": \"Child2\",\n              \"status\": \"INLINED\",\n            },\n            Object {\n              \"children\": Array [],\n              \"message\": \"\",\n              \"name\": \"Child2\",\n              \"status\": \"INLINED\",\n            },\n          ],\n          \"message\": \"\",\n          \"name\": \"Child\",\n          \"status\": \"INLINED\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 3,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`Simple with multiple JSX spreads #10: (JSX => createElement) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 4,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [\n            Object {\n              \"children\": Array [],\n              \"message\": \"\",\n              \"name\": \"Child2\",\n              \"status\": \"INLINED\",\n            },\n            Object {\n              \"children\": Array [],\n              \"message\": \"\",\n              \"name\": \"Child2\",\n              \"status\": \"INLINED\",\n            },\n          ],\n          \"message\": \"\",\n          \"name\": \"Child\",\n          \"status\": \"INLINED\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 3,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`Simple with multiple JSX spreads #10: (createElement => JSX) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 4,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [\n            Object {\n              \"children\": Array [],\n              \"message\": \"\",\n              \"name\": \"Child2\",\n              \"status\": \"INLINED\",\n            },\n            Object {\n              \"children\": Array [],\n              \"message\": \"\",\n              \"name\": \"Child2\",\n              \"status\": \"INLINED\",\n            },\n          ],\n          \"message\": \"\",\n          \"name\": \"Child\",\n          \"status\": \"INLINED\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 3,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`Simple with multiple JSX spreads #10: (createElement => createElement) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 4,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [\n            Object {\n              \"children\": Array [],\n              \"message\": \"\",\n              \"name\": \"Child2\",\n              \"status\": \"INLINED\",\n            },\n            Object {\n              \"children\": Array [],\n              \"message\": \"\",\n              \"name\": \"Child2\",\n              \"status\": \"INLINED\",\n            },\n          ],\n          \"message\": \"\",\n          \"name\": \"Child\",\n          \"status\": \"INLINED\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 3,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`Simple with multiple JSX spreads #11: (JSX => JSX) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 4,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [\n            Object {\n              \"children\": Array [],\n              \"message\": \"\",\n              \"name\": \"Child2\",\n              \"status\": \"INLINED\",\n            },\n            Object {\n              \"children\": Array [],\n              \"message\": \"\",\n              \"name\": \"Child2\",\n              \"status\": \"INLINED\",\n            },\n          ],\n          \"message\": \"\",\n          \"name\": \"Child\",\n          \"status\": \"INLINED\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 3,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`Simple with multiple JSX spreads #11: (JSX => createElement) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 4,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [\n            Object {\n              \"children\": Array [],\n              \"message\": \"\",\n              \"name\": \"Child2\",\n              \"status\": \"INLINED\",\n            },\n            Object {\n              \"children\": Array [],\n              \"message\": \"\",\n              \"name\": \"Child2\",\n              \"status\": \"INLINED\",\n            },\n          ],\n          \"message\": \"\",\n          \"name\": \"Child\",\n          \"status\": \"INLINED\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 3,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`Simple with multiple JSX spreads #11: (createElement => JSX) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 4,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [\n            Object {\n              \"children\": Array [],\n              \"message\": \"\",\n              \"name\": \"Child2\",\n              \"status\": \"INLINED\",\n            },\n            Object {\n              \"children\": Array [],\n              \"message\": \"\",\n              \"name\": \"Child2\",\n              \"status\": \"INLINED\",\n            },\n          ],\n          \"message\": \"\",\n          \"name\": \"Child\",\n          \"status\": \"INLINED\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 3,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`Simple with multiple JSX spreads #11: (createElement => createElement) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 4,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [\n            Object {\n              \"children\": Array [],\n              \"message\": \"\",\n              \"name\": \"Child2\",\n              \"status\": \"INLINED\",\n            },\n            Object {\n              \"children\": Array [],\n              \"message\": \"\",\n              \"name\": \"Child2\",\n              \"status\": \"INLINED\",\n            },\n          ],\n          \"message\": \"\",\n          \"name\": \"Child\",\n          \"status\": \"INLINED\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 3,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`Simple with multiple JSX spreads #12: (JSX => JSX) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 2,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [],\n          \"message\": \"\",\n          \"name\": \"Button\",\n          \"status\": \"INLINED\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 1,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`Simple with multiple JSX spreads #12: (JSX => createElement) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 2,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [],\n          \"message\": \"\",\n          \"name\": \"Button\",\n          \"status\": \"INLINED\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 1,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`Simple with multiple JSX spreads #12: (createElement => JSX) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 2,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [],\n          \"message\": \"\",\n          \"name\": \"Button\",\n          \"status\": \"INLINED\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 1,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`Simple with multiple JSX spreads #12: (createElement => createElement) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 2,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [],\n          \"message\": \"\",\n          \"name\": \"Button\",\n          \"status\": \"INLINED\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 1,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`Simple with multiple JSX spreads #13: (JSX => JSX) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 4,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [],\n          \"message\": \"\",\n          \"name\": \"Button\",\n          \"status\": \"INLINED\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [],\n          \"message\": \"\",\n          \"name\": \"Button\",\n          \"status\": \"INLINED\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App2\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 2,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 2,\n}\n`;\n\nexports[`Simple with multiple JSX spreads #13: (JSX => createElement) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 4,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [],\n          \"message\": \"\",\n          \"name\": \"Button\",\n          \"status\": \"INLINED\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [],\n          \"message\": \"\",\n          \"name\": \"Button\",\n          \"status\": \"INLINED\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App2\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 2,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 2,\n}\n`;\n\nexports[`Simple with multiple JSX spreads #13: (createElement => JSX) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 4,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [],\n          \"message\": \"\",\n          \"name\": \"Button\",\n          \"status\": \"INLINED\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [],\n          \"message\": \"\",\n          \"name\": \"Button\",\n          \"status\": \"INLINED\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App2\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 2,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 2,\n}\n`;\n\nexports[`Simple with multiple JSX spreads #13: (createElement => createElement) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 4,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [],\n          \"message\": \"\",\n          \"name\": \"Button\",\n          \"status\": \"INLINED\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [],\n          \"message\": \"\",\n          \"name\": \"Button\",\n          \"status\": \"INLINED\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App2\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 2,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 2,\n}\n`;\n\nexports[`Simple with multiple JSX spreads: (JSX => JSX) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 3,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [\n            Object {\n              \"children\": Array [],\n              \"message\": \"\",\n              \"name\": \"IWantThisToBeInlined\",\n              \"status\": \"INLINED\",\n            },\n          ],\n          \"message\": \"\",\n          \"name\": \"Button\",\n          \"status\": \"INLINED\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 2,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`Simple with multiple JSX spreads: (JSX => createElement) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 3,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [\n            Object {\n              \"children\": Array [],\n              \"message\": \"\",\n              \"name\": \"IWantThisToBeInlined\",\n              \"status\": \"INLINED\",\n            },\n          ],\n          \"message\": \"\",\n          \"name\": \"Button\",\n          \"status\": \"INLINED\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 2,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`Simple with multiple JSX spreads: (createElement => JSX) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 3,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [\n            Object {\n              \"children\": Array [],\n              \"message\": \"\",\n              \"name\": \"IWantThisToBeInlined\",\n              \"status\": \"INLINED\",\n            },\n          ],\n          \"message\": \"\",\n          \"name\": \"Button\",\n          \"status\": \"INLINED\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 2,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`Simple with multiple JSX spreads: (createElement => createElement) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 3,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [\n            Object {\n              \"children\": Array [],\n              \"message\": \"\",\n              \"name\": \"IWantThisToBeInlined\",\n              \"status\": \"INLINED\",\n            },\n          ],\n          \"message\": \"\",\n          \"name\": \"Button\",\n          \"status\": \"INLINED\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 2,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`Unsafe spread: (JSX => JSX) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 1,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 0,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`Unsafe spread: (JSX => createElement) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 1,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 0,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`Unsafe spread: (createElement => JSX) 1`] = `\"Failed to optimize React component tree for \\\\\"App\\\\\" due to a fatal error during evaluation: A fatal error occurred while prepacking.\"`;\n\nexports[`Unsafe spread: (createElement => createElement) 1`] = `\"Failed to optimize React component tree for \\\\\"App\\\\\" due to a fatal error during evaluation: A fatal error occurred while prepacking.\"`;\n"
  },
  {
    "path": "test/react/__snapshots__/ClassComponents-test.js.snap",
    "content": "// Jest Snapshot v1, https://goo.gl/fbAQLP\n\nexports[`Classes with state: (JSX => JSX) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 1,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 0,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`Classes with state: (JSX => createElement) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 1,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 0,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`Classes with state: (createElement => JSX) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 1,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 0,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`Classes with state: (createElement => createElement) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 1,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 0,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`Complex class component hoists nodes independently of functional root component: (JSX => JSX) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 4,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [\n            Object {\n              \"children\": Array [],\n              \"message\": \"\",\n              \"name\": \"React.Fragment\",\n              \"status\": \"NORMAL\",\n            },\n          ],\n          \"message\": \"\",\n          \"name\": \"Epsilon\",\n          \"status\": \"NEW_TREE\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"Tau\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 0,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 2,\n}\n`;\n\nexports[`Complex class component hoists nodes independently of functional root component: (JSX => createElement) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 4,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [\n            Object {\n              \"children\": Array [],\n              \"message\": \"\",\n              \"name\": \"React.Fragment\",\n              \"status\": \"NORMAL\",\n            },\n          ],\n          \"message\": \"\",\n          \"name\": \"Epsilon\",\n          \"status\": \"NEW_TREE\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"Tau\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 0,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 2,\n}\n`;\n\nexports[`Complex class component hoists nodes independently of functional root component: (createElement => JSX) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 4,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [\n            Object {\n              \"children\": Array [],\n              \"message\": \"\",\n              \"name\": \"React.Fragment\",\n              \"status\": \"NORMAL\",\n            },\n          ],\n          \"message\": \"\",\n          \"name\": \"Epsilon\",\n          \"status\": \"NEW_TREE\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"Tau\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 0,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 2,\n}\n`;\n\nexports[`Complex class component hoists nodes independently of functional root component: (createElement => createElement) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 4,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [\n            Object {\n              \"children\": Array [],\n              \"message\": \"\",\n              \"name\": \"React.Fragment\",\n              \"status\": \"NORMAL\",\n            },\n          ],\n          \"message\": \"\",\n          \"name\": \"Epsilon\",\n          \"status\": \"NEW_TREE\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"Tau\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 0,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 2,\n}\n`;\n\nexports[`Complex class component rendering equivalent node to functional root component: (JSX => JSX) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 5,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [\n            Object {\n              \"children\": Array [],\n              \"message\": \"\",\n              \"name\": \"Zeta\",\n              \"status\": \"INLINED\",\n            },\n          ],\n          \"message\": \"\",\n          \"name\": \"Epsilon\",\n          \"status\": \"NEW_TREE\",\n        },\n        Object {\n          \"children\": Array [],\n          \"message\": \"\",\n          \"name\": \"Zeta\",\n          \"status\": \"INLINED\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"Tau\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 2,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 2,\n}\n`;\n\nexports[`Complex class component rendering equivalent node to functional root component: (JSX => createElement) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 5,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [\n            Object {\n              \"children\": Array [],\n              \"message\": \"\",\n              \"name\": \"Zeta\",\n              \"status\": \"INLINED\",\n            },\n          ],\n          \"message\": \"\",\n          \"name\": \"Epsilon\",\n          \"status\": \"NEW_TREE\",\n        },\n        Object {\n          \"children\": Array [],\n          \"message\": \"\",\n          \"name\": \"Zeta\",\n          \"status\": \"INLINED\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"Tau\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 2,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 2,\n}\n`;\n\nexports[`Complex class component rendering equivalent node to functional root component: (createElement => JSX) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 5,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [\n            Object {\n              \"children\": Array [],\n              \"message\": \"\",\n              \"name\": \"Zeta\",\n              \"status\": \"INLINED\",\n            },\n          ],\n          \"message\": \"\",\n          \"name\": \"Epsilon\",\n          \"status\": \"NEW_TREE\",\n        },\n        Object {\n          \"children\": Array [],\n          \"message\": \"\",\n          \"name\": \"Zeta\",\n          \"status\": \"INLINED\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"Tau\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 2,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 2,\n}\n`;\n\nexports[`Complex class component rendering equivalent node to functional root component: (createElement => createElement) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 5,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [\n            Object {\n              \"children\": Array [],\n              \"message\": \"\",\n              \"name\": \"Zeta\",\n              \"status\": \"INLINED\",\n            },\n          ],\n          \"message\": \"\",\n          \"name\": \"Epsilon\",\n          \"status\": \"NEW_TREE\",\n        },\n        Object {\n          \"children\": Array [],\n          \"message\": \"\",\n          \"name\": \"Zeta\",\n          \"status\": \"INLINED\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"Tau\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 2,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 2,\n}\n`;\n\nexports[`Complex class components folding into functional root component #2: (JSX => JSX) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 4,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [\n            Object {\n              \"children\": Array [],\n              \"message\": \"\",\n              \"name\": \"Child2\",\n              \"status\": \"INLINED\",\n            },\n          ],\n          \"message\": \"\",\n          \"name\": \"Child\",\n          \"status\": \"NEW_TREE\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 1,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 2,\n}\n`;\n\nexports[`Complex class components folding into functional root component #2: (JSX => createElement) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 4,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [\n            Object {\n              \"children\": Array [],\n              \"message\": \"\",\n              \"name\": \"Child2\",\n              \"status\": \"INLINED\",\n            },\n          ],\n          \"message\": \"\",\n          \"name\": \"Child\",\n          \"status\": \"NEW_TREE\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 1,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 2,\n}\n`;\n\nexports[`Complex class components folding into functional root component #2: (createElement => JSX) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 4,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [\n            Object {\n              \"children\": Array [],\n              \"message\": \"\",\n              \"name\": \"Child2\",\n              \"status\": \"INLINED\",\n            },\n          ],\n          \"message\": \"\",\n          \"name\": \"Child\",\n          \"status\": \"NEW_TREE\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 1,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 2,\n}\n`;\n\nexports[`Complex class components folding into functional root component #2: (createElement => createElement) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 4,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [\n            Object {\n              \"children\": Array [],\n              \"message\": \"\",\n              \"name\": \"Child2\",\n              \"status\": \"INLINED\",\n            },\n          ],\n          \"message\": \"\",\n          \"name\": \"Child\",\n          \"status\": \"NEW_TREE\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 1,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 2,\n}\n`;\n\nexports[`Complex class components folding into functional root component #3: (JSX => JSX) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 4,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [\n            Object {\n              \"children\": Array [],\n              \"message\": \"\",\n              \"name\": \"Child2\",\n              \"status\": \"INLINED\",\n            },\n          ],\n          \"message\": \"\",\n          \"name\": \"Child\",\n          \"status\": \"NEW_TREE\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 1,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 2,\n}\n`;\n\nexports[`Complex class components folding into functional root component #3: (JSX => createElement) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 4,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [\n            Object {\n              \"children\": Array [],\n              \"message\": \"\",\n              \"name\": \"Child2\",\n              \"status\": \"INLINED\",\n            },\n          ],\n          \"message\": \"\",\n          \"name\": \"Child\",\n          \"status\": \"NEW_TREE\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 1,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 2,\n}\n`;\n\nexports[`Complex class components folding into functional root component #3: (createElement => JSX) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 4,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [\n            Object {\n              \"children\": Array [],\n              \"message\": \"\",\n              \"name\": \"Child2\",\n              \"status\": \"INLINED\",\n            },\n          ],\n          \"message\": \"\",\n          \"name\": \"Child\",\n          \"status\": \"NEW_TREE\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 1,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 2,\n}\n`;\n\nexports[`Complex class components folding into functional root component #3: (createElement => createElement) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 4,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [\n            Object {\n              \"children\": Array [],\n              \"message\": \"\",\n              \"name\": \"Child2\",\n              \"status\": \"INLINED\",\n            },\n          ],\n          \"message\": \"\",\n          \"name\": \"Child\",\n          \"status\": \"NEW_TREE\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 1,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 2,\n}\n`;\n\nexports[`Complex class components folding into functional root component #4: (JSX => JSX) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 12,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [],\n          \"message\": \"\",\n          \"name\": \"Child\",\n          \"status\": \"NEW_TREE\",\n        },\n        Object {\n          \"children\": Array [],\n          \"message\": \"\",\n          \"name\": \"Child\",\n          \"status\": \"NEW_TREE\",\n        },\n        Object {\n          \"children\": Array [],\n          \"message\": \"\",\n          \"name\": \"Child\",\n          \"status\": \"NEW_TREE\",\n        },\n        Object {\n          \"children\": Array [],\n          \"message\": \"\",\n          \"name\": \"Child\",\n          \"status\": \"NEW_TREE\",\n        },\n        Object {\n          \"children\": Array [],\n          \"message\": \"\",\n          \"name\": \"Child\",\n          \"status\": \"NEW_TREE\",\n        },\n        Object {\n          \"children\": Array [],\n          \"message\": \"\",\n          \"name\": \"Child\",\n          \"status\": \"NEW_TREE\",\n        },\n        Object {\n          \"children\": Array [],\n          \"message\": \"\",\n          \"name\": \"Child\",\n          \"status\": \"NEW_TREE\",\n        },\n        Object {\n          \"children\": Array [],\n          \"message\": \"\",\n          \"name\": \"Child\",\n          \"status\": \"NEW_TREE\",\n        },\n        Object {\n          \"children\": Array [],\n          \"message\": \"\",\n          \"name\": \"Child\",\n          \"status\": \"NEW_TREE\",\n        },\n        Object {\n          \"children\": Array [],\n          \"message\": \"\",\n          \"name\": \"Child\",\n          \"status\": \"NEW_TREE\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 0,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 2,\n}\n`;\n\nexports[`Complex class components folding into functional root component #4: (JSX => createElement) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 12,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [],\n          \"message\": \"\",\n          \"name\": \"Child\",\n          \"status\": \"NEW_TREE\",\n        },\n        Object {\n          \"children\": Array [],\n          \"message\": \"\",\n          \"name\": \"Child\",\n          \"status\": \"NEW_TREE\",\n        },\n        Object {\n          \"children\": Array [],\n          \"message\": \"\",\n          \"name\": \"Child\",\n          \"status\": \"NEW_TREE\",\n        },\n        Object {\n          \"children\": Array [],\n          \"message\": \"\",\n          \"name\": \"Child\",\n          \"status\": \"NEW_TREE\",\n        },\n        Object {\n          \"children\": Array [],\n          \"message\": \"\",\n          \"name\": \"Child\",\n          \"status\": \"NEW_TREE\",\n        },\n        Object {\n          \"children\": Array [],\n          \"message\": \"\",\n          \"name\": \"Child\",\n          \"status\": \"NEW_TREE\",\n        },\n        Object {\n          \"children\": Array [],\n          \"message\": \"\",\n          \"name\": \"Child\",\n          \"status\": \"NEW_TREE\",\n        },\n        Object {\n          \"children\": Array [],\n          \"message\": \"\",\n          \"name\": \"Child\",\n          \"status\": \"NEW_TREE\",\n        },\n        Object {\n          \"children\": Array [],\n          \"message\": \"\",\n          \"name\": \"Child\",\n          \"status\": \"NEW_TREE\",\n        },\n        Object {\n          \"children\": Array [],\n          \"message\": \"\",\n          \"name\": \"Child\",\n          \"status\": \"NEW_TREE\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 0,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 2,\n}\n`;\n\nexports[`Complex class components folding into functional root component #4: (createElement => JSX) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 12,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [],\n          \"message\": \"\",\n          \"name\": \"Child\",\n          \"status\": \"NEW_TREE\",\n        },\n        Object {\n          \"children\": Array [],\n          \"message\": \"\",\n          \"name\": \"Child\",\n          \"status\": \"NEW_TREE\",\n        },\n        Object {\n          \"children\": Array [],\n          \"message\": \"\",\n          \"name\": \"Child\",\n          \"status\": \"NEW_TREE\",\n        },\n        Object {\n          \"children\": Array [],\n          \"message\": \"\",\n          \"name\": \"Child\",\n          \"status\": \"NEW_TREE\",\n        },\n        Object {\n          \"children\": Array [],\n          \"message\": \"\",\n          \"name\": \"Child\",\n          \"status\": \"NEW_TREE\",\n        },\n        Object {\n          \"children\": Array [],\n          \"message\": \"\",\n          \"name\": \"Child\",\n          \"status\": \"NEW_TREE\",\n        },\n        Object {\n          \"children\": Array [],\n          \"message\": \"\",\n          \"name\": \"Child\",\n          \"status\": \"NEW_TREE\",\n        },\n        Object {\n          \"children\": Array [],\n          \"message\": \"\",\n          \"name\": \"Child\",\n          \"status\": \"NEW_TREE\",\n        },\n        Object {\n          \"children\": Array [],\n          \"message\": \"\",\n          \"name\": \"Child\",\n          \"status\": \"NEW_TREE\",\n        },\n        Object {\n          \"children\": Array [],\n          \"message\": \"\",\n          \"name\": \"Child\",\n          \"status\": \"NEW_TREE\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 0,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 2,\n}\n`;\n\nexports[`Complex class components folding into functional root component #4: (createElement => createElement) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 12,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [],\n          \"message\": \"\",\n          \"name\": \"Child\",\n          \"status\": \"NEW_TREE\",\n        },\n        Object {\n          \"children\": Array [],\n          \"message\": \"\",\n          \"name\": \"Child\",\n          \"status\": \"NEW_TREE\",\n        },\n        Object {\n          \"children\": Array [],\n          \"message\": \"\",\n          \"name\": \"Child\",\n          \"status\": \"NEW_TREE\",\n        },\n        Object {\n          \"children\": Array [],\n          \"message\": \"\",\n          \"name\": \"Child\",\n          \"status\": \"NEW_TREE\",\n        },\n        Object {\n          \"children\": Array [],\n          \"message\": \"\",\n          \"name\": \"Child\",\n          \"status\": \"NEW_TREE\",\n        },\n        Object {\n          \"children\": Array [],\n          \"message\": \"\",\n          \"name\": \"Child\",\n          \"status\": \"NEW_TREE\",\n        },\n        Object {\n          \"children\": Array [],\n          \"message\": \"\",\n          \"name\": \"Child\",\n          \"status\": \"NEW_TREE\",\n        },\n        Object {\n          \"children\": Array [],\n          \"message\": \"\",\n          \"name\": \"Child\",\n          \"status\": \"NEW_TREE\",\n        },\n        Object {\n          \"children\": Array [],\n          \"message\": \"\",\n          \"name\": \"Child\",\n          \"status\": \"NEW_TREE\",\n        },\n        Object {\n          \"children\": Array [],\n          \"message\": \"\",\n          \"name\": \"Child\",\n          \"status\": \"NEW_TREE\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 0,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 2,\n}\n`;\n\nexports[`Complex class components folding into functional root component #5: (JSX => JSX) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 4,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [\n            Object {\n              \"children\": Array [],\n              \"message\": \"\",\n              \"name\": \"Child2\",\n              \"status\": \"INLINED\",\n            },\n          ],\n          \"message\": \"\",\n          \"name\": \"Child\",\n          \"status\": \"NEW_TREE\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 1,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 2,\n}\n`;\n\nexports[`Complex class components folding into functional root component #5: (JSX => createElement) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 4,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [\n            Object {\n              \"children\": Array [],\n              \"message\": \"\",\n              \"name\": \"Child2\",\n              \"status\": \"INLINED\",\n            },\n          ],\n          \"message\": \"\",\n          \"name\": \"Child\",\n          \"status\": \"NEW_TREE\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 1,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 2,\n}\n`;\n\nexports[`Complex class components folding into functional root component #5: (createElement => JSX) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 4,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [\n            Object {\n              \"children\": Array [],\n              \"message\": \"\",\n              \"name\": \"Child2\",\n              \"status\": \"INLINED\",\n            },\n          ],\n          \"message\": \"\",\n          \"name\": \"Child\",\n          \"status\": \"NEW_TREE\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 1,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 2,\n}\n`;\n\nexports[`Complex class components folding into functional root component #5: (createElement => createElement) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 4,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [\n            Object {\n              \"children\": Array [],\n              \"message\": \"\",\n              \"name\": \"Child2\",\n              \"status\": \"INLINED\",\n            },\n          ],\n          \"message\": \"\",\n          \"name\": \"Child\",\n          \"status\": \"NEW_TREE\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 1,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 2,\n}\n`;\n\nexports[`Complex class components folding into functional root component: (JSX => JSX) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 3,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [],\n          \"message\": \"\",\n          \"name\": \"Child\",\n          \"status\": \"NEW_TREE\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 0,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 2,\n}\n`;\n\nexports[`Complex class components folding into functional root component: (JSX => createElement) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 3,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [],\n          \"message\": \"\",\n          \"name\": \"Child\",\n          \"status\": \"NEW_TREE\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 0,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 2,\n}\n`;\n\nexports[`Complex class components folding into functional root component: (createElement => JSX) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 3,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [],\n          \"message\": \"\",\n          \"name\": \"Child\",\n          \"status\": \"NEW_TREE\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 0,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 2,\n}\n`;\n\nexports[`Complex class components folding into functional root component: (createElement => createElement) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 3,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [],\n          \"message\": \"\",\n          \"name\": \"Child\",\n          \"status\": \"NEW_TREE\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 0,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 2,\n}\n`;\n\nexports[`Inheritance chaining: (JSX => JSX) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 3,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [],\n          \"message\": \"\",\n          \"name\": \"Child\",\n          \"status\": \"NEW_TREE\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 0,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 2,\n}\n`;\n\nexports[`Inheritance chaining: (JSX => createElement) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 3,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [],\n          \"message\": \"\",\n          \"name\": \"Child\",\n          \"status\": \"NEW_TREE\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 0,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 2,\n}\n`;\n\nexports[`Inheritance chaining: (createElement => JSX) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 3,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [],\n          \"message\": \"\",\n          \"name\": \"Child\",\n          \"status\": \"NEW_TREE\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 0,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 2,\n}\n`;\n\nexports[`Inheritance chaining: (createElement => createElement) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 3,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [],\n          \"message\": \"\",\n          \"name\": \"Child\",\n          \"status\": \"NEW_TREE\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 0,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 2,\n}\n`;\n\nexports[`Simple classes #2: (JSX => JSX) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 1,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 0,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`Simple classes #2: (JSX => createElement) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 1,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 0,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`Simple classes #2: (createElement => JSX) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 1,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 0,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`Simple classes #2: (createElement => createElement) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 1,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 0,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`Simple classes #3: (JSX => JSX) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 3,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [],\n          \"message\": \"\",\n          \"name\": \"Child\",\n          \"status\": \"NEW_TREE\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 0,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 2,\n}\n`;\n\nexports[`Simple classes #3: (JSX => createElement) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 3,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [],\n          \"message\": \"\",\n          \"name\": \"Child\",\n          \"status\": \"NEW_TREE\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 0,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 2,\n}\n`;\n\nexports[`Simple classes #3: (createElement => JSX) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 3,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [],\n          \"message\": \"\",\n          \"name\": \"Child\",\n          \"status\": \"NEW_TREE\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 0,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 2,\n}\n`;\n\nexports[`Simple classes #3: (createElement => createElement) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 3,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [],\n          \"message\": \"\",\n          \"name\": \"Child\",\n          \"status\": \"NEW_TREE\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 0,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 2,\n}\n`;\n\nexports[`Simple classes with Array.from 2: (JSX => JSX) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 2,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [],\n          \"message\": \"\",\n          \"name\": \"A\",\n          \"status\": \"INLINED\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 1,\n  \"optimizedNestedClosures\": 1,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`Simple classes with Array.from 2: (JSX => createElement) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 2,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [],\n          \"message\": \"\",\n          \"name\": \"A\",\n          \"status\": \"INLINED\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 1,\n  \"optimizedNestedClosures\": 1,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`Simple classes with Array.from 2: (createElement => JSX) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 2,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [],\n          \"message\": \"\",\n          \"name\": \"A\",\n          \"status\": \"INLINED\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 1,\n  \"optimizedNestedClosures\": 1,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`Simple classes with Array.from 2: (createElement => createElement) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 2,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [],\n          \"message\": \"\",\n          \"name\": \"A\",\n          \"status\": \"INLINED\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 1,\n  \"optimizedNestedClosures\": 1,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`Simple classes with Array.from: (JSX => JSX) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 2,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [],\n          \"message\": \"\",\n          \"name\": \"A\",\n          \"status\": \"INLINED\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 1,\n  \"optimizedNestedClosures\": 1,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`Simple classes with Array.from: (JSX => createElement) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 2,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [],\n          \"message\": \"\",\n          \"name\": \"A\",\n          \"status\": \"INLINED\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 1,\n  \"optimizedNestedClosures\": 1,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`Simple classes with Array.from: (createElement => JSX) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 2,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [],\n          \"message\": \"\",\n          \"name\": \"A\",\n          \"status\": \"INLINED\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 1,\n  \"optimizedNestedClosures\": 1,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`Simple classes with Array.from: (createElement => createElement) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 2,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [],\n          \"message\": \"\",\n          \"name\": \"A\",\n          \"status\": \"INLINED\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 1,\n  \"optimizedNestedClosures\": 1,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`Simple classes: (JSX => JSX) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 2,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [],\n          \"message\": \"\",\n          \"name\": \"Child\",\n          \"status\": \"INLINED\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 1,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`Simple classes: (JSX => createElement) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 2,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [],\n          \"message\": \"\",\n          \"name\": \"Child\",\n          \"status\": \"INLINED\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 1,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`Simple classes: (createElement => JSX) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 2,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [],\n          \"message\": \"\",\n          \"name\": \"Child\",\n          \"status\": \"INLINED\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 1,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`Simple classes: (createElement => createElement) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 2,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [],\n          \"message\": \"\",\n          \"name\": \"Child\",\n          \"status\": \"INLINED\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 1,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`Simple: (JSX => JSX) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 1,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [],\n      \"message\": \"\",\n      \"name\": \"MyComponent\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 0,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`Simple: (JSX => createElement) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 1,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [],\n      \"message\": \"\",\n      \"name\": \"MyComponent\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 0,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`Simple: (createElement => JSX) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 1,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [],\n      \"message\": \"\",\n      \"name\": \"MyComponent\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 0,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`Simple: (createElement => createElement) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 1,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [],\n      \"message\": \"\",\n      \"name\": \"MyComponent\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 0,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n"
  },
  {
    "path": "test/react/__snapshots__/FBMocks-test.js.snap",
    "content": "// Jest Snapshot v1, https://goo.gl/fbAQLP\n\nexports[`Function bind: (JSX => JSX) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 2,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [],\n          \"message\": \"\",\n          \"name\": \"Middle\",\n          \"status\": \"INLINED\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 1,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`Function bind: (JSX => createElement) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 2,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [],\n          \"message\": \"\",\n          \"name\": \"Middle\",\n          \"status\": \"INLINED\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 1,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`Function bind: (createElement => JSX) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 2,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [],\n          \"message\": \"\",\n          \"name\": \"Middle\",\n          \"status\": \"INLINED\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 1,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`Function bind: (createElement => createElement) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 2,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [],\n          \"message\": \"\",\n          \"name\": \"Middle\",\n          \"status\": \"INLINED\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 1,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`Hacker News app: (JSX => JSX) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 7,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [\n            Object {\n              \"children\": Array [\n                Object {\n                  \"children\": Array [],\n                  \"message\": \"\",\n                  \"name\": \"HeaderBar\",\n                  \"status\": \"INLINED\",\n                },\n                Object {\n                  \"children\": Array [\n                    Object {\n                      \"children\": Array [\n                        Object {\n                          \"children\": Array [],\n                          \"message\": \"\",\n                          \"name\": \"React.Fragment\",\n                          \"status\": \"NORMAL\",\n                        },\n                      ],\n                      \"message\": \"\",\n                      \"name\": \"Story\",\n                      \"status\": \"INLINED\",\n                    },\n                  ],\n                  \"message\": \"\",\n                  \"name\": \"StoryList\",\n                  \"status\": \"INLINED\",\n                },\n              ],\n              \"message\": \"\",\n              \"name\": \"React.Fragment\",\n              \"status\": \"NORMAL\",\n            },\n          ],\n          \"message\": \"\",\n          \"name\": \"AppBody\",\n          \"status\": \"INLINED\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 4,\n  \"optimizedNestedClosures\": 1,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`Hacker News app: (JSX => createElement) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 7,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [\n            Object {\n              \"children\": Array [\n                Object {\n                  \"children\": Array [],\n                  \"message\": \"\",\n                  \"name\": \"HeaderBar\",\n                  \"status\": \"INLINED\",\n                },\n                Object {\n                  \"children\": Array [\n                    Object {\n                      \"children\": Array [\n                        Object {\n                          \"children\": Array [],\n                          \"message\": \"\",\n                          \"name\": \"React.Fragment\",\n                          \"status\": \"NORMAL\",\n                        },\n                      ],\n                      \"message\": \"\",\n                      \"name\": \"Story\",\n                      \"status\": \"INLINED\",\n                    },\n                  ],\n                  \"message\": \"\",\n                  \"name\": \"StoryList\",\n                  \"status\": \"INLINED\",\n                },\n              ],\n              \"message\": \"\",\n              \"name\": \"React.Fragment\",\n              \"status\": \"NORMAL\",\n            },\n          ],\n          \"message\": \"\",\n          \"name\": \"AppBody\",\n          \"status\": \"INLINED\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 4,\n  \"optimizedNestedClosures\": 1,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`Hacker News app: (createElement => JSX) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 7,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [\n            Object {\n              \"children\": Array [\n                Object {\n                  \"children\": Array [],\n                  \"message\": \"\",\n                  \"name\": \"HeaderBar\",\n                  \"status\": \"INLINED\",\n                },\n                Object {\n                  \"children\": Array [\n                    Object {\n                      \"children\": Array [\n                        Object {\n                          \"children\": Array [],\n                          \"message\": \"\",\n                          \"name\": \"React.Fragment\",\n                          \"status\": \"NORMAL\",\n                        },\n                      ],\n                      \"message\": \"\",\n                      \"name\": \"Story\",\n                      \"status\": \"INLINED\",\n                    },\n                  ],\n                  \"message\": \"\",\n                  \"name\": \"StoryList\",\n                  \"status\": \"INLINED\",\n                },\n              ],\n              \"message\": \"\",\n              \"name\": \"React.Fragment\",\n              \"status\": \"NORMAL\",\n            },\n          ],\n          \"message\": \"\",\n          \"name\": \"AppBody\",\n          \"status\": \"INLINED\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 4,\n  \"optimizedNestedClosures\": 1,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`Hacker News app: (createElement => createElement) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 7,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [\n            Object {\n              \"children\": Array [\n                Object {\n                  \"children\": Array [],\n                  \"message\": \"\",\n                  \"name\": \"HeaderBar\",\n                  \"status\": \"INLINED\",\n                },\n                Object {\n                  \"children\": Array [\n                    Object {\n                      \"children\": Array [\n                        Object {\n                          \"children\": Array [],\n                          \"message\": \"\",\n                          \"name\": \"React.Fragment\",\n                          \"status\": \"NORMAL\",\n                        },\n                      ],\n                      \"message\": \"\",\n                      \"name\": \"Story\",\n                      \"status\": \"INLINED\",\n                    },\n                  ],\n                  \"message\": \"\",\n                  \"name\": \"StoryList\",\n                  \"status\": \"INLINED\",\n                },\n              ],\n              \"message\": \"\",\n              \"name\": \"React.Fragment\",\n              \"status\": \"NORMAL\",\n            },\n          ],\n          \"message\": \"\",\n          \"name\": \"AppBody\",\n          \"status\": \"INLINED\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 4,\n  \"optimizedNestedClosures\": 1,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`PE Functional Components benchmark: (JSX => JSX) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 498,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [\n            Object {\n              \"children\": Array [\n                Object {\n                  \"children\": Array [\n                    Object {\n                      \"children\": Array [\n                        Object {\n                          \"children\": Array [\n                            Object {\n                              \"children\": Array [\n                                Object {\n                                  \"children\": Array [\n                                    Object {\n                                      \"children\": Array [\n                                        Object {\n                                          \"children\": Array [\n                                            Object {\n                                              \"children\": Array [\n                                                Object {\n                                                  \"children\": Array [\n                                                    Object {\n                                                      \"children\": Array [\n                                                        Object {\n                                                          \"children\": Array [\n                                                            Object {\n                                                              \"children\": Array [\n                                                                Object {\n                                                                  \"children\": Array [\n                                                                    Object {\n                                                                      \"children\": Array [],\n                                                                      \"message\": \"\",\n                                                                      \"name\": \"ReactImage0\",\n                                                                      \"status\": \"INLINED\",\n                                                                    },\n                                                                  ],\n                                                                  \"message\": \"\",\n                                                                  \"name\": \"AbstractLink1\",\n                                                                  \"status\": \"INLINED\",\n                                                                },\n                                                              ],\n                                                              \"message\": \"\",\n                                                              \"name\": \"Link2\",\n                                                              \"status\": \"INLINED\",\n                                                            },\n                                                          ],\n                                                          \"message\": \"\",\n                                                          \"name\": \"AbstractButton3\",\n                                                          \"status\": \"INLINED\",\n                                                        },\n                                                      ],\n                                                      \"message\": \"\",\n                                                      \"name\": \"XUIButton4\",\n                                                      \"status\": \"INLINED\",\n                                                    },\n                                                  ],\n                                                  \"message\": \"\",\n                                                  \"name\": \"AbstractPopoverButton5\",\n                                                  \"status\": \"INLINED\",\n                                                },\n                                              ],\n                                              \"message\": \"\",\n                                              \"name\": \"ReactXUIPopoverButton6\",\n                                              \"status\": \"INLINED\",\n                                            },\n                                          ],\n                                          \"message\": \"\",\n                                          \"name\": \"BIGAdAccountSelector7\",\n                                          \"status\": \"INLINED\",\n                                        },\n                                      ],\n                                      \"message\": \"\",\n                                      \"name\": \"FluxContainer_AdsPEBIGAdAccountSelectorContainer_8\",\n                                      \"status\": \"INLINED\",\n                                    },\n                                  ],\n                                  \"message\": \"\",\n                                  \"name\": \"ErrorBoundary9\",\n                                  \"status\": \"INLINED\",\n                                },\n                              ],\n                              \"message\": \"\",\n                              \"name\": \"AdsErrorBoundary10\",\n                              \"status\": \"INLINED\",\n                            },\n                            Object {\n                              \"children\": Array [\n                                Object {\n                                  \"children\": Array [\n                                    Object {\n                                      \"children\": Array [\n                                        Object {\n                                          \"children\": Array [],\n                                          \"message\": \"\",\n                                          \"name\": \"AdsPENavigationBar11\",\n                                          \"status\": \"INLINED\",\n                                        },\n                                      ],\n                                      \"message\": \"\",\n                                      \"name\": \"FluxContainer_AdsPENavigationBarContainer_12\",\n                                      \"status\": \"INLINED\",\n                                    },\n                                  ],\n                                  \"message\": \"\",\n                                  \"name\": \"ErrorBoundary9\",\n                                  \"status\": \"INLINED\",\n                                },\n                              ],\n                              \"message\": \"\",\n                              \"name\": \"AdsErrorBoundary10\",\n                              \"status\": \"INLINED\",\n                            },\n                            Object {\n                              \"children\": Array [\n                                Object {\n                                  \"children\": Array [\n                                    Object {\n                                      \"children\": Array [\n                                        Object {\n                                          \"children\": Array [\n                                            Object {\n                                              \"children\": Array [\n                                                Object {\n                                                  \"children\": Array [\n                                                    Object {\n                                                      \"children\": Array [],\n                                                      \"message\": \"\",\n                                                      \"name\": \"ReactImage0\",\n                                                      \"status\": \"INLINED\",\n                                                    },\n                                                  ],\n                                                  \"message\": \"\",\n                                                  \"name\": \"AdsPEDraftSyncStatus13\",\n                                                  \"status\": \"INLINED\",\n                                                },\n                                              ],\n                                              \"message\": \"\",\n                                              \"name\": \"FluxContainer_AdsPEDraftSyncStatusContainer_14\",\n                                              \"status\": \"INLINED\",\n                                            },\n                                            Object {\n                                              \"children\": Array [\n                                                Object {\n                                                  \"children\": Array [],\n                                                  \"message\": \"\",\n                                                  \"name\": \"AdsPEDraftErrorsStatus15\",\n                                                  \"status\": \"INLINED\",\n                                                },\n                                              ],\n                                              \"message\": \"\",\n                                              \"name\": \"FluxContainer_viewFn_16\",\n                                              \"status\": \"INLINED\",\n                                            },\n                                            Object {\n                                              \"children\": Array [\n                                                Object {\n                                                  \"children\": Array [],\n                                                  \"message\": \"\",\n                                                  \"name\": \"AbstractButton3\",\n                                                  \"status\": \"INLINED\",\n                                                },\n                                              ],\n                                              \"message\": \"\",\n                                              \"name\": \"XUIButton4\",\n                                              \"status\": \"INLINED\",\n                                            },\n                                            Object {\n                                              \"children\": Array [\n                                                Object {\n                                                  \"children\": Array [\n                                                    Object {\n                                                      \"children\": Array [],\n                                                      \"message\": \"\",\n                                                      \"name\": \"ReactImage0\",\n                                                      \"status\": \"INLINED\",\n                                                    },\n                                                  ],\n                                                  \"message\": \"\",\n                                                  \"name\": \"AbstractButton3\",\n                                                  \"status\": \"INLINED\",\n                                                },\n                                              ],\n                                              \"message\": \"\",\n                                              \"name\": \"XUIButton4\",\n                                              \"status\": \"INLINED\",\n                                            },\n                                          ],\n                                          \"message\": \"\",\n                                          \"name\": \"AdsPEPublishButton17\",\n                                          \"status\": \"INLINED\",\n                                        },\n                                      ],\n                                      \"message\": \"\",\n                                      \"name\": \"FluxContainer_AdsPEPublishButtonContainer_18\",\n                                      \"status\": \"INLINED\",\n                                    },\n                                  ],\n                                  \"message\": \"\",\n                                  \"name\": \"ErrorBoundary9\",\n                                  \"status\": \"INLINED\",\n                                },\n                              ],\n                              \"message\": \"\",\n                              \"name\": \"AdsErrorBoundary10\",\n                              \"status\": \"INLINED\",\n                            },\n                            Object {\n                              \"children\": Array [\n                                Object {\n                                  \"children\": Array [\n                                    Object {\n                                      \"children\": Array [\n                                        Object {\n                                          \"children\": Array [\n                                            Object {\n                                              \"children\": Array [],\n                                              \"message\": \"\",\n                                              \"name\": \"ReactImage0\",\n                                              \"status\": \"INLINED\",\n                                            },\n                                          ],\n                                          \"message\": \"\",\n                                          \"name\": \"InlineBlock19\",\n                                          \"status\": \"INLINED\",\n                                        },\n                                      ],\n                                      \"message\": \"\",\n                                      \"name\": \"ReactPopoverMenu20\",\n                                      \"status\": \"INLINED\",\n                                    },\n                                  ],\n                                  \"message\": \"\",\n                                  \"name\": \"ErrorBoundary9\",\n                                  \"status\": \"INLINED\",\n                                },\n                              ],\n                              \"message\": \"\",\n                              \"name\": \"AdsErrorBoundary10\",\n                              \"status\": \"INLINED\",\n                            },\n                          ],\n                          \"message\": \"\",\n                          \"name\": \"LeftRight21\",\n                          \"status\": \"INLINED\",\n                        },\n                      ],\n                      \"message\": \"\",\n                      \"name\": \"AdsUnifiedNavigationLocalNav22\",\n                      \"status\": \"INLINED\",\n                    },\n                    Object {\n                      \"children\": Array [\n                        Object {\n                          \"children\": Array [\n                            Object {\n                              \"children\": Array [\n                                Object {\n                                  \"children\": Array [],\n                                  \"message\": \"\",\n                                  \"name\": \"XUIDialog23\",\n                                  \"status\": \"INLINED\",\n                                },\n                              ],\n                              \"message\": \"\",\n                              \"name\": \"AdsPEResetDialog24\",\n                              \"status\": \"INLINED\",\n                            },\n                          ],\n                          \"message\": \"\",\n                          \"name\": \"ErrorBoundary9\",\n                          \"status\": \"INLINED\",\n                        },\n                      ],\n                      \"message\": \"\",\n                      \"name\": \"AdsErrorBoundary10\",\n                      \"status\": \"INLINED\",\n                    },\n                  ],\n                  \"message\": \"\",\n                  \"name\": \"AdsPETopNav25\",\n                  \"status\": \"INLINED\",\n                },\n              ],\n              \"message\": \"\",\n              \"name\": \"FluxContainer_AdsPETopNavContainer_26\",\n              \"status\": \"INLINED\",\n            },\n            Object {\n              \"children\": Array [\n                Object {\n                  \"children\": Array [\n                    Object {\n                      \"children\": Array [\n                        Object {\n                          \"children\": Array [\n                            Object {\n                              \"children\": Array [\n                                Object {\n                                  \"children\": Array [\n                                    Object {\n                                      \"children\": Array [\n                                        Object {\n                                          \"children\": Array [\n                                            Object {\n                                              \"children\": Array [\n                                                Object {\n                                                  \"children\": Array [\n                                                    Object {\n                                                      \"children\": Array [],\n                                                      \"message\": \"\",\n                                                      \"name\": \"ReactImage0\",\n                                                      \"status\": \"INLINED\",\n                                                    },\n                                                    Object {\n                                                      \"children\": Array [\n                                                        Object {\n                                                          \"children\": Array [\n                                                            Object {\n                                                              \"children\": Array [\n                                                                Object {\n                                                                  \"children\": Array [\n                                                                    Object {\n                                                                      \"children\": Array [],\n                                                                      \"message\": \"\",\n                                                                      \"name\": \"AbstractLink1\",\n                                                                      \"status\": \"INLINED\",\n                                                                    },\n                                                                  ],\n                                                                  \"message\": \"\",\n                                                                  \"name\": \"Link2\",\n                                                                  \"status\": \"INLINED\",\n                                                                },\n                                                              ],\n                                                              \"message\": \"\",\n                                                              \"name\": \"AbstractButton3\",\n                                                              \"status\": \"INLINED\",\n                                                            },\n                                                          ],\n                                                          \"message\": \"\",\n                                                          \"name\": \"XUIAbstractGlyphButton27\",\n                                                          \"status\": \"INLINED\",\n                                                        },\n                                                      ],\n                                                      \"message\": \"\",\n                                                      \"name\": \"XUICloseButton28\",\n                                                      \"status\": \"INLINED\",\n                                                    },\n                                                    Object {\n                                                      \"children\": Array [\n                                                        Object {\n                                                          \"children\": Array [\n                                                            Object {\n                                                              \"children\": Array [],\n                                                              \"message\": \"\",\n                                                              \"name\": \"XUIText29\",\n                                                              \"status\": \"INLINED\",\n                                                            },\n                                                          ],\n                                                          \"message\": \"\",\n                                                          \"name\": \"AbstractLink1\",\n                                                          \"status\": \"INLINED\",\n                                                        },\n                                                      ],\n                                                      \"message\": \"\",\n                                                      \"name\": \"Link2\",\n                                                      \"status\": \"INLINED\",\n                                                    },\n                                                  ],\n                                                  \"message\": \"\",\n                                                  \"name\": \"XUINotice30\",\n                                                  \"status\": \"INLINED\",\n                                                },\n                                              ],\n                                              \"message\": \"\",\n                                              \"name\": \"ReactCSSTransitionGroupChild31\",\n                                              \"status\": \"INLINED\",\n                                            },\n                                          ],\n                                          \"message\": \"\",\n                                          \"name\": \"ReactTransitionGroup32\",\n                                          \"status\": \"INLINED\",\n                                        },\n                                      ],\n                                      \"message\": \"\",\n                                      \"name\": \"ReactCSSTransitionGroup33\",\n                                      \"status\": \"INLINED\",\n                                    },\n                                  ],\n                                  \"message\": \"\",\n                                  \"name\": \"AdsPETopError34\",\n                                  \"status\": \"INLINED\",\n                                },\n                              ],\n                              \"message\": \"\",\n                              \"name\": \"FluxContainer_AdsPETopErrorContainer_35\",\n                              \"status\": \"INLINED\",\n                            },\n                          ],\n                          \"message\": \"\",\n                          \"name\": \"ErrorBoundary9\",\n                          \"status\": \"INLINED\",\n                        },\n                      ],\n                      \"message\": \"\",\n                      \"name\": \"AdsErrorBoundary10\",\n                      \"status\": \"INLINED\",\n                    },\n                    Object {\n                      \"children\": Array [\n                        Object {\n                          \"children\": Array [\n                            Object {\n                              \"children\": Array [],\n                              \"message\": \"\",\n                              \"name\": \"FluxContainer_AdsGuidanceChannel_36\",\n                              \"status\": \"INLINED\",\n                            },\n                          ],\n                          \"message\": \"\",\n                          \"name\": \"ErrorBoundary9\",\n                          \"status\": \"INLINED\",\n                        },\n                      ],\n                      \"message\": \"\",\n                      \"name\": \"AdsErrorBoundary10\",\n                      \"status\": \"INLINED\",\n                    },\n                  ],\n                  \"message\": \"\",\n                  \"name\": \"ResponsiveBlock37\",\n                  \"status\": \"INLINED\",\n                },\n                Object {\n                  \"children\": Array [\n                    Object {\n                      \"children\": Array [\n                        Object {\n                          \"children\": Array [\n                            Object {\n                              \"children\": Array [\n                                Object {\n                                  \"children\": Array [\n                                    Object {\n                                      \"children\": Array [\n                                        Object {\n                                          \"children\": Array [],\n                                          \"message\": \"\",\n                                          \"name\": \"FluxContainer_AdsBulkEditDialogContainer_38\",\n                                          \"status\": \"INLINED\",\n                                        },\n                                      ],\n                                      \"message\": \"\",\n                                      \"name\": \"ErrorBoundary9\",\n                                      \"status\": \"INLINED\",\n                                    },\n                                  ],\n                                  \"message\": \"\",\n                                  \"name\": \"AdsErrorBoundary10\",\n                                  \"status\": \"INLINED\",\n                                },\n                                Object {\n                                  \"children\": Array [\n                                    Object {\n                                      \"children\": Array [\n                                        Object {\n                                          \"children\": Array [\n                                            Object {\n                                              \"children\": Array [\n                                                Object {\n                                                  \"children\": Array [\n                                                    Object {\n                                                      \"children\": Array [],\n                                                      \"message\": \"\",\n                                                      \"name\": \"Column39\",\n                                                      \"status\": \"INLINED\",\n                                                    },\n                                                    Object {\n                                                      \"children\": Array [\n                                                        Object {\n                                                          \"children\": Array [\n                                                            Object {\n                                                              \"children\": Array [\n                                                                Object {\n                                                                  \"children\": Array [\n                                                                    Object {\n                                                                      \"children\": Array [],\n                                                                      \"message\": \"\",\n                                                                      \"name\": \"ReactImage0\",\n                                                                      \"status\": \"INLINED\",\n                                                                    },\n                                                                  ],\n                                                                  \"message\": \"\",\n                                                                  \"name\": \"AbstractButton3\",\n                                                                  \"status\": \"INLINED\",\n                                                                },\n                                                              ],\n                                                              \"message\": \"\",\n                                                              \"name\": \"XUIButton4\",\n                                                              \"status\": \"INLINED\",\n                                                            },\n                                                            Object {\n                                                              \"children\": Array [\n                                                                Object {\n                                                                  \"children\": Array [\n                                                                    Object {\n                                                                      \"children\": Array [\n                                                                        Object {\n                                                                          \"children\": Array [\n                                                                            Object {\n                                                                              \"children\": Array [],\n                                                                              \"message\": \"\",\n                                                                              \"name\": \"ReactImage0\",\n                                                                              \"status\": \"INLINED\",\n                                                                            },\n                                                                          ],\n                                                                          \"message\": \"\",\n                                                                          \"name\": \"AbstractButton3\",\n                                                                          \"status\": \"INLINED\",\n                                                                        },\n                                                                      ],\n                                                                      \"message\": \"\",\n                                                                      \"name\": \"XUIButton4\",\n                                                                      \"status\": \"INLINED\",\n                                                                    },\n                                                                  ],\n                                                                  \"message\": \"\",\n                                                                  \"name\": \"InlineBlock19\",\n                                                                  \"status\": \"INLINED\",\n                                                                },\n                                                              ],\n                                                              \"message\": \"\",\n                                                              \"name\": \"ReactPopoverMenu20\",\n                                                              \"status\": \"INLINED\",\n                                                            },\n                                                          ],\n                                                          \"message\": \"\",\n                                                          \"name\": \"XUIButtonGroup40\",\n                                                          \"status\": \"INLINED\",\n                                                        },\n                                                        Object {\n                                                          \"children\": Array [\n                                                            Object {\n                                                              \"children\": Array [\n                                                                Object {\n                                                                  \"children\": Array [\n                                                                    Object {\n                                                                      \"children\": Array [\n                                                                        Object {\n                                                                          \"children\": Array [\n                                                                            Object {\n                                                                              \"children\": Array [\n                                                                                Object {\n                                                                                  \"children\": Array [],\n                                                                                  \"message\": \"\",\n                                                                                  \"name\": \"ReactImage0\",\n                                                                                  \"status\": \"INLINED\",\n                                                                                },\n                                                                              ],\n                                                                              \"message\": \"\",\n                                                                              \"name\": \"AbstractButton3\",\n                                                                              \"status\": \"INLINED\",\n                                                                            },\n                                                                          ],\n                                                                          \"message\": \"\",\n                                                                          \"name\": \"XUIButton4\",\n                                                                          \"status\": \"INLINED\",\n                                                                        },\n                                                                        Object {\n                                                                          \"children\": Array [\n                                                                            Object {\n                                                                              \"children\": Array [\n                                                                                Object {\n                                                                                  \"children\": Array [\n                                                                                    Object {\n                                                                                      \"children\": Array [\n                                                                                        Object {\n                                                                                          \"children\": Array [],\n                                                                                          \"message\": \"\",\n                                                                                          \"name\": \"ReactImage0\",\n                                                                                          \"status\": \"INLINED\",\n                                                                                        },\n                                                                                      ],\n                                                                                      \"message\": \"\",\n                                                                                      \"name\": \"AbstractButton3\",\n                                                                                      \"status\": \"INLINED\",\n                                                                                    },\n                                                                                  ],\n                                                                                  \"message\": \"\",\n                                                                                  \"name\": \"XUIButton4\",\n                                                                                  \"status\": \"INLINED\",\n                                                                                },\n                                                                              ],\n                                                                              \"message\": \"\",\n                                                                              \"name\": \"InlineBlock19\",\n                                                                              \"status\": \"INLINED\",\n                                                                            },\n                                                                          ],\n                                                                          \"message\": \"\",\n                                                                          \"name\": \"ReactPopoverMenu20\",\n                                                                          \"status\": \"INLINED\",\n                                                                        },\n                                                                      ],\n                                                                      \"message\": \"\",\n                                                                      \"name\": \"XUIButtonGroup40\",\n                                                                      \"status\": \"INLINED\",\n                                                                    },\n                                                                  ],\n                                                                  \"message\": \"\",\n                                                                  \"name\": \"AdsPEEditToolbarButton41\",\n                                                                  \"status\": \"INLINED\",\n                                                                },\n                                                              ],\n                                                              \"message\": \"\",\n                                                              \"name\": \"FluxContainer_AdsPEEditCampaignGroupToolbarButtonContainer_42\",\n                                                              \"status\": \"INLINED\",\n                                                            },\n                                                          ],\n                                                          \"message\": \"\",\n                                                          \"name\": \"FluxContainer_AdsPEEditToolbarButtonContainer_43\",\n                                                          \"status\": \"INLINED\",\n                                                        },\n                                                        Object {\n                                                          \"children\": Array [\n                                                            Object {\n                                                              \"children\": Array [\n                                                                Object {\n                                                                  \"children\": Array [\n                                                                    Object {\n                                                                      \"children\": Array [],\n                                                                      \"message\": \"\",\n                                                                      \"name\": \"ReactImage0\",\n                                                                      \"status\": \"INLINED\",\n                                                                    },\n                                                                  ],\n                                                                  \"message\": \"\",\n                                                                  \"name\": \"AbstractButton3\",\n                                                                  \"status\": \"INLINED\",\n                                                                },\n                                                              ],\n                                                              \"message\": \"\",\n                                                              \"name\": \"XUIButton4\",\n                                                              \"status\": \"INLINED\",\n                                                            },\n                                                            Object {\n                                                              \"children\": Array [\n                                                                Object {\n                                                                  \"children\": Array [\n                                                                    Object {\n                                                                      \"children\": Array [],\n                                                                      \"message\": \"\",\n                                                                      \"name\": \"ReactImage0\",\n                                                                      \"status\": \"INLINED\",\n                                                                    },\n                                                                  ],\n                                                                  \"message\": \"\",\n                                                                  \"name\": \"AbstractButton3\",\n                                                                  \"status\": \"INLINED\",\n                                                                },\n                                                              ],\n                                                              \"message\": \"\",\n                                                              \"name\": \"XUIButton4\",\n                                                              \"status\": \"INLINED\",\n                                                            },\n                                                            Object {\n                                                              \"children\": Array [\n                                                                Object {\n                                                                  \"children\": Array [\n                                                                    Object {\n                                                                      \"children\": Array [],\n                                                                      \"message\": \"\",\n                                                                      \"name\": \"ReactImage0\",\n                                                                      \"status\": \"INLINED\",\n                                                                    },\n                                                                  ],\n                                                                  \"message\": \"\",\n                                                                  \"name\": \"AbstractButton3\",\n                                                                  \"status\": \"INLINED\",\n                                                                },\n                                                              ],\n                                                              \"message\": \"\",\n                                                              \"name\": \"XUIButton4\",\n                                                              \"status\": \"INLINED\",\n                                                            },\n                                                          ],\n                                                          \"message\": \"\",\n                                                          \"name\": \"XUIButtonGroup40\",\n                                                          \"status\": \"INLINED\",\n                                                        },\n                                                        Object {\n                                                          \"children\": Array [\n                                                            Object {\n                                                              \"children\": Array [\n                                                                Object {\n                                                                  \"children\": Array [\n                                                                    Object {\n                                                                      \"children\": Array [\n                                                                        Object {\n                                                                          \"children\": Array [\n                                                                            Object {\n                                                                              \"children\": Array [\n                                                                                Object {\n                                                                                  \"children\": Array [\n                                                                                    Object {\n                                                                                      \"children\": Array [],\n                                                                                      \"message\": \"\",\n                                                                                      \"name\": \"ReactImage0\",\n                                                                                      \"status\": \"INLINED\",\n                                                                                    },\n                                                                                  ],\n                                                                                  \"message\": \"\",\n                                                                                  \"name\": \"AbstractButton3\",\n                                                                                  \"status\": \"INLINED\",\n                                                                                },\n                                                                              ],\n                                                                              \"message\": \"\",\n                                                                              \"name\": \"XUIButton4\",\n                                                                              \"status\": \"INLINED\",\n                                                                            },\n                                                                          ],\n                                                                          \"message\": \"\",\n                                                                          \"name\": \"InlineBlock19\",\n                                                                          \"status\": \"INLINED\",\n                                                                        },\n                                                                      ],\n                                                                      \"message\": \"\",\n                                                                      \"name\": \"ReactPopoverMenu20\",\n                                                                      \"status\": \"INLINED\",\n                                                                    },\n                                                                  ],\n                                                                  \"message\": \"\",\n                                                                  \"name\": \"AdsPEExportImportMenu44\",\n                                                                  \"status\": \"INLINED\",\n                                                                },\n                                                                Object {\n                                                                  \"children\": Array [],\n                                                                  \"message\": \"\",\n                                                                  \"name\": \"FluxContainer_AdsPECustomizeExportContainer_45\",\n                                                                  \"status\": \"INLINED\",\n                                                                },\n                                                                Object {\n                                                                  \"children\": Array [\n                                                                    Object {\n                                                                      \"children\": Array [],\n                                                                      \"message\": \"\",\n                                                                      \"name\": \"AdsPEExportAsTextDialog46\",\n                                                                      \"status\": \"INLINED\",\n                                                                    },\n                                                                  ],\n                                                                  \"message\": \"\",\n                                                                  \"name\": \"FluxContainer_AdsPEExportAsTextDialogContainer_47\",\n                                                                  \"status\": \"INLINED\",\n                                                                },\n                                                              ],\n                                                              \"message\": \"\",\n                                                              \"name\": \"AdsPEExportImportMenuContainer48\",\n                                                              \"status\": \"INLINED\",\n                                                            },\n                                                            Object {\n                                                              \"children\": Array [\n                                                                Object {\n                                                                  \"children\": Array [\n                                                                    Object {\n                                                                      \"children\": Array [],\n                                                                      \"message\": \"\",\n                                                                      \"name\": \"ReactImage0\",\n                                                                      \"status\": \"INLINED\",\n                                                                    },\n                                                                  ],\n                                                                  \"message\": \"\",\n                                                                  \"name\": \"AbstractButton3\",\n                                                                  \"status\": \"INLINED\",\n                                                                },\n                                                              ],\n                                                              \"message\": \"\",\n                                                              \"name\": \"XUIButton4\",\n                                                              \"status\": \"INLINED\",\n                                                            },\n                                                            Object {\n                                                              \"children\": Array [\n                                                                Object {\n                                                                  \"children\": Array [\n                                                                    Object {\n                                                                      \"children\": Array [\n                                                                        Object {\n                                                                          \"children\": Array [\n                                                                            Object {\n                                                                              \"children\": Array [],\n                                                                              \"message\": \"\",\n                                                                              \"name\": \"ReactImage0\",\n                                                                              \"status\": \"INLINED\",\n                                                                            },\n                                                                          ],\n                                                                          \"message\": \"\",\n                                                                          \"name\": \"AbstractButton3\",\n                                                                          \"status\": \"INLINED\",\n                                                                        },\n                                                                      ],\n                                                                      \"message\": \"\",\n                                                                      \"name\": \"XUIButton4\",\n                                                                      \"status\": \"INLINED\",\n                                                                    },\n                                                                    Object {\n                                                                      \"children\": Array [],\n                                                                      \"message\": \"\",\n                                                                      \"name\": \"Constructor49\",\n                                                                      \"status\": \"INLINED\",\n                                                                    },\n                                                                  ],\n                                                                  \"message\": \"\",\n                                                                  \"name\": \"TagSelectorPopover50\",\n                                                                  \"status\": \"INLINED\",\n                                                                },\n                                                              ],\n                                                              \"message\": \"\",\n                                                              \"name\": \"AdsPECampaignGroupTagContainer51\",\n                                                              \"status\": \"INLINED\",\n                                                            },\n                                                          ],\n                                                          \"message\": \"\",\n                                                          \"name\": \"XUIButtonGroup40\",\n                                                          \"status\": \"INLINED\",\n                                                        },\n                                                        Object {\n                                                          \"children\": Array [\n                                                            Object {\n                                                              \"children\": Array [],\n                                                              \"message\": \"\",\n                                                              \"name\": \"AdsRuleToolbarMenu52\",\n                                                              \"status\": \"INLINED\",\n                                                            },\n                                                          ],\n                                                          \"message\": \"\",\n                                                          \"name\": \"FluxContainer_AdsPERuleToolbarMenuContainer_53\",\n                                                          \"status\": \"INLINED\",\n                                                        },\n                                                      ],\n                                                      \"message\": \"\",\n                                                      \"name\": \"FillColumn54\",\n                                                      \"status\": \"INLINED\",\n                                                    },\n                                                  ],\n                                                  \"message\": \"\",\n                                                  \"name\": \"Layout55\",\n                                                  \"status\": \"INLINED\",\n                                                },\n                                              ],\n                                              \"message\": \"\",\n                                              \"name\": \"AdsPEMainPaneToolbar56\",\n                                              \"status\": \"INLINED\",\n                                            },\n                                          ],\n                                          \"message\": \"\",\n                                          \"name\": \"AdsPECampaignGroupToolbarContainer57\",\n                                          \"status\": \"INLINED\",\n                                        },\n                                      ],\n                                      \"message\": \"\",\n                                      \"name\": \"ErrorBoundary9\",\n                                      \"status\": \"INLINED\",\n                                    },\n                                  ],\n                                  \"message\": \"\",\n                                  \"name\": \"AdsErrorBoundary10\",\n                                  \"status\": \"INLINED\",\n                                },\n                                Object {\n                                  \"children\": Array [\n                                    Object {\n                                      \"children\": Array [\n                                        Object {\n                                          \"children\": Array [\n                                            Object {\n                                              \"children\": Array [\n                                                Object {\n                                                  \"children\": Array [\n                                                    Object {\n                                                      \"children\": Array [\n                                                        Object {\n                                                          \"children\": Array [\n                                                            Object {\n                                                              \"children\": Array [\n                                                                Object {\n                                                                  \"children\": Array [\n                                                                    Object {\n                                                                      \"children\": Array [\n                                                                        Object {\n                                                                          \"children\": Array [\n                                                                            Object {\n                                                                              \"children\": Array [],\n                                                                              \"message\": \"\",\n                                                                              \"name\": \"ReactImage0\",\n                                                                              \"status\": \"INLINED\",\n                                                                            },\n                                                                            Object {\n                                                                              \"children\": Array [],\n                                                                              \"message\": \"\",\n                                                                              \"name\": \"ReactImage0\",\n                                                                              \"status\": \"INLINED\",\n                                                                            },\n                                                                          ],\n                                                                          \"message\": \"\",\n                                                                          \"name\": \"AbstractLink1\",\n                                                                          \"status\": \"INLINED\",\n                                                                        },\n                                                                      ],\n                                                                      \"message\": \"\",\n                                                                      \"name\": \"Link2\",\n                                                                      \"status\": \"INLINED\",\n                                                                    },\n                                                                  ],\n                                                                  \"message\": \"\",\n                                                                  \"name\": \"AbstractButton3\",\n                                                                  \"status\": \"INLINED\",\n                                                                },\n                                                              ],\n                                                              \"message\": \"\",\n                                                              \"name\": \"XUIButton4\",\n                                                              \"status\": \"INLINED\",\n                                                            },\n                                                          ],\n                                                          \"message\": \"\",\n                                                          \"name\": \"AbstractPopoverButton5\",\n                                                          \"status\": \"INLINED\",\n                                                        },\n                                                      ],\n                                                      \"message\": \"\",\n                                                      \"name\": \"ReactXUIPopoverButton6\",\n                                                      \"status\": \"INLINED\",\n                                                    },\n                                                    Object {\n                                                      \"children\": Array [\n                                                        Object {\n                                                          \"children\": Array [\n                                                            Object {\n                                                              \"children\": Array [\n                                                                Object {\n                                                                  \"children\": Array [\n                                                                    Object {\n                                                                      \"children\": Array [\n                                                                        Object {\n                                                                          \"children\": Array [\n                                                                            Object {\n                                                                              \"children\": Array [],\n                                                                              \"message\": \"\",\n                                                                              \"name\": \"ReactImage0\",\n                                                                              \"status\": \"INLINED\",\n                                                                            },\n                                                                            Object {\n                                                                              \"children\": Array [],\n                                                                              \"message\": \"\",\n                                                                              \"name\": \"ReactImage0\",\n                                                                              \"status\": \"INLINED\",\n                                                                            },\n                                                                          ],\n                                                                          \"message\": \"\",\n                                                                          \"name\": \"AbstractLink1\",\n                                                                          \"status\": \"INLINED\",\n                                                                        },\n                                                                      ],\n                                                                      \"message\": \"\",\n                                                                      \"name\": \"Link2\",\n                                                                      \"status\": \"INLINED\",\n                                                                    },\n                                                                  ],\n                                                                  \"message\": \"\",\n                                                                  \"name\": \"AbstractButton3\",\n                                                                  \"status\": \"INLINED\",\n                                                                },\n                                                              ],\n                                                              \"message\": \"\",\n                                                              \"name\": \"XUIButton4\",\n                                                              \"status\": \"INLINED\",\n                                                            },\n                                                          ],\n                                                          \"message\": \"\",\n                                                          \"name\": \"AbstractPopoverButton5\",\n                                                          \"status\": \"INLINED\",\n                                                        },\n                                                      ],\n                                                      \"message\": \"\",\n                                                      \"name\": \"ReactXUIPopoverButton6\",\n                                                      \"status\": \"INLINED\",\n                                                    },\n                                                    Object {\n                                                      \"children\": Array [],\n                                                      \"message\": \"\",\n                                                      \"name\": \"Constructor49\",\n                                                      \"status\": \"INLINED\",\n                                                    },\n                                                    Object {\n                                                      \"children\": Array [],\n                                                      \"message\": \"\",\n                                                      \"name\": \"Constructor49\",\n                                                      \"status\": \"INLINED\",\n                                                    },\n                                                  ],\n                                                  \"message\": \"\",\n                                                  \"name\": \"AdsPEFiltersPopover58\",\n                                                  \"status\": \"INLINED\",\n                                                },\n                                                Object {\n                                                  \"children\": Array [\n                                                    Object {\n                                                      \"children\": Array [\n                                                        Object {\n                                                          \"children\": Array [],\n                                                          \"message\": \"\",\n                                                          \"name\": \"AbstractCheckboxInput59\",\n                                                          \"status\": \"INLINED\",\n                                                        },\n                                                      ],\n                                                      \"message\": \"\",\n                                                      \"name\": \"XUICheckboxInput60\",\n                                                      \"status\": \"INLINED\",\n                                                    },\n                                                  ],\n                                                  \"message\": \"\",\n                                                  \"name\": \"InputLabel61\",\n                                                  \"status\": \"INLINED\",\n                                                },\n                                                Object {\n                                                  \"children\": Array [\n                                                    Object {\n                                                      \"children\": Array [\n                                                        Object {\n                                                          \"children\": Array [],\n                                                          \"message\": \"\",\n                                                          \"name\": \"ReactImage0\",\n                                                          \"status\": \"INLINED\",\n                                                        },\n                                                        Object {\n                                                          \"children\": Array [\n                                                            Object {\n                                                              \"children\": Array [\n                                                                Object {\n                                                                  \"children\": Array [],\n                                                                  \"message\": \"\",\n                                                                  \"name\": \"AbstractButton3\",\n                                                                  \"status\": \"INLINED\",\n                                                                },\n                                                              ],\n                                                              \"message\": \"\",\n                                                              \"name\": \"XUIAbstractGlyphButton27\",\n                                                              \"status\": \"INLINED\",\n                                                            },\n                                                          ],\n                                                          \"message\": \"\",\n                                                          \"name\": \"XUICloseButton28\",\n                                                          \"status\": \"INLINED\",\n                                                        },\n                                                        Object {\n                                                          \"children\": Array [\n                                                            Object {\n                                                              \"children\": Array [],\n                                                              \"message\": \"\",\n                                                              \"name\": \"ReactImage0\",\n                                                              \"status\": \"INLINED\",\n                                                            },\n                                                            Object {\n                                                              \"children\": Array [\n                                                                Object {\n                                                                  \"children\": Array [\n                                                                    Object {\n                                                                      \"children\": Array [],\n                                                                      \"message\": \"\",\n                                                                      \"name\": \"ReactImage0\",\n                                                                      \"status\": \"INLINED\",\n                                                                    },\n                                                                  ],\n                                                                  \"message\": \"\",\n                                                                  \"name\": \"AdsPopoverLink62\",\n                                                                  \"status\": \"INLINED\",\n                                                                },\n                                                              ],\n                                                              \"message\": \"\",\n                                                              \"name\": \"AdsHelpLink63\",\n                                                              \"status\": \"INLINED\",\n                                                            },\n                                                            Object {\n                                                              \"children\": Array [\n                                                                Object {\n                                                                  \"children\": Array [],\n                                                                  \"message\": \"\",\n                                                                  \"name\": \"AbstractButton3\",\n                                                                  \"status\": \"INLINED\",\n                                                                },\n                                                              ],\n                                                              \"message\": \"\",\n                                                              \"name\": \"XUIButton4\",\n                                                              \"status\": \"INLINED\",\n                                                            },\n                                                          ],\n                                                          \"message\": \"\",\n                                                          \"name\": \"BUIFilterTokenInput64\",\n                                                          \"status\": \"INLINED\",\n                                                        },\n                                                      ],\n                                                      \"message\": \"\",\n                                                      \"name\": \"BUIFilterToken65\",\n                                                      \"status\": \"INLINED\",\n                                                    },\n                                                    Object {\n                                                      \"children\": Array [\n                                                        Object {\n                                                          \"children\": Array [\n                                                            Object {\n                                                              \"children\": Array [\n                                                                Object {\n                                                                  \"children\": Array [],\n                                                                  \"message\": \"\",\n                                                                  \"name\": \"ReactImage0\",\n                                                                  \"status\": \"INLINED\",\n                                                                },\n                                                              ],\n                                                              \"message\": \"\",\n                                                              \"name\": \"AbstractButton3\",\n                                                              \"status\": \"INLINED\",\n                                                            },\n                                                          ],\n                                                          \"message\": \"\",\n                                                          \"name\": \"XUIButton4\",\n                                                          \"status\": \"INLINED\",\n                                                        },\n                                                      ],\n                                                      \"message\": \"\",\n                                                      \"name\": \"BUIFilterTokenCreateButton66\",\n                                                      \"status\": \"INLINED\",\n                                                    },\n                                                  ],\n                                                  \"message\": \"\",\n                                                  \"name\": \"BUIFilterTokenizer67\",\n                                                  \"status\": \"INLINED\",\n                                                },\n                                                Object {\n                                                  \"children\": Array [\n                                                    Object {\n                                                      \"children\": Array [\n                                                        Object {\n                                                          \"children\": Array [],\n                                                          \"message\": \"\",\n                                                          \"name\": \"XUIAmbientNUX68\",\n                                                          \"status\": \"INLINED\",\n                                                        },\n                                                      ],\n                                                      \"message\": \"\",\n                                                      \"name\": \"XUIAmbientNUX69\",\n                                                      \"status\": \"INLINED\",\n                                                    },\n                                                  ],\n                                                  \"message\": \"\",\n                                                  \"name\": \"AdsPEAmbientNUXMegaphone70\",\n                                                  \"status\": \"INLINED\",\n                                                },\n                                              ],\n                                              \"message\": \"\",\n                                              \"name\": \"AdsPEFilters71\",\n                                              \"status\": \"INLINED\",\n                                            },\n                                          ],\n                                          \"message\": \"\",\n                                          \"name\": \"AdsPEFilterContainer72\",\n                                          \"status\": \"INLINED\",\n                                        },\n                                      ],\n                                      \"message\": \"\",\n                                      \"name\": \"ErrorBoundary9\",\n                                      \"status\": \"INLINED\",\n                                    },\n                                  ],\n                                  \"message\": \"\",\n                                  \"name\": \"AdsErrorBoundary10\",\n                                  \"status\": \"INLINED\",\n                                },\n                                Object {\n                                  \"children\": Array [\n                                    Object {\n                                      \"children\": Array [\n                                        Object {\n                                          \"children\": Array [\n                                            Object {\n                                              \"children\": Array [\n                                                Object {\n                                                  \"children\": Array [],\n                                                  \"message\": \"\",\n                                                  \"name\": \"AdsPETablePager73\",\n                                                  \"status\": \"INLINED\",\n                                                },\n                                              ],\n                                              \"message\": \"\",\n                                              \"name\": \"AdsPECampaignGroupTablePagerContainer74\",\n                                              \"status\": \"INLINED\",\n                                            },\n                                          ],\n                                          \"message\": \"\",\n                                          \"name\": \"AdsPETablePagerContainer75\",\n                                          \"status\": \"INLINED\",\n                                        },\n                                      ],\n                                      \"message\": \"\",\n                                      \"name\": \"ErrorBoundary9\",\n                                      \"status\": \"INLINED\",\n                                    },\n                                  ],\n                                  \"message\": \"\",\n                                  \"name\": \"AdsErrorBoundary10\",\n                                  \"status\": \"INLINED\",\n                                },\n                                Object {\n                                  \"children\": Array [\n                                    Object {\n                                      \"children\": Array [\n                                        Object {\n                                          \"children\": Array [\n                                            Object {\n                                              \"children\": Array [\n                                                Object {\n                                                  \"children\": Array [\n                                                    Object {\n                                                      \"children\": Array [\n                                                        Object {\n                                                          \"children\": Array [\n                                                            Object {\n                                                              \"children\": Array [\n                                                                Object {\n                                                                  \"children\": Array [\n                                                                    Object {\n                                                                      \"children\": Array [\n                                                                        Object {\n                                                                          \"children\": Array [\n                                                                            Object {\n                                                                              \"children\": Array [],\n                                                                              \"message\": \"\",\n                                                                              \"name\": \"ReactImage0\",\n                                                                              \"status\": \"INLINED\",\n                                                                            },\n                                                                          ],\n                                                                          \"message\": \"\",\n                                                                          \"name\": \"AbstractLink1\",\n                                                                          \"status\": \"INLINED\",\n                                                                        },\n                                                                      ],\n                                                                      \"message\": \"\",\n                                                                      \"name\": \"Link2\",\n                                                                      \"status\": \"INLINED\",\n                                                                    },\n                                                                  ],\n                                                                  \"message\": \"\",\n                                                                  \"name\": \"AbstractButton3\",\n                                                                  \"status\": \"INLINED\",\n                                                                },\n                                                              ],\n                                                              \"message\": \"\",\n                                                              \"name\": \"ReactXUIError76\",\n                                                              \"status\": \"INLINED\",\n                                                            },\n                                                          ],\n                                                          \"message\": \"\",\n                                                          \"name\": \"BUIPopoverButton77\",\n                                                          \"status\": \"INLINED\",\n                                                        },\n                                                        Object {\n                                                          \"children\": Array [],\n                                                          \"message\": \"\",\n                                                          \"name\": \"Constructor49\",\n                                                          \"status\": \"INLINED\",\n                                                        },\n                                                      ],\n                                                      \"message\": \"\",\n                                                      \"name\": \"BUIDateRangePicker78\",\n                                                      \"status\": \"INLINED\",\n                                                    },\n                                                  ],\n                                                  \"message\": \"\",\n                                                  \"name\": \"AdsPEStatsRangePicker79\",\n                                                  \"status\": \"INLINED\",\n                                                },\n                                                Object {\n                                                  \"children\": Array [\n                                                    Object {\n                                                      \"children\": Array [\n                                                        Object {\n                                                          \"children\": Array [],\n                                                          \"message\": \"\",\n                                                          \"name\": \"ReactImage0\",\n                                                          \"status\": \"INLINED\",\n                                                        },\n                                                      ],\n                                                      \"message\": \"\",\n                                                      \"name\": \"AbstractButton3\",\n                                                      \"status\": \"INLINED\",\n                                                    },\n                                                  ],\n                                                  \"message\": \"\",\n                                                  \"name\": \"XUIButton4\",\n                                                  \"status\": \"INLINED\",\n                                                },\n                                                Object {\n                                                  \"children\": Array [\n                                                    Object {\n                                                      \"children\": Array [],\n                                                      \"message\": \"\",\n                                                      \"name\": \"XUIAmbientNUX68\",\n                                                      \"status\": \"INLINED\",\n                                                    },\n                                                  ],\n                                                  \"message\": \"\",\n                                                  \"name\": \"XUIAmbientNUX69\",\n                                                  \"status\": \"INLINED\",\n                                                },\n                                              ],\n                                              \"message\": \"\",\n                                              \"name\": \"AdsPEStatRange80\",\n                                              \"status\": \"INLINED\",\n                                            },\n                                          ],\n                                          \"message\": \"\",\n                                          \"name\": \"AdsPEStatRangeContainer81\",\n                                          \"status\": \"INLINED\",\n                                        },\n                                      ],\n                                      \"message\": \"\",\n                                      \"name\": \"ErrorBoundary9\",\n                                      \"status\": \"INLINED\",\n                                    },\n                                  ],\n                                  \"message\": \"\",\n                                  \"name\": \"AdsErrorBoundary10\",\n                                  \"status\": \"INLINED\",\n                                },\n                                Object {\n                                  \"children\": Array [\n                                    Object {\n                                      \"children\": Array [\n                                        Object {\n                                          \"children\": Array [\n                                            Object {\n                                              \"children\": Array [\n                                                Object {\n                                                  \"children\": Array [\n                                                    Object {\n                                                      \"children\": Array [\n                                                        Object {\n                                                          \"children\": Array [],\n                                                          \"message\": \"\",\n                                                          \"name\": \"ReactImage0\",\n                                                          \"status\": \"INLINED\",\n                                                        },\n                                                      ],\n                                                      \"message\": \"\",\n                                                      \"name\": \"AdsPESideTrayTabButton82\",\n                                                      \"status\": \"INLINED\",\n                                                    },\n                                                  ],\n                                                  \"message\": \"\",\n                                                  \"name\": \"AdsPEEditorTrayTabButton83\",\n                                                  \"status\": \"INLINED\",\n                                                },\n                                                Object {\n                                                  \"children\": Array [\n                                                    Object {\n                                                      \"children\": Array [\n                                                        Object {\n                                                          \"children\": Array [],\n                                                          \"message\": \"\",\n                                                          \"name\": \"ReactImage0\",\n                                                          \"status\": \"INLINED\",\n                                                        },\n                                                      ],\n                                                      \"message\": \"\",\n                                                      \"name\": \"AdsPESideTrayTabButton82\",\n                                                      \"status\": \"INLINED\",\n                                                    },\n                                                    Object {\n                                                      \"children\": Array [\n                                                        Object {\n                                                          \"children\": Array [],\n                                                          \"message\": \"\",\n                                                          \"name\": \"XUIAmbientNUX68\",\n                                                          \"status\": \"INLINED\",\n                                                        },\n                                                      ],\n                                                      \"message\": \"\",\n                                                      \"name\": \"XUIAmbientNUX69\",\n                                                      \"status\": \"INLINED\",\n                                                    },\n                                                  ],\n                                                  \"message\": \"\",\n                                                  \"name\": \"AdsPEInsightsTrayTabButton84\",\n                                                  \"status\": \"INLINED\",\n                                                },\n                                                Object {\n                                                  \"children\": Array [\n                                                    Object {\n                                                      \"children\": Array [],\n                                                      \"message\": \"\",\n                                                      \"name\": \"AdsPESideTrayTabButton82\",\n                                                      \"status\": \"INLINED\",\n                                                    },\n                                                  ],\n                                                  \"message\": \"\",\n                                                  \"name\": \"AdsPENekoDebuggerTrayTabButton85\",\n                                                  \"status\": \"INLINED\",\n                                                },\n                                                Object {\n                                                  \"children\": Array [\n                                                    Object {\n                                                      \"children\": Array [\n                                                        Object {\n                                                          \"children\": Array [\n                                                            Object {\n                                                              \"children\": Array [\n                                                                Object {\n                                                                  \"children\": Array [\n                                                                    Object {\n                                                                      \"children\": Array [\n                                                                        Object {\n                                                                          \"children\": Array [],\n                                                                          \"message\": \"\",\n                                                                          \"name\": \"XUIText29\",\n                                                                          \"status\": \"INLINED\",\n                                                                        },\n                                                                        Object {\n                                                                          \"children\": Array [],\n                                                                          \"message\": \"\",\n                                                                          \"name\": \"XUIText29\",\n                                                                          \"status\": \"INLINED\",\n                                                                        },\n                                                                        Object {\n                                                                          \"children\": Array [\n                                                                            Object {\n                                                                              \"children\": Array [\n                                                                                Object {\n                                                                                  \"children\": Array [\n                                                                                    Object {\n                                                                                      \"children\": Array [],\n                                                                                      \"message\": \"\",\n                                                                                      \"name\": \"AbstractLink1\",\n                                                                                      \"status\": \"INLINED\",\n                                                                                    },\n                                                                                  ],\n                                                                                  \"message\": \"\",\n                                                                                  \"name\": \"Link2\",\n                                                                                  \"status\": \"INLINED\",\n                                                                                },\n                                                                                Object {\n                                                                                  \"children\": Array [\n                                                                                    Object {\n                                                                                      \"children\": Array [],\n                                                                                      \"message\": \"\",\n                                                                                      \"name\": \"AbstractLink1\",\n                                                                                      \"status\": \"INLINED\",\n                                                                                    },\n                                                                                  ],\n                                                                                  \"message\": \"\",\n                                                                                  \"name\": \"Link2\",\n                                                                                  \"status\": \"INLINED\",\n                                                                                },\n                                                                              ],\n                                                                              \"message\": \"\",\n                                                                              \"name\": \"AdsPEEditorChildLink86\",\n                                                                              \"status\": \"INLINED\",\n                                                                            },\n                                                                          ],\n                                                                          \"message\": \"\",\n                                                                          \"name\": \"AdsPEEditorChildLinkContainer87\",\n                                                                          \"status\": \"INLINED\",\n                                                                        },\n                                                                      ],\n                                                                      \"message\": \"\",\n                                                                      \"name\": \"AdsPEHeaderSection88\",\n                                                                      \"status\": \"INLINED\",\n                                                                    },\n                                                                  ],\n                                                                  \"message\": \"\",\n                                                                  \"name\": \"AdsPECampaignGroupHeaderSectionContainer89\",\n                                                                  \"status\": \"INLINED\",\n                                                                },\n                                                                Object {\n                                                                  \"children\": Array [\n                                                                    Object {\n                                                                      \"children\": Array [],\n                                                                      \"message\": \"\",\n                                                                      \"name\": \"AdsEditorLoadingErrors90\",\n                                                                      \"status\": \"INLINED\",\n                                                                    },\n                                                                    Object {\n                                                                      \"children\": Array [\n                                                                        Object {\n                                                                          \"children\": Array [\n                                                                            Object {\n                                                                              \"children\": Array [\n                                                                                Object {\n                                                                                  \"children\": Array [\n                                                                                    Object {\n                                                                                      \"children\": Array [\n                                                                                        Object {\n                                                                                          \"children\": Array [\n                                                                                            Object {\n                                                                                              \"children\": Array [\n                                                                                                Object {\n                                                                                                  \"children\": Array [\n                                                                                                    Object {\n                                                                                                      \"children\": Array [\n                                                                                                        Object {\n                                                                                                          \"children\": Array [\n                                                                                                            Object {\n                                                                                                              \"children\": Array [\n                                                                                                                Object {\n                                                                                                                  \"children\": Array [],\n                                                                                                                  \"message\": \"\",\n                                                                                                                  \"name\": \"ReactXUIError76\",\n                                                                                                                  \"status\": \"INLINED\",\n                                                                                                                },\n                                                                                                              ],\n                                                                                                              \"message\": \"\",\n                                                                                                              \"name\": \"AdsTextInput91\",\n                                                                                                              \"status\": \"INLINED\",\n                                                                                                            },\n                                                                                                          ],\n                                                                                                          \"message\": \"\",\n                                                                                                          \"name\": \"BUIFormElement92\",\n                                                                                                          \"status\": \"INLINED\",\n                                                                                                        },\n                                                                                                      ],\n                                                                                                      \"message\": \"\",\n                                                                                                      \"name\": \"BUIForm93\",\n                                                                                                      \"status\": \"INLINED\",\n                                                                                                    },\n                                                                                                  ],\n                                                                                                  \"message\": \"\",\n                                                                                                  \"name\": \"XUICard94\",\n                                                                                                  \"status\": \"INLINED\",\n                                                                                                },\n                                                                                              ],\n                                                                                              \"message\": \"\",\n                                                                                              \"name\": \"ReactXUIError76\",\n                                                                                              \"status\": \"INLINED\",\n                                                                                            },\n                                                                                          ],\n                                                                                          \"message\": \"\",\n                                                                                          \"name\": \"AdsCard95\",\n                                                                                          \"status\": \"INLINED\",\n                                                                                        },\n                                                                                      ],\n                                                                                      \"message\": \"\",\n                                                                                      \"name\": \"AdsEditorNameSection96\",\n                                                                                      \"status\": \"INLINED\",\n                                                                                    },\n                                                                                  ],\n                                                                                  \"message\": \"\",\n                                                                                  \"name\": \"AdsCampaignGroupNameSectionContainer97\",\n                                                                                  \"status\": \"INLINED\",\n                                                                                },\n                                                                              ],\n                                                                              \"message\": \"\",\n                                                                              \"name\": \"_render98\",\n                                                                              \"status\": \"INLINED\",\n                                                                            },\n                                                                          ],\n                                                                          \"message\": \"\",\n                                                                          \"name\": \"AdsPluginWrapper99\",\n                                                                          \"status\": \"INLINED\",\n                                                                        },\n                                                                        Object {\n                                                                          \"children\": Array [\n                                                                            Object {\n                                                                              \"children\": Array [\n                                                                                Object {\n                                                                                  \"children\": Array [\n                                                                                    Object {\n                                                                                      \"children\": Array [\n                                                                                        Object {\n                                                                                          \"children\": Array [\n                                                                                            Object {\n                                                                                              \"children\": Array [\n                                                                                                Object {\n                                                                                                  \"children\": Array [\n                                                                                                    Object {\n                                                                                                      \"children\": Array [\n                                                                                                        Object {\n                                                                                                          \"children\": Array [\n                                                                                                            Object {\n                                                                                                              \"children\": Array [\n                                                                                                                Object {\n                                                                                                                  \"children\": Array [],\n                                                                                                                  \"message\": \"\",\n                                                                                                                  \"name\": \"XUICardHeaderTitle100\",\n                                                                                                                  \"status\": \"INLINED\",\n                                                                                                                },\n                                                                                                              ],\n                                                                                                              \"message\": \"\",\n                                                                                                              \"name\": \"XUICardSection101\",\n                                                                                                              \"status\": \"INLINED\",\n                                                                                                            },\n                                                                                                          ],\n                                                                                                          \"message\": \"\",\n                                                                                                          \"name\": \"XUICardHeader102\",\n                                                                                                          \"status\": \"INLINED\",\n                                                                                                        },\n                                                                                                      ],\n                                                                                                      \"message\": \"\",\n                                                                                                      \"name\": \"AdsCardHeader103\",\n                                                                                                      \"status\": \"INLINED\",\n                                                                                                    },\n                                                                                                    Object {\n                                                                                                      \"children\": Array [\n                                                                                                        Object {\n                                                                                                          \"children\": Array [\n                                                                                                            Object {\n                                                                                                              \"children\": Array [\n                                                                                                                Object {\n                                                                                                                  \"children\": Array [\n                                                                                                                    Object {\n                                                                                                                      \"children\": Array [],\n                                                                                                                      \"message\": \"\",\n                                                                                                                      \"name\": \"AdsLabeledField104\",\n                                                                                                                      \"status\": \"INLINED\",\n                                                                                                                    },\n                                                                                                                  ],\n                                                                                                                  \"message\": \"\",\n                                                                                                                  \"name\": \"LeftRight21\",\n                                                                                                                  \"status\": \"INLINED\",\n                                                                                                                },\n                                                                                                              ],\n                                                                                                              \"message\": \"\",\n                                                                                                              \"name\": \"FlexibleBlock105\",\n                                                                                                              \"status\": \"INLINED\",\n                                                                                                            },\n                                                                                                            Object {\n                                                                                                              \"children\": Array [\n                                                                                                                Object {\n                                                                                                                  \"children\": Array [\n                                                                                                                    Object {\n                                                                                                                      \"children\": Array [],\n                                                                                                                      \"message\": \"\",\n                                                                                                                      \"name\": \"AdsLabeledField104\",\n                                                                                                                      \"status\": \"INLINED\",\n                                                                                                                    },\n                                                                                                                  ],\n                                                                                                                  \"message\": \"\",\n                                                                                                                  \"name\": \"LeftRight21\",\n                                                                                                                  \"status\": \"INLINED\",\n                                                                                                                },\n                                                                                                              ],\n                                                                                                              \"message\": \"\",\n                                                                                                              \"name\": \"FlexibleBlock105\",\n                                                                                                              \"status\": \"INLINED\",\n                                                                                                            },\n                                                                                                            Object {\n                                                                                                              \"children\": Array [\n                                                                                                                Object {\n                                                                                                                  \"children\": Array [\n                                                                                                                    Object {\n                                                                                                                      \"children\": Array [\n                                                                                                                        Object {\n                                                                                                                          \"children\": Array [\n                                                                                                                            Object {\n                                                                                                                              \"children\": Array [\n                                                                                                                                Object {\n                                                                                                                                  \"children\": Array [],\n                                                                                                                                  \"message\": \"\",\n                                                                                                                                  \"name\": \"ReactImage0\",\n                                                                                                                                  \"status\": \"INLINED\",\n                                                                                                                                },\n                                                                                                                              ],\n                                                                                                                              \"message\": \"\",\n                                                                                                                              \"name\": \"AdsPopoverLink62\",\n                                                                                                                              \"status\": \"INLINED\",\n                                                                                                                            },\n                                                                                                                          ],\n                                                                                                                          \"message\": \"\",\n                                                                                                                          \"name\": \"AdsHelpLink63\",\n                                                                                                                          \"status\": \"INLINED\",\n                                                                                                                        },\n                                                                                                                      ],\n                                                                                                                      \"message\": \"\",\n                                                                                                                      \"name\": \"AdsLabeledField104\",\n                                                                                                                      \"status\": \"INLINED\",\n                                                                                                                    },\n                                                                                                                    Object {\n                                                                                                                      \"children\": Array [\n                                                                                                                        Object {\n                                                                                                                          \"children\": Array [\n                                                                                                                            Object {\n                                                                                                                              \"children\": Array [\n                                                                                                                                Object {\n                                                                                                                                  \"children\": Array [],\n                                                                                                                                  \"message\": \"\",\n                                                                                                                                  \"name\": \"AbstractLink1\",\n                                                                                                                                  \"status\": \"INLINED\",\n                                                                                                                                },\n                                                                                                                              ],\n                                                                                                                              \"message\": \"\",\n                                                                                                                              \"name\": \"Link2\",\n                                                                                                                              \"status\": \"INLINED\",\n                                                                                                                            },\n                                                                                                                          ],\n                                                                                                                          \"message\": \"\",\n                                                                                                                          \"name\": \"AdsBulkCampaignSpendCapField106\",\n                                                                                                                          \"status\": \"INLINED\",\n                                                                                                                        },\n                                                                                                                      ],\n                                                                                                                      \"message\": \"\",\n                                                                                                                      \"name\": \"FluxContainer_AdsCampaignGroupSpendCapContainer_107\",\n                                                                                                                      \"status\": \"INLINED\",\n                                                                                                                    },\n                                                                                                                  ],\n                                                                                                                  \"message\": \"\",\n                                                                                                                  \"name\": \"LeftRight21\",\n                                                                                                                  \"status\": \"INLINED\",\n                                                                                                                },\n                                                                                                              ],\n                                                                                                              \"message\": \"\",\n                                                                                                              \"name\": \"FlexibleBlock105\",\n                                                                                                              \"status\": \"INLINED\",\n                                                                                                            },\n                                                                                                          ],\n                                                                                                          \"message\": \"\",\n                                                                                                          \"name\": \"XUICardSection101\",\n                                                                                                          \"status\": \"INLINED\",\n                                                                                                        },\n                                                                                                      ],\n                                                                                                      \"message\": \"\",\n                                                                                                      \"name\": \"AdsCardSection108\",\n                                                                                                      \"status\": \"INLINED\",\n                                                                                                    },\n                                                                                                  ],\n                                                                                                  \"message\": \"\",\n                                                                                                  \"name\": \"XUICard94\",\n                                                                                                  \"status\": \"INLINED\",\n                                                                                                },\n                                                                                              ],\n                                                                                              \"message\": \"\",\n                                                                                              \"name\": \"ReactXUIError76\",\n                                                                                              \"status\": \"INLINED\",\n                                                                                            },\n                                                                                          ],\n                                                                                          \"message\": \"\",\n                                                                                          \"name\": \"AdsCard95\",\n                                                                                          \"status\": \"INLINED\",\n                                                                                        },\n                                                                                      ],\n                                                                                      \"message\": \"\",\n                                                                                      \"name\": \"AdsEditorCampaignGroupDetailsSection109\",\n                                                                                      \"status\": \"INLINED\",\n                                                                                    },\n                                                                                  ],\n                                                                                  \"message\": \"\",\n                                                                                  \"name\": \"AdsEditorCampaignGroupDetailsSectionContainer110\",\n                                                                                  \"status\": \"INLINED\",\n                                                                                },\n                                                                              ],\n                                                                              \"message\": \"\",\n                                                                              \"name\": \"_render111\",\n                                                                              \"status\": \"INLINED\",\n                                                                            },\n                                                                          ],\n                                                                          \"message\": \"\",\n                                                                          \"name\": \"AdsPluginWrapper99\",\n                                                                          \"status\": \"INLINED\",\n                                                                        },\n                                                                        Object {\n                                                                          \"children\": Array [\n                                                                            Object {\n                                                                              \"children\": Array [\n                                                                                Object {\n                                                                                  \"children\": Array [],\n                                                                                  \"message\": \"\",\n                                                                                  \"name\": \"FluxContainer_AdsEditorToplineDetailsSectionContainer_112\",\n                                                                                  \"status\": \"INLINED\",\n                                                                                },\n                                                                              ],\n                                                                              \"message\": \"\",\n                                                                              \"name\": \"_render113\",\n                                                                              \"status\": \"INLINED\",\n                                                                            },\n                                                                          ],\n                                                                          \"message\": \"\",\n                                                                          \"name\": \"AdsPluginWrapper99\",\n                                                                          \"status\": \"INLINED\",\n                                                                        },\n                                                                        Object {\n                                                                          \"children\": Array [],\n                                                                          \"message\": \"\",\n                                                                          \"name\": \"AdsStickyArea114\",\n                                                                          \"status\": \"INLINED\",\n                                                                        },\n                                                                      ],\n                                                                      \"message\": \"\",\n                                                                      \"name\": \"FluxContainer_AdsEditorColumnContainer_115\",\n                                                                      \"status\": \"INLINED\",\n                                                                    },\n                                                                    Object {\n                                                                      \"children\": Array [\n                                                                        Object {\n                                                                          \"children\": Array [\n                                                                            Object {\n                                                                              \"children\": Array [\n                                                                                Object {\n                                                                                  \"children\": Array [\n                                                                                    Object {\n                                                                                      \"children\": Array [\n                                                                                        Object {\n                                                                                          \"children\": Array [\n                                                                                            Object {\n                                                                                              \"children\": Array [\n                                                                                                Object {\n                                                                                                  \"children\": Array [\n                                                                                                    Object {\n                                                                                                      \"children\": Array [\n                                                                                                        Object {\n                                                                                                          \"children\": Array [\n                                                                                                            Object {\n                                                                                                              \"children\": Array [\n                                                                                                                Object {\n                                                                                                                  \"children\": Array [\n                                                                                                                    Object {\n                                                                                                                      \"children\": Array [\n                                                                                                                        Object {\n                                                                                                                          \"children\": Array [\n                                                                                                                            Object {\n                                                                                                                              \"children\": Array [\n                                                                                                                                Object {\n                                                                                                                                  \"children\": Array [\n                                                                                                                                    Object {\n                                                                                                                                      \"children\": Array [],\n                                                                                                                                      \"message\": \"\",\n                                                                                                                                      \"name\": \"BUISwitch116\",\n                                                                                                                                      \"status\": \"INLINED\",\n                                                                                                                                    },\n                                                                                                                                  ],\n                                                                                                                                  \"message\": \"\",\n                                                                                                                                  \"name\": \"AdsStatusSwitchInternal117\",\n                                                                                                                                  \"status\": \"INLINED\",\n                                                                                                                                },\n                                                                                                                              ],\n                                                                                                                              \"message\": \"\",\n                                                                                                                              \"name\": \"AdsStatusSwitch118\",\n                                                                                                                              \"status\": \"INLINED\",\n                                                                                                                            },\n                                                                                                                          ],\n                                                                                                                          \"message\": \"\",\n                                                                                                                          \"name\": \"FluxContainer_AdsCampaignGroupStatusSwitchContainer_119\",\n                                                                                                                          \"status\": \"INLINED\",\n                                                                                                                        },\n                                                                                                                      ],\n                                                                                                                      \"message\": \"\",\n                                                                                                                      \"name\": \"XUICardHeaderTitle100\",\n                                                                                                                      \"status\": \"INLINED\",\n                                                                                                                    },\n                                                                                                                    Object {\n                                                                                                                      \"children\": Array [\n                                                                                                                        Object {\n                                                                                                                          \"children\": Array [\n                                                                                                                            Object {\n                                                                                                                              \"children\": Array [\n                                                                                                                                Object {\n                                                                                                                                  \"children\": Array [\n                                                                                                                                    Object {\n                                                                                                                                      \"children\": Array [\n                                                                                                                                        Object {\n                                                                                                                                          \"children\": Array [\n                                                                                                                                            Object {\n                                                                                                                                              \"children\": Array [\n                                                                                                                                                Object {\n                                                                                                                                                  \"children\": Array [\n                                                                                                                                                    Object {\n                                                                                                                                                      \"children\": Array [\n                                                                                                                                                        Object {\n                                                                                                                                                          \"children\": Array [\n                                                                                                                                                            Object {\n                                                                                                                                                              \"children\": Array [],\n                                                                                                                                                              \"message\": \"\",\n                                                                                                                                                              \"name\": \"ReactImage0\",\n                                                                                                                                                              \"status\": \"INLINED\",\n                                                                                                                                                            },\n                                                                                                                                                          ],\n                                                                                                                                                          \"message\": \"\",\n                                                                                                                                                          \"name\": \"AbstractLink1\",\n                                                                                                                                                          \"status\": \"INLINED\",\n                                                                                                                                                        },\n                                                                                                                                                      ],\n                                                                                                                                                      \"message\": \"\",\n                                                                                                                                                      \"name\": \"Link2\",\n                                                                                                                                                      \"status\": \"INLINED\",\n                                                                                                                                                    },\n                                                                                                                                                  ],\n                                                                                                                                                  \"message\": \"\",\n                                                                                                                                                  \"name\": \"AbstractButton3\",\n                                                                                                                                                  \"status\": \"INLINED\",\n                                                                                                                                                },\n                                                                                                                                              ],\n                                                                                                                                              \"message\": \"\",\n                                                                                                                                              \"name\": \"XUIButton4\",\n                                                                                                                                              \"status\": \"INLINED\",\n                                                                                                                                            },\n                                                                                                                                          ],\n                                                                                                                                          \"message\": \"\",\n                                                                                                                                          \"name\": \"AbstractPopoverButton5\",\n                                                                                                                                          \"status\": \"INLINED\",\n                                                                                                                                        },\n                                                                                                                                      ],\n                                                                                                                                      \"message\": \"\",\n                                                                                                                                      \"name\": \"ReactXUIPopoverButton6\",\n                                                                                                                                      \"status\": \"INLINED\",\n                                                                                                                                    },\n                                                                                                                                  ],\n                                                                                                                                  \"message\": \"\",\n                                                                                                                                  \"name\": \"InlineBlock19\",\n                                                                                                                                  \"status\": \"INLINED\",\n                                                                                                                                },\n                                                                                                                              ],\n                                                                                                                              \"message\": \"\",\n                                                                                                                              \"name\": \"ReactPopoverMenu20\",\n                                                                                                                              \"status\": \"INLINED\",\n                                                                                                                            },\n                                                                                                                          ],\n                                                                                                                          \"message\": \"\",\n                                                                                                                          \"name\": \"AdsLinksMenu120\",\n                                                                                                                          \"status\": \"INLINED\",\n                                                                                                                        },\n                                                                                                                      ],\n                                                                                                                      \"message\": \"\",\n                                                                                                                      \"name\": \"FluxContainer_AdsPluginizedLinksMenuContainer_121\",\n                                                                                                                      \"status\": \"INLINED\",\n                                                                                                                    },\n                                                                                                                  ],\n                                                                                                                  \"message\": \"\",\n                                                                                                                  \"name\": \"LeftRight21\",\n                                                                                                                  \"status\": \"INLINED\",\n                                                                                                                },\n                                                                                                              ],\n                                                                                                              \"message\": \"\",\n                                                                                                              \"name\": \"AdsCardLeftRightHeader122\",\n                                                                                                              \"status\": \"INLINED\",\n                                                                                                            },\n                                                                                                          ],\n                                                                                                          \"message\": \"\",\n                                                                                                          \"name\": \"XUICard94\",\n                                                                                                          \"status\": \"INLINED\",\n                                                                                                        },\n                                                                                                      ],\n                                                                                                      \"message\": \"\",\n                                                                                                      \"name\": \"ReactXUIError76\",\n                                                                                                      \"status\": \"INLINED\",\n                                                                                                    },\n                                                                                                  ],\n                                                                                                  \"message\": \"\",\n                                                                                                  \"name\": \"AdsCard95\",\n                                                                                                  \"status\": \"INLINED\",\n                                                                                                },\n                                                                                              ],\n                                                                                              \"message\": \"\",\n                                                                                              \"name\": \"AdsPEIDSection123\",\n                                                                                              \"status\": \"INLINED\",\n                                                                                            },\n                                                                                          ],\n                                                                                          \"message\": \"\",\n                                                                                          \"name\": \"FluxContainer_AdsPECampaignGroupIDSectionContainer_124\",\n                                                                                          \"status\": \"INLINED\",\n                                                                                        },\n                                                                                      ],\n                                                                                      \"message\": \"\",\n                                                                                      \"name\": \"DeferredComponent125\",\n                                                                                      \"status\": \"INLINED\",\n                                                                                    },\n                                                                                  ],\n                                                                                  \"message\": \"\",\n                                                                                  \"name\": \"BootloadedComponent126\",\n                                                                                  \"status\": \"INLINED\",\n                                                                                },\n                                                                              ],\n                                                                              \"message\": \"\",\n                                                                              \"name\": \"_render127\",\n                                                                              \"status\": \"INLINED\",\n                                                                            },\n                                                                          ],\n                                                                          \"message\": \"\",\n                                                                          \"name\": \"AdsPluginWrapper99\",\n                                                                          \"status\": \"INLINED\",\n                                                                        },\n                                                                        Object {\n                                                                          \"children\": Array [\n                                                                            Object {\n                                                                              \"children\": Array [\n                                                                                Object {\n                                                                                  \"children\": Array [\n                                                                                    Object {\n                                                                                      \"children\": Array [\n                                                                                        Object {\n                                                                                          \"children\": Array [],\n                                                                                          \"message\": \"\",\n                                                                                          \"name\": \"AdsEditorErrorsCard128\",\n                                                                                          \"status\": \"INLINED\",\n                                                                                        },\n                                                                                      ],\n                                                                                      \"message\": \"\",\n                                                                                      \"name\": \"FluxContainer_FunctionalContainer_129\",\n                                                                                      \"status\": \"INLINED\",\n                                                                                    },\n                                                                                  ],\n                                                                                  \"message\": \"\",\n                                                                                  \"name\": \"_render130\",\n                                                                                  \"status\": \"INLINED\",\n                                                                                },\n                                                                              ],\n                                                                              \"message\": \"\",\n                                                                              \"name\": \"AdsPluginWrapper99\",\n                                                                              \"status\": \"INLINED\",\n                                                                            },\n                                                                          ],\n                                                                          \"message\": \"\",\n                                                                          \"name\": \"AdsStickyArea114\",\n                                                                          \"status\": \"INLINED\",\n                                                                        },\n                                                                      ],\n                                                                      \"message\": \"\",\n                                                                      \"name\": \"FluxContainer_AdsEditorColumnContainer_115\",\n                                                                      \"status\": \"INLINED\",\n                                                                    },\n                                                                  ],\n                                                                  \"message\": \"\",\n                                                                  \"name\": \"AdsEditorMultiColumnLayout131\",\n                                                                  \"status\": \"INLINED\",\n                                                                },\n                                                              ],\n                                                              \"message\": \"\",\n                                                              \"name\": \"AdsPECampaignGroupEditor132\",\n                                                              \"status\": \"INLINED\",\n                                                            },\n                                                          ],\n                                                          \"message\": \"\",\n                                                          \"name\": \"AdsPECampaignGroupEditorContainer133\",\n                                                          \"status\": \"INLINED\",\n                                                        },\n                                                      ],\n                                                      \"message\": \"\",\n                                                      \"name\": \"AdsPESideTrayTabContent134\",\n                                                      \"status\": \"INLINED\",\n                                                    },\n                                                  ],\n                                                  \"message\": \"\",\n                                                  \"name\": \"AdsPEEditorTrayTabContentContainer135\",\n                                                  \"status\": \"INLINED\",\n                                                },\n                                              ],\n                                              \"message\": \"\",\n                                              \"name\": \"AdsPEMultiTabDrawer136\",\n                                              \"status\": \"INLINED\",\n                                            },\n                                          ],\n                                          \"message\": \"\",\n                                          \"name\": \"FluxContainer_AdsPEMultiTabDrawerContainer_137\",\n                                          \"status\": \"INLINED\",\n                                        },\n                                      ],\n                                      \"message\": \"\",\n                                      \"name\": \"ErrorBoundary9\",\n                                      \"status\": \"INLINED\",\n                                    },\n                                  ],\n                                  \"message\": \"\",\n                                  \"name\": \"AdsErrorBoundary10\",\n                                  \"status\": \"INLINED\",\n                                },\n                                Object {\n                                  \"children\": Array [\n                                    Object {\n                                      \"children\": Array [\n                                        Object {\n                                          \"children\": Array [\n                                            Object {\n                                              \"children\": Array [\n                                                Object {\n                                                  \"children\": Array [\n                                                    Object {\n                                                      \"children\": Array [],\n                                                      \"message\": \"\",\n                                                      \"name\": \"AbstractButton3\",\n                                                      \"status\": \"INLINED\",\n                                                    },\n                                                  ],\n                                                  \"message\": \"\",\n                                                  \"name\": \"XUIButton4\",\n                                                  \"status\": \"INLINED\",\n                                                },\n                                                Object {\n                                                  \"children\": Array [\n                                                    Object {\n                                                      \"children\": Array [],\n                                                      \"message\": \"\",\n                                                      \"name\": \"AbstractButton3\",\n                                                      \"status\": \"INLINED\",\n                                                    },\n                                                  ],\n                                                  \"message\": \"\",\n                                                  \"name\": \"XUIButton4\",\n                                                  \"status\": \"INLINED\",\n                                                },\n                                                Object {\n                                                  \"children\": Array [\n                                                    Object {\n                                                      \"children\": Array [],\n                                                      \"message\": \"\",\n                                                      \"name\": \"AbstractButton3\",\n                                                      \"status\": \"INLINED\",\n                                                    },\n                                                  ],\n                                                  \"message\": \"\",\n                                                  \"name\": \"XUIButton4\",\n                                                  \"status\": \"INLINED\",\n                                                },\n                                              ],\n                                              \"message\": \"\",\n                                              \"name\": \"AdsPESimpleOrganizer138\",\n                                              \"status\": \"INLINED\",\n                                            },\n                                          ],\n                                          \"message\": \"\",\n                                          \"name\": \"AdsPEOrganizerContainer139\",\n                                          \"status\": \"INLINED\",\n                                        },\n                                      ],\n                                      \"message\": \"\",\n                                      \"name\": \"ErrorBoundary9\",\n                                      \"status\": \"INLINED\",\n                                    },\n                                  ],\n                                  \"message\": \"\",\n                                  \"name\": \"AdsErrorBoundary10\",\n                                  \"status\": \"INLINED\",\n                                },\n                                Object {\n                                  \"children\": Array [\n                                    Object {\n                                      \"children\": Array [\n                                        Object {\n                                          \"children\": Array [\n                                            Object {\n                                              \"children\": Array [\n                                                Object {\n                                                  \"children\": Array [\n                                                    Object {\n                                                      \"children\": Array [\n                                                        Object {\n                                                          \"children\": Array [\n                                                            Object {\n                                                              \"children\": Array [\n                                                                Object {\n                                                                  \"children\": Array [\n                                                                    Object {\n                                                                      \"children\": Array [\n                                                                        Object {\n                                                                          \"children\": Array [],\n                                                                          \"message\": \"\",\n                                                                          \"name\": \"FixedDataTableColumnResizeHandle140\",\n                                                                          \"status\": \"INLINED\",\n                                                                        },\n                                                                        Object {\n                                                                          \"children\": Array [\n                                                                            Object {\n                                                                              \"children\": Array [\n                                                                                Object {\n                                                                                  \"children\": Array [\n                                                                                    Object {\n                                                                                      \"children\": Array [\n                                                                                        Object {\n                                                                                          \"children\": Array [\n                                                                                            Object {\n                                                                                              \"children\": Array [\n                                                                                                Object {\n                                                                                                  \"children\": Array [\n                                                                                                    Object {\n                                                                                                      \"children\": Array [],\n                                                                                                      \"message\": \"\",\n                                                                                                      \"name\": \"ReactImage0\",\n                                                                                                      \"status\": \"INLINED\",\n                                                                                                    },\n                                                                                                  ],\n                                                                                                  \"message\": \"\",\n                                                                                                  \"name\": \"AdsPETableHeader141\",\n                                                                                                  \"status\": \"INLINED\",\n                                                                                                },\n                                                                                              ],\n                                                                                              \"message\": \"\",\n                                                                                              \"name\": \"TransitionCell142\",\n                                                                                              \"status\": \"INLINED\",\n                                                                                            },\n                                                                                          ],\n                                                                                          \"message\": \"\",\n                                                                                          \"name\": \"FixedDataTableCell143\",\n                                                                                          \"status\": \"INLINED\",\n                                                                                        },\n                                                                                      ],\n                                                                                      \"message\": \"\",\n                                                                                      \"name\": \"FixedDataTableCellGroupImpl144\",\n                                                                                      \"status\": \"INLINED\",\n                                                                                    },\n                                                                                  ],\n                                                                                  \"message\": \"\",\n                                                                                  \"name\": \"FixedDataTableCellGroup145\",\n                                                                                  \"status\": \"INLINED\",\n                                                                                },\n                                                                                Object {\n                                                                                  \"children\": Array [\n                                                                                    Object {\n                                                                                      \"children\": Array [\n                                                                                        Object {\n                                                                                          \"children\": Array [\n                                                                                            Object {\n                                                                                              \"children\": Array [\n                                                                                                Object {\n                                                                                                  \"children\": Array [],\n                                                                                                  \"message\": \"\",\n                                                                                                  \"name\": \"AdsPETableHeader141\",\n                                                                                                  \"status\": \"INLINED\",\n                                                                                                },\n                                                                                              ],\n                                                                                              \"message\": \"\",\n                                                                                              \"name\": \"TransitionCell142\",\n                                                                                              \"status\": \"INLINED\",\n                                                                                            },\n                                                                                          ],\n                                                                                          \"message\": \"\",\n                                                                                          \"name\": \"FixedDataTableCell143\",\n                                                                                          \"status\": \"INLINED\",\n                                                                                        },\n                                                                                        Object {\n                                                                                          \"children\": Array [\n                                                                                            Object {\n                                                                                              \"children\": Array [\n                                                                                                Object {\n                                                                                                  \"children\": Array [],\n                                                                                                  \"message\": \"\",\n                                                                                                  \"name\": \"AdsPETableHeader141\",\n                                                                                                  \"status\": \"INLINED\",\n                                                                                                },\n                                                                                              ],\n                                                                                              \"message\": \"\",\n                                                                                              \"name\": \"TransitionCell142\",\n                                                                                              \"status\": \"INLINED\",\n                                                                                            },\n                                                                                          ],\n                                                                                          \"message\": \"\",\n                                                                                          \"name\": \"FixedDataTableCell143\",\n                                                                                          \"status\": \"INLINED\",\n                                                                                        },\n                                                                                        Object {\n                                                                                          \"children\": Array [\n                                                                                            Object {\n                                                                                              \"children\": Array [\n                                                                                                Object {\n                                                                                                  \"children\": Array [],\n                                                                                                  \"message\": \"\",\n                                                                                                  \"name\": \"AdsPETableHeader141\",\n                                                                                                  \"status\": \"INLINED\",\n                                                                                                },\n                                                                                              ],\n                                                                                              \"message\": \"\",\n                                                                                              \"name\": \"TransitionCell142\",\n                                                                                              \"status\": \"INLINED\",\n                                                                                            },\n                                                                                          ],\n                                                                                          \"message\": \"\",\n                                                                                          \"name\": \"FixedDataTableCell143\",\n                                                                                          \"status\": \"INLINED\",\n                                                                                        },\n                                                                                        Object {\n                                                                                          \"children\": Array [\n                                                                                            Object {\n                                                                                              \"children\": Array [\n                                                                                                Object {\n                                                                                                  \"children\": Array [],\n                                                                                                  \"message\": \"\",\n                                                                                                  \"name\": \"AdsPETableHeader141\",\n                                                                                                  \"status\": \"INLINED\",\n                                                                                                },\n                                                                                              ],\n                                                                                              \"message\": \"\",\n                                                                                              \"name\": \"TransitionCell142\",\n                                                                                              \"status\": \"INLINED\",\n                                                                                            },\n                                                                                          ],\n                                                                                          \"message\": \"\",\n                                                                                          \"name\": \"FixedDataTableCell143\",\n                                                                                          \"status\": \"INLINED\",\n                                                                                        },\n                                                                                      ],\n                                                                                      \"message\": \"\",\n                                                                                      \"name\": \"FixedDataTableCellGroupImpl144\",\n                                                                                      \"status\": \"INLINED\",\n                                                                                    },\n                                                                                  ],\n                                                                                  \"message\": \"\",\n                                                                                  \"name\": \"FixedDataTableCellGroup145\",\n                                                                                  \"status\": \"INLINED\",\n                                                                                },\n                                                                              ],\n                                                                              \"message\": \"\",\n                                                                              \"name\": \"FixedDataTableRowImpl146\",\n                                                                              \"status\": \"INLINED\",\n                                                                            },\n                                                                          ],\n                                                                          \"message\": \"\",\n                                                                          \"name\": \"FixedDataTableRow147\",\n                                                                          \"status\": \"INLINED\",\n                                                                        },\n                                                                        Object {\n                                                                          \"children\": Array [\n                                                                            Object {\n                                                                              \"children\": Array [\n                                                                                Object {\n                                                                                  \"children\": Array [\n                                                                                    Object {\n                                                                                      \"children\": Array [\n                                                                                        Object {\n                                                                                          \"children\": Array [\n                                                                                            Object {\n                                                                                              \"children\": Array [\n                                                                                                Object {\n                                                                                                  \"children\": Array [\n                                                                                                    Object {\n                                                                                                      \"children\": Array [],\n                                                                                                      \"message\": \"\",\n                                                                                                      \"name\": \"AbstractCheckboxInput59\",\n                                                                                                      \"status\": \"INLINED\",\n                                                                                                    },\n                                                                                                  ],\n                                                                                                  \"message\": \"\",\n                                                                                                  \"name\": \"XUICheckboxInput60\",\n                                                                                                  \"status\": \"INLINED\",\n                                                                                                },\n                                                                                              ],\n                                                                                              \"message\": \"\",\n                                                                                              \"name\": \"TransitionCell142\",\n                                                                                              \"status\": \"INLINED\",\n                                                                                            },\n                                                                                          ],\n                                                                                          \"message\": \"\",\n                                                                                          \"name\": \"FixedDataTableCell143\",\n                                                                                          \"status\": \"INLINED\",\n                                                                                        },\n                                                                                        Object {\n                                                                                          \"children\": Array [\n                                                                                            Object {\n                                                                                              \"children\": Array [\n                                                                                                Object {\n                                                                                                  \"children\": Array [\n                                                                                                    Object {\n                                                                                                      \"children\": Array [\n                                                                                                        Object {\n                                                                                                          \"children\": Array [],\n                                                                                                          \"message\": \"\",\n                                                                                                          \"name\": \"AdsPETableHeader141\",\n                                                                                                          \"status\": \"INLINED\",\n                                                                                                        },\n                                                                                                      ],\n                                                                                                      \"message\": \"\",\n                                                                                                      \"name\": \"FixedDataTableAbstractSortableHeader148\",\n                                                                                                      \"status\": \"INLINED\",\n                                                                                                    },\n                                                                                                  ],\n                                                                                                  \"message\": \"\",\n                                                                                                  \"name\": \"FixedDataTableSortableHeader149\",\n                                                                                                  \"status\": \"INLINED\",\n                                                                                                },\n                                                                                              ],\n                                                                                              \"message\": \"\",\n                                                                                              \"name\": \"TransitionCell142\",\n                                                                                              \"status\": \"INLINED\",\n                                                                                            },\n                                                                                          ],\n                                                                                          \"message\": \"\",\n                                                                                          \"name\": \"FixedDataTableCell143\",\n                                                                                          \"status\": \"INLINED\",\n                                                                                        },\n                                                                                        Object {\n                                                                                          \"children\": Array [\n                                                                                            Object {\n                                                                                              \"children\": Array [\n                                                                                                Object {\n                                                                                                  \"children\": Array [\n                                                                                                    Object {\n                                                                                                      \"children\": Array [\n                                                                                                        Object {\n                                                                                                          \"children\": Array [\n                                                                                                            Object {\n                                                                                                              \"children\": Array [],\n                                                                                                              \"message\": \"\",\n                                                                                                              \"name\": \"ReactImage0\",\n                                                                                                              \"status\": \"INLINED\",\n                                                                                                            },\n                                                                                                          ],\n                                                                                                          \"message\": \"\",\n                                                                                                          \"name\": \"AdsPETableHeader141\",\n                                                                                                          \"status\": \"INLINED\",\n                                                                                                        },\n                                                                                                      ],\n                                                                                                      \"message\": \"\",\n                                                                                                      \"name\": \"FixedDataTableAbstractSortableHeader148\",\n                                                                                                      \"status\": \"INLINED\",\n                                                                                                    },\n                                                                                                  ],\n                                                                                                  \"message\": \"\",\n                                                                                                  \"name\": \"FixedDataTableSortableHeader149\",\n                                                                                                  \"status\": \"INLINED\",\n                                                                                                },\n                                                                                              ],\n                                                                                              \"message\": \"\",\n                                                                                              \"name\": \"TransitionCell142\",\n                                                                                              \"status\": \"INLINED\",\n                                                                                            },\n                                                                                          ],\n                                                                                          \"message\": \"\",\n                                                                                          \"name\": \"FixedDataTableCell143\",\n                                                                                          \"status\": \"INLINED\",\n                                                                                        },\n                                                                                        Object {\n                                                                                          \"children\": Array [\n                                                                                            Object {\n                                                                                              \"children\": Array [\n                                                                                                Object {\n                                                                                                  \"children\": Array [\n                                                                                                    Object {\n                                                                                                      \"children\": Array [\n                                                                                                        Object {\n                                                                                                          \"children\": Array [\n                                                                                                            Object {\n                                                                                                              \"children\": Array [],\n                                                                                                              \"message\": \"\",\n                                                                                                              \"name\": \"ReactImage0\",\n                                                                                                              \"status\": \"INLINED\",\n                                                                                                            },\n                                                                                                          ],\n                                                                                                          \"message\": \"\",\n                                                                                                          \"name\": \"AdsPETableHeader141\",\n                                                                                                          \"status\": \"INLINED\",\n                                                                                                        },\n                                                                                                      ],\n                                                                                                      \"message\": \"\",\n                                                                                                      \"name\": \"FixedDataTableAbstractSortableHeader148\",\n                                                                                                      \"status\": \"INLINED\",\n                                                                                                    },\n                                                                                                  ],\n                                                                                                  \"message\": \"\",\n                                                                                                  \"name\": \"FixedDataTableSortableHeader149\",\n                                                                                                  \"status\": \"INLINED\",\n                                                                                                },\n                                                                                              ],\n                                                                                              \"message\": \"\",\n                                                                                              \"name\": \"TransitionCell142\",\n                                                                                              \"status\": \"INLINED\",\n                                                                                            },\n                                                                                          ],\n                                                                                          \"message\": \"\",\n                                                                                          \"name\": \"FixedDataTableCell143\",\n                                                                                          \"status\": \"INLINED\",\n                                                                                        },\n                                                                                        Object {\n                                                                                          \"children\": Array [\n                                                                                            Object {\n                                                                                              \"children\": Array [\n                                                                                                Object {\n                                                                                                  \"children\": Array [\n                                                                                                    Object {\n                                                                                                      \"children\": Array [\n                                                                                                        Object {\n                                                                                                          \"children\": Array [],\n                                                                                                          \"message\": \"\",\n                                                                                                          \"name\": \"AdsPETableHeader141\",\n                                                                                                          \"status\": \"INLINED\",\n                                                                                                        },\n                                                                                                      ],\n                                                                                                      \"message\": \"\",\n                                                                                                      \"name\": \"FixedDataTableAbstractSortableHeader148\",\n                                                                                                      \"status\": \"INLINED\",\n                                                                                                    },\n                                                                                                  ],\n                                                                                                  \"message\": \"\",\n                                                                                                  \"name\": \"FixedDataTableSortableHeader149\",\n                                                                                                  \"status\": \"INLINED\",\n                                                                                                },\n                                                                                              ],\n                                                                                              \"message\": \"\",\n                                                                                              \"name\": \"TransitionCell142\",\n                                                                                              \"status\": \"INLINED\",\n                                                                                            },\n                                                                                          ],\n                                                                                          \"message\": \"\",\n                                                                                          \"name\": \"FixedDataTableCell143\",\n                                                                                          \"status\": \"INLINED\",\n                                                                                        },\n                                                                                        Object {\n                                                                                          \"children\": Array [\n                                                                                            Object {\n                                                                                              \"children\": Array [\n                                                                                                Object {\n                                                                                                  \"children\": Array [\n                                                                                                    Object {\n                                                                                                      \"children\": Array [\n                                                                                                        Object {\n                                                                                                          \"children\": Array [],\n                                                                                                          \"message\": \"\",\n                                                                                                          \"name\": \"AdsPETableHeader141\",\n                                                                                                          \"status\": \"INLINED\",\n                                                                                                        },\n                                                                                                      ],\n                                                                                                      \"message\": \"\",\n                                                                                                      \"name\": \"FixedDataTableAbstractSortableHeader148\",\n                                                                                                      \"status\": \"INLINED\",\n                                                                                                    },\n                                                                                                  ],\n                                                                                                  \"message\": \"\",\n                                                                                                  \"name\": \"FixedDataTableSortableHeader149\",\n                                                                                                  \"status\": \"INLINED\",\n                                                                                                },\n                                                                                              ],\n                                                                                              \"message\": \"\",\n                                                                                              \"name\": \"TransitionCell142\",\n                                                                                              \"status\": \"INLINED\",\n                                                                                            },\n                                                                                          ],\n                                                                                          \"message\": \"\",\n                                                                                          \"name\": \"FixedDataTableCell143\",\n                                                                                          \"status\": \"INLINED\",\n                                                                                        },\n                                                                                      ],\n                                                                                      \"message\": \"\",\n                                                                                      \"name\": \"FixedDataTableCellGroupImpl144\",\n                                                                                      \"status\": \"INLINED\",\n                                                                                    },\n                                                                                  ],\n                                                                                  \"message\": \"\",\n                                                                                  \"name\": \"FixedDataTableCellGroup145\",\n                                                                                  \"status\": \"INLINED\",\n                                                                                },\n                                                                                Object {\n                                                                                  \"children\": Array [\n                                                                                    Object {\n                                                                                      \"children\": Array [\n                                                                                        Object {\n                                                                                          \"children\": Array [\n                                                                                            Object {\n                                                                                              \"children\": Array [\n                                                                                                Object {\n                                                                                                  \"children\": Array [\n                                                                                                    Object {\n                                                                                                      \"children\": Array [\n                                                                                                        Object {\n                                                                                                          \"children\": Array [],\n                                                                                                          \"message\": \"\",\n                                                                                                          \"name\": \"AdsPETableHeader141\",\n                                                                                                          \"status\": \"INLINED\",\n                                                                                                        },\n                                                                                                      ],\n                                                                                                      \"message\": \"\",\n                                                                                                      \"name\": \"FixedDataTableAbstractSortableHeader148\",\n                                                                                                      \"status\": \"INLINED\",\n                                                                                                    },\n                                                                                                  ],\n                                                                                                  \"message\": \"\",\n                                                                                                  \"name\": \"FixedDataTableSortableHeader149\",\n                                                                                                  \"status\": \"INLINED\",\n                                                                                                },\n                                                                                              ],\n                                                                                              \"message\": \"\",\n                                                                                              \"name\": \"TransitionCell142\",\n                                                                                              \"status\": \"INLINED\",\n                                                                                            },\n                                                                                          ],\n                                                                                          \"message\": \"\",\n                                                                                          \"name\": \"FixedDataTableCell143\",\n                                                                                          \"status\": \"INLINED\",\n                                                                                        },\n                                                                                        Object {\n                                                                                          \"children\": Array [\n                                                                                            Object {\n                                                                                              \"children\": Array [\n                                                                                                Object {\n                                                                                                  \"children\": Array [\n                                                                                                    Object {\n                                                                                                      \"children\": Array [\n                                                                                                        Object {\n                                                                                                          \"children\": Array [],\n                                                                                                          \"message\": \"\",\n                                                                                                          \"name\": \"AdsPETableHeader141\",\n                                                                                                          \"status\": \"INLINED\",\n                                                                                                        },\n                                                                                                      ],\n                                                                                                      \"message\": \"\",\n                                                                                                      \"name\": \"FixedDataTableAbstractSortableHeader148\",\n                                                                                                      \"status\": \"INLINED\",\n                                                                                                    },\n                                                                                                  ],\n                                                                                                  \"message\": \"\",\n                                                                                                  \"name\": \"FixedDataTableSortableHeader149\",\n                                                                                                  \"status\": \"INLINED\",\n                                                                                                },\n                                                                                              ],\n                                                                                              \"message\": \"\",\n                                                                                              \"name\": \"TransitionCell142\",\n                                                                                              \"status\": \"INLINED\",\n                                                                                            },\n                                                                                          ],\n                                                                                          \"message\": \"\",\n                                                                                          \"name\": \"FixedDataTableCell143\",\n                                                                                          \"status\": \"INLINED\",\n                                                                                        },\n                                                                                        Object {\n                                                                                          \"children\": Array [\n                                                                                            Object {\n                                                                                              \"children\": Array [\n                                                                                                Object {\n                                                                                                  \"children\": Array [\n                                                                                                    Object {\n                                                                                                      \"children\": Array [\n                                                                                                        Object {\n                                                                                                          \"children\": Array [],\n                                                                                                          \"message\": \"\",\n                                                                                                          \"name\": \"AdsPETableHeader141\",\n                                                                                                          \"status\": \"INLINED\",\n                                                                                                        },\n                                                                                                      ],\n                                                                                                      \"message\": \"\",\n                                                                                                      \"name\": \"FixedDataTableAbstractSortableHeader148\",\n                                                                                                      \"status\": \"INLINED\",\n                                                                                                    },\n                                                                                                  ],\n                                                                                                  \"message\": \"\",\n                                                                                                  \"name\": \"FixedDataTableSortableHeader149\",\n                                                                                                  \"status\": \"INLINED\",\n                                                                                                },\n                                                                                              ],\n                                                                                              \"message\": \"\",\n                                                                                              \"name\": \"TransitionCell142\",\n                                                                                              \"status\": \"INLINED\",\n                                                                                            },\n                                                                                          ],\n                                                                                          \"message\": \"\",\n                                                                                          \"name\": \"FixedDataTableCell143\",\n                                                                                          \"status\": \"INLINED\",\n                                                                                        },\n                                                                                        Object {\n                                                                                          \"children\": Array [\n                                                                                            Object {\n                                                                                              \"children\": Array [\n                                                                                                Object {\n                                                                                                  \"children\": Array [\n                                                                                                    Object {\n                                                                                                      \"children\": Array [\n                                                                                                        Object {\n                                                                                                          \"children\": Array [],\n                                                                                                          \"message\": \"\",\n                                                                                                          \"name\": \"AdsPETableHeader141\",\n                                                                                                          \"status\": \"INLINED\",\n                                                                                                        },\n                                                                                                      ],\n                                                                                                      \"message\": \"\",\n                                                                                                      \"name\": \"FixedDataTableAbstractSortableHeader148\",\n                                                                                                      \"status\": \"INLINED\",\n                                                                                                    },\n                                                                                                  ],\n                                                                                                  \"message\": \"\",\n                                                                                                  \"name\": \"FixedDataTableSortableHeader149\",\n                                                                                                  \"status\": \"INLINED\",\n                                                                                                },\n                                                                                              ],\n                                                                                              \"message\": \"\",\n                                                                                              \"name\": \"TransitionCell142\",\n                                                                                              \"status\": \"INLINED\",\n                                                                                            },\n                                                                                          ],\n                                                                                          \"message\": \"\",\n                                                                                          \"name\": \"FixedDataTableCell143\",\n                                                                                          \"status\": \"INLINED\",\n                                                                                        },\n                                                                                        Object {\n                                                                                          \"children\": Array [\n                                                                                            Object {\n                                                                                              \"children\": Array [\n                                                                                                Object {\n                                                                                                  \"children\": Array [\n                                                                                                    Object {\n                                                                                                      \"children\": Array [\n                                                                                                        Object {\n                                                                                                          \"children\": Array [],\n                                                                                                          \"message\": \"\",\n                                                                                                          \"name\": \"AdsPETableHeader141\",\n                                                                                                          \"status\": \"INLINED\",\n                                                                                                        },\n                                                                                                      ],\n                                                                                                      \"message\": \"\",\n                                                                                                      \"name\": \"FixedDataTableAbstractSortableHeader148\",\n                                                                                                      \"status\": \"INLINED\",\n                                                                                                    },\n                                                                                                  ],\n                                                                                                  \"message\": \"\",\n                                                                                                  \"name\": \"FixedDataTableSortableHeader149\",\n                                                                                                  \"status\": \"INLINED\",\n                                                                                                },\n                                                                                              ],\n                                                                                              \"message\": \"\",\n                                                                                              \"name\": \"TransitionCell142\",\n                                                                                              \"status\": \"INLINED\",\n                                                                                            },\n                                                                                          ],\n                                                                                          \"message\": \"\",\n                                                                                          \"name\": \"FixedDataTableCell143\",\n                                                                                          \"status\": \"INLINED\",\n                                                                                        },\n                                                                                        Object {\n                                                                                          \"children\": Array [\n                                                                                            Object {\n                                                                                              \"children\": Array [\n                                                                                                Object {\n                                                                                                  \"children\": Array [\n                                                                                                    Object {\n                                                                                                      \"children\": Array [\n                                                                                                        Object {\n                                                                                                          \"children\": Array [],\n                                                                                                          \"message\": \"\",\n                                                                                                          \"name\": \"AdsPETableHeader141\",\n                                                                                                          \"status\": \"INLINED\",\n                                                                                                        },\n                                                                                                      ],\n                                                                                                      \"message\": \"\",\n                                                                                                      \"name\": \"FixedDataTableAbstractSortableHeader148\",\n                                                                                                      \"status\": \"INLINED\",\n                                                                                                    },\n                                                                                                  ],\n                                                                                                  \"message\": \"\",\n                                                                                                  \"name\": \"FixedDataTableSortableHeader149\",\n                                                                                                  \"status\": \"INLINED\",\n                                                                                                },\n                                                                                              ],\n                                                                                              \"message\": \"\",\n                                                                                              \"name\": \"TransitionCell142\",\n                                                                                              \"status\": \"INLINED\",\n                                                                                            },\n                                                                                          ],\n                                                                                          \"message\": \"\",\n                                                                                          \"name\": \"FixedDataTableCell143\",\n                                                                                          \"status\": \"INLINED\",\n                                                                                        },\n                                                                                        Object {\n                                                                                          \"children\": Array [\n                                                                                            Object {\n                                                                                              \"children\": Array [\n                                                                                                Object {\n                                                                                                  \"children\": Array [\n                                                                                                    Object {\n                                                                                                      \"children\": Array [\n                                                                                                        Object {\n                                                                                                          \"children\": Array [],\n                                                                                                          \"message\": \"\",\n                                                                                                          \"name\": \"AdsPETableHeader141\",\n                                                                                                          \"status\": \"INLINED\",\n                                                                                                        },\n                                                                                                      ],\n                                                                                                      \"message\": \"\",\n                                                                                                      \"name\": \"FixedDataTableAbstractSortableHeader148\",\n                                                                                                      \"status\": \"INLINED\",\n                                                                                                    },\n                                                                                                  ],\n                                                                                                  \"message\": \"\",\n                                                                                                  \"name\": \"FixedDataTableSortableHeader149\",\n                                                                                                  \"status\": \"INLINED\",\n                                                                                                },\n                                                                                              ],\n                                                                                              \"message\": \"\",\n                                                                                              \"name\": \"TransitionCell142\",\n                                                                                              \"status\": \"INLINED\",\n                                                                                            },\n                                                                                          ],\n                                                                                          \"message\": \"\",\n                                                                                          \"name\": \"FixedDataTableCell143\",\n                                                                                          \"status\": \"INLINED\",\n                                                                                        },\n                                                                                        Object {\n                                                                                          \"children\": Array [\n                                                                                            Object {\n                                                                                              \"children\": Array [\n                                                                                                Object {\n                                                                                                  \"children\": Array [\n                                                                                                    Object {\n                                                                                                      \"children\": Array [\n                                                                                                        Object {\n                                                                                                          \"children\": Array [],\n                                                                                                          \"message\": \"\",\n                                                                                                          \"name\": \"AdsPETableHeader141\",\n                                                                                                          \"status\": \"INLINED\",\n                                                                                                        },\n                                                                                                      ],\n                                                                                                      \"message\": \"\",\n                                                                                                      \"name\": \"FixedDataTableAbstractSortableHeader148\",\n                                                                                                      \"status\": \"INLINED\",\n                                                                                                    },\n                                                                                                  ],\n                                                                                                  \"message\": \"\",\n                                                                                                  \"name\": \"FixedDataTableSortableHeader149\",\n                                                                                                  \"status\": \"INLINED\",\n                                                                                                },\n                                                                                              ],\n                                                                                              \"message\": \"\",\n                                                                                              \"name\": \"TransitionCell142\",\n                                                                                              \"status\": \"INLINED\",\n                                                                                            },\n                                                                                          ],\n                                                                                          \"message\": \"\",\n                                                                                          \"name\": \"FixedDataTableCell143\",\n                                                                                          \"status\": \"INLINED\",\n                                                                                        },\n                                                                                        Object {\n                                                                                          \"children\": Array [\n                                                                                            Object {\n                                                                                              \"children\": Array [\n                                                                                                Object {\n                                                                                                  \"children\": Array [\n                                                                                                    Object {\n                                                                                                      \"children\": Array [\n                                                                                                        Object {\n                                                                                                          \"children\": Array [],\n                                                                                                          \"message\": \"\",\n                                                                                                          \"name\": \"AdsPETableHeader141\",\n                                                                                                          \"status\": \"INLINED\",\n                                                                                                        },\n                                                                                                      ],\n                                                                                                      \"message\": \"\",\n                                                                                                      \"name\": \"FixedDataTableAbstractSortableHeader148\",\n                                                                                                      \"status\": \"INLINED\",\n                                                                                                    },\n                                                                                                  ],\n                                                                                                  \"message\": \"\",\n                                                                                                  \"name\": \"FixedDataTableSortableHeader149\",\n                                                                                                  \"status\": \"INLINED\",\n                                                                                                },\n                                                                                              ],\n                                                                                              \"message\": \"\",\n                                                                                              \"name\": \"TransitionCell142\",\n                                                                                              \"status\": \"INLINED\",\n                                                                                            },\n                                                                                          ],\n                                                                                          \"message\": \"\",\n                                                                                          \"name\": \"FixedDataTableCell143\",\n                                                                                          \"status\": \"INLINED\",\n                                                                                        },\n                                                                                        Object {\n                                                                                          \"children\": Array [\n                                                                                            Object {\n                                                                                              \"children\": Array [\n                                                                                                Object {\n                                                                                                  \"children\": Array [\n                                                                                                    Object {\n                                                                                                      \"children\": Array [\n                                                                                                        Object {\n                                                                                                          \"children\": Array [],\n                                                                                                          \"message\": \"\",\n                                                                                                          \"name\": \"AdsPETableHeader141\",\n                                                                                                          \"status\": \"INLINED\",\n                                                                                                        },\n                                                                                                      ],\n                                                                                                      \"message\": \"\",\n                                                                                                      \"name\": \"FixedDataTableAbstractSortableHeader148\",\n                                                                                                      \"status\": \"INLINED\",\n                                                                                                    },\n                                                                                                  ],\n                                                                                                  \"message\": \"\",\n                                                                                                  \"name\": \"FixedDataTableSortableHeader149\",\n                                                                                                  \"status\": \"INLINED\",\n                                                                                                },\n                                                                                              ],\n                                                                                              \"message\": \"\",\n                                                                                              \"name\": \"TransitionCell142\",\n                                                                                              \"status\": \"INLINED\",\n                                                                                            },\n                                                                                          ],\n                                                                                          \"message\": \"\",\n                                                                                          \"name\": \"FixedDataTableCell143\",\n                                                                                          \"status\": \"INLINED\",\n                                                                                        },\n                                                                                        Object {\n                                                                                          \"children\": Array [\n                                                                                            Object {\n                                                                                              \"children\": Array [\n                                                                                                Object {\n                                                                                                  \"children\": Array [\n                                                                                                    Object {\n                                                                                                      \"children\": Array [\n                                                                                                        Object {\n                                                                                                          \"children\": Array [],\n                                                                                                          \"message\": \"\",\n                                                                                                          \"name\": \"AdsPETableHeader141\",\n                                                                                                          \"status\": \"INLINED\",\n                                                                                                        },\n                                                                                                      ],\n                                                                                                      \"message\": \"\",\n                                                                                                      \"name\": \"FixedDataTableAbstractSortableHeader148\",\n                                                                                                      \"status\": \"INLINED\",\n                                                                                                    },\n                                                                                                  ],\n                                                                                                  \"message\": \"\",\n                                                                                                  \"name\": \"FixedDataTableSortableHeader149\",\n                                                                                                  \"status\": \"INLINED\",\n                                                                                                },\n                                                                                              ],\n                                                                                              \"message\": \"\",\n                                                                                              \"name\": \"TransitionCell142\",\n                                                                                              \"status\": \"INLINED\",\n                                                                                            },\n                                                                                          ],\n                                                                                          \"message\": \"\",\n                                                                                          \"name\": \"FixedDataTableCell143\",\n                                                                                          \"status\": \"INLINED\",\n                                                                                        },\n                                                                                        Object {\n                                                                                          \"children\": Array [\n                                                                                            Object {\n                                                                                              \"children\": Array [\n                                                                                                Object {\n                                                                                                  \"children\": Array [\n                                                                                                    Object {\n                                                                                                      \"children\": Array [\n                                                                                                        Object {\n                                                                                                          \"children\": Array [],\n                                                                                                          \"message\": \"\",\n                                                                                                          \"name\": \"AdsPETableHeader141\",\n                                                                                                          \"status\": \"INLINED\",\n                                                                                                        },\n                                                                                                      ],\n                                                                                                      \"message\": \"\",\n                                                                                                      \"name\": \"FixedDataTableAbstractSortableHeader148\",\n                                                                                                      \"status\": \"INLINED\",\n                                                                                                    },\n                                                                                                  ],\n                                                                                                  \"message\": \"\",\n                                                                                                  \"name\": \"FixedDataTableSortableHeader149\",\n                                                                                                  \"status\": \"INLINED\",\n                                                                                                },\n                                                                                              ],\n                                                                                              \"message\": \"\",\n                                                                                              \"name\": \"TransitionCell142\",\n                                                                                              \"status\": \"INLINED\",\n                                                                                            },\n                                                                                          ],\n                                                                                          \"message\": \"\",\n                                                                                          \"name\": \"FixedDataTableCell143\",\n                                                                                          \"status\": \"INLINED\",\n                                                                                        },\n                                                                                        Object {\n                                                                                          \"children\": Array [\n                                                                                            Object {\n                                                                                              \"children\": Array [\n                                                                                                Object {\n                                                                                                  \"children\": Array [\n                                                                                                    Object {\n                                                                                                      \"children\": Array [\n                                                                                                        Object {\n                                                                                                          \"children\": Array [],\n                                                                                                          \"message\": \"\",\n                                                                                                          \"name\": \"AdsPETableHeader141\",\n                                                                                                          \"status\": \"INLINED\",\n                                                                                                        },\n                                                                                                      ],\n                                                                                                      \"message\": \"\",\n                                                                                                      \"name\": \"FixedDataTableAbstractSortableHeader148\",\n                                                                                                      \"status\": \"INLINED\",\n                                                                                                    },\n                                                                                                  ],\n                                                                                                  \"message\": \"\",\n                                                                                                  \"name\": \"FixedDataTableSortableHeader149\",\n                                                                                                  \"status\": \"INLINED\",\n                                                                                                },\n                                                                                              ],\n                                                                                              \"message\": \"\",\n                                                                                              \"name\": \"TransitionCell142\",\n                                                                                              \"status\": \"INLINED\",\n                                                                                            },\n                                                                                          ],\n                                                                                          \"message\": \"\",\n                                                                                          \"name\": \"FixedDataTableCell143\",\n                                                                                          \"status\": \"INLINED\",\n                                                                                        },\n                                                                                        Object {\n                                                                                          \"children\": Array [\n                                                                                            Object {\n                                                                                              \"children\": Array [\n                                                                                                Object {\n                                                                                                  \"children\": Array [\n                                                                                                    Object {\n                                                                                                      \"children\": Array [\n                                                                                                        Object {\n                                                                                                          \"children\": Array [],\n                                                                                                          \"message\": \"\",\n                                                                                                          \"name\": \"AdsPETableHeader141\",\n                                                                                                          \"status\": \"INLINED\",\n                                                                                                        },\n                                                                                                      ],\n                                                                                                      \"message\": \"\",\n                                                                                                      \"name\": \"FixedDataTableAbstractSortableHeader148\",\n                                                                                                      \"status\": \"INLINED\",\n                                                                                                    },\n                                                                                                  ],\n                                                                                                  \"message\": \"\",\n                                                                                                  \"name\": \"FixedDataTableSortableHeader149\",\n                                                                                                  \"status\": \"INLINED\",\n                                                                                                },\n                                                                                              ],\n                                                                                              \"message\": \"\",\n                                                                                              \"name\": \"TransitionCell142\",\n                                                                                              \"status\": \"INLINED\",\n                                                                                            },\n                                                                                          ],\n                                                                                          \"message\": \"\",\n                                                                                          \"name\": \"FixedDataTableCell143\",\n                                                                                          \"status\": \"INLINED\",\n                                                                                        },\n                                                                                        Object {\n                                                                                          \"children\": Array [\n                                                                                            Object {\n                                                                                              \"children\": Array [\n                                                                                                Object {\n                                                                                                  \"children\": Array [\n                                                                                                    Object {\n                                                                                                      \"children\": Array [\n                                                                                                        Object {\n                                                                                                          \"children\": Array [],\n                                                                                                          \"message\": \"\",\n                                                                                                          \"name\": \"AdsPETableHeader141\",\n                                                                                                          \"status\": \"INLINED\",\n                                                                                                        },\n                                                                                                      ],\n                                                                                                      \"message\": \"\",\n                                                                                                      \"name\": \"FixedDataTableAbstractSortableHeader148\",\n                                                                                                      \"status\": \"INLINED\",\n                                                                                                    },\n                                                                                                  ],\n                                                                                                  \"message\": \"\",\n                                                                                                  \"name\": \"FixedDataTableSortableHeader149\",\n                                                                                                  \"status\": \"INLINED\",\n                                                                                                },\n                                                                                              ],\n                                                                                              \"message\": \"\",\n                                                                                              \"name\": \"TransitionCell142\",\n                                                                                              \"status\": \"INLINED\",\n                                                                                            },\n                                                                                          ],\n                                                                                          \"message\": \"\",\n                                                                                          \"name\": \"FixedDataTableCell143\",\n                                                                                          \"status\": \"INLINED\",\n                                                                                        },\n                                                                                        Object {\n                                                                                          \"children\": Array [\n                                                                                            Object {\n                                                                                              \"children\": Array [\n                                                                                                Object {\n                                                                                                  \"children\": Array [\n                                                                                                    Object {\n                                                                                                      \"children\": Array [\n                                                                                                        Object {\n                                                                                                          \"children\": Array [],\n                                                                                                          \"message\": \"\",\n                                                                                                          \"name\": \"AdsPETableHeader141\",\n                                                                                                          \"status\": \"INLINED\",\n                                                                                                        },\n                                                                                                      ],\n                                                                                                      \"message\": \"\",\n                                                                                                      \"name\": \"FixedDataTableAbstractSortableHeader148\",\n                                                                                                      \"status\": \"INLINED\",\n                                                                                                    },\n                                                                                                  ],\n                                                                                                  \"message\": \"\",\n                                                                                                  \"name\": \"FixedDataTableSortableHeader149\",\n                                                                                                  \"status\": \"INLINED\",\n                                                                                                },\n                                                                                              ],\n                                                                                              \"message\": \"\",\n                                                                                              \"name\": \"TransitionCell142\",\n                                                                                              \"status\": \"INLINED\",\n                                                                                            },\n                                                                                          ],\n                                                                                          \"message\": \"\",\n                                                                                          \"name\": \"FixedDataTableCell143\",\n                                                                                          \"status\": \"INLINED\",\n                                                                                        },\n                                                                                        Object {\n                                                                                          \"children\": Array [\n                                                                                            Object {\n                                                                                              \"children\": Array [\n                                                                                                Object {\n                                                                                                  \"children\": Array [],\n                                                                                                  \"message\": \"\",\n                                                                                                  \"name\": \"AdsPETableHeader141\",\n                                                                                                  \"status\": \"INLINED\",\n                                                                                                },\n                                                                                              ],\n                                                                                              \"message\": \"\",\n                                                                                              \"name\": \"TransitionCell142\",\n                                                                                              \"status\": \"INLINED\",\n                                                                                            },\n                                                                                          ],\n                                                                                          \"message\": \"\",\n                                                                                          \"name\": \"FixedDataTableCell143\",\n                                                                                          \"status\": \"INLINED\",\n                                                                                        },\n                                                                                        Object {\n                                                                                          \"children\": Array [\n                                                                                            Object {\n                                                                                              \"children\": Array [\n                                                                                                Object {\n                                                                                                  \"children\": Array [],\n                                                                                                  \"message\": \"\",\n                                                                                                  \"name\": \"AdsPETableHeader141\",\n                                                                                                  \"status\": \"INLINED\",\n                                                                                                },\n                                                                                              ],\n                                                                                              \"message\": \"\",\n                                                                                              \"name\": \"TransitionCell142\",\n                                                                                              \"status\": \"INLINED\",\n                                                                                            },\n                                                                                          ],\n                                                                                          \"message\": \"\",\n                                                                                          \"name\": \"FixedDataTableCell143\",\n                                                                                          \"status\": \"INLINED\",\n                                                                                        },\n                                                                                      ],\n                                                                                      \"message\": \"\",\n                                                                                      \"name\": \"FixedDataTableCellGroupImpl144\",\n                                                                                      \"status\": \"INLINED\",\n                                                                                    },\n                                                                                  ],\n                                                                                  \"message\": \"\",\n                                                                                  \"name\": \"FixedDataTableCellGroup145\",\n                                                                                  \"status\": \"INLINED\",\n                                                                                },\n                                                                              ],\n                                                                              \"message\": \"\",\n                                                                              \"name\": \"FixedDataTableRowImpl146\",\n                                                                              \"status\": \"INLINED\",\n                                                                            },\n                                                                          ],\n                                                                          \"message\": \"\",\n                                                                          \"name\": \"FixedDataTableRow147\",\n                                                                          \"status\": \"INLINED\",\n                                                                        },\n                                                                        Object {\n                                                                          \"children\": Array [],\n                                                                          \"message\": \"\",\n                                                                          \"name\": \"FixedDataTableBufferedRows150\",\n                                                                          \"status\": \"INLINED\",\n                                                                        },\n                                                                        Object {\n                                                                          \"children\": Array [],\n                                                                          \"message\": \"\",\n                                                                          \"name\": \"Scrollbar151\",\n                                                                          \"status\": \"INLINED\",\n                                                                        },\n                                                                        Object {\n                                                                          \"children\": Array [\n                                                                            Object {\n                                                                              \"children\": Array [],\n                                                                              \"message\": \"\",\n                                                                              \"name\": \"Scrollbar151\",\n                                                                              \"status\": \"INLINED\",\n                                                                            },\n                                                                          ],\n                                                                          \"message\": \"\",\n                                                                          \"name\": \"HorizontalScrollbar152\",\n                                                                          \"status\": \"INLINED\",\n                                                                        },\n                                                                      ],\n                                                                      \"message\": \"\",\n                                                                      \"name\": \"FixedDataTable153\",\n                                                                      \"status\": \"INLINED\",\n                                                                    },\n                                                                  ],\n                                                                  \"message\": \"\",\n                                                                  \"name\": \"TransitionTable154\",\n                                                                  \"status\": \"INLINED\",\n                                                                },\n                                                              ],\n                                                              \"message\": \"\",\n                                                              \"name\": \"AdsSelectableFixedDataTable155\",\n                                                              \"status\": \"INLINED\",\n                                                            },\n                                                          ],\n                                                          \"message\": \"\",\n                                                          \"name\": \"AdsDataTableKeyboardSupportDecorator156\",\n                                                          \"status\": \"INLINED\",\n                                                        },\n                                                      ],\n                                                      \"message\": \"\",\n                                                      \"name\": \"AdsEditableDataTableDecorator157\",\n                                                      \"status\": \"INLINED\",\n                                                    },\n                                                  ],\n                                                  \"message\": \"\",\n                                                  \"name\": \"AdsPEDataTableContainer158\",\n                                                  \"status\": \"INLINED\",\n                                                },\n                                              ],\n                                              \"message\": \"\",\n                                              \"name\": \"ResponsiveBlock37\",\n                                              \"status\": \"INLINED\",\n                                            },\n                                          ],\n                                          \"message\": \"\",\n                                          \"name\": \"AdsPECampaignGroupTableContainer159\",\n                                          \"status\": \"INLINED\",\n                                        },\n                                      ],\n                                      \"message\": \"\",\n                                      \"name\": \"ErrorBoundary9\",\n                                      \"status\": \"INLINED\",\n                                    },\n                                  ],\n                                  \"message\": \"\",\n                                  \"name\": \"AdsErrorBoundary10\",\n                                  \"status\": \"INLINED\",\n                                },\n                              ],\n                              \"message\": \"\",\n                              \"name\": \"AdsPEManageAdsPaneContainer160\",\n                              \"status\": \"INLINED\",\n                            },\n                          ],\n                          \"message\": \"\",\n                          \"name\": \"AdsPEContentContainer161\",\n                          \"status\": \"INLINED\",\n                        },\n                      ],\n                      \"message\": \"\",\n                      \"name\": \"ErrorBoundary9\",\n                      \"status\": \"INLINED\",\n                    },\n                  ],\n                  \"message\": \"\",\n                  \"name\": \"AdsErrorBoundary10\",\n                  \"status\": \"INLINED\",\n                },\n              ],\n              \"message\": \"\",\n              \"name\": \"FluxContainer_AdsPEWorkspaceContainer_162\",\n              \"status\": \"INLINED\",\n            },\n            Object {\n              \"children\": Array [],\n              \"message\": \"\",\n              \"name\": \"FluxContainer_AdsSessionExpiredDialogContainer_163\",\n              \"status\": \"INLINED\",\n            },\n            Object {\n              \"children\": Array [],\n              \"message\": \"\",\n              \"name\": \"FluxContainer_AdsPEUploadDialogLazyContainer_164\",\n              \"status\": \"INLINED\",\n            },\n            Object {\n              \"children\": Array [],\n              \"message\": \"\",\n              \"name\": \"FluxContainer_DialogContainer_165\",\n              \"status\": \"INLINED\",\n            },\n            Object {\n              \"children\": Array [],\n              \"message\": \"\",\n              \"name\": \"AdsBugReportContainer166\",\n              \"status\": \"INLINED\",\n            },\n            Object {\n              \"children\": Array [\n                Object {\n                  \"children\": Array [],\n                  \"message\": \"\",\n                  \"name\": \"AdsPEAudienceSplittingDialog167\",\n                  \"status\": \"INLINED\",\n                },\n              ],\n              \"message\": \"\",\n              \"name\": \"AdsPEAudienceSplittingDialogContainer168\",\n              \"status\": \"INLINED\",\n            },\n            Object {\n              \"children\": Array [],\n              \"message\": \"\",\n              \"name\": \"FluxContainer_AdsRuleDialogBootloadContainer_169\",\n              \"status\": \"INLINED\",\n            },\n            Object {\n              \"children\": Array [],\n              \"message\": \"\",\n              \"name\": \"FluxContainer_AdsPECFTrayContainer_170\",\n              \"status\": \"INLINED\",\n            },\n            Object {\n              \"children\": Array [],\n              \"message\": \"\",\n              \"name\": \"FluxContainer_AdsPEDeleteDraftContainer_171\",\n              \"status\": \"INLINED\",\n            },\n            Object {\n              \"children\": Array [],\n              \"message\": \"\",\n              \"name\": \"FluxContainer_AdsPEInitialDraftPublishDialogContainer_172\",\n              \"status\": \"INLINED\",\n            },\n            Object {\n              \"children\": Array [],\n              \"message\": \"\",\n              \"name\": \"FluxContainer_AdsPEReachFrequencyStatusTransitionDialogBootloadContainer_173\",\n              \"status\": \"INLINED\",\n            },\n            Object {\n              \"children\": Array [],\n              \"message\": \"\",\n              \"name\": \"FluxContainer_AdsPEPurgeArchiveDialogContainer_174\",\n              \"status\": \"INLINED\",\n            },\n            Object {\n              \"children\": Array [],\n              \"message\": \"\",\n              \"name\": \"AdsPECreateDialogContainer175\",\n              \"status\": \"INLINED\",\n            },\n            Object {\n              \"children\": Array [],\n              \"message\": \"\",\n              \"name\": \"FluxContainer_AdsPEModalStatusContainer_176\",\n              \"status\": \"INLINED\",\n            },\n            Object {\n              \"children\": Array [],\n              \"message\": \"\",\n              \"name\": \"FluxContainer_AdsBrowserExtensionErrorDialogContainer_177\",\n              \"status\": \"INLINED\",\n            },\n            Object {\n              \"children\": Array [],\n              \"message\": \"\",\n              \"name\": \"FluxContainer_AdsPESortByErrorTipContainer_178\",\n              \"status\": \"INLINED\",\n            },\n            Object {\n              \"children\": Array [\n                Object {\n                  \"children\": Array [],\n                  \"message\": \"\",\n                  \"name\": \"LeadDownloadDialogSelector179\",\n                  \"status\": \"INLINED\",\n                },\n              ],\n              \"message\": \"\",\n              \"name\": \"FluxContainer_AdsPELeadDownloadDialogContainerClass_180\",\n              \"status\": \"INLINED\",\n            },\n          ],\n          \"message\": \"\",\n          \"name\": \"AdsPEContainer181\",\n          \"status\": \"INLINED\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"Benchmark\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 497,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`PE Functional Components benchmark: (JSX => createElement) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 498,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [\n            Object {\n              \"children\": Array [\n                Object {\n                  \"children\": Array [\n                    Object {\n                      \"children\": Array [\n                        Object {\n                          \"children\": Array [\n                            Object {\n                              \"children\": Array [\n                                Object {\n                                  \"children\": Array [\n                                    Object {\n                                      \"children\": Array [\n                                        Object {\n                                          \"children\": Array [\n                                            Object {\n                                              \"children\": Array [\n                                                Object {\n                                                  \"children\": Array [\n                                                    Object {\n                                                      \"children\": Array [\n                                                        Object {\n                                                          \"children\": Array [\n                                                            Object {\n                                                              \"children\": Array [\n                                                                Object {\n                                                                  \"children\": Array [\n                                                                    Object {\n                                                                      \"children\": Array [],\n                                                                      \"message\": \"\",\n                                                                      \"name\": \"ReactImage0\",\n                                                                      \"status\": \"INLINED\",\n                                                                    },\n                                                                  ],\n                                                                  \"message\": \"\",\n                                                                  \"name\": \"AbstractLink1\",\n                                                                  \"status\": \"INLINED\",\n                                                                },\n                                                              ],\n                                                              \"message\": \"\",\n                                                              \"name\": \"Link2\",\n                                                              \"status\": \"INLINED\",\n                                                            },\n                                                          ],\n                                                          \"message\": \"\",\n                                                          \"name\": \"AbstractButton3\",\n                                                          \"status\": \"INLINED\",\n                                                        },\n                                                      ],\n                                                      \"message\": \"\",\n                                                      \"name\": \"XUIButton4\",\n                                                      \"status\": \"INLINED\",\n                                                    },\n                                                  ],\n                                                  \"message\": \"\",\n                                                  \"name\": \"AbstractPopoverButton5\",\n                                                  \"status\": \"INLINED\",\n                                                },\n                                              ],\n                                              \"message\": \"\",\n                                              \"name\": \"ReactXUIPopoverButton6\",\n                                              \"status\": \"INLINED\",\n                                            },\n                                          ],\n                                          \"message\": \"\",\n                                          \"name\": \"BIGAdAccountSelector7\",\n                                          \"status\": \"INLINED\",\n                                        },\n                                      ],\n                                      \"message\": \"\",\n                                      \"name\": \"FluxContainer_AdsPEBIGAdAccountSelectorContainer_8\",\n                                      \"status\": \"INLINED\",\n                                    },\n                                  ],\n                                  \"message\": \"\",\n                                  \"name\": \"ErrorBoundary9\",\n                                  \"status\": \"INLINED\",\n                                },\n                              ],\n                              \"message\": \"\",\n                              \"name\": \"AdsErrorBoundary10\",\n                              \"status\": \"INLINED\",\n                            },\n                            Object {\n                              \"children\": Array [\n                                Object {\n                                  \"children\": Array [\n                                    Object {\n                                      \"children\": Array [\n                                        Object {\n                                          \"children\": Array [],\n                                          \"message\": \"\",\n                                          \"name\": \"AdsPENavigationBar11\",\n                                          \"status\": \"INLINED\",\n                                        },\n                                      ],\n                                      \"message\": \"\",\n                                      \"name\": \"FluxContainer_AdsPENavigationBarContainer_12\",\n                                      \"status\": \"INLINED\",\n                                    },\n                                  ],\n                                  \"message\": \"\",\n                                  \"name\": \"ErrorBoundary9\",\n                                  \"status\": \"INLINED\",\n                                },\n                              ],\n                              \"message\": \"\",\n                              \"name\": \"AdsErrorBoundary10\",\n                              \"status\": \"INLINED\",\n                            },\n                            Object {\n                              \"children\": Array [\n                                Object {\n                                  \"children\": Array [\n                                    Object {\n                                      \"children\": Array [\n                                        Object {\n                                          \"children\": Array [\n                                            Object {\n                                              \"children\": Array [\n                                                Object {\n                                                  \"children\": Array [\n                                                    Object {\n                                                      \"children\": Array [],\n                                                      \"message\": \"\",\n                                                      \"name\": \"ReactImage0\",\n                                                      \"status\": \"INLINED\",\n                                                    },\n                                                  ],\n                                                  \"message\": \"\",\n                                                  \"name\": \"AdsPEDraftSyncStatus13\",\n                                                  \"status\": \"INLINED\",\n                                                },\n                                              ],\n                                              \"message\": \"\",\n                                              \"name\": \"FluxContainer_AdsPEDraftSyncStatusContainer_14\",\n                                              \"status\": \"INLINED\",\n                                            },\n                                            Object {\n                                              \"children\": Array [\n                                                Object {\n                                                  \"children\": Array [],\n                                                  \"message\": \"\",\n                                                  \"name\": \"AdsPEDraftErrorsStatus15\",\n                                                  \"status\": \"INLINED\",\n                                                },\n                                              ],\n                                              \"message\": \"\",\n                                              \"name\": \"FluxContainer_viewFn_16\",\n                                              \"status\": \"INLINED\",\n                                            },\n                                            Object {\n                                              \"children\": Array [\n                                                Object {\n                                                  \"children\": Array [],\n                                                  \"message\": \"\",\n                                                  \"name\": \"AbstractButton3\",\n                                                  \"status\": \"INLINED\",\n                                                },\n                                              ],\n                                              \"message\": \"\",\n                                              \"name\": \"XUIButton4\",\n                                              \"status\": \"INLINED\",\n                                            },\n                                            Object {\n                                              \"children\": Array [\n                                                Object {\n                                                  \"children\": Array [\n                                                    Object {\n                                                      \"children\": Array [],\n                                                      \"message\": \"\",\n                                                      \"name\": \"ReactImage0\",\n                                                      \"status\": \"INLINED\",\n                                                    },\n                                                  ],\n                                                  \"message\": \"\",\n                                                  \"name\": \"AbstractButton3\",\n                                                  \"status\": \"INLINED\",\n                                                },\n                                              ],\n                                              \"message\": \"\",\n                                              \"name\": \"XUIButton4\",\n                                              \"status\": \"INLINED\",\n                                            },\n                                          ],\n                                          \"message\": \"\",\n                                          \"name\": \"AdsPEPublishButton17\",\n                                          \"status\": \"INLINED\",\n                                        },\n                                      ],\n                                      \"message\": \"\",\n                                      \"name\": \"FluxContainer_AdsPEPublishButtonContainer_18\",\n                                      \"status\": \"INLINED\",\n                                    },\n                                  ],\n                                  \"message\": \"\",\n                                  \"name\": \"ErrorBoundary9\",\n                                  \"status\": \"INLINED\",\n                                },\n                              ],\n                              \"message\": \"\",\n                              \"name\": \"AdsErrorBoundary10\",\n                              \"status\": \"INLINED\",\n                            },\n                            Object {\n                              \"children\": Array [\n                                Object {\n                                  \"children\": Array [\n                                    Object {\n                                      \"children\": Array [\n                                        Object {\n                                          \"children\": Array [\n                                            Object {\n                                              \"children\": Array [],\n                                              \"message\": \"\",\n                                              \"name\": \"ReactImage0\",\n                                              \"status\": \"INLINED\",\n                                            },\n                                          ],\n                                          \"message\": \"\",\n                                          \"name\": \"InlineBlock19\",\n                                          \"status\": \"INLINED\",\n                                        },\n                                      ],\n                                      \"message\": \"\",\n                                      \"name\": \"ReactPopoverMenu20\",\n                                      \"status\": \"INLINED\",\n                                    },\n                                  ],\n                                  \"message\": \"\",\n                                  \"name\": \"ErrorBoundary9\",\n                                  \"status\": \"INLINED\",\n                                },\n                              ],\n                              \"message\": \"\",\n                              \"name\": \"AdsErrorBoundary10\",\n                              \"status\": \"INLINED\",\n                            },\n                          ],\n                          \"message\": \"\",\n                          \"name\": \"LeftRight21\",\n                          \"status\": \"INLINED\",\n                        },\n                      ],\n                      \"message\": \"\",\n                      \"name\": \"AdsUnifiedNavigationLocalNav22\",\n                      \"status\": \"INLINED\",\n                    },\n                    Object {\n                      \"children\": Array [\n                        Object {\n                          \"children\": Array [\n                            Object {\n                              \"children\": Array [\n                                Object {\n                                  \"children\": Array [],\n                                  \"message\": \"\",\n                                  \"name\": \"XUIDialog23\",\n                                  \"status\": \"INLINED\",\n                                },\n                              ],\n                              \"message\": \"\",\n                              \"name\": \"AdsPEResetDialog24\",\n                              \"status\": \"INLINED\",\n                            },\n                          ],\n                          \"message\": \"\",\n                          \"name\": \"ErrorBoundary9\",\n                          \"status\": \"INLINED\",\n                        },\n                      ],\n                      \"message\": \"\",\n                      \"name\": \"AdsErrorBoundary10\",\n                      \"status\": \"INLINED\",\n                    },\n                  ],\n                  \"message\": \"\",\n                  \"name\": \"AdsPETopNav25\",\n                  \"status\": \"INLINED\",\n                },\n              ],\n              \"message\": \"\",\n              \"name\": \"FluxContainer_AdsPETopNavContainer_26\",\n              \"status\": \"INLINED\",\n            },\n            Object {\n              \"children\": Array [\n                Object {\n                  \"children\": Array [\n                    Object {\n                      \"children\": Array [\n                        Object {\n                          \"children\": Array [\n                            Object {\n                              \"children\": Array [\n                                Object {\n                                  \"children\": Array [\n                                    Object {\n                                      \"children\": Array [\n                                        Object {\n                                          \"children\": Array [\n                                            Object {\n                                              \"children\": Array [\n                                                Object {\n                                                  \"children\": Array [\n                                                    Object {\n                                                      \"children\": Array [],\n                                                      \"message\": \"\",\n                                                      \"name\": \"ReactImage0\",\n                                                      \"status\": \"INLINED\",\n                                                    },\n                                                    Object {\n                                                      \"children\": Array [\n                                                        Object {\n                                                          \"children\": Array [\n                                                            Object {\n                                                              \"children\": Array [\n                                                                Object {\n                                                                  \"children\": Array [\n                                                                    Object {\n                                                                      \"children\": Array [],\n                                                                      \"message\": \"\",\n                                                                      \"name\": \"AbstractLink1\",\n                                                                      \"status\": \"INLINED\",\n                                                                    },\n                                                                  ],\n                                                                  \"message\": \"\",\n                                                                  \"name\": \"Link2\",\n                                                                  \"status\": \"INLINED\",\n                                                                },\n                                                              ],\n                                                              \"message\": \"\",\n                                                              \"name\": \"AbstractButton3\",\n                                                              \"status\": \"INLINED\",\n                                                            },\n                                                          ],\n                                                          \"message\": \"\",\n                                                          \"name\": \"XUIAbstractGlyphButton27\",\n                                                          \"status\": \"INLINED\",\n                                                        },\n                                                      ],\n                                                      \"message\": \"\",\n                                                      \"name\": \"XUICloseButton28\",\n                                                      \"status\": \"INLINED\",\n                                                    },\n                                                    Object {\n                                                      \"children\": Array [\n                                                        Object {\n                                                          \"children\": Array [\n                                                            Object {\n                                                              \"children\": Array [],\n                                                              \"message\": \"\",\n                                                              \"name\": \"XUIText29\",\n                                                              \"status\": \"INLINED\",\n                                                            },\n                                                          ],\n                                                          \"message\": \"\",\n                                                          \"name\": \"AbstractLink1\",\n                                                          \"status\": \"INLINED\",\n                                                        },\n                                                      ],\n                                                      \"message\": \"\",\n                                                      \"name\": \"Link2\",\n                                                      \"status\": \"INLINED\",\n                                                    },\n                                                  ],\n                                                  \"message\": \"\",\n                                                  \"name\": \"XUINotice30\",\n                                                  \"status\": \"INLINED\",\n                                                },\n                                              ],\n                                              \"message\": \"\",\n                                              \"name\": \"ReactCSSTransitionGroupChild31\",\n                                              \"status\": \"INLINED\",\n                                            },\n                                          ],\n                                          \"message\": \"\",\n                                          \"name\": \"ReactTransitionGroup32\",\n                                          \"status\": \"INLINED\",\n                                        },\n                                      ],\n                                      \"message\": \"\",\n                                      \"name\": \"ReactCSSTransitionGroup33\",\n                                      \"status\": \"INLINED\",\n                                    },\n                                  ],\n                                  \"message\": \"\",\n                                  \"name\": \"AdsPETopError34\",\n                                  \"status\": \"INLINED\",\n                                },\n                              ],\n                              \"message\": \"\",\n                              \"name\": \"FluxContainer_AdsPETopErrorContainer_35\",\n                              \"status\": \"INLINED\",\n                            },\n                          ],\n                          \"message\": \"\",\n                          \"name\": \"ErrorBoundary9\",\n                          \"status\": \"INLINED\",\n                        },\n                      ],\n                      \"message\": \"\",\n                      \"name\": \"AdsErrorBoundary10\",\n                      \"status\": \"INLINED\",\n                    },\n                    Object {\n                      \"children\": Array [\n                        Object {\n                          \"children\": Array [\n                            Object {\n                              \"children\": Array [],\n                              \"message\": \"\",\n                              \"name\": \"FluxContainer_AdsGuidanceChannel_36\",\n                              \"status\": \"INLINED\",\n                            },\n                          ],\n                          \"message\": \"\",\n                          \"name\": \"ErrorBoundary9\",\n                          \"status\": \"INLINED\",\n                        },\n                      ],\n                      \"message\": \"\",\n                      \"name\": \"AdsErrorBoundary10\",\n                      \"status\": \"INLINED\",\n                    },\n                  ],\n                  \"message\": \"\",\n                  \"name\": \"ResponsiveBlock37\",\n                  \"status\": \"INLINED\",\n                },\n                Object {\n                  \"children\": Array [\n                    Object {\n                      \"children\": Array [\n                        Object {\n                          \"children\": Array [\n                            Object {\n                              \"children\": Array [\n                                Object {\n                                  \"children\": Array [\n                                    Object {\n                                      \"children\": Array [\n                                        Object {\n                                          \"children\": Array [],\n                                          \"message\": \"\",\n                                          \"name\": \"FluxContainer_AdsBulkEditDialogContainer_38\",\n                                          \"status\": \"INLINED\",\n                                        },\n                                      ],\n                                      \"message\": \"\",\n                                      \"name\": \"ErrorBoundary9\",\n                                      \"status\": \"INLINED\",\n                                    },\n                                  ],\n                                  \"message\": \"\",\n                                  \"name\": \"AdsErrorBoundary10\",\n                                  \"status\": \"INLINED\",\n                                },\n                                Object {\n                                  \"children\": Array [\n                                    Object {\n                                      \"children\": Array [\n                                        Object {\n                                          \"children\": Array [\n                                            Object {\n                                              \"children\": Array [\n                                                Object {\n                                                  \"children\": Array [\n                                                    Object {\n                                                      \"children\": Array [],\n                                                      \"message\": \"\",\n                                                      \"name\": \"Column39\",\n                                                      \"status\": \"INLINED\",\n                                                    },\n                                                    Object {\n                                                      \"children\": Array [\n                                                        Object {\n                                                          \"children\": Array [\n                                                            Object {\n                                                              \"children\": Array [\n                                                                Object {\n                                                                  \"children\": Array [\n                                                                    Object {\n                                                                      \"children\": Array [],\n                                                                      \"message\": \"\",\n                                                                      \"name\": \"ReactImage0\",\n                                                                      \"status\": \"INLINED\",\n                                                                    },\n                                                                  ],\n                                                                  \"message\": \"\",\n                                                                  \"name\": \"AbstractButton3\",\n                                                                  \"status\": \"INLINED\",\n                                                                },\n                                                              ],\n                                                              \"message\": \"\",\n                                                              \"name\": \"XUIButton4\",\n                                                              \"status\": \"INLINED\",\n                                                            },\n                                                            Object {\n                                                              \"children\": Array [\n                                                                Object {\n                                                                  \"children\": Array [\n                                                                    Object {\n                                                                      \"children\": Array [\n                                                                        Object {\n                                                                          \"children\": Array [\n                                                                            Object {\n                                                                              \"children\": Array [],\n                                                                              \"message\": \"\",\n                                                                              \"name\": \"ReactImage0\",\n                                                                              \"status\": \"INLINED\",\n                                                                            },\n                                                                          ],\n                                                                          \"message\": \"\",\n                                                                          \"name\": \"AbstractButton3\",\n                                                                          \"status\": \"INLINED\",\n                                                                        },\n                                                                      ],\n                                                                      \"message\": \"\",\n                                                                      \"name\": \"XUIButton4\",\n                                                                      \"status\": \"INLINED\",\n                                                                    },\n                                                                  ],\n                                                                  \"message\": \"\",\n                                                                  \"name\": \"InlineBlock19\",\n                                                                  \"status\": \"INLINED\",\n                                                                },\n                                                              ],\n                                                              \"message\": \"\",\n                                                              \"name\": \"ReactPopoverMenu20\",\n                                                              \"status\": \"INLINED\",\n                                                            },\n                                                          ],\n                                                          \"message\": \"\",\n                                                          \"name\": \"XUIButtonGroup40\",\n                                                          \"status\": \"INLINED\",\n                                                        },\n                                                        Object {\n                                                          \"children\": Array [\n                                                            Object {\n                                                              \"children\": Array [\n                                                                Object {\n                                                                  \"children\": Array [\n                                                                    Object {\n                                                                      \"children\": Array [\n                                                                        Object {\n                                                                          \"children\": Array [\n                                                                            Object {\n                                                                              \"children\": Array [\n                                                                                Object {\n                                                                                  \"children\": Array [],\n                                                                                  \"message\": \"\",\n                                                                                  \"name\": \"ReactImage0\",\n                                                                                  \"status\": \"INLINED\",\n                                                                                },\n                                                                              ],\n                                                                              \"message\": \"\",\n                                                                              \"name\": \"AbstractButton3\",\n                                                                              \"status\": \"INLINED\",\n                                                                            },\n                                                                          ],\n                                                                          \"message\": \"\",\n                                                                          \"name\": \"XUIButton4\",\n                                                                          \"status\": \"INLINED\",\n                                                                        },\n                                                                        Object {\n                                                                          \"children\": Array [\n                                                                            Object {\n                                                                              \"children\": Array [\n                                                                                Object {\n                                                                                  \"children\": Array [\n                                                                                    Object {\n                                                                                      \"children\": Array [\n                                                                                        Object {\n                                                                                          \"children\": Array [],\n                                                                                          \"message\": \"\",\n                                                                                          \"name\": \"ReactImage0\",\n                                                                                          \"status\": \"INLINED\",\n                                                                                        },\n                                                                                      ],\n                                                                                      \"message\": \"\",\n                                                                                      \"name\": \"AbstractButton3\",\n                                                                                      \"status\": \"INLINED\",\n                                                                                    },\n                                                                                  ],\n                                                                                  \"message\": \"\",\n                                                                                  \"name\": \"XUIButton4\",\n                                                                                  \"status\": \"INLINED\",\n                                                                                },\n                                                                              ],\n                                                                              \"message\": \"\",\n                                                                              \"name\": \"InlineBlock19\",\n                                                                              \"status\": \"INLINED\",\n                                                                            },\n                                                                          ],\n                                                                          \"message\": \"\",\n                                                                          \"name\": \"ReactPopoverMenu20\",\n                                                                          \"status\": \"INLINED\",\n                                                                        },\n                                                                      ],\n                                                                      \"message\": \"\",\n                                                                      \"name\": \"XUIButtonGroup40\",\n                                                                      \"status\": \"INLINED\",\n                                                                    },\n                                                                  ],\n                                                                  \"message\": \"\",\n                                                                  \"name\": \"AdsPEEditToolbarButton41\",\n                                                                  \"status\": \"INLINED\",\n                                                                },\n                                                              ],\n                                                              \"message\": \"\",\n                                                              \"name\": \"FluxContainer_AdsPEEditCampaignGroupToolbarButtonContainer_42\",\n                                                              \"status\": \"INLINED\",\n                                                            },\n                                                          ],\n                                                          \"message\": \"\",\n                                                          \"name\": \"FluxContainer_AdsPEEditToolbarButtonContainer_43\",\n                                                          \"status\": \"INLINED\",\n                                                        },\n                                                        Object {\n                                                          \"children\": Array [\n                                                            Object {\n                                                              \"children\": Array [\n                                                                Object {\n                                                                  \"children\": Array [\n                                                                    Object {\n                                                                      \"children\": Array [],\n                                                                      \"message\": \"\",\n                                                                      \"name\": \"ReactImage0\",\n                                                                      \"status\": \"INLINED\",\n                                                                    },\n                                                                  ],\n                                                                  \"message\": \"\",\n                                                                  \"name\": \"AbstractButton3\",\n                                                                  \"status\": \"INLINED\",\n                                                                },\n                                                              ],\n                                                              \"message\": \"\",\n                                                              \"name\": \"XUIButton4\",\n                                                              \"status\": \"INLINED\",\n                                                            },\n                                                            Object {\n                                                              \"children\": Array [\n                                                                Object {\n                                                                  \"children\": Array [\n                                                                    Object {\n                                                                      \"children\": Array [],\n                                                                      \"message\": \"\",\n                                                                      \"name\": \"ReactImage0\",\n                                                                      \"status\": \"INLINED\",\n                                                                    },\n                                                                  ],\n                                                                  \"message\": \"\",\n                                                                  \"name\": \"AbstractButton3\",\n                                                                  \"status\": \"INLINED\",\n                                                                },\n                                                              ],\n                                                              \"message\": \"\",\n                                                              \"name\": \"XUIButton4\",\n                                                              \"status\": \"INLINED\",\n                                                            },\n                                                            Object {\n                                                              \"children\": Array [\n                                                                Object {\n                                                                  \"children\": Array [\n                                                                    Object {\n                                                                      \"children\": Array [],\n                                                                      \"message\": \"\",\n                                                                      \"name\": \"ReactImage0\",\n                                                                      \"status\": \"INLINED\",\n                                                                    },\n                                                                  ],\n                                                                  \"message\": \"\",\n                                                                  \"name\": \"AbstractButton3\",\n                                                                  \"status\": \"INLINED\",\n                                                                },\n                                                              ],\n                                                              \"message\": \"\",\n                                                              \"name\": \"XUIButton4\",\n                                                              \"status\": \"INLINED\",\n                                                            },\n                                                          ],\n                                                          \"message\": \"\",\n                                                          \"name\": \"XUIButtonGroup40\",\n                                                          \"status\": \"INLINED\",\n                                                        },\n                                                        Object {\n                                                          \"children\": Array [\n                                                            Object {\n                                                              \"children\": Array [\n                                                                Object {\n                                                                  \"children\": Array [\n                                                                    Object {\n                                                                      \"children\": Array [\n                                                                        Object {\n                                                                          \"children\": Array [\n                                                                            Object {\n                                                                              \"children\": Array [\n                                                                                Object {\n                                                                                  \"children\": Array [\n                                                                                    Object {\n                                                                                      \"children\": Array [],\n                                                                                      \"message\": \"\",\n                                                                                      \"name\": \"ReactImage0\",\n                                                                                      \"status\": \"INLINED\",\n                                                                                    },\n                                                                                  ],\n                                                                                  \"message\": \"\",\n                                                                                  \"name\": \"AbstractButton3\",\n                                                                                  \"status\": \"INLINED\",\n                                                                                },\n                                                                              ],\n                                                                              \"message\": \"\",\n                                                                              \"name\": \"XUIButton4\",\n                                                                              \"status\": \"INLINED\",\n                                                                            },\n                                                                          ],\n                                                                          \"message\": \"\",\n                                                                          \"name\": \"InlineBlock19\",\n                                                                          \"status\": \"INLINED\",\n                                                                        },\n                                                                      ],\n                                                                      \"message\": \"\",\n                                                                      \"name\": \"ReactPopoverMenu20\",\n                                                                      \"status\": \"INLINED\",\n                                                                    },\n                                                                  ],\n                                                                  \"message\": \"\",\n                                                                  \"name\": \"AdsPEExportImportMenu44\",\n                                                                  \"status\": \"INLINED\",\n                                                                },\n                                                                Object {\n                                                                  \"children\": Array [],\n                                                                  \"message\": \"\",\n                                                                  \"name\": \"FluxContainer_AdsPECustomizeExportContainer_45\",\n                                                                  \"status\": \"INLINED\",\n                                                                },\n                                                                Object {\n                                                                  \"children\": Array [\n                                                                    Object {\n                                                                      \"children\": Array [],\n                                                                      \"message\": \"\",\n                                                                      \"name\": \"AdsPEExportAsTextDialog46\",\n                                                                      \"status\": \"INLINED\",\n                                                                    },\n                                                                  ],\n                                                                  \"message\": \"\",\n                                                                  \"name\": \"FluxContainer_AdsPEExportAsTextDialogContainer_47\",\n                                                                  \"status\": \"INLINED\",\n                                                                },\n                                                              ],\n                                                              \"message\": \"\",\n                                                              \"name\": \"AdsPEExportImportMenuContainer48\",\n                                                              \"status\": \"INLINED\",\n                                                            },\n                                                            Object {\n                                                              \"children\": Array [\n                                                                Object {\n                                                                  \"children\": Array [\n                                                                    Object {\n                                                                      \"children\": Array [],\n                                                                      \"message\": \"\",\n                                                                      \"name\": \"ReactImage0\",\n                                                                      \"status\": \"INLINED\",\n                                                                    },\n                                                                  ],\n                                                                  \"message\": \"\",\n                                                                  \"name\": \"AbstractButton3\",\n                                                                  \"status\": \"INLINED\",\n                                                                },\n                                                              ],\n                                                              \"message\": \"\",\n                                                              \"name\": \"XUIButton4\",\n                                                              \"status\": \"INLINED\",\n                                                            },\n                                                            Object {\n                                                              \"children\": Array [\n                                                                Object {\n                                                                  \"children\": Array [\n                                                                    Object {\n                                                                      \"children\": Array [\n                                                                        Object {\n                                                                          \"children\": Array [\n                                                                            Object {\n                                                                              \"children\": Array [],\n                                                                              \"message\": \"\",\n                                                                              \"name\": \"ReactImage0\",\n                                                                              \"status\": \"INLINED\",\n                                                                            },\n                                                                          ],\n                                                                          \"message\": \"\",\n                                                                          \"name\": \"AbstractButton3\",\n                                                                          \"status\": \"INLINED\",\n                                                                        },\n                                                                      ],\n                                                                      \"message\": \"\",\n                                                                      \"name\": \"XUIButton4\",\n                                                                      \"status\": \"INLINED\",\n                                                                    },\n                                                                    Object {\n                                                                      \"children\": Array [],\n                                                                      \"message\": \"\",\n                                                                      \"name\": \"Constructor49\",\n                                                                      \"status\": \"INLINED\",\n                                                                    },\n                                                                  ],\n                                                                  \"message\": \"\",\n                                                                  \"name\": \"TagSelectorPopover50\",\n                                                                  \"status\": \"INLINED\",\n                                                                },\n                                                              ],\n                                                              \"message\": \"\",\n                                                              \"name\": \"AdsPECampaignGroupTagContainer51\",\n                                                              \"status\": \"INLINED\",\n                                                            },\n                                                          ],\n                                                          \"message\": \"\",\n                                                          \"name\": \"XUIButtonGroup40\",\n                                                          \"status\": \"INLINED\",\n                                                        },\n                                                        Object {\n                                                          \"children\": Array [\n                                                            Object {\n                                                              \"children\": Array [],\n                                                              \"message\": \"\",\n                                                              \"name\": \"AdsRuleToolbarMenu52\",\n                                                              \"status\": \"INLINED\",\n                                                            },\n                                                          ],\n                                                          \"message\": \"\",\n                                                          \"name\": \"FluxContainer_AdsPERuleToolbarMenuContainer_53\",\n                                                          \"status\": \"INLINED\",\n                                                        },\n                                                      ],\n                                                      \"message\": \"\",\n                                                      \"name\": \"FillColumn54\",\n                                                      \"status\": \"INLINED\",\n                                                    },\n                                                  ],\n                                                  \"message\": \"\",\n                                                  \"name\": \"Layout55\",\n                                                  \"status\": \"INLINED\",\n                                                },\n                                              ],\n                                              \"message\": \"\",\n                                              \"name\": \"AdsPEMainPaneToolbar56\",\n                                              \"status\": \"INLINED\",\n                                            },\n                                          ],\n                                          \"message\": \"\",\n                                          \"name\": \"AdsPECampaignGroupToolbarContainer57\",\n                                          \"status\": \"INLINED\",\n                                        },\n                                      ],\n                                      \"message\": \"\",\n                                      \"name\": \"ErrorBoundary9\",\n                                      \"status\": \"INLINED\",\n                                    },\n                                  ],\n                                  \"message\": \"\",\n                                  \"name\": \"AdsErrorBoundary10\",\n                                  \"status\": \"INLINED\",\n                                },\n                                Object {\n                                  \"children\": Array [\n                                    Object {\n                                      \"children\": Array [\n                                        Object {\n                                          \"children\": Array [\n                                            Object {\n                                              \"children\": Array [\n                                                Object {\n                                                  \"children\": Array [\n                                                    Object {\n                                                      \"children\": Array [\n                                                        Object {\n                                                          \"children\": Array [\n                                                            Object {\n                                                              \"children\": Array [\n                                                                Object {\n                                                                  \"children\": Array [\n                                                                    Object {\n                                                                      \"children\": Array [\n                                                                        Object {\n                                                                          \"children\": Array [\n                                                                            Object {\n                                                                              \"children\": Array [],\n                                                                              \"message\": \"\",\n                                                                              \"name\": \"ReactImage0\",\n                                                                              \"status\": \"INLINED\",\n                                                                            },\n                                                                            Object {\n                                                                              \"children\": Array [],\n                                                                              \"message\": \"\",\n                                                                              \"name\": \"ReactImage0\",\n                                                                              \"status\": \"INLINED\",\n                                                                            },\n                                                                          ],\n                                                                          \"message\": \"\",\n                                                                          \"name\": \"AbstractLink1\",\n                                                                          \"status\": \"INLINED\",\n                                                                        },\n                                                                      ],\n                                                                      \"message\": \"\",\n                                                                      \"name\": \"Link2\",\n                                                                      \"status\": \"INLINED\",\n                                                                    },\n                                                                  ],\n                                                                  \"message\": \"\",\n                                                                  \"name\": \"AbstractButton3\",\n                                                                  \"status\": \"INLINED\",\n                                                                },\n                                                              ],\n                                                              \"message\": \"\",\n                                                              \"name\": \"XUIButton4\",\n                                                              \"status\": \"INLINED\",\n                                                            },\n                                                          ],\n                                                          \"message\": \"\",\n                                                          \"name\": \"AbstractPopoverButton5\",\n                                                          \"status\": \"INLINED\",\n                                                        },\n                                                      ],\n                                                      \"message\": \"\",\n                                                      \"name\": \"ReactXUIPopoverButton6\",\n                                                      \"status\": \"INLINED\",\n                                                    },\n                                                    Object {\n                                                      \"children\": Array [\n                                                        Object {\n                                                          \"children\": Array [\n                                                            Object {\n                                                              \"children\": Array [\n                                                                Object {\n                                                                  \"children\": Array [\n                                                                    Object {\n                                                                      \"children\": Array [\n                                                                        Object {\n                                                                          \"children\": Array [\n                                                                            Object {\n                                                                              \"children\": Array [],\n                                                                              \"message\": \"\",\n                                                                              \"name\": \"ReactImage0\",\n                                                                              \"status\": \"INLINED\",\n                                                                            },\n                                                                            Object {\n                                                                              \"children\": Array [],\n                                                                              \"message\": \"\",\n                                                                              \"name\": \"ReactImage0\",\n                                                                              \"status\": \"INLINED\",\n                                                                            },\n                                                                          ],\n                                                                          \"message\": \"\",\n                                                                          \"name\": \"AbstractLink1\",\n                                                                          \"status\": \"INLINED\",\n                                                                        },\n                                                                      ],\n                                                                      \"message\": \"\",\n                                                                      \"name\": \"Link2\",\n                                                                      \"status\": \"INLINED\",\n                                                                    },\n                                                                  ],\n                                                                  \"message\": \"\",\n                                                                  \"name\": \"AbstractButton3\",\n                                                                  \"status\": \"INLINED\",\n                                                                },\n                                                              ],\n                                                              \"message\": \"\",\n                                                              \"name\": \"XUIButton4\",\n                                                              \"status\": \"INLINED\",\n                                                            },\n                                                          ],\n                                                          \"message\": \"\",\n                                                          \"name\": \"AbstractPopoverButton5\",\n                                                          \"status\": \"INLINED\",\n                                                        },\n                                                      ],\n                                                      \"message\": \"\",\n                                                      \"name\": \"ReactXUIPopoverButton6\",\n                                                      \"status\": \"INLINED\",\n                                                    },\n                                                    Object {\n                                                      \"children\": Array [],\n                                                      \"message\": \"\",\n                                                      \"name\": \"Constructor49\",\n                                                      \"status\": \"INLINED\",\n                                                    },\n                                                    Object {\n                                                      \"children\": Array [],\n                                                      \"message\": \"\",\n                                                      \"name\": \"Constructor49\",\n                                                      \"status\": \"INLINED\",\n                                                    },\n                                                  ],\n                                                  \"message\": \"\",\n                                                  \"name\": \"AdsPEFiltersPopover58\",\n                                                  \"status\": \"INLINED\",\n                                                },\n                                                Object {\n                                                  \"children\": Array [\n                                                    Object {\n                                                      \"children\": Array [\n                                                        Object {\n                                                          \"children\": Array [],\n                                                          \"message\": \"\",\n                                                          \"name\": \"AbstractCheckboxInput59\",\n                                                          \"status\": \"INLINED\",\n                                                        },\n                                                      ],\n                                                      \"message\": \"\",\n                                                      \"name\": \"XUICheckboxInput60\",\n                                                      \"status\": \"INLINED\",\n                                                    },\n                                                  ],\n                                                  \"message\": \"\",\n                                                  \"name\": \"InputLabel61\",\n                                                  \"status\": \"INLINED\",\n                                                },\n                                                Object {\n                                                  \"children\": Array [\n                                                    Object {\n                                                      \"children\": Array [\n                                                        Object {\n                                                          \"children\": Array [],\n                                                          \"message\": \"\",\n                                                          \"name\": \"ReactImage0\",\n                                                          \"status\": \"INLINED\",\n                                                        },\n                                                        Object {\n                                                          \"children\": Array [\n                                                            Object {\n                                                              \"children\": Array [\n                                                                Object {\n                                                                  \"children\": Array [],\n                                                                  \"message\": \"\",\n                                                                  \"name\": \"AbstractButton3\",\n                                                                  \"status\": \"INLINED\",\n                                                                },\n                                                              ],\n                                                              \"message\": \"\",\n                                                              \"name\": \"XUIAbstractGlyphButton27\",\n                                                              \"status\": \"INLINED\",\n                                                            },\n                                                          ],\n                                                          \"message\": \"\",\n                                                          \"name\": \"XUICloseButton28\",\n                                                          \"status\": \"INLINED\",\n                                                        },\n                                                        Object {\n                                                          \"children\": Array [\n                                                            Object {\n                                                              \"children\": Array [],\n                                                              \"message\": \"\",\n                                                              \"name\": \"ReactImage0\",\n                                                              \"status\": \"INLINED\",\n                                                            },\n                                                            Object {\n                                                              \"children\": Array [\n                                                                Object {\n                                                                  \"children\": Array [\n                                                                    Object {\n                                                                      \"children\": Array [],\n                                                                      \"message\": \"\",\n                                                                      \"name\": \"ReactImage0\",\n                                                                      \"status\": \"INLINED\",\n                                                                    },\n                                                                  ],\n                                                                  \"message\": \"\",\n                                                                  \"name\": \"AdsPopoverLink62\",\n                                                                  \"status\": \"INLINED\",\n                                                                },\n                                                              ],\n                                                              \"message\": \"\",\n                                                              \"name\": \"AdsHelpLink63\",\n                                                              \"status\": \"INLINED\",\n                                                            },\n                                                            Object {\n                                                              \"children\": Array [\n                                                                Object {\n                                                                  \"children\": Array [],\n                                                                  \"message\": \"\",\n                                                                  \"name\": \"AbstractButton3\",\n                                                                  \"status\": \"INLINED\",\n                                                                },\n                                                              ],\n                                                              \"message\": \"\",\n                                                              \"name\": \"XUIButton4\",\n                                                              \"status\": \"INLINED\",\n                                                            },\n                                                          ],\n                                                          \"message\": \"\",\n                                                          \"name\": \"BUIFilterTokenInput64\",\n                                                          \"status\": \"INLINED\",\n                                                        },\n                                                      ],\n                                                      \"message\": \"\",\n                                                      \"name\": \"BUIFilterToken65\",\n                                                      \"status\": \"INLINED\",\n                                                    },\n                                                    Object {\n                                                      \"children\": Array [\n                                                        Object {\n                                                          \"children\": Array [\n                                                            Object {\n                                                              \"children\": Array [\n                                                                Object {\n                                                                  \"children\": Array [],\n                                                                  \"message\": \"\",\n                                                                  \"name\": \"ReactImage0\",\n                                                                  \"status\": \"INLINED\",\n                                                                },\n                                                              ],\n                                                              \"message\": \"\",\n                                                              \"name\": \"AbstractButton3\",\n                                                              \"status\": \"INLINED\",\n                                                            },\n                                                          ],\n                                                          \"message\": \"\",\n                                                          \"name\": \"XUIButton4\",\n                                                          \"status\": \"INLINED\",\n                                                        },\n                                                      ],\n                                                      \"message\": \"\",\n                                                      \"name\": \"BUIFilterTokenCreateButton66\",\n                                                      \"status\": \"INLINED\",\n                                                    },\n                                                  ],\n                                                  \"message\": \"\",\n                                                  \"name\": \"BUIFilterTokenizer67\",\n                                                  \"status\": \"INLINED\",\n                                                },\n                                                Object {\n                                                  \"children\": Array [\n                                                    Object {\n                                                      \"children\": Array [\n                                                        Object {\n                                                          \"children\": Array [],\n                                                          \"message\": \"\",\n                                                          \"name\": \"XUIAmbientNUX68\",\n                                                          \"status\": \"INLINED\",\n                                                        },\n                                                      ],\n                                                      \"message\": \"\",\n                                                      \"name\": \"XUIAmbientNUX69\",\n                                                      \"status\": \"INLINED\",\n                                                    },\n                                                  ],\n                                                  \"message\": \"\",\n                                                  \"name\": \"AdsPEAmbientNUXMegaphone70\",\n                                                  \"status\": \"INLINED\",\n                                                },\n                                              ],\n                                              \"message\": \"\",\n                                              \"name\": \"AdsPEFilters71\",\n                                              \"status\": \"INLINED\",\n                                            },\n                                          ],\n                                          \"message\": \"\",\n                                          \"name\": \"AdsPEFilterContainer72\",\n                                          \"status\": \"INLINED\",\n                                        },\n                                      ],\n                                      \"message\": \"\",\n                                      \"name\": \"ErrorBoundary9\",\n                                      \"status\": \"INLINED\",\n                                    },\n                                  ],\n                                  \"message\": \"\",\n                                  \"name\": \"AdsErrorBoundary10\",\n                                  \"status\": \"INLINED\",\n                                },\n                                Object {\n                                  \"children\": Array [\n                                    Object {\n                                      \"children\": Array [\n                                        Object {\n                                          \"children\": Array [\n                                            Object {\n                                              \"children\": Array [\n                                                Object {\n                                                  \"children\": Array [],\n                                                  \"message\": \"\",\n                                                  \"name\": \"AdsPETablePager73\",\n                                                  \"status\": \"INLINED\",\n                                                },\n                                              ],\n                                              \"message\": \"\",\n                                              \"name\": \"AdsPECampaignGroupTablePagerContainer74\",\n                                              \"status\": \"INLINED\",\n                                            },\n                                          ],\n                                          \"message\": \"\",\n                                          \"name\": \"AdsPETablePagerContainer75\",\n                                          \"status\": \"INLINED\",\n                                        },\n                                      ],\n                                      \"message\": \"\",\n                                      \"name\": \"ErrorBoundary9\",\n                                      \"status\": \"INLINED\",\n                                    },\n                                  ],\n                                  \"message\": \"\",\n                                  \"name\": \"AdsErrorBoundary10\",\n                                  \"status\": \"INLINED\",\n                                },\n                                Object {\n                                  \"children\": Array [\n                                    Object {\n                                      \"children\": Array [\n                                        Object {\n                                          \"children\": Array [\n                                            Object {\n                                              \"children\": Array [\n                                                Object {\n                                                  \"children\": Array [\n                                                    Object {\n                                                      \"children\": Array [\n                                                        Object {\n                                                          \"children\": Array [\n                                                            Object {\n                                                              \"children\": Array [\n                                                                Object {\n                                                                  \"children\": Array [\n                                                                    Object {\n                                                                      \"children\": Array [\n                                                                        Object {\n                                                                          \"children\": Array [\n                                                                            Object {\n                                                                              \"children\": Array [],\n                                                                              \"message\": \"\",\n                                                                              \"name\": \"ReactImage0\",\n                                                                              \"status\": \"INLINED\",\n                                                                            },\n                                                                          ],\n                                                                          \"message\": \"\",\n                                                                          \"name\": \"AbstractLink1\",\n                                                                          \"status\": \"INLINED\",\n                                                                        },\n                                                                      ],\n                                                                      \"message\": \"\",\n                                                                      \"name\": \"Link2\",\n                                                                      \"status\": \"INLINED\",\n                                                                    },\n                                                                  ],\n                                                                  \"message\": \"\",\n                                                                  \"name\": \"AbstractButton3\",\n                                                                  \"status\": \"INLINED\",\n                                                                },\n                                                              ],\n                                                              \"message\": \"\",\n                                                              \"name\": \"ReactXUIError76\",\n                                                              \"status\": \"INLINED\",\n                                                            },\n                                                          ],\n                                                          \"message\": \"\",\n                                                          \"name\": \"BUIPopoverButton77\",\n                                                          \"status\": \"INLINED\",\n                                                        },\n                                                        Object {\n                                                          \"children\": Array [],\n                                                          \"message\": \"\",\n                                                          \"name\": \"Constructor49\",\n                                                          \"status\": \"INLINED\",\n                                                        },\n                                                      ],\n                                                      \"message\": \"\",\n                                                      \"name\": \"BUIDateRangePicker78\",\n                                                      \"status\": \"INLINED\",\n                                                    },\n                                                  ],\n                                                  \"message\": \"\",\n                                                  \"name\": \"AdsPEStatsRangePicker79\",\n                                                  \"status\": \"INLINED\",\n                                                },\n                                                Object {\n                                                  \"children\": Array [\n                                                    Object {\n                                                      \"children\": Array [\n                                                        Object {\n                                                          \"children\": Array [],\n                                                          \"message\": \"\",\n                                                          \"name\": \"ReactImage0\",\n                                                          \"status\": \"INLINED\",\n                                                        },\n                                                      ],\n                                                      \"message\": \"\",\n                                                      \"name\": \"AbstractButton3\",\n                                                      \"status\": \"INLINED\",\n                                                    },\n                                                  ],\n                                                  \"message\": \"\",\n                                                  \"name\": \"XUIButton4\",\n                                                  \"status\": \"INLINED\",\n                                                },\n                                                Object {\n                                                  \"children\": Array [\n                                                    Object {\n                                                      \"children\": Array [],\n                                                      \"message\": \"\",\n                                                      \"name\": \"XUIAmbientNUX68\",\n                                                      \"status\": \"INLINED\",\n                                                    },\n                                                  ],\n                                                  \"message\": \"\",\n                                                  \"name\": \"XUIAmbientNUX69\",\n                                                  \"status\": \"INLINED\",\n                                                },\n                                              ],\n                                              \"message\": \"\",\n                                              \"name\": \"AdsPEStatRange80\",\n                                              \"status\": \"INLINED\",\n                                            },\n                                          ],\n                                          \"message\": \"\",\n                                          \"name\": \"AdsPEStatRangeContainer81\",\n                                          \"status\": \"INLINED\",\n                                        },\n                                      ],\n                                      \"message\": \"\",\n                                      \"name\": \"ErrorBoundary9\",\n                                      \"status\": \"INLINED\",\n                                    },\n                                  ],\n                                  \"message\": \"\",\n                                  \"name\": \"AdsErrorBoundary10\",\n                                  \"status\": \"INLINED\",\n                                },\n                                Object {\n                                  \"children\": Array [\n                                    Object {\n                                      \"children\": Array [\n                                        Object {\n                                          \"children\": Array [\n                                            Object {\n                                              \"children\": Array [\n                                                Object {\n                                                  \"children\": Array [\n                                                    Object {\n                                                      \"children\": Array [\n                                                        Object {\n                                                          \"children\": Array [],\n                                                          \"message\": \"\",\n                                                          \"name\": \"ReactImage0\",\n                                                          \"status\": \"INLINED\",\n                                                        },\n                                                      ],\n                                                      \"message\": \"\",\n                                                      \"name\": \"AdsPESideTrayTabButton82\",\n                                                      \"status\": \"INLINED\",\n                                                    },\n                                                  ],\n                                                  \"message\": \"\",\n                                                  \"name\": \"AdsPEEditorTrayTabButton83\",\n                                                  \"status\": \"INLINED\",\n                                                },\n                                                Object {\n                                                  \"children\": Array [\n                                                    Object {\n                                                      \"children\": Array [\n                                                        Object {\n                                                          \"children\": Array [],\n                                                          \"message\": \"\",\n                                                          \"name\": \"ReactImage0\",\n                                                          \"status\": \"INLINED\",\n                                                        },\n                                                      ],\n                                                      \"message\": \"\",\n                                                      \"name\": \"AdsPESideTrayTabButton82\",\n                                                      \"status\": \"INLINED\",\n                                                    },\n                                                    Object {\n                                                      \"children\": Array [\n                                                        Object {\n                                                          \"children\": Array [],\n                                                          \"message\": \"\",\n                                                          \"name\": \"XUIAmbientNUX68\",\n                                                          \"status\": \"INLINED\",\n                                                        },\n                                                      ],\n                                                      \"message\": \"\",\n                                                      \"name\": \"XUIAmbientNUX69\",\n                                                      \"status\": \"INLINED\",\n                                                    },\n                                                  ],\n                                                  \"message\": \"\",\n                                                  \"name\": \"AdsPEInsightsTrayTabButton84\",\n                                                  \"status\": \"INLINED\",\n                                                },\n                                                Object {\n                                                  \"children\": Array [\n                                                    Object {\n                                                      \"children\": Array [],\n                                                      \"message\": \"\",\n                                                      \"name\": \"AdsPESideTrayTabButton82\",\n                                                      \"status\": \"INLINED\",\n                                                    },\n                                                  ],\n                                                  \"message\": \"\",\n                                                  \"name\": \"AdsPENekoDebuggerTrayTabButton85\",\n                                                  \"status\": \"INLINED\",\n                                                },\n                                                Object {\n                                                  \"children\": Array [\n                                                    Object {\n                                                      \"children\": Array [\n                                                        Object {\n                                                          \"children\": Array [\n                                                            Object {\n                                                              \"children\": Array [\n                                                                Object {\n                                                                  \"children\": Array [\n                                                                    Object {\n                                                                      \"children\": Array [\n                                                                        Object {\n                                                                          \"children\": Array [],\n                                                                          \"message\": \"\",\n                                                                          \"name\": \"XUIText29\",\n                                                                          \"status\": \"INLINED\",\n                                                                        },\n                                                                        Object {\n                                                                          \"children\": Array [],\n                                                                          \"message\": \"\",\n                                                                          \"name\": \"XUIText29\",\n                                                                          \"status\": \"INLINED\",\n                                                                        },\n                                                                        Object {\n                                                                          \"children\": Array [\n                                                                            Object {\n                                                                              \"children\": Array [\n                                                                                Object {\n                                                                                  \"children\": Array [\n                                                                                    Object {\n                                                                                      \"children\": Array [],\n                                                                                      \"message\": \"\",\n                                                                                      \"name\": \"AbstractLink1\",\n                                                                                      \"status\": \"INLINED\",\n                                                                                    },\n                                                                                  ],\n                                                                                  \"message\": \"\",\n                                                                                  \"name\": \"Link2\",\n                                                                                  \"status\": \"INLINED\",\n                                                                                },\n                                                                                Object {\n                                                                                  \"children\": Array [\n                                                                                    Object {\n                                                                                      \"children\": Array [],\n                                                                                      \"message\": \"\",\n                                                                                      \"name\": \"AbstractLink1\",\n                                                                                      \"status\": \"INLINED\",\n                                                                                    },\n                                                                                  ],\n                                                                                  \"message\": \"\",\n                                                                                  \"name\": \"Link2\",\n                                                                                  \"status\": \"INLINED\",\n                                                                                },\n                                                                              ],\n                                                                              \"message\": \"\",\n                                                                              \"name\": \"AdsPEEditorChildLink86\",\n                                                                              \"status\": \"INLINED\",\n                                                                            },\n                                                                          ],\n                                                                          \"message\": \"\",\n                                                                          \"name\": \"AdsPEEditorChildLinkContainer87\",\n                                                                          \"status\": \"INLINED\",\n                                                                        },\n                                                                      ],\n                                                                      \"message\": \"\",\n                                                                      \"name\": \"AdsPEHeaderSection88\",\n                                                                      \"status\": \"INLINED\",\n                                                                    },\n                                                                  ],\n                                                                  \"message\": \"\",\n                                                                  \"name\": \"AdsPECampaignGroupHeaderSectionContainer89\",\n                                                                  \"status\": \"INLINED\",\n                                                                },\n                                                                Object {\n                                                                  \"children\": Array [\n                                                                    Object {\n                                                                      \"children\": Array [],\n                                                                      \"message\": \"\",\n                                                                      \"name\": \"AdsEditorLoadingErrors90\",\n                                                                      \"status\": \"INLINED\",\n                                                                    },\n                                                                    Object {\n                                                                      \"children\": Array [\n                                                                        Object {\n                                                                          \"children\": Array [\n                                                                            Object {\n                                                                              \"children\": Array [\n                                                                                Object {\n                                                                                  \"children\": Array [\n                                                                                    Object {\n                                                                                      \"children\": Array [\n                                                                                        Object {\n                                                                                          \"children\": Array [\n                                                                                            Object {\n                                                                                              \"children\": Array [\n                                                                                                Object {\n                                                                                                  \"children\": Array [\n                                                                                                    Object {\n                                                                                                      \"children\": Array [\n                                                                                                        Object {\n                                                                                                          \"children\": Array [\n                                                                                                            Object {\n                                                                                                              \"children\": Array [\n                                                                                                                Object {\n                                                                                                                  \"children\": Array [],\n                                                                                                                  \"message\": \"\",\n                                                                                                                  \"name\": \"ReactXUIError76\",\n                                                                                                                  \"status\": \"INLINED\",\n                                                                                                                },\n                                                                                                              ],\n                                                                                                              \"message\": \"\",\n                                                                                                              \"name\": \"AdsTextInput91\",\n                                                                                                              \"status\": \"INLINED\",\n                                                                                                            },\n                                                                                                          ],\n                                                                                                          \"message\": \"\",\n                                                                                                          \"name\": \"BUIFormElement92\",\n                                                                                                          \"status\": \"INLINED\",\n                                                                                                        },\n                                                                                                      ],\n                                                                                                      \"message\": \"\",\n                                                                                                      \"name\": \"BUIForm93\",\n                                                                                                      \"status\": \"INLINED\",\n                                                                                                    },\n                                                                                                  ],\n                                                                                                  \"message\": \"\",\n                                                                                                  \"name\": \"XUICard94\",\n                                                                                                  \"status\": \"INLINED\",\n                                                                                                },\n                                                                                              ],\n                                                                                              \"message\": \"\",\n                                                                                              \"name\": \"ReactXUIError76\",\n                                                                                              \"status\": \"INLINED\",\n                                                                                            },\n                                                                                          ],\n                                                                                          \"message\": \"\",\n                                                                                          \"name\": \"AdsCard95\",\n                                                                                          \"status\": \"INLINED\",\n                                                                                        },\n                                                                                      ],\n                                                                                      \"message\": \"\",\n                                                                                      \"name\": \"AdsEditorNameSection96\",\n                                                                                      \"status\": \"INLINED\",\n                                                                                    },\n                                                                                  ],\n                                                                                  \"message\": \"\",\n                                                                                  \"name\": \"AdsCampaignGroupNameSectionContainer97\",\n                                                                                  \"status\": \"INLINED\",\n                                                                                },\n                                                                              ],\n                                                                              \"message\": \"\",\n                                                                              \"name\": \"_render98\",\n                                                                              \"status\": \"INLINED\",\n                                                                            },\n                                                                          ],\n                                                                          \"message\": \"\",\n                                                                          \"name\": \"AdsPluginWrapper99\",\n                                                                          \"status\": \"INLINED\",\n                                                                        },\n                                                                        Object {\n                                                                          \"children\": Array [\n                                                                            Object {\n                                                                              \"children\": Array [\n                                                                                Object {\n                                                                                  \"children\": Array [\n                                                                                    Object {\n                                                                                      \"children\": Array [\n                                                                                        Object {\n                                                                                          \"children\": Array [\n                                                                                            Object {\n                                                                                              \"children\": Array [\n                                                                                                Object {\n                                                                                                  \"children\": Array [\n                                                                                                    Object {\n                                                                                                      \"children\": Array [\n                                                                                                        Object {\n                                                                                                          \"children\": Array [\n                                                                                                            Object {\n                                                                                                              \"children\": Array [\n                                                                                                                Object {\n                                                                                                                  \"children\": Array [],\n                                                                                                                  \"message\": \"\",\n                                                                                                                  \"name\": \"XUICardHeaderTitle100\",\n                                                                                                                  \"status\": \"INLINED\",\n                                                                                                                },\n                                                                                                              ],\n                                                                                                              \"message\": \"\",\n                                                                                                              \"name\": \"XUICardSection101\",\n                                                                                                              \"status\": \"INLINED\",\n                                                                                                            },\n                                                                                                          ],\n                                                                                                          \"message\": \"\",\n                                                                                                          \"name\": \"XUICardHeader102\",\n                                                                                                          \"status\": \"INLINED\",\n                                                                                                        },\n                                                                                                      ],\n                                                                                                      \"message\": \"\",\n                                                                                                      \"name\": \"AdsCardHeader103\",\n                                                                                                      \"status\": \"INLINED\",\n                                                                                                    },\n                                                                                                    Object {\n                                                                                                      \"children\": Array [\n                                                                                                        Object {\n                                                                                                          \"children\": Array [\n                                                                                                            Object {\n                                                                                                              \"children\": Array [\n                                                                                                                Object {\n                                                                                                                  \"children\": Array [\n                                                                                                                    Object {\n                                                                                                                      \"children\": Array [],\n                                                                                                                      \"message\": \"\",\n                                                                                                                      \"name\": \"AdsLabeledField104\",\n                                                                                                                      \"status\": \"INLINED\",\n                                                                                                                    },\n                                                                                                                  ],\n                                                                                                                  \"message\": \"\",\n                                                                                                                  \"name\": \"LeftRight21\",\n                                                                                                                  \"status\": \"INLINED\",\n                                                                                                                },\n                                                                                                              ],\n                                                                                                              \"message\": \"\",\n                                                                                                              \"name\": \"FlexibleBlock105\",\n                                                                                                              \"status\": \"INLINED\",\n                                                                                                            },\n                                                                                                            Object {\n                                                                                                              \"children\": Array [\n                                                                                                                Object {\n                                                                                                                  \"children\": Array [\n                                                                                                                    Object {\n                                                                                                                      \"children\": Array [],\n                                                                                                                      \"message\": \"\",\n                                                                                                                      \"name\": \"AdsLabeledField104\",\n                                                                                                                      \"status\": \"INLINED\",\n                                                                                                                    },\n                                                                                                                  ],\n                                                                                                                  \"message\": \"\",\n                                                                                                                  \"name\": \"LeftRight21\",\n                                                                                                                  \"status\": \"INLINED\",\n                                                                                                                },\n                                                                                                              ],\n                                                                                                              \"message\": \"\",\n                                                                                                              \"name\": \"FlexibleBlock105\",\n                                                                                                              \"status\": \"INLINED\",\n                                                                                                            },\n                                                                                                            Object {\n                                                                                                              \"children\": Array [\n                                                                                                                Object {\n                                                                                                                  \"children\": Array [\n                                                                                                                    Object {\n                                                                                                                      \"children\": Array [\n                                                                                                                        Object {\n                                                                                                                          \"children\": Array [\n                                                                                                                            Object {\n                                                                                                                              \"children\": Array [\n                                                                                                                                Object {\n                                                                                                                                  \"children\": Array [],\n                                                                                                                                  \"message\": \"\",\n                                                                                                                                  \"name\": \"ReactImage0\",\n                                                                                                                                  \"status\": \"INLINED\",\n                                                                                                                                },\n                                                                                                                              ],\n                                                                                                                              \"message\": \"\",\n                                                                                                                              \"name\": \"AdsPopoverLink62\",\n                                                                                                                              \"status\": \"INLINED\",\n                                                                                                                            },\n                                                                                                                          ],\n                                                                                                                          \"message\": \"\",\n                                                                                                                          \"name\": \"AdsHelpLink63\",\n                                                                                                                          \"status\": \"INLINED\",\n                                                                                                                        },\n                                                                                                                      ],\n                                                                                                                      \"message\": \"\",\n                                                                                                                      \"name\": \"AdsLabeledField104\",\n                                                                                                                      \"status\": \"INLINED\",\n                                                                                                                    },\n                                                                                                                    Object {\n                                                                                                                      \"children\": Array [\n                                                                                                                        Object {\n                                                                                                                          \"children\": Array [\n                                                                                                                            Object {\n                                                                                                                              \"children\": Array [\n                                                                                                                                Object {\n                                                                                                                                  \"children\": Array [],\n                                                                                                                                  \"message\": \"\",\n                                                                                                                                  \"name\": \"AbstractLink1\",\n                                                                                                                                  \"status\": \"INLINED\",\n                                                                                                                                },\n                                                                                                                              ],\n                                                                                                                              \"message\": \"\",\n                                                                                                                              \"name\": \"Link2\",\n                                                                                                                              \"status\": \"INLINED\",\n                                                                                                                            },\n                                                                                                                          ],\n                                                                                                                          \"message\": \"\",\n                                                                                                                          \"name\": \"AdsBulkCampaignSpendCapField106\",\n                                                                                                                          \"status\": \"INLINED\",\n                                                                                                                        },\n                                                                                                                      ],\n                                                                                                                      \"message\": \"\",\n                                                                                                                      \"name\": \"FluxContainer_AdsCampaignGroupSpendCapContainer_107\",\n                                                                                                                      \"status\": \"INLINED\",\n                                                                                                                    },\n                                                                                                                  ],\n                                                                                                                  \"message\": \"\",\n                                                                                                                  \"name\": \"LeftRight21\",\n                                                                                                                  \"status\": \"INLINED\",\n                                                                                                                },\n                                                                                                              ],\n                                                                                                              \"message\": \"\",\n                                                                                                              \"name\": \"FlexibleBlock105\",\n                                                                                                              \"status\": \"INLINED\",\n                                                                                                            },\n                                                                                                          ],\n                                                                                                          \"message\": \"\",\n                                                                                                          \"name\": \"XUICardSection101\",\n                                                                                                          \"status\": \"INLINED\",\n                                                                                                        },\n                                                                                                      ],\n                                                                                                      \"message\": \"\",\n                                                                                                      \"name\": \"AdsCardSection108\",\n                                                                                                      \"status\": \"INLINED\",\n                                                                                                    },\n                                                                                                  ],\n                                                                                                  \"message\": \"\",\n                                                                                                  \"name\": \"XUICard94\",\n                                                                                                  \"status\": \"INLINED\",\n                                                                                                },\n                                                                                              ],\n                                                                                              \"message\": \"\",\n                                                                                              \"name\": \"ReactXUIError76\",\n                                                                                              \"status\": \"INLINED\",\n                                                                                            },\n                                                                                          ],\n                                                                                          \"message\": \"\",\n                                                                                          \"name\": \"AdsCard95\",\n                                                                                          \"status\": \"INLINED\",\n                                                                                        },\n                                                                                      ],\n                                                                                      \"message\": \"\",\n                                                                                      \"name\": \"AdsEditorCampaignGroupDetailsSection109\",\n                                                                                      \"status\": \"INLINED\",\n                                                                                    },\n                                                                                  ],\n                                                                                  \"message\": \"\",\n                                                                                  \"name\": \"AdsEditorCampaignGroupDetailsSectionContainer110\",\n                                                                                  \"status\": \"INLINED\",\n                                                                                },\n                                                                              ],\n                                                                              \"message\": \"\",\n                                                                              \"name\": \"_render111\",\n                                                                              \"status\": \"INLINED\",\n                                                                            },\n                                                                          ],\n                                                                          \"message\": \"\",\n                                                                          \"name\": \"AdsPluginWrapper99\",\n                                                                          \"status\": \"INLINED\",\n                                                                        },\n                                                                        Object {\n                                                                          \"children\": Array [\n                                                                            Object {\n                                                                              \"children\": Array [\n                                                                                Object {\n                                                                                  \"children\": Array [],\n                                                                                  \"message\": \"\",\n                                                                                  \"name\": \"FluxContainer_AdsEditorToplineDetailsSectionContainer_112\",\n                                                                                  \"status\": \"INLINED\",\n                                                                                },\n                                                                              ],\n                                                                              \"message\": \"\",\n                                                                              \"name\": \"_render113\",\n                                                                              \"status\": \"INLINED\",\n                                                                            },\n                                                                          ],\n                                                                          \"message\": \"\",\n                                                                          \"name\": \"AdsPluginWrapper99\",\n                                                                          \"status\": \"INLINED\",\n                                                                        },\n                                                                        Object {\n                                                                          \"children\": Array [],\n                                                                          \"message\": \"\",\n                                                                          \"name\": \"AdsStickyArea114\",\n                                                                          \"status\": \"INLINED\",\n                                                                        },\n                                                                      ],\n                                                                      \"message\": \"\",\n                                                                      \"name\": \"FluxContainer_AdsEditorColumnContainer_115\",\n                                                                      \"status\": \"INLINED\",\n                                                                    },\n                                                                    Object {\n                                                                      \"children\": Array [\n                                                                        Object {\n                                                                          \"children\": Array [\n                                                                            Object {\n                                                                              \"children\": Array [\n                                                                                Object {\n                                                                                  \"children\": Array [\n                                                                                    Object {\n                                                                                      \"children\": Array [\n                                                                                        Object {\n                                                                                          \"children\": Array [\n                                                                                            Object {\n                                                                                              \"children\": Array [\n                                                                                                Object {\n                                                                                                  \"children\": Array [\n                                                                                                    Object {\n                                                                                                      \"children\": Array [\n                                                                                                        Object {\n                                                                                                          \"children\": Array [\n                                                                                                            Object {\n                                                                                                              \"children\": Array [\n                                                                                                                Object {\n                                                                                                                  \"children\": Array [\n                                                                                                                    Object {\n                                                                                                                      \"children\": Array [\n                                                                                                                        Object {\n                                                                                                                          \"children\": Array [\n                                                                                                                            Object {\n                                                                                                                              \"children\": Array [\n                                                                                                                                Object {\n                                                                                                                                  \"children\": Array [\n                                                                                                                                    Object {\n                                                                                                                                      \"children\": Array [],\n                                                                                                                                      \"message\": \"\",\n                                                                                                                                      \"name\": \"BUISwitch116\",\n                                                                                                                                      \"status\": \"INLINED\",\n                                                                                                                                    },\n                                                                                                                                  ],\n                                                                                                                                  \"message\": \"\",\n                                                                                                                                  \"name\": \"AdsStatusSwitchInternal117\",\n                                                                                                                                  \"status\": \"INLINED\",\n                                                                                                                                },\n                                                                                                                              ],\n                                                                                                                              \"message\": \"\",\n                                                                                                                              \"name\": \"AdsStatusSwitch118\",\n                                                                                                                              \"status\": \"INLINED\",\n                                                                                                                            },\n                                                                                                                          ],\n                                                                                                                          \"message\": \"\",\n                                                                                                                          \"name\": \"FluxContainer_AdsCampaignGroupStatusSwitchContainer_119\",\n                                                                                                                          \"status\": \"INLINED\",\n                                                                                                                        },\n                                                                                                                      ],\n                                                                                                                      \"message\": \"\",\n                                                                                                                      \"name\": \"XUICardHeaderTitle100\",\n                                                                                                                      \"status\": \"INLINED\",\n                                                                                                                    },\n                                                                                                                    Object {\n                                                                                                                      \"children\": Array [\n                                                                                                                        Object {\n                                                                                                                          \"children\": Array [\n                                                                                                                            Object {\n                                                                                                                              \"children\": Array [\n                                                                                                                                Object {\n                                                                                                                                  \"children\": Array [\n                                                                                                                                    Object {\n                                                                                                                                      \"children\": Array [\n                                                                                                                                        Object {\n                                                                                                                                          \"children\": Array [\n                                                                                                                                            Object {\n                                                                                                                                              \"children\": Array [\n                                                                                                                                                Object {\n                                                                                                                                                  \"children\": Array [\n                                                                                                                                                    Object {\n                                                                                                                                                      \"children\": Array [\n                                                                                                                                                        Object {\n                                                                                                                                                          \"children\": Array [\n                                                                                                                                                            Object {\n                                                                                                                                                              \"children\": Array [],\n                                                                                                                                                              \"message\": \"\",\n                                                                                                                                                              \"name\": \"ReactImage0\",\n                                                                                                                                                              \"status\": \"INLINED\",\n                                                                                                                                                            },\n                                                                                                                                                          ],\n                                                                                                                                                          \"message\": \"\",\n                                                                                                                                                          \"name\": \"AbstractLink1\",\n                                                                                                                                                          \"status\": \"INLINED\",\n                                                                                                                                                        },\n                                                                                                                                                      ],\n                                                                                                                                                      \"message\": \"\",\n                                                                                                                                                      \"name\": \"Link2\",\n                                                                                                                                                      \"status\": \"INLINED\",\n                                                                                                                                                    },\n                                                                                                                                                  ],\n                                                                                                                                                  \"message\": \"\",\n                                                                                                                                                  \"name\": \"AbstractButton3\",\n                                                                                                                                                  \"status\": \"INLINED\",\n                                                                                                                                                },\n                                                                                                                                              ],\n                                                                                                                                              \"message\": \"\",\n                                                                                                                                              \"name\": \"XUIButton4\",\n                                                                                                                                              \"status\": \"INLINED\",\n                                                                                                                                            },\n                                                                                                                                          ],\n                                                                                                                                          \"message\": \"\",\n                                                                                                                                          \"name\": \"AbstractPopoverButton5\",\n                                                                                                                                          \"status\": \"INLINED\",\n                                                                                                                                        },\n                                                                                                                                      ],\n                                                                                                                                      \"message\": \"\",\n                                                                                                                                      \"name\": \"ReactXUIPopoverButton6\",\n                                                                                                                                      \"status\": \"INLINED\",\n                                                                                                                                    },\n                                                                                                                                  ],\n                                                                                                                                  \"message\": \"\",\n                                                                                                                                  \"name\": \"InlineBlock19\",\n                                                                                                                                  \"status\": \"INLINED\",\n                                                                                                                                },\n                                                                                                                              ],\n                                                                                                                              \"message\": \"\",\n                                                                                                                              \"name\": \"ReactPopoverMenu20\",\n                                                                                                                              \"status\": \"INLINED\",\n                                                                                                                            },\n                                                                                                                          ],\n                                                                                                                          \"message\": \"\",\n                                                                                                                          \"name\": \"AdsLinksMenu120\",\n                                                                                                                          \"status\": \"INLINED\",\n                                                                                                                        },\n                                                                                                                      ],\n                                                                                                                      \"message\": \"\",\n                                                                                                                      \"name\": \"FluxContainer_AdsPluginizedLinksMenuContainer_121\",\n                                                                                                                      \"status\": \"INLINED\",\n                                                                                                                    },\n                                                                                                                  ],\n                                                                                                                  \"message\": \"\",\n                                                                                                                  \"name\": \"LeftRight21\",\n                                                                                                                  \"status\": \"INLINED\",\n                                                                                                                },\n                                                                                                              ],\n                                                                                                              \"message\": \"\",\n                                                                                                              \"name\": \"AdsCardLeftRightHeader122\",\n                                                                                                              \"status\": \"INLINED\",\n                                                                                                            },\n                                                                                                          ],\n                                                                                                          \"message\": \"\",\n                                                                                                          \"name\": \"XUICard94\",\n                                                                                                          \"status\": \"INLINED\",\n                                                                                                        },\n                                                                                                      ],\n                                                                                                      \"message\": \"\",\n                                                                                                      \"name\": \"ReactXUIError76\",\n                                                                                                      \"status\": \"INLINED\",\n                                                                                                    },\n                                                                                                  ],\n                                                                                                  \"message\": \"\",\n                                                                                                  \"name\": \"AdsCard95\",\n                                                                                                  \"status\": \"INLINED\",\n                                                                                                },\n                                                                                              ],\n                                                                                              \"message\": \"\",\n                                                                                              \"name\": \"AdsPEIDSection123\",\n                                                                                              \"status\": \"INLINED\",\n                                                                                            },\n                                                                                          ],\n                                                                                          \"message\": \"\",\n                                                                                          \"name\": \"FluxContainer_AdsPECampaignGroupIDSectionContainer_124\",\n                                                                                          \"status\": \"INLINED\",\n                                                                                        },\n                                                                                      ],\n                                                                                      \"message\": \"\",\n                                                                                      \"name\": \"DeferredComponent125\",\n                                                                                      \"status\": \"INLINED\",\n                                                                                    },\n                                                                                  ],\n                                                                                  \"message\": \"\",\n                                                                                  \"name\": \"BootloadedComponent126\",\n                                                                                  \"status\": \"INLINED\",\n                                                                                },\n                                                                              ],\n                                                                              \"message\": \"\",\n                                                                              \"name\": \"_render127\",\n                                                                              \"status\": \"INLINED\",\n                                                                            },\n                                                                          ],\n                                                                          \"message\": \"\",\n                                                                          \"name\": \"AdsPluginWrapper99\",\n                                                                          \"status\": \"INLINED\",\n                                                                        },\n                                                                        Object {\n                                                                          \"children\": Array [\n                                                                            Object {\n                                                                              \"children\": Array [\n                                                                                Object {\n                                                                                  \"children\": Array [\n                                                                                    Object {\n                                                                                      \"children\": Array [\n                                                                                        Object {\n                                                                                          \"children\": Array [],\n                                                                                          \"message\": \"\",\n                                                                                          \"name\": \"AdsEditorErrorsCard128\",\n                                                                                          \"status\": \"INLINED\",\n                                                                                        },\n                                                                                      ],\n                                                                                      \"message\": \"\",\n                                                                                      \"name\": \"FluxContainer_FunctionalContainer_129\",\n                                                                                      \"status\": \"INLINED\",\n                                                                                    },\n                                                                                  ],\n                                                                                  \"message\": \"\",\n                                                                                  \"name\": \"_render130\",\n                                                                                  \"status\": \"INLINED\",\n                                                                                },\n                                                                              ],\n                                                                              \"message\": \"\",\n                                                                              \"name\": \"AdsPluginWrapper99\",\n                                                                              \"status\": \"INLINED\",\n                                                                            },\n                                                                          ],\n                                                                          \"message\": \"\",\n                                                                          \"name\": \"AdsStickyArea114\",\n                                                                          \"status\": \"INLINED\",\n                                                                        },\n                                                                      ],\n                                                                      \"message\": \"\",\n                                                                      \"name\": \"FluxContainer_AdsEditorColumnContainer_115\",\n                                                                      \"status\": \"INLINED\",\n                                                                    },\n                                                                  ],\n                                                                  \"message\": \"\",\n                                                                  \"name\": \"AdsEditorMultiColumnLayout131\",\n                                                                  \"status\": \"INLINED\",\n                                                                },\n                                                              ],\n                                                              \"message\": \"\",\n                                                              \"name\": \"AdsPECampaignGroupEditor132\",\n                                                              \"status\": \"INLINED\",\n                                                            },\n                                                          ],\n                                                          \"message\": \"\",\n                                                          \"name\": \"AdsPECampaignGroupEditorContainer133\",\n                                                          \"status\": \"INLINED\",\n                                                        },\n                                                      ],\n                                                      \"message\": \"\",\n                                                      \"name\": \"AdsPESideTrayTabContent134\",\n                                                      \"status\": \"INLINED\",\n                                                    },\n                                                  ],\n                                                  \"message\": \"\",\n                                                  \"name\": \"AdsPEEditorTrayTabContentContainer135\",\n                                                  \"status\": \"INLINED\",\n                                                },\n                                              ],\n                                              \"message\": \"\",\n                                              \"name\": \"AdsPEMultiTabDrawer136\",\n                                              \"status\": \"INLINED\",\n                                            },\n                                          ],\n                                          \"message\": \"\",\n                                          \"name\": \"FluxContainer_AdsPEMultiTabDrawerContainer_137\",\n                                          \"status\": \"INLINED\",\n                                        },\n                                      ],\n                                      \"message\": \"\",\n                                      \"name\": \"ErrorBoundary9\",\n                                      \"status\": \"INLINED\",\n                                    },\n                                  ],\n                                  \"message\": \"\",\n                                  \"name\": \"AdsErrorBoundary10\",\n                                  \"status\": \"INLINED\",\n                                },\n                                Object {\n                                  \"children\": Array [\n                                    Object {\n                                      \"children\": Array [\n                                        Object {\n                                          \"children\": Array [\n                                            Object {\n                                              \"children\": Array [\n                                                Object {\n                                                  \"children\": Array [\n                                                    Object {\n                                                      \"children\": Array [],\n                                                      \"message\": \"\",\n                                                      \"name\": \"AbstractButton3\",\n                                                      \"status\": \"INLINED\",\n                                                    },\n                                                  ],\n                                                  \"message\": \"\",\n                                                  \"name\": \"XUIButton4\",\n                                                  \"status\": \"INLINED\",\n                                                },\n                                                Object {\n                                                  \"children\": Array [\n                                                    Object {\n                                                      \"children\": Array [],\n                                                      \"message\": \"\",\n                                                      \"name\": \"AbstractButton3\",\n                                                      \"status\": \"INLINED\",\n                                                    },\n                                                  ],\n                                                  \"message\": \"\",\n                                                  \"name\": \"XUIButton4\",\n                                                  \"status\": \"INLINED\",\n                                                },\n                                                Object {\n                                                  \"children\": Array [\n                                                    Object {\n                                                      \"children\": Array [],\n                                                      \"message\": \"\",\n                                                      \"name\": \"AbstractButton3\",\n                                                      \"status\": \"INLINED\",\n                                                    },\n                                                  ],\n                                                  \"message\": \"\",\n                                                  \"name\": \"XUIButton4\",\n                                                  \"status\": \"INLINED\",\n                                                },\n                                              ],\n                                              \"message\": \"\",\n                                              \"name\": \"AdsPESimpleOrganizer138\",\n                                              \"status\": \"INLINED\",\n                                            },\n                                          ],\n                                          \"message\": \"\",\n                                          \"name\": \"AdsPEOrganizerContainer139\",\n                                          \"status\": \"INLINED\",\n                                        },\n                                      ],\n                                      \"message\": \"\",\n                                      \"name\": \"ErrorBoundary9\",\n                                      \"status\": \"INLINED\",\n                                    },\n                                  ],\n                                  \"message\": \"\",\n                                  \"name\": \"AdsErrorBoundary10\",\n                                  \"status\": \"INLINED\",\n                                },\n                                Object {\n                                  \"children\": Array [\n                                    Object {\n                                      \"children\": Array [\n                                        Object {\n                                          \"children\": Array [\n                                            Object {\n                                              \"children\": Array [\n                                                Object {\n                                                  \"children\": Array [\n                                                    Object {\n                                                      \"children\": Array [\n                                                        Object {\n                                                          \"children\": Array [\n                                                            Object {\n                                                              \"children\": Array [\n                                                                Object {\n                                                                  \"children\": Array [\n                                                                    Object {\n                                                                      \"children\": Array [\n                                                                        Object {\n                                                                          \"children\": Array [],\n                                                                          \"message\": \"\",\n                                                                          \"name\": \"FixedDataTableColumnResizeHandle140\",\n                                                                          \"status\": \"INLINED\",\n                                                                        },\n                                                                        Object {\n                                                                          \"children\": Array [\n                                                                            Object {\n                                                                              \"children\": Array [\n                                                                                Object {\n                                                                                  \"children\": Array [\n                                                                                    Object {\n                                                                                      \"children\": Array [\n                                                                                        Object {\n                                                                                          \"children\": Array [\n                                                                                            Object {\n                                                                                              \"children\": Array [\n                                                                                                Object {\n                                                                                                  \"children\": Array [\n                                                                                                    Object {\n                                                                                                      \"children\": Array [],\n                                                                                                      \"message\": \"\",\n                                                                                                      \"name\": \"ReactImage0\",\n                                                                                                      \"status\": \"INLINED\",\n                                                                                                    },\n                                                                                                  ],\n                                                                                                  \"message\": \"\",\n                                                                                                  \"name\": \"AdsPETableHeader141\",\n                                                                                                  \"status\": \"INLINED\",\n                                                                                                },\n                                                                                              ],\n                                                                                              \"message\": \"\",\n                                                                                              \"name\": \"TransitionCell142\",\n                                                                                              \"status\": \"INLINED\",\n                                                                                            },\n                                                                                          ],\n                                                                                          \"message\": \"\",\n                                                                                          \"name\": \"FixedDataTableCell143\",\n                                                                                          \"status\": \"INLINED\",\n                                                                                        },\n                                                                                      ],\n                                                                                      \"message\": \"\",\n                                                                                      \"name\": \"FixedDataTableCellGroupImpl144\",\n                                                                                      \"status\": \"INLINED\",\n                                                                                    },\n                                                                                  ],\n                                                                                  \"message\": \"\",\n                                                                                  \"name\": \"FixedDataTableCellGroup145\",\n                                                                                  \"status\": \"INLINED\",\n                                                                                },\n                                                                                Object {\n                                                                                  \"children\": Array [\n                                                                                    Object {\n                                                                                      \"children\": Array [\n                                                                                        Object {\n                                                                                          \"children\": Array [\n                                                                                            Object {\n                                                                                              \"children\": Array [\n                                                                                                Object {\n                                                                                                  \"children\": Array [],\n                                                                                                  \"message\": \"\",\n                                                                                                  \"name\": \"AdsPETableHeader141\",\n                                                                                                  \"status\": \"INLINED\",\n                                                                                                },\n                                                                                              ],\n                                                                                              \"message\": \"\",\n                                                                                              \"name\": \"TransitionCell142\",\n                                                                                              \"status\": \"INLINED\",\n                                                                                            },\n                                                                                          ],\n                                                                                          \"message\": \"\",\n                                                                                          \"name\": \"FixedDataTableCell143\",\n                                                                                          \"status\": \"INLINED\",\n                                                                                        },\n                                                                                        Object {\n                                                                                          \"children\": Array [\n                                                                                            Object {\n                                                                                              \"children\": Array [\n                                                                                                Object {\n                                                                                                  \"children\": Array [],\n                                                                                                  \"message\": \"\",\n                                                                                                  \"name\": \"AdsPETableHeader141\",\n                                                                                                  \"status\": \"INLINED\",\n                                                                                                },\n                                                                                              ],\n                                                                                              \"message\": \"\",\n                                                                                              \"name\": \"TransitionCell142\",\n                                                                                              \"status\": \"INLINED\",\n                                                                                            },\n                                                                                          ],\n                                                                                          \"message\": \"\",\n                                                                                          \"name\": \"FixedDataTableCell143\",\n                                                                                          \"status\": \"INLINED\",\n                                                                                        },\n                                                                                        Object {\n                                                                                          \"children\": Array [\n                                                                                            Object {\n                                                                                              \"children\": Array [\n                                                                                                Object {\n                                                                                                  \"children\": Array [],\n                                                                                                  \"message\": \"\",\n                                                                                                  \"name\": \"AdsPETableHeader141\",\n                                                                                                  \"status\": \"INLINED\",\n                                                                                                },\n                                                                                              ],\n                                                                                              \"message\": \"\",\n                                                                                              \"name\": \"TransitionCell142\",\n                                                                                              \"status\": \"INLINED\",\n                                                                                            },\n                                                                                          ],\n                                                                                          \"message\": \"\",\n                                                                                          \"name\": \"FixedDataTableCell143\",\n                                                                                          \"status\": \"INLINED\",\n                                                                                        },\n                                                                                        Object {\n                                                                                          \"children\": Array [\n                                                                                            Object {\n                                                                                              \"children\": Array [\n                                                                                                Object {\n                                                                                                  \"children\": Array [],\n                                                                                                  \"message\": \"\",\n                                                                                                  \"name\": \"AdsPETableHeader141\",\n                                                                                                  \"status\": \"INLINED\",\n                                                                                                },\n                                                                                              ],\n                                                                                              \"message\": \"\",\n                                                                                              \"name\": \"TransitionCell142\",\n                                                                                              \"status\": \"INLINED\",\n                                                                                            },\n                                                                                          ],\n                                                                                          \"message\": \"\",\n                                                                                          \"name\": \"FixedDataTableCell143\",\n                                                                                          \"status\": \"INLINED\",\n                                                                                        },\n                                                                                      ],\n                                                                                      \"message\": \"\",\n                                                                                      \"name\": \"FixedDataTableCellGroupImpl144\",\n                                                                                      \"status\": \"INLINED\",\n                                                                                    },\n                                                                                  ],\n                                                                                  \"message\": \"\",\n                                                                                  \"name\": \"FixedDataTableCellGroup145\",\n                                                                                  \"status\": \"INLINED\",\n                                                                                },\n                                                                              ],\n                                                                              \"message\": \"\",\n                                                                              \"name\": \"FixedDataTableRowImpl146\",\n                                                                              \"status\": \"INLINED\",\n                                                                            },\n                                                                          ],\n                                                                          \"message\": \"\",\n                                                                          \"name\": \"FixedDataTableRow147\",\n                                                                          \"status\": \"INLINED\",\n                                                                        },\n                                                                        Object {\n                                                                          \"children\": Array [\n                                                                            Object {\n                                                                              \"children\": Array [\n                                                                                Object {\n                                                                                  \"children\": Array [\n                                                                                    Object {\n                                                                                      \"children\": Array [\n                                                                                        Object {\n                                                                                          \"children\": Array [\n                                                                                            Object {\n                                                                                              \"children\": Array [\n                                                                                                Object {\n                                                                                                  \"children\": Array [\n                                                                                                    Object {\n                                                                                                      \"children\": Array [],\n                                                                                                      \"message\": \"\",\n                                                                                                      \"name\": \"AbstractCheckboxInput59\",\n                                                                                                      \"status\": \"INLINED\",\n                                                                                                    },\n                                                                                                  ],\n                                                                                                  \"message\": \"\",\n                                                                                                  \"name\": \"XUICheckboxInput60\",\n                                                                                                  \"status\": \"INLINED\",\n                                                                                                },\n                                                                                              ],\n                                                                                              \"message\": \"\",\n                                                                                              \"name\": \"TransitionCell142\",\n                                                                                              \"status\": \"INLINED\",\n                                                                                            },\n                                                                                          ],\n                                                                                          \"message\": \"\",\n                                                                                          \"name\": \"FixedDataTableCell143\",\n                                                                                          \"status\": \"INLINED\",\n                                                                                        },\n                                                                                        Object {\n                                                                                          \"children\": Array [\n                                                                                            Object {\n                                                                                              \"children\": Array [\n                                                                                                Object {\n                                                                                                  \"children\": Array [\n                                                                                                    Object {\n                                                                                                      \"children\": Array [\n                                                                                                        Object {\n                                                                                                          \"children\": Array [],\n                                                                                                          \"message\": \"\",\n                                                                                                          \"name\": \"AdsPETableHeader141\",\n                                                                                                          \"status\": \"INLINED\",\n                                                                                                        },\n                                                                                                      ],\n                                                                                                      \"message\": \"\",\n                                                                                                      \"name\": \"FixedDataTableAbstractSortableHeader148\",\n                                                                                                      \"status\": \"INLINED\",\n                                                                                                    },\n                                                                                                  ],\n                                                                                                  \"message\": \"\",\n                                                                                                  \"name\": \"FixedDataTableSortableHeader149\",\n                                                                                                  \"status\": \"INLINED\",\n                                                                                                },\n                                                                                              ],\n                                                                                              \"message\": \"\",\n                                                                                              \"name\": \"TransitionCell142\",\n                                                                                              \"status\": \"INLINED\",\n                                                                                            },\n                                                                                          ],\n                                                                                          \"message\": \"\",\n                                                                                          \"name\": \"FixedDataTableCell143\",\n                                                                                          \"status\": \"INLINED\",\n                                                                                        },\n                                                                                        Object {\n                                                                                          \"children\": Array [\n                                                                                            Object {\n                                                                                              \"children\": Array [\n                                                                                                Object {\n                                                                                                  \"children\": Array [\n                                                                                                    Object {\n                                                                                                      \"children\": Array [\n                                                                                                        Object {\n                                                                                                          \"children\": Array [\n                                                                                                            Object {\n                                                                                                              \"children\": Array [],\n                                                                                                              \"message\": \"\",\n                                                                                                              \"name\": \"ReactImage0\",\n                                                                                                              \"status\": \"INLINED\",\n                                                                                                            },\n                                                                                                          ],\n                                                                                                          \"message\": \"\",\n                                                                                                          \"name\": \"AdsPETableHeader141\",\n                                                                                                          \"status\": \"INLINED\",\n                                                                                                        },\n                                                                                                      ],\n                                                                                                      \"message\": \"\",\n                                                                                                      \"name\": \"FixedDataTableAbstractSortableHeader148\",\n                                                                                                      \"status\": \"INLINED\",\n                                                                                                    },\n                                                                                                  ],\n                                                                                                  \"message\": \"\",\n                                                                                                  \"name\": \"FixedDataTableSortableHeader149\",\n                                                                                                  \"status\": \"INLINED\",\n                                                                                                },\n                                                                                              ],\n                                                                                              \"message\": \"\",\n                                                                                              \"name\": \"TransitionCell142\",\n                                                                                              \"status\": \"INLINED\",\n                                                                                            },\n                                                                                          ],\n                                                                                          \"message\": \"\",\n                                                                                          \"name\": \"FixedDataTableCell143\",\n                                                                                          \"status\": \"INLINED\",\n                                                                                        },\n                                                                                        Object {\n                                                                                          \"children\": Array [\n                                                                                            Object {\n                                                                                              \"children\": Array [\n                                                                                                Object {\n                                                                                                  \"children\": Array [\n                                                                                                    Object {\n                                                                                                      \"children\": Array [\n                                                                                                        Object {\n                                                                                                          \"children\": Array [\n                                                                                                            Object {\n                                                                                                              \"children\": Array [],\n                                                                                                              \"message\": \"\",\n                                                                                                              \"name\": \"ReactImage0\",\n                                                                                                              \"status\": \"INLINED\",\n                                                                                                            },\n                                                                                                          ],\n                                                                                                          \"message\": \"\",\n                                                                                                          \"name\": \"AdsPETableHeader141\",\n                                                                                                          \"status\": \"INLINED\",\n                                                                                                        },\n                                                                                                      ],\n                                                                                                      \"message\": \"\",\n                                                                                                      \"name\": \"FixedDataTableAbstractSortableHeader148\",\n                                                                                                      \"status\": \"INLINED\",\n                                                                                                    },\n                                                                                                  ],\n                                                                                                  \"message\": \"\",\n                                                                                                  \"name\": \"FixedDataTableSortableHeader149\",\n                                                                                                  \"status\": \"INLINED\",\n                                                                                                },\n                                                                                              ],\n                                                                                              \"message\": \"\",\n                                                                                              \"name\": \"TransitionCell142\",\n                                                                                              \"status\": \"INLINED\",\n                                                                                            },\n                                                                                          ],\n                                                                                          \"message\": \"\",\n                                                                                          \"name\": \"FixedDataTableCell143\",\n                                                                                          \"status\": \"INLINED\",\n                                                                                        },\n                                                                                        Object {\n                                                                                          \"children\": Array [\n                                                                                            Object {\n                                                                                              \"children\": Array [\n                                                                                                Object {\n                                                                                                  \"children\": Array [\n                                                                                                    Object {\n                                                                                                      \"children\": Array [\n                                                                                                        Object {\n                                                                                                          \"children\": Array [],\n                                                                                                          \"message\": \"\",\n                                                                                                          \"name\": \"AdsPETableHeader141\",\n                                                                                                          \"status\": \"INLINED\",\n                                                                                                        },\n                                                                                                      ],\n                                                                                                      \"message\": \"\",\n                                                                                                      \"name\": \"FixedDataTableAbstractSortableHeader148\",\n                                                                                                      \"status\": \"INLINED\",\n                                                                                                    },\n                                                                                                  ],\n                                                                                                  \"message\": \"\",\n                                                                                                  \"name\": \"FixedDataTableSortableHeader149\",\n                                                                                                  \"status\": \"INLINED\",\n                                                                                                },\n                                                                                              ],\n                                                                                              \"message\": \"\",\n                                                                                              \"name\": \"TransitionCell142\",\n                                                                                              \"status\": \"INLINED\",\n                                                                                            },\n                                                                                          ],\n                                                                                          \"message\": \"\",\n                                                                                          \"name\": \"FixedDataTableCell143\",\n                                                                                          \"status\": \"INLINED\",\n                                                                                        },\n                                                                                        Object {\n                                                                                          \"children\": Array [\n                                                                                            Object {\n                                                                                              \"children\": Array [\n                                                                                                Object {\n                                                                                                  \"children\": Array [\n                                                                                                    Object {\n                                                                                                      \"children\": Array [\n                                                                                                        Object {\n                                                                                                          \"children\": Array [],\n                                                                                                          \"message\": \"\",\n                                                                                                          \"name\": \"AdsPETableHeader141\",\n                                                                                                          \"status\": \"INLINED\",\n                                                                                                        },\n                                                                                                      ],\n                                                                                                      \"message\": \"\",\n                                                                                                      \"name\": \"FixedDataTableAbstractSortableHeader148\",\n                                                                                                      \"status\": \"INLINED\",\n                                                                                                    },\n                                                                                                  ],\n                                                                                                  \"message\": \"\",\n                                                                                                  \"name\": \"FixedDataTableSortableHeader149\",\n                                                                                                  \"status\": \"INLINED\",\n                                                                                                },\n                                                                                              ],\n                                                                                              \"message\": \"\",\n                                                                                              \"name\": \"TransitionCell142\",\n                                                                                              \"status\": \"INLINED\",\n                                                                                            },\n                                                                                          ],\n                                                                                          \"message\": \"\",\n                                                                                          \"name\": \"FixedDataTableCell143\",\n                                                                                          \"status\": \"INLINED\",\n                                                                                        },\n                                                                                      ],\n                                                                                      \"message\": \"\",\n                                                                                      \"name\": \"FixedDataTableCellGroupImpl144\",\n                                                                                      \"status\": \"INLINED\",\n                                                                                    },\n                                                                                  ],\n                                                                                  \"message\": \"\",\n                                                                                  \"name\": \"FixedDataTableCellGroup145\",\n                                                                                  \"status\": \"INLINED\",\n                                                                                },\n                                                                                Object {\n                                                                                  \"children\": Array [\n                                                                                    Object {\n                                                                                      \"children\": Array [\n                                                                                        Object {\n                                                                                          \"children\": Array [\n                                                                                            Object {\n                                                                                              \"children\": Array [\n                                                                                                Object {\n                                                                                                  \"children\": Array [\n                                                                                                    Object {\n                                                                                                      \"children\": Array [\n                                                                                                        Object {\n                                                                                                          \"children\": Array [],\n                                                                                                          \"message\": \"\",\n                                                                                                          \"name\": \"AdsPETableHeader141\",\n                                                                                                          \"status\": \"INLINED\",\n                                                                                                        },\n                                                                                                      ],\n                                                                                                      \"message\": \"\",\n                                                                                                      \"name\": \"FixedDataTableAbstractSortableHeader148\",\n                                                                                                      \"status\": \"INLINED\",\n                                                                                                    },\n                                                                                                  ],\n                                                                                                  \"message\": \"\",\n                                                                                                  \"name\": \"FixedDataTableSortableHeader149\",\n                                                                                                  \"status\": \"INLINED\",\n                                                                                                },\n                                                                                              ],\n                                                                                              \"message\": \"\",\n                                                                                              \"name\": \"TransitionCell142\",\n                                                                                              \"status\": \"INLINED\",\n                                                                                            },\n                                                                                          ],\n                                                                                          \"message\": \"\",\n                                                                                          \"name\": \"FixedDataTableCell143\",\n                                                                                          \"status\": \"INLINED\",\n                                                                                        },\n                                                                                        Object {\n                                                                                          \"children\": Array [\n                                                                                            Object {\n                                                                                              \"children\": Array [\n                                                                                                Object {\n                                                                                                  \"children\": Array [\n                                                                                                    Object {\n                                                                                                      \"children\": Array [\n                                                                                                        Object {\n                                                                                                          \"children\": Array [],\n                                                                                                          \"message\": \"\",\n                                                                                                          \"name\": \"AdsPETableHeader141\",\n                                                                                                          \"status\": \"INLINED\",\n                                                                                                        },\n                                                                                                      ],\n                                                                                                      \"message\": \"\",\n                                                                                                      \"name\": \"FixedDataTableAbstractSortableHeader148\",\n                                                                                                      \"status\": \"INLINED\",\n                                                                                                    },\n                                                                                                  ],\n                                                                                                  \"message\": \"\",\n                                                                                                  \"name\": \"FixedDataTableSortableHeader149\",\n                                                                                                  \"status\": \"INLINED\",\n                                                                                                },\n                                                                                              ],\n                                                                                              \"message\": \"\",\n                                                                                              \"name\": \"TransitionCell142\",\n                                                                                              \"status\": \"INLINED\",\n                                                                                            },\n                                                                                          ],\n                                                                                          \"message\": \"\",\n                                                                                          \"name\": \"FixedDataTableCell143\",\n                                                                                          \"status\": \"INLINED\",\n                                                                                        },\n                                                                                        Object {\n                                                                                          \"children\": Array [\n                                                                                            Object {\n                                                                                              \"children\": Array [\n                                                                                                Object {\n                                                                                                  \"children\": Array [\n                                                                                                    Object {\n                                                                                                      \"children\": Array [\n                                                                                                        Object {\n                                                                                                          \"children\": Array [],\n                                                                                                          \"message\": \"\",\n                                                                                                          \"name\": \"AdsPETableHeader141\",\n                                                                                                          \"status\": \"INLINED\",\n                                                                                                        },\n                                                                                                      ],\n                                                                                                      \"message\": \"\",\n                                                                                                      \"name\": \"FixedDataTableAbstractSortableHeader148\",\n                                                                                                      \"status\": \"INLINED\",\n                                                                                                    },\n                                                                                                  ],\n                                                                                                  \"message\": \"\",\n                                                                                                  \"name\": \"FixedDataTableSortableHeader149\",\n                                                                                                  \"status\": \"INLINED\",\n                                                                                                },\n                                                                                              ],\n                                                                                              \"message\": \"\",\n                                                                                              \"name\": \"TransitionCell142\",\n                                                                                              \"status\": \"INLINED\",\n                                                                                            },\n                                                                                          ],\n                                                                                          \"message\": \"\",\n                                                                                          \"name\": \"FixedDataTableCell143\",\n                                                                                          \"status\": \"INLINED\",\n                                                                                        },\n                                                                                        Object {\n                                                                                          \"children\": Array [\n                                                                                            Object {\n                                                                                              \"children\": Array [\n                                                                                                Object {\n                                                                                                  \"children\": Array [\n                                                                                                    Object {\n                                                                                                      \"children\": Array [\n                                                                                                        Object {\n                                                                                                          \"children\": Array [],\n                                                                                                          \"message\": \"\",\n                                                                                                          \"name\": \"AdsPETableHeader141\",\n                                                                                                          \"status\": \"INLINED\",\n                                                                                                        },\n                                                                                                      ],\n                                                                                                      \"message\": \"\",\n                                                                                                      \"name\": \"FixedDataTableAbstractSortableHeader148\",\n                                                                                                      \"status\": \"INLINED\",\n                                                                                                    },\n                                                                                                  ],\n                                                                                                  \"message\": \"\",\n                                                                                                  \"name\": \"FixedDataTableSortableHeader149\",\n                                                                                                  \"status\": \"INLINED\",\n                                                                                                },\n                                                                                              ],\n                                                                                              \"message\": \"\",\n                                                                                              \"name\": \"TransitionCell142\",\n                                                                                              \"status\": \"INLINED\",\n                                                                                            },\n                                                                                          ],\n                                                                                          \"message\": \"\",\n                                                                                          \"name\": \"FixedDataTableCell143\",\n                                                                                          \"status\": \"INLINED\",\n                                                                                        },\n                                                                                        Object {\n                                                                                          \"children\": Array [\n                                                                                            Object {\n                                                                                              \"children\": Array [\n                                                                                                Object {\n                                                                                                  \"children\": Array [\n                                                                                                    Object {\n                                                                                                      \"children\": Array [\n                                                                                                        Object {\n                                                                                                          \"children\": Array [],\n                                                                                                          \"message\": \"\",\n                                                                                                          \"name\": \"AdsPETableHeader141\",\n                                                                                                          \"status\": \"INLINED\",\n                                                                                                        },\n                                                                                                      ],\n                                                                                                      \"message\": \"\",\n                                                                                                      \"name\": \"FixedDataTableAbstractSortableHeader148\",\n                                                                                                      \"status\": \"INLINED\",\n                                                                                                    },\n                                                                                                  ],\n                                                                                                  \"message\": \"\",\n                                                                                                  \"name\": \"FixedDataTableSortableHeader149\",\n                                                                                                  \"status\": \"INLINED\",\n                                                                                                },\n                                                                                              ],\n                                                                                              \"message\": \"\",\n                                                                                              \"name\": \"TransitionCell142\",\n                                                                                              \"status\": \"INLINED\",\n                                                                                            },\n                                                                                          ],\n                                                                                          \"message\": \"\",\n                                                                                          \"name\": \"FixedDataTableCell143\",\n                                                                                          \"status\": \"INLINED\",\n                                                                                        },\n                                                                                        Object {\n                                                                                          \"children\": Array [\n                                                                                            Object {\n                                                                                              \"children\": Array [\n                                                                                                Object {\n                                                                                                  \"children\": Array [\n                                                                                                    Object {\n                                                                                                      \"children\": Array [\n                                                                                                        Object {\n                                                                                                          \"children\": Array [],\n                                                                                                          \"message\": \"\",\n                                                                                                          \"name\": \"AdsPETableHeader141\",\n                                                                                                          \"status\": \"INLINED\",\n                                                                                                        },\n                                                                                                      ],\n                                                                                                      \"message\": \"\",\n                                                                                                      \"name\": \"FixedDataTableAbstractSortableHeader148\",\n                                                                                                      \"status\": \"INLINED\",\n                                                                                                    },\n                                                                                                  ],\n                                                                                                  \"message\": \"\",\n                                                                                                  \"name\": \"FixedDataTableSortableHeader149\",\n                                                                                                  \"status\": \"INLINED\",\n                                                                                                },\n                                                                                              ],\n                                                                                              \"message\": \"\",\n                                                                                              \"name\": \"TransitionCell142\",\n                                                                                              \"status\": \"INLINED\",\n                                                                                            },\n                                                                                          ],\n                                                                                          \"message\": \"\",\n                                                                                          \"name\": \"FixedDataTableCell143\",\n                                                                                          \"status\": \"INLINED\",\n                                                                                        },\n                                                                                        Object {\n                                                                                          \"children\": Array [\n                                                                                            Object {\n                                                                                              \"children\": Array [\n                                                                                                Object {\n                                                                                                  \"children\": Array [\n                                                                                                    Object {\n                                                                                                      \"children\": Array [\n                                                                                                        Object {\n                                                                                                          \"children\": Array [],\n                                                                                                          \"message\": \"\",\n                                                                                                          \"name\": \"AdsPETableHeader141\",\n                                                                                                          \"status\": \"INLINED\",\n                                                                                                        },\n                                                                                                      ],\n                                                                                                      \"message\": \"\",\n                                                                                                      \"name\": \"FixedDataTableAbstractSortableHeader148\",\n                                                                                                      \"status\": \"INLINED\",\n                                                                                                    },\n                                                                                                  ],\n                                                                                                  \"message\": \"\",\n                                                                                                  \"name\": \"FixedDataTableSortableHeader149\",\n                                                                                                  \"status\": \"INLINED\",\n                                                                                                },\n                                                                                              ],\n                                                                                              \"message\": \"\",\n                                                                                              \"name\": \"TransitionCell142\",\n                                                                                              \"status\": \"INLINED\",\n                                                                                            },\n                                                                                          ],\n                                                                                          \"message\": \"\",\n                                                                                          \"name\": \"FixedDataTableCell143\",\n                                                                                          \"status\": \"INLINED\",\n                                                                                        },\n                                                                                        Object {\n                                                                                          \"children\": Array [\n                                                                                            Object {\n                                                                                              \"children\": Array [\n                                                                                                Object {\n                                                                                                  \"children\": Array [\n                                                                                                    Object {\n                                                                                                      \"children\": Array [\n                                                                                                        Object {\n                                                                                                          \"children\": Array [],\n                                                                                                          \"message\": \"\",\n                                                                                                          \"name\": \"AdsPETableHeader141\",\n                                                                                                          \"status\": \"INLINED\",\n                                                                                                        },\n                                                                                                      ],\n                                                                                                      \"message\": \"\",\n                                                                                                      \"name\": \"FixedDataTableAbstractSortableHeader148\",\n                                                                                                      \"status\": \"INLINED\",\n                                                                                                    },\n                                                                                                  ],\n                                                                                                  \"message\": \"\",\n                                                                                                  \"name\": \"FixedDataTableSortableHeader149\",\n                                                                                                  \"status\": \"INLINED\",\n                                                                                                },\n                                                                                              ],\n                                                                                              \"message\": \"\",\n                                                                                              \"name\": \"TransitionCell142\",\n                                                                                              \"status\": \"INLINED\",\n                                                                                            },\n                                                                                          ],\n                                                                                          \"message\": \"\",\n                                                                                          \"name\": \"FixedDataTableCell143\",\n                                                                                          \"status\": \"INLINED\",\n                                                                                        },\n                                                                                        Object {\n                                                                                          \"children\": Array [\n                                                                                            Object {\n                                                                                              \"children\": Array [\n                                                                                                Object {\n                                                                                                  \"children\": Array [\n                                                                                                    Object {\n                                                                                                      \"children\": Array [\n                                                                                                        Object {\n                                                                                                          \"children\": Array [],\n                                                                                                          \"message\": \"\",\n                                                                                                          \"name\": \"AdsPETableHeader141\",\n                                                                                                          \"status\": \"INLINED\",\n                                                                                                        },\n                                                                                                      ],\n                                                                                                      \"message\": \"\",\n                                                                                                      \"name\": \"FixedDataTableAbstractSortableHeader148\",\n                                                                                                      \"status\": \"INLINED\",\n                                                                                                    },\n                                                                                                  ],\n                                                                                                  \"message\": \"\",\n                                                                                                  \"name\": \"FixedDataTableSortableHeader149\",\n                                                                                                  \"status\": \"INLINED\",\n                                                                                                },\n                                                                                              ],\n                                                                                              \"message\": \"\",\n                                                                                              \"name\": \"TransitionCell142\",\n                                                                                              \"status\": \"INLINED\",\n                                                                                            },\n                                                                                          ],\n                                                                                          \"message\": \"\",\n                                                                                          \"name\": \"FixedDataTableCell143\",\n                                                                                          \"status\": \"INLINED\",\n                                                                                        },\n                                                                                        Object {\n                                                                                          \"children\": Array [\n                                                                                            Object {\n                                                                                              \"children\": Array [\n                                                                                                Object {\n                                                                                                  \"children\": Array [\n                                                                                                    Object {\n                                                                                                      \"children\": Array [\n                                                                                                        Object {\n                                                                                                          \"children\": Array [],\n                                                                                                          \"message\": \"\",\n                                                                                                          \"name\": \"AdsPETableHeader141\",\n                                                                                                          \"status\": \"INLINED\",\n                                                                                                        },\n                                                                                                      ],\n                                                                                                      \"message\": \"\",\n                                                                                                      \"name\": \"FixedDataTableAbstractSortableHeader148\",\n                                                                                                      \"status\": \"INLINED\",\n                                                                                                    },\n                                                                                                  ],\n                                                                                                  \"message\": \"\",\n                                                                                                  \"name\": \"FixedDataTableSortableHeader149\",\n                                                                                                  \"status\": \"INLINED\",\n                                                                                                },\n                                                                                              ],\n                                                                                              \"message\": \"\",\n                                                                                              \"name\": \"TransitionCell142\",\n                                                                                              \"status\": \"INLINED\",\n                                                                                            },\n                                                                                          ],\n                                                                                          \"message\": \"\",\n                                                                                          \"name\": \"FixedDataTableCell143\",\n                                                                                          \"status\": \"INLINED\",\n                                                                                        },\n                                                                                        Object {\n                                                                                          \"children\": Array [\n                                                                                            Object {\n                                                                                              \"children\": Array [\n                                                                                                Object {\n                                                                                                  \"children\": Array [\n                                                                                                    Object {\n                                                                                                      \"children\": Array [\n                                                                                                        Object {\n                                                                                                          \"children\": Array [],\n                                                                                                          \"message\": \"\",\n                                                                                                          \"name\": \"AdsPETableHeader141\",\n                                                                                                          \"status\": \"INLINED\",\n                                                                                                        },\n                                                                                                      ],\n                                                                                                      \"message\": \"\",\n                                                                                                      \"name\": \"FixedDataTableAbstractSortableHeader148\",\n                                                                                                      \"status\": \"INLINED\",\n                                                                                                    },\n                                                                                                  ],\n                                                                                                  \"message\": \"\",\n                                                                                                  \"name\": \"FixedDataTableSortableHeader149\",\n                                                                                                  \"status\": \"INLINED\",\n                                                                                                },\n                                                                                              ],\n                                                                                              \"message\": \"\",\n                                                                                              \"name\": \"TransitionCell142\",\n                                                                                              \"status\": \"INLINED\",\n                                                                                            },\n                                                                                          ],\n                                                                                          \"message\": \"\",\n                                                                                          \"name\": \"FixedDataTableCell143\",\n                                                                                          \"status\": \"INLINED\",\n                                                                                        },\n                                                                                        Object {\n                                                                                          \"children\": Array [\n                                                                                            Object {\n                                                                                              \"children\": Array [\n                                                                                                Object {\n                                                                                                  \"children\": Array [\n                                                                                                    Object {\n                                                                                                      \"children\": Array [\n                                                                                                        Object {\n                                                                                                          \"children\": Array [],\n                                                                                                          \"message\": \"\",\n                                                                                                          \"name\": \"AdsPETableHeader141\",\n                                                                                                          \"status\": \"INLINED\",\n                                                                                                        },\n                                                                                                      ],\n                                                                                                      \"message\": \"\",\n                                                                                                      \"name\": \"FixedDataTableAbstractSortableHeader148\",\n                                                                                                      \"status\": \"INLINED\",\n                                                                                                    },\n                                                                                                  ],\n                                                                                                  \"message\": \"\",\n                                                                                                  \"name\": \"FixedDataTableSortableHeader149\",\n                                                                                                  \"status\": \"INLINED\",\n                                                                                                },\n                                                                                              ],\n                                                                                              \"message\": \"\",\n                                                                                              \"name\": \"TransitionCell142\",\n                                                                                              \"status\": \"INLINED\",\n                                                                                            },\n                                                                                          ],\n                                                                                          \"message\": \"\",\n                                                                                          \"name\": \"FixedDataTableCell143\",\n                                                                                          \"status\": \"INLINED\",\n                                                                                        },\n                                                                                        Object {\n                                                                                          \"children\": Array [\n                                                                                            Object {\n                                                                                              \"children\": Array [\n                                                                                                Object {\n                                                                                                  \"children\": Array [\n                                                                                                    Object {\n                                                                                                      \"children\": Array [\n                                                                                                        Object {\n                                                                                                          \"children\": Array [],\n                                                                                                          \"message\": \"\",\n                                                                                                          \"name\": \"AdsPETableHeader141\",\n                                                                                                          \"status\": \"INLINED\",\n                                                                                                        },\n                                                                                                      ],\n                                                                                                      \"message\": \"\",\n                                                                                                      \"name\": \"FixedDataTableAbstractSortableHeader148\",\n                                                                                                      \"status\": \"INLINED\",\n                                                                                                    },\n                                                                                                  ],\n                                                                                                  \"message\": \"\",\n                                                                                                  \"name\": \"FixedDataTableSortableHeader149\",\n                                                                                                  \"status\": \"INLINED\",\n                                                                                                },\n                                                                                              ],\n                                                                                              \"message\": \"\",\n                                                                                              \"name\": \"TransitionCell142\",\n                                                                                              \"status\": \"INLINED\",\n                                                                                            },\n                                                                                          ],\n                                                                                          \"message\": \"\",\n                                                                                          \"name\": \"FixedDataTableCell143\",\n                                                                                          \"status\": \"INLINED\",\n                                                                                        },\n                                                                                        Object {\n                                                                                          \"children\": Array [\n                                                                                            Object {\n                                                                                              \"children\": Array [\n                                                                                                Object {\n                                                                                                  \"children\": Array [\n                                                                                                    Object {\n                                                                                                      \"children\": Array [\n                                                                                                        Object {\n                                                                                                          \"children\": Array [],\n                                                                                                          \"message\": \"\",\n                                                                                                          \"name\": \"AdsPETableHeader141\",\n                                                                                                          \"status\": \"INLINED\",\n                                                                                                        },\n                                                                                                      ],\n                                                                                                      \"message\": \"\",\n                                                                                                      \"name\": \"FixedDataTableAbstractSortableHeader148\",\n                                                                                                      \"status\": \"INLINED\",\n                                                                                                    },\n                                                                                                  ],\n                                                                                                  \"message\": \"\",\n                                                                                                  \"name\": \"FixedDataTableSortableHeader149\",\n                                                                                                  \"status\": \"INLINED\",\n                                                                                                },\n                                                                                              ],\n                                                                                              \"message\": \"\",\n                                                                                              \"name\": \"TransitionCell142\",\n                                                                                              \"status\": \"INLINED\",\n                                                                                            },\n                                                                                          ],\n                                                                                          \"message\": \"\",\n                                                                                          \"name\": \"FixedDataTableCell143\",\n                                                                                          \"status\": \"INLINED\",\n                                                                                        },\n                                                                                        Object {\n                                                                                          \"children\": Array [\n                                                                                            Object {\n                                                                                              \"children\": Array [\n                                                                                                Object {\n                                                                                                  \"children\": Array [\n                                                                                                    Object {\n                                                                                                      \"children\": Array [\n                                                                                                        Object {\n                                                                                                          \"children\": Array [],\n                                                                                                          \"message\": \"\",\n                                                                                                          \"name\": \"AdsPETableHeader141\",\n                                                                                                          \"status\": \"INLINED\",\n                                                                                                        },\n                                                                                                      ],\n                                                                                                      \"message\": \"\",\n                                                                                                      \"name\": \"FixedDataTableAbstractSortableHeader148\",\n                                                                                                      \"status\": \"INLINED\",\n                                                                                                    },\n                                                                                                  ],\n                                                                                                  \"message\": \"\",\n                                                                                                  \"name\": \"FixedDataTableSortableHeader149\",\n                                                                                                  \"status\": \"INLINED\",\n                                                                                                },\n                                                                                              ],\n                                                                                              \"message\": \"\",\n                                                                                              \"name\": \"TransitionCell142\",\n                                                                                              \"status\": \"INLINED\",\n                                                                                            },\n                                                                                          ],\n                                                                                          \"message\": \"\",\n                                                                                          \"name\": \"FixedDataTableCell143\",\n                                                                                          \"status\": \"INLINED\",\n                                                                                        },\n                                                                                        Object {\n                                                                                          \"children\": Array [\n                                                                                            Object {\n                                                                                              \"children\": Array [\n                                                                                                Object {\n                                                                                                  \"children\": Array [\n                                                                                                    Object {\n                                                                                                      \"children\": Array [\n                                                                                                        Object {\n                                                                                                          \"children\": Array [],\n                                                                                                          \"message\": \"\",\n                                                                                                          \"name\": \"AdsPETableHeader141\",\n                                                                                                          \"status\": \"INLINED\",\n                                                                                                        },\n                                                                                                      ],\n                                                                                                      \"message\": \"\",\n                                                                                                      \"name\": \"FixedDataTableAbstractSortableHeader148\",\n                                                                                                      \"status\": \"INLINED\",\n                                                                                                    },\n                                                                                                  ],\n                                                                                                  \"message\": \"\",\n                                                                                                  \"name\": \"FixedDataTableSortableHeader149\",\n                                                                                                  \"status\": \"INLINED\",\n                                                                                                },\n                                                                                              ],\n                                                                                              \"message\": \"\",\n                                                                                              \"name\": \"TransitionCell142\",\n                                                                                              \"status\": \"INLINED\",\n                                                                                            },\n                                                                                          ],\n                                                                                          \"message\": \"\",\n                                                                                          \"name\": \"FixedDataTableCell143\",\n                                                                                          \"status\": \"INLINED\",\n                                                                                        },\n                                                                                        Object {\n                                                                                          \"children\": Array [\n                                                                                            Object {\n                                                                                              \"children\": Array [\n                                                                                                Object {\n                                                                                                  \"children\": Array [],\n                                                                                                  \"message\": \"\",\n                                                                                                  \"name\": \"AdsPETableHeader141\",\n                                                                                                  \"status\": \"INLINED\",\n                                                                                                },\n                                                                                              ],\n                                                                                              \"message\": \"\",\n                                                                                              \"name\": \"TransitionCell142\",\n                                                                                              \"status\": \"INLINED\",\n                                                                                            },\n                                                                                          ],\n                                                                                          \"message\": \"\",\n                                                                                          \"name\": \"FixedDataTableCell143\",\n                                                                                          \"status\": \"INLINED\",\n                                                                                        },\n                                                                                        Object {\n                                                                                          \"children\": Array [\n                                                                                            Object {\n                                                                                              \"children\": Array [\n                                                                                                Object {\n                                                                                                  \"children\": Array [],\n                                                                                                  \"message\": \"\",\n                                                                                                  \"name\": \"AdsPETableHeader141\",\n                                                                                                  \"status\": \"INLINED\",\n                                                                                                },\n                                                                                              ],\n                                                                                              \"message\": \"\",\n                                                                                              \"name\": \"TransitionCell142\",\n                                                                                              \"status\": \"INLINED\",\n                                                                                            },\n                                                                                          ],\n                                                                                          \"message\": \"\",\n                                                                                          \"name\": \"FixedDataTableCell143\",\n                                                                                          \"status\": \"INLINED\",\n                                                                                        },\n                                                                                      ],\n                                                                                      \"message\": \"\",\n                                                                                      \"name\": \"FixedDataTableCellGroupImpl144\",\n                                                                                      \"status\": \"INLINED\",\n                                                                                    },\n                                                                                  ],\n                                                                                  \"message\": \"\",\n                                                                                  \"name\": \"FixedDataTableCellGroup145\",\n                                                                                  \"status\": \"INLINED\",\n                                                                                },\n                                                                              ],\n                                                                              \"message\": \"\",\n                                                                              \"name\": \"FixedDataTableRowImpl146\",\n                                                                              \"status\": \"INLINED\",\n                                                                            },\n                                                                          ],\n                                                                          \"message\": \"\",\n                                                                          \"name\": \"FixedDataTableRow147\",\n                                                                          \"status\": \"INLINED\",\n                                                                        },\n                                                                        Object {\n                                                                          \"children\": Array [],\n                                                                          \"message\": \"\",\n                                                                          \"name\": \"FixedDataTableBufferedRows150\",\n                                                                          \"status\": \"INLINED\",\n                                                                        },\n                                                                        Object {\n                                                                          \"children\": Array [],\n                                                                          \"message\": \"\",\n                                                                          \"name\": \"Scrollbar151\",\n                                                                          \"status\": \"INLINED\",\n                                                                        },\n                                                                        Object {\n                                                                          \"children\": Array [\n                                                                            Object {\n                                                                              \"children\": Array [],\n                                                                              \"message\": \"\",\n                                                                              \"name\": \"Scrollbar151\",\n                                                                              \"status\": \"INLINED\",\n                                                                            },\n                                                                          ],\n                                                                          \"message\": \"\",\n                                                                          \"name\": \"HorizontalScrollbar152\",\n                                                                          \"status\": \"INLINED\",\n                                                                        },\n                                                                      ],\n                                                                      \"message\": \"\",\n                                                                      \"name\": \"FixedDataTable153\",\n                                                                      \"status\": \"INLINED\",\n                                                                    },\n                                                                  ],\n                                                                  \"message\": \"\",\n                                                                  \"name\": \"TransitionTable154\",\n                                                                  \"status\": \"INLINED\",\n                                                                },\n                                                              ],\n                                                              \"message\": \"\",\n                                                              \"name\": \"AdsSelectableFixedDataTable155\",\n                                                              \"status\": \"INLINED\",\n                                                            },\n                                                          ],\n                                                          \"message\": \"\",\n                                                          \"name\": \"AdsDataTableKeyboardSupportDecorator156\",\n                                                          \"status\": \"INLINED\",\n                                                        },\n                                                      ],\n                                                      \"message\": \"\",\n                                                      \"name\": \"AdsEditableDataTableDecorator157\",\n                                                      \"status\": \"INLINED\",\n                                                    },\n                                                  ],\n                                                  \"message\": \"\",\n                                                  \"name\": \"AdsPEDataTableContainer158\",\n                                                  \"status\": \"INLINED\",\n                                                },\n                                              ],\n                                              \"message\": \"\",\n                                              \"name\": \"ResponsiveBlock37\",\n                                              \"status\": \"INLINED\",\n                                            },\n                                          ],\n                                          \"message\": \"\",\n                                          \"name\": \"AdsPECampaignGroupTableContainer159\",\n                                          \"status\": \"INLINED\",\n                                        },\n                                      ],\n                                      \"message\": \"\",\n                                      \"name\": \"ErrorBoundary9\",\n                                      \"status\": \"INLINED\",\n                                    },\n                                  ],\n                                  \"message\": \"\",\n                                  \"name\": \"AdsErrorBoundary10\",\n                                  \"status\": \"INLINED\",\n                                },\n                              ],\n                              \"message\": \"\",\n                              \"name\": \"AdsPEManageAdsPaneContainer160\",\n                              \"status\": \"INLINED\",\n                            },\n                          ],\n                          \"message\": \"\",\n                          \"name\": \"AdsPEContentContainer161\",\n                          \"status\": \"INLINED\",\n                        },\n                      ],\n                      \"message\": \"\",\n                      \"name\": \"ErrorBoundary9\",\n                      \"status\": \"INLINED\",\n                    },\n                  ],\n                  \"message\": \"\",\n                  \"name\": \"AdsErrorBoundary10\",\n                  \"status\": \"INLINED\",\n                },\n              ],\n              \"message\": \"\",\n              \"name\": \"FluxContainer_AdsPEWorkspaceContainer_162\",\n              \"status\": \"INLINED\",\n            },\n            Object {\n              \"children\": Array [],\n              \"message\": \"\",\n              \"name\": \"FluxContainer_AdsSessionExpiredDialogContainer_163\",\n              \"status\": \"INLINED\",\n            },\n            Object {\n              \"children\": Array [],\n              \"message\": \"\",\n              \"name\": \"FluxContainer_AdsPEUploadDialogLazyContainer_164\",\n              \"status\": \"INLINED\",\n            },\n            Object {\n              \"children\": Array [],\n              \"message\": \"\",\n              \"name\": \"FluxContainer_DialogContainer_165\",\n              \"status\": \"INLINED\",\n            },\n            Object {\n              \"children\": Array [],\n              \"message\": \"\",\n              \"name\": \"AdsBugReportContainer166\",\n              \"status\": \"INLINED\",\n            },\n            Object {\n              \"children\": Array [\n                Object {\n                  \"children\": Array [],\n                  \"message\": \"\",\n                  \"name\": \"AdsPEAudienceSplittingDialog167\",\n                  \"status\": \"INLINED\",\n                },\n              ],\n              \"message\": \"\",\n              \"name\": \"AdsPEAudienceSplittingDialogContainer168\",\n              \"status\": \"INLINED\",\n            },\n            Object {\n              \"children\": Array [],\n              \"message\": \"\",\n              \"name\": \"FluxContainer_AdsRuleDialogBootloadContainer_169\",\n              \"status\": \"INLINED\",\n            },\n            Object {\n              \"children\": Array [],\n              \"message\": \"\",\n              \"name\": \"FluxContainer_AdsPECFTrayContainer_170\",\n              \"status\": \"INLINED\",\n            },\n            Object {\n              \"children\": Array [],\n              \"message\": \"\",\n              \"name\": \"FluxContainer_AdsPEDeleteDraftContainer_171\",\n              \"status\": \"INLINED\",\n            },\n            Object {\n              \"children\": Array [],\n              \"message\": \"\",\n              \"name\": \"FluxContainer_AdsPEInitialDraftPublishDialogContainer_172\",\n              \"status\": \"INLINED\",\n            },\n            Object {\n              \"children\": Array [],\n              \"message\": \"\",\n              \"name\": \"FluxContainer_AdsPEReachFrequencyStatusTransitionDialogBootloadContainer_173\",\n              \"status\": \"INLINED\",\n            },\n            Object {\n              \"children\": Array [],\n              \"message\": \"\",\n              \"name\": \"FluxContainer_AdsPEPurgeArchiveDialogContainer_174\",\n              \"status\": \"INLINED\",\n            },\n            Object {\n              \"children\": Array [],\n              \"message\": \"\",\n              \"name\": \"AdsPECreateDialogContainer175\",\n              \"status\": \"INLINED\",\n            },\n            Object {\n              \"children\": Array [],\n              \"message\": \"\",\n              \"name\": \"FluxContainer_AdsPEModalStatusContainer_176\",\n              \"status\": \"INLINED\",\n            },\n            Object {\n              \"children\": Array [],\n              \"message\": \"\",\n              \"name\": \"FluxContainer_AdsBrowserExtensionErrorDialogContainer_177\",\n              \"status\": \"INLINED\",\n            },\n            Object {\n              \"children\": Array [],\n              \"message\": \"\",\n              \"name\": \"FluxContainer_AdsPESortByErrorTipContainer_178\",\n              \"status\": \"INLINED\",\n            },\n            Object {\n              \"children\": Array [\n                Object {\n                  \"children\": Array [],\n                  \"message\": \"\",\n                  \"name\": \"LeadDownloadDialogSelector179\",\n                  \"status\": \"INLINED\",\n                },\n              ],\n              \"message\": \"\",\n              \"name\": \"FluxContainer_AdsPELeadDownloadDialogContainerClass_180\",\n              \"status\": \"INLINED\",\n            },\n          ],\n          \"message\": \"\",\n          \"name\": \"AdsPEContainer181\",\n          \"status\": \"INLINED\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"Benchmark\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 497,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`PE Functional Components benchmark: (createElement => JSX) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 498,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [\n            Object {\n              \"children\": Array [\n                Object {\n                  \"children\": Array [\n                    Object {\n                      \"children\": Array [\n                        Object {\n                          \"children\": Array [\n                            Object {\n                              \"children\": Array [\n                                Object {\n                                  \"children\": Array [\n                                    Object {\n                                      \"children\": Array [\n                                        Object {\n                                          \"children\": Array [\n                                            Object {\n                                              \"children\": Array [\n                                                Object {\n                                                  \"children\": Array [\n                                                    Object {\n                                                      \"children\": Array [\n                                                        Object {\n                                                          \"children\": Array [\n                                                            Object {\n                                                              \"children\": Array [\n                                                                Object {\n                                                                  \"children\": Array [\n                                                                    Object {\n                                                                      \"children\": Array [],\n                                                                      \"message\": \"\",\n                                                                      \"name\": \"ReactImage0\",\n                                                                      \"status\": \"INLINED\",\n                                                                    },\n                                                                  ],\n                                                                  \"message\": \"\",\n                                                                  \"name\": \"AbstractLink1\",\n                                                                  \"status\": \"INLINED\",\n                                                                },\n                                                              ],\n                                                              \"message\": \"\",\n                                                              \"name\": \"Link2\",\n                                                              \"status\": \"INLINED\",\n                                                            },\n                                                          ],\n                                                          \"message\": \"\",\n                                                          \"name\": \"AbstractButton3\",\n                                                          \"status\": \"INLINED\",\n                                                        },\n                                                      ],\n                                                      \"message\": \"\",\n                                                      \"name\": \"XUIButton4\",\n                                                      \"status\": \"INLINED\",\n                                                    },\n                                                  ],\n                                                  \"message\": \"\",\n                                                  \"name\": \"AbstractPopoverButton5\",\n                                                  \"status\": \"INLINED\",\n                                                },\n                                              ],\n                                              \"message\": \"\",\n                                              \"name\": \"ReactXUIPopoverButton6\",\n                                              \"status\": \"INLINED\",\n                                            },\n                                          ],\n                                          \"message\": \"\",\n                                          \"name\": \"BIGAdAccountSelector7\",\n                                          \"status\": \"INLINED\",\n                                        },\n                                      ],\n                                      \"message\": \"\",\n                                      \"name\": \"FluxContainer_AdsPEBIGAdAccountSelectorContainer_8\",\n                                      \"status\": \"INLINED\",\n                                    },\n                                  ],\n                                  \"message\": \"\",\n                                  \"name\": \"ErrorBoundary9\",\n                                  \"status\": \"INLINED\",\n                                },\n                              ],\n                              \"message\": \"\",\n                              \"name\": \"AdsErrorBoundary10\",\n                              \"status\": \"INLINED\",\n                            },\n                            Object {\n                              \"children\": Array [\n                                Object {\n                                  \"children\": Array [\n                                    Object {\n                                      \"children\": Array [\n                                        Object {\n                                          \"children\": Array [],\n                                          \"message\": \"\",\n                                          \"name\": \"AdsPENavigationBar11\",\n                                          \"status\": \"INLINED\",\n                                        },\n                                      ],\n                                      \"message\": \"\",\n                                      \"name\": \"FluxContainer_AdsPENavigationBarContainer_12\",\n                                      \"status\": \"INLINED\",\n                                    },\n                                  ],\n                                  \"message\": \"\",\n                                  \"name\": \"ErrorBoundary9\",\n                                  \"status\": \"INLINED\",\n                                },\n                              ],\n                              \"message\": \"\",\n                              \"name\": \"AdsErrorBoundary10\",\n                              \"status\": \"INLINED\",\n                            },\n                            Object {\n                              \"children\": Array [\n                                Object {\n                                  \"children\": Array [\n                                    Object {\n                                      \"children\": Array [\n                                        Object {\n                                          \"children\": Array [\n                                            Object {\n                                              \"children\": Array [\n                                                Object {\n                                                  \"children\": Array [\n                                                    Object {\n                                                      \"children\": Array [],\n                                                      \"message\": \"\",\n                                                      \"name\": \"ReactImage0\",\n                                                      \"status\": \"INLINED\",\n                                                    },\n                                                  ],\n                                                  \"message\": \"\",\n                                                  \"name\": \"AdsPEDraftSyncStatus13\",\n                                                  \"status\": \"INLINED\",\n                                                },\n                                              ],\n                                              \"message\": \"\",\n                                              \"name\": \"FluxContainer_AdsPEDraftSyncStatusContainer_14\",\n                                              \"status\": \"INLINED\",\n                                            },\n                                            Object {\n                                              \"children\": Array [\n                                                Object {\n                                                  \"children\": Array [],\n                                                  \"message\": \"\",\n                                                  \"name\": \"AdsPEDraftErrorsStatus15\",\n                                                  \"status\": \"INLINED\",\n                                                },\n                                              ],\n                                              \"message\": \"\",\n                                              \"name\": \"FluxContainer_viewFn_16\",\n                                              \"status\": \"INLINED\",\n                                            },\n                                            Object {\n                                              \"children\": Array [\n                                                Object {\n                                                  \"children\": Array [],\n                                                  \"message\": \"\",\n                                                  \"name\": \"AbstractButton3\",\n                                                  \"status\": \"INLINED\",\n                                                },\n                                              ],\n                                              \"message\": \"\",\n                                              \"name\": \"XUIButton4\",\n                                              \"status\": \"INLINED\",\n                                            },\n                                            Object {\n                                              \"children\": Array [\n                                                Object {\n                                                  \"children\": Array [\n                                                    Object {\n                                                      \"children\": Array [],\n                                                      \"message\": \"\",\n                                                      \"name\": \"ReactImage0\",\n                                                      \"status\": \"INLINED\",\n                                                    },\n                                                  ],\n                                                  \"message\": \"\",\n                                                  \"name\": \"AbstractButton3\",\n                                                  \"status\": \"INLINED\",\n                                                },\n                                              ],\n                                              \"message\": \"\",\n                                              \"name\": \"XUIButton4\",\n                                              \"status\": \"INLINED\",\n                                            },\n                                          ],\n                                          \"message\": \"\",\n                                          \"name\": \"AdsPEPublishButton17\",\n                                          \"status\": \"INLINED\",\n                                        },\n                                      ],\n                                      \"message\": \"\",\n                                      \"name\": \"FluxContainer_AdsPEPublishButtonContainer_18\",\n                                      \"status\": \"INLINED\",\n                                    },\n                                  ],\n                                  \"message\": \"\",\n                                  \"name\": \"ErrorBoundary9\",\n                                  \"status\": \"INLINED\",\n                                },\n                              ],\n                              \"message\": \"\",\n                              \"name\": \"AdsErrorBoundary10\",\n                              \"status\": \"INLINED\",\n                            },\n                            Object {\n                              \"children\": Array [\n                                Object {\n                                  \"children\": Array [\n                                    Object {\n                                      \"children\": Array [\n                                        Object {\n                                          \"children\": Array [\n                                            Object {\n                                              \"children\": Array [],\n                                              \"message\": \"\",\n                                              \"name\": \"ReactImage0\",\n                                              \"status\": \"INLINED\",\n                                            },\n                                          ],\n                                          \"message\": \"\",\n                                          \"name\": \"InlineBlock19\",\n                                          \"status\": \"INLINED\",\n                                        },\n                                      ],\n                                      \"message\": \"\",\n                                      \"name\": \"ReactPopoverMenu20\",\n                                      \"status\": \"INLINED\",\n                                    },\n                                  ],\n                                  \"message\": \"\",\n                                  \"name\": \"ErrorBoundary9\",\n                                  \"status\": \"INLINED\",\n                                },\n                              ],\n                              \"message\": \"\",\n                              \"name\": \"AdsErrorBoundary10\",\n                              \"status\": \"INLINED\",\n                            },\n                          ],\n                          \"message\": \"\",\n                          \"name\": \"LeftRight21\",\n                          \"status\": \"INLINED\",\n                        },\n                      ],\n                      \"message\": \"\",\n                      \"name\": \"AdsUnifiedNavigationLocalNav22\",\n                      \"status\": \"INLINED\",\n                    },\n                    Object {\n                      \"children\": Array [\n                        Object {\n                          \"children\": Array [\n                            Object {\n                              \"children\": Array [\n                                Object {\n                                  \"children\": Array [],\n                                  \"message\": \"\",\n                                  \"name\": \"XUIDialog23\",\n                                  \"status\": \"INLINED\",\n                                },\n                              ],\n                              \"message\": \"\",\n                              \"name\": \"AdsPEResetDialog24\",\n                              \"status\": \"INLINED\",\n                            },\n                          ],\n                          \"message\": \"\",\n                          \"name\": \"ErrorBoundary9\",\n                          \"status\": \"INLINED\",\n                        },\n                      ],\n                      \"message\": \"\",\n                      \"name\": \"AdsErrorBoundary10\",\n                      \"status\": \"INLINED\",\n                    },\n                  ],\n                  \"message\": \"\",\n                  \"name\": \"AdsPETopNav25\",\n                  \"status\": \"INLINED\",\n                },\n              ],\n              \"message\": \"\",\n              \"name\": \"FluxContainer_AdsPETopNavContainer_26\",\n              \"status\": \"INLINED\",\n            },\n            Object {\n              \"children\": Array [\n                Object {\n                  \"children\": Array [\n                    Object {\n                      \"children\": Array [\n                        Object {\n                          \"children\": Array [\n                            Object {\n                              \"children\": Array [\n                                Object {\n                                  \"children\": Array [\n                                    Object {\n                                      \"children\": Array [\n                                        Object {\n                                          \"children\": Array [\n                                            Object {\n                                              \"children\": Array [\n                                                Object {\n                                                  \"children\": Array [\n                                                    Object {\n                                                      \"children\": Array [],\n                                                      \"message\": \"\",\n                                                      \"name\": \"ReactImage0\",\n                                                      \"status\": \"INLINED\",\n                                                    },\n                                                    Object {\n                                                      \"children\": Array [\n                                                        Object {\n                                                          \"children\": Array [\n                                                            Object {\n                                                              \"children\": Array [\n                                                                Object {\n                                                                  \"children\": Array [\n                                                                    Object {\n                                                                      \"children\": Array [],\n                                                                      \"message\": \"\",\n                                                                      \"name\": \"AbstractLink1\",\n                                                                      \"status\": \"INLINED\",\n                                                                    },\n                                                                  ],\n                                                                  \"message\": \"\",\n                                                                  \"name\": \"Link2\",\n                                                                  \"status\": \"INLINED\",\n                                                                },\n                                                              ],\n                                                              \"message\": \"\",\n                                                              \"name\": \"AbstractButton3\",\n                                                              \"status\": \"INLINED\",\n                                                            },\n                                                          ],\n                                                          \"message\": \"\",\n                                                          \"name\": \"XUIAbstractGlyphButton27\",\n                                                          \"status\": \"INLINED\",\n                                                        },\n                                                      ],\n                                                      \"message\": \"\",\n                                                      \"name\": \"XUICloseButton28\",\n                                                      \"status\": \"INLINED\",\n                                                    },\n                                                    Object {\n                                                      \"children\": Array [\n                                                        Object {\n                                                          \"children\": Array [\n                                                            Object {\n                                                              \"children\": Array [],\n                                                              \"message\": \"\",\n                                                              \"name\": \"XUIText29\",\n                                                              \"status\": \"INLINED\",\n                                                            },\n                                                          ],\n                                                          \"message\": \"\",\n                                                          \"name\": \"AbstractLink1\",\n                                                          \"status\": \"INLINED\",\n                                                        },\n                                                      ],\n                                                      \"message\": \"\",\n                                                      \"name\": \"Link2\",\n                                                      \"status\": \"INLINED\",\n                                                    },\n                                                  ],\n                                                  \"message\": \"\",\n                                                  \"name\": \"XUINotice30\",\n                                                  \"status\": \"INLINED\",\n                                                },\n                                              ],\n                                              \"message\": \"\",\n                                              \"name\": \"ReactCSSTransitionGroupChild31\",\n                                              \"status\": \"INLINED\",\n                                            },\n                                          ],\n                                          \"message\": \"\",\n                                          \"name\": \"ReactTransitionGroup32\",\n                                          \"status\": \"INLINED\",\n                                        },\n                                      ],\n                                      \"message\": \"\",\n                                      \"name\": \"ReactCSSTransitionGroup33\",\n                                      \"status\": \"INLINED\",\n                                    },\n                                  ],\n                                  \"message\": \"\",\n                                  \"name\": \"AdsPETopError34\",\n                                  \"status\": \"INLINED\",\n                                },\n                              ],\n                              \"message\": \"\",\n                              \"name\": \"FluxContainer_AdsPETopErrorContainer_35\",\n                              \"status\": \"INLINED\",\n                            },\n                          ],\n                          \"message\": \"\",\n                          \"name\": \"ErrorBoundary9\",\n                          \"status\": \"INLINED\",\n                        },\n                      ],\n                      \"message\": \"\",\n                      \"name\": \"AdsErrorBoundary10\",\n                      \"status\": \"INLINED\",\n                    },\n                    Object {\n                      \"children\": Array [\n                        Object {\n                          \"children\": Array [\n                            Object {\n                              \"children\": Array [],\n                              \"message\": \"\",\n                              \"name\": \"FluxContainer_AdsGuidanceChannel_36\",\n                              \"status\": \"INLINED\",\n                            },\n                          ],\n                          \"message\": \"\",\n                          \"name\": \"ErrorBoundary9\",\n                          \"status\": \"INLINED\",\n                        },\n                      ],\n                      \"message\": \"\",\n                      \"name\": \"AdsErrorBoundary10\",\n                      \"status\": \"INLINED\",\n                    },\n                  ],\n                  \"message\": \"\",\n                  \"name\": \"ResponsiveBlock37\",\n                  \"status\": \"INLINED\",\n                },\n                Object {\n                  \"children\": Array [\n                    Object {\n                      \"children\": Array [\n                        Object {\n                          \"children\": Array [\n                            Object {\n                              \"children\": Array [\n                                Object {\n                                  \"children\": Array [\n                                    Object {\n                                      \"children\": Array [\n                                        Object {\n                                          \"children\": Array [],\n                                          \"message\": \"\",\n                                          \"name\": \"FluxContainer_AdsBulkEditDialogContainer_38\",\n                                          \"status\": \"INLINED\",\n                                        },\n                                      ],\n                                      \"message\": \"\",\n                                      \"name\": \"ErrorBoundary9\",\n                                      \"status\": \"INLINED\",\n                                    },\n                                  ],\n                                  \"message\": \"\",\n                                  \"name\": \"AdsErrorBoundary10\",\n                                  \"status\": \"INLINED\",\n                                },\n                                Object {\n                                  \"children\": Array [\n                                    Object {\n                                      \"children\": Array [\n                                        Object {\n                                          \"children\": Array [\n                                            Object {\n                                              \"children\": Array [\n                                                Object {\n                                                  \"children\": Array [\n                                                    Object {\n                                                      \"children\": Array [],\n                                                      \"message\": \"\",\n                                                      \"name\": \"Column39\",\n                                                      \"status\": \"INLINED\",\n                                                    },\n                                                    Object {\n                                                      \"children\": Array [\n                                                        Object {\n                                                          \"children\": Array [\n                                                            Object {\n                                                              \"children\": Array [\n                                                                Object {\n                                                                  \"children\": Array [\n                                                                    Object {\n                                                                      \"children\": Array [],\n                                                                      \"message\": \"\",\n                                                                      \"name\": \"ReactImage0\",\n                                                                      \"status\": \"INLINED\",\n                                                                    },\n                                                                  ],\n                                                                  \"message\": \"\",\n                                                                  \"name\": \"AbstractButton3\",\n                                                                  \"status\": \"INLINED\",\n                                                                },\n                                                              ],\n                                                              \"message\": \"\",\n                                                              \"name\": \"XUIButton4\",\n                                                              \"status\": \"INLINED\",\n                                                            },\n                                                            Object {\n                                                              \"children\": Array [\n                                                                Object {\n                                                                  \"children\": Array [\n                                                                    Object {\n                                                                      \"children\": Array [\n                                                                        Object {\n                                                                          \"children\": Array [\n                                                                            Object {\n                                                                              \"children\": Array [],\n                                                                              \"message\": \"\",\n                                                                              \"name\": \"ReactImage0\",\n                                                                              \"status\": \"INLINED\",\n                                                                            },\n                                                                          ],\n                                                                          \"message\": \"\",\n                                                                          \"name\": \"AbstractButton3\",\n                                                                          \"status\": \"INLINED\",\n                                                                        },\n                                                                      ],\n                                                                      \"message\": \"\",\n                                                                      \"name\": \"XUIButton4\",\n                                                                      \"status\": \"INLINED\",\n                                                                    },\n                                                                  ],\n                                                                  \"message\": \"\",\n                                                                  \"name\": \"InlineBlock19\",\n                                                                  \"status\": \"INLINED\",\n                                                                },\n                                                              ],\n                                                              \"message\": \"\",\n                                                              \"name\": \"ReactPopoverMenu20\",\n                                                              \"status\": \"INLINED\",\n                                                            },\n                                                          ],\n                                                          \"message\": \"\",\n                                                          \"name\": \"XUIButtonGroup40\",\n                                                          \"status\": \"INLINED\",\n                                                        },\n                                                        Object {\n                                                          \"children\": Array [\n                                                            Object {\n                                                              \"children\": Array [\n                                                                Object {\n                                                                  \"children\": Array [\n                                                                    Object {\n                                                                      \"children\": Array [\n                                                                        Object {\n                                                                          \"children\": Array [\n                                                                            Object {\n                                                                              \"children\": Array [\n                                                                                Object {\n                                                                                  \"children\": Array [],\n                                                                                  \"message\": \"\",\n                                                                                  \"name\": \"ReactImage0\",\n                                                                                  \"status\": \"INLINED\",\n                                                                                },\n                                                                              ],\n                                                                              \"message\": \"\",\n                                                                              \"name\": \"AbstractButton3\",\n                                                                              \"status\": \"INLINED\",\n                                                                            },\n                                                                          ],\n                                                                          \"message\": \"\",\n                                                                          \"name\": \"XUIButton4\",\n                                                                          \"status\": \"INLINED\",\n                                                                        },\n                                                                        Object {\n                                                                          \"children\": Array [\n                                                                            Object {\n                                                                              \"children\": Array [\n                                                                                Object {\n                                                                                  \"children\": Array [\n                                                                                    Object {\n                                                                                      \"children\": Array [\n                                                                                        Object {\n                                                                                          \"children\": Array [],\n                                                                                          \"message\": \"\",\n                                                                                          \"name\": \"ReactImage0\",\n                                                                                          \"status\": \"INLINED\",\n                                                                                        },\n                                                                                      ],\n                                                                                      \"message\": \"\",\n                                                                                      \"name\": \"AbstractButton3\",\n                                                                                      \"status\": \"INLINED\",\n                                                                                    },\n                                                                                  ],\n                                                                                  \"message\": \"\",\n                                                                                  \"name\": \"XUIButton4\",\n                                                                                  \"status\": \"INLINED\",\n                                                                                },\n                                                                              ],\n                                                                              \"message\": \"\",\n                                                                              \"name\": \"InlineBlock19\",\n                                                                              \"status\": \"INLINED\",\n                                                                            },\n                                                                          ],\n                                                                          \"message\": \"\",\n                                                                          \"name\": \"ReactPopoverMenu20\",\n                                                                          \"status\": \"INLINED\",\n                                                                        },\n                                                                      ],\n                                                                      \"message\": \"\",\n                                                                      \"name\": \"XUIButtonGroup40\",\n                                                                      \"status\": \"INLINED\",\n                                                                    },\n                                                                  ],\n                                                                  \"message\": \"\",\n                                                                  \"name\": \"AdsPEEditToolbarButton41\",\n                                                                  \"status\": \"INLINED\",\n                                                                },\n                                                              ],\n                                                              \"message\": \"\",\n                                                              \"name\": \"FluxContainer_AdsPEEditCampaignGroupToolbarButtonContainer_42\",\n                                                              \"status\": \"INLINED\",\n                                                            },\n                                                          ],\n                                                          \"message\": \"\",\n                                                          \"name\": \"FluxContainer_AdsPEEditToolbarButtonContainer_43\",\n                                                          \"status\": \"INLINED\",\n                                                        },\n                                                        Object {\n                                                          \"children\": Array [\n                                                            Object {\n                                                              \"children\": Array [\n                                                                Object {\n                                                                  \"children\": Array [\n                                                                    Object {\n                                                                      \"children\": Array [],\n                                                                      \"message\": \"\",\n                                                                      \"name\": \"ReactImage0\",\n                                                                      \"status\": \"INLINED\",\n                                                                    },\n                                                                  ],\n                                                                  \"message\": \"\",\n                                                                  \"name\": \"AbstractButton3\",\n                                                                  \"status\": \"INLINED\",\n                                                                },\n                                                              ],\n                                                              \"message\": \"\",\n                                                              \"name\": \"XUIButton4\",\n                                                              \"status\": \"INLINED\",\n                                                            },\n                                                            Object {\n                                                              \"children\": Array [\n                                                                Object {\n                                                                  \"children\": Array [\n                                                                    Object {\n                                                                      \"children\": Array [],\n                                                                      \"message\": \"\",\n                                                                      \"name\": \"ReactImage0\",\n                                                                      \"status\": \"INLINED\",\n                                                                    },\n                                                                  ],\n                                                                  \"message\": \"\",\n                                                                  \"name\": \"AbstractButton3\",\n                                                                  \"status\": \"INLINED\",\n                                                                },\n                                                              ],\n                                                              \"message\": \"\",\n                                                              \"name\": \"XUIButton4\",\n                                                              \"status\": \"INLINED\",\n                                                            },\n                                                            Object {\n                                                              \"children\": Array [\n                                                                Object {\n                                                                  \"children\": Array [\n                                                                    Object {\n                                                                      \"children\": Array [],\n                                                                      \"message\": \"\",\n                                                                      \"name\": \"ReactImage0\",\n                                                                      \"status\": \"INLINED\",\n                                                                    },\n                                                                  ],\n                                                                  \"message\": \"\",\n                                                                  \"name\": \"AbstractButton3\",\n                                                                  \"status\": \"INLINED\",\n                                                                },\n                                                              ],\n                                                              \"message\": \"\",\n                                                              \"name\": \"XUIButton4\",\n                                                              \"status\": \"INLINED\",\n                                                            },\n                                                          ],\n                                                          \"message\": \"\",\n                                                          \"name\": \"XUIButtonGroup40\",\n                                                          \"status\": \"INLINED\",\n                                                        },\n                                                        Object {\n                                                          \"children\": Array [\n                                                            Object {\n                                                              \"children\": Array [\n                                                                Object {\n                                                                  \"children\": Array [\n                                                                    Object {\n                                                                      \"children\": Array [\n                                                                        Object {\n                                                                          \"children\": Array [\n                                                                            Object {\n                                                                              \"children\": Array [\n                                                                                Object {\n                                                                                  \"children\": Array [\n                                                                                    Object {\n                                                                                      \"children\": Array [],\n                                                                                      \"message\": \"\",\n                                                                                      \"name\": \"ReactImage0\",\n                                                                                      \"status\": \"INLINED\",\n                                                                                    },\n                                                                                  ],\n                                                                                  \"message\": \"\",\n                                                                                  \"name\": \"AbstractButton3\",\n                                                                                  \"status\": \"INLINED\",\n                                                                                },\n                                                                              ],\n                                                                              \"message\": \"\",\n                                                                              \"name\": \"XUIButton4\",\n                                                                              \"status\": \"INLINED\",\n                                                                            },\n                                                                          ],\n                                                                          \"message\": \"\",\n                                                                          \"name\": \"InlineBlock19\",\n                                                                          \"status\": \"INLINED\",\n                                                                        },\n                                                                      ],\n                                                                      \"message\": \"\",\n                                                                      \"name\": \"ReactPopoverMenu20\",\n                                                                      \"status\": \"INLINED\",\n                                                                    },\n                                                                  ],\n                                                                  \"message\": \"\",\n                                                                  \"name\": \"AdsPEExportImportMenu44\",\n                                                                  \"status\": \"INLINED\",\n                                                                },\n                                                                Object {\n                                                                  \"children\": Array [],\n                                                                  \"message\": \"\",\n                                                                  \"name\": \"FluxContainer_AdsPECustomizeExportContainer_45\",\n                                                                  \"status\": \"INLINED\",\n                                                                },\n                                                                Object {\n                                                                  \"children\": Array [\n                                                                    Object {\n                                                                      \"children\": Array [],\n                                                                      \"message\": \"\",\n                                                                      \"name\": \"AdsPEExportAsTextDialog46\",\n                                                                      \"status\": \"INLINED\",\n                                                                    },\n                                                                  ],\n                                                                  \"message\": \"\",\n                                                                  \"name\": \"FluxContainer_AdsPEExportAsTextDialogContainer_47\",\n                                                                  \"status\": \"INLINED\",\n                                                                },\n                                                              ],\n                                                              \"message\": \"\",\n                                                              \"name\": \"AdsPEExportImportMenuContainer48\",\n                                                              \"status\": \"INLINED\",\n                                                            },\n                                                            Object {\n                                                              \"children\": Array [\n                                                                Object {\n                                                                  \"children\": Array [\n                                                                    Object {\n                                                                      \"children\": Array [],\n                                                                      \"message\": \"\",\n                                                                      \"name\": \"ReactImage0\",\n                                                                      \"status\": \"INLINED\",\n                                                                    },\n                                                                  ],\n                                                                  \"message\": \"\",\n                                                                  \"name\": \"AbstractButton3\",\n                                                                  \"status\": \"INLINED\",\n                                                                },\n                                                              ],\n                                                              \"message\": \"\",\n                                                              \"name\": \"XUIButton4\",\n                                                              \"status\": \"INLINED\",\n                                                            },\n                                                            Object {\n                                                              \"children\": Array [\n                                                                Object {\n                                                                  \"children\": Array [\n                                                                    Object {\n                                                                      \"children\": Array [\n                                                                        Object {\n                                                                          \"children\": Array [\n                                                                            Object {\n                                                                              \"children\": Array [],\n                                                                              \"message\": \"\",\n                                                                              \"name\": \"ReactImage0\",\n                                                                              \"status\": \"INLINED\",\n                                                                            },\n                                                                          ],\n                                                                          \"message\": \"\",\n                                                                          \"name\": \"AbstractButton3\",\n                                                                          \"status\": \"INLINED\",\n                                                                        },\n                                                                      ],\n                                                                      \"message\": \"\",\n                                                                      \"name\": \"XUIButton4\",\n                                                                      \"status\": \"INLINED\",\n                                                                    },\n                                                                    Object {\n                                                                      \"children\": Array [],\n                                                                      \"message\": \"\",\n                                                                      \"name\": \"Constructor49\",\n                                                                      \"status\": \"INLINED\",\n                                                                    },\n                                                                  ],\n                                                                  \"message\": \"\",\n                                                                  \"name\": \"TagSelectorPopover50\",\n                                                                  \"status\": \"INLINED\",\n                                                                },\n                                                              ],\n                                                              \"message\": \"\",\n                                                              \"name\": \"AdsPECampaignGroupTagContainer51\",\n                                                              \"status\": \"INLINED\",\n                                                            },\n                                                          ],\n                                                          \"message\": \"\",\n                                                          \"name\": \"XUIButtonGroup40\",\n                                                          \"status\": \"INLINED\",\n                                                        },\n                                                        Object {\n                                                          \"children\": Array [\n                                                            Object {\n                                                              \"children\": Array [],\n                                                              \"message\": \"\",\n                                                              \"name\": \"AdsRuleToolbarMenu52\",\n                                                              \"status\": \"INLINED\",\n                                                            },\n                                                          ],\n                                                          \"message\": \"\",\n                                                          \"name\": \"FluxContainer_AdsPERuleToolbarMenuContainer_53\",\n                                                          \"status\": \"INLINED\",\n                                                        },\n                                                      ],\n                                                      \"message\": \"\",\n                                                      \"name\": \"FillColumn54\",\n                                                      \"status\": \"INLINED\",\n                                                    },\n                                                  ],\n                                                  \"message\": \"\",\n                                                  \"name\": \"Layout55\",\n                                                  \"status\": \"INLINED\",\n                                                },\n                                              ],\n                                              \"message\": \"\",\n                                              \"name\": \"AdsPEMainPaneToolbar56\",\n                                              \"status\": \"INLINED\",\n                                            },\n                                          ],\n                                          \"message\": \"\",\n                                          \"name\": \"AdsPECampaignGroupToolbarContainer57\",\n                                          \"status\": \"INLINED\",\n                                        },\n                                      ],\n                                      \"message\": \"\",\n                                      \"name\": \"ErrorBoundary9\",\n                                      \"status\": \"INLINED\",\n                                    },\n                                  ],\n                                  \"message\": \"\",\n                                  \"name\": \"AdsErrorBoundary10\",\n                                  \"status\": \"INLINED\",\n                                },\n                                Object {\n                                  \"children\": Array [\n                                    Object {\n                                      \"children\": Array [\n                                        Object {\n                                          \"children\": Array [\n                                            Object {\n                                              \"children\": Array [\n                                                Object {\n                                                  \"children\": Array [\n                                                    Object {\n                                                      \"children\": Array [\n                                                        Object {\n                                                          \"children\": Array [\n                                                            Object {\n                                                              \"children\": Array [\n                                                                Object {\n                                                                  \"children\": Array [\n                                                                    Object {\n                                                                      \"children\": Array [\n                                                                        Object {\n                                                                          \"children\": Array [\n                                                                            Object {\n                                                                              \"children\": Array [],\n                                                                              \"message\": \"\",\n                                                                              \"name\": \"ReactImage0\",\n                                                                              \"status\": \"INLINED\",\n                                                                            },\n                                                                            Object {\n                                                                              \"children\": Array [],\n                                                                              \"message\": \"\",\n                                                                              \"name\": \"ReactImage0\",\n                                                                              \"status\": \"INLINED\",\n                                                                            },\n                                                                          ],\n                                                                          \"message\": \"\",\n                                                                          \"name\": \"AbstractLink1\",\n                                                                          \"status\": \"INLINED\",\n                                                                        },\n                                                                      ],\n                                                                      \"message\": \"\",\n                                                                      \"name\": \"Link2\",\n                                                                      \"status\": \"INLINED\",\n                                                                    },\n                                                                  ],\n                                                                  \"message\": \"\",\n                                                                  \"name\": \"AbstractButton3\",\n                                                                  \"status\": \"INLINED\",\n                                                                },\n                                                              ],\n                                                              \"message\": \"\",\n                                                              \"name\": \"XUIButton4\",\n                                                              \"status\": \"INLINED\",\n                                                            },\n                                                          ],\n                                                          \"message\": \"\",\n                                                          \"name\": \"AbstractPopoverButton5\",\n                                                          \"status\": \"INLINED\",\n                                                        },\n                                                      ],\n                                                      \"message\": \"\",\n                                                      \"name\": \"ReactXUIPopoverButton6\",\n                                                      \"status\": \"INLINED\",\n                                                    },\n                                                    Object {\n                                                      \"children\": Array [\n                                                        Object {\n                                                          \"children\": Array [\n                                                            Object {\n                                                              \"children\": Array [\n                                                                Object {\n                                                                  \"children\": Array [\n                                                                    Object {\n                                                                      \"children\": Array [\n                                                                        Object {\n                                                                          \"children\": Array [\n                                                                            Object {\n                                                                              \"children\": Array [],\n                                                                              \"message\": \"\",\n                                                                              \"name\": \"ReactImage0\",\n                                                                              \"status\": \"INLINED\",\n                                                                            },\n                                                                            Object {\n                                                                              \"children\": Array [],\n                                                                              \"message\": \"\",\n                                                                              \"name\": \"ReactImage0\",\n                                                                              \"status\": \"INLINED\",\n                                                                            },\n                                                                          ],\n                                                                          \"message\": \"\",\n                                                                          \"name\": \"AbstractLink1\",\n                                                                          \"status\": \"INLINED\",\n                                                                        },\n                                                                      ],\n                                                                      \"message\": \"\",\n                                                                      \"name\": \"Link2\",\n                                                                      \"status\": \"INLINED\",\n                                                                    },\n                                                                  ],\n                                                                  \"message\": \"\",\n                                                                  \"name\": \"AbstractButton3\",\n                                                                  \"status\": \"INLINED\",\n                                                                },\n                                                              ],\n                                                              \"message\": \"\",\n                                                              \"name\": \"XUIButton4\",\n                                                              \"status\": \"INLINED\",\n                                                            },\n                                                          ],\n                                                          \"message\": \"\",\n                                                          \"name\": \"AbstractPopoverButton5\",\n                                                          \"status\": \"INLINED\",\n                                                        },\n                                                      ],\n                                                      \"message\": \"\",\n                                                      \"name\": \"ReactXUIPopoverButton6\",\n                                                      \"status\": \"INLINED\",\n                                                    },\n                                                    Object {\n                                                      \"children\": Array [],\n                                                      \"message\": \"\",\n                                                      \"name\": \"Constructor49\",\n                                                      \"status\": \"INLINED\",\n                                                    },\n                                                    Object {\n                                                      \"children\": Array [],\n                                                      \"message\": \"\",\n                                                      \"name\": \"Constructor49\",\n                                                      \"status\": \"INLINED\",\n                                                    },\n                                                  ],\n                                                  \"message\": \"\",\n                                                  \"name\": \"AdsPEFiltersPopover58\",\n                                                  \"status\": \"INLINED\",\n                                                },\n                                                Object {\n                                                  \"children\": Array [\n                                                    Object {\n                                                      \"children\": Array [\n                                                        Object {\n                                                          \"children\": Array [],\n                                                          \"message\": \"\",\n                                                          \"name\": \"AbstractCheckboxInput59\",\n                                                          \"status\": \"INLINED\",\n                                                        },\n                                                      ],\n                                                      \"message\": \"\",\n                                                      \"name\": \"XUICheckboxInput60\",\n                                                      \"status\": \"INLINED\",\n                                                    },\n                                                  ],\n                                                  \"message\": \"\",\n                                                  \"name\": \"InputLabel61\",\n                                                  \"status\": \"INLINED\",\n                                                },\n                                                Object {\n                                                  \"children\": Array [\n                                                    Object {\n                                                      \"children\": Array [\n                                                        Object {\n                                                          \"children\": Array [],\n                                                          \"message\": \"\",\n                                                          \"name\": \"ReactImage0\",\n                                                          \"status\": \"INLINED\",\n                                                        },\n                                                        Object {\n                                                          \"children\": Array [\n                                                            Object {\n                                                              \"children\": Array [\n                                                                Object {\n                                                                  \"children\": Array [],\n                                                                  \"message\": \"\",\n                                                                  \"name\": \"AbstractButton3\",\n                                                                  \"status\": \"INLINED\",\n                                                                },\n                                                              ],\n                                                              \"message\": \"\",\n                                                              \"name\": \"XUIAbstractGlyphButton27\",\n                                                              \"status\": \"INLINED\",\n                                                            },\n                                                          ],\n                                                          \"message\": \"\",\n                                                          \"name\": \"XUICloseButton28\",\n                                                          \"status\": \"INLINED\",\n                                                        },\n                                                        Object {\n                                                          \"children\": Array [\n                                                            Object {\n                                                              \"children\": Array [],\n                                                              \"message\": \"\",\n                                                              \"name\": \"ReactImage0\",\n                                                              \"status\": \"INLINED\",\n                                                            },\n                                                            Object {\n                                                              \"children\": Array [\n                                                                Object {\n                                                                  \"children\": Array [\n                                                                    Object {\n                                                                      \"children\": Array [],\n                                                                      \"message\": \"\",\n                                                                      \"name\": \"ReactImage0\",\n                                                                      \"status\": \"INLINED\",\n                                                                    },\n                                                                  ],\n                                                                  \"message\": \"\",\n                                                                  \"name\": \"AdsPopoverLink62\",\n                                                                  \"status\": \"INLINED\",\n                                                                },\n                                                              ],\n                                                              \"message\": \"\",\n                                                              \"name\": \"AdsHelpLink63\",\n                                                              \"status\": \"INLINED\",\n                                                            },\n                                                            Object {\n                                                              \"children\": Array [\n                                                                Object {\n                                                                  \"children\": Array [],\n                                                                  \"message\": \"\",\n                                                                  \"name\": \"AbstractButton3\",\n                                                                  \"status\": \"INLINED\",\n                                                                },\n                                                              ],\n                                                              \"message\": \"\",\n                                                              \"name\": \"XUIButton4\",\n                                                              \"status\": \"INLINED\",\n                                                            },\n                                                          ],\n                                                          \"message\": \"\",\n                                                          \"name\": \"BUIFilterTokenInput64\",\n                                                          \"status\": \"INLINED\",\n                                                        },\n                                                      ],\n                                                      \"message\": \"\",\n                                                      \"name\": \"BUIFilterToken65\",\n                                                      \"status\": \"INLINED\",\n                                                    },\n                                                    Object {\n                                                      \"children\": Array [\n                                                        Object {\n                                                          \"children\": Array [\n                                                            Object {\n                                                              \"children\": Array [\n                                                                Object {\n                                                                  \"children\": Array [],\n                                                                  \"message\": \"\",\n                                                                  \"name\": \"ReactImage0\",\n                                                                  \"status\": \"INLINED\",\n                                                                },\n                                                              ],\n                                                              \"message\": \"\",\n                                                              \"name\": \"AbstractButton3\",\n                                                              \"status\": \"INLINED\",\n                                                            },\n                                                          ],\n                                                          \"message\": \"\",\n                                                          \"name\": \"XUIButton4\",\n                                                          \"status\": \"INLINED\",\n                                                        },\n                                                      ],\n                                                      \"message\": \"\",\n                                                      \"name\": \"BUIFilterTokenCreateButton66\",\n                                                      \"status\": \"INLINED\",\n                                                    },\n                                                  ],\n                                                  \"message\": \"\",\n                                                  \"name\": \"BUIFilterTokenizer67\",\n                                                  \"status\": \"INLINED\",\n                                                },\n                                                Object {\n                                                  \"children\": Array [\n                                                    Object {\n                                                      \"children\": Array [\n                                                        Object {\n                                                          \"children\": Array [],\n                                                          \"message\": \"\",\n                                                          \"name\": \"XUIAmbientNUX68\",\n                                                          \"status\": \"INLINED\",\n                                                        },\n                                                      ],\n                                                      \"message\": \"\",\n                                                      \"name\": \"XUIAmbientNUX69\",\n                                                      \"status\": \"INLINED\",\n                                                    },\n                                                  ],\n                                                  \"message\": \"\",\n                                                  \"name\": \"AdsPEAmbientNUXMegaphone70\",\n                                                  \"status\": \"INLINED\",\n                                                },\n                                              ],\n                                              \"message\": \"\",\n                                              \"name\": \"AdsPEFilters71\",\n                                              \"status\": \"INLINED\",\n                                            },\n                                          ],\n                                          \"message\": \"\",\n                                          \"name\": \"AdsPEFilterContainer72\",\n                                          \"status\": \"INLINED\",\n                                        },\n                                      ],\n                                      \"message\": \"\",\n                                      \"name\": \"ErrorBoundary9\",\n                                      \"status\": \"INLINED\",\n                                    },\n                                  ],\n                                  \"message\": \"\",\n                                  \"name\": \"AdsErrorBoundary10\",\n                                  \"status\": \"INLINED\",\n                                },\n                                Object {\n                                  \"children\": Array [\n                                    Object {\n                                      \"children\": Array [\n                                        Object {\n                                          \"children\": Array [\n                                            Object {\n                                              \"children\": Array [\n                                                Object {\n                                                  \"children\": Array [],\n                                                  \"message\": \"\",\n                                                  \"name\": \"AdsPETablePager73\",\n                                                  \"status\": \"INLINED\",\n                                                },\n                                              ],\n                                              \"message\": \"\",\n                                              \"name\": \"AdsPECampaignGroupTablePagerContainer74\",\n                                              \"status\": \"INLINED\",\n                                            },\n                                          ],\n                                          \"message\": \"\",\n                                          \"name\": \"AdsPETablePagerContainer75\",\n                                          \"status\": \"INLINED\",\n                                        },\n                                      ],\n                                      \"message\": \"\",\n                                      \"name\": \"ErrorBoundary9\",\n                                      \"status\": \"INLINED\",\n                                    },\n                                  ],\n                                  \"message\": \"\",\n                                  \"name\": \"AdsErrorBoundary10\",\n                                  \"status\": \"INLINED\",\n                                },\n                                Object {\n                                  \"children\": Array [\n                                    Object {\n                                      \"children\": Array [\n                                        Object {\n                                          \"children\": Array [\n                                            Object {\n                                              \"children\": Array [\n                                                Object {\n                                                  \"children\": Array [\n                                                    Object {\n                                                      \"children\": Array [\n                                                        Object {\n                                                          \"children\": Array [\n                                                            Object {\n                                                              \"children\": Array [\n                                                                Object {\n                                                                  \"children\": Array [\n                                                                    Object {\n                                                                      \"children\": Array [\n                                                                        Object {\n                                                                          \"children\": Array [\n                                                                            Object {\n                                                                              \"children\": Array [],\n                                                                              \"message\": \"\",\n                                                                              \"name\": \"ReactImage0\",\n                                                                              \"status\": \"INLINED\",\n                                                                            },\n                                                                          ],\n                                                                          \"message\": \"\",\n                                                                          \"name\": \"AbstractLink1\",\n                                                                          \"status\": \"INLINED\",\n                                                                        },\n                                                                      ],\n                                                                      \"message\": \"\",\n                                                                      \"name\": \"Link2\",\n                                                                      \"status\": \"INLINED\",\n                                                                    },\n                                                                  ],\n                                                                  \"message\": \"\",\n                                                                  \"name\": \"AbstractButton3\",\n                                                                  \"status\": \"INLINED\",\n                                                                },\n                                                              ],\n                                                              \"message\": \"\",\n                                                              \"name\": \"ReactXUIError76\",\n                                                              \"status\": \"INLINED\",\n                                                            },\n                                                          ],\n                                                          \"message\": \"\",\n                                                          \"name\": \"BUIPopoverButton77\",\n                                                          \"status\": \"INLINED\",\n                                                        },\n                                                        Object {\n                                                          \"children\": Array [],\n                                                          \"message\": \"\",\n                                                          \"name\": \"Constructor49\",\n                                                          \"status\": \"INLINED\",\n                                                        },\n                                                      ],\n                                                      \"message\": \"\",\n                                                      \"name\": \"BUIDateRangePicker78\",\n                                                      \"status\": \"INLINED\",\n                                                    },\n                                                  ],\n                                                  \"message\": \"\",\n                                                  \"name\": \"AdsPEStatsRangePicker79\",\n                                                  \"status\": \"INLINED\",\n                                                },\n                                                Object {\n                                                  \"children\": Array [\n                                                    Object {\n                                                      \"children\": Array [\n                                                        Object {\n                                                          \"children\": Array [],\n                                                          \"message\": \"\",\n                                                          \"name\": \"ReactImage0\",\n                                                          \"status\": \"INLINED\",\n                                                        },\n                                                      ],\n                                                      \"message\": \"\",\n                                                      \"name\": \"AbstractButton3\",\n                                                      \"status\": \"INLINED\",\n                                                    },\n                                                  ],\n                                                  \"message\": \"\",\n                                                  \"name\": \"XUIButton4\",\n                                                  \"status\": \"INLINED\",\n                                                },\n                                                Object {\n                                                  \"children\": Array [\n                                                    Object {\n                                                      \"children\": Array [],\n                                                      \"message\": \"\",\n                                                      \"name\": \"XUIAmbientNUX68\",\n                                                      \"status\": \"INLINED\",\n                                                    },\n                                                  ],\n                                                  \"message\": \"\",\n                                                  \"name\": \"XUIAmbientNUX69\",\n                                                  \"status\": \"INLINED\",\n                                                },\n                                              ],\n                                              \"message\": \"\",\n                                              \"name\": \"AdsPEStatRange80\",\n                                              \"status\": \"INLINED\",\n                                            },\n                                          ],\n                                          \"message\": \"\",\n                                          \"name\": \"AdsPEStatRangeContainer81\",\n                                          \"status\": \"INLINED\",\n                                        },\n                                      ],\n                                      \"message\": \"\",\n                                      \"name\": \"ErrorBoundary9\",\n                                      \"status\": \"INLINED\",\n                                    },\n                                  ],\n                                  \"message\": \"\",\n                                  \"name\": \"AdsErrorBoundary10\",\n                                  \"status\": \"INLINED\",\n                                },\n                                Object {\n                                  \"children\": Array [\n                                    Object {\n                                      \"children\": Array [\n                                        Object {\n                                          \"children\": Array [\n                                            Object {\n                                              \"children\": Array [\n                                                Object {\n                                                  \"children\": Array [\n                                                    Object {\n                                                      \"children\": Array [\n                                                        Object {\n                                                          \"children\": Array [],\n                                                          \"message\": \"\",\n                                                          \"name\": \"ReactImage0\",\n                                                          \"status\": \"INLINED\",\n                                                        },\n                                                      ],\n                                                      \"message\": \"\",\n                                                      \"name\": \"AdsPESideTrayTabButton82\",\n                                                      \"status\": \"INLINED\",\n                                                    },\n                                                  ],\n                                                  \"message\": \"\",\n                                                  \"name\": \"AdsPEEditorTrayTabButton83\",\n                                                  \"status\": \"INLINED\",\n                                                },\n                                                Object {\n                                                  \"children\": Array [\n                                                    Object {\n                                                      \"children\": Array [\n                                                        Object {\n                                                          \"children\": Array [],\n                                                          \"message\": \"\",\n                                                          \"name\": \"ReactImage0\",\n                                                          \"status\": \"INLINED\",\n                                                        },\n                                                      ],\n                                                      \"message\": \"\",\n                                                      \"name\": \"AdsPESideTrayTabButton82\",\n                                                      \"status\": \"INLINED\",\n                                                    },\n                                                    Object {\n                                                      \"children\": Array [\n                                                        Object {\n                                                          \"children\": Array [],\n                                                          \"message\": \"\",\n                                                          \"name\": \"XUIAmbientNUX68\",\n                                                          \"status\": \"INLINED\",\n                                                        },\n                                                      ],\n                                                      \"message\": \"\",\n                                                      \"name\": \"XUIAmbientNUX69\",\n                                                      \"status\": \"INLINED\",\n                                                    },\n                                                  ],\n                                                  \"message\": \"\",\n                                                  \"name\": \"AdsPEInsightsTrayTabButton84\",\n                                                  \"status\": \"INLINED\",\n                                                },\n                                                Object {\n                                                  \"children\": Array [\n                                                    Object {\n                                                      \"children\": Array [],\n                                                      \"message\": \"\",\n                                                      \"name\": \"AdsPESideTrayTabButton82\",\n                                                      \"status\": \"INLINED\",\n                                                    },\n                                                  ],\n                                                  \"message\": \"\",\n                                                  \"name\": \"AdsPENekoDebuggerTrayTabButton85\",\n                                                  \"status\": \"INLINED\",\n                                                },\n                                                Object {\n                                                  \"children\": Array [\n                                                    Object {\n                                                      \"children\": Array [\n                                                        Object {\n                                                          \"children\": Array [\n                                                            Object {\n                                                              \"children\": Array [\n                                                                Object {\n                                                                  \"children\": Array [\n                                                                    Object {\n                                                                      \"children\": Array [\n                                                                        Object {\n                                                                          \"children\": Array [],\n                                                                          \"message\": \"\",\n                                                                          \"name\": \"XUIText29\",\n                                                                          \"status\": \"INLINED\",\n                                                                        },\n                                                                        Object {\n                                                                          \"children\": Array [],\n                                                                          \"message\": \"\",\n                                                                          \"name\": \"XUIText29\",\n                                                                          \"status\": \"INLINED\",\n                                                                        },\n                                                                        Object {\n                                                                          \"children\": Array [\n                                                                            Object {\n                                                                              \"children\": Array [\n                                                                                Object {\n                                                                                  \"children\": Array [\n                                                                                    Object {\n                                                                                      \"children\": Array [],\n                                                                                      \"message\": \"\",\n                                                                                      \"name\": \"AbstractLink1\",\n                                                                                      \"status\": \"INLINED\",\n                                                                                    },\n                                                                                  ],\n                                                                                  \"message\": \"\",\n                                                                                  \"name\": \"Link2\",\n                                                                                  \"status\": \"INLINED\",\n                                                                                },\n                                                                                Object {\n                                                                                  \"children\": Array [\n                                                                                    Object {\n                                                                                      \"children\": Array [],\n                                                                                      \"message\": \"\",\n                                                                                      \"name\": \"AbstractLink1\",\n                                                                                      \"status\": \"INLINED\",\n                                                                                    },\n                                                                                  ],\n                                                                                  \"message\": \"\",\n                                                                                  \"name\": \"Link2\",\n                                                                                  \"status\": \"INLINED\",\n                                                                                },\n                                                                              ],\n                                                                              \"message\": \"\",\n                                                                              \"name\": \"AdsPEEditorChildLink86\",\n                                                                              \"status\": \"INLINED\",\n                                                                            },\n                                                                          ],\n                                                                          \"message\": \"\",\n                                                                          \"name\": \"AdsPEEditorChildLinkContainer87\",\n                                                                          \"status\": \"INLINED\",\n                                                                        },\n                                                                      ],\n                                                                      \"message\": \"\",\n                                                                      \"name\": \"AdsPEHeaderSection88\",\n                                                                      \"status\": \"INLINED\",\n                                                                    },\n                                                                  ],\n                                                                  \"message\": \"\",\n                                                                  \"name\": \"AdsPECampaignGroupHeaderSectionContainer89\",\n                                                                  \"status\": \"INLINED\",\n                                                                },\n                                                                Object {\n                                                                  \"children\": Array [\n                                                                    Object {\n                                                                      \"children\": Array [],\n                                                                      \"message\": \"\",\n                                                                      \"name\": \"AdsEditorLoadingErrors90\",\n                                                                      \"status\": \"INLINED\",\n                                                                    },\n                                                                    Object {\n                                                                      \"children\": Array [\n                                                                        Object {\n                                                                          \"children\": Array [\n                                                                            Object {\n                                                                              \"children\": Array [\n                                                                                Object {\n                                                                                  \"children\": Array [\n                                                                                    Object {\n                                                                                      \"children\": Array [\n                                                                                        Object {\n                                                                                          \"children\": Array [\n                                                                                            Object {\n                                                                                              \"children\": Array [\n                                                                                                Object {\n                                                                                                  \"children\": Array [\n                                                                                                    Object {\n                                                                                                      \"children\": Array [\n                                                                                                        Object {\n                                                                                                          \"children\": Array [\n                                                                                                            Object {\n                                                                                                              \"children\": Array [\n                                                                                                                Object {\n                                                                                                                  \"children\": Array [],\n                                                                                                                  \"message\": \"\",\n                                                                                                                  \"name\": \"ReactXUIError76\",\n                                                                                                                  \"status\": \"INLINED\",\n                                                                                                                },\n                                                                                                              ],\n                                                                                                              \"message\": \"\",\n                                                                                                              \"name\": \"AdsTextInput91\",\n                                                                                                              \"status\": \"INLINED\",\n                                                                                                            },\n                                                                                                          ],\n                                                                                                          \"message\": \"\",\n                                                                                                          \"name\": \"BUIFormElement92\",\n                                                                                                          \"status\": \"INLINED\",\n                                                                                                        },\n                                                                                                      ],\n                                                                                                      \"message\": \"\",\n                                                                                                      \"name\": \"BUIForm93\",\n                                                                                                      \"status\": \"INLINED\",\n                                                                                                    },\n                                                                                                  ],\n                                                                                                  \"message\": \"\",\n                                                                                                  \"name\": \"XUICard94\",\n                                                                                                  \"status\": \"INLINED\",\n                                                                                                },\n                                                                                              ],\n                                                                                              \"message\": \"\",\n                                                                                              \"name\": \"ReactXUIError76\",\n                                                                                              \"status\": \"INLINED\",\n                                                                                            },\n                                                                                          ],\n                                                                                          \"message\": \"\",\n                                                                                          \"name\": \"AdsCard95\",\n                                                                                          \"status\": \"INLINED\",\n                                                                                        },\n                                                                                      ],\n                                                                                      \"message\": \"\",\n                                                                                      \"name\": \"AdsEditorNameSection96\",\n                                                                                      \"status\": \"INLINED\",\n                                                                                    },\n                                                                                  ],\n                                                                                  \"message\": \"\",\n                                                                                  \"name\": \"AdsCampaignGroupNameSectionContainer97\",\n                                                                                  \"status\": \"INLINED\",\n                                                                                },\n                                                                              ],\n                                                                              \"message\": \"\",\n                                                                              \"name\": \"_render98\",\n                                                                              \"status\": \"INLINED\",\n                                                                            },\n                                                                          ],\n                                                                          \"message\": \"\",\n                                                                          \"name\": \"AdsPluginWrapper99\",\n                                                                          \"status\": \"INLINED\",\n                                                                        },\n                                                                        Object {\n                                                                          \"children\": Array [\n                                                                            Object {\n                                                                              \"children\": Array [\n                                                                                Object {\n                                                                                  \"children\": Array [\n                                                                                    Object {\n                                                                                      \"children\": Array [\n                                                                                        Object {\n                                                                                          \"children\": Array [\n                                                                                            Object {\n                                                                                              \"children\": Array [\n                                                                                                Object {\n                                                                                                  \"children\": Array [\n                                                                                                    Object {\n                                                                                                      \"children\": Array [\n                                                                                                        Object {\n                                                                                                          \"children\": Array [\n                                                                                                            Object {\n                                                                                                              \"children\": Array [\n                                                                                                                Object {\n                                                                                                                  \"children\": Array [],\n                                                                                                                  \"message\": \"\",\n                                                                                                                  \"name\": \"XUICardHeaderTitle100\",\n                                                                                                                  \"status\": \"INLINED\",\n                                                                                                                },\n                                                                                                              ],\n                                                                                                              \"message\": \"\",\n                                                                                                              \"name\": \"XUICardSection101\",\n                                                                                                              \"status\": \"INLINED\",\n                                                                                                            },\n                                                                                                          ],\n                                                                                                          \"message\": \"\",\n                                                                                                          \"name\": \"XUICardHeader102\",\n                                                                                                          \"status\": \"INLINED\",\n                                                                                                        },\n                                                                                                      ],\n                                                                                                      \"message\": \"\",\n                                                                                                      \"name\": \"AdsCardHeader103\",\n                                                                                                      \"status\": \"INLINED\",\n                                                                                                    },\n                                                                                                    Object {\n                                                                                                      \"children\": Array [\n                                                                                                        Object {\n                                                                                                          \"children\": Array [\n                                                                                                            Object {\n                                                                                                              \"children\": Array [\n                                                                                                                Object {\n                                                                                                                  \"children\": Array [\n                                                                                                                    Object {\n                                                                                                                      \"children\": Array [],\n                                                                                                                      \"message\": \"\",\n                                                                                                                      \"name\": \"AdsLabeledField104\",\n                                                                                                                      \"status\": \"INLINED\",\n                                                                                                                    },\n                                                                                                                  ],\n                                                                                                                  \"message\": \"\",\n                                                                                                                  \"name\": \"LeftRight21\",\n                                                                                                                  \"status\": \"INLINED\",\n                                                                                                                },\n                                                                                                              ],\n                                                                                                              \"message\": \"\",\n                                                                                                              \"name\": \"FlexibleBlock105\",\n                                                                                                              \"status\": \"INLINED\",\n                                                                                                            },\n                                                                                                            Object {\n                                                                                                              \"children\": Array [\n                                                                                                                Object {\n                                                                                                                  \"children\": Array [\n                                                                                                                    Object {\n                                                                                                                      \"children\": Array [],\n                                                                                                                      \"message\": \"\",\n                                                                                                                      \"name\": \"AdsLabeledField104\",\n                                                                                                                      \"status\": \"INLINED\",\n                                                                                                                    },\n                                                                                                                  ],\n                                                                                                                  \"message\": \"\",\n                                                                                                                  \"name\": \"LeftRight21\",\n                                                                                                                  \"status\": \"INLINED\",\n                                                                                                                },\n                                                                                                              ],\n                                                                                                              \"message\": \"\",\n                                                                                                              \"name\": \"FlexibleBlock105\",\n                                                                                                              \"status\": \"INLINED\",\n                                                                                                            },\n                                                                                                            Object {\n                                                                                                              \"children\": Array [\n                                                                                                                Object {\n                                                                                                                  \"children\": Array [\n                                                                                                                    Object {\n                                                                                                                      \"children\": Array [\n                                                                                                                        Object {\n                                                                                                                          \"children\": Array [\n                                                                                                                            Object {\n                                                                                                                              \"children\": Array [\n                                                                                                                                Object {\n                                                                                                                                  \"children\": Array [],\n                                                                                                                                  \"message\": \"\",\n                                                                                                                                  \"name\": \"ReactImage0\",\n                                                                                                                                  \"status\": \"INLINED\",\n                                                                                                                                },\n                                                                                                                              ],\n                                                                                                                              \"message\": \"\",\n                                                                                                                              \"name\": \"AdsPopoverLink62\",\n                                                                                                                              \"status\": \"INLINED\",\n                                                                                                                            },\n                                                                                                                          ],\n                                                                                                                          \"message\": \"\",\n                                                                                                                          \"name\": \"AdsHelpLink63\",\n                                                                                                                          \"status\": \"INLINED\",\n                                                                                                                        },\n                                                                                                                      ],\n                                                                                                                      \"message\": \"\",\n                                                                                                                      \"name\": \"AdsLabeledField104\",\n                                                                                                                      \"status\": \"INLINED\",\n                                                                                                                    },\n                                                                                                                    Object {\n                                                                                                                      \"children\": Array [\n                                                                                                                        Object {\n                                                                                                                          \"children\": Array [\n                                                                                                                            Object {\n                                                                                                                              \"children\": Array [\n                                                                                                                                Object {\n                                                                                                                                  \"children\": Array [],\n                                                                                                                                  \"message\": \"\",\n                                                                                                                                  \"name\": \"AbstractLink1\",\n                                                                                                                                  \"status\": \"INLINED\",\n                                                                                                                                },\n                                                                                                                              ],\n                                                                                                                              \"message\": \"\",\n                                                                                                                              \"name\": \"Link2\",\n                                                                                                                              \"status\": \"INLINED\",\n                                                                                                                            },\n                                                                                                                          ],\n                                                                                                                          \"message\": \"\",\n                                                                                                                          \"name\": \"AdsBulkCampaignSpendCapField106\",\n                                                                                                                          \"status\": \"INLINED\",\n                                                                                                                        },\n                                                                                                                      ],\n                                                                                                                      \"message\": \"\",\n                                                                                                                      \"name\": \"FluxContainer_AdsCampaignGroupSpendCapContainer_107\",\n                                                                                                                      \"status\": \"INLINED\",\n                                                                                                                    },\n                                                                                                                  ],\n                                                                                                                  \"message\": \"\",\n                                                                                                                  \"name\": \"LeftRight21\",\n                                                                                                                  \"status\": \"INLINED\",\n                                                                                                                },\n                                                                                                              ],\n                                                                                                              \"message\": \"\",\n                                                                                                              \"name\": \"FlexibleBlock105\",\n                                                                                                              \"status\": \"INLINED\",\n                                                                                                            },\n                                                                                                          ],\n                                                                                                          \"message\": \"\",\n                                                                                                          \"name\": \"XUICardSection101\",\n                                                                                                          \"status\": \"INLINED\",\n                                                                                                        },\n                                                                                                      ],\n                                                                                                      \"message\": \"\",\n                                                                                                      \"name\": \"AdsCardSection108\",\n                                                                                                      \"status\": \"INLINED\",\n                                                                                                    },\n                                                                                                  ],\n                                                                                                  \"message\": \"\",\n                                                                                                  \"name\": \"XUICard94\",\n                                                                                                  \"status\": \"INLINED\",\n                                                                                                },\n                                                                                              ],\n                                                                                              \"message\": \"\",\n                                                                                              \"name\": \"ReactXUIError76\",\n                                                                                              \"status\": \"INLINED\",\n                                                                                            },\n                                                                                          ],\n                                                                                          \"message\": \"\",\n                                                                                          \"name\": \"AdsCard95\",\n                                                                                          \"status\": \"INLINED\",\n                                                                                        },\n                                                                                      ],\n                                                                                      \"message\": \"\",\n                                                                                      \"name\": \"AdsEditorCampaignGroupDetailsSection109\",\n                                                                                      \"status\": \"INLINED\",\n                                                                                    },\n                                                                                  ],\n                                                                                  \"message\": \"\",\n                                                                                  \"name\": \"AdsEditorCampaignGroupDetailsSectionContainer110\",\n                                                                                  \"status\": \"INLINED\",\n                                                                                },\n                                                                              ],\n                                                                              \"message\": \"\",\n                                                                              \"name\": \"_render111\",\n                                                                              \"status\": \"INLINED\",\n                                                                            },\n                                                                          ],\n                                                                          \"message\": \"\",\n                                                                          \"name\": \"AdsPluginWrapper99\",\n                                                                          \"status\": \"INLINED\",\n                                                                        },\n                                                                        Object {\n                                                                          \"children\": Array [\n                                                                            Object {\n                                                                              \"children\": Array [\n                                                                                Object {\n                                                                                  \"children\": Array [],\n                                                                                  \"message\": \"\",\n                                                                                  \"name\": \"FluxContainer_AdsEditorToplineDetailsSectionContainer_112\",\n                                                                                  \"status\": \"INLINED\",\n                                                                                },\n                                                                              ],\n                                                                              \"message\": \"\",\n                                                                              \"name\": \"_render113\",\n                                                                              \"status\": \"INLINED\",\n                                                                            },\n                                                                          ],\n                                                                          \"message\": \"\",\n                                                                          \"name\": \"AdsPluginWrapper99\",\n                                                                          \"status\": \"INLINED\",\n                                                                        },\n                                                                        Object {\n                                                                          \"children\": Array [],\n                                                                          \"message\": \"\",\n                                                                          \"name\": \"AdsStickyArea114\",\n                                                                          \"status\": \"INLINED\",\n                                                                        },\n                                                                      ],\n                                                                      \"message\": \"\",\n                                                                      \"name\": \"FluxContainer_AdsEditorColumnContainer_115\",\n                                                                      \"status\": \"INLINED\",\n                                                                    },\n                                                                    Object {\n                                                                      \"children\": Array [\n                                                                        Object {\n                                                                          \"children\": Array [\n                                                                            Object {\n                                                                              \"children\": Array [\n                                                                                Object {\n                                                                                  \"children\": Array [\n                                                                                    Object {\n                                                                                      \"children\": Array [\n                                                                                        Object {\n                                                                                          \"children\": Array [\n                                                                                            Object {\n                                                                                              \"children\": Array [\n                                                                                                Object {\n                                                                                                  \"children\": Array [\n                                                                                                    Object {\n                                                                                                      \"children\": Array [\n                                                                                                        Object {\n                                                                                                          \"children\": Array [\n                                                                                                            Object {\n                                                                                                              \"children\": Array [\n                                                                                                                Object {\n                                                                                                                  \"children\": Array [\n                                                                                                                    Object {\n                                                                                                                      \"children\": Array [\n                                                                                                                        Object {\n                                                                                                                          \"children\": Array [\n                                                                                                                            Object {\n                                                                                                                              \"children\": Array [\n                                                                                                                                Object {\n                                                                                                                                  \"children\": Array [\n                                                                                                                                    Object {\n                                                                                                                                      \"children\": Array [],\n                                                                                                                                      \"message\": \"\",\n                                                                                                                                      \"name\": \"BUISwitch116\",\n                                                                                                                                      \"status\": \"INLINED\",\n                                                                                                                                    },\n                                                                                                                                  ],\n                                                                                                                                  \"message\": \"\",\n                                                                                                                                  \"name\": \"AdsStatusSwitchInternal117\",\n                                                                                                                                  \"status\": \"INLINED\",\n                                                                                                                                },\n                                                                                                                              ],\n                                                                                                                              \"message\": \"\",\n                                                                                                                              \"name\": \"AdsStatusSwitch118\",\n                                                                                                                              \"status\": \"INLINED\",\n                                                                                                                            },\n                                                                                                                          ],\n                                                                                                                          \"message\": \"\",\n                                                                                                                          \"name\": \"FluxContainer_AdsCampaignGroupStatusSwitchContainer_119\",\n                                                                                                                          \"status\": \"INLINED\",\n                                                                                                                        },\n                                                                                                                      ],\n                                                                                                                      \"message\": \"\",\n                                                                                                                      \"name\": \"XUICardHeaderTitle100\",\n                                                                                                                      \"status\": \"INLINED\",\n                                                                                                                    },\n                                                                                                                    Object {\n                                                                                                                      \"children\": Array [\n                                                                                                                        Object {\n                                                                                                                          \"children\": Array [\n                                                                                                                            Object {\n                                                                                                                              \"children\": Array [\n                                                                                                                                Object {\n                                                                                                                                  \"children\": Array [\n                                                                                                                                    Object {\n                                                                                                                                      \"children\": Array [\n                                                                                                                                        Object {\n                                                                                                                                          \"children\": Array [\n                                                                                                                                            Object {\n                                                                                                                                              \"children\": Array [\n                                                                                                                                                Object {\n                                                                                                                                                  \"children\": Array [\n                                                                                                                                                    Object {\n                                                                                                                                                      \"children\": Array [\n                                                                                                                                                        Object {\n                                                                                                                                                          \"children\": Array [\n                                                                                                                                                            Object {\n                                                                                                                                                              \"children\": Array [],\n                                                                                                                                                              \"message\": \"\",\n                                                                                                                                                              \"name\": \"ReactImage0\",\n                                                                                                                                                              \"status\": \"INLINED\",\n                                                                                                                                                            },\n                                                                                                                                                          ],\n                                                                                                                                                          \"message\": \"\",\n                                                                                                                                                          \"name\": \"AbstractLink1\",\n                                                                                                                                                          \"status\": \"INLINED\",\n                                                                                                                                                        },\n                                                                                                                                                      ],\n                                                                                                                                                      \"message\": \"\",\n                                                                                                                                                      \"name\": \"Link2\",\n                                                                                                                                                      \"status\": \"INLINED\",\n                                                                                                                                                    },\n                                                                                                                                                  ],\n                                                                                                                                                  \"message\": \"\",\n                                                                                                                                                  \"name\": \"AbstractButton3\",\n                                                                                                                                                  \"status\": \"INLINED\",\n                                                                                                                                                },\n                                                                                                                                              ],\n                                                                                                                                              \"message\": \"\",\n                                                                                                                                              \"name\": \"XUIButton4\",\n                                                                                                                                              \"status\": \"INLINED\",\n                                                                                                                                            },\n                                                                                                                                          ],\n                                                                                                                                          \"message\": \"\",\n                                                                                                                                          \"name\": \"AbstractPopoverButton5\",\n                                                                                                                                          \"status\": \"INLINED\",\n                                                                                                                                        },\n                                                                                                                                      ],\n                                                                                                                                      \"message\": \"\",\n                                                                                                                                      \"name\": \"ReactXUIPopoverButton6\",\n                                                                                                                                      \"status\": \"INLINED\",\n                                                                                                                                    },\n                                                                                                                                  ],\n                                                                                                                                  \"message\": \"\",\n                                                                                                                                  \"name\": \"InlineBlock19\",\n                                                                                                                                  \"status\": \"INLINED\",\n                                                                                                                                },\n                                                                                                                              ],\n                                                                                                                              \"message\": \"\",\n                                                                                                                              \"name\": \"ReactPopoverMenu20\",\n                                                                                                                              \"status\": \"INLINED\",\n                                                                                                                            },\n                                                                                                                          ],\n                                                                                                                          \"message\": \"\",\n                                                                                                                          \"name\": \"AdsLinksMenu120\",\n                                                                                                                          \"status\": \"INLINED\",\n                                                                                                                        },\n                                                                                                                      ],\n                                                                                                                      \"message\": \"\",\n                                                                                                                      \"name\": \"FluxContainer_AdsPluginizedLinksMenuContainer_121\",\n                                                                                                                      \"status\": \"INLINED\",\n                                                                                                                    },\n                                                                                                                  ],\n                                                                                                                  \"message\": \"\",\n                                                                                                                  \"name\": \"LeftRight21\",\n                                                                                                                  \"status\": \"INLINED\",\n                                                                                                                },\n                                                                                                              ],\n                                                                                                              \"message\": \"\",\n                                                                                                              \"name\": \"AdsCardLeftRightHeader122\",\n                                                                                                              \"status\": \"INLINED\",\n                                                                                                            },\n                                                                                                          ],\n                                                                                                          \"message\": \"\",\n                                                                                                          \"name\": \"XUICard94\",\n                                                                                                          \"status\": \"INLINED\",\n                                                                                                        },\n                                                                                                      ],\n                                                                                                      \"message\": \"\",\n                                                                                                      \"name\": \"ReactXUIError76\",\n                                                                                                      \"status\": \"INLINED\",\n                                                                                                    },\n                                                                                                  ],\n                                                                                                  \"message\": \"\",\n                                                                                                  \"name\": \"AdsCard95\",\n                                                                                                  \"status\": \"INLINED\",\n                                                                                                },\n                                                                                              ],\n                                                                                              \"message\": \"\",\n                                                                                              \"name\": \"AdsPEIDSection123\",\n                                                                                              \"status\": \"INLINED\",\n                                                                                            },\n                                                                                          ],\n                                                                                          \"message\": \"\",\n                                                                                          \"name\": \"FluxContainer_AdsPECampaignGroupIDSectionContainer_124\",\n                                                                                          \"status\": \"INLINED\",\n                                                                                        },\n                                                                                      ],\n                                                                                      \"message\": \"\",\n                                                                                      \"name\": \"DeferredComponent125\",\n                                                                                      \"status\": \"INLINED\",\n                                                                                    },\n                                                                                  ],\n                                                                                  \"message\": \"\",\n                                                                                  \"name\": \"BootloadedComponent126\",\n                                                                                  \"status\": \"INLINED\",\n                                                                                },\n                                                                              ],\n                                                                              \"message\": \"\",\n                                                                              \"name\": \"_render127\",\n                                                                              \"status\": \"INLINED\",\n                                                                            },\n                                                                          ],\n                                                                          \"message\": \"\",\n                                                                          \"name\": \"AdsPluginWrapper99\",\n                                                                          \"status\": \"INLINED\",\n                                                                        },\n                                                                        Object {\n                                                                          \"children\": Array [\n                                                                            Object {\n                                                                              \"children\": Array [\n                                                                                Object {\n                                                                                  \"children\": Array [\n                                                                                    Object {\n                                                                                      \"children\": Array [\n                                                                                        Object {\n                                                                                          \"children\": Array [],\n                                                                                          \"message\": \"\",\n                                                                                          \"name\": \"AdsEditorErrorsCard128\",\n                                                                                          \"status\": \"INLINED\",\n                                                                                        },\n                                                                                      ],\n                                                                                      \"message\": \"\",\n                                                                                      \"name\": \"FluxContainer_FunctionalContainer_129\",\n                                                                                      \"status\": \"INLINED\",\n                                                                                    },\n                                                                                  ],\n                                                                                  \"message\": \"\",\n                                                                                  \"name\": \"_render130\",\n                                                                                  \"status\": \"INLINED\",\n                                                                                },\n                                                                              ],\n                                                                              \"message\": \"\",\n                                                                              \"name\": \"AdsPluginWrapper99\",\n                                                                              \"status\": \"INLINED\",\n                                                                            },\n                                                                          ],\n                                                                          \"message\": \"\",\n                                                                          \"name\": \"AdsStickyArea114\",\n                                                                          \"status\": \"INLINED\",\n                                                                        },\n                                                                      ],\n                                                                      \"message\": \"\",\n                                                                      \"name\": \"FluxContainer_AdsEditorColumnContainer_115\",\n                                                                      \"status\": \"INLINED\",\n                                                                    },\n                                                                  ],\n                                                                  \"message\": \"\",\n                                                                  \"name\": \"AdsEditorMultiColumnLayout131\",\n                                                                  \"status\": \"INLINED\",\n                                                                },\n                                                              ],\n                                                              \"message\": \"\",\n                                                              \"name\": \"AdsPECampaignGroupEditor132\",\n                                                              \"status\": \"INLINED\",\n                                                            },\n                                                          ],\n                                                          \"message\": \"\",\n                                                          \"name\": \"AdsPECampaignGroupEditorContainer133\",\n                                                          \"status\": \"INLINED\",\n                                                        },\n                                                      ],\n                                                      \"message\": \"\",\n                                                      \"name\": \"AdsPESideTrayTabContent134\",\n                                                      \"status\": \"INLINED\",\n                                                    },\n                                                  ],\n                                                  \"message\": \"\",\n                                                  \"name\": \"AdsPEEditorTrayTabContentContainer135\",\n                                                  \"status\": \"INLINED\",\n                                                },\n                                              ],\n                                              \"message\": \"\",\n                                              \"name\": \"AdsPEMultiTabDrawer136\",\n                                              \"status\": \"INLINED\",\n                                            },\n                                          ],\n                                          \"message\": \"\",\n                                          \"name\": \"FluxContainer_AdsPEMultiTabDrawerContainer_137\",\n                                          \"status\": \"INLINED\",\n                                        },\n                                      ],\n                                      \"message\": \"\",\n                                      \"name\": \"ErrorBoundary9\",\n                                      \"status\": \"INLINED\",\n                                    },\n                                  ],\n                                  \"message\": \"\",\n                                  \"name\": \"AdsErrorBoundary10\",\n                                  \"status\": \"INLINED\",\n                                },\n                                Object {\n                                  \"children\": Array [\n                                    Object {\n                                      \"children\": Array [\n                                        Object {\n                                          \"children\": Array [\n                                            Object {\n                                              \"children\": Array [\n                                                Object {\n                                                  \"children\": Array [\n                                                    Object {\n                                                      \"children\": Array [],\n                                                      \"message\": \"\",\n                                                      \"name\": \"AbstractButton3\",\n                                                      \"status\": \"INLINED\",\n                                                    },\n                                                  ],\n                                                  \"message\": \"\",\n                                                  \"name\": \"XUIButton4\",\n                                                  \"status\": \"INLINED\",\n                                                },\n                                                Object {\n                                                  \"children\": Array [\n                                                    Object {\n                                                      \"children\": Array [],\n                                                      \"message\": \"\",\n                                                      \"name\": \"AbstractButton3\",\n                                                      \"status\": \"INLINED\",\n                                                    },\n                                                  ],\n                                                  \"message\": \"\",\n                                                  \"name\": \"XUIButton4\",\n                                                  \"status\": \"INLINED\",\n                                                },\n                                                Object {\n                                                  \"children\": Array [\n                                                    Object {\n                                                      \"children\": Array [],\n                                                      \"message\": \"\",\n                                                      \"name\": \"AbstractButton3\",\n                                                      \"status\": \"INLINED\",\n                                                    },\n                                                  ],\n                                                  \"message\": \"\",\n                                                  \"name\": \"XUIButton4\",\n                                                  \"status\": \"INLINED\",\n                                                },\n                                              ],\n                                              \"message\": \"\",\n                                              \"name\": \"AdsPESimpleOrganizer138\",\n                                              \"status\": \"INLINED\",\n                                            },\n                                          ],\n                                          \"message\": \"\",\n                                          \"name\": \"AdsPEOrganizerContainer139\",\n                                          \"status\": \"INLINED\",\n                                        },\n                                      ],\n                                      \"message\": \"\",\n                                      \"name\": \"ErrorBoundary9\",\n                                      \"status\": \"INLINED\",\n                                    },\n                                  ],\n                                  \"message\": \"\",\n                                  \"name\": \"AdsErrorBoundary10\",\n                                  \"status\": \"INLINED\",\n                                },\n                                Object {\n                                  \"children\": Array [\n                                    Object {\n                                      \"children\": Array [\n                                        Object {\n                                          \"children\": Array [\n                                            Object {\n                                              \"children\": Array [\n                                                Object {\n                                                  \"children\": Array [\n                                                    Object {\n                                                      \"children\": Array [\n                                                        Object {\n                                                          \"children\": Array [\n                                                            Object {\n                                                              \"children\": Array [\n                                                                Object {\n                                                                  \"children\": Array [\n                                                                    Object {\n                                                                      \"children\": Array [\n                                                                        Object {\n                                                                          \"children\": Array [],\n                                                                          \"message\": \"\",\n                                                                          \"name\": \"FixedDataTableColumnResizeHandle140\",\n                                                                          \"status\": \"INLINED\",\n                                                                        },\n                                                                        Object {\n                                                                          \"children\": Array [\n                                                                            Object {\n                                                                              \"children\": Array [\n                                                                                Object {\n                                                                                  \"children\": Array [\n                                                                                    Object {\n                                                                                      \"children\": Array [\n                                                                                        Object {\n                                                                                          \"children\": Array [\n                                                                                            Object {\n                                                                                              \"children\": Array [\n                                                                                                Object {\n                                                                                                  \"children\": Array [\n                                                                                                    Object {\n                                                                                                      \"children\": Array [],\n                                                                                                      \"message\": \"\",\n                                                                                                      \"name\": \"ReactImage0\",\n                                                                                                      \"status\": \"INLINED\",\n                                                                                                    },\n                                                                                                  ],\n                                                                                                  \"message\": \"\",\n                                                                                                  \"name\": \"AdsPETableHeader141\",\n                                                                                                  \"status\": \"INLINED\",\n                                                                                                },\n                                                                                              ],\n                                                                                              \"message\": \"\",\n                                                                                              \"name\": \"TransitionCell142\",\n                                                                                              \"status\": \"INLINED\",\n                                                                                            },\n                                                                                          ],\n                                                                                          \"message\": \"\",\n                                                                                          \"name\": \"FixedDataTableCell143\",\n                                                                                          \"status\": \"INLINED\",\n                                                                                        },\n                                                                                      ],\n                                                                                      \"message\": \"\",\n                                                                                      \"name\": \"FixedDataTableCellGroupImpl144\",\n                                                                                      \"status\": \"INLINED\",\n                                                                                    },\n                                                                                  ],\n                                                                                  \"message\": \"\",\n                                                                                  \"name\": \"FixedDataTableCellGroup145\",\n                                                                                  \"status\": \"INLINED\",\n                                                                                },\n                                                                                Object {\n                                                                                  \"children\": Array [\n                                                                                    Object {\n                                                                                      \"children\": Array [\n                                                                                        Object {\n                                                                                          \"children\": Array [\n                                                                                            Object {\n                                                                                              \"children\": Array [\n                                                                                                Object {\n                                                                                                  \"children\": Array [],\n                                                                                                  \"message\": \"\",\n                                                                                                  \"name\": \"AdsPETableHeader141\",\n                                                                                                  \"status\": \"INLINED\",\n                                                                                                },\n                                                                                              ],\n                                                                                              \"message\": \"\",\n                                                                                              \"name\": \"TransitionCell142\",\n                                                                                              \"status\": \"INLINED\",\n                                                                                            },\n                                                                                          ],\n                                                                                          \"message\": \"\",\n                                                                                          \"name\": \"FixedDataTableCell143\",\n                                                                                          \"status\": \"INLINED\",\n                                                                                        },\n                                                                                        Object {\n                                                                                          \"children\": Array [\n                                                                                            Object {\n                                                                                              \"children\": Array [\n                                                                                                Object {\n                                                                                                  \"children\": Array [],\n                                                                                                  \"message\": \"\",\n                                                                                                  \"name\": \"AdsPETableHeader141\",\n                                                                                                  \"status\": \"INLINED\",\n                                                                                                },\n                                                                                              ],\n                                                                                              \"message\": \"\",\n                                                                                              \"name\": \"TransitionCell142\",\n                                                                                              \"status\": \"INLINED\",\n                                                                                            },\n                                                                                          ],\n                                                                                          \"message\": \"\",\n                                                                                          \"name\": \"FixedDataTableCell143\",\n                                                                                          \"status\": \"INLINED\",\n                                                                                        },\n                                                                                        Object {\n                                                                                          \"children\": Array [\n                                                                                            Object {\n                                                                                              \"children\": Array [\n                                                                                                Object {\n                                                                                                  \"children\": Array [],\n                                                                                                  \"message\": \"\",\n                                                                                                  \"name\": \"AdsPETableHeader141\",\n                                                                                                  \"status\": \"INLINED\",\n                                                                                                },\n                                                                                              ],\n                                                                                              \"message\": \"\",\n                                                                                              \"name\": \"TransitionCell142\",\n                                                                                              \"status\": \"INLINED\",\n                                                                                            },\n                                                                                          ],\n                                                                                          \"message\": \"\",\n                                                                                          \"name\": \"FixedDataTableCell143\",\n                                                                                          \"status\": \"INLINED\",\n                                                                                        },\n                                                                                        Object {\n                                                                                          \"children\": Array [\n                                                                                            Object {\n                                                                                              \"children\": Array [\n                                                                                                Object {\n                                                                                                  \"children\": Array [],\n                                                                                                  \"message\": \"\",\n                                                                                                  \"name\": \"AdsPETableHeader141\",\n                                                                                                  \"status\": \"INLINED\",\n                                                                                                },\n                                                                                              ],\n                                                                                              \"message\": \"\",\n                                                                                              \"name\": \"TransitionCell142\",\n                                                                                              \"status\": \"INLINED\",\n                                                                                            },\n                                                                                          ],\n                                                                                          \"message\": \"\",\n                                                                                          \"name\": \"FixedDataTableCell143\",\n                                                                                          \"status\": \"INLINED\",\n                                                                                        },\n                                                                                      ],\n                                                                                      \"message\": \"\",\n                                                                                      \"name\": \"FixedDataTableCellGroupImpl144\",\n                                                                                      \"status\": \"INLINED\",\n                                                                                    },\n                                                                                  ],\n                                                                                  \"message\": \"\",\n                                                                                  \"name\": \"FixedDataTableCellGroup145\",\n                                                                                  \"status\": \"INLINED\",\n                                                                                },\n                                                                              ],\n                                                                              \"message\": \"\",\n                                                                              \"name\": \"FixedDataTableRowImpl146\",\n                                                                              \"status\": \"INLINED\",\n                                                                            },\n                                                                          ],\n                                                                          \"message\": \"\",\n                                                                          \"name\": \"FixedDataTableRow147\",\n                                                                          \"status\": \"INLINED\",\n                                                                        },\n                                                                        Object {\n                                                                          \"children\": Array [\n                                                                            Object {\n                                                                              \"children\": Array [\n                                                                                Object {\n                                                                                  \"children\": Array [\n                                                                                    Object {\n                                                                                      \"children\": Array [\n                                                                                        Object {\n                                                                                          \"children\": Array [\n                                                                                            Object {\n                                                                                              \"children\": Array [\n                                                                                                Object {\n                                                                                                  \"children\": Array [\n                                                                                                    Object {\n                                                                                                      \"children\": Array [],\n                                                                                                      \"message\": \"\",\n                                                                                                      \"name\": \"AbstractCheckboxInput59\",\n                                                                                                      \"status\": \"INLINED\",\n                                                                                                    },\n                                                                                                  ],\n                                                                                                  \"message\": \"\",\n                                                                                                  \"name\": \"XUICheckboxInput60\",\n                                                                                                  \"status\": \"INLINED\",\n                                                                                                },\n                                                                                              ],\n                                                                                              \"message\": \"\",\n                                                                                              \"name\": \"TransitionCell142\",\n                                                                                              \"status\": \"INLINED\",\n                                                                                            },\n                                                                                          ],\n                                                                                          \"message\": \"\",\n                                                                                          \"name\": \"FixedDataTableCell143\",\n                                                                                          \"status\": \"INLINED\",\n                                                                                        },\n                                                                                        Object {\n                                                                                          \"children\": Array [\n                                                                                            Object {\n                                                                                              \"children\": Array [\n                                                                                                Object {\n                                                                                                  \"children\": Array [\n                                                                                                    Object {\n                                                                                                      \"children\": Array [\n                                                                                                        Object {\n                                                                                                          \"children\": Array [],\n                                                                                                          \"message\": \"\",\n                                                                                                          \"name\": \"AdsPETableHeader141\",\n                                                                                                          \"status\": \"INLINED\",\n                                                                                                        },\n                                                                                                      ],\n                                                                                                      \"message\": \"\",\n                                                                                                      \"name\": \"FixedDataTableAbstractSortableHeader148\",\n                                                                                                      \"status\": \"INLINED\",\n                                                                                                    },\n                                                                                                  ],\n                                                                                                  \"message\": \"\",\n                                                                                                  \"name\": \"FixedDataTableSortableHeader149\",\n                                                                                                  \"status\": \"INLINED\",\n                                                                                                },\n                                                                                              ],\n                                                                                              \"message\": \"\",\n                                                                                              \"name\": \"TransitionCell142\",\n                                                                                              \"status\": \"INLINED\",\n                                                                                            },\n                                                                                          ],\n                                                                                          \"message\": \"\",\n                                                                                          \"name\": \"FixedDataTableCell143\",\n                                                                                          \"status\": \"INLINED\",\n                                                                                        },\n                                                                                        Object {\n                                                                                          \"children\": Array [\n                                                                                            Object {\n                                                                                              \"children\": Array [\n                                                                                                Object {\n                                                                                                  \"children\": Array [\n                                                                                                    Object {\n                                                                                                      \"children\": Array [\n                                                                                                        Object {\n                                                                                                          \"children\": Array [\n                                                                                                            Object {\n                                                                                                              \"children\": Array [],\n                                                                                                              \"message\": \"\",\n                                                                                                              \"name\": \"ReactImage0\",\n                                                                                                              \"status\": \"INLINED\",\n                                                                                                            },\n                                                                                                          ],\n                                                                                                          \"message\": \"\",\n                                                                                                          \"name\": \"AdsPETableHeader141\",\n                                                                                                          \"status\": \"INLINED\",\n                                                                                                        },\n                                                                                                      ],\n                                                                                                      \"message\": \"\",\n                                                                                                      \"name\": \"FixedDataTableAbstractSortableHeader148\",\n                                                                                                      \"status\": \"INLINED\",\n                                                                                                    },\n                                                                                                  ],\n                                                                                                  \"message\": \"\",\n                                                                                                  \"name\": \"FixedDataTableSortableHeader149\",\n                                                                                                  \"status\": \"INLINED\",\n                                                                                                },\n                                                                                              ],\n                                                                                              \"message\": \"\",\n                                                                                              \"name\": \"TransitionCell142\",\n                                                                                              \"status\": \"INLINED\",\n                                                                                            },\n                                                                                          ],\n                                                                                          \"message\": \"\",\n                                                                                          \"name\": \"FixedDataTableCell143\",\n                                                                                          \"status\": \"INLINED\",\n                                                                                        },\n                                                                                        Object {\n                                                                                          \"children\": Array [\n                                                                                            Object {\n                                                                                              \"children\": Array [\n                                                                                                Object {\n                                                                                                  \"children\": Array [\n                                                                                                    Object {\n                                                                                                      \"children\": Array [\n                                                                                                        Object {\n                                                                                                          \"children\": Array [\n                                                                                                            Object {\n                                                                                                              \"children\": Array [],\n                                                                                                              \"message\": \"\",\n                                                                                                              \"name\": \"ReactImage0\",\n                                                                                                              \"status\": \"INLINED\",\n                                                                                                            },\n                                                                                                          ],\n                                                                                                          \"message\": \"\",\n                                                                                                          \"name\": \"AdsPETableHeader141\",\n                                                                                                          \"status\": \"INLINED\",\n                                                                                                        },\n                                                                                                      ],\n                                                                                                      \"message\": \"\",\n                                                                                                      \"name\": \"FixedDataTableAbstractSortableHeader148\",\n                                                                                                      \"status\": \"INLINED\",\n                                                                                                    },\n                                                                                                  ],\n                                                                                                  \"message\": \"\",\n                                                                                                  \"name\": \"FixedDataTableSortableHeader149\",\n                                                                                                  \"status\": \"INLINED\",\n                                                                                                },\n                                                                                              ],\n                                                                                              \"message\": \"\",\n                                                                                              \"name\": \"TransitionCell142\",\n                                                                                              \"status\": \"INLINED\",\n                                                                                            },\n                                                                                          ],\n                                                                                          \"message\": \"\",\n                                                                                          \"name\": \"FixedDataTableCell143\",\n                                                                                          \"status\": \"INLINED\",\n                                                                                        },\n                                                                                        Object {\n                                                                                          \"children\": Array [\n                                                                                            Object {\n                                                                                              \"children\": Array [\n                                                                                                Object {\n                                                                                                  \"children\": Array [\n                                                                                                    Object {\n                                                                                                      \"children\": Array [\n                                                                                                        Object {\n                                                                                                          \"children\": Array [],\n                                                                                                          \"message\": \"\",\n                                                                                                          \"name\": \"AdsPETableHeader141\",\n                                                                                                          \"status\": \"INLINED\",\n                                                                                                        },\n                                                                                                      ],\n                                                                                                      \"message\": \"\",\n                                                                                                      \"name\": \"FixedDataTableAbstractSortableHeader148\",\n                                                                                                      \"status\": \"INLINED\",\n                                                                                                    },\n                                                                                                  ],\n                                                                                                  \"message\": \"\",\n                                                                                                  \"name\": \"FixedDataTableSortableHeader149\",\n                                                                                                  \"status\": \"INLINED\",\n                                                                                                },\n                                                                                              ],\n                                                                                              \"message\": \"\",\n                                                                                              \"name\": \"TransitionCell142\",\n                                                                                              \"status\": \"INLINED\",\n                                                                                            },\n                                                                                          ],\n                                                                                          \"message\": \"\",\n                                                                                          \"name\": \"FixedDataTableCell143\",\n                                                                                          \"status\": \"INLINED\",\n                                                                                        },\n                                                                                        Object {\n                                                                                          \"children\": Array [\n                                                                                            Object {\n                                                                                              \"children\": Array [\n                                                                                                Object {\n                                                                                                  \"children\": Array [\n                                                                                                    Object {\n                                                                                                      \"children\": Array [\n                                                                                                        Object {\n                                                                                                          \"children\": Array [],\n                                                                                                          \"message\": \"\",\n                                                                                                          \"name\": \"AdsPETableHeader141\",\n                                                                                                          \"status\": \"INLINED\",\n                                                                                                        },\n                                                                                                      ],\n                                                                                                      \"message\": \"\",\n                                                                                                      \"name\": \"FixedDataTableAbstractSortableHeader148\",\n                                                                                                      \"status\": \"INLINED\",\n                                                                                                    },\n                                                                                                  ],\n                                                                                                  \"message\": \"\",\n                                                                                                  \"name\": \"FixedDataTableSortableHeader149\",\n                                                                                                  \"status\": \"INLINED\",\n                                                                                                },\n                                                                                              ],\n                                                                                              \"message\": \"\",\n                                                                                              \"name\": \"TransitionCell142\",\n                                                                                              \"status\": \"INLINED\",\n                                                                                            },\n                                                                                          ],\n                                                                                          \"message\": \"\",\n                                                                                          \"name\": \"FixedDataTableCell143\",\n                                                                                          \"status\": \"INLINED\",\n                                                                                        },\n                                                                                      ],\n                                                                                      \"message\": \"\",\n                                                                                      \"name\": \"FixedDataTableCellGroupImpl144\",\n                                                                                      \"status\": \"INLINED\",\n                                                                                    },\n                                                                                  ],\n                                                                                  \"message\": \"\",\n                                                                                  \"name\": \"FixedDataTableCellGroup145\",\n                                                                                  \"status\": \"INLINED\",\n                                                                                },\n                                                                                Object {\n                                                                                  \"children\": Array [\n                                                                                    Object {\n                                                                                      \"children\": Array [\n                                                                                        Object {\n                                                                                          \"children\": Array [\n                                                                                            Object {\n                                                                                              \"children\": Array [\n                                                                                                Object {\n                                                                                                  \"children\": Array [\n                                                                                                    Object {\n                                                                                                      \"children\": Array [\n                                                                                                        Object {\n                                                                                                          \"children\": Array [],\n                                                                                                          \"message\": \"\",\n                                                                                                          \"name\": \"AdsPETableHeader141\",\n                                                                                                          \"status\": \"INLINED\",\n                                                                                                        },\n                                                                                                      ],\n                                                                                                      \"message\": \"\",\n                                                                                                      \"name\": \"FixedDataTableAbstractSortableHeader148\",\n                                                                                                      \"status\": \"INLINED\",\n                                                                                                    },\n                                                                                                  ],\n                                                                                                  \"message\": \"\",\n                                                                                                  \"name\": \"FixedDataTableSortableHeader149\",\n                                                                                                  \"status\": \"INLINED\",\n                                                                                                },\n                                                                                              ],\n                                                                                              \"message\": \"\",\n                                                                                              \"name\": \"TransitionCell142\",\n                                                                                              \"status\": \"INLINED\",\n                                                                                            },\n                                                                                          ],\n                                                                                          \"message\": \"\",\n                                                                                          \"name\": \"FixedDataTableCell143\",\n                                                                                          \"status\": \"INLINED\",\n                                                                                        },\n                                                                                        Object {\n                                                                                          \"children\": Array [\n                                                                                            Object {\n                                                                                              \"children\": Array [\n                                                                                                Object {\n                                                                                                  \"children\": Array [\n                                                                                                    Object {\n                                                                                                      \"children\": Array [\n                                                                                                        Object {\n                                                                                                          \"children\": Array [],\n                                                                                                          \"message\": \"\",\n                                                                                                          \"name\": \"AdsPETableHeader141\",\n                                                                                                          \"status\": \"INLINED\",\n                                                                                                        },\n                                                                                                      ],\n                                                                                                      \"message\": \"\",\n                                                                                                      \"name\": \"FixedDataTableAbstractSortableHeader148\",\n                                                                                                      \"status\": \"INLINED\",\n                                                                                                    },\n                                                                                                  ],\n                                                                                                  \"message\": \"\",\n                                                                                                  \"name\": \"FixedDataTableSortableHeader149\",\n                                                                                                  \"status\": \"INLINED\",\n                                                                                                },\n                                                                                              ],\n                                                                                              \"message\": \"\",\n                                                                                              \"name\": \"TransitionCell142\",\n                                                                                              \"status\": \"INLINED\",\n                                                                                            },\n                                                                                          ],\n                                                                                          \"message\": \"\",\n                                                                                          \"name\": \"FixedDataTableCell143\",\n                                                                                          \"status\": \"INLINED\",\n                                                                                        },\n                                                                                        Object {\n                                                                                          \"children\": Array [\n                                                                                            Object {\n                                                                                              \"children\": Array [\n                                                                                                Object {\n                                                                                                  \"children\": Array [\n                                                                                                    Object {\n                                                                                                      \"children\": Array [\n                                                                                                        Object {\n                                                                                                          \"children\": Array [],\n                                                                                                          \"message\": \"\",\n                                                                                                          \"name\": \"AdsPETableHeader141\",\n                                                                                                          \"status\": \"INLINED\",\n                                                                                                        },\n                                                                                                      ],\n                                                                                                      \"message\": \"\",\n                                                                                                      \"name\": \"FixedDataTableAbstractSortableHeader148\",\n                                                                                                      \"status\": \"INLINED\",\n                                                                                                    },\n                                                                                                  ],\n                                                                                                  \"message\": \"\",\n                                                                                                  \"name\": \"FixedDataTableSortableHeader149\",\n                                                                                                  \"status\": \"INLINED\",\n                                                                                                },\n                                                                                              ],\n                                                                                              \"message\": \"\",\n                                                                                              \"name\": \"TransitionCell142\",\n                                                                                              \"status\": \"INLINED\",\n                                                                                            },\n                                                                                          ],\n                                                                                          \"message\": \"\",\n                                                                                          \"name\": \"FixedDataTableCell143\",\n                                                                                          \"status\": \"INLINED\",\n                                                                                        },\n                                                                                        Object {\n                                                                                          \"children\": Array [\n                                                                                            Object {\n                                                                                              \"children\": Array [\n                                                                                                Object {\n                                                                                                  \"children\": Array [\n                                                                                                    Object {\n                                                                                                      \"children\": Array [\n                                                                                                        Object {\n                                                                                                          \"children\": Array [],\n                                                                                                          \"message\": \"\",\n                                                                                                          \"name\": \"AdsPETableHeader141\",\n                                                                                                          \"status\": \"INLINED\",\n                                                                                                        },\n                                                                                                      ],\n                                                                                                      \"message\": \"\",\n                                                                                                      \"name\": \"FixedDataTableAbstractSortableHeader148\",\n                                                                                                      \"status\": \"INLINED\",\n                                                                                                    },\n                                                                                                  ],\n                                                                                                  \"message\": \"\",\n                                                                                                  \"name\": \"FixedDataTableSortableHeader149\",\n                                                                                                  \"status\": \"INLINED\",\n                                                                                                },\n                                                                                              ],\n                                                                                              \"message\": \"\",\n                                                                                              \"name\": \"TransitionCell142\",\n                                                                                              \"status\": \"INLINED\",\n                                                                                            },\n                                                                                          ],\n                                                                                          \"message\": \"\",\n                                                                                          \"name\": \"FixedDataTableCell143\",\n                                                                                          \"status\": \"INLINED\",\n                                                                                        },\n                                                                                        Object {\n                                                                                          \"children\": Array [\n                                                                                            Object {\n                                                                                              \"children\": Array [\n                                                                                                Object {\n                                                                                                  \"children\": Array [\n                                                                                                    Object {\n                                                                                                      \"children\": Array [\n                                                                                                        Object {\n                                                                                                          \"children\": Array [],\n                                                                                                          \"message\": \"\",\n                                                                                                          \"name\": \"AdsPETableHeader141\",\n                                                                                                          \"status\": \"INLINED\",\n                                                                                                        },\n                                                                                                      ],\n                                                                                                      \"message\": \"\",\n                                                                                                      \"name\": \"FixedDataTableAbstractSortableHeader148\",\n                                                                                                      \"status\": \"INLINED\",\n                                                                                                    },\n                                                                                                  ],\n                                                                                                  \"message\": \"\",\n                                                                                                  \"name\": \"FixedDataTableSortableHeader149\",\n                                                                                                  \"status\": \"INLINED\",\n                                                                                                },\n                                                                                              ],\n                                                                                              \"message\": \"\",\n                                                                                              \"name\": \"TransitionCell142\",\n                                                                                              \"status\": \"INLINED\",\n                                                                                            },\n                                                                                          ],\n                                                                                          \"message\": \"\",\n                                                                                          \"name\": \"FixedDataTableCell143\",\n                                                                                          \"status\": \"INLINED\",\n                                                                                        },\n                                                                                        Object {\n                                                                                          \"children\": Array [\n                                                                                            Object {\n                                                                                              \"children\": Array [\n                                                                                                Object {\n                                                                                                  \"children\": Array [\n                                                                                                    Object {\n                                                                                                      \"children\": Array [\n                                                                                                        Object {\n                                                                                                          \"children\": Array [],\n                                                                                                          \"message\": \"\",\n                                                                                                          \"name\": \"AdsPETableHeader141\",\n                                                                                                          \"status\": \"INLINED\",\n                                                                                                        },\n                                                                                                      ],\n                                                                                                      \"message\": \"\",\n                                                                                                      \"name\": \"FixedDataTableAbstractSortableHeader148\",\n                                                                                                      \"status\": \"INLINED\",\n                                                                                                    },\n                                                                                                  ],\n                                                                                                  \"message\": \"\",\n                                                                                                  \"name\": \"FixedDataTableSortableHeader149\",\n                                                                                                  \"status\": \"INLINED\",\n                                                                                                },\n                                                                                              ],\n                                                                                              \"message\": \"\",\n                                                                                              \"name\": \"TransitionCell142\",\n                                                                                              \"status\": \"INLINED\",\n                                                                                            },\n                                                                                          ],\n                                                                                          \"message\": \"\",\n                                                                                          \"name\": \"FixedDataTableCell143\",\n                                                                                          \"status\": \"INLINED\",\n                                                                                        },\n                                                                                        Object {\n                                                                                          \"children\": Array [\n                                                                                            Object {\n                                                                                              \"children\": Array [\n                                                                                                Object {\n                                                                                                  \"children\": Array [\n                                                                                                    Object {\n                                                                                                      \"children\": Array [\n                                                                                                        Object {\n                                                                                                          \"children\": Array [],\n                                                                                                          \"message\": \"\",\n                                                                                                          \"name\": \"AdsPETableHeader141\",\n                                                                                                          \"status\": \"INLINED\",\n                                                                                                        },\n                                                                                                      ],\n                                                                                                      \"message\": \"\",\n                                                                                                      \"name\": \"FixedDataTableAbstractSortableHeader148\",\n                                                                                                      \"status\": \"INLINED\",\n                                                                                                    },\n                                                                                                  ],\n                                                                                                  \"message\": \"\",\n                                                                                                  \"name\": \"FixedDataTableSortableHeader149\",\n                                                                                                  \"status\": \"INLINED\",\n                                                                                                },\n                                                                                              ],\n                                                                                              \"message\": \"\",\n                                                                                              \"name\": \"TransitionCell142\",\n                                                                                              \"status\": \"INLINED\",\n                                                                                            },\n                                                                                          ],\n                                                                                          \"message\": \"\",\n                                                                                          \"name\": \"FixedDataTableCell143\",\n                                                                                          \"status\": \"INLINED\",\n                                                                                        },\n                                                                                        Object {\n                                                                                          \"children\": Array [\n                                                                                            Object {\n                                                                                              \"children\": Array [\n                                                                                                Object {\n                                                                                                  \"children\": Array [\n                                                                                                    Object {\n                                                                                                      \"children\": Array [\n                                                                                                        Object {\n                                                                                                          \"children\": Array [],\n                                                                                                          \"message\": \"\",\n                                                                                                          \"name\": \"AdsPETableHeader141\",\n                                                                                                          \"status\": \"INLINED\",\n                                                                                                        },\n                                                                                                      ],\n                                                                                                      \"message\": \"\",\n                                                                                                      \"name\": \"FixedDataTableAbstractSortableHeader148\",\n                                                                                                      \"status\": \"INLINED\",\n                                                                                                    },\n                                                                                                  ],\n                                                                                                  \"message\": \"\",\n                                                                                                  \"name\": \"FixedDataTableSortableHeader149\",\n                                                                                                  \"status\": \"INLINED\",\n                                                                                                },\n                                                                                              ],\n                                                                                              \"message\": \"\",\n                                                                                              \"name\": \"TransitionCell142\",\n                                                                                              \"status\": \"INLINED\",\n                                                                                            },\n                                                                                          ],\n                                                                                          \"message\": \"\",\n                                                                                          \"name\": \"FixedDataTableCell143\",\n                                                                                          \"status\": \"INLINED\",\n                                                                                        },\n                                                                                        Object {\n                                                                                          \"children\": Array [\n                                                                                            Object {\n                                                                                              \"children\": Array [\n                                                                                                Object {\n                                                                                                  \"children\": Array [\n                                                                                                    Object {\n                                                                                                      \"children\": Array [\n                                                                                                        Object {\n                                                                                                          \"children\": Array [],\n                                                                                                          \"message\": \"\",\n                                                                                                          \"name\": \"AdsPETableHeader141\",\n                                                                                                          \"status\": \"INLINED\",\n                                                                                                        },\n                                                                                                      ],\n                                                                                                      \"message\": \"\",\n                                                                                                      \"name\": \"FixedDataTableAbstractSortableHeader148\",\n                                                                                                      \"status\": \"INLINED\",\n                                                                                                    },\n                                                                                                  ],\n                                                                                                  \"message\": \"\",\n                                                                                                  \"name\": \"FixedDataTableSortableHeader149\",\n                                                                                                  \"status\": \"INLINED\",\n                                                                                                },\n                                                                                              ],\n                                                                                              \"message\": \"\",\n                                                                                              \"name\": \"TransitionCell142\",\n                                                                                              \"status\": \"INLINED\",\n                                                                                            },\n                                                                                          ],\n                                                                                          \"message\": \"\",\n                                                                                          \"name\": \"FixedDataTableCell143\",\n                                                                                          \"status\": \"INLINED\",\n                                                                                        },\n                                                                                        Object {\n                                                                                          \"children\": Array [\n                                                                                            Object {\n                                                                                              \"children\": Array [\n                                                                                                Object {\n                                                                                                  \"children\": Array [\n                                                                                                    Object {\n                                                                                                      \"children\": Array [\n                                                                                                        Object {\n                                                                                                          \"children\": Array [],\n                                                                                                          \"message\": \"\",\n                                                                                                          \"name\": \"AdsPETableHeader141\",\n                                                                                                          \"status\": \"INLINED\",\n                                                                                                        },\n                                                                                                      ],\n                                                                                                      \"message\": \"\",\n                                                                                                      \"name\": \"FixedDataTableAbstractSortableHeader148\",\n                                                                                                      \"status\": \"INLINED\",\n                                                                                                    },\n                                                                                                  ],\n                                                                                                  \"message\": \"\",\n                                                                                                  \"name\": \"FixedDataTableSortableHeader149\",\n                                                                                                  \"status\": \"INLINED\",\n                                                                                                },\n                                                                                              ],\n                                                                                              \"message\": \"\",\n                                                                                              \"name\": \"TransitionCell142\",\n                                                                                              \"status\": \"INLINED\",\n                                                                                            },\n                                                                                          ],\n                                                                                          \"message\": \"\",\n                                                                                          \"name\": \"FixedDataTableCell143\",\n                                                                                          \"status\": \"INLINED\",\n                                                                                        },\n                                                                                        Object {\n                                                                                          \"children\": Array [\n                                                                                            Object {\n                                                                                              \"children\": Array [\n                                                                                                Object {\n                                                                                                  \"children\": Array [\n                                                                                                    Object {\n                                                                                                      \"children\": Array [\n                                                                                                        Object {\n                                                                                                          \"children\": Array [],\n                                                                                                          \"message\": \"\",\n                                                                                                          \"name\": \"AdsPETableHeader141\",\n                                                                                                          \"status\": \"INLINED\",\n                                                                                                        },\n                                                                                                      ],\n                                                                                                      \"message\": \"\",\n                                                                                                      \"name\": \"FixedDataTableAbstractSortableHeader148\",\n                                                                                                      \"status\": \"INLINED\",\n                                                                                                    },\n                                                                                                  ],\n                                                                                                  \"message\": \"\",\n                                                                                                  \"name\": \"FixedDataTableSortableHeader149\",\n                                                                                                  \"status\": \"INLINED\",\n                                                                                                },\n                                                                                              ],\n                                                                                              \"message\": \"\",\n                                                                                              \"name\": \"TransitionCell142\",\n                                                                                              \"status\": \"INLINED\",\n                                                                                            },\n                                                                                          ],\n                                                                                          \"message\": \"\",\n                                                                                          \"name\": \"FixedDataTableCell143\",\n                                                                                          \"status\": \"INLINED\",\n                                                                                        },\n                                                                                        Object {\n                                                                                          \"children\": Array [\n                                                                                            Object {\n                                                                                              \"children\": Array [\n                                                                                                Object {\n                                                                                                  \"children\": Array [\n                                                                                                    Object {\n                                                                                                      \"children\": Array [\n                                                                                                        Object {\n                                                                                                          \"children\": Array [],\n                                                                                                          \"message\": \"\",\n                                                                                                          \"name\": \"AdsPETableHeader141\",\n                                                                                                          \"status\": \"INLINED\",\n                                                                                                        },\n                                                                                                      ],\n                                                                                                      \"message\": \"\",\n                                                                                                      \"name\": \"FixedDataTableAbstractSortableHeader148\",\n                                                                                                      \"status\": \"INLINED\",\n                                                                                                    },\n                                                                                                  ],\n                                                                                                  \"message\": \"\",\n                                                                                                  \"name\": \"FixedDataTableSortableHeader149\",\n                                                                                                  \"status\": \"INLINED\",\n                                                                                                },\n                                                                                              ],\n                                                                                              \"message\": \"\",\n                                                                                              \"name\": \"TransitionCell142\",\n                                                                                              \"status\": \"INLINED\",\n                                                                                            },\n                                                                                          ],\n                                                                                          \"message\": \"\",\n                                                                                          \"name\": \"FixedDataTableCell143\",\n                                                                                          \"status\": \"INLINED\",\n                                                                                        },\n                                                                                        Object {\n                                                                                          \"children\": Array [\n                                                                                            Object {\n                                                                                              \"children\": Array [\n                                                                                                Object {\n                                                                                                  \"children\": Array [\n                                                                                                    Object {\n                                                                                                      \"children\": Array [\n                                                                                                        Object {\n                                                                                                          \"children\": Array [],\n                                                                                                          \"message\": \"\",\n                                                                                                          \"name\": \"AdsPETableHeader141\",\n                                                                                                          \"status\": \"INLINED\",\n                                                                                                        },\n                                                                                                      ],\n                                                                                                      \"message\": \"\",\n                                                                                                      \"name\": \"FixedDataTableAbstractSortableHeader148\",\n                                                                                                      \"status\": \"INLINED\",\n                                                                                                    },\n                                                                                                  ],\n                                                                                                  \"message\": \"\",\n                                                                                                  \"name\": \"FixedDataTableSortableHeader149\",\n                                                                                                  \"status\": \"INLINED\",\n                                                                                                },\n                                                                                              ],\n                                                                                              \"message\": \"\",\n                                                                                              \"name\": \"TransitionCell142\",\n                                                                                              \"status\": \"INLINED\",\n                                                                                            },\n                                                                                          ],\n                                                                                          \"message\": \"\",\n                                                                                          \"name\": \"FixedDataTableCell143\",\n                                                                                          \"status\": \"INLINED\",\n                                                                                        },\n                                                                                        Object {\n                                                                                          \"children\": Array [\n                                                                                            Object {\n                                                                                              \"children\": Array [\n                                                                                                Object {\n                                                                                                  \"children\": Array [\n                                                                                                    Object {\n                                                                                                      \"children\": Array [\n                                                                                                        Object {\n                                                                                                          \"children\": Array [],\n                                                                                                          \"message\": \"\",\n                                                                                                          \"name\": \"AdsPETableHeader141\",\n                                                                                                          \"status\": \"INLINED\",\n                                                                                                        },\n                                                                                                      ],\n                                                                                                      \"message\": \"\",\n                                                                                                      \"name\": \"FixedDataTableAbstractSortableHeader148\",\n                                                                                                      \"status\": \"INLINED\",\n                                                                                                    },\n                                                                                                  ],\n                                                                                                  \"message\": \"\",\n                                                                                                  \"name\": \"FixedDataTableSortableHeader149\",\n                                                                                                  \"status\": \"INLINED\",\n                                                                                                },\n                                                                                              ],\n                                                                                              \"message\": \"\",\n                                                                                              \"name\": \"TransitionCell142\",\n                                                                                              \"status\": \"INLINED\",\n                                                                                            },\n                                                                                          ],\n                                                                                          \"message\": \"\",\n                                                                                          \"name\": \"FixedDataTableCell143\",\n                                                                                          \"status\": \"INLINED\",\n                                                                                        },\n                                                                                        Object {\n                                                                                          \"children\": Array [\n                                                                                            Object {\n                                                                                              \"children\": Array [\n                                                                                                Object {\n                                                                                                  \"children\": Array [\n                                                                                                    Object {\n                                                                                                      \"children\": Array [\n                                                                                                        Object {\n                                                                                                          \"children\": Array [],\n                                                                                                          \"message\": \"\",\n                                                                                                          \"name\": \"AdsPETableHeader141\",\n                                                                                                          \"status\": \"INLINED\",\n                                                                                                        },\n                                                                                                      ],\n                                                                                                      \"message\": \"\",\n                                                                                                      \"name\": \"FixedDataTableAbstractSortableHeader148\",\n                                                                                                      \"status\": \"INLINED\",\n                                                                                                    },\n                                                                                                  ],\n                                                                                                  \"message\": \"\",\n                                                                                                  \"name\": \"FixedDataTableSortableHeader149\",\n                                                                                                  \"status\": \"INLINED\",\n                                                                                                },\n                                                                                              ],\n                                                                                              \"message\": \"\",\n                                                                                              \"name\": \"TransitionCell142\",\n                                                                                              \"status\": \"INLINED\",\n                                                                                            },\n                                                                                          ],\n                                                                                          \"message\": \"\",\n                                                                                          \"name\": \"FixedDataTableCell143\",\n                                                                                          \"status\": \"INLINED\",\n                                                                                        },\n                                                                                        Object {\n                                                                                          \"children\": Array [\n                                                                                            Object {\n                                                                                              \"children\": Array [\n                                                                                                Object {\n                                                                                                  \"children\": Array [\n                                                                                                    Object {\n                                                                                                      \"children\": Array [\n                                                                                                        Object {\n                                                                                                          \"children\": Array [],\n                                                                                                          \"message\": \"\",\n                                                                                                          \"name\": \"AdsPETableHeader141\",\n                                                                                                          \"status\": \"INLINED\",\n                                                                                                        },\n                                                                                                      ],\n                                                                                                      \"message\": \"\",\n                                                                                                      \"name\": \"FixedDataTableAbstractSortableHeader148\",\n                                                                                                      \"status\": \"INLINED\",\n                                                                                                    },\n                                                                                                  ],\n                                                                                                  \"message\": \"\",\n                                                                                                  \"name\": \"FixedDataTableSortableHeader149\",\n                                                                                                  \"status\": \"INLINED\",\n                                                                                                },\n                                                                                              ],\n                                                                                              \"message\": \"\",\n                                                                                              \"name\": \"TransitionCell142\",\n                                                                                              \"status\": \"INLINED\",\n                                                                                            },\n                                                                                          ],\n                                                                                          \"message\": \"\",\n                                                                                          \"name\": \"FixedDataTableCell143\",\n                                                                                          \"status\": \"INLINED\",\n                                                                                        },\n                                                                                        Object {\n                                                                                          \"children\": Array [\n                                                                                            Object {\n                                                                                              \"children\": Array [\n                                                                                                Object {\n                                                                                                  \"children\": Array [],\n                                                                                                  \"message\": \"\",\n                                                                                                  \"name\": \"AdsPETableHeader141\",\n                                                                                                  \"status\": \"INLINED\",\n                                                                                                },\n                                                                                              ],\n                                                                                              \"message\": \"\",\n                                                                                              \"name\": \"TransitionCell142\",\n                                                                                              \"status\": \"INLINED\",\n                                                                                            },\n                                                                                          ],\n                                                                                          \"message\": \"\",\n                                                                                          \"name\": \"FixedDataTableCell143\",\n                                                                                          \"status\": \"INLINED\",\n                                                                                        },\n                                                                                        Object {\n                                                                                          \"children\": Array [\n                                                                                            Object {\n                                                                                              \"children\": Array [\n                                                                                                Object {\n                                                                                                  \"children\": Array [],\n                                                                                                  \"message\": \"\",\n                                                                                                  \"name\": \"AdsPETableHeader141\",\n                                                                                                  \"status\": \"INLINED\",\n                                                                                                },\n                                                                                              ],\n                                                                                              \"message\": \"\",\n                                                                                              \"name\": \"TransitionCell142\",\n                                                                                              \"status\": \"INLINED\",\n                                                                                            },\n                                                                                          ],\n                                                                                          \"message\": \"\",\n                                                                                          \"name\": \"FixedDataTableCell143\",\n                                                                                          \"status\": \"INLINED\",\n                                                                                        },\n                                                                                      ],\n                                                                                      \"message\": \"\",\n                                                                                      \"name\": \"FixedDataTableCellGroupImpl144\",\n                                                                                      \"status\": \"INLINED\",\n                                                                                    },\n                                                                                  ],\n                                                                                  \"message\": \"\",\n                                                                                  \"name\": \"FixedDataTableCellGroup145\",\n                                                                                  \"status\": \"INLINED\",\n                                                                                },\n                                                                              ],\n                                                                              \"message\": \"\",\n                                                                              \"name\": \"FixedDataTableRowImpl146\",\n                                                                              \"status\": \"INLINED\",\n                                                                            },\n                                                                          ],\n                                                                          \"message\": \"\",\n                                                                          \"name\": \"FixedDataTableRow147\",\n                                                                          \"status\": \"INLINED\",\n                                                                        },\n                                                                        Object {\n                                                                          \"children\": Array [],\n                                                                          \"message\": \"\",\n                                                                          \"name\": \"FixedDataTableBufferedRows150\",\n                                                                          \"status\": \"INLINED\",\n                                                                        },\n                                                                        Object {\n                                                                          \"children\": Array [],\n                                                                          \"message\": \"\",\n                                                                          \"name\": \"Scrollbar151\",\n                                                                          \"status\": \"INLINED\",\n                                                                        },\n                                                                        Object {\n                                                                          \"children\": Array [\n                                                                            Object {\n                                                                              \"children\": Array [],\n                                                                              \"message\": \"\",\n                                                                              \"name\": \"Scrollbar151\",\n                                                                              \"status\": \"INLINED\",\n                                                                            },\n                                                                          ],\n                                                                          \"message\": \"\",\n                                                                          \"name\": \"HorizontalScrollbar152\",\n                                                                          \"status\": \"INLINED\",\n                                                                        },\n                                                                      ],\n                                                                      \"message\": \"\",\n                                                                      \"name\": \"FixedDataTable153\",\n                                                                      \"status\": \"INLINED\",\n                                                                    },\n                                                                  ],\n                                                                  \"message\": \"\",\n                                                                  \"name\": \"TransitionTable154\",\n                                                                  \"status\": \"INLINED\",\n                                                                },\n                                                              ],\n                                                              \"message\": \"\",\n                                                              \"name\": \"AdsSelectableFixedDataTable155\",\n                                                              \"status\": \"INLINED\",\n                                                            },\n                                                          ],\n                                                          \"message\": \"\",\n                                                          \"name\": \"AdsDataTableKeyboardSupportDecorator156\",\n                                                          \"status\": \"INLINED\",\n                                                        },\n                                                      ],\n                                                      \"message\": \"\",\n                                                      \"name\": \"AdsEditableDataTableDecorator157\",\n                                                      \"status\": \"INLINED\",\n                                                    },\n                                                  ],\n                                                  \"message\": \"\",\n                                                  \"name\": \"AdsPEDataTableContainer158\",\n                                                  \"status\": \"INLINED\",\n                                                },\n                                              ],\n                                              \"message\": \"\",\n                                              \"name\": \"ResponsiveBlock37\",\n                                              \"status\": \"INLINED\",\n                                            },\n                                          ],\n                                          \"message\": \"\",\n                                          \"name\": \"AdsPECampaignGroupTableContainer159\",\n                                          \"status\": \"INLINED\",\n                                        },\n                                      ],\n                                      \"message\": \"\",\n                                      \"name\": \"ErrorBoundary9\",\n                                      \"status\": \"INLINED\",\n                                    },\n                                  ],\n                                  \"message\": \"\",\n                                  \"name\": \"AdsErrorBoundary10\",\n                                  \"status\": \"INLINED\",\n                                },\n                              ],\n                              \"message\": \"\",\n                              \"name\": \"AdsPEManageAdsPaneContainer160\",\n                              \"status\": \"INLINED\",\n                            },\n                          ],\n                          \"message\": \"\",\n                          \"name\": \"AdsPEContentContainer161\",\n                          \"status\": \"INLINED\",\n                        },\n                      ],\n                      \"message\": \"\",\n                      \"name\": \"ErrorBoundary9\",\n                      \"status\": \"INLINED\",\n                    },\n                  ],\n                  \"message\": \"\",\n                  \"name\": \"AdsErrorBoundary10\",\n                  \"status\": \"INLINED\",\n                },\n              ],\n              \"message\": \"\",\n              \"name\": \"FluxContainer_AdsPEWorkspaceContainer_162\",\n              \"status\": \"INLINED\",\n            },\n            Object {\n              \"children\": Array [],\n              \"message\": \"\",\n              \"name\": \"FluxContainer_AdsSessionExpiredDialogContainer_163\",\n              \"status\": \"INLINED\",\n            },\n            Object {\n              \"children\": Array [],\n              \"message\": \"\",\n              \"name\": \"FluxContainer_AdsPEUploadDialogLazyContainer_164\",\n              \"status\": \"INLINED\",\n            },\n            Object {\n              \"children\": Array [],\n              \"message\": \"\",\n              \"name\": \"FluxContainer_DialogContainer_165\",\n              \"status\": \"INLINED\",\n            },\n            Object {\n              \"children\": Array [],\n              \"message\": \"\",\n              \"name\": \"AdsBugReportContainer166\",\n              \"status\": \"INLINED\",\n            },\n            Object {\n              \"children\": Array [\n                Object {\n                  \"children\": Array [],\n                  \"message\": \"\",\n                  \"name\": \"AdsPEAudienceSplittingDialog167\",\n                  \"status\": \"INLINED\",\n                },\n              ],\n              \"message\": \"\",\n              \"name\": \"AdsPEAudienceSplittingDialogContainer168\",\n              \"status\": \"INLINED\",\n            },\n            Object {\n              \"children\": Array [],\n              \"message\": \"\",\n              \"name\": \"FluxContainer_AdsRuleDialogBootloadContainer_169\",\n              \"status\": \"INLINED\",\n            },\n            Object {\n              \"children\": Array [],\n              \"message\": \"\",\n              \"name\": \"FluxContainer_AdsPECFTrayContainer_170\",\n              \"status\": \"INLINED\",\n            },\n            Object {\n              \"children\": Array [],\n              \"message\": \"\",\n              \"name\": \"FluxContainer_AdsPEDeleteDraftContainer_171\",\n              \"status\": \"INLINED\",\n            },\n            Object {\n              \"children\": Array [],\n              \"message\": \"\",\n              \"name\": \"FluxContainer_AdsPEInitialDraftPublishDialogContainer_172\",\n              \"status\": \"INLINED\",\n            },\n            Object {\n              \"children\": Array [],\n              \"message\": \"\",\n              \"name\": \"FluxContainer_AdsPEReachFrequencyStatusTransitionDialogBootloadContainer_173\",\n              \"status\": \"INLINED\",\n            },\n            Object {\n              \"children\": Array [],\n              \"message\": \"\",\n              \"name\": \"FluxContainer_AdsPEPurgeArchiveDialogContainer_174\",\n              \"status\": \"INLINED\",\n            },\n            Object {\n              \"children\": Array [],\n              \"message\": \"\",\n              \"name\": \"AdsPECreateDialogContainer175\",\n              \"status\": \"INLINED\",\n            },\n            Object {\n              \"children\": Array [],\n              \"message\": \"\",\n              \"name\": \"FluxContainer_AdsPEModalStatusContainer_176\",\n              \"status\": \"INLINED\",\n            },\n            Object {\n              \"children\": Array [],\n              \"message\": \"\",\n              \"name\": \"FluxContainer_AdsBrowserExtensionErrorDialogContainer_177\",\n              \"status\": \"INLINED\",\n            },\n            Object {\n              \"children\": Array [],\n              \"message\": \"\",\n              \"name\": \"FluxContainer_AdsPESortByErrorTipContainer_178\",\n              \"status\": \"INLINED\",\n            },\n            Object {\n              \"children\": Array [\n                Object {\n                  \"children\": Array [],\n                  \"message\": \"\",\n                  \"name\": \"LeadDownloadDialogSelector179\",\n                  \"status\": \"INLINED\",\n                },\n              ],\n              \"message\": \"\",\n              \"name\": \"FluxContainer_AdsPELeadDownloadDialogContainerClass_180\",\n              \"status\": \"INLINED\",\n            },\n          ],\n          \"message\": \"\",\n          \"name\": \"AdsPEContainer181\",\n          \"status\": \"INLINED\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"Benchmark\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 497,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`PE Functional Components benchmark: (createElement => createElement) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 498,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [\n            Object {\n              \"children\": Array [\n                Object {\n                  \"children\": Array [\n                    Object {\n                      \"children\": Array [\n                        Object {\n                          \"children\": Array [\n                            Object {\n                              \"children\": Array [\n                                Object {\n                                  \"children\": Array [\n                                    Object {\n                                      \"children\": Array [\n                                        Object {\n                                          \"children\": Array [\n                                            Object {\n                                              \"children\": Array [\n                                                Object {\n                                                  \"children\": Array [\n                                                    Object {\n                                                      \"children\": Array [\n                                                        Object {\n                                                          \"children\": Array [\n                                                            Object {\n                                                              \"children\": Array [\n                                                                Object {\n                                                                  \"children\": Array [\n                                                                    Object {\n                                                                      \"children\": Array [],\n                                                                      \"message\": \"\",\n                                                                      \"name\": \"ReactImage0\",\n                                                                      \"status\": \"INLINED\",\n                                                                    },\n                                                                  ],\n                                                                  \"message\": \"\",\n                                                                  \"name\": \"AbstractLink1\",\n                                                                  \"status\": \"INLINED\",\n                                                                },\n                                                              ],\n                                                              \"message\": \"\",\n                                                              \"name\": \"Link2\",\n                                                              \"status\": \"INLINED\",\n                                                            },\n                                                          ],\n                                                          \"message\": \"\",\n                                                          \"name\": \"AbstractButton3\",\n                                                          \"status\": \"INLINED\",\n                                                        },\n                                                      ],\n                                                      \"message\": \"\",\n                                                      \"name\": \"XUIButton4\",\n                                                      \"status\": \"INLINED\",\n                                                    },\n                                                  ],\n                                                  \"message\": \"\",\n                                                  \"name\": \"AbstractPopoverButton5\",\n                                                  \"status\": \"INLINED\",\n                                                },\n                                              ],\n                                              \"message\": \"\",\n                                              \"name\": \"ReactXUIPopoverButton6\",\n                                              \"status\": \"INLINED\",\n                                            },\n                                          ],\n                                          \"message\": \"\",\n                                          \"name\": \"BIGAdAccountSelector7\",\n                                          \"status\": \"INLINED\",\n                                        },\n                                      ],\n                                      \"message\": \"\",\n                                      \"name\": \"FluxContainer_AdsPEBIGAdAccountSelectorContainer_8\",\n                                      \"status\": \"INLINED\",\n                                    },\n                                  ],\n                                  \"message\": \"\",\n                                  \"name\": \"ErrorBoundary9\",\n                                  \"status\": \"INLINED\",\n                                },\n                              ],\n                              \"message\": \"\",\n                              \"name\": \"AdsErrorBoundary10\",\n                              \"status\": \"INLINED\",\n                            },\n                            Object {\n                              \"children\": Array [\n                                Object {\n                                  \"children\": Array [\n                                    Object {\n                                      \"children\": Array [\n                                        Object {\n                                          \"children\": Array [],\n                                          \"message\": \"\",\n                                          \"name\": \"AdsPENavigationBar11\",\n                                          \"status\": \"INLINED\",\n                                        },\n                                      ],\n                                      \"message\": \"\",\n                                      \"name\": \"FluxContainer_AdsPENavigationBarContainer_12\",\n                                      \"status\": \"INLINED\",\n                                    },\n                                  ],\n                                  \"message\": \"\",\n                                  \"name\": \"ErrorBoundary9\",\n                                  \"status\": \"INLINED\",\n                                },\n                              ],\n                              \"message\": \"\",\n                              \"name\": \"AdsErrorBoundary10\",\n                              \"status\": \"INLINED\",\n                            },\n                            Object {\n                              \"children\": Array [\n                                Object {\n                                  \"children\": Array [\n                                    Object {\n                                      \"children\": Array [\n                                        Object {\n                                          \"children\": Array [\n                                            Object {\n                                              \"children\": Array [\n                                                Object {\n                                                  \"children\": Array [\n                                                    Object {\n                                                      \"children\": Array [],\n                                                      \"message\": \"\",\n                                                      \"name\": \"ReactImage0\",\n                                                      \"status\": \"INLINED\",\n                                                    },\n                                                  ],\n                                                  \"message\": \"\",\n                                                  \"name\": \"AdsPEDraftSyncStatus13\",\n                                                  \"status\": \"INLINED\",\n                                                },\n                                              ],\n                                              \"message\": \"\",\n                                              \"name\": \"FluxContainer_AdsPEDraftSyncStatusContainer_14\",\n                                              \"status\": \"INLINED\",\n                                            },\n                                            Object {\n                                              \"children\": Array [\n                                                Object {\n                                                  \"children\": Array [],\n                                                  \"message\": \"\",\n                                                  \"name\": \"AdsPEDraftErrorsStatus15\",\n                                                  \"status\": \"INLINED\",\n                                                },\n                                              ],\n                                              \"message\": \"\",\n                                              \"name\": \"FluxContainer_viewFn_16\",\n                                              \"status\": \"INLINED\",\n                                            },\n                                            Object {\n                                              \"children\": Array [\n                                                Object {\n                                                  \"children\": Array [],\n                                                  \"message\": \"\",\n                                                  \"name\": \"AbstractButton3\",\n                                                  \"status\": \"INLINED\",\n                                                },\n                                              ],\n                                              \"message\": \"\",\n                                              \"name\": \"XUIButton4\",\n                                              \"status\": \"INLINED\",\n                                            },\n                                            Object {\n                                              \"children\": Array [\n                                                Object {\n                                                  \"children\": Array [\n                                                    Object {\n                                                      \"children\": Array [],\n                                                      \"message\": \"\",\n                                                      \"name\": \"ReactImage0\",\n                                                      \"status\": \"INLINED\",\n                                                    },\n                                                  ],\n                                                  \"message\": \"\",\n                                                  \"name\": \"AbstractButton3\",\n                                                  \"status\": \"INLINED\",\n                                                },\n                                              ],\n                                              \"message\": \"\",\n                                              \"name\": \"XUIButton4\",\n                                              \"status\": \"INLINED\",\n                                            },\n                                          ],\n                                          \"message\": \"\",\n                                          \"name\": \"AdsPEPublishButton17\",\n                                          \"status\": \"INLINED\",\n                                        },\n                                      ],\n                                      \"message\": \"\",\n                                      \"name\": \"FluxContainer_AdsPEPublishButtonContainer_18\",\n                                      \"status\": \"INLINED\",\n                                    },\n                                  ],\n                                  \"message\": \"\",\n                                  \"name\": \"ErrorBoundary9\",\n                                  \"status\": \"INLINED\",\n                                },\n                              ],\n                              \"message\": \"\",\n                              \"name\": \"AdsErrorBoundary10\",\n                              \"status\": \"INLINED\",\n                            },\n                            Object {\n                              \"children\": Array [\n                                Object {\n                                  \"children\": Array [\n                                    Object {\n                                      \"children\": Array [\n                                        Object {\n                                          \"children\": Array [\n                                            Object {\n                                              \"children\": Array [],\n                                              \"message\": \"\",\n                                              \"name\": \"ReactImage0\",\n                                              \"status\": \"INLINED\",\n                                            },\n                                          ],\n                                          \"message\": \"\",\n                                          \"name\": \"InlineBlock19\",\n                                          \"status\": \"INLINED\",\n                                        },\n                                      ],\n                                      \"message\": \"\",\n                                      \"name\": \"ReactPopoverMenu20\",\n                                      \"status\": \"INLINED\",\n                                    },\n                                  ],\n                                  \"message\": \"\",\n                                  \"name\": \"ErrorBoundary9\",\n                                  \"status\": \"INLINED\",\n                                },\n                              ],\n                              \"message\": \"\",\n                              \"name\": \"AdsErrorBoundary10\",\n                              \"status\": \"INLINED\",\n                            },\n                          ],\n                          \"message\": \"\",\n                          \"name\": \"LeftRight21\",\n                          \"status\": \"INLINED\",\n                        },\n                      ],\n                      \"message\": \"\",\n                      \"name\": \"AdsUnifiedNavigationLocalNav22\",\n                      \"status\": \"INLINED\",\n                    },\n                    Object {\n                      \"children\": Array [\n                        Object {\n                          \"children\": Array [\n                            Object {\n                              \"children\": Array [\n                                Object {\n                                  \"children\": Array [],\n                                  \"message\": \"\",\n                                  \"name\": \"XUIDialog23\",\n                                  \"status\": \"INLINED\",\n                                },\n                              ],\n                              \"message\": \"\",\n                              \"name\": \"AdsPEResetDialog24\",\n                              \"status\": \"INLINED\",\n                            },\n                          ],\n                          \"message\": \"\",\n                          \"name\": \"ErrorBoundary9\",\n                          \"status\": \"INLINED\",\n                        },\n                      ],\n                      \"message\": \"\",\n                      \"name\": \"AdsErrorBoundary10\",\n                      \"status\": \"INLINED\",\n                    },\n                  ],\n                  \"message\": \"\",\n                  \"name\": \"AdsPETopNav25\",\n                  \"status\": \"INLINED\",\n                },\n              ],\n              \"message\": \"\",\n              \"name\": \"FluxContainer_AdsPETopNavContainer_26\",\n              \"status\": \"INLINED\",\n            },\n            Object {\n              \"children\": Array [\n                Object {\n                  \"children\": Array [\n                    Object {\n                      \"children\": Array [\n                        Object {\n                          \"children\": Array [\n                            Object {\n                              \"children\": Array [\n                                Object {\n                                  \"children\": Array [\n                                    Object {\n                                      \"children\": Array [\n                                        Object {\n                                          \"children\": Array [\n                                            Object {\n                                              \"children\": Array [\n                                                Object {\n                                                  \"children\": Array [\n                                                    Object {\n                                                      \"children\": Array [],\n                                                      \"message\": \"\",\n                                                      \"name\": \"ReactImage0\",\n                                                      \"status\": \"INLINED\",\n                                                    },\n                                                    Object {\n                                                      \"children\": Array [\n                                                        Object {\n                                                          \"children\": Array [\n                                                            Object {\n                                                              \"children\": Array [\n                                                                Object {\n                                                                  \"children\": Array [\n                                                                    Object {\n                                                                      \"children\": Array [],\n                                                                      \"message\": \"\",\n                                                                      \"name\": \"AbstractLink1\",\n                                                                      \"status\": \"INLINED\",\n                                                                    },\n                                                                  ],\n                                                                  \"message\": \"\",\n                                                                  \"name\": \"Link2\",\n                                                                  \"status\": \"INLINED\",\n                                                                },\n                                                              ],\n                                                              \"message\": \"\",\n                                                              \"name\": \"AbstractButton3\",\n                                                              \"status\": \"INLINED\",\n                                                            },\n                                                          ],\n                                                          \"message\": \"\",\n                                                          \"name\": \"XUIAbstractGlyphButton27\",\n                                                          \"status\": \"INLINED\",\n                                                        },\n                                                      ],\n                                                      \"message\": \"\",\n                                                      \"name\": \"XUICloseButton28\",\n                                                      \"status\": \"INLINED\",\n                                                    },\n                                                    Object {\n                                                      \"children\": Array [\n                                                        Object {\n                                                          \"children\": Array [\n                                                            Object {\n                                                              \"children\": Array [],\n                                                              \"message\": \"\",\n                                                              \"name\": \"XUIText29\",\n                                                              \"status\": \"INLINED\",\n                                                            },\n                                                          ],\n                                                          \"message\": \"\",\n                                                          \"name\": \"AbstractLink1\",\n                                                          \"status\": \"INLINED\",\n                                                        },\n                                                      ],\n                                                      \"message\": \"\",\n                                                      \"name\": \"Link2\",\n                                                      \"status\": \"INLINED\",\n                                                    },\n                                                  ],\n                                                  \"message\": \"\",\n                                                  \"name\": \"XUINotice30\",\n                                                  \"status\": \"INLINED\",\n                                                },\n                                              ],\n                                              \"message\": \"\",\n                                              \"name\": \"ReactCSSTransitionGroupChild31\",\n                                              \"status\": \"INLINED\",\n                                            },\n                                          ],\n                                          \"message\": \"\",\n                                          \"name\": \"ReactTransitionGroup32\",\n                                          \"status\": \"INLINED\",\n                                        },\n                                      ],\n                                      \"message\": \"\",\n                                      \"name\": \"ReactCSSTransitionGroup33\",\n                                      \"status\": \"INLINED\",\n                                    },\n                                  ],\n                                  \"message\": \"\",\n                                  \"name\": \"AdsPETopError34\",\n                                  \"status\": \"INLINED\",\n                                },\n                              ],\n                              \"message\": \"\",\n                              \"name\": \"FluxContainer_AdsPETopErrorContainer_35\",\n                              \"status\": \"INLINED\",\n                            },\n                          ],\n                          \"message\": \"\",\n                          \"name\": \"ErrorBoundary9\",\n                          \"status\": \"INLINED\",\n                        },\n                      ],\n                      \"message\": \"\",\n                      \"name\": \"AdsErrorBoundary10\",\n                      \"status\": \"INLINED\",\n                    },\n                    Object {\n                      \"children\": Array [\n                        Object {\n                          \"children\": Array [\n                            Object {\n                              \"children\": Array [],\n                              \"message\": \"\",\n                              \"name\": \"FluxContainer_AdsGuidanceChannel_36\",\n                              \"status\": \"INLINED\",\n                            },\n                          ],\n                          \"message\": \"\",\n                          \"name\": \"ErrorBoundary9\",\n                          \"status\": \"INLINED\",\n                        },\n                      ],\n                      \"message\": \"\",\n                      \"name\": \"AdsErrorBoundary10\",\n                      \"status\": \"INLINED\",\n                    },\n                  ],\n                  \"message\": \"\",\n                  \"name\": \"ResponsiveBlock37\",\n                  \"status\": \"INLINED\",\n                },\n                Object {\n                  \"children\": Array [\n                    Object {\n                      \"children\": Array [\n                        Object {\n                          \"children\": Array [\n                            Object {\n                              \"children\": Array [\n                                Object {\n                                  \"children\": Array [\n                                    Object {\n                                      \"children\": Array [\n                                        Object {\n                                          \"children\": Array [],\n                                          \"message\": \"\",\n                                          \"name\": \"FluxContainer_AdsBulkEditDialogContainer_38\",\n                                          \"status\": \"INLINED\",\n                                        },\n                                      ],\n                                      \"message\": \"\",\n                                      \"name\": \"ErrorBoundary9\",\n                                      \"status\": \"INLINED\",\n                                    },\n                                  ],\n                                  \"message\": \"\",\n                                  \"name\": \"AdsErrorBoundary10\",\n                                  \"status\": \"INLINED\",\n                                },\n                                Object {\n                                  \"children\": Array [\n                                    Object {\n                                      \"children\": Array [\n                                        Object {\n                                          \"children\": Array [\n                                            Object {\n                                              \"children\": Array [\n                                                Object {\n                                                  \"children\": Array [\n                                                    Object {\n                                                      \"children\": Array [],\n                                                      \"message\": \"\",\n                                                      \"name\": \"Column39\",\n                                                      \"status\": \"INLINED\",\n                                                    },\n                                                    Object {\n                                                      \"children\": Array [\n                                                        Object {\n                                                          \"children\": Array [\n                                                            Object {\n                                                              \"children\": Array [\n                                                                Object {\n                                                                  \"children\": Array [\n                                                                    Object {\n                                                                      \"children\": Array [],\n                                                                      \"message\": \"\",\n                                                                      \"name\": \"ReactImage0\",\n                                                                      \"status\": \"INLINED\",\n                                                                    },\n                                                                  ],\n                                                                  \"message\": \"\",\n                                                                  \"name\": \"AbstractButton3\",\n                                                                  \"status\": \"INLINED\",\n                                                                },\n                                                              ],\n                                                              \"message\": \"\",\n                                                              \"name\": \"XUIButton4\",\n                                                              \"status\": \"INLINED\",\n                                                            },\n                                                            Object {\n                                                              \"children\": Array [\n                                                                Object {\n                                                                  \"children\": Array [\n                                                                    Object {\n                                                                      \"children\": Array [\n                                                                        Object {\n                                                                          \"children\": Array [\n                                                                            Object {\n                                                                              \"children\": Array [],\n                                                                              \"message\": \"\",\n                                                                              \"name\": \"ReactImage0\",\n                                                                              \"status\": \"INLINED\",\n                                                                            },\n                                                                          ],\n                                                                          \"message\": \"\",\n                                                                          \"name\": \"AbstractButton3\",\n                                                                          \"status\": \"INLINED\",\n                                                                        },\n                                                                      ],\n                                                                      \"message\": \"\",\n                                                                      \"name\": \"XUIButton4\",\n                                                                      \"status\": \"INLINED\",\n                                                                    },\n                                                                  ],\n                                                                  \"message\": \"\",\n                                                                  \"name\": \"InlineBlock19\",\n                                                                  \"status\": \"INLINED\",\n                                                                },\n                                                              ],\n                                                              \"message\": \"\",\n                                                              \"name\": \"ReactPopoverMenu20\",\n                                                              \"status\": \"INLINED\",\n                                                            },\n                                                          ],\n                                                          \"message\": \"\",\n                                                          \"name\": \"XUIButtonGroup40\",\n                                                          \"status\": \"INLINED\",\n                                                        },\n                                                        Object {\n                                                          \"children\": Array [\n                                                            Object {\n                                                              \"children\": Array [\n                                                                Object {\n                                                                  \"children\": Array [\n                                                                    Object {\n                                                                      \"children\": Array [\n                                                                        Object {\n                                                                          \"children\": Array [\n                                                                            Object {\n                                                                              \"children\": Array [\n                                                                                Object {\n                                                                                  \"children\": Array [],\n                                                                                  \"message\": \"\",\n                                                                                  \"name\": \"ReactImage0\",\n                                                                                  \"status\": \"INLINED\",\n                                                                                },\n                                                                              ],\n                                                                              \"message\": \"\",\n                                                                              \"name\": \"AbstractButton3\",\n                                                                              \"status\": \"INLINED\",\n                                                                            },\n                                                                          ],\n                                                                          \"message\": \"\",\n                                                                          \"name\": \"XUIButton4\",\n                                                                          \"status\": \"INLINED\",\n                                                                        },\n                                                                        Object {\n                                                                          \"children\": Array [\n                                                                            Object {\n                                                                              \"children\": Array [\n                                                                                Object {\n                                                                                  \"children\": Array [\n                                                                                    Object {\n                                                                                      \"children\": Array [\n                                                                                        Object {\n                                                                                          \"children\": Array [],\n                                                                                          \"message\": \"\",\n                                                                                          \"name\": \"ReactImage0\",\n                                                                                          \"status\": \"INLINED\",\n                                                                                        },\n                                                                                      ],\n                                                                                      \"message\": \"\",\n                                                                                      \"name\": \"AbstractButton3\",\n                                                                                      \"status\": \"INLINED\",\n                                                                                    },\n                                                                                  ],\n                                                                                  \"message\": \"\",\n                                                                                  \"name\": \"XUIButton4\",\n                                                                                  \"status\": \"INLINED\",\n                                                                                },\n                                                                              ],\n                                                                              \"message\": \"\",\n                                                                              \"name\": \"InlineBlock19\",\n                                                                              \"status\": \"INLINED\",\n                                                                            },\n                                                                          ],\n                                                                          \"message\": \"\",\n                                                                          \"name\": \"ReactPopoverMenu20\",\n                                                                          \"status\": \"INLINED\",\n                                                                        },\n                                                                      ],\n                                                                      \"message\": \"\",\n                                                                      \"name\": \"XUIButtonGroup40\",\n                                                                      \"status\": \"INLINED\",\n                                                                    },\n                                                                  ],\n                                                                  \"message\": \"\",\n                                                                  \"name\": \"AdsPEEditToolbarButton41\",\n                                                                  \"status\": \"INLINED\",\n                                                                },\n                                                              ],\n                                                              \"message\": \"\",\n                                                              \"name\": \"FluxContainer_AdsPEEditCampaignGroupToolbarButtonContainer_42\",\n                                                              \"status\": \"INLINED\",\n                                                            },\n                                                          ],\n                                                          \"message\": \"\",\n                                                          \"name\": \"FluxContainer_AdsPEEditToolbarButtonContainer_43\",\n                                                          \"status\": \"INLINED\",\n                                                        },\n                                                        Object {\n                                                          \"children\": Array [\n                                                            Object {\n                                                              \"children\": Array [\n                                                                Object {\n                                                                  \"children\": Array [\n                                                                    Object {\n                                                                      \"children\": Array [],\n                                                                      \"message\": \"\",\n                                                                      \"name\": \"ReactImage0\",\n                                                                      \"status\": \"INLINED\",\n                                                                    },\n                                                                  ],\n                                                                  \"message\": \"\",\n                                                                  \"name\": \"AbstractButton3\",\n                                                                  \"status\": \"INLINED\",\n                                                                },\n                                                              ],\n                                                              \"message\": \"\",\n                                                              \"name\": \"XUIButton4\",\n                                                              \"status\": \"INLINED\",\n                                                            },\n                                                            Object {\n                                                              \"children\": Array [\n                                                                Object {\n                                                                  \"children\": Array [\n                                                                    Object {\n                                                                      \"children\": Array [],\n                                                                      \"message\": \"\",\n                                                                      \"name\": \"ReactImage0\",\n                                                                      \"status\": \"INLINED\",\n                                                                    },\n                                                                  ],\n                                                                  \"message\": \"\",\n                                                                  \"name\": \"AbstractButton3\",\n                                                                  \"status\": \"INLINED\",\n                                                                },\n                                                              ],\n                                                              \"message\": \"\",\n                                                              \"name\": \"XUIButton4\",\n                                                              \"status\": \"INLINED\",\n                                                            },\n                                                            Object {\n                                                              \"children\": Array [\n                                                                Object {\n                                                                  \"children\": Array [\n                                                                    Object {\n                                                                      \"children\": Array [],\n                                                                      \"message\": \"\",\n                                                                      \"name\": \"ReactImage0\",\n                                                                      \"status\": \"INLINED\",\n                                                                    },\n                                                                  ],\n                                                                  \"message\": \"\",\n                                                                  \"name\": \"AbstractButton3\",\n                                                                  \"status\": \"INLINED\",\n                                                                },\n                                                              ],\n                                                              \"message\": \"\",\n                                                              \"name\": \"XUIButton4\",\n                                                              \"status\": \"INLINED\",\n                                                            },\n                                                          ],\n                                                          \"message\": \"\",\n                                                          \"name\": \"XUIButtonGroup40\",\n                                                          \"status\": \"INLINED\",\n                                                        },\n                                                        Object {\n                                                          \"children\": Array [\n                                                            Object {\n                                                              \"children\": Array [\n                                                                Object {\n                                                                  \"children\": Array [\n                                                                    Object {\n                                                                      \"children\": Array [\n                                                                        Object {\n                                                                          \"children\": Array [\n                                                                            Object {\n                                                                              \"children\": Array [\n                                                                                Object {\n                                                                                  \"children\": Array [\n                                                                                    Object {\n                                                                                      \"children\": Array [],\n                                                                                      \"message\": \"\",\n                                                                                      \"name\": \"ReactImage0\",\n                                                                                      \"status\": \"INLINED\",\n                                                                                    },\n                                                                                  ],\n                                                                                  \"message\": \"\",\n                                                                                  \"name\": \"AbstractButton3\",\n                                                                                  \"status\": \"INLINED\",\n                                                                                },\n                                                                              ],\n                                                                              \"message\": \"\",\n                                                                              \"name\": \"XUIButton4\",\n                                                                              \"status\": \"INLINED\",\n                                                                            },\n                                                                          ],\n                                                                          \"message\": \"\",\n                                                                          \"name\": \"InlineBlock19\",\n                                                                          \"status\": \"INLINED\",\n                                                                        },\n                                                                      ],\n                                                                      \"message\": \"\",\n                                                                      \"name\": \"ReactPopoverMenu20\",\n                                                                      \"status\": \"INLINED\",\n                                                                    },\n                                                                  ],\n                                                                  \"message\": \"\",\n                                                                  \"name\": \"AdsPEExportImportMenu44\",\n                                                                  \"status\": \"INLINED\",\n                                                                },\n                                                                Object {\n                                                                  \"children\": Array [],\n                                                                  \"message\": \"\",\n                                                                  \"name\": \"FluxContainer_AdsPECustomizeExportContainer_45\",\n                                                                  \"status\": \"INLINED\",\n                                                                },\n                                                                Object {\n                                                                  \"children\": Array [\n                                                                    Object {\n                                                                      \"children\": Array [],\n                                                                      \"message\": \"\",\n                                                                      \"name\": \"AdsPEExportAsTextDialog46\",\n                                                                      \"status\": \"INLINED\",\n                                                                    },\n                                                                  ],\n                                                                  \"message\": \"\",\n                                                                  \"name\": \"FluxContainer_AdsPEExportAsTextDialogContainer_47\",\n                                                                  \"status\": \"INLINED\",\n                                                                },\n                                                              ],\n                                                              \"message\": \"\",\n                                                              \"name\": \"AdsPEExportImportMenuContainer48\",\n                                                              \"status\": \"INLINED\",\n                                                            },\n                                                            Object {\n                                                              \"children\": Array [\n                                                                Object {\n                                                                  \"children\": Array [\n                                                                    Object {\n                                                                      \"children\": Array [],\n                                                                      \"message\": \"\",\n                                                                      \"name\": \"ReactImage0\",\n                                                                      \"status\": \"INLINED\",\n                                                                    },\n                                                                  ],\n                                                                  \"message\": \"\",\n                                                                  \"name\": \"AbstractButton3\",\n                                                                  \"status\": \"INLINED\",\n                                                                },\n                                                              ],\n                                                              \"message\": \"\",\n                                                              \"name\": \"XUIButton4\",\n                                                              \"status\": \"INLINED\",\n                                                            },\n                                                            Object {\n                                                              \"children\": Array [\n                                                                Object {\n                                                                  \"children\": Array [\n                                                                    Object {\n                                                                      \"children\": Array [\n                                                                        Object {\n                                                                          \"children\": Array [\n                                                                            Object {\n                                                                              \"children\": Array [],\n                                                                              \"message\": \"\",\n                                                                              \"name\": \"ReactImage0\",\n                                                                              \"status\": \"INLINED\",\n                                                                            },\n                                                                          ],\n                                                                          \"message\": \"\",\n                                                                          \"name\": \"AbstractButton3\",\n                                                                          \"status\": \"INLINED\",\n                                                                        },\n                                                                      ],\n                                                                      \"message\": \"\",\n                                                                      \"name\": \"XUIButton4\",\n                                                                      \"status\": \"INLINED\",\n                                                                    },\n                                                                    Object {\n                                                                      \"children\": Array [],\n                                                                      \"message\": \"\",\n                                                                      \"name\": \"Constructor49\",\n                                                                      \"status\": \"INLINED\",\n                                                                    },\n                                                                  ],\n                                                                  \"message\": \"\",\n                                                                  \"name\": \"TagSelectorPopover50\",\n                                                                  \"status\": \"INLINED\",\n                                                                },\n                                                              ],\n                                                              \"message\": \"\",\n                                                              \"name\": \"AdsPECampaignGroupTagContainer51\",\n                                                              \"status\": \"INLINED\",\n                                                            },\n                                                          ],\n                                                          \"message\": \"\",\n                                                          \"name\": \"XUIButtonGroup40\",\n                                                          \"status\": \"INLINED\",\n                                                        },\n                                                        Object {\n                                                          \"children\": Array [\n                                                            Object {\n                                                              \"children\": Array [],\n                                                              \"message\": \"\",\n                                                              \"name\": \"AdsRuleToolbarMenu52\",\n                                                              \"status\": \"INLINED\",\n                                                            },\n                                                          ],\n                                                          \"message\": \"\",\n                                                          \"name\": \"FluxContainer_AdsPERuleToolbarMenuContainer_53\",\n                                                          \"status\": \"INLINED\",\n                                                        },\n                                                      ],\n                                                      \"message\": \"\",\n                                                      \"name\": \"FillColumn54\",\n                                                      \"status\": \"INLINED\",\n                                                    },\n                                                  ],\n                                                  \"message\": \"\",\n                                                  \"name\": \"Layout55\",\n                                                  \"status\": \"INLINED\",\n                                                },\n                                              ],\n                                              \"message\": \"\",\n                                              \"name\": \"AdsPEMainPaneToolbar56\",\n                                              \"status\": \"INLINED\",\n                                            },\n                                          ],\n                                          \"message\": \"\",\n                                          \"name\": \"AdsPECampaignGroupToolbarContainer57\",\n                                          \"status\": \"INLINED\",\n                                        },\n                                      ],\n                                      \"message\": \"\",\n                                      \"name\": \"ErrorBoundary9\",\n                                      \"status\": \"INLINED\",\n                                    },\n                                  ],\n                                  \"message\": \"\",\n                                  \"name\": \"AdsErrorBoundary10\",\n                                  \"status\": \"INLINED\",\n                                },\n                                Object {\n                                  \"children\": Array [\n                                    Object {\n                                      \"children\": Array [\n                                        Object {\n                                          \"children\": Array [\n                                            Object {\n                                              \"children\": Array [\n                                                Object {\n                                                  \"children\": Array [\n                                                    Object {\n                                                      \"children\": Array [\n                                                        Object {\n                                                          \"children\": Array [\n                                                            Object {\n                                                              \"children\": Array [\n                                                                Object {\n                                                                  \"children\": Array [\n                                                                    Object {\n                                                                      \"children\": Array [\n                                                                        Object {\n                                                                          \"children\": Array [\n                                                                            Object {\n                                                                              \"children\": Array [],\n                                                                              \"message\": \"\",\n                                                                              \"name\": \"ReactImage0\",\n                                                                              \"status\": \"INLINED\",\n                                                                            },\n                                                                            Object {\n                                                                              \"children\": Array [],\n                                                                              \"message\": \"\",\n                                                                              \"name\": \"ReactImage0\",\n                                                                              \"status\": \"INLINED\",\n                                                                            },\n                                                                          ],\n                                                                          \"message\": \"\",\n                                                                          \"name\": \"AbstractLink1\",\n                                                                          \"status\": \"INLINED\",\n                                                                        },\n                                                                      ],\n                                                                      \"message\": \"\",\n                                                                      \"name\": \"Link2\",\n                                                                      \"status\": \"INLINED\",\n                                                                    },\n                                                                  ],\n                                                                  \"message\": \"\",\n                                                                  \"name\": \"AbstractButton3\",\n                                                                  \"status\": \"INLINED\",\n                                                                },\n                                                              ],\n                                                              \"message\": \"\",\n                                                              \"name\": \"XUIButton4\",\n                                                              \"status\": \"INLINED\",\n                                                            },\n                                                          ],\n                                                          \"message\": \"\",\n                                                          \"name\": \"AbstractPopoverButton5\",\n                                                          \"status\": \"INLINED\",\n                                                        },\n                                                      ],\n                                                      \"message\": \"\",\n                                                      \"name\": \"ReactXUIPopoverButton6\",\n                                                      \"status\": \"INLINED\",\n                                                    },\n                                                    Object {\n                                                      \"children\": Array [\n                                                        Object {\n                                                          \"children\": Array [\n                                                            Object {\n                                                              \"children\": Array [\n                                                                Object {\n                                                                  \"children\": Array [\n                                                                    Object {\n                                                                      \"children\": Array [\n                                                                        Object {\n                                                                          \"children\": Array [\n                                                                            Object {\n                                                                              \"children\": Array [],\n                                                                              \"message\": \"\",\n                                                                              \"name\": \"ReactImage0\",\n                                                                              \"status\": \"INLINED\",\n                                                                            },\n                                                                            Object {\n                                                                              \"children\": Array [],\n                                                                              \"message\": \"\",\n                                                                              \"name\": \"ReactImage0\",\n                                                                              \"status\": \"INLINED\",\n                                                                            },\n                                                                          ],\n                                                                          \"message\": \"\",\n                                                                          \"name\": \"AbstractLink1\",\n                                                                          \"status\": \"INLINED\",\n                                                                        },\n                                                                      ],\n                                                                      \"message\": \"\",\n                                                                      \"name\": \"Link2\",\n                                                                      \"status\": \"INLINED\",\n                                                                    },\n                                                                  ],\n                                                                  \"message\": \"\",\n                                                                  \"name\": \"AbstractButton3\",\n                                                                  \"status\": \"INLINED\",\n                                                                },\n                                                              ],\n                                                              \"message\": \"\",\n                                                              \"name\": \"XUIButton4\",\n                                                              \"status\": \"INLINED\",\n                                                            },\n                                                          ],\n                                                          \"message\": \"\",\n                                                          \"name\": \"AbstractPopoverButton5\",\n                                                          \"status\": \"INLINED\",\n                                                        },\n                                                      ],\n                                                      \"message\": \"\",\n                                                      \"name\": \"ReactXUIPopoverButton6\",\n                                                      \"status\": \"INLINED\",\n                                                    },\n                                                    Object {\n                                                      \"children\": Array [],\n                                                      \"message\": \"\",\n                                                      \"name\": \"Constructor49\",\n                                                      \"status\": \"INLINED\",\n                                                    },\n                                                    Object {\n                                                      \"children\": Array [],\n                                                      \"message\": \"\",\n                                                      \"name\": \"Constructor49\",\n                                                      \"status\": \"INLINED\",\n                                                    },\n                                                  ],\n                                                  \"message\": \"\",\n                                                  \"name\": \"AdsPEFiltersPopover58\",\n                                                  \"status\": \"INLINED\",\n                                                },\n                                                Object {\n                                                  \"children\": Array [\n                                                    Object {\n                                                      \"children\": Array [\n                                                        Object {\n                                                          \"children\": Array [],\n                                                          \"message\": \"\",\n                                                          \"name\": \"AbstractCheckboxInput59\",\n                                                          \"status\": \"INLINED\",\n                                                        },\n                                                      ],\n                                                      \"message\": \"\",\n                                                      \"name\": \"XUICheckboxInput60\",\n                                                      \"status\": \"INLINED\",\n                                                    },\n                                                  ],\n                                                  \"message\": \"\",\n                                                  \"name\": \"InputLabel61\",\n                                                  \"status\": \"INLINED\",\n                                                },\n                                                Object {\n                                                  \"children\": Array [\n                                                    Object {\n                                                      \"children\": Array [\n                                                        Object {\n                                                          \"children\": Array [],\n                                                          \"message\": \"\",\n                                                          \"name\": \"ReactImage0\",\n                                                          \"status\": \"INLINED\",\n                                                        },\n                                                        Object {\n                                                          \"children\": Array [\n                                                            Object {\n                                                              \"children\": Array [\n                                                                Object {\n                                                                  \"children\": Array [],\n                                                                  \"message\": \"\",\n                                                                  \"name\": \"AbstractButton3\",\n                                                                  \"status\": \"INLINED\",\n                                                                },\n                                                              ],\n                                                              \"message\": \"\",\n                                                              \"name\": \"XUIAbstractGlyphButton27\",\n                                                              \"status\": \"INLINED\",\n                                                            },\n                                                          ],\n                                                          \"message\": \"\",\n                                                          \"name\": \"XUICloseButton28\",\n                                                          \"status\": \"INLINED\",\n                                                        },\n                                                        Object {\n                                                          \"children\": Array [\n                                                            Object {\n                                                              \"children\": Array [],\n                                                              \"message\": \"\",\n                                                              \"name\": \"ReactImage0\",\n                                                              \"status\": \"INLINED\",\n                                                            },\n                                                            Object {\n                                                              \"children\": Array [\n                                                                Object {\n                                                                  \"children\": Array [\n                                                                    Object {\n                                                                      \"children\": Array [],\n                                                                      \"message\": \"\",\n                                                                      \"name\": \"ReactImage0\",\n                                                                      \"status\": \"INLINED\",\n                                                                    },\n                                                                  ],\n                                                                  \"message\": \"\",\n                                                                  \"name\": \"AdsPopoverLink62\",\n                                                                  \"status\": \"INLINED\",\n                                                                },\n                                                              ],\n                                                              \"message\": \"\",\n                                                              \"name\": \"AdsHelpLink63\",\n                                                              \"status\": \"INLINED\",\n                                                            },\n                                                            Object {\n                                                              \"children\": Array [\n                                                                Object {\n                                                                  \"children\": Array [],\n                                                                  \"message\": \"\",\n                                                                  \"name\": \"AbstractButton3\",\n                                                                  \"status\": \"INLINED\",\n                                                                },\n                                                              ],\n                                                              \"message\": \"\",\n                                                              \"name\": \"XUIButton4\",\n                                                              \"status\": \"INLINED\",\n                                                            },\n                                                          ],\n                                                          \"message\": \"\",\n                                                          \"name\": \"BUIFilterTokenInput64\",\n                                                          \"status\": \"INLINED\",\n                                                        },\n                                                      ],\n                                                      \"message\": \"\",\n                                                      \"name\": \"BUIFilterToken65\",\n                                                      \"status\": \"INLINED\",\n                                                    },\n                                                    Object {\n                                                      \"children\": Array [\n                                                        Object {\n                                                          \"children\": Array [\n                                                            Object {\n                                                              \"children\": Array [\n                                                                Object {\n                                                                  \"children\": Array [],\n                                                                  \"message\": \"\",\n                                                                  \"name\": \"ReactImage0\",\n                                                                  \"status\": \"INLINED\",\n                                                                },\n                                                              ],\n                                                              \"message\": \"\",\n                                                              \"name\": \"AbstractButton3\",\n                                                              \"status\": \"INLINED\",\n                                                            },\n                                                          ],\n                                                          \"message\": \"\",\n                                                          \"name\": \"XUIButton4\",\n                                                          \"status\": \"INLINED\",\n                                                        },\n                                                      ],\n                                                      \"message\": \"\",\n                                                      \"name\": \"BUIFilterTokenCreateButton66\",\n                                                      \"status\": \"INLINED\",\n                                                    },\n                                                  ],\n                                                  \"message\": \"\",\n                                                  \"name\": \"BUIFilterTokenizer67\",\n                                                  \"status\": \"INLINED\",\n                                                },\n                                                Object {\n                                                  \"children\": Array [\n                                                    Object {\n                                                      \"children\": Array [\n                                                        Object {\n                                                          \"children\": Array [],\n                                                          \"message\": \"\",\n                                                          \"name\": \"XUIAmbientNUX68\",\n                                                          \"status\": \"INLINED\",\n                                                        },\n                                                      ],\n                                                      \"message\": \"\",\n                                                      \"name\": \"XUIAmbientNUX69\",\n                                                      \"status\": \"INLINED\",\n                                                    },\n                                                  ],\n                                                  \"message\": \"\",\n                                                  \"name\": \"AdsPEAmbientNUXMegaphone70\",\n                                                  \"status\": \"INLINED\",\n                                                },\n                                              ],\n                                              \"message\": \"\",\n                                              \"name\": \"AdsPEFilters71\",\n                                              \"status\": \"INLINED\",\n                                            },\n                                          ],\n                                          \"message\": \"\",\n                                          \"name\": \"AdsPEFilterContainer72\",\n                                          \"status\": \"INLINED\",\n                                        },\n                                      ],\n                                      \"message\": \"\",\n                                      \"name\": \"ErrorBoundary9\",\n                                      \"status\": \"INLINED\",\n                                    },\n                                  ],\n                                  \"message\": \"\",\n                                  \"name\": \"AdsErrorBoundary10\",\n                                  \"status\": \"INLINED\",\n                                },\n                                Object {\n                                  \"children\": Array [\n                                    Object {\n                                      \"children\": Array [\n                                        Object {\n                                          \"children\": Array [\n                                            Object {\n                                              \"children\": Array [\n                                                Object {\n                                                  \"children\": Array [],\n                                                  \"message\": \"\",\n                                                  \"name\": \"AdsPETablePager73\",\n                                                  \"status\": \"INLINED\",\n                                                },\n                                              ],\n                                              \"message\": \"\",\n                                              \"name\": \"AdsPECampaignGroupTablePagerContainer74\",\n                                              \"status\": \"INLINED\",\n                                            },\n                                          ],\n                                          \"message\": \"\",\n                                          \"name\": \"AdsPETablePagerContainer75\",\n                                          \"status\": \"INLINED\",\n                                        },\n                                      ],\n                                      \"message\": \"\",\n                                      \"name\": \"ErrorBoundary9\",\n                                      \"status\": \"INLINED\",\n                                    },\n                                  ],\n                                  \"message\": \"\",\n                                  \"name\": \"AdsErrorBoundary10\",\n                                  \"status\": \"INLINED\",\n                                },\n                                Object {\n                                  \"children\": Array [\n                                    Object {\n                                      \"children\": Array [\n                                        Object {\n                                          \"children\": Array [\n                                            Object {\n                                              \"children\": Array [\n                                                Object {\n                                                  \"children\": Array [\n                                                    Object {\n                                                      \"children\": Array [\n                                                        Object {\n                                                          \"children\": Array [\n                                                            Object {\n                                                              \"children\": Array [\n                                                                Object {\n                                                                  \"children\": Array [\n                                                                    Object {\n                                                                      \"children\": Array [\n                                                                        Object {\n                                                                          \"children\": Array [\n                                                                            Object {\n                                                                              \"children\": Array [],\n                                                                              \"message\": \"\",\n                                                                              \"name\": \"ReactImage0\",\n                                                                              \"status\": \"INLINED\",\n                                                                            },\n                                                                          ],\n                                                                          \"message\": \"\",\n                                                                          \"name\": \"AbstractLink1\",\n                                                                          \"status\": \"INLINED\",\n                                                                        },\n                                                                      ],\n                                                                      \"message\": \"\",\n                                                                      \"name\": \"Link2\",\n                                                                      \"status\": \"INLINED\",\n                                                                    },\n                                                                  ],\n                                                                  \"message\": \"\",\n                                                                  \"name\": \"AbstractButton3\",\n                                                                  \"status\": \"INLINED\",\n                                                                },\n                                                              ],\n                                                              \"message\": \"\",\n                                                              \"name\": \"ReactXUIError76\",\n                                                              \"status\": \"INLINED\",\n                                                            },\n                                                          ],\n                                                          \"message\": \"\",\n                                                          \"name\": \"BUIPopoverButton77\",\n                                                          \"status\": \"INLINED\",\n                                                        },\n                                                        Object {\n                                                          \"children\": Array [],\n                                                          \"message\": \"\",\n                                                          \"name\": \"Constructor49\",\n                                                          \"status\": \"INLINED\",\n                                                        },\n                                                      ],\n                                                      \"message\": \"\",\n                                                      \"name\": \"BUIDateRangePicker78\",\n                                                      \"status\": \"INLINED\",\n                                                    },\n                                                  ],\n                                                  \"message\": \"\",\n                                                  \"name\": \"AdsPEStatsRangePicker79\",\n                                                  \"status\": \"INLINED\",\n                                                },\n                                                Object {\n                                                  \"children\": Array [\n                                                    Object {\n                                                      \"children\": Array [\n                                                        Object {\n                                                          \"children\": Array [],\n                                                          \"message\": \"\",\n                                                          \"name\": \"ReactImage0\",\n                                                          \"status\": \"INLINED\",\n                                                        },\n                                                      ],\n                                                      \"message\": \"\",\n                                                      \"name\": \"AbstractButton3\",\n                                                      \"status\": \"INLINED\",\n                                                    },\n                                                  ],\n                                                  \"message\": \"\",\n                                                  \"name\": \"XUIButton4\",\n                                                  \"status\": \"INLINED\",\n                                                },\n                                                Object {\n                                                  \"children\": Array [\n                                                    Object {\n                                                      \"children\": Array [],\n                                                      \"message\": \"\",\n                                                      \"name\": \"XUIAmbientNUX68\",\n                                                      \"status\": \"INLINED\",\n                                                    },\n                                                  ],\n                                                  \"message\": \"\",\n                                                  \"name\": \"XUIAmbientNUX69\",\n                                                  \"status\": \"INLINED\",\n                                                },\n                                              ],\n                                              \"message\": \"\",\n                                              \"name\": \"AdsPEStatRange80\",\n                                              \"status\": \"INLINED\",\n                                            },\n                                          ],\n                                          \"message\": \"\",\n                                          \"name\": \"AdsPEStatRangeContainer81\",\n                                          \"status\": \"INLINED\",\n                                        },\n                                      ],\n                                      \"message\": \"\",\n                                      \"name\": \"ErrorBoundary9\",\n                                      \"status\": \"INLINED\",\n                                    },\n                                  ],\n                                  \"message\": \"\",\n                                  \"name\": \"AdsErrorBoundary10\",\n                                  \"status\": \"INLINED\",\n                                },\n                                Object {\n                                  \"children\": Array [\n                                    Object {\n                                      \"children\": Array [\n                                        Object {\n                                          \"children\": Array [\n                                            Object {\n                                              \"children\": Array [\n                                                Object {\n                                                  \"children\": Array [\n                                                    Object {\n                                                      \"children\": Array [\n                                                        Object {\n                                                          \"children\": Array [],\n                                                          \"message\": \"\",\n                                                          \"name\": \"ReactImage0\",\n                                                          \"status\": \"INLINED\",\n                                                        },\n                                                      ],\n                                                      \"message\": \"\",\n                                                      \"name\": \"AdsPESideTrayTabButton82\",\n                                                      \"status\": \"INLINED\",\n                                                    },\n                                                  ],\n                                                  \"message\": \"\",\n                                                  \"name\": \"AdsPEEditorTrayTabButton83\",\n                                                  \"status\": \"INLINED\",\n                                                },\n                                                Object {\n                                                  \"children\": Array [\n                                                    Object {\n                                                      \"children\": Array [\n                                                        Object {\n                                                          \"children\": Array [],\n                                                          \"message\": \"\",\n                                                          \"name\": \"ReactImage0\",\n                                                          \"status\": \"INLINED\",\n                                                        },\n                                                      ],\n                                                      \"message\": \"\",\n                                                      \"name\": \"AdsPESideTrayTabButton82\",\n                                                      \"status\": \"INLINED\",\n                                                    },\n                                                    Object {\n                                                      \"children\": Array [\n                                                        Object {\n                                                          \"children\": Array [],\n                                                          \"message\": \"\",\n                                                          \"name\": \"XUIAmbientNUX68\",\n                                                          \"status\": \"INLINED\",\n                                                        },\n                                                      ],\n                                                      \"message\": \"\",\n                                                      \"name\": \"XUIAmbientNUX69\",\n                                                      \"status\": \"INLINED\",\n                                                    },\n                                                  ],\n                                                  \"message\": \"\",\n                                                  \"name\": \"AdsPEInsightsTrayTabButton84\",\n                                                  \"status\": \"INLINED\",\n                                                },\n                                                Object {\n                                                  \"children\": Array [\n                                                    Object {\n                                                      \"children\": Array [],\n                                                      \"message\": \"\",\n                                                      \"name\": \"AdsPESideTrayTabButton82\",\n                                                      \"status\": \"INLINED\",\n                                                    },\n                                                  ],\n                                                  \"message\": \"\",\n                                                  \"name\": \"AdsPENekoDebuggerTrayTabButton85\",\n                                                  \"status\": \"INLINED\",\n                                                },\n                                                Object {\n                                                  \"children\": Array [\n                                                    Object {\n                                                      \"children\": Array [\n                                                        Object {\n                                                          \"children\": Array [\n                                                            Object {\n                                                              \"children\": Array [\n                                                                Object {\n                                                                  \"children\": Array [\n                                                                    Object {\n                                                                      \"children\": Array [\n                                                                        Object {\n                                                                          \"children\": Array [],\n                                                                          \"message\": \"\",\n                                                                          \"name\": \"XUIText29\",\n                                                                          \"status\": \"INLINED\",\n                                                                        },\n                                                                        Object {\n                                                                          \"children\": Array [],\n                                                                          \"message\": \"\",\n                                                                          \"name\": \"XUIText29\",\n                                                                          \"status\": \"INLINED\",\n                                                                        },\n                                                                        Object {\n                                                                          \"children\": Array [\n                                                                            Object {\n                                                                              \"children\": Array [\n                                                                                Object {\n                                                                                  \"children\": Array [\n                                                                                    Object {\n                                                                                      \"children\": Array [],\n                                                                                      \"message\": \"\",\n                                                                                      \"name\": \"AbstractLink1\",\n                                                                                      \"status\": \"INLINED\",\n                                                                                    },\n                                                                                  ],\n                                                                                  \"message\": \"\",\n                                                                                  \"name\": \"Link2\",\n                                                                                  \"status\": \"INLINED\",\n                                                                                },\n                                                                                Object {\n                                                                                  \"children\": Array [\n                                                                                    Object {\n                                                                                      \"children\": Array [],\n                                                                                      \"message\": \"\",\n                                                                                      \"name\": \"AbstractLink1\",\n                                                                                      \"status\": \"INLINED\",\n                                                                                    },\n                                                                                  ],\n                                                                                  \"message\": \"\",\n                                                                                  \"name\": \"Link2\",\n                                                                                  \"status\": \"INLINED\",\n                                                                                },\n                                                                              ],\n                                                                              \"message\": \"\",\n                                                                              \"name\": \"AdsPEEditorChildLink86\",\n                                                                              \"status\": \"INLINED\",\n                                                                            },\n                                                                          ],\n                                                                          \"message\": \"\",\n                                                                          \"name\": \"AdsPEEditorChildLinkContainer87\",\n                                                                          \"status\": \"INLINED\",\n                                                                        },\n                                                                      ],\n                                                                      \"message\": \"\",\n                                                                      \"name\": \"AdsPEHeaderSection88\",\n                                                                      \"status\": \"INLINED\",\n                                                                    },\n                                                                  ],\n                                                                  \"message\": \"\",\n                                                                  \"name\": \"AdsPECampaignGroupHeaderSectionContainer89\",\n                                                                  \"status\": \"INLINED\",\n                                                                },\n                                                                Object {\n                                                                  \"children\": Array [\n                                                                    Object {\n                                                                      \"children\": Array [],\n                                                                      \"message\": \"\",\n                                                                      \"name\": \"AdsEditorLoadingErrors90\",\n                                                                      \"status\": \"INLINED\",\n                                                                    },\n                                                                    Object {\n                                                                      \"children\": Array [\n                                                                        Object {\n                                                                          \"children\": Array [\n                                                                            Object {\n                                                                              \"children\": Array [\n                                                                                Object {\n                                                                                  \"children\": Array [\n                                                                                    Object {\n                                                                                      \"children\": Array [\n                                                                                        Object {\n                                                                                          \"children\": Array [\n                                                                                            Object {\n                                                                                              \"children\": Array [\n                                                                                                Object {\n                                                                                                  \"children\": Array [\n                                                                                                    Object {\n                                                                                                      \"children\": Array [\n                                                                                                        Object {\n                                                                                                          \"children\": Array [\n                                                                                                            Object {\n                                                                                                              \"children\": Array [\n                                                                                                                Object {\n                                                                                                                  \"children\": Array [],\n                                                                                                                  \"message\": \"\",\n                                                                                                                  \"name\": \"ReactXUIError76\",\n                                                                                                                  \"status\": \"INLINED\",\n                                                                                                                },\n                                                                                                              ],\n                                                                                                              \"message\": \"\",\n                                                                                                              \"name\": \"AdsTextInput91\",\n                                                                                                              \"status\": \"INLINED\",\n                                                                                                            },\n                                                                                                          ],\n                                                                                                          \"message\": \"\",\n                                                                                                          \"name\": \"BUIFormElement92\",\n                                                                                                          \"status\": \"INLINED\",\n                                                                                                        },\n                                                                                                      ],\n                                                                                                      \"message\": \"\",\n                                                                                                      \"name\": \"BUIForm93\",\n                                                                                                      \"status\": \"INLINED\",\n                                                                                                    },\n                                                                                                  ],\n                                                                                                  \"message\": \"\",\n                                                                                                  \"name\": \"XUICard94\",\n                                                                                                  \"status\": \"INLINED\",\n                                                                                                },\n                                                                                              ],\n                                                                                              \"message\": \"\",\n                                                                                              \"name\": \"ReactXUIError76\",\n                                                                                              \"status\": \"INLINED\",\n                                                                                            },\n                                                                                          ],\n                                                                                          \"message\": \"\",\n                                                                                          \"name\": \"AdsCard95\",\n                                                                                          \"status\": \"INLINED\",\n                                                                                        },\n                                                                                      ],\n                                                                                      \"message\": \"\",\n                                                                                      \"name\": \"AdsEditorNameSection96\",\n                                                                                      \"status\": \"INLINED\",\n                                                                                    },\n                                                                                  ],\n                                                                                  \"message\": \"\",\n                                                                                  \"name\": \"AdsCampaignGroupNameSectionContainer97\",\n                                                                                  \"status\": \"INLINED\",\n                                                                                },\n                                                                              ],\n                                                                              \"message\": \"\",\n                                                                              \"name\": \"_render98\",\n                                                                              \"status\": \"INLINED\",\n                                                                            },\n                                                                          ],\n                                                                          \"message\": \"\",\n                                                                          \"name\": \"AdsPluginWrapper99\",\n                                                                          \"status\": \"INLINED\",\n                                                                        },\n                                                                        Object {\n                                                                          \"children\": Array [\n                                                                            Object {\n                                                                              \"children\": Array [\n                                                                                Object {\n                                                                                  \"children\": Array [\n                                                                                    Object {\n                                                                                      \"children\": Array [\n                                                                                        Object {\n                                                                                          \"children\": Array [\n                                                                                            Object {\n                                                                                              \"children\": Array [\n                                                                                                Object {\n                                                                                                  \"children\": Array [\n                                                                                                    Object {\n                                                                                                      \"children\": Array [\n                                                                                                        Object {\n                                                                                                          \"children\": Array [\n                                                                                                            Object {\n                                                                                                              \"children\": Array [\n                                                                                                                Object {\n                                                                                                                  \"children\": Array [],\n                                                                                                                  \"message\": \"\",\n                                                                                                                  \"name\": \"XUICardHeaderTitle100\",\n                                                                                                                  \"status\": \"INLINED\",\n                                                                                                                },\n                                                                                                              ],\n                                                                                                              \"message\": \"\",\n                                                                                                              \"name\": \"XUICardSection101\",\n                                                                                                              \"status\": \"INLINED\",\n                                                                                                            },\n                                                                                                          ],\n                                                                                                          \"message\": \"\",\n                                                                                                          \"name\": \"XUICardHeader102\",\n                                                                                                          \"status\": \"INLINED\",\n                                                                                                        },\n                                                                                                      ],\n                                                                                                      \"message\": \"\",\n                                                                                                      \"name\": \"AdsCardHeader103\",\n                                                                                                      \"status\": \"INLINED\",\n                                                                                                    },\n                                                                                                    Object {\n                                                                                                      \"children\": Array [\n                                                                                                        Object {\n                                                                                                          \"children\": Array [\n                                                                                                            Object {\n                                                                                                              \"children\": Array [\n                                                                                                                Object {\n                                                                                                                  \"children\": Array [\n                                                                                                                    Object {\n                                                                                                                      \"children\": Array [],\n                                                                                                                      \"message\": \"\",\n                                                                                                                      \"name\": \"AdsLabeledField104\",\n                                                                                                                      \"status\": \"INLINED\",\n                                                                                                                    },\n                                                                                                                  ],\n                                                                                                                  \"message\": \"\",\n                                                                                                                  \"name\": \"LeftRight21\",\n                                                                                                                  \"status\": \"INLINED\",\n                                                                                                                },\n                                                                                                              ],\n                                                                                                              \"message\": \"\",\n                                                                                                              \"name\": \"FlexibleBlock105\",\n                                                                                                              \"status\": \"INLINED\",\n                                                                                                            },\n                                                                                                            Object {\n                                                                                                              \"children\": Array [\n                                                                                                                Object {\n                                                                                                                  \"children\": Array [\n                                                                                                                    Object {\n                                                                                                                      \"children\": Array [],\n                                                                                                                      \"message\": \"\",\n                                                                                                                      \"name\": \"AdsLabeledField104\",\n                                                                                                                      \"status\": \"INLINED\",\n                                                                                                                    },\n                                                                                                                  ],\n                                                                                                                  \"message\": \"\",\n                                                                                                                  \"name\": \"LeftRight21\",\n                                                                                                                  \"status\": \"INLINED\",\n                                                                                                                },\n                                                                                                              ],\n                                                                                                              \"message\": \"\",\n                                                                                                              \"name\": \"FlexibleBlock105\",\n                                                                                                              \"status\": \"INLINED\",\n                                                                                                            },\n                                                                                                            Object {\n                                                                                                              \"children\": Array [\n                                                                                                                Object {\n                                                                                                                  \"children\": Array [\n                                                                                                                    Object {\n                                                                                                                      \"children\": Array [\n                                                                                                                        Object {\n                                                                                                                          \"children\": Array [\n                                                                                                                            Object {\n                                                                                                                              \"children\": Array [\n                                                                                                                                Object {\n                                                                                                                                  \"children\": Array [],\n                                                                                                                                  \"message\": \"\",\n                                                                                                                                  \"name\": \"ReactImage0\",\n                                                                                                                                  \"status\": \"INLINED\",\n                                                                                                                                },\n                                                                                                                              ],\n                                                                                                                              \"message\": \"\",\n                                                                                                                              \"name\": \"AdsPopoverLink62\",\n                                                                                                                              \"status\": \"INLINED\",\n                                                                                                                            },\n                                                                                                                          ],\n                                                                                                                          \"message\": \"\",\n                                                                                                                          \"name\": \"AdsHelpLink63\",\n                                                                                                                          \"status\": \"INLINED\",\n                                                                                                                        },\n                                                                                                                      ],\n                                                                                                                      \"message\": \"\",\n                                                                                                                      \"name\": \"AdsLabeledField104\",\n                                                                                                                      \"status\": \"INLINED\",\n                                                                                                                    },\n                                                                                                                    Object {\n                                                                                                                      \"children\": Array [\n                                                                                                                        Object {\n                                                                                                                          \"children\": Array [\n                                                                                                                            Object {\n                                                                                                                              \"children\": Array [\n                                                                                                                                Object {\n                                                                                                                                  \"children\": Array [],\n                                                                                                                                  \"message\": \"\",\n                                                                                                                                  \"name\": \"AbstractLink1\",\n                                                                                                                                  \"status\": \"INLINED\",\n                                                                                                                                },\n                                                                                                                              ],\n                                                                                                                              \"message\": \"\",\n                                                                                                                              \"name\": \"Link2\",\n                                                                                                                              \"status\": \"INLINED\",\n                                                                                                                            },\n                                                                                                                          ],\n                                                                                                                          \"message\": \"\",\n                                                                                                                          \"name\": \"AdsBulkCampaignSpendCapField106\",\n                                                                                                                          \"status\": \"INLINED\",\n                                                                                                                        },\n                                                                                                                      ],\n                                                                                                                      \"message\": \"\",\n                                                                                                                      \"name\": \"FluxContainer_AdsCampaignGroupSpendCapContainer_107\",\n                                                                                                                      \"status\": \"INLINED\",\n                                                                                                                    },\n                                                                                                                  ],\n                                                                                                                  \"message\": \"\",\n                                                                                                                  \"name\": \"LeftRight21\",\n                                                                                                                  \"status\": \"INLINED\",\n                                                                                                                },\n                                                                                                              ],\n                                                                                                              \"message\": \"\",\n                                                                                                              \"name\": \"FlexibleBlock105\",\n                                                                                                              \"status\": \"INLINED\",\n                                                                                                            },\n                                                                                                          ],\n                                                                                                          \"message\": \"\",\n                                                                                                          \"name\": \"XUICardSection101\",\n                                                                                                          \"status\": \"INLINED\",\n                                                                                                        },\n                                                                                                      ],\n                                                                                                      \"message\": \"\",\n                                                                                                      \"name\": \"AdsCardSection108\",\n                                                                                                      \"status\": \"INLINED\",\n                                                                                                    },\n                                                                                                  ],\n                                                                                                  \"message\": \"\",\n                                                                                                  \"name\": \"XUICard94\",\n                                                                                                  \"status\": \"INLINED\",\n                                                                                                },\n                                                                                              ],\n                                                                                              \"message\": \"\",\n                                                                                              \"name\": \"ReactXUIError76\",\n                                                                                              \"status\": \"INLINED\",\n                                                                                            },\n                                                                                          ],\n                                                                                          \"message\": \"\",\n                                                                                          \"name\": \"AdsCard95\",\n                                                                                          \"status\": \"INLINED\",\n                                                                                        },\n                                                                                      ],\n                                                                                      \"message\": \"\",\n                                                                                      \"name\": \"AdsEditorCampaignGroupDetailsSection109\",\n                                                                                      \"status\": \"INLINED\",\n                                                                                    },\n                                                                                  ],\n                                                                                  \"message\": \"\",\n                                                                                  \"name\": \"AdsEditorCampaignGroupDetailsSectionContainer110\",\n                                                                                  \"status\": \"INLINED\",\n                                                                                },\n                                                                              ],\n                                                                              \"message\": \"\",\n                                                                              \"name\": \"_render111\",\n                                                                              \"status\": \"INLINED\",\n                                                                            },\n                                                                          ],\n                                                                          \"message\": \"\",\n                                                                          \"name\": \"AdsPluginWrapper99\",\n                                                                          \"status\": \"INLINED\",\n                                                                        },\n                                                                        Object {\n                                                                          \"children\": Array [\n                                                                            Object {\n                                                                              \"children\": Array [\n                                                                                Object {\n                                                                                  \"children\": Array [],\n                                                                                  \"message\": \"\",\n                                                                                  \"name\": \"FluxContainer_AdsEditorToplineDetailsSectionContainer_112\",\n                                                                                  \"status\": \"INLINED\",\n                                                                                },\n                                                                              ],\n                                                                              \"message\": \"\",\n                                                                              \"name\": \"_render113\",\n                                                                              \"status\": \"INLINED\",\n                                                                            },\n                                                                          ],\n                                                                          \"message\": \"\",\n                                                                          \"name\": \"AdsPluginWrapper99\",\n                                                                          \"status\": \"INLINED\",\n                                                                        },\n                                                                        Object {\n                                                                          \"children\": Array [],\n                                                                          \"message\": \"\",\n                                                                          \"name\": \"AdsStickyArea114\",\n                                                                          \"status\": \"INLINED\",\n                                                                        },\n                                                                      ],\n                                                                      \"message\": \"\",\n                                                                      \"name\": \"FluxContainer_AdsEditorColumnContainer_115\",\n                                                                      \"status\": \"INLINED\",\n                                                                    },\n                                                                    Object {\n                                                                      \"children\": Array [\n                                                                        Object {\n                                                                          \"children\": Array [\n                                                                            Object {\n                                                                              \"children\": Array [\n                                                                                Object {\n                                                                                  \"children\": Array [\n                                                                                    Object {\n                                                                                      \"children\": Array [\n                                                                                        Object {\n                                                                                          \"children\": Array [\n                                                                                            Object {\n                                                                                              \"children\": Array [\n                                                                                                Object {\n                                                                                                  \"children\": Array [\n                                                                                                    Object {\n                                                                                                      \"children\": Array [\n                                                                                                        Object {\n                                                                                                          \"children\": Array [\n                                                                                                            Object {\n                                                                                                              \"children\": Array [\n                                                                                                                Object {\n                                                                                                                  \"children\": Array [\n                                                                                                                    Object {\n                                                                                                                      \"children\": Array [\n                                                                                                                        Object {\n                                                                                                                          \"children\": Array [\n                                                                                                                            Object {\n                                                                                                                              \"children\": Array [\n                                                                                                                                Object {\n                                                                                                                                  \"children\": Array [\n                                                                                                                                    Object {\n                                                                                                                                      \"children\": Array [],\n                                                                                                                                      \"message\": \"\",\n                                                                                                                                      \"name\": \"BUISwitch116\",\n                                                                                                                                      \"status\": \"INLINED\",\n                                                                                                                                    },\n                                                                                                                                  ],\n                                                                                                                                  \"message\": \"\",\n                                                                                                                                  \"name\": \"AdsStatusSwitchInternal117\",\n                                                                                                                                  \"status\": \"INLINED\",\n                                                                                                                                },\n                                                                                                                              ],\n                                                                                                                              \"message\": \"\",\n                                                                                                                              \"name\": \"AdsStatusSwitch118\",\n                                                                                                                              \"status\": \"INLINED\",\n                                                                                                                            },\n                                                                                                                          ],\n                                                                                                                          \"message\": \"\",\n                                                                                                                          \"name\": \"FluxContainer_AdsCampaignGroupStatusSwitchContainer_119\",\n                                                                                                                          \"status\": \"INLINED\",\n                                                                                                                        },\n                                                                                                                      ],\n                                                                                                                      \"message\": \"\",\n                                                                                                                      \"name\": \"XUICardHeaderTitle100\",\n                                                                                                                      \"status\": \"INLINED\",\n                                                                                                                    },\n                                                                                                                    Object {\n                                                                                                                      \"children\": Array [\n                                                                                                                        Object {\n                                                                                                                          \"children\": Array [\n                                                                                                                            Object {\n                                                                                                                              \"children\": Array [\n                                                                                                                                Object {\n                                                                                                                                  \"children\": Array [\n                                                                                                                                    Object {\n                                                                                                                                      \"children\": Array [\n                                                                                                                                        Object {\n                                                                                                                                          \"children\": Array [\n                                                                                                                                            Object {\n                                                                                                                                              \"children\": Array [\n                                                                                                                                                Object {\n                                                                                                                                                  \"children\": Array [\n                                                                                                                                                    Object {\n                                                                                                                                                      \"children\": Array [\n                                                                                                                                                        Object {\n                                                                                                                                                          \"children\": Array [\n                                                                                                                                                            Object {\n                                                                                                                                                              \"children\": Array [],\n                                                                                                                                                              \"message\": \"\",\n                                                                                                                                                              \"name\": \"ReactImage0\",\n                                                                                                                                                              \"status\": \"INLINED\",\n                                                                                                                                                            },\n                                                                                                                                                          ],\n                                                                                                                                                          \"message\": \"\",\n                                                                                                                                                          \"name\": \"AbstractLink1\",\n                                                                                                                                                          \"status\": \"INLINED\",\n                                                                                                                                                        },\n                                                                                                                                                      ],\n                                                                                                                                                      \"message\": \"\",\n                                                                                                                                                      \"name\": \"Link2\",\n                                                                                                                                                      \"status\": \"INLINED\",\n                                                                                                                                                    },\n                                                                                                                                                  ],\n                                                                                                                                                  \"message\": \"\",\n                                                                                                                                                  \"name\": \"AbstractButton3\",\n                                                                                                                                                  \"status\": \"INLINED\",\n                                                                                                                                                },\n                                                                                                                                              ],\n                                                                                                                                              \"message\": \"\",\n                                                                                                                                              \"name\": \"XUIButton4\",\n                                                                                                                                              \"status\": \"INLINED\",\n                                                                                                                                            },\n                                                                                                                                          ],\n                                                                                                                                          \"message\": \"\",\n                                                                                                                                          \"name\": \"AbstractPopoverButton5\",\n                                                                                                                                          \"status\": \"INLINED\",\n                                                                                                                                        },\n                                                                                                                                      ],\n                                                                                                                                      \"message\": \"\",\n                                                                                                                                      \"name\": \"ReactXUIPopoverButton6\",\n                                                                                                                                      \"status\": \"INLINED\",\n                                                                                                                                    },\n                                                                                                                                  ],\n                                                                                                                                  \"message\": \"\",\n                                                                                                                                  \"name\": \"InlineBlock19\",\n                                                                                                                                  \"status\": \"INLINED\",\n                                                                                                                                },\n                                                                                                                              ],\n                                                                                                                              \"message\": \"\",\n                                                                                                                              \"name\": \"ReactPopoverMenu20\",\n                                                                                                                              \"status\": \"INLINED\",\n                                                                                                                            },\n                                                                                                                          ],\n                                                                                                                          \"message\": \"\",\n                                                                                                                          \"name\": \"AdsLinksMenu120\",\n                                                                                                                          \"status\": \"INLINED\",\n                                                                                                                        },\n                                                                                                                      ],\n                                                                                                                      \"message\": \"\",\n                                                                                                                      \"name\": \"FluxContainer_AdsPluginizedLinksMenuContainer_121\",\n                                                                                                                      \"status\": \"INLINED\",\n                                                                                                                    },\n                                                                                                                  ],\n                                                                                                                  \"message\": \"\",\n                                                                                                                  \"name\": \"LeftRight21\",\n                                                                                                                  \"status\": \"INLINED\",\n                                                                                                                },\n                                                                                                              ],\n                                                                                                              \"message\": \"\",\n                                                                                                              \"name\": \"AdsCardLeftRightHeader122\",\n                                                                                                              \"status\": \"INLINED\",\n                                                                                                            },\n                                                                                                          ],\n                                                                                                          \"message\": \"\",\n                                                                                                          \"name\": \"XUICard94\",\n                                                                                                          \"status\": \"INLINED\",\n                                                                                                        },\n                                                                                                      ],\n                                                                                                      \"message\": \"\",\n                                                                                                      \"name\": \"ReactXUIError76\",\n                                                                                                      \"status\": \"INLINED\",\n                                                                                                    },\n                                                                                                  ],\n                                                                                                  \"message\": \"\",\n                                                                                                  \"name\": \"AdsCard95\",\n                                                                                                  \"status\": \"INLINED\",\n                                                                                                },\n                                                                                              ],\n                                                                                              \"message\": \"\",\n                                                                                              \"name\": \"AdsPEIDSection123\",\n                                                                                              \"status\": \"INLINED\",\n                                                                                            },\n                                                                                          ],\n                                                                                          \"message\": \"\",\n                                                                                          \"name\": \"FluxContainer_AdsPECampaignGroupIDSectionContainer_124\",\n                                                                                          \"status\": \"INLINED\",\n                                                                                        },\n                                                                                      ],\n                                                                                      \"message\": \"\",\n                                                                                      \"name\": \"DeferredComponent125\",\n                                                                                      \"status\": \"INLINED\",\n                                                                                    },\n                                                                                  ],\n                                                                                  \"message\": \"\",\n                                                                                  \"name\": \"BootloadedComponent126\",\n                                                                                  \"status\": \"INLINED\",\n                                                                                },\n                                                                              ],\n                                                                              \"message\": \"\",\n                                                                              \"name\": \"_render127\",\n                                                                              \"status\": \"INLINED\",\n                                                                            },\n                                                                          ],\n                                                                          \"message\": \"\",\n                                                                          \"name\": \"AdsPluginWrapper99\",\n                                                                          \"status\": \"INLINED\",\n                                                                        },\n                                                                        Object {\n                                                                          \"children\": Array [\n                                                                            Object {\n                                                                              \"children\": Array [\n                                                                                Object {\n                                                                                  \"children\": Array [\n                                                                                    Object {\n                                                                                      \"children\": Array [\n                                                                                        Object {\n                                                                                          \"children\": Array [],\n                                                                                          \"message\": \"\",\n                                                                                          \"name\": \"AdsEditorErrorsCard128\",\n                                                                                          \"status\": \"INLINED\",\n                                                                                        },\n                                                                                      ],\n                                                                                      \"message\": \"\",\n                                                                                      \"name\": \"FluxContainer_FunctionalContainer_129\",\n                                                                                      \"status\": \"INLINED\",\n                                                                                    },\n                                                                                  ],\n                                                                                  \"message\": \"\",\n                                                                                  \"name\": \"_render130\",\n                                                                                  \"status\": \"INLINED\",\n                                                                                },\n                                                                              ],\n                                                                              \"message\": \"\",\n                                                                              \"name\": \"AdsPluginWrapper99\",\n                                                                              \"status\": \"INLINED\",\n                                                                            },\n                                                                          ],\n                                                                          \"message\": \"\",\n                                                                          \"name\": \"AdsStickyArea114\",\n                                                                          \"status\": \"INLINED\",\n                                                                        },\n                                                                      ],\n                                                                      \"message\": \"\",\n                                                                      \"name\": \"FluxContainer_AdsEditorColumnContainer_115\",\n                                                                      \"status\": \"INLINED\",\n                                                                    },\n                                                                  ],\n                                                                  \"message\": \"\",\n                                                                  \"name\": \"AdsEditorMultiColumnLayout131\",\n                                                                  \"status\": \"INLINED\",\n                                                                },\n                                                              ],\n                                                              \"message\": \"\",\n                                                              \"name\": \"AdsPECampaignGroupEditor132\",\n                                                              \"status\": \"INLINED\",\n                                                            },\n                                                          ],\n                                                          \"message\": \"\",\n                                                          \"name\": \"AdsPECampaignGroupEditorContainer133\",\n                                                          \"status\": \"INLINED\",\n                                                        },\n                                                      ],\n                                                      \"message\": \"\",\n                                                      \"name\": \"AdsPESideTrayTabContent134\",\n                                                      \"status\": \"INLINED\",\n                                                    },\n                                                  ],\n                                                  \"message\": \"\",\n                                                  \"name\": \"AdsPEEditorTrayTabContentContainer135\",\n                                                  \"status\": \"INLINED\",\n                                                },\n                                              ],\n                                              \"message\": \"\",\n                                              \"name\": \"AdsPEMultiTabDrawer136\",\n                                              \"status\": \"INLINED\",\n                                            },\n                                          ],\n                                          \"message\": \"\",\n                                          \"name\": \"FluxContainer_AdsPEMultiTabDrawerContainer_137\",\n                                          \"status\": \"INLINED\",\n                                        },\n                                      ],\n                                      \"message\": \"\",\n                                      \"name\": \"ErrorBoundary9\",\n                                      \"status\": \"INLINED\",\n                                    },\n                                  ],\n                                  \"message\": \"\",\n                                  \"name\": \"AdsErrorBoundary10\",\n                                  \"status\": \"INLINED\",\n                                },\n                                Object {\n                                  \"children\": Array [\n                                    Object {\n                                      \"children\": Array [\n                                        Object {\n                                          \"children\": Array [\n                                            Object {\n                                              \"children\": Array [\n                                                Object {\n                                                  \"children\": Array [\n                                                    Object {\n                                                      \"children\": Array [],\n                                                      \"message\": \"\",\n                                                      \"name\": \"AbstractButton3\",\n                                                      \"status\": \"INLINED\",\n                                                    },\n                                                  ],\n                                                  \"message\": \"\",\n                                                  \"name\": \"XUIButton4\",\n                                                  \"status\": \"INLINED\",\n                                                },\n                                                Object {\n                                                  \"children\": Array [\n                                                    Object {\n                                                      \"children\": Array [],\n                                                      \"message\": \"\",\n                                                      \"name\": \"AbstractButton3\",\n                                                      \"status\": \"INLINED\",\n                                                    },\n                                                  ],\n                                                  \"message\": \"\",\n                                                  \"name\": \"XUIButton4\",\n                                                  \"status\": \"INLINED\",\n                                                },\n                                                Object {\n                                                  \"children\": Array [\n                                                    Object {\n                                                      \"children\": Array [],\n                                                      \"message\": \"\",\n                                                      \"name\": \"AbstractButton3\",\n                                                      \"status\": \"INLINED\",\n                                                    },\n                                                  ],\n                                                  \"message\": \"\",\n                                                  \"name\": \"XUIButton4\",\n                                                  \"status\": \"INLINED\",\n                                                },\n                                              ],\n                                              \"message\": \"\",\n                                              \"name\": \"AdsPESimpleOrganizer138\",\n                                              \"status\": \"INLINED\",\n                                            },\n                                          ],\n                                          \"message\": \"\",\n                                          \"name\": \"AdsPEOrganizerContainer139\",\n                                          \"status\": \"INLINED\",\n                                        },\n                                      ],\n                                      \"message\": \"\",\n                                      \"name\": \"ErrorBoundary9\",\n                                      \"status\": \"INLINED\",\n                                    },\n                                  ],\n                                  \"message\": \"\",\n                                  \"name\": \"AdsErrorBoundary10\",\n                                  \"status\": \"INLINED\",\n                                },\n                                Object {\n                                  \"children\": Array [\n                                    Object {\n                                      \"children\": Array [\n                                        Object {\n                                          \"children\": Array [\n                                            Object {\n                                              \"children\": Array [\n                                                Object {\n                                                  \"children\": Array [\n                                                    Object {\n                                                      \"children\": Array [\n                                                        Object {\n                                                          \"children\": Array [\n                                                            Object {\n                                                              \"children\": Array [\n                                                                Object {\n                                                                  \"children\": Array [\n                                                                    Object {\n                                                                      \"children\": Array [\n                                                                        Object {\n                                                                          \"children\": Array [],\n                                                                          \"message\": \"\",\n                                                                          \"name\": \"FixedDataTableColumnResizeHandle140\",\n                                                                          \"status\": \"INLINED\",\n                                                                        },\n                                                                        Object {\n                                                                          \"children\": Array [\n                                                                            Object {\n                                                                              \"children\": Array [\n                                                                                Object {\n                                                                                  \"children\": Array [\n                                                                                    Object {\n                                                                                      \"children\": Array [\n                                                                                        Object {\n                                                                                          \"children\": Array [\n                                                                                            Object {\n                                                                                              \"children\": Array [\n                                                                                                Object {\n                                                                                                  \"children\": Array [\n                                                                                                    Object {\n                                                                                                      \"children\": Array [],\n                                                                                                      \"message\": \"\",\n                                                                                                      \"name\": \"ReactImage0\",\n                                                                                                      \"status\": \"INLINED\",\n                                                                                                    },\n                                                                                                  ],\n                                                                                                  \"message\": \"\",\n                                                                                                  \"name\": \"AdsPETableHeader141\",\n                                                                                                  \"status\": \"INLINED\",\n                                                                                                },\n                                                                                              ],\n                                                                                              \"message\": \"\",\n                                                                                              \"name\": \"TransitionCell142\",\n                                                                                              \"status\": \"INLINED\",\n                                                                                            },\n                                                                                          ],\n                                                                                          \"message\": \"\",\n                                                                                          \"name\": \"FixedDataTableCell143\",\n                                                                                          \"status\": \"INLINED\",\n                                                                                        },\n                                                                                      ],\n                                                                                      \"message\": \"\",\n                                                                                      \"name\": \"FixedDataTableCellGroupImpl144\",\n                                                                                      \"status\": \"INLINED\",\n                                                                                    },\n                                                                                  ],\n                                                                                  \"message\": \"\",\n                                                                                  \"name\": \"FixedDataTableCellGroup145\",\n                                                                                  \"status\": \"INLINED\",\n                                                                                },\n                                                                                Object {\n                                                                                  \"children\": Array [\n                                                                                    Object {\n                                                                                      \"children\": Array [\n                                                                                        Object {\n                                                                                          \"children\": Array [\n                                                                                            Object {\n                                                                                              \"children\": Array [\n                                                                                                Object {\n                                                                                                  \"children\": Array [],\n                                                                                                  \"message\": \"\",\n                                                                                                  \"name\": \"AdsPETableHeader141\",\n                                                                                                  \"status\": \"INLINED\",\n                                                                                                },\n                                                                                              ],\n                                                                                              \"message\": \"\",\n                                                                                              \"name\": \"TransitionCell142\",\n                                                                                              \"status\": \"INLINED\",\n                                                                                            },\n                                                                                          ],\n                                                                                          \"message\": \"\",\n                                                                                          \"name\": \"FixedDataTableCell143\",\n                                                                                          \"status\": \"INLINED\",\n                                                                                        },\n                                                                                        Object {\n                                                                                          \"children\": Array [\n                                                                                            Object {\n                                                                                              \"children\": Array [\n                                                                                                Object {\n                                                                                                  \"children\": Array [],\n                                                                                                  \"message\": \"\",\n                                                                                                  \"name\": \"AdsPETableHeader141\",\n                                                                                                  \"status\": \"INLINED\",\n                                                                                                },\n                                                                                              ],\n                                                                                              \"message\": \"\",\n                                                                                              \"name\": \"TransitionCell142\",\n                                                                                              \"status\": \"INLINED\",\n                                                                                            },\n                                                                                          ],\n                                                                                          \"message\": \"\",\n                                                                                          \"name\": \"FixedDataTableCell143\",\n                                                                                          \"status\": \"INLINED\",\n                                                                                        },\n                                                                                        Object {\n                                                                                          \"children\": Array [\n                                                                                            Object {\n                                                                                              \"children\": Array [\n                                                                                                Object {\n                                                                                                  \"children\": Array [],\n                                                                                                  \"message\": \"\",\n                                                                                                  \"name\": \"AdsPETableHeader141\",\n                                                                                                  \"status\": \"INLINED\",\n                                                                                                },\n                                                                                              ],\n                                                                                              \"message\": \"\",\n                                                                                              \"name\": \"TransitionCell142\",\n                                                                                              \"status\": \"INLINED\",\n                                                                                            },\n                                                                                          ],\n                                                                                          \"message\": \"\",\n                                                                                          \"name\": \"FixedDataTableCell143\",\n                                                                                          \"status\": \"INLINED\",\n                                                                                        },\n                                                                                        Object {\n                                                                                          \"children\": Array [\n                                                                                            Object {\n                                                                                              \"children\": Array [\n                                                                                                Object {\n                                                                                                  \"children\": Array [],\n                                                                                                  \"message\": \"\",\n                                                                                                  \"name\": \"AdsPETableHeader141\",\n                                                                                                  \"status\": \"INLINED\",\n                                                                                                },\n                                                                                              ],\n                                                                                              \"message\": \"\",\n                                                                                              \"name\": \"TransitionCell142\",\n                                                                                              \"status\": \"INLINED\",\n                                                                                            },\n                                                                                          ],\n                                                                                          \"message\": \"\",\n                                                                                          \"name\": \"FixedDataTableCell143\",\n                                                                                          \"status\": \"INLINED\",\n                                                                                        },\n                                                                                      ],\n                                                                                      \"message\": \"\",\n                                                                                      \"name\": \"FixedDataTableCellGroupImpl144\",\n                                                                                      \"status\": \"INLINED\",\n                                                                                    },\n                                                                                  ],\n                                                                                  \"message\": \"\",\n                                                                                  \"name\": \"FixedDataTableCellGroup145\",\n                                                                                  \"status\": \"INLINED\",\n                                                                                },\n                                                                              ],\n                                                                              \"message\": \"\",\n                                                                              \"name\": \"FixedDataTableRowImpl146\",\n                                                                              \"status\": \"INLINED\",\n                                                                            },\n                                                                          ],\n                                                                          \"message\": \"\",\n                                                                          \"name\": \"FixedDataTableRow147\",\n                                                                          \"status\": \"INLINED\",\n                                                                        },\n                                                                        Object {\n                                                                          \"children\": Array [\n                                                                            Object {\n                                                                              \"children\": Array [\n                                                                                Object {\n                                                                                  \"children\": Array [\n                                                                                    Object {\n                                                                                      \"children\": Array [\n                                                                                        Object {\n                                                                                          \"children\": Array [\n                                                                                            Object {\n                                                                                              \"children\": Array [\n                                                                                                Object {\n                                                                                                  \"children\": Array [\n                                                                                                    Object {\n                                                                                                      \"children\": Array [],\n                                                                                                      \"message\": \"\",\n                                                                                                      \"name\": \"AbstractCheckboxInput59\",\n                                                                                                      \"status\": \"INLINED\",\n                                                                                                    },\n                                                                                                  ],\n                                                                                                  \"message\": \"\",\n                                                                                                  \"name\": \"XUICheckboxInput60\",\n                                                                                                  \"status\": \"INLINED\",\n                                                                                                },\n                                                                                              ],\n                                                                                              \"message\": \"\",\n                                                                                              \"name\": \"TransitionCell142\",\n                                                                                              \"status\": \"INLINED\",\n                                                                                            },\n                                                                                          ],\n                                                                                          \"message\": \"\",\n                                                                                          \"name\": \"FixedDataTableCell143\",\n                                                                                          \"status\": \"INLINED\",\n                                                                                        },\n                                                                                        Object {\n                                                                                          \"children\": Array [\n                                                                                            Object {\n                                                                                              \"children\": Array [\n                                                                                                Object {\n                                                                                                  \"children\": Array [\n                                                                                                    Object {\n                                                                                                      \"children\": Array [\n                                                                                                        Object {\n                                                                                                          \"children\": Array [],\n                                                                                                          \"message\": \"\",\n                                                                                                          \"name\": \"AdsPETableHeader141\",\n                                                                                                          \"status\": \"INLINED\",\n                                                                                                        },\n                                                                                                      ],\n                                                                                                      \"message\": \"\",\n                                                                                                      \"name\": \"FixedDataTableAbstractSortableHeader148\",\n                                                                                                      \"status\": \"INLINED\",\n                                                                                                    },\n                                                                                                  ],\n                                                                                                  \"message\": \"\",\n                                                                                                  \"name\": \"FixedDataTableSortableHeader149\",\n                                                                                                  \"status\": \"INLINED\",\n                                                                                                },\n                                                                                              ],\n                                                                                              \"message\": \"\",\n                                                                                              \"name\": \"TransitionCell142\",\n                                                                                              \"status\": \"INLINED\",\n                                                                                            },\n                                                                                          ],\n                                                                                          \"message\": \"\",\n                                                                                          \"name\": \"FixedDataTableCell143\",\n                                                                                          \"status\": \"INLINED\",\n                                                                                        },\n                                                                                        Object {\n                                                                                          \"children\": Array [\n                                                                                            Object {\n                                                                                              \"children\": Array [\n                                                                                                Object {\n                                                                                                  \"children\": Array [\n                                                                                                    Object {\n                                                                                                      \"children\": Array [\n                                                                                                        Object {\n                                                                                                          \"children\": Array [\n                                                                                                            Object {\n                                                                                                              \"children\": Array [],\n                                                                                                              \"message\": \"\",\n                                                                                                              \"name\": \"ReactImage0\",\n                                                                                                              \"status\": \"INLINED\",\n                                                                                                            },\n                                                                                                          ],\n                                                                                                          \"message\": \"\",\n                                                                                                          \"name\": \"AdsPETableHeader141\",\n                                                                                                          \"status\": \"INLINED\",\n                                                                                                        },\n                                                                                                      ],\n                                                                                                      \"message\": \"\",\n                                                                                                      \"name\": \"FixedDataTableAbstractSortableHeader148\",\n                                                                                                      \"status\": \"INLINED\",\n                                                                                                    },\n                                                                                                  ],\n                                                                                                  \"message\": \"\",\n                                                                                                  \"name\": \"FixedDataTableSortableHeader149\",\n                                                                                                  \"status\": \"INLINED\",\n                                                                                                },\n                                                                                              ],\n                                                                                              \"message\": \"\",\n                                                                                              \"name\": \"TransitionCell142\",\n                                                                                              \"status\": \"INLINED\",\n                                                                                            },\n                                                                                          ],\n                                                                                          \"message\": \"\",\n                                                                                          \"name\": \"FixedDataTableCell143\",\n                                                                                          \"status\": \"INLINED\",\n                                                                                        },\n                                                                                        Object {\n                                                                                          \"children\": Array [\n                                                                                            Object {\n                                                                                              \"children\": Array [\n                                                                                                Object {\n                                                                                                  \"children\": Array [\n                                                                                                    Object {\n                                                                                                      \"children\": Array [\n                                                                                                        Object {\n                                                                                                          \"children\": Array [\n                                                                                                            Object {\n                                                                                                              \"children\": Array [],\n                                                                                                              \"message\": \"\",\n                                                                                                              \"name\": \"ReactImage0\",\n                                                                                                              \"status\": \"INLINED\",\n                                                                                                            },\n                                                                                                          ],\n                                                                                                          \"message\": \"\",\n                                                                                                          \"name\": \"AdsPETableHeader141\",\n                                                                                                          \"status\": \"INLINED\",\n                                                                                                        },\n                                                                                                      ],\n                                                                                                      \"message\": \"\",\n                                                                                                      \"name\": \"FixedDataTableAbstractSortableHeader148\",\n                                                                                                      \"status\": \"INLINED\",\n                                                                                                    },\n                                                                                                  ],\n                                                                                                  \"message\": \"\",\n                                                                                                  \"name\": \"FixedDataTableSortableHeader149\",\n                                                                                                  \"status\": \"INLINED\",\n                                                                                                },\n                                                                                              ],\n                                                                                              \"message\": \"\",\n                                                                                              \"name\": \"TransitionCell142\",\n                                                                                              \"status\": \"INLINED\",\n                                                                                            },\n                                                                                          ],\n                                                                                          \"message\": \"\",\n                                                                                          \"name\": \"FixedDataTableCell143\",\n                                                                                          \"status\": \"INLINED\",\n                                                                                        },\n                                                                                        Object {\n                                                                                          \"children\": Array [\n                                                                                            Object {\n                                                                                              \"children\": Array [\n                                                                                                Object {\n                                                                                                  \"children\": Array [\n                                                                                                    Object {\n                                                                                                      \"children\": Array [\n                                                                                                        Object {\n                                                                                                          \"children\": Array [],\n                                                                                                          \"message\": \"\",\n                                                                                                          \"name\": \"AdsPETableHeader141\",\n                                                                                                          \"status\": \"INLINED\",\n                                                                                                        },\n                                                                                                      ],\n                                                                                                      \"message\": \"\",\n                                                                                                      \"name\": \"FixedDataTableAbstractSortableHeader148\",\n                                                                                                      \"status\": \"INLINED\",\n                                                                                                    },\n                                                                                                  ],\n                                                                                                  \"message\": \"\",\n                                                                                                  \"name\": \"FixedDataTableSortableHeader149\",\n                                                                                                  \"status\": \"INLINED\",\n                                                                                                },\n                                                                                              ],\n                                                                                              \"message\": \"\",\n                                                                                              \"name\": \"TransitionCell142\",\n                                                                                              \"status\": \"INLINED\",\n                                                                                            },\n                                                                                          ],\n                                                                                          \"message\": \"\",\n                                                                                          \"name\": \"FixedDataTableCell143\",\n                                                                                          \"status\": \"INLINED\",\n                                                                                        },\n                                                                                        Object {\n                                                                                          \"children\": Array [\n                                                                                            Object {\n                                                                                              \"children\": Array [\n                                                                                                Object {\n                                                                                                  \"children\": Array [\n                                                                                                    Object {\n                                                                                                      \"children\": Array [\n                                                                                                        Object {\n                                                                                                          \"children\": Array [],\n                                                                                                          \"message\": \"\",\n                                                                                                          \"name\": \"AdsPETableHeader141\",\n                                                                                                          \"status\": \"INLINED\",\n                                                                                                        },\n                                                                                                      ],\n                                                                                                      \"message\": \"\",\n                                                                                                      \"name\": \"FixedDataTableAbstractSortableHeader148\",\n                                                                                                      \"status\": \"INLINED\",\n                                                                                                    },\n                                                                                                  ],\n                                                                                                  \"message\": \"\",\n                                                                                                  \"name\": \"FixedDataTableSortableHeader149\",\n                                                                                                  \"status\": \"INLINED\",\n                                                                                                },\n                                                                                              ],\n                                                                                              \"message\": \"\",\n                                                                                              \"name\": \"TransitionCell142\",\n                                                                                              \"status\": \"INLINED\",\n                                                                                            },\n                                                                                          ],\n                                                                                          \"message\": \"\",\n                                                                                          \"name\": \"FixedDataTableCell143\",\n                                                                                          \"status\": \"INLINED\",\n                                                                                        },\n                                                                                      ],\n                                                                                      \"message\": \"\",\n                                                                                      \"name\": \"FixedDataTableCellGroupImpl144\",\n                                                                                      \"status\": \"INLINED\",\n                                                                                    },\n                                                                                  ],\n                                                                                  \"message\": \"\",\n                                                                                  \"name\": \"FixedDataTableCellGroup145\",\n                                                                                  \"status\": \"INLINED\",\n                                                                                },\n                                                                                Object {\n                                                                                  \"children\": Array [\n                                                                                    Object {\n                                                                                      \"children\": Array [\n                                                                                        Object {\n                                                                                          \"children\": Array [\n                                                                                            Object {\n                                                                                              \"children\": Array [\n                                                                                                Object {\n                                                                                                  \"children\": Array [\n                                                                                                    Object {\n                                                                                                      \"children\": Array [\n                                                                                                        Object {\n                                                                                                          \"children\": Array [],\n                                                                                                          \"message\": \"\",\n                                                                                                          \"name\": \"AdsPETableHeader141\",\n                                                                                                          \"status\": \"INLINED\",\n                                                                                                        },\n                                                                                                      ],\n                                                                                                      \"message\": \"\",\n                                                                                                      \"name\": \"FixedDataTableAbstractSortableHeader148\",\n                                                                                                      \"status\": \"INLINED\",\n                                                                                                    },\n                                                                                                  ],\n                                                                                                  \"message\": \"\",\n                                                                                                  \"name\": \"FixedDataTableSortableHeader149\",\n                                                                                                  \"status\": \"INLINED\",\n                                                                                                },\n                                                                                              ],\n                                                                                              \"message\": \"\",\n                                                                                              \"name\": \"TransitionCell142\",\n                                                                                              \"status\": \"INLINED\",\n                                                                                            },\n                                                                                          ],\n                                                                                          \"message\": \"\",\n                                                                                          \"name\": \"FixedDataTableCell143\",\n                                                                                          \"status\": \"INLINED\",\n                                                                                        },\n                                                                                        Object {\n                                                                                          \"children\": Array [\n                                                                                            Object {\n                                                                                              \"children\": Array [\n                                                                                                Object {\n                                                                                                  \"children\": Array [\n                                                                                                    Object {\n                                                                                                      \"children\": Array [\n                                                                                                        Object {\n                                                                                                          \"children\": Array [],\n                                                                                                          \"message\": \"\",\n                                                                                                          \"name\": \"AdsPETableHeader141\",\n                                                                                                          \"status\": \"INLINED\",\n                                                                                                        },\n                                                                                                      ],\n                                                                                                      \"message\": \"\",\n                                                                                                      \"name\": \"FixedDataTableAbstractSortableHeader148\",\n                                                                                                      \"status\": \"INLINED\",\n                                                                                                    },\n                                                                                                  ],\n                                                                                                  \"message\": \"\",\n                                                                                                  \"name\": \"FixedDataTableSortableHeader149\",\n                                                                                                  \"status\": \"INLINED\",\n                                                                                                },\n                                                                                              ],\n                                                                                              \"message\": \"\",\n                                                                                              \"name\": \"TransitionCell142\",\n                                                                                              \"status\": \"INLINED\",\n                                                                                            },\n                                                                                          ],\n                                                                                          \"message\": \"\",\n                                                                                          \"name\": \"FixedDataTableCell143\",\n                                                                                          \"status\": \"INLINED\",\n                                                                                        },\n                                                                                        Object {\n                                                                                          \"children\": Array [\n                                                                                            Object {\n                                                                                              \"children\": Array [\n                                                                                                Object {\n                                                                                                  \"children\": Array [\n                                                                                                    Object {\n                                                                                                      \"children\": Array [\n                                                                                                        Object {\n                                                                                                          \"children\": Array [],\n                                                                                                          \"message\": \"\",\n                                                                                                          \"name\": \"AdsPETableHeader141\",\n                                                                                                          \"status\": \"INLINED\",\n                                                                                                        },\n                                                                                                      ],\n                                                                                                      \"message\": \"\",\n                                                                                                      \"name\": \"FixedDataTableAbstractSortableHeader148\",\n                                                                                                      \"status\": \"INLINED\",\n                                                                                                    },\n                                                                                                  ],\n                                                                                                  \"message\": \"\",\n                                                                                                  \"name\": \"FixedDataTableSortableHeader149\",\n                                                                                                  \"status\": \"INLINED\",\n                                                                                                },\n                                                                                              ],\n                                                                                              \"message\": \"\",\n                                                                                              \"name\": \"TransitionCell142\",\n                                                                                              \"status\": \"INLINED\",\n                                                                                            },\n                                                                                          ],\n                                                                                          \"message\": \"\",\n                                                                                          \"name\": \"FixedDataTableCell143\",\n                                                                                          \"status\": \"INLINED\",\n                                                                                        },\n                                                                                        Object {\n                                                                                          \"children\": Array [\n                                                                                            Object {\n                                                                                              \"children\": Array [\n                                                                                                Object {\n                                                                                                  \"children\": Array [\n                                                                                                    Object {\n                                                                                                      \"children\": Array [\n                                                                                                        Object {\n                                                                                                          \"children\": Array [],\n                                                                                                          \"message\": \"\",\n                                                                                                          \"name\": \"AdsPETableHeader141\",\n                                                                                                          \"status\": \"INLINED\",\n                                                                                                        },\n                                                                                                      ],\n                                                                                                      \"message\": \"\",\n                                                                                                      \"name\": \"FixedDataTableAbstractSortableHeader148\",\n                                                                                                      \"status\": \"INLINED\",\n                                                                                                    },\n                                                                                                  ],\n                                                                                                  \"message\": \"\",\n                                                                                                  \"name\": \"FixedDataTableSortableHeader149\",\n                                                                                                  \"status\": \"INLINED\",\n                                                                                                },\n                                                                                              ],\n                                                                                              \"message\": \"\",\n                                                                                              \"name\": \"TransitionCell142\",\n                                                                                              \"status\": \"INLINED\",\n                                                                                            },\n                                                                                          ],\n                                                                                          \"message\": \"\",\n                                                                                          \"name\": \"FixedDataTableCell143\",\n                                                                                          \"status\": \"INLINED\",\n                                                                                        },\n                                                                                        Object {\n                                                                                          \"children\": Array [\n                                                                                            Object {\n                                                                                              \"children\": Array [\n                                                                                                Object {\n                                                                                                  \"children\": Array [\n                                                                                                    Object {\n                                                                                                      \"children\": Array [\n                                                                                                        Object {\n                                                                                                          \"children\": Array [],\n                                                                                                          \"message\": \"\",\n                                                                                                          \"name\": \"AdsPETableHeader141\",\n                                                                                                          \"status\": \"INLINED\",\n                                                                                                        },\n                                                                                                      ],\n                                                                                                      \"message\": \"\",\n                                                                                                      \"name\": \"FixedDataTableAbstractSortableHeader148\",\n                                                                                                      \"status\": \"INLINED\",\n                                                                                                    },\n                                                                                                  ],\n                                                                                                  \"message\": \"\",\n                                                                                                  \"name\": \"FixedDataTableSortableHeader149\",\n                                                                                                  \"status\": \"INLINED\",\n                                                                                                },\n                                                                                              ],\n                                                                                              \"message\": \"\",\n                                                                                              \"name\": \"TransitionCell142\",\n                                                                                              \"status\": \"INLINED\",\n                                                                                            },\n                                                                                          ],\n                                                                                          \"message\": \"\",\n                                                                                          \"name\": \"FixedDataTableCell143\",\n                                                                                          \"status\": \"INLINED\",\n                                                                                        },\n                                                                                        Object {\n                                                                                          \"children\": Array [\n                                                                                            Object {\n                                                                                              \"children\": Array [\n                                                                                                Object {\n                                                                                                  \"children\": Array [\n                                                                                                    Object {\n                                                                                                      \"children\": Array [\n                                                                                                        Object {\n                                                                                                          \"children\": Array [],\n                                                                                                          \"message\": \"\",\n                                                                                                          \"name\": \"AdsPETableHeader141\",\n                                                                                                          \"status\": \"INLINED\",\n                                                                                                        },\n                                                                                                      ],\n                                                                                                      \"message\": \"\",\n                                                                                                      \"name\": \"FixedDataTableAbstractSortableHeader148\",\n                                                                                                      \"status\": \"INLINED\",\n                                                                                                    },\n                                                                                                  ],\n                                                                                                  \"message\": \"\",\n                                                                                                  \"name\": \"FixedDataTableSortableHeader149\",\n                                                                                                  \"status\": \"INLINED\",\n                                                                                                },\n                                                                                              ],\n                                                                                              \"message\": \"\",\n                                                                                              \"name\": \"TransitionCell142\",\n                                                                                              \"status\": \"INLINED\",\n                                                                                            },\n                                                                                          ],\n                                                                                          \"message\": \"\",\n                                                                                          \"name\": \"FixedDataTableCell143\",\n                                                                                          \"status\": \"INLINED\",\n                                                                                        },\n                                                                                        Object {\n                                                                                          \"children\": Array [\n                                                                                            Object {\n                                                                                              \"children\": Array [\n                                                                                                Object {\n                                                                                                  \"children\": Array [\n                                                                                                    Object {\n                                                                                                      \"children\": Array [\n                                                                                                        Object {\n                                                                                                          \"children\": Array [],\n                                                                                                          \"message\": \"\",\n                                                                                                          \"name\": \"AdsPETableHeader141\",\n                                                                                                          \"status\": \"INLINED\",\n                                                                                                        },\n                                                                                                      ],\n                                                                                                      \"message\": \"\",\n                                                                                                      \"name\": \"FixedDataTableAbstractSortableHeader148\",\n                                                                                                      \"status\": \"INLINED\",\n                                                                                                    },\n                                                                                                  ],\n                                                                                                  \"message\": \"\",\n                                                                                                  \"name\": \"FixedDataTableSortableHeader149\",\n                                                                                                  \"status\": \"INLINED\",\n                                                                                                },\n                                                                                              ],\n                                                                                              \"message\": \"\",\n                                                                                              \"name\": \"TransitionCell142\",\n                                                                                              \"status\": \"INLINED\",\n                                                                                            },\n                                                                                          ],\n                                                                                          \"message\": \"\",\n                                                                                          \"name\": \"FixedDataTableCell143\",\n                                                                                          \"status\": \"INLINED\",\n                                                                                        },\n                                                                                        Object {\n                                                                                          \"children\": Array [\n                                                                                            Object {\n                                                                                              \"children\": Array [\n                                                                                                Object {\n                                                                                                  \"children\": Array [\n                                                                                                    Object {\n                                                                                                      \"children\": Array [\n                                                                                                        Object {\n                                                                                                          \"children\": Array [],\n                                                                                                          \"message\": \"\",\n                                                                                                          \"name\": \"AdsPETableHeader141\",\n                                                                                                          \"status\": \"INLINED\",\n                                                                                                        },\n                                                                                                      ],\n                                                                                                      \"message\": \"\",\n                                                                                                      \"name\": \"FixedDataTableAbstractSortableHeader148\",\n                                                                                                      \"status\": \"INLINED\",\n                                                                                                    },\n                                                                                                  ],\n                                                                                                  \"message\": \"\",\n                                                                                                  \"name\": \"FixedDataTableSortableHeader149\",\n                                                                                                  \"status\": \"INLINED\",\n                                                                                                },\n                                                                                              ],\n                                                                                              \"message\": \"\",\n                                                                                              \"name\": \"TransitionCell142\",\n                                                                                              \"status\": \"INLINED\",\n                                                                                            },\n                                                                                          ],\n                                                                                          \"message\": \"\",\n                                                                                          \"name\": \"FixedDataTableCell143\",\n                                                                                          \"status\": \"INLINED\",\n                                                                                        },\n                                                                                        Object {\n                                                                                          \"children\": Array [\n                                                                                            Object {\n                                                                                              \"children\": Array [\n                                                                                                Object {\n                                                                                                  \"children\": Array [\n                                                                                                    Object {\n                                                                                                      \"children\": Array [\n                                                                                                        Object {\n                                                                                                          \"children\": Array [],\n                                                                                                          \"message\": \"\",\n                                                                                                          \"name\": \"AdsPETableHeader141\",\n                                                                                                          \"status\": \"INLINED\",\n                                                                                                        },\n                                                                                                      ],\n                                                                                                      \"message\": \"\",\n                                                                                                      \"name\": \"FixedDataTableAbstractSortableHeader148\",\n                                                                                                      \"status\": \"INLINED\",\n                                                                                                    },\n                                                                                                  ],\n                                                                                                  \"message\": \"\",\n                                                                                                  \"name\": \"FixedDataTableSortableHeader149\",\n                                                                                                  \"status\": \"INLINED\",\n                                                                                                },\n                                                                                              ],\n                                                                                              \"message\": \"\",\n                                                                                              \"name\": \"TransitionCell142\",\n                                                                                              \"status\": \"INLINED\",\n                                                                                            },\n                                                                                          ],\n                                                                                          \"message\": \"\",\n                                                                                          \"name\": \"FixedDataTableCell143\",\n                                                                                          \"status\": \"INLINED\",\n                                                                                        },\n                                                                                        Object {\n                                                                                          \"children\": Array [\n                                                                                            Object {\n                                                                                              \"children\": Array [\n                                                                                                Object {\n                                                                                                  \"children\": Array [\n                                                                                                    Object {\n                                                                                                      \"children\": Array [\n                                                                                                        Object {\n                                                                                                          \"children\": Array [],\n                                                                                                          \"message\": \"\",\n                                                                                                          \"name\": \"AdsPETableHeader141\",\n                                                                                                          \"status\": \"INLINED\",\n                                                                                                        },\n                                                                                                      ],\n                                                                                                      \"message\": \"\",\n                                                                                                      \"name\": \"FixedDataTableAbstractSortableHeader148\",\n                                                                                                      \"status\": \"INLINED\",\n                                                                                                    },\n                                                                                                  ],\n                                                                                                  \"message\": \"\",\n                                                                                                  \"name\": \"FixedDataTableSortableHeader149\",\n                                                                                                  \"status\": \"INLINED\",\n                                                                                                },\n                                                                                              ],\n                                                                                              \"message\": \"\",\n                                                                                              \"name\": \"TransitionCell142\",\n                                                                                              \"status\": \"INLINED\",\n                                                                                            },\n                                                                                          ],\n                                                                                          \"message\": \"\",\n                                                                                          \"name\": \"FixedDataTableCell143\",\n                                                                                          \"status\": \"INLINED\",\n                                                                                        },\n                                                                                        Object {\n                                                                                          \"children\": Array [\n                                                                                            Object {\n                                                                                              \"children\": Array [\n                                                                                                Object {\n                                                                                                  \"children\": Array [\n                                                                                                    Object {\n                                                                                                      \"children\": Array [\n                                                                                                        Object {\n                                                                                                          \"children\": Array [],\n                                                                                                          \"message\": \"\",\n                                                                                                          \"name\": \"AdsPETableHeader141\",\n                                                                                                          \"status\": \"INLINED\",\n                                                                                                        },\n                                                                                                      ],\n                                                                                                      \"message\": \"\",\n                                                                                                      \"name\": \"FixedDataTableAbstractSortableHeader148\",\n                                                                                                      \"status\": \"INLINED\",\n                                                                                                    },\n                                                                                                  ],\n                                                                                                  \"message\": \"\",\n                                                                                                  \"name\": \"FixedDataTableSortableHeader149\",\n                                                                                                  \"status\": \"INLINED\",\n                                                                                                },\n                                                                                              ],\n                                                                                              \"message\": \"\",\n                                                                                              \"name\": \"TransitionCell142\",\n                                                                                              \"status\": \"INLINED\",\n                                                                                            },\n                                                                                          ],\n                                                                                          \"message\": \"\",\n                                                                                          \"name\": \"FixedDataTableCell143\",\n                                                                                          \"status\": \"INLINED\",\n                                                                                        },\n                                                                                        Object {\n                                                                                          \"children\": Array [\n                                                                                            Object {\n                                                                                              \"children\": Array [\n                                                                                                Object {\n                                                                                                  \"children\": Array [\n                                                                                                    Object {\n                                                                                                      \"children\": Array [\n                                                                                                        Object {\n                                                                                                          \"children\": Array [],\n                                                                                                          \"message\": \"\",\n                                                                                                          \"name\": \"AdsPETableHeader141\",\n                                                                                                          \"status\": \"INLINED\",\n                                                                                                        },\n                                                                                                      ],\n                                                                                                      \"message\": \"\",\n                                                                                                      \"name\": \"FixedDataTableAbstractSortableHeader148\",\n                                                                                                      \"status\": \"INLINED\",\n                                                                                                    },\n                                                                                                  ],\n                                                                                                  \"message\": \"\",\n                                                                                                  \"name\": \"FixedDataTableSortableHeader149\",\n                                                                                                  \"status\": \"INLINED\",\n                                                                                                },\n                                                                                              ],\n                                                                                              \"message\": \"\",\n                                                                                              \"name\": \"TransitionCell142\",\n                                                                                              \"status\": \"INLINED\",\n                                                                                            },\n                                                                                          ],\n                                                                                          \"message\": \"\",\n                                                                                          \"name\": \"FixedDataTableCell143\",\n                                                                                          \"status\": \"INLINED\",\n                                                                                        },\n                                                                                        Object {\n                                                                                          \"children\": Array [\n                                                                                            Object {\n                                                                                              \"children\": Array [\n                                                                                                Object {\n                                                                                                  \"children\": Array [\n                                                                                                    Object {\n                                                                                                      \"children\": Array [\n                                                                                                        Object {\n                                                                                                          \"children\": Array [],\n                                                                                                          \"message\": \"\",\n                                                                                                          \"name\": \"AdsPETableHeader141\",\n                                                                                                          \"status\": \"INLINED\",\n                                                                                                        },\n                                                                                                      ],\n                                                                                                      \"message\": \"\",\n                                                                                                      \"name\": \"FixedDataTableAbstractSortableHeader148\",\n                                                                                                      \"status\": \"INLINED\",\n                                                                                                    },\n                                                                                                  ],\n                                                                                                  \"message\": \"\",\n                                                                                                  \"name\": \"FixedDataTableSortableHeader149\",\n                                                                                                  \"status\": \"INLINED\",\n                                                                                                },\n                                                                                              ],\n                                                                                              \"message\": \"\",\n                                                                                              \"name\": \"TransitionCell142\",\n                                                                                              \"status\": \"INLINED\",\n                                                                                            },\n                                                                                          ],\n                                                                                          \"message\": \"\",\n                                                                                          \"name\": \"FixedDataTableCell143\",\n                                                                                          \"status\": \"INLINED\",\n                                                                                        },\n                                                                                        Object {\n                                                                                          \"children\": Array [\n                                                                                            Object {\n                                                                                              \"children\": Array [\n                                                                                                Object {\n                                                                                                  \"children\": Array [\n                                                                                                    Object {\n                                                                                                      \"children\": Array [\n                                                                                                        Object {\n                                                                                                          \"children\": Array [],\n                                                                                                          \"message\": \"\",\n                                                                                                          \"name\": \"AdsPETableHeader141\",\n                                                                                                          \"status\": \"INLINED\",\n                                                                                                        },\n                                                                                                      ],\n                                                                                                      \"message\": \"\",\n                                                                                                      \"name\": \"FixedDataTableAbstractSortableHeader148\",\n                                                                                                      \"status\": \"INLINED\",\n                                                                                                    },\n                                                                                                  ],\n                                                                                                  \"message\": \"\",\n                                                                                                  \"name\": \"FixedDataTableSortableHeader149\",\n                                                                                                  \"status\": \"INLINED\",\n                                                                                                },\n                                                                                              ],\n                                                                                              \"message\": \"\",\n                                                                                              \"name\": \"TransitionCell142\",\n                                                                                              \"status\": \"INLINED\",\n                                                                                            },\n                                                                                          ],\n                                                                                          \"message\": \"\",\n                                                                                          \"name\": \"FixedDataTableCell143\",\n                                                                                          \"status\": \"INLINED\",\n                                                                                        },\n                                                                                        Object {\n                                                                                          \"children\": Array [\n                                                                                            Object {\n                                                                                              \"children\": Array [\n                                                                                                Object {\n                                                                                                  \"children\": Array [\n                                                                                                    Object {\n                                                                                                      \"children\": Array [\n                                                                                                        Object {\n                                                                                                          \"children\": Array [],\n                                                                                                          \"message\": \"\",\n                                                                                                          \"name\": \"AdsPETableHeader141\",\n                                                                                                          \"status\": \"INLINED\",\n                                                                                                        },\n                                                                                                      ],\n                                                                                                      \"message\": \"\",\n                                                                                                      \"name\": \"FixedDataTableAbstractSortableHeader148\",\n                                                                                                      \"status\": \"INLINED\",\n                                                                                                    },\n                                                                                                  ],\n                                                                                                  \"message\": \"\",\n                                                                                                  \"name\": \"FixedDataTableSortableHeader149\",\n                                                                                                  \"status\": \"INLINED\",\n                                                                                                },\n                                                                                              ],\n                                                                                              \"message\": \"\",\n                                                                                              \"name\": \"TransitionCell142\",\n                                                                                              \"status\": \"INLINED\",\n                                                                                            },\n                                                                                          ],\n                                                                                          \"message\": \"\",\n                                                                                          \"name\": \"FixedDataTableCell143\",\n                                                                                          \"status\": \"INLINED\",\n                                                                                        },\n                                                                                        Object {\n                                                                                          \"children\": Array [\n                                                                                            Object {\n                                                                                              \"children\": Array [\n                                                                                                Object {\n                                                                                                  \"children\": Array [\n                                                                                                    Object {\n                                                                                                      \"children\": Array [\n                                                                                                        Object {\n                                                                                                          \"children\": Array [],\n                                                                                                          \"message\": \"\",\n                                                                                                          \"name\": \"AdsPETableHeader141\",\n                                                                                                          \"status\": \"INLINED\",\n                                                                                                        },\n                                                                                                      ],\n                                                                                                      \"message\": \"\",\n                                                                                                      \"name\": \"FixedDataTableAbstractSortableHeader148\",\n                                                                                                      \"status\": \"INLINED\",\n                                                                                                    },\n                                                                                                  ],\n                                                                                                  \"message\": \"\",\n                                                                                                  \"name\": \"FixedDataTableSortableHeader149\",\n                                                                                                  \"status\": \"INLINED\",\n                                                                                                },\n                                                                                              ],\n                                                                                              \"message\": \"\",\n                                                                                              \"name\": \"TransitionCell142\",\n                                                                                              \"status\": \"INLINED\",\n                                                                                            },\n                                                                                          ],\n                                                                                          \"message\": \"\",\n                                                                                          \"name\": \"FixedDataTableCell143\",\n                                                                                          \"status\": \"INLINED\",\n                                                                                        },\n                                                                                        Object {\n                                                                                          \"children\": Array [\n                                                                                            Object {\n                                                                                              \"children\": Array [\n                                                                                                Object {\n                                                                                                  \"children\": Array [],\n                                                                                                  \"message\": \"\",\n                                                                                                  \"name\": \"AdsPETableHeader141\",\n                                                                                                  \"status\": \"INLINED\",\n                                                                                                },\n                                                                                              ],\n                                                                                              \"message\": \"\",\n                                                                                              \"name\": \"TransitionCell142\",\n                                                                                              \"status\": \"INLINED\",\n                                                                                            },\n                                                                                          ],\n                                                                                          \"message\": \"\",\n                                                                                          \"name\": \"FixedDataTableCell143\",\n                                                                                          \"status\": \"INLINED\",\n                                                                                        },\n                                                                                        Object {\n                                                                                          \"children\": Array [\n                                                                                            Object {\n                                                                                              \"children\": Array [\n                                                                                                Object {\n                                                                                                  \"children\": Array [],\n                                                                                                  \"message\": \"\",\n                                                                                                  \"name\": \"AdsPETableHeader141\",\n                                                                                                  \"status\": \"INLINED\",\n                                                                                                },\n                                                                                              ],\n                                                                                              \"message\": \"\",\n                                                                                              \"name\": \"TransitionCell142\",\n                                                                                              \"status\": \"INLINED\",\n                                                                                            },\n                                                                                          ],\n                                                                                          \"message\": \"\",\n                                                                                          \"name\": \"FixedDataTableCell143\",\n                                                                                          \"status\": \"INLINED\",\n                                                                                        },\n                                                                                      ],\n                                                                                      \"message\": \"\",\n                                                                                      \"name\": \"FixedDataTableCellGroupImpl144\",\n                                                                                      \"status\": \"INLINED\",\n                                                                                    },\n                                                                                  ],\n                                                                                  \"message\": \"\",\n                                                                                  \"name\": \"FixedDataTableCellGroup145\",\n                                                                                  \"status\": \"INLINED\",\n                                                                                },\n                                                                              ],\n                                                                              \"message\": \"\",\n                                                                              \"name\": \"FixedDataTableRowImpl146\",\n                                                                              \"status\": \"INLINED\",\n                                                                            },\n                                                                          ],\n                                                                          \"message\": \"\",\n                                                                          \"name\": \"FixedDataTableRow147\",\n                                                                          \"status\": \"INLINED\",\n                                                                        },\n                                                                        Object {\n                                                                          \"children\": Array [],\n                                                                          \"message\": \"\",\n                                                                          \"name\": \"FixedDataTableBufferedRows150\",\n                                                                          \"status\": \"INLINED\",\n                                                                        },\n                                                                        Object {\n                                                                          \"children\": Array [],\n                                                                          \"message\": \"\",\n                                                                          \"name\": \"Scrollbar151\",\n                                                                          \"status\": \"INLINED\",\n                                                                        },\n                                                                        Object {\n                                                                          \"children\": Array [\n                                                                            Object {\n                                                                              \"children\": Array [],\n                                                                              \"message\": \"\",\n                                                                              \"name\": \"Scrollbar151\",\n                                                                              \"status\": \"INLINED\",\n                                                                            },\n                                                                          ],\n                                                                          \"message\": \"\",\n                                                                          \"name\": \"HorizontalScrollbar152\",\n                                                                          \"status\": \"INLINED\",\n                                                                        },\n                                                                      ],\n                                                                      \"message\": \"\",\n                                                                      \"name\": \"FixedDataTable153\",\n                                                                      \"status\": \"INLINED\",\n                                                                    },\n                                                                  ],\n                                                                  \"message\": \"\",\n                                                                  \"name\": \"TransitionTable154\",\n                                                                  \"status\": \"INLINED\",\n                                                                },\n                                                              ],\n                                                              \"message\": \"\",\n                                                              \"name\": \"AdsSelectableFixedDataTable155\",\n                                                              \"status\": \"INLINED\",\n                                                            },\n                                                          ],\n                                                          \"message\": \"\",\n                                                          \"name\": \"AdsDataTableKeyboardSupportDecorator156\",\n                                                          \"status\": \"INLINED\",\n                                                        },\n                                                      ],\n                                                      \"message\": \"\",\n                                                      \"name\": \"AdsEditableDataTableDecorator157\",\n                                                      \"status\": \"INLINED\",\n                                                    },\n                                                  ],\n                                                  \"message\": \"\",\n                                                  \"name\": \"AdsPEDataTableContainer158\",\n                                                  \"status\": \"INLINED\",\n                                                },\n                                              ],\n                                              \"message\": \"\",\n                                              \"name\": \"ResponsiveBlock37\",\n                                              \"status\": \"INLINED\",\n                                            },\n                                          ],\n                                          \"message\": \"\",\n                                          \"name\": \"AdsPECampaignGroupTableContainer159\",\n                                          \"status\": \"INLINED\",\n                                        },\n                                      ],\n                                      \"message\": \"\",\n                                      \"name\": \"ErrorBoundary9\",\n                                      \"status\": \"INLINED\",\n                                    },\n                                  ],\n                                  \"message\": \"\",\n                                  \"name\": \"AdsErrorBoundary10\",\n                                  \"status\": \"INLINED\",\n                                },\n                              ],\n                              \"message\": \"\",\n                              \"name\": \"AdsPEManageAdsPaneContainer160\",\n                              \"status\": \"INLINED\",\n                            },\n                          ],\n                          \"message\": \"\",\n                          \"name\": \"AdsPEContentContainer161\",\n                          \"status\": \"INLINED\",\n                        },\n                      ],\n                      \"message\": \"\",\n                      \"name\": \"ErrorBoundary9\",\n                      \"status\": \"INLINED\",\n                    },\n                  ],\n                  \"message\": \"\",\n                  \"name\": \"AdsErrorBoundary10\",\n                  \"status\": \"INLINED\",\n                },\n              ],\n              \"message\": \"\",\n              \"name\": \"FluxContainer_AdsPEWorkspaceContainer_162\",\n              \"status\": \"INLINED\",\n            },\n            Object {\n              \"children\": Array [],\n              \"message\": \"\",\n              \"name\": \"FluxContainer_AdsSessionExpiredDialogContainer_163\",\n              \"status\": \"INLINED\",\n            },\n            Object {\n              \"children\": Array [],\n              \"message\": \"\",\n              \"name\": \"FluxContainer_AdsPEUploadDialogLazyContainer_164\",\n              \"status\": \"INLINED\",\n            },\n            Object {\n              \"children\": Array [],\n              \"message\": \"\",\n              \"name\": \"FluxContainer_DialogContainer_165\",\n              \"status\": \"INLINED\",\n            },\n            Object {\n              \"children\": Array [],\n              \"message\": \"\",\n              \"name\": \"AdsBugReportContainer166\",\n              \"status\": \"INLINED\",\n            },\n            Object {\n              \"children\": Array [\n                Object {\n                  \"children\": Array [],\n                  \"message\": \"\",\n                  \"name\": \"AdsPEAudienceSplittingDialog167\",\n                  \"status\": \"INLINED\",\n                },\n              ],\n              \"message\": \"\",\n              \"name\": \"AdsPEAudienceSplittingDialogContainer168\",\n              \"status\": \"INLINED\",\n            },\n            Object {\n              \"children\": Array [],\n              \"message\": \"\",\n              \"name\": \"FluxContainer_AdsRuleDialogBootloadContainer_169\",\n              \"status\": \"INLINED\",\n            },\n            Object {\n              \"children\": Array [],\n              \"message\": \"\",\n              \"name\": \"FluxContainer_AdsPECFTrayContainer_170\",\n              \"status\": \"INLINED\",\n            },\n            Object {\n              \"children\": Array [],\n              \"message\": \"\",\n              \"name\": \"FluxContainer_AdsPEDeleteDraftContainer_171\",\n              \"status\": \"INLINED\",\n            },\n            Object {\n              \"children\": Array [],\n              \"message\": \"\",\n              \"name\": \"FluxContainer_AdsPEInitialDraftPublishDialogContainer_172\",\n              \"status\": \"INLINED\",\n            },\n            Object {\n              \"children\": Array [],\n              \"message\": \"\",\n              \"name\": \"FluxContainer_AdsPEReachFrequencyStatusTransitionDialogBootloadContainer_173\",\n              \"status\": \"INLINED\",\n            },\n            Object {\n              \"children\": Array [],\n              \"message\": \"\",\n              \"name\": \"FluxContainer_AdsPEPurgeArchiveDialogContainer_174\",\n              \"status\": \"INLINED\",\n            },\n            Object {\n              \"children\": Array [],\n              \"message\": \"\",\n              \"name\": \"AdsPECreateDialogContainer175\",\n              \"status\": \"INLINED\",\n            },\n            Object {\n              \"children\": Array [],\n              \"message\": \"\",\n              \"name\": \"FluxContainer_AdsPEModalStatusContainer_176\",\n              \"status\": \"INLINED\",\n            },\n            Object {\n              \"children\": Array [],\n              \"message\": \"\",\n              \"name\": \"FluxContainer_AdsBrowserExtensionErrorDialogContainer_177\",\n              \"status\": \"INLINED\",\n            },\n            Object {\n              \"children\": Array [],\n              \"message\": \"\",\n              \"name\": \"FluxContainer_AdsPESortByErrorTipContainer_178\",\n              \"status\": \"INLINED\",\n            },\n            Object {\n              \"children\": Array [\n                Object {\n                  \"children\": Array [],\n                  \"message\": \"\",\n                  \"name\": \"LeadDownloadDialogSelector179\",\n                  \"status\": \"INLINED\",\n                },\n              ],\n              \"message\": \"\",\n              \"name\": \"FluxContainer_AdsPELeadDownloadDialogContainerClass_180\",\n              \"status\": \"INLINED\",\n            },\n          ],\n          \"message\": \"\",\n          \"name\": \"AdsPEContainer181\",\n          \"status\": \"INLINED\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"Benchmark\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 497,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`fb-www 2: (JSX => JSX) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 1,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [],\n      \"message\": \"\",\n      \"name\": \"Hello\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 0,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`fb-www 2: (JSX => createElement) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 1,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [],\n      \"message\": \"\",\n      \"name\": \"Hello\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 0,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`fb-www 2: (createElement => JSX) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 1,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [],\n      \"message\": \"\",\n      \"name\": \"Hello\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 0,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`fb-www 2: (createElement => createElement) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 1,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [],\n      \"message\": \"\",\n      \"name\": \"Hello\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 0,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`fb-www 3: (JSX => JSX) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 0,\n  \"evaluatedRootNodes\": Array [],\n  \"inlinedComponents\": 0,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 0,\n}\n`;\n\nexports[`fb-www 3: (JSX => createElement) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 0,\n  \"evaluatedRootNodes\": Array [],\n  \"inlinedComponents\": 0,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 0,\n}\n`;\n\nexports[`fb-www 3: (createElement => JSX) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 0,\n  \"evaluatedRootNodes\": Array [],\n  \"inlinedComponents\": 0,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 0,\n}\n`;\n\nexports[`fb-www 3: (createElement => createElement) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 0,\n  \"evaluatedRootNodes\": Array [],\n  \"inlinedComponents\": 0,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 0,\n}\n`;\n\nexports[`fb-www 4: (JSX => JSX) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 0,\n  \"evaluatedRootNodes\": Array [],\n  \"inlinedComponents\": 0,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 0,\n}\n`;\n\nexports[`fb-www 4: (JSX => createElement) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 0,\n  \"evaluatedRootNodes\": Array [],\n  \"inlinedComponents\": 0,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 0,\n}\n`;\n\nexports[`fb-www 4: (createElement => JSX) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 0,\n  \"evaluatedRootNodes\": Array [],\n  \"inlinedComponents\": 0,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 0,\n}\n`;\n\nexports[`fb-www 4: (createElement => createElement) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 0,\n  \"evaluatedRootNodes\": Array [],\n  \"inlinedComponents\": 0,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 0,\n}\n`;\n\nexports[`fb-www 5: (JSX => JSX) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 0,\n  \"evaluatedRootNodes\": Array [],\n  \"inlinedComponents\": 0,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 0,\n}\n`;\n\nexports[`fb-www 5: (JSX => createElement) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 0,\n  \"evaluatedRootNodes\": Array [],\n  \"inlinedComponents\": 0,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 0,\n}\n`;\n\nexports[`fb-www 5: (createElement => JSX) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 0,\n  \"evaluatedRootNodes\": Array [],\n  \"inlinedComponents\": 0,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 0,\n}\n`;\n\nexports[`fb-www 5: (createElement => createElement) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 0,\n  \"evaluatedRootNodes\": Array [],\n  \"inlinedComponents\": 0,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 0,\n}\n`;\n\nexports[`fb-www 6: (JSX => JSX) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 0,\n  \"evaluatedRootNodes\": Array [],\n  \"inlinedComponents\": 0,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 0,\n}\n`;\n\nexports[`fb-www 6: (JSX => createElement) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 0,\n  \"evaluatedRootNodes\": Array [],\n  \"inlinedComponents\": 0,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 0,\n}\n`;\n\nexports[`fb-www 6: (createElement => JSX) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 0,\n  \"evaluatedRootNodes\": Array [],\n  \"inlinedComponents\": 0,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 0,\n}\n`;\n\nexports[`fb-www 6: (createElement => createElement) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 0,\n  \"evaluatedRootNodes\": Array [],\n  \"inlinedComponents\": 0,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 0,\n}\n`;\n\nexports[`fb-www 7: (JSX => JSX) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 1,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 0,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`fb-www 7: (JSX => createElement) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 1,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 0,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`fb-www 7: (createElement => JSX) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 1,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 0,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`fb-www 7: (createElement => createElement) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 1,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 0,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`fb-www 8: (JSX => JSX) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 3,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [],\n          \"message\": \"RelayContainer\",\n          \"name\": \"WrappedApp\",\n          \"status\": \"NEW_TREE\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 0,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 2,\n}\n`;\n\nexports[`fb-www 8: (JSX => createElement) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 3,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [],\n          \"message\": \"RelayContainer\",\n          \"name\": \"WrappedApp\",\n          \"status\": \"NEW_TREE\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 0,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 2,\n}\n`;\n\nexports[`fb-www 8: (createElement => JSX) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 3,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [],\n          \"message\": \"RelayContainer\",\n          \"name\": \"WrappedApp\",\n          \"status\": \"NEW_TREE\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 0,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 2,\n}\n`;\n\nexports[`fb-www 8: (createElement => createElement) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 3,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [],\n          \"message\": \"RelayContainer\",\n          \"name\": \"WrappedApp\",\n          \"status\": \"NEW_TREE\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 0,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 2,\n}\n`;\n\nexports[`fb-www 9: (JSX => JSX) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 9,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [\n            Object {\n              \"children\": Array [\n                Object {\n                  \"children\": Array [],\n                  \"message\": \"\",\n                  \"name\": \"B\",\n                  \"status\": \"INLINED\",\n                },\n                Object {\n                  \"children\": Array [],\n                  \"message\": \"\",\n                  \"name\": \"C\",\n                  \"status\": \"INLINED\",\n                },\n              ],\n              \"message\": \"\",\n              \"name\": \"React.Fragment\",\n              \"status\": \"NORMAL\",\n            },\n          ],\n          \"message\": \"\",\n          \"name\": \"A\",\n          \"status\": \"INLINED\",\n        },\n        Object {\n          \"children\": Array [\n            Object {\n              \"children\": Array [\n                Object {\n                  \"children\": Array [],\n                  \"message\": \"\",\n                  \"name\": \"B\",\n                  \"status\": \"INLINED\",\n                },\n                Object {\n                  \"children\": Array [],\n                  \"message\": \"\",\n                  \"name\": \"C\",\n                  \"status\": \"INLINED\",\n                },\n              ],\n              \"message\": \"\",\n              \"name\": \"React.Fragment\",\n              \"status\": \"NORMAL\",\n            },\n          ],\n          \"message\": \"\",\n          \"name\": \"A\",\n          \"status\": \"INLINED\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 6,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`fb-www 9: (JSX => createElement) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 9,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [\n            Object {\n              \"children\": Array [\n                Object {\n                  \"children\": Array [],\n                  \"message\": \"\",\n                  \"name\": \"B\",\n                  \"status\": \"INLINED\",\n                },\n                Object {\n                  \"children\": Array [],\n                  \"message\": \"\",\n                  \"name\": \"C\",\n                  \"status\": \"INLINED\",\n                },\n              ],\n              \"message\": \"\",\n              \"name\": \"React.Fragment\",\n              \"status\": \"NORMAL\",\n            },\n          ],\n          \"message\": \"\",\n          \"name\": \"A\",\n          \"status\": \"INLINED\",\n        },\n        Object {\n          \"children\": Array [\n            Object {\n              \"children\": Array [\n                Object {\n                  \"children\": Array [],\n                  \"message\": \"\",\n                  \"name\": \"B\",\n                  \"status\": \"INLINED\",\n                },\n                Object {\n                  \"children\": Array [],\n                  \"message\": \"\",\n                  \"name\": \"C\",\n                  \"status\": \"INLINED\",\n                },\n              ],\n              \"message\": \"\",\n              \"name\": \"React.Fragment\",\n              \"status\": \"NORMAL\",\n            },\n          ],\n          \"message\": \"\",\n          \"name\": \"A\",\n          \"status\": \"INLINED\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 6,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`fb-www 9: (createElement => JSX) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 9,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [\n            Object {\n              \"children\": Array [\n                Object {\n                  \"children\": Array [],\n                  \"message\": \"\",\n                  \"name\": \"B\",\n                  \"status\": \"INLINED\",\n                },\n                Object {\n                  \"children\": Array [],\n                  \"message\": \"\",\n                  \"name\": \"C\",\n                  \"status\": \"INLINED\",\n                },\n              ],\n              \"message\": \"\",\n              \"name\": \"React.Fragment\",\n              \"status\": \"NORMAL\",\n            },\n          ],\n          \"message\": \"\",\n          \"name\": \"A\",\n          \"status\": \"INLINED\",\n        },\n        Object {\n          \"children\": Array [\n            Object {\n              \"children\": Array [\n                Object {\n                  \"children\": Array [],\n                  \"message\": \"\",\n                  \"name\": \"B\",\n                  \"status\": \"INLINED\",\n                },\n                Object {\n                  \"children\": Array [],\n                  \"message\": \"\",\n                  \"name\": \"C\",\n                  \"status\": \"INLINED\",\n                },\n              ],\n              \"message\": \"\",\n              \"name\": \"React.Fragment\",\n              \"status\": \"NORMAL\",\n            },\n          ],\n          \"message\": \"\",\n          \"name\": \"A\",\n          \"status\": \"INLINED\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 6,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`fb-www 9: (createElement => createElement) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 9,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [\n            Object {\n              \"children\": Array [\n                Object {\n                  \"children\": Array [],\n                  \"message\": \"\",\n                  \"name\": \"B\",\n                  \"status\": \"INLINED\",\n                },\n                Object {\n                  \"children\": Array [],\n                  \"message\": \"\",\n                  \"name\": \"C\",\n                  \"status\": \"INLINED\",\n                },\n              ],\n              \"message\": \"\",\n              \"name\": \"React.Fragment\",\n              \"status\": \"NORMAL\",\n            },\n          ],\n          \"message\": \"\",\n          \"name\": \"A\",\n          \"status\": \"INLINED\",\n        },\n        Object {\n          \"children\": Array [\n            Object {\n              \"children\": Array [\n                Object {\n                  \"children\": Array [],\n                  \"message\": \"\",\n                  \"name\": \"B\",\n                  \"status\": \"INLINED\",\n                },\n                Object {\n                  \"children\": Array [],\n                  \"message\": \"\",\n                  \"name\": \"C\",\n                  \"status\": \"INLINED\",\n                },\n              ],\n              \"message\": \"\",\n              \"name\": \"React.Fragment\",\n              \"status\": \"NORMAL\",\n            },\n          ],\n          \"message\": \"\",\n          \"name\": \"A\",\n          \"status\": \"INLINED\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 6,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`fb-www 10: (JSX => JSX) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 5,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [\n            Object {\n              \"children\": Array [\n                Object {\n                  \"children\": Array [],\n                  \"message\": \"\",\n                  \"name\": \"B\",\n                  \"status\": \"INLINED\",\n                },\n                Object {\n                  \"children\": Array [],\n                  \"message\": \"\",\n                  \"name\": \"C\",\n                  \"status\": \"INLINED\",\n                },\n              ],\n              \"message\": \"\",\n              \"name\": \"React.Fragment\",\n              \"status\": \"NORMAL\",\n            },\n          ],\n          \"message\": \"\",\n          \"name\": \"A\",\n          \"status\": \"INLINED\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 3,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`fb-www 10: (JSX => createElement) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 5,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [\n            Object {\n              \"children\": Array [\n                Object {\n                  \"children\": Array [],\n                  \"message\": \"\",\n                  \"name\": \"B\",\n                  \"status\": \"INLINED\",\n                },\n                Object {\n                  \"children\": Array [],\n                  \"message\": \"\",\n                  \"name\": \"C\",\n                  \"status\": \"INLINED\",\n                },\n              ],\n              \"message\": \"\",\n              \"name\": \"React.Fragment\",\n              \"status\": \"NORMAL\",\n            },\n          ],\n          \"message\": \"\",\n          \"name\": \"A\",\n          \"status\": \"INLINED\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 3,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`fb-www 10: (createElement => JSX) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 5,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [\n            Object {\n              \"children\": Array [\n                Object {\n                  \"children\": Array [],\n                  \"message\": \"\",\n                  \"name\": \"B\",\n                  \"status\": \"INLINED\",\n                },\n                Object {\n                  \"children\": Array [],\n                  \"message\": \"\",\n                  \"name\": \"C\",\n                  \"status\": \"INLINED\",\n                },\n              ],\n              \"message\": \"\",\n              \"name\": \"React.Fragment\",\n              \"status\": \"NORMAL\",\n            },\n          ],\n          \"message\": \"\",\n          \"name\": \"A\",\n          \"status\": \"INLINED\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 3,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`fb-www 10: (createElement => createElement) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 5,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [\n            Object {\n              \"children\": Array [\n                Object {\n                  \"children\": Array [],\n                  \"message\": \"\",\n                  \"name\": \"B\",\n                  \"status\": \"INLINED\",\n                },\n                Object {\n                  \"children\": Array [],\n                  \"message\": \"\",\n                  \"name\": \"C\",\n                  \"status\": \"INLINED\",\n                },\n              ],\n              \"message\": \"\",\n              \"name\": \"React.Fragment\",\n              \"status\": \"NORMAL\",\n            },\n          ],\n          \"message\": \"\",\n          \"name\": \"A\",\n          \"status\": \"INLINED\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 3,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`fb-www 11: (JSX => JSX) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 13,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [\n            Object {\n              \"children\": Array [\n                Object {\n                  \"children\": Array [],\n                  \"message\": \"\",\n                  \"name\": \"B\",\n                  \"status\": \"INLINED\",\n                },\n                Object {\n                  \"children\": Array [],\n                  \"message\": \"\",\n                  \"name\": \"C\",\n                  \"status\": \"INLINED\",\n                },\n              ],\n              \"message\": \"\",\n              \"name\": \"React.Fragment\",\n              \"status\": \"NORMAL\",\n            },\n          ],\n          \"message\": \"\",\n          \"name\": \"A\",\n          \"status\": \"INLINED\",\n        },\n        Object {\n          \"children\": Array [\n            Object {\n              \"children\": Array [\n                Object {\n                  \"children\": Array [],\n                  \"message\": \"\",\n                  \"name\": \"B\",\n                  \"status\": \"INLINED\",\n                },\n                Object {\n                  \"children\": Array [],\n                  \"message\": \"\",\n                  \"name\": \"C\",\n                  \"status\": \"INLINED\",\n                },\n              ],\n              \"message\": \"\",\n              \"name\": \"React.Fragment\",\n              \"status\": \"NORMAL\",\n            },\n          ],\n          \"message\": \"\",\n          \"name\": \"A\",\n          \"status\": \"INLINED\",\n        },\n        Object {\n          \"children\": Array [\n            Object {\n              \"children\": Array [\n                Object {\n                  \"children\": Array [],\n                  \"message\": \"\",\n                  \"name\": \"B\",\n                  \"status\": \"INLINED\",\n                },\n                Object {\n                  \"children\": Array [],\n                  \"message\": \"\",\n                  \"name\": \"C\",\n                  \"status\": \"INLINED\",\n                },\n              ],\n              \"message\": \"\",\n              \"name\": \"React.Fragment\",\n              \"status\": \"NORMAL\",\n            },\n          ],\n          \"message\": \"\",\n          \"name\": \"A\",\n          \"status\": \"INLINED\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 9,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`fb-www 11: (JSX => createElement) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 13,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [\n            Object {\n              \"children\": Array [\n                Object {\n                  \"children\": Array [],\n                  \"message\": \"\",\n                  \"name\": \"B\",\n                  \"status\": \"INLINED\",\n                },\n                Object {\n                  \"children\": Array [],\n                  \"message\": \"\",\n                  \"name\": \"C\",\n                  \"status\": \"INLINED\",\n                },\n              ],\n              \"message\": \"\",\n              \"name\": \"React.Fragment\",\n              \"status\": \"NORMAL\",\n            },\n          ],\n          \"message\": \"\",\n          \"name\": \"A\",\n          \"status\": \"INLINED\",\n        },\n        Object {\n          \"children\": Array [\n            Object {\n              \"children\": Array [\n                Object {\n                  \"children\": Array [],\n                  \"message\": \"\",\n                  \"name\": \"B\",\n                  \"status\": \"INLINED\",\n                },\n                Object {\n                  \"children\": Array [],\n                  \"message\": \"\",\n                  \"name\": \"C\",\n                  \"status\": \"INLINED\",\n                },\n              ],\n              \"message\": \"\",\n              \"name\": \"React.Fragment\",\n              \"status\": \"NORMAL\",\n            },\n          ],\n          \"message\": \"\",\n          \"name\": \"A\",\n          \"status\": \"INLINED\",\n        },\n        Object {\n          \"children\": Array [\n            Object {\n              \"children\": Array [\n                Object {\n                  \"children\": Array [],\n                  \"message\": \"\",\n                  \"name\": \"B\",\n                  \"status\": \"INLINED\",\n                },\n                Object {\n                  \"children\": Array [],\n                  \"message\": \"\",\n                  \"name\": \"C\",\n                  \"status\": \"INLINED\",\n                },\n              ],\n              \"message\": \"\",\n              \"name\": \"React.Fragment\",\n              \"status\": \"NORMAL\",\n            },\n          ],\n          \"message\": \"\",\n          \"name\": \"A\",\n          \"status\": \"INLINED\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 9,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`fb-www 11: (createElement => JSX) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 13,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [\n            Object {\n              \"children\": Array [\n                Object {\n                  \"children\": Array [],\n                  \"message\": \"\",\n                  \"name\": \"B\",\n                  \"status\": \"INLINED\",\n                },\n                Object {\n                  \"children\": Array [],\n                  \"message\": \"\",\n                  \"name\": \"C\",\n                  \"status\": \"INLINED\",\n                },\n              ],\n              \"message\": \"\",\n              \"name\": \"React.Fragment\",\n              \"status\": \"NORMAL\",\n            },\n          ],\n          \"message\": \"\",\n          \"name\": \"A\",\n          \"status\": \"INLINED\",\n        },\n        Object {\n          \"children\": Array [\n            Object {\n              \"children\": Array [\n                Object {\n                  \"children\": Array [],\n                  \"message\": \"\",\n                  \"name\": \"B\",\n                  \"status\": \"INLINED\",\n                },\n                Object {\n                  \"children\": Array [],\n                  \"message\": \"\",\n                  \"name\": \"C\",\n                  \"status\": \"INLINED\",\n                },\n              ],\n              \"message\": \"\",\n              \"name\": \"React.Fragment\",\n              \"status\": \"NORMAL\",\n            },\n          ],\n          \"message\": \"\",\n          \"name\": \"A\",\n          \"status\": \"INLINED\",\n        },\n        Object {\n          \"children\": Array [\n            Object {\n              \"children\": Array [\n                Object {\n                  \"children\": Array [],\n                  \"message\": \"\",\n                  \"name\": \"B\",\n                  \"status\": \"INLINED\",\n                },\n                Object {\n                  \"children\": Array [],\n                  \"message\": \"\",\n                  \"name\": \"C\",\n                  \"status\": \"INLINED\",\n                },\n              ],\n              \"message\": \"\",\n              \"name\": \"React.Fragment\",\n              \"status\": \"NORMAL\",\n            },\n          ],\n          \"message\": \"\",\n          \"name\": \"A\",\n          \"status\": \"INLINED\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 9,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`fb-www 11: (createElement => createElement) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 13,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [\n            Object {\n              \"children\": Array [\n                Object {\n                  \"children\": Array [],\n                  \"message\": \"\",\n                  \"name\": \"B\",\n                  \"status\": \"INLINED\",\n                },\n                Object {\n                  \"children\": Array [],\n                  \"message\": \"\",\n                  \"name\": \"C\",\n                  \"status\": \"INLINED\",\n                },\n              ],\n              \"message\": \"\",\n              \"name\": \"React.Fragment\",\n              \"status\": \"NORMAL\",\n            },\n          ],\n          \"message\": \"\",\n          \"name\": \"A\",\n          \"status\": \"INLINED\",\n        },\n        Object {\n          \"children\": Array [\n            Object {\n              \"children\": Array [\n                Object {\n                  \"children\": Array [],\n                  \"message\": \"\",\n                  \"name\": \"B\",\n                  \"status\": \"INLINED\",\n                },\n                Object {\n                  \"children\": Array [],\n                  \"message\": \"\",\n                  \"name\": \"C\",\n                  \"status\": \"INLINED\",\n                },\n              ],\n              \"message\": \"\",\n              \"name\": \"React.Fragment\",\n              \"status\": \"NORMAL\",\n            },\n          ],\n          \"message\": \"\",\n          \"name\": \"A\",\n          \"status\": \"INLINED\",\n        },\n        Object {\n          \"children\": Array [\n            Object {\n              \"children\": Array [\n                Object {\n                  \"children\": Array [],\n                  \"message\": \"\",\n                  \"name\": \"B\",\n                  \"status\": \"INLINED\",\n                },\n                Object {\n                  \"children\": Array [],\n                  \"message\": \"\",\n                  \"name\": \"C\",\n                  \"status\": \"INLINED\",\n                },\n              ],\n              \"message\": \"\",\n              \"name\": \"React.Fragment\",\n              \"status\": \"NORMAL\",\n            },\n          ],\n          \"message\": \"\",\n          \"name\": \"A\",\n          \"status\": \"INLINED\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 9,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`fb-www 12: (JSX => JSX) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 4,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [\n            Object {\n              \"children\": Array [],\n              \"message\": \"\",\n              \"name\": \"B\",\n              \"status\": \"INLINED\",\n            },\n            Object {\n              \"children\": Array [],\n              \"message\": \"\",\n              \"name\": \"C\",\n              \"status\": \"INLINED\",\n            },\n          ],\n          \"message\": \"\",\n          \"name\": \"A\",\n          \"status\": \"INLINED\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 3,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`fb-www 12: (JSX => createElement) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 4,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [\n            Object {\n              \"children\": Array [],\n              \"message\": \"\",\n              \"name\": \"B\",\n              \"status\": \"INLINED\",\n            },\n            Object {\n              \"children\": Array [],\n              \"message\": \"\",\n              \"name\": \"C\",\n              \"status\": \"INLINED\",\n            },\n          ],\n          \"message\": \"\",\n          \"name\": \"A\",\n          \"status\": \"INLINED\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 3,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`fb-www 12: (createElement => JSX) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 4,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [\n            Object {\n              \"children\": Array [],\n              \"message\": \"\",\n              \"name\": \"B\",\n              \"status\": \"INLINED\",\n            },\n            Object {\n              \"children\": Array [],\n              \"message\": \"\",\n              \"name\": \"C\",\n              \"status\": \"INLINED\",\n            },\n          ],\n          \"message\": \"\",\n          \"name\": \"A\",\n          \"status\": \"INLINED\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 3,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`fb-www 12: (createElement => createElement) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 4,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [\n            Object {\n              \"children\": Array [],\n              \"message\": \"\",\n              \"name\": \"B\",\n              \"status\": \"INLINED\",\n            },\n            Object {\n              \"children\": Array [],\n              \"message\": \"\",\n              \"name\": \"C\",\n              \"status\": \"INLINED\",\n            },\n          ],\n          \"message\": \"\",\n          \"name\": \"A\",\n          \"status\": \"INLINED\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 3,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`fb-www 13: (JSX => JSX) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 0,\n  \"evaluatedRootNodes\": Array [],\n  \"inlinedComponents\": 0,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 0,\n}\n`;\n\nexports[`fb-www 13: (JSX => createElement) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 0,\n  \"evaluatedRootNodes\": Array [],\n  \"inlinedComponents\": 0,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 0,\n}\n`;\n\nexports[`fb-www 13: (createElement => JSX) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 0,\n  \"evaluatedRootNodes\": Array [],\n  \"inlinedComponents\": 0,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 0,\n}\n`;\n\nexports[`fb-www 13: (createElement => createElement) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 0,\n  \"evaluatedRootNodes\": Array [],\n  \"inlinedComponents\": 0,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 0,\n}\n`;\n\nexports[`fb-www 14: (JSX => JSX) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 4,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [\n            Object {\n              \"children\": Array [],\n              \"message\": \"\",\n              \"name\": \"Child\",\n              \"status\": \"INLINED\",\n            },\n          ],\n          \"message\": \"RelayContainer\",\n          \"name\": \"WrappedApp\",\n          \"status\": \"INLINED\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 2,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`fb-www 14: (JSX => createElement) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 4,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [\n            Object {\n              \"children\": Array [],\n              \"message\": \"\",\n              \"name\": \"Child\",\n              \"status\": \"INLINED\",\n            },\n          ],\n          \"message\": \"RelayContainer\",\n          \"name\": \"WrappedApp\",\n          \"status\": \"INLINED\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 2,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`fb-www 14: (createElement => JSX) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 4,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [\n            Object {\n              \"children\": Array [],\n              \"message\": \"\",\n              \"name\": \"Child\",\n              \"status\": \"INLINED\",\n            },\n          ],\n          \"message\": \"RelayContainer\",\n          \"name\": \"WrappedApp\",\n          \"status\": \"INLINED\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 2,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`fb-www 14: (createElement => createElement) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 4,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [\n            Object {\n              \"children\": Array [],\n              \"message\": \"\",\n              \"name\": \"Child\",\n              \"status\": \"INLINED\",\n            },\n          ],\n          \"message\": \"RelayContainer\",\n          \"name\": \"WrappedApp\",\n          \"status\": \"INLINED\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 2,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`fb-www 15: (JSX => JSX) 1`] = `\"Failed to render React component root \\\\\"Outer\\\\\" due to side-effects from mutating the binding \\\\\"result\\\\\"\"`;\n\nexports[`fb-www 15: (JSX => createElement) 1`] = `\"Failed to render React component root \\\\\"Outer\\\\\" due to side-effects from mutating the binding \\\\\"result\\\\\"\"`;\n\nexports[`fb-www 15: (createElement => JSX) 1`] = `\"Failed to render React component root \\\\\"Outer\\\\\" due to side-effects from mutating the binding \\\\\"result\\\\\"\"`;\n\nexports[`fb-www 15: (createElement => createElement) 1`] = `\"Failed to render React component root \\\\\"Outer\\\\\" due to side-effects from mutating the binding \\\\\"result\\\\\"\"`;\n\nexports[`fb-www 16: (JSX => JSX) 1`] = `\"Failed to render React component root \\\\\"ViewCount\\\\\" due to side-effects from mutating a property \"`;\n\nexports[`fb-www 16: (JSX => createElement) 1`] = `\"Failed to render React component root \\\\\"ViewCount\\\\\" due to side-effects from mutating a property \"`;\n\nexports[`fb-www 16: (createElement => JSX) 1`] = `\"Failed to render React component root \\\\\"ViewCount\\\\\" due to side-effects from mutating a property \"`;\n\nexports[`fb-www 16: (createElement => createElement) 1`] = `\"Failed to render React component root \\\\\"ViewCount\\\\\" due to side-effects from mutating a property \"`;\n\nexports[`fb-www 17: (JSX => JSX) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 4,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [\n            Object {\n              \"children\": Array [\n                Object {\n                  \"children\": Array [],\n                  \"message\": \"\",\n                  \"name\": \"Inner\",\n                  \"status\": \"INLINED\",\n                },\n              ],\n              \"message\": \"\",\n              \"name\": \"Middle\",\n              \"status\": \"INLINED\",\n            },\n          ],\n          \"message\": \"\",\n          \"name\": \"Outer\",\n          \"status\": \"INLINED\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 3,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`fb-www 17: (JSX => createElement) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 4,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [\n            Object {\n              \"children\": Array [\n                Object {\n                  \"children\": Array [],\n                  \"message\": \"\",\n                  \"name\": \"Inner\",\n                  \"status\": \"INLINED\",\n                },\n              ],\n              \"message\": \"\",\n              \"name\": \"Middle\",\n              \"status\": \"INLINED\",\n            },\n          ],\n          \"message\": \"\",\n          \"name\": \"Outer\",\n          \"status\": \"INLINED\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 3,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`fb-www 17: (createElement => JSX) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 4,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [\n            Object {\n              \"children\": Array [\n                Object {\n                  \"children\": Array [],\n                  \"message\": \"\",\n                  \"name\": \"Inner\",\n                  \"status\": \"INLINED\",\n                },\n              ],\n              \"message\": \"\",\n              \"name\": \"Middle\",\n              \"status\": \"INLINED\",\n            },\n          ],\n          \"message\": \"\",\n          \"name\": \"Outer\",\n          \"status\": \"INLINED\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 3,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`fb-www 17: (createElement => createElement) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 4,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [\n            Object {\n              \"children\": Array [\n                Object {\n                  \"children\": Array [],\n                  \"message\": \"\",\n                  \"name\": \"Inner\",\n                  \"status\": \"INLINED\",\n                },\n              ],\n              \"message\": \"\",\n              \"name\": \"Middle\",\n              \"status\": \"INLINED\",\n            },\n          ],\n          \"message\": \"\",\n          \"name\": \"Outer\",\n          \"status\": \"INLINED\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 3,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`fb-www 18: (JSX => JSX) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 1,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 0,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`fb-www 18: (JSX => createElement) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 1,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 0,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`fb-www 18: (createElement => JSX) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 1,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 0,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`fb-www 18: (createElement => createElement) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 1,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 0,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`fb-www 19: (JSX => JSX) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 1,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 0,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`fb-www 19: (JSX => createElement) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 1,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 0,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`fb-www 19: (createElement => JSX) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 1,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 0,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`fb-www 19: (createElement => createElement) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 1,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 0,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`fb-www 20: (JSX => JSX) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 2,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [],\n          \"message\": \"\",\n          \"name\": \"Child\",\n          \"status\": \"INLINED\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 1,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`fb-www 20: (JSX => createElement) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 2,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [],\n          \"message\": \"\",\n          \"name\": \"Child\",\n          \"status\": \"INLINED\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 1,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`fb-www 20: (createElement => JSX) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 2,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [],\n          \"message\": \"\",\n          \"name\": \"Child\",\n          \"status\": \"INLINED\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 1,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`fb-www 20: (createElement => createElement) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 2,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [],\n          \"message\": \"\",\n          \"name\": \"Child\",\n          \"status\": \"INLINED\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 1,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`fb-www 21: (JSX => JSX) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 4,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [],\n          \"message\": \"\",\n          \"name\": \"A\",\n          \"status\": \"INLINED\",\n        },\n        Object {\n          \"children\": Array [],\n          \"message\": \"\",\n          \"name\": \"B\",\n          \"status\": \"INLINED\",\n        },\n        Object {\n          \"children\": Array [],\n          \"message\": \"\",\n          \"name\": \"C\",\n          \"status\": \"INLINED\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 3,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`fb-www 21: (JSX => createElement) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 4,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [],\n          \"message\": \"\",\n          \"name\": \"A\",\n          \"status\": \"INLINED\",\n        },\n        Object {\n          \"children\": Array [],\n          \"message\": \"\",\n          \"name\": \"B\",\n          \"status\": \"INLINED\",\n        },\n        Object {\n          \"children\": Array [],\n          \"message\": \"\",\n          \"name\": \"C\",\n          \"status\": \"INLINED\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 3,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`fb-www 21: (createElement => JSX) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 4,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [],\n          \"message\": \"\",\n          \"name\": \"A\",\n          \"status\": \"INLINED\",\n        },\n        Object {\n          \"children\": Array [],\n          \"message\": \"\",\n          \"name\": \"B\",\n          \"status\": \"INLINED\",\n        },\n        Object {\n          \"children\": Array [],\n          \"message\": \"\",\n          \"name\": \"C\",\n          \"status\": \"INLINED\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 3,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`fb-www 21: (createElement => createElement) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 4,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [],\n          \"message\": \"\",\n          \"name\": \"A\",\n          \"status\": \"INLINED\",\n        },\n        Object {\n          \"children\": Array [],\n          \"message\": \"\",\n          \"name\": \"B\",\n          \"status\": \"INLINED\",\n        },\n        Object {\n          \"children\": Array [],\n          \"message\": \"\",\n          \"name\": \"C\",\n          \"status\": \"INLINED\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 3,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`fb-www 22: (JSX => JSX) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 2,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [],\n          \"message\": \"\",\n          \"name\": \"React.Fragment\",\n          \"status\": \"INLINED\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 1,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`fb-www 22: (JSX => createElement) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 2,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [],\n          \"message\": \"\",\n          \"name\": \"React.Fragment\",\n          \"status\": \"INLINED\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 1,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`fb-www 22: (createElement => JSX) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 2,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [],\n          \"message\": \"\",\n          \"name\": \"React.Fragment\",\n          \"status\": \"INLINED\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 1,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`fb-www 22: (createElement => createElement) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 2,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [],\n          \"message\": \"\",\n          \"name\": \"React.Fragment\",\n          \"status\": \"INLINED\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 1,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`fb-www 23: (JSX => JSX) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 4,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [],\n          \"message\": \"\",\n          \"name\": \"A\",\n          \"status\": \"INLINED\",\n        },\n        Object {\n          \"children\": Array [],\n          \"message\": \"\",\n          \"name\": \"B\",\n          \"status\": \"INLINED\",\n        },\n        Object {\n          \"children\": Array [],\n          \"message\": \"\",\n          \"name\": \"C\",\n          \"status\": \"INLINED\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 3,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`fb-www 23: (JSX => createElement) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 4,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [],\n          \"message\": \"\",\n          \"name\": \"A\",\n          \"status\": \"INLINED\",\n        },\n        Object {\n          \"children\": Array [],\n          \"message\": \"\",\n          \"name\": \"B\",\n          \"status\": \"INLINED\",\n        },\n        Object {\n          \"children\": Array [],\n          \"message\": \"\",\n          \"name\": \"C\",\n          \"status\": \"INLINED\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 3,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`fb-www 23: (createElement => JSX) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 4,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [],\n          \"message\": \"\",\n          \"name\": \"A\",\n          \"status\": \"INLINED\",\n        },\n        Object {\n          \"children\": Array [],\n          \"message\": \"\",\n          \"name\": \"B\",\n          \"status\": \"INLINED\",\n        },\n        Object {\n          \"children\": Array [],\n          \"message\": \"\",\n          \"name\": \"C\",\n          \"status\": \"INLINED\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 3,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`fb-www 23: (createElement => createElement) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 4,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [],\n          \"message\": \"\",\n          \"name\": \"A\",\n          \"status\": \"INLINED\",\n        },\n        Object {\n          \"children\": Array [],\n          \"message\": \"\",\n          \"name\": \"B\",\n          \"status\": \"INLINED\",\n        },\n        Object {\n          \"children\": Array [],\n          \"message\": \"\",\n          \"name\": \"C\",\n          \"status\": \"INLINED\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 3,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`fb-www 24: (JSX => JSX) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 1,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 0,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`fb-www 24: (JSX => createElement) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 1,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 0,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`fb-www 24: (createElement => JSX) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 1,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 0,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`fb-www 24: (createElement => createElement) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 1,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 0,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`fb-www 25: (JSX => JSX) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 1,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 0,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`fb-www 25: (JSX => createElement) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 1,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 0,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`fb-www 25: (createElement => JSX) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 1,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 0,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`fb-www 25: (createElement => createElement) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 1,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 0,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`fb-www: (JSX => JSX) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 1,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [],\n          \"message\": \"\",\n          \"name\": \"QueryRenderer\",\n          \"status\": \"RENDER_PROPS\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 0,\n  \"optimizedNestedClosures\": 1,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`fb-www: (JSX => createElement) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 1,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [],\n          \"message\": \"\",\n          \"name\": \"QueryRenderer\",\n          \"status\": \"RENDER_PROPS\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 0,\n  \"optimizedNestedClosures\": 1,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`fb-www: (createElement => JSX) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 1,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [],\n          \"message\": \"\",\n          \"name\": \"QueryRenderer\",\n          \"status\": \"RENDER_PROPS\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 0,\n  \"optimizedNestedClosures\": 1,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`fb-www: (createElement => createElement) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 1,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [],\n          \"message\": \"\",\n          \"name\": \"QueryRenderer\",\n          \"status\": \"RENDER_PROPS\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 0,\n  \"optimizedNestedClosures\": 1,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`repl example: (JSX => JSX) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 7,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [\n            Object {\n              \"children\": Array [],\n              \"message\": \"\",\n              \"name\": \"Yar\",\n              \"status\": \"INLINED\",\n            },\n          ],\n          \"message\": \"\",\n          \"name\": \"Bar\",\n          \"status\": \"INLINED\",\n        },\n        Object {\n          \"children\": Array [\n            Object {\n              \"children\": Array [],\n              \"message\": \"\",\n              \"name\": \"Yar\",\n              \"status\": \"INLINED\",\n            },\n          ],\n          \"message\": \"\",\n          \"name\": \"Bar\",\n          \"status\": \"INLINED\",\n        },\n        Object {\n          \"children\": Array [\n            Object {\n              \"children\": Array [],\n              \"message\": \"\",\n              \"name\": \"Yar\",\n              \"status\": \"INLINED\",\n            },\n          ],\n          \"message\": \"\",\n          \"name\": \"Bar\",\n          \"status\": \"INLINED\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"Foo\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 6,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`repl example: (JSX => createElement) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 7,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [\n            Object {\n              \"children\": Array [],\n              \"message\": \"\",\n              \"name\": \"Yar\",\n              \"status\": \"INLINED\",\n            },\n          ],\n          \"message\": \"\",\n          \"name\": \"Bar\",\n          \"status\": \"INLINED\",\n        },\n        Object {\n          \"children\": Array [\n            Object {\n              \"children\": Array [],\n              \"message\": \"\",\n              \"name\": \"Yar\",\n              \"status\": \"INLINED\",\n            },\n          ],\n          \"message\": \"\",\n          \"name\": \"Bar\",\n          \"status\": \"INLINED\",\n        },\n        Object {\n          \"children\": Array [\n            Object {\n              \"children\": Array [],\n              \"message\": \"\",\n              \"name\": \"Yar\",\n              \"status\": \"INLINED\",\n            },\n          ],\n          \"message\": \"\",\n          \"name\": \"Bar\",\n          \"status\": \"INLINED\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"Foo\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 6,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`repl example: (createElement => JSX) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 7,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [\n            Object {\n              \"children\": Array [],\n              \"message\": \"\",\n              \"name\": \"Yar\",\n              \"status\": \"INLINED\",\n            },\n          ],\n          \"message\": \"\",\n          \"name\": \"Bar\",\n          \"status\": \"INLINED\",\n        },\n        Object {\n          \"children\": Array [\n            Object {\n              \"children\": Array [],\n              \"message\": \"\",\n              \"name\": \"Yar\",\n              \"status\": \"INLINED\",\n            },\n          ],\n          \"message\": \"\",\n          \"name\": \"Bar\",\n          \"status\": \"INLINED\",\n        },\n        Object {\n          \"children\": Array [\n            Object {\n              \"children\": Array [],\n              \"message\": \"\",\n              \"name\": \"Yar\",\n              \"status\": \"INLINED\",\n            },\n          ],\n          \"message\": \"\",\n          \"name\": \"Bar\",\n          \"status\": \"INLINED\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"Foo\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 6,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`repl example: (createElement => createElement) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 7,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [\n            Object {\n              \"children\": Array [],\n              \"message\": \"\",\n              \"name\": \"Yar\",\n              \"status\": \"INLINED\",\n            },\n          ],\n          \"message\": \"\",\n          \"name\": \"Bar\",\n          \"status\": \"INLINED\",\n        },\n        Object {\n          \"children\": Array [\n            Object {\n              \"children\": Array [],\n              \"message\": \"\",\n              \"name\": \"Yar\",\n              \"status\": \"INLINED\",\n            },\n          ],\n          \"message\": \"\",\n          \"name\": \"Bar\",\n          \"status\": \"INLINED\",\n        },\n        Object {\n          \"children\": Array [\n            Object {\n              \"children\": Array [],\n              \"message\": \"\",\n              \"name\": \"Yar\",\n              \"status\": \"INLINED\",\n            },\n          ],\n          \"message\": \"\",\n          \"name\": \"Bar\",\n          \"status\": \"INLINED\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"Foo\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 6,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n"
  },
  {
    "path": "test/react/__snapshots__/FactoryComponents-test.js.snap",
    "content": "// Jest Snapshot v1, https://goo.gl/fbAQLP\n\nexports[`Simple factory classes 2: (JSX => JSX) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 3,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [],\n          \"message\": \"non-root factory class components are not suppoted\",\n          \"name\": \"FactoryComponent\",\n          \"status\": \"BAIL-OUT\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 0,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 2,\n}\n`;\n\nexports[`Simple factory classes 2: (JSX => createElement) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 3,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [],\n          \"message\": \"non-root factory class components are not suppoted\",\n          \"name\": \"FactoryComponent\",\n          \"status\": \"BAIL-OUT\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 0,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 2,\n}\n`;\n\nexports[`Simple factory classes 2: (createElement => JSX) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 3,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [],\n          \"message\": \"non-root factory class components are not suppoted\",\n          \"name\": \"FactoryComponent\",\n          \"status\": \"BAIL-OUT\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 0,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 2,\n}\n`;\n\nexports[`Simple factory classes 2: (createElement => createElement) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 3,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [],\n          \"message\": \"non-root factory class components are not suppoted\",\n          \"name\": \"FactoryComponent\",\n          \"status\": \"BAIL-OUT\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 0,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 2,\n}\n`;\n\nexports[`Simple factory classes: (JSX => JSX) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 1,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [],\n      \"message\": \"\",\n      \"name\": \"FactoryComponent\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 0,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`Simple factory classes: (JSX => createElement) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 1,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [],\n      \"message\": \"\",\n      \"name\": \"FactoryComponent\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 0,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`Simple factory classes: (createElement => JSX) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 1,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [],\n      \"message\": \"\",\n      \"name\": \"FactoryComponent\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 0,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`Simple factory classes: (createElement => createElement) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 1,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [],\n      \"message\": \"\",\n      \"name\": \"FactoryComponent\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 0,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n"
  },
  {
    "path": "test/react/__snapshots__/FirstRenderOnly-test.js.snap",
    "content": "// Jest Snapshot v1, https://goo.gl/fbAQLP\n\nexports[`Equivalence of snapshotted node 2: (JSX => JSX) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 1,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 0,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`Equivalence of snapshotted node 2: (JSX => createElement) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 1,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 0,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`Equivalence of snapshotted node 2: (createElement => JSX) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 1,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 0,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`Equivalence of snapshotted node 2: (createElement => createElement) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 1,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 0,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`Equivalence of snapshotted node 3: (JSX => JSX) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 1,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 0,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`Equivalence of snapshotted node 3: (JSX => createElement) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 1,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 0,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`Equivalence of snapshotted node 3: (createElement => JSX) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 1,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 0,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`Equivalence of snapshotted node 3: (createElement => createElement) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 1,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 0,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`Equivalence of snapshotted node 4: (JSX => JSX) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 1,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 0,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`Equivalence of snapshotted node 4: (JSX => createElement) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 1,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 0,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`Equivalence of snapshotted node 4: (createElement => JSX) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 1,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 0,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`Equivalence of snapshotted node 4: (createElement => createElement) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 1,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 0,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`Equivalence of snapshotted node 5: (JSX => JSX) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 1,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 0,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`Equivalence of snapshotted node 5: (JSX => createElement) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 1,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 0,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`Equivalence of snapshotted node 5: (createElement => JSX) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 1,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 0,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`Equivalence of snapshotted node 5: (createElement => createElement) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 1,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 0,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`Equivalence of snapshotted node: (JSX => JSX) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 1,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 0,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`Equivalence of snapshotted node: (JSX => createElement) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 1,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 0,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`Equivalence of snapshotted node: (createElement => JSX) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 1,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 0,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`Equivalence of snapshotted node: (createElement => createElement) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 1,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 0,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`React Context 2: (JSX => JSX) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 4,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [\n            Object {\n              \"children\": Array [\n                Object {\n                  \"children\": Array [],\n                  \"message\": \"\",\n                  \"name\": \"Context.Consumer\",\n                  \"status\": \"INLINED\",\n                },\n              ],\n              \"message\": \"\",\n              \"name\": \"Child\",\n              \"status\": \"INLINED\",\n            },\n          ],\n          \"message\": \"\",\n          \"name\": \"Context.Provider\",\n          \"status\": \"INLINED\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 3,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`React Context 2: (JSX => createElement) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 4,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [\n            Object {\n              \"children\": Array [\n                Object {\n                  \"children\": Array [],\n                  \"message\": \"\",\n                  \"name\": \"Context.Consumer\",\n                  \"status\": \"INLINED\",\n                },\n              ],\n              \"message\": \"\",\n              \"name\": \"Child\",\n              \"status\": \"INLINED\",\n            },\n          ],\n          \"message\": \"\",\n          \"name\": \"Context.Provider\",\n          \"status\": \"INLINED\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 3,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`React Context 2: (createElement => JSX) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 4,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [\n            Object {\n              \"children\": Array [\n                Object {\n                  \"children\": Array [],\n                  \"message\": \"\",\n                  \"name\": \"Context.Consumer\",\n                  \"status\": \"INLINED\",\n                },\n              ],\n              \"message\": \"\",\n              \"name\": \"Child\",\n              \"status\": \"INLINED\",\n            },\n          ],\n          \"message\": \"\",\n          \"name\": \"Context.Provider\",\n          \"status\": \"INLINED\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 3,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`React Context 2: (createElement => createElement) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 4,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [\n            Object {\n              \"children\": Array [\n                Object {\n                  \"children\": Array [],\n                  \"message\": \"\",\n                  \"name\": \"Context.Consumer\",\n                  \"status\": \"INLINED\",\n                },\n              ],\n              \"message\": \"\",\n              \"name\": \"Child\",\n              \"status\": \"INLINED\",\n            },\n          ],\n          \"message\": \"\",\n          \"name\": \"Context.Provider\",\n          \"status\": \"INLINED\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 3,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`React Context 3: (JSX => JSX) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 2,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [\n            Object {\n              \"children\": Array [],\n              \"message\": \"\",\n              \"name\": \"Context.Consumer\",\n              \"status\": \"RENDER_PROPS\",\n            },\n          ],\n          \"message\": \"\",\n          \"name\": \"Child\",\n          \"status\": \"INLINED\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 1,\n  \"optimizedNestedClosures\": 1,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`React Context 3: (JSX => createElement) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 2,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [\n            Object {\n              \"children\": Array [],\n              \"message\": \"\",\n              \"name\": \"Context.Consumer\",\n              \"status\": \"RENDER_PROPS\",\n            },\n          ],\n          \"message\": \"\",\n          \"name\": \"Child\",\n          \"status\": \"INLINED\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 1,\n  \"optimizedNestedClosures\": 1,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`React Context 3: (createElement => JSX) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 2,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [\n            Object {\n              \"children\": Array [],\n              \"message\": \"\",\n              \"name\": \"Context.Consumer\",\n              \"status\": \"RENDER_PROPS\",\n            },\n          ],\n          \"message\": \"\",\n          \"name\": \"Child\",\n          \"status\": \"INLINED\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 1,\n  \"optimizedNestedClosures\": 1,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`React Context 3: (createElement => createElement) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 2,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [\n            Object {\n              \"children\": Array [],\n              \"message\": \"\",\n              \"name\": \"Context.Consumer\",\n              \"status\": \"RENDER_PROPS\",\n            },\n          ],\n          \"message\": \"\",\n          \"name\": \"Child\",\n          \"status\": \"INLINED\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 1,\n  \"optimizedNestedClosures\": 1,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`React Context 4: (JSX => JSX) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 7,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [\n            Object {\n              \"children\": Array [\n                Object {\n                  \"children\": Array [\n                    Object {\n                      \"children\": Array [],\n                      \"message\": \"\",\n                      \"name\": \"Context.Consumer\",\n                      \"status\": \"INLINED\",\n                    },\n                  ],\n                  \"message\": \"\",\n                  \"name\": \"Child\",\n                  \"status\": \"INLINED\",\n                },\n              ],\n              \"message\": \"\",\n              \"name\": \"Context.Provider\",\n              \"status\": \"INLINED\",\n            },\n            Object {\n              \"children\": Array [\n                Object {\n                  \"children\": Array [],\n                  \"message\": \"\",\n                  \"name\": \"Context.Consumer\",\n                  \"status\": \"INLINED\",\n                },\n              ],\n              \"message\": \"\",\n              \"name\": \"Child\",\n              \"status\": \"INLINED\",\n            },\n          ],\n          \"message\": \"\",\n          \"name\": \"Context.Provider\",\n          \"status\": \"INLINED\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 6,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`React Context 4: (JSX => createElement) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 7,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [\n            Object {\n              \"children\": Array [\n                Object {\n                  \"children\": Array [\n                    Object {\n                      \"children\": Array [],\n                      \"message\": \"\",\n                      \"name\": \"Context.Consumer\",\n                      \"status\": \"INLINED\",\n                    },\n                  ],\n                  \"message\": \"\",\n                  \"name\": \"Child\",\n                  \"status\": \"INLINED\",\n                },\n              ],\n              \"message\": \"\",\n              \"name\": \"Context.Provider\",\n              \"status\": \"INLINED\",\n            },\n            Object {\n              \"children\": Array [\n                Object {\n                  \"children\": Array [],\n                  \"message\": \"\",\n                  \"name\": \"Context.Consumer\",\n                  \"status\": \"INLINED\",\n                },\n              ],\n              \"message\": \"\",\n              \"name\": \"Child\",\n              \"status\": \"INLINED\",\n            },\n          ],\n          \"message\": \"\",\n          \"name\": \"Context.Provider\",\n          \"status\": \"INLINED\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 6,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`React Context 4: (createElement => JSX) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 7,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [\n            Object {\n              \"children\": Array [\n                Object {\n                  \"children\": Array [\n                    Object {\n                      \"children\": Array [],\n                      \"message\": \"\",\n                      \"name\": \"Context.Consumer\",\n                      \"status\": \"INLINED\",\n                    },\n                  ],\n                  \"message\": \"\",\n                  \"name\": \"Child\",\n                  \"status\": \"INLINED\",\n                },\n              ],\n              \"message\": \"\",\n              \"name\": \"Context.Provider\",\n              \"status\": \"INLINED\",\n            },\n            Object {\n              \"children\": Array [\n                Object {\n                  \"children\": Array [],\n                  \"message\": \"\",\n                  \"name\": \"Context.Consumer\",\n                  \"status\": \"INLINED\",\n                },\n              ],\n              \"message\": \"\",\n              \"name\": \"Child\",\n              \"status\": \"INLINED\",\n            },\n          ],\n          \"message\": \"\",\n          \"name\": \"Context.Provider\",\n          \"status\": \"INLINED\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 6,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`React Context 4: (createElement => createElement) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 7,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [\n            Object {\n              \"children\": Array [\n                Object {\n                  \"children\": Array [\n                    Object {\n                      \"children\": Array [],\n                      \"message\": \"\",\n                      \"name\": \"Context.Consumer\",\n                      \"status\": \"INLINED\",\n                    },\n                  ],\n                  \"message\": \"\",\n                  \"name\": \"Child\",\n                  \"status\": \"INLINED\",\n                },\n              ],\n              \"message\": \"\",\n              \"name\": \"Context.Provider\",\n              \"status\": \"INLINED\",\n            },\n            Object {\n              \"children\": Array [\n                Object {\n                  \"children\": Array [],\n                  \"message\": \"\",\n                  \"name\": \"Context.Consumer\",\n                  \"status\": \"INLINED\",\n                },\n              ],\n              \"message\": \"\",\n              \"name\": \"Child\",\n              \"status\": \"INLINED\",\n            },\n          ],\n          \"message\": \"\",\n          \"name\": \"Context.Provider\",\n          \"status\": \"INLINED\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 6,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`React Context 5: (JSX => JSX) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 5,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [\n            Object {\n              \"children\": Array [\n                Object {\n                  \"children\": Array [],\n                  \"message\": \"\",\n                  \"name\": \"Context.Consumer\",\n                  \"status\": \"INLINED\",\n                },\n              ],\n              \"message\": \"\",\n              \"name\": \"Child\",\n              \"status\": \"INLINED\",\n            },\n          ],\n          \"message\": \"\",\n          \"name\": \"Context.Provider\",\n          \"status\": \"INLINED\",\n        },\n        Object {\n          \"children\": Array [\n            Object {\n              \"children\": Array [],\n              \"message\": \"\",\n              \"name\": \"Context.Consumer\",\n              \"status\": \"RENDER_PROPS\",\n            },\n          ],\n          \"message\": \"\",\n          \"name\": \"Child\",\n          \"status\": \"INLINED\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 4,\n  \"optimizedNestedClosures\": 1,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`React Context 5: (JSX => createElement) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 5,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [\n            Object {\n              \"children\": Array [\n                Object {\n                  \"children\": Array [],\n                  \"message\": \"\",\n                  \"name\": \"Context.Consumer\",\n                  \"status\": \"INLINED\",\n                },\n              ],\n              \"message\": \"\",\n              \"name\": \"Child\",\n              \"status\": \"INLINED\",\n            },\n          ],\n          \"message\": \"\",\n          \"name\": \"Context.Provider\",\n          \"status\": \"INLINED\",\n        },\n        Object {\n          \"children\": Array [\n            Object {\n              \"children\": Array [],\n              \"message\": \"\",\n              \"name\": \"Context.Consumer\",\n              \"status\": \"RENDER_PROPS\",\n            },\n          ],\n          \"message\": \"\",\n          \"name\": \"Child\",\n          \"status\": \"INLINED\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 4,\n  \"optimizedNestedClosures\": 1,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`React Context 5: (createElement => JSX) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 5,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [\n            Object {\n              \"children\": Array [\n                Object {\n                  \"children\": Array [],\n                  \"message\": \"\",\n                  \"name\": \"Context.Consumer\",\n                  \"status\": \"INLINED\",\n                },\n              ],\n              \"message\": \"\",\n              \"name\": \"Child\",\n              \"status\": \"INLINED\",\n            },\n          ],\n          \"message\": \"\",\n          \"name\": \"Context.Provider\",\n          \"status\": \"INLINED\",\n        },\n        Object {\n          \"children\": Array [\n            Object {\n              \"children\": Array [],\n              \"message\": \"\",\n              \"name\": \"Context.Consumer\",\n              \"status\": \"RENDER_PROPS\",\n            },\n          ],\n          \"message\": \"\",\n          \"name\": \"Child\",\n          \"status\": \"INLINED\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 4,\n  \"optimizedNestedClosures\": 1,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`React Context 5: (createElement => createElement) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 5,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [\n            Object {\n              \"children\": Array [\n                Object {\n                  \"children\": Array [],\n                  \"message\": \"\",\n                  \"name\": \"Context.Consumer\",\n                  \"status\": \"INLINED\",\n                },\n              ],\n              \"message\": \"\",\n              \"name\": \"Child\",\n              \"status\": \"INLINED\",\n            },\n          ],\n          \"message\": \"\",\n          \"name\": \"Context.Provider\",\n          \"status\": \"INLINED\",\n        },\n        Object {\n          \"children\": Array [\n            Object {\n              \"children\": Array [],\n              \"message\": \"\",\n              \"name\": \"Context.Consumer\",\n              \"status\": \"RENDER_PROPS\",\n            },\n          ],\n          \"message\": \"\",\n          \"name\": \"Child\",\n          \"status\": \"INLINED\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 4,\n  \"optimizedNestedClosures\": 1,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`React Context 6: (JSX => JSX) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 7,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [\n            Object {\n              \"children\": Array [\n                Object {\n                  \"children\": Array [],\n                  \"message\": \"\",\n                  \"name\": \"Context.Consumer\",\n                  \"status\": \"INLINED\",\n                },\n                Object {\n                  \"children\": Array [],\n                  \"message\": \"\",\n                  \"name\": \"Child2\",\n                  \"status\": \"INLINED\",\n                },\n              ],\n              \"message\": \"\",\n              \"name\": \"Child\",\n              \"status\": \"INLINED\",\n            },\n          ],\n          \"message\": \"\",\n          \"name\": \"Context.Provider\",\n          \"status\": \"INLINED\",\n        },\n        Object {\n          \"children\": Array [\n            Object {\n              \"children\": Array [\n                Object {\n                  \"children\": Array [],\n                  \"message\": \"\",\n                  \"name\": \"Child2\",\n                  \"status\": \"INLINED\",\n                },\n              ],\n              \"message\": \"\",\n              \"name\": \"Context.Consumer\",\n              \"status\": \"RENDER_PROPS\",\n            },\n          ],\n          \"message\": \"\",\n          \"name\": \"Child\",\n          \"status\": \"INLINED\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 6,\n  \"optimizedNestedClosures\": 1,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`React Context 6: (JSX => createElement) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 7,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [\n            Object {\n              \"children\": Array [\n                Object {\n                  \"children\": Array [],\n                  \"message\": \"\",\n                  \"name\": \"Context.Consumer\",\n                  \"status\": \"INLINED\",\n                },\n                Object {\n                  \"children\": Array [],\n                  \"message\": \"\",\n                  \"name\": \"Child2\",\n                  \"status\": \"INLINED\",\n                },\n              ],\n              \"message\": \"\",\n              \"name\": \"Child\",\n              \"status\": \"INLINED\",\n            },\n          ],\n          \"message\": \"\",\n          \"name\": \"Context.Provider\",\n          \"status\": \"INLINED\",\n        },\n        Object {\n          \"children\": Array [\n            Object {\n              \"children\": Array [\n                Object {\n                  \"children\": Array [],\n                  \"message\": \"\",\n                  \"name\": \"Child2\",\n                  \"status\": \"INLINED\",\n                },\n              ],\n              \"message\": \"\",\n              \"name\": \"Context.Consumer\",\n              \"status\": \"RENDER_PROPS\",\n            },\n          ],\n          \"message\": \"\",\n          \"name\": \"Child\",\n          \"status\": \"INLINED\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 6,\n  \"optimizedNestedClosures\": 1,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`React Context 6: (createElement => JSX) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 7,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [\n            Object {\n              \"children\": Array [\n                Object {\n                  \"children\": Array [],\n                  \"message\": \"\",\n                  \"name\": \"Context.Consumer\",\n                  \"status\": \"INLINED\",\n                },\n                Object {\n                  \"children\": Array [],\n                  \"message\": \"\",\n                  \"name\": \"Child2\",\n                  \"status\": \"INLINED\",\n                },\n              ],\n              \"message\": \"\",\n              \"name\": \"Child\",\n              \"status\": \"INLINED\",\n            },\n          ],\n          \"message\": \"\",\n          \"name\": \"Context.Provider\",\n          \"status\": \"INLINED\",\n        },\n        Object {\n          \"children\": Array [\n            Object {\n              \"children\": Array [\n                Object {\n                  \"children\": Array [],\n                  \"message\": \"\",\n                  \"name\": \"Child2\",\n                  \"status\": \"INLINED\",\n                },\n              ],\n              \"message\": \"\",\n              \"name\": \"Context.Consumer\",\n              \"status\": \"RENDER_PROPS\",\n            },\n          ],\n          \"message\": \"\",\n          \"name\": \"Child\",\n          \"status\": \"INLINED\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 6,\n  \"optimizedNestedClosures\": 1,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`React Context 6: (createElement => createElement) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 7,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [\n            Object {\n              \"children\": Array [\n                Object {\n                  \"children\": Array [],\n                  \"message\": \"\",\n                  \"name\": \"Context.Consumer\",\n                  \"status\": \"INLINED\",\n                },\n                Object {\n                  \"children\": Array [],\n                  \"message\": \"\",\n                  \"name\": \"Child2\",\n                  \"status\": \"INLINED\",\n                },\n              ],\n              \"message\": \"\",\n              \"name\": \"Child\",\n              \"status\": \"INLINED\",\n            },\n          ],\n          \"message\": \"\",\n          \"name\": \"Context.Provider\",\n          \"status\": \"INLINED\",\n        },\n        Object {\n          \"children\": Array [\n            Object {\n              \"children\": Array [\n                Object {\n                  \"children\": Array [],\n                  \"message\": \"\",\n                  \"name\": \"Child2\",\n                  \"status\": \"INLINED\",\n                },\n              ],\n              \"message\": \"\",\n              \"name\": \"Context.Consumer\",\n              \"status\": \"RENDER_PROPS\",\n            },\n          ],\n          \"message\": \"\",\n          \"name\": \"Child\",\n          \"status\": \"INLINED\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 6,\n  \"optimizedNestedClosures\": 1,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`React Context: (JSX => JSX) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 4,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [\n            Object {\n              \"children\": Array [\n                Object {\n                  \"children\": Array [],\n                  \"message\": \"\",\n                  \"name\": \"Context.Consumer\",\n                  \"status\": \"INLINED\",\n                },\n              ],\n              \"message\": \"\",\n              \"name\": \"Child\",\n              \"status\": \"INLINED\",\n            },\n          ],\n          \"message\": \"\",\n          \"name\": \"Context.Provider\",\n          \"status\": \"INLINED\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 3,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`React Context: (JSX => createElement) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 4,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [\n            Object {\n              \"children\": Array [\n                Object {\n                  \"children\": Array [],\n                  \"message\": \"\",\n                  \"name\": \"Context.Consumer\",\n                  \"status\": \"INLINED\",\n                },\n              ],\n              \"message\": \"\",\n              \"name\": \"Child\",\n              \"status\": \"INLINED\",\n            },\n          ],\n          \"message\": \"\",\n          \"name\": \"Context.Provider\",\n          \"status\": \"INLINED\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 3,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`React Context: (createElement => JSX) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 4,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [\n            Object {\n              \"children\": Array [\n                Object {\n                  \"children\": Array [],\n                  \"message\": \"\",\n                  \"name\": \"Context.Consumer\",\n                  \"status\": \"INLINED\",\n                },\n              ],\n              \"message\": \"\",\n              \"name\": \"Child\",\n              \"status\": \"INLINED\",\n            },\n          ],\n          \"message\": \"\",\n          \"name\": \"Context.Provider\",\n          \"status\": \"INLINED\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 3,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`React Context: (createElement => createElement) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 4,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [\n            Object {\n              \"children\": Array [\n                Object {\n                  \"children\": Array [],\n                  \"message\": \"\",\n                  \"name\": \"Context.Consumer\",\n                  \"status\": \"INLINED\",\n                },\n              ],\n              \"message\": \"\",\n              \"name\": \"Child\",\n              \"status\": \"INLINED\",\n            },\n          ],\n          \"message\": \"\",\n          \"name\": \"Context.Provider\",\n          \"status\": \"INLINED\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 3,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`Replace this in callbacks 2: (JSX => JSX) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 2,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [],\n          \"message\": \"\",\n          \"name\": \"Child1\",\n          \"status\": \"INLINED\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 1,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`Replace this in callbacks 2: (JSX => createElement) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 2,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [],\n          \"message\": \"\",\n          \"name\": \"Child1\",\n          \"status\": \"INLINED\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 1,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`Replace this in callbacks 2: (createElement => JSX) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 2,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [],\n          \"message\": \"\",\n          \"name\": \"Child1\",\n          \"status\": \"INLINED\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 1,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`Replace this in callbacks 2: (createElement => createElement) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 2,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [],\n          \"message\": \"\",\n          \"name\": \"Child1\",\n          \"status\": \"INLINED\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 1,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`Replace this in callbacks 3: (JSX => JSX) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 2,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [],\n          \"message\": \"\",\n          \"name\": \"Child1\",\n          \"status\": \"INLINED\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 1,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`Replace this in callbacks 3: (JSX => createElement) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 2,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [],\n          \"message\": \"\",\n          \"name\": \"Child1\",\n          \"status\": \"INLINED\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 1,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`Replace this in callbacks 3: (createElement => JSX) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 2,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [],\n          \"message\": \"\",\n          \"name\": \"Child1\",\n          \"status\": \"INLINED\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 1,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`Replace this in callbacks 3: (createElement => createElement) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 2,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [],\n          \"message\": \"\",\n          \"name\": \"Child1\",\n          \"status\": \"INLINED\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 1,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`Simple #2: (JSX => JSX) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 2,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [],\n          \"message\": \"\",\n          \"name\": \"A\",\n          \"status\": \"INLINED\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 1,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`Simple #2: (JSX => createElement) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 2,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [],\n          \"message\": \"\",\n          \"name\": \"A\",\n          \"status\": \"INLINED\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 1,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`Simple #2: (createElement => JSX) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 2,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [],\n          \"message\": \"\",\n          \"name\": \"A\",\n          \"status\": \"INLINED\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 1,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`Simple #2: (createElement => createElement) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 2,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [],\n          \"message\": \"\",\n          \"name\": \"A\",\n          \"status\": \"INLINED\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 1,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`Simple #3: (JSX => JSX) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 1,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 0,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`Simple #3: (JSX => createElement) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 1,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 0,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`Simple #3: (createElement => JSX) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 1,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 0,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`Simple #3: (createElement => createElement) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 1,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 0,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`Simple #4: (JSX => JSX) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 1,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 0,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`Simple #4: (JSX => createElement) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 1,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 0,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`Simple #4: (createElement => JSX) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 1,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 0,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`Simple #4: (createElement => createElement) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 1,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 0,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`Simple: (JSX => JSX) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 5,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [\n            Object {\n              \"children\": Array [\n                Object {\n                  \"children\": Array [\n                    Object {\n                      \"children\": Array [],\n                      \"message\": \"\",\n                      \"name\": \"Child3\",\n                      \"status\": \"INLINED\",\n                    },\n                  ],\n                  \"message\": \"\",\n                  \"name\": \"React.Fragment\",\n                  \"status\": \"INLINED\",\n                },\n              ],\n              \"message\": \"\",\n              \"name\": \"Child2\",\n              \"status\": \"INLINED\",\n            },\n          ],\n          \"message\": \"\",\n          \"name\": \"Child1\",\n          \"status\": \"INLINED\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 4,\n  \"optimizedNestedClosures\": 1,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`Simple: (JSX => createElement) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 5,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [\n            Object {\n              \"children\": Array [\n                Object {\n                  \"children\": Array [\n                    Object {\n                      \"children\": Array [],\n                      \"message\": \"\",\n                      \"name\": \"Child3\",\n                      \"status\": \"INLINED\",\n                    },\n                  ],\n                  \"message\": \"\",\n                  \"name\": \"React.Fragment\",\n                  \"status\": \"INLINED\",\n                },\n              ],\n              \"message\": \"\",\n              \"name\": \"Child2\",\n              \"status\": \"INLINED\",\n            },\n          ],\n          \"message\": \"\",\n          \"name\": \"Child1\",\n          \"status\": \"INLINED\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 4,\n  \"optimizedNestedClosures\": 1,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`Simple: (createElement => JSX) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 5,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [\n            Object {\n              \"children\": Array [\n                Object {\n                  \"children\": Array [\n                    Object {\n                      \"children\": Array [],\n                      \"message\": \"\",\n                      \"name\": \"Child3\",\n                      \"status\": \"INLINED\",\n                    },\n                  ],\n                  \"message\": \"\",\n                  \"name\": \"React.Fragment\",\n                  \"status\": \"INLINED\",\n                },\n              ],\n              \"message\": \"\",\n              \"name\": \"Child2\",\n              \"status\": \"INLINED\",\n            },\n          ],\n          \"message\": \"\",\n          \"name\": \"Child1\",\n          \"status\": \"INLINED\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 4,\n  \"optimizedNestedClosures\": 1,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`Simple: (createElement => createElement) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 5,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [\n            Object {\n              \"children\": Array [\n                Object {\n                  \"children\": Array [\n                    Object {\n                      \"children\": Array [],\n                      \"message\": \"\",\n                      \"name\": \"Child3\",\n                      \"status\": \"INLINED\",\n                    },\n                  ],\n                  \"message\": \"\",\n                  \"name\": \"React.Fragment\",\n                  \"status\": \"INLINED\",\n                },\n              ],\n              \"message\": \"\",\n              \"name\": \"Child2\",\n              \"status\": \"INLINED\",\n            },\n          ],\n          \"message\": \"\",\n          \"name\": \"Child1\",\n          \"status\": \"INLINED\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 4,\n  \"optimizedNestedClosures\": 1,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`componentWillMount: (JSX => JSX) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 5,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [\n            Object {\n              \"children\": Array [\n                Object {\n                  \"children\": Array [\n                    Object {\n                      \"children\": Array [],\n                      \"message\": \"\",\n                      \"name\": \"Child3\",\n                      \"status\": \"INLINED\",\n                    },\n                  ],\n                  \"message\": \"\",\n                  \"name\": \"React.Fragment\",\n                  \"status\": \"INLINED\",\n                },\n              ],\n              \"message\": \"\",\n              \"name\": \"Child2\",\n              \"status\": \"INLINED\",\n            },\n          ],\n          \"message\": \"\",\n          \"name\": \"Child1\",\n          \"status\": \"INLINED\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 4,\n  \"optimizedNestedClosures\": 1,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`componentWillMount: (JSX => createElement) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 5,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [\n            Object {\n              \"children\": Array [\n                Object {\n                  \"children\": Array [\n                    Object {\n                      \"children\": Array [],\n                      \"message\": \"\",\n                      \"name\": \"Child3\",\n                      \"status\": \"INLINED\",\n                    },\n                  ],\n                  \"message\": \"\",\n                  \"name\": \"React.Fragment\",\n                  \"status\": \"INLINED\",\n                },\n              ],\n              \"message\": \"\",\n              \"name\": \"Child2\",\n              \"status\": \"INLINED\",\n            },\n          ],\n          \"message\": \"\",\n          \"name\": \"Child1\",\n          \"status\": \"INLINED\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 4,\n  \"optimizedNestedClosures\": 1,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`componentWillMount: (createElement => JSX) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 5,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [\n            Object {\n              \"children\": Array [\n                Object {\n                  \"children\": Array [\n                    Object {\n                      \"children\": Array [],\n                      \"message\": \"\",\n                      \"name\": \"Child3\",\n                      \"status\": \"INLINED\",\n                    },\n                  ],\n                  \"message\": \"\",\n                  \"name\": \"React.Fragment\",\n                  \"status\": \"INLINED\",\n                },\n              ],\n              \"message\": \"\",\n              \"name\": \"Child2\",\n              \"status\": \"INLINED\",\n            },\n          ],\n          \"message\": \"\",\n          \"name\": \"Child1\",\n          \"status\": \"INLINED\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 4,\n  \"optimizedNestedClosures\": 1,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`componentWillMount: (createElement => createElement) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 5,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [\n            Object {\n              \"children\": Array [\n                Object {\n                  \"children\": Array [\n                    Object {\n                      \"children\": Array [],\n                      \"message\": \"\",\n                      \"name\": \"Child3\",\n                      \"status\": \"INLINED\",\n                    },\n                  ],\n                  \"message\": \"\",\n                  \"name\": \"React.Fragment\",\n                  \"status\": \"INLINED\",\n                },\n              ],\n              \"message\": \"\",\n              \"name\": \"Child2\",\n              \"status\": \"INLINED\",\n            },\n          ],\n          \"message\": \"\",\n          \"name\": \"Child1\",\n          \"status\": \"INLINED\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 4,\n  \"optimizedNestedClosures\": 1,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`getDerivedStateFromProps 2: (JSX => JSX) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 5,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [\n            Object {\n              \"children\": Array [\n                Object {\n                  \"children\": Array [\n                    Object {\n                      \"children\": Array [],\n                      \"message\": \"\",\n                      \"name\": \"Child3\",\n                      \"status\": \"INLINED\",\n                    },\n                  ],\n                  \"message\": \"\",\n                  \"name\": \"React.Fragment\",\n                  \"status\": \"INLINED\",\n                },\n              ],\n              \"message\": \"\",\n              \"name\": \"Child2\",\n              \"status\": \"INLINED\",\n            },\n          ],\n          \"message\": \"\",\n          \"name\": \"Child1\",\n          \"status\": \"INLINED\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 4,\n  \"optimizedNestedClosures\": 1,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`getDerivedStateFromProps 2: (JSX => createElement) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 5,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [\n            Object {\n              \"children\": Array [\n                Object {\n                  \"children\": Array [\n                    Object {\n                      \"children\": Array [],\n                      \"message\": \"\",\n                      \"name\": \"Child3\",\n                      \"status\": \"INLINED\",\n                    },\n                  ],\n                  \"message\": \"\",\n                  \"name\": \"React.Fragment\",\n                  \"status\": \"INLINED\",\n                },\n              ],\n              \"message\": \"\",\n              \"name\": \"Child2\",\n              \"status\": \"INLINED\",\n            },\n          ],\n          \"message\": \"\",\n          \"name\": \"Child1\",\n          \"status\": \"INLINED\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 4,\n  \"optimizedNestedClosures\": 1,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`getDerivedStateFromProps 2: (createElement => JSX) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 5,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [\n            Object {\n              \"children\": Array [\n                Object {\n                  \"children\": Array [\n                    Object {\n                      \"children\": Array [],\n                      \"message\": \"\",\n                      \"name\": \"Child3\",\n                      \"status\": \"INLINED\",\n                    },\n                  ],\n                  \"message\": \"\",\n                  \"name\": \"React.Fragment\",\n                  \"status\": \"INLINED\",\n                },\n              ],\n              \"message\": \"\",\n              \"name\": \"Child2\",\n              \"status\": \"INLINED\",\n            },\n          ],\n          \"message\": \"\",\n          \"name\": \"Child1\",\n          \"status\": \"INLINED\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 4,\n  \"optimizedNestedClosures\": 1,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`getDerivedStateFromProps 2: (createElement => createElement) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 5,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [\n            Object {\n              \"children\": Array [\n                Object {\n                  \"children\": Array [\n                    Object {\n                      \"children\": Array [],\n                      \"message\": \"\",\n                      \"name\": \"Child3\",\n                      \"status\": \"INLINED\",\n                    },\n                  ],\n                  \"message\": \"\",\n                  \"name\": \"React.Fragment\",\n                  \"status\": \"INLINED\",\n                },\n              ],\n              \"message\": \"\",\n              \"name\": \"Child2\",\n              \"status\": \"INLINED\",\n            },\n          ],\n          \"message\": \"\",\n          \"name\": \"Child1\",\n          \"status\": \"INLINED\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 4,\n  \"optimizedNestedClosures\": 1,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`getDerivedStateFromProps 3: (JSX => JSX) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 5,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [\n            Object {\n              \"children\": Array [\n                Object {\n                  \"children\": Array [\n                    Object {\n                      \"children\": Array [],\n                      \"message\": \"\",\n                      \"name\": \"Child3\",\n                      \"status\": \"INLINED\",\n                    },\n                  ],\n                  \"message\": \"\",\n                  \"name\": \"React.Fragment\",\n                  \"status\": \"INLINED\",\n                },\n              ],\n              \"message\": \"\",\n              \"name\": \"Child2\",\n              \"status\": \"INLINED\",\n            },\n          ],\n          \"message\": \"\",\n          \"name\": \"Child1\",\n          \"status\": \"INLINED\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 4,\n  \"optimizedNestedClosures\": 1,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`getDerivedStateFromProps 3: (JSX => createElement) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 5,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [\n            Object {\n              \"children\": Array [\n                Object {\n                  \"children\": Array [\n                    Object {\n                      \"children\": Array [],\n                      \"message\": \"\",\n                      \"name\": \"Child3\",\n                      \"status\": \"INLINED\",\n                    },\n                  ],\n                  \"message\": \"\",\n                  \"name\": \"React.Fragment\",\n                  \"status\": \"INLINED\",\n                },\n              ],\n              \"message\": \"\",\n              \"name\": \"Child2\",\n              \"status\": \"INLINED\",\n            },\n          ],\n          \"message\": \"\",\n          \"name\": \"Child1\",\n          \"status\": \"INLINED\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 4,\n  \"optimizedNestedClosures\": 1,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`getDerivedStateFromProps 3: (createElement => JSX) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 5,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [\n            Object {\n              \"children\": Array [\n                Object {\n                  \"children\": Array [\n                    Object {\n                      \"children\": Array [],\n                      \"message\": \"\",\n                      \"name\": \"Child3\",\n                      \"status\": \"INLINED\",\n                    },\n                  ],\n                  \"message\": \"\",\n                  \"name\": \"React.Fragment\",\n                  \"status\": \"INLINED\",\n                },\n              ],\n              \"message\": \"\",\n              \"name\": \"Child2\",\n              \"status\": \"INLINED\",\n            },\n          ],\n          \"message\": \"\",\n          \"name\": \"Child1\",\n          \"status\": \"INLINED\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 4,\n  \"optimizedNestedClosures\": 1,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`getDerivedStateFromProps 3: (createElement => createElement) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 5,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [\n            Object {\n              \"children\": Array [\n                Object {\n                  \"children\": Array [\n                    Object {\n                      \"children\": Array [],\n                      \"message\": \"\",\n                      \"name\": \"Child3\",\n                      \"status\": \"INLINED\",\n                    },\n                  ],\n                  \"message\": \"\",\n                  \"name\": \"React.Fragment\",\n                  \"status\": \"INLINED\",\n                },\n              ],\n              \"message\": \"\",\n              \"name\": \"Child2\",\n              \"status\": \"INLINED\",\n            },\n          ],\n          \"message\": \"\",\n          \"name\": \"Child1\",\n          \"status\": \"INLINED\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 4,\n  \"optimizedNestedClosures\": 1,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`getDerivedStateFromProps 4: (JSX => JSX) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 5,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [\n            Object {\n              \"children\": Array [\n                Object {\n                  \"children\": Array [\n                    Object {\n                      \"children\": Array [],\n                      \"message\": \"\",\n                      \"name\": \"Child3\",\n                      \"status\": \"INLINED\",\n                    },\n                  ],\n                  \"message\": \"\",\n                  \"name\": \"React.Fragment\",\n                  \"status\": \"INLINED\",\n                },\n              ],\n              \"message\": \"\",\n              \"name\": \"Child2\",\n              \"status\": \"INLINED\",\n            },\n          ],\n          \"message\": \"\",\n          \"name\": \"Child1\",\n          \"status\": \"INLINED\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 4,\n  \"optimizedNestedClosures\": 1,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`getDerivedStateFromProps 4: (JSX => createElement) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 5,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [\n            Object {\n              \"children\": Array [\n                Object {\n                  \"children\": Array [\n                    Object {\n                      \"children\": Array [],\n                      \"message\": \"\",\n                      \"name\": \"Child3\",\n                      \"status\": \"INLINED\",\n                    },\n                  ],\n                  \"message\": \"\",\n                  \"name\": \"React.Fragment\",\n                  \"status\": \"INLINED\",\n                },\n              ],\n              \"message\": \"\",\n              \"name\": \"Child2\",\n              \"status\": \"INLINED\",\n            },\n          ],\n          \"message\": \"\",\n          \"name\": \"Child1\",\n          \"status\": \"INLINED\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 4,\n  \"optimizedNestedClosures\": 1,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`getDerivedStateFromProps 4: (createElement => JSX) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 5,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [\n            Object {\n              \"children\": Array [\n                Object {\n                  \"children\": Array [\n                    Object {\n                      \"children\": Array [],\n                      \"message\": \"\",\n                      \"name\": \"Child3\",\n                      \"status\": \"INLINED\",\n                    },\n                  ],\n                  \"message\": \"\",\n                  \"name\": \"React.Fragment\",\n                  \"status\": \"INLINED\",\n                },\n              ],\n              \"message\": \"\",\n              \"name\": \"Child2\",\n              \"status\": \"INLINED\",\n            },\n          ],\n          \"message\": \"\",\n          \"name\": \"Child1\",\n          \"status\": \"INLINED\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 4,\n  \"optimizedNestedClosures\": 1,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`getDerivedStateFromProps 4: (createElement => createElement) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 5,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [\n            Object {\n              \"children\": Array [\n                Object {\n                  \"children\": Array [\n                    Object {\n                      \"children\": Array [],\n                      \"message\": \"\",\n                      \"name\": \"Child3\",\n                      \"status\": \"INLINED\",\n                    },\n                  ],\n                  \"message\": \"\",\n                  \"name\": \"React.Fragment\",\n                  \"status\": \"INLINED\",\n                },\n              ],\n              \"message\": \"\",\n              \"name\": \"Child2\",\n              \"status\": \"INLINED\",\n            },\n          ],\n          \"message\": \"\",\n          \"name\": \"Child1\",\n          \"status\": \"INLINED\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 4,\n  \"optimizedNestedClosures\": 1,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`getDerivedStateFromProps 5: (JSX => JSX) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 1,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [],\n      \"message\": \"\",\n      \"name\": \"MyComponent\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 0,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`getDerivedStateFromProps 5: (JSX => createElement) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 1,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [],\n      \"message\": \"\",\n      \"name\": \"MyComponent\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 0,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`getDerivedStateFromProps 5: (createElement => JSX) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 1,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [],\n      \"message\": \"\",\n      \"name\": \"MyComponent\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 0,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`getDerivedStateFromProps 5: (createElement => createElement) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 1,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [],\n      \"message\": \"\",\n      \"name\": \"MyComponent\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 0,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`getDerivedStateFromProps: (JSX => JSX) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 5,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [\n            Object {\n              \"children\": Array [\n                Object {\n                  \"children\": Array [\n                    Object {\n                      \"children\": Array [],\n                      \"message\": \"\",\n                      \"name\": \"Child3\",\n                      \"status\": \"INLINED\",\n                    },\n                  ],\n                  \"message\": \"\",\n                  \"name\": \"React.Fragment\",\n                  \"status\": \"INLINED\",\n                },\n              ],\n              \"message\": \"\",\n              \"name\": \"Child2\",\n              \"status\": \"INLINED\",\n            },\n          ],\n          \"message\": \"\",\n          \"name\": \"Child1\",\n          \"status\": \"INLINED\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 4,\n  \"optimizedNestedClosures\": 1,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`getDerivedStateFromProps: (JSX => createElement) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 5,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [\n            Object {\n              \"children\": Array [\n                Object {\n                  \"children\": Array [\n                    Object {\n                      \"children\": Array [],\n                      \"message\": \"\",\n                      \"name\": \"Child3\",\n                      \"status\": \"INLINED\",\n                    },\n                  ],\n                  \"message\": \"\",\n                  \"name\": \"React.Fragment\",\n                  \"status\": \"INLINED\",\n                },\n              ],\n              \"message\": \"\",\n              \"name\": \"Child2\",\n              \"status\": \"INLINED\",\n            },\n          ],\n          \"message\": \"\",\n          \"name\": \"Child1\",\n          \"status\": \"INLINED\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 4,\n  \"optimizedNestedClosures\": 1,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`getDerivedStateFromProps: (createElement => JSX) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 5,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [\n            Object {\n              \"children\": Array [\n                Object {\n                  \"children\": Array [\n                    Object {\n                      \"children\": Array [],\n                      \"message\": \"\",\n                      \"name\": \"Child3\",\n                      \"status\": \"INLINED\",\n                    },\n                  ],\n                  \"message\": \"\",\n                  \"name\": \"React.Fragment\",\n                  \"status\": \"INLINED\",\n                },\n              ],\n              \"message\": \"\",\n              \"name\": \"Child2\",\n              \"status\": \"INLINED\",\n            },\n          ],\n          \"message\": \"\",\n          \"name\": \"Child1\",\n          \"status\": \"INLINED\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 4,\n  \"optimizedNestedClosures\": 1,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`getDerivedStateFromProps: (createElement => createElement) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 5,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [\n            Object {\n              \"children\": Array [\n                Object {\n                  \"children\": Array [\n                    Object {\n                      \"children\": Array [],\n                      \"message\": \"\",\n                      \"name\": \"Child3\",\n                      \"status\": \"INLINED\",\n                    },\n                  ],\n                  \"message\": \"\",\n                  \"name\": \"React.Fragment\",\n                  \"status\": \"INLINED\",\n                },\n              ],\n              \"message\": \"\",\n              \"name\": \"Child2\",\n              \"status\": \"INLINED\",\n            },\n          ],\n          \"message\": \"\",\n          \"name\": \"Child1\",\n          \"status\": \"INLINED\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 4,\n  \"optimizedNestedClosures\": 1,\n  \"optimizedTrees\": 1,\n}\n`;\n"
  },
  {
    "path": "test/react/__snapshots__/FunctionalComponents-test.js.snap",
    "content": "// Jest Snapshot v1, https://goo.gl/fbAQLP\n\nexports[`__reactCompilerDoNotOptimize: (JSX => JSX) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 1,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 0,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`__reactCompilerDoNotOptimize: (JSX => createElement) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 1,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 0,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`__reactCompilerDoNotOptimize: (createElement => JSX) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 1,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 0,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`__reactCompilerDoNotOptimize: (createElement => createElement) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 1,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 0,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`16.3 refs 2: (JSX => JSX) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 2,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [\n            Object {\n              \"children\": Array [],\n              \"message\": \"\",\n              \"name\": \"Child\",\n              \"status\": \"INLINED\",\n            },\n          ],\n          \"message\": \"\",\n          \"name\": \"\",\n          \"status\": \"FORWARD_REF\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 1,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`16.3 refs 2: (JSX => createElement) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 2,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [\n            Object {\n              \"children\": Array [],\n              \"message\": \"\",\n              \"name\": \"Child\",\n              \"status\": \"INLINED\",\n            },\n          ],\n          \"message\": \"\",\n          \"name\": \"\",\n          \"status\": \"FORWARD_REF\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 1,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`16.3 refs 2: (createElement => JSX) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 2,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [\n            Object {\n              \"children\": Array [],\n              \"message\": \"\",\n              \"name\": \"Child\",\n              \"status\": \"INLINED\",\n            },\n          ],\n          \"message\": \"\",\n          \"name\": \"\",\n          \"status\": \"FORWARD_REF\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 1,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`16.3 refs 2: (createElement => createElement) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 2,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [\n            Object {\n              \"children\": Array [],\n              \"message\": \"\",\n              \"name\": \"Child\",\n              \"status\": \"INLINED\",\n            },\n          ],\n          \"message\": \"\",\n          \"name\": \"\",\n          \"status\": \"FORWARD_REF\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 1,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`16.3 refs 3: (JSX => JSX) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 4,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [\n            Object {\n              \"children\": Array [\n                Object {\n                  \"children\": Array [],\n                  \"message\": \"\",\n                  \"name\": \"ClassComponent\",\n                  \"status\": \"NEW_TREE\",\n                },\n              ],\n              \"message\": \"\",\n              \"name\": \"Child\",\n              \"status\": \"INLINED\",\n            },\n          ],\n          \"message\": \"\",\n          \"name\": \"\",\n          \"status\": \"FORWARD_REF\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 1,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 2,\n}\n`;\n\nexports[`16.3 refs 3: (JSX => createElement) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 4,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [\n            Object {\n              \"children\": Array [\n                Object {\n                  \"children\": Array [],\n                  \"message\": \"\",\n                  \"name\": \"ClassComponent\",\n                  \"status\": \"NEW_TREE\",\n                },\n              ],\n              \"message\": \"\",\n              \"name\": \"Child\",\n              \"status\": \"INLINED\",\n            },\n          ],\n          \"message\": \"\",\n          \"name\": \"\",\n          \"status\": \"FORWARD_REF\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 1,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 2,\n}\n`;\n\nexports[`16.3 refs 3: (createElement => JSX) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 4,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [\n            Object {\n              \"children\": Array [\n                Object {\n                  \"children\": Array [],\n                  \"message\": \"\",\n                  \"name\": \"ClassComponent\",\n                  \"status\": \"NEW_TREE\",\n                },\n              ],\n              \"message\": \"\",\n              \"name\": \"Child\",\n              \"status\": \"INLINED\",\n            },\n          ],\n          \"message\": \"\",\n          \"name\": \"\",\n          \"status\": \"FORWARD_REF\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 1,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 2,\n}\n`;\n\nexports[`16.3 refs 3: (createElement => createElement) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 4,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [\n            Object {\n              \"children\": Array [\n                Object {\n                  \"children\": Array [],\n                  \"message\": \"\",\n                  \"name\": \"ClassComponent\",\n                  \"status\": \"NEW_TREE\",\n                },\n              ],\n              \"message\": \"\",\n              \"name\": \"Child\",\n              \"status\": \"INLINED\",\n            },\n          ],\n          \"message\": \"\",\n          \"name\": \"\",\n          \"status\": \"FORWARD_REF\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 1,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 2,\n}\n`;\n\nexports[`16.3 refs: (JSX => JSX) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 2,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [\n            Object {\n              \"children\": Array [],\n              \"message\": \"\",\n              \"name\": \"Child\",\n              \"status\": \"INLINED\",\n            },\n          ],\n          \"message\": \"\",\n          \"name\": \"\",\n          \"status\": \"FORWARD_REF\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 1,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`16.3 refs: (JSX => createElement) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 2,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [\n            Object {\n              \"children\": Array [],\n              \"message\": \"\",\n              \"name\": \"Child\",\n              \"status\": \"INLINED\",\n            },\n          ],\n          \"message\": \"\",\n          \"name\": \"\",\n          \"status\": \"FORWARD_REF\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 1,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`16.3 refs: (createElement => JSX) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 2,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [\n            Object {\n              \"children\": Array [],\n              \"message\": \"\",\n              \"name\": \"Child\",\n              \"status\": \"INLINED\",\n            },\n          ],\n          \"message\": \"\",\n          \"name\": \"\",\n          \"status\": \"FORWARD_REF\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 1,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`16.3 refs: (createElement => createElement) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 2,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [\n            Object {\n              \"children\": Array [],\n              \"message\": \"\",\n              \"name\": \"Child\",\n              \"status\": \"INLINED\",\n            },\n          ],\n          \"message\": \"\",\n          \"name\": \"\",\n          \"status\": \"FORWARD_REF\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 1,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`Additional functions closure scope capturing: (JSX => JSX) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 1,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 0,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`Additional functions closure scope capturing: (JSX => createElement) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 1,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 0,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`Additional functions closure scope capturing: (createElement => JSX) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 1,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 0,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`Additional functions closure scope capturing: (createElement => createElement) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 1,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 0,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`Bound type 2: (JSX => JSX) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 1,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [],\n      \"message\": \"\",\n      \"name\": \"bound anonymous\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 0,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`Bound type 2: (JSX => createElement) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 1,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [],\n      \"message\": \"\",\n      \"name\": \"bound anonymous\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 0,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`Bound type 2: (createElement => JSX) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 1,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [],\n      \"message\": \"\",\n      \"name\": \"bound anonymous\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 0,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`Bound type 2: (createElement => createElement) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 1,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [],\n      \"message\": \"\",\n      \"name\": \"bound anonymous\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 0,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`Bound type: (JSX => JSX) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 2,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [],\n          \"message\": \"\",\n          \"name\": \"bound anonymous\",\n          \"status\": \"INLINED\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 1,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`Bound type: (JSX => createElement) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 2,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [],\n          \"message\": \"\",\n          \"name\": \"bound anonymous\",\n          \"status\": \"INLINED\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 1,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`Bound type: (createElement => JSX) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 2,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [],\n          \"message\": \"\",\n          \"name\": \"bound anonymous\",\n          \"status\": \"INLINED\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 1,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`Bound type: (createElement => createElement) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 2,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [],\n          \"message\": \"\",\n          \"name\": \"bound anonymous\",\n          \"status\": \"INLINED\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 1,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`Circular reference: (JSX => JSX) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 1,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 0,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`Circular reference: (JSX => createElement) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 1,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 0,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`Circular reference: (createElement => JSX) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 1,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 0,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`Circular reference: (createElement => createElement) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 1,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 0,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`Class component as root with instance variables #2: (JSX => JSX) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 3,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [\n            Object {\n              \"children\": Array [],\n              \"message\": \"\",\n              \"name\": \"SubChild\",\n              \"status\": \"INLINED\",\n            },\n          ],\n          \"message\": \"\",\n          \"name\": \"Child\",\n          \"status\": \"INLINED\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 2,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`Class component as root with instance variables #2: (JSX => createElement) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 3,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [\n            Object {\n              \"children\": Array [],\n              \"message\": \"\",\n              \"name\": \"SubChild\",\n              \"status\": \"INLINED\",\n            },\n          ],\n          \"message\": \"\",\n          \"name\": \"Child\",\n          \"status\": \"INLINED\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 2,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`Class component as root with instance variables #2: (createElement => JSX) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 3,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [\n            Object {\n              \"children\": Array [],\n              \"message\": \"\",\n              \"name\": \"SubChild\",\n              \"status\": \"INLINED\",\n            },\n          ],\n          \"message\": \"\",\n          \"name\": \"Child\",\n          \"status\": \"INLINED\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 2,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`Class component as root with instance variables #2: (createElement => createElement) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 3,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [\n            Object {\n              \"children\": Array [],\n              \"message\": \"\",\n              \"name\": \"SubChild\",\n              \"status\": \"INLINED\",\n            },\n          ],\n          \"message\": \"\",\n          \"name\": \"Child\",\n          \"status\": \"INLINED\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 2,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`Class component as root with instance variables: (JSX => JSX) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 3,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [\n            Object {\n              \"children\": Array [],\n              \"message\": \"\",\n              \"name\": \"SubChild\",\n              \"status\": \"INLINED\",\n            },\n          ],\n          \"message\": \"\",\n          \"name\": \"Child\",\n          \"status\": \"INLINED\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 2,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`Class component as root with instance variables: (JSX => createElement) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 3,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [\n            Object {\n              \"children\": Array [],\n              \"message\": \"\",\n              \"name\": \"SubChild\",\n              \"status\": \"INLINED\",\n            },\n          ],\n          \"message\": \"\",\n          \"name\": \"Child\",\n          \"status\": \"INLINED\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 2,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`Class component as root with instance variables: (createElement => JSX) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 3,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [\n            Object {\n              \"children\": Array [],\n              \"message\": \"\",\n              \"name\": \"SubChild\",\n              \"status\": \"INLINED\",\n            },\n          ],\n          \"message\": \"\",\n          \"name\": \"Child\",\n          \"status\": \"INLINED\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 2,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`Class component as root with instance variables: (createElement => createElement) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 3,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [\n            Object {\n              \"children\": Array [],\n              \"message\": \"\",\n              \"name\": \"SubChild\",\n              \"status\": \"INLINED\",\n            },\n          ],\n          \"message\": \"\",\n          \"name\": \"Child\",\n          \"status\": \"INLINED\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 2,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`Class component as root with multiple render methods: (JSX => JSX) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 3,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [\n            Object {\n              \"children\": Array [],\n              \"message\": \"\",\n              \"name\": \"SubChild\",\n              \"status\": \"INLINED\",\n            },\n          ],\n          \"message\": \"\",\n          \"name\": \"Child\",\n          \"status\": \"INLINED\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 2,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`Class component as root with multiple render methods: (JSX => createElement) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 3,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [\n            Object {\n              \"children\": Array [],\n              \"message\": \"\",\n              \"name\": \"SubChild\",\n              \"status\": \"INLINED\",\n            },\n          ],\n          \"message\": \"\",\n          \"name\": \"Child\",\n          \"status\": \"INLINED\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 2,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`Class component as root with multiple render methods: (createElement => JSX) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 3,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [\n            Object {\n              \"children\": Array [],\n              \"message\": \"\",\n              \"name\": \"SubChild\",\n              \"status\": \"INLINED\",\n            },\n          ],\n          \"message\": \"\",\n          \"name\": \"Child\",\n          \"status\": \"INLINED\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 2,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`Class component as root with multiple render methods: (createElement => createElement) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 3,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [\n            Object {\n              \"children\": Array [],\n              \"message\": \"\",\n              \"name\": \"SubChild\",\n              \"status\": \"INLINED\",\n            },\n          ],\n          \"message\": \"\",\n          \"name\": \"Child\",\n          \"status\": \"INLINED\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 2,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`Class component as root with props: (JSX => JSX) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 3,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [\n            Object {\n              \"children\": Array [],\n              \"message\": \"\",\n              \"name\": \"SubChild\",\n              \"status\": \"INLINED\",\n            },\n          ],\n          \"message\": \"\",\n          \"name\": \"Child\",\n          \"status\": \"INLINED\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 2,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`Class component as root with props: (JSX => createElement) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 3,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [\n            Object {\n              \"children\": Array [],\n              \"message\": \"\",\n              \"name\": \"SubChild\",\n              \"status\": \"INLINED\",\n            },\n          ],\n          \"message\": \"\",\n          \"name\": \"Child\",\n          \"status\": \"INLINED\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 2,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`Class component as root with props: (createElement => JSX) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 3,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [\n            Object {\n              \"children\": Array [],\n              \"message\": \"\",\n              \"name\": \"SubChild\",\n              \"status\": \"INLINED\",\n            },\n          ],\n          \"message\": \"\",\n          \"name\": \"Child\",\n          \"status\": \"INLINED\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 2,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`Class component as root with props: (createElement => createElement) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 3,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [\n            Object {\n              \"children\": Array [],\n              \"message\": \"\",\n              \"name\": \"SubChild\",\n              \"status\": \"INLINED\",\n            },\n          ],\n          \"message\": \"\",\n          \"name\": \"Child\",\n          \"status\": \"INLINED\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 2,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`Class component as root with refs: (JSX => JSX) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 3,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [\n            Object {\n              \"children\": Array [],\n              \"message\": \"\",\n              \"name\": \"SubChild\",\n              \"status\": \"INLINED\",\n            },\n          ],\n          \"message\": \"\",\n          \"name\": \"Child\",\n          \"status\": \"INLINED\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 2,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`Class component as root with refs: (JSX => createElement) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 3,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [\n            Object {\n              \"children\": Array [],\n              \"message\": \"\",\n              \"name\": \"SubChild\",\n              \"status\": \"INLINED\",\n            },\n          ],\n          \"message\": \"\",\n          \"name\": \"Child\",\n          \"status\": \"INLINED\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 2,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`Class component as root with refs: (createElement => JSX) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 3,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [\n            Object {\n              \"children\": Array [],\n              \"message\": \"\",\n              \"name\": \"SubChild\",\n              \"status\": \"INLINED\",\n            },\n          ],\n          \"message\": \"\",\n          \"name\": \"Child\",\n          \"status\": \"INLINED\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 2,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`Class component as root with refs: (createElement => createElement) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 3,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [\n            Object {\n              \"children\": Array [],\n              \"message\": \"\",\n              \"name\": \"SubChild\",\n              \"status\": \"INLINED\",\n            },\n          ],\n          \"message\": \"\",\n          \"name\": \"Child\",\n          \"status\": \"INLINED\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 2,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`Class component as root with state: (JSX => JSX) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 3,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [\n            Object {\n              \"children\": Array [],\n              \"message\": \"\",\n              \"name\": \"SubChild\",\n              \"status\": \"INLINED\",\n            },\n          ],\n          \"message\": \"\",\n          \"name\": \"Child\",\n          \"status\": \"INLINED\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 2,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`Class component as root with state: (JSX => createElement) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 3,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [\n            Object {\n              \"children\": Array [],\n              \"message\": \"\",\n              \"name\": \"SubChild\",\n              \"status\": \"INLINED\",\n            },\n          ],\n          \"message\": \"\",\n          \"name\": \"Child\",\n          \"status\": \"INLINED\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 2,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`Class component as root with state: (createElement => JSX) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 3,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [\n            Object {\n              \"children\": Array [],\n              \"message\": \"\",\n              \"name\": \"SubChild\",\n              \"status\": \"INLINED\",\n            },\n          ],\n          \"message\": \"\",\n          \"name\": \"Child\",\n          \"status\": \"INLINED\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 2,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`Class component as root with state: (createElement => createElement) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 3,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [\n            Object {\n              \"children\": Array [],\n              \"message\": \"\",\n              \"name\": \"SubChild\",\n              \"status\": \"INLINED\",\n            },\n          ],\n          \"message\": \"\",\n          \"name\": \"Child\",\n          \"status\": \"INLINED\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 2,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`Class component as root: (JSX => JSX) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 3,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [\n            Object {\n              \"children\": Array [],\n              \"message\": \"\",\n              \"name\": \"SubChild\",\n              \"status\": \"INLINED\",\n            },\n          ],\n          \"message\": \"\",\n          \"name\": \"Child\",\n          \"status\": \"INLINED\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 2,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`Class component as root: (JSX => createElement) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 3,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [\n            Object {\n              \"children\": Array [],\n              \"message\": \"\",\n              \"name\": \"SubChild\",\n              \"status\": \"INLINED\",\n            },\n          ],\n          \"message\": \"\",\n          \"name\": \"Child\",\n          \"status\": \"INLINED\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 2,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`Class component as root: (createElement => JSX) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 3,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [\n            Object {\n              \"children\": Array [],\n              \"message\": \"\",\n              \"name\": \"SubChild\",\n              \"status\": \"INLINED\",\n            },\n          ],\n          \"message\": \"\",\n          \"name\": \"Child\",\n          \"status\": \"INLINED\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 2,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`Class component as root: (createElement => createElement) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 3,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [\n            Object {\n              \"children\": Array [],\n              \"message\": \"\",\n              \"name\": \"SubChild\",\n              \"status\": \"INLINED\",\n            },\n          ],\n          \"message\": \"\",\n          \"name\": \"Child\",\n          \"status\": \"INLINED\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 2,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`Conditional: (JSX => JSX) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 2,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [],\n          \"message\": \"\",\n          \"name\": \"MaybeShow\",\n          \"status\": \"INLINED\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 1,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`Conditional: (JSX => createElement) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 2,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [],\n          \"message\": \"\",\n          \"name\": \"MaybeShow\",\n          \"status\": \"INLINED\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 1,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`Conditional: (createElement => JSX) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 2,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [],\n          \"message\": \"\",\n          \"name\": \"MaybeShow\",\n          \"status\": \"INLINED\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 1,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`Conditional: (createElement => createElement) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 2,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [],\n          \"message\": \"\",\n          \"name\": \"MaybeShow\",\n          \"status\": \"INLINED\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 1,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`Delete element prop key: (JSX => JSX) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 4,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [],\n          \"message\": \"\",\n          \"name\": \"A\",\n          \"status\": \"INLINED\",\n        },\n        Object {\n          \"children\": Array [],\n          \"message\": \"\",\n          \"name\": \"B\",\n          \"status\": \"INLINED\",\n        },\n        Object {\n          \"children\": Array [],\n          \"message\": \"\",\n          \"name\": \"C\",\n          \"status\": \"INLINED\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 3,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`Delete element prop key: (JSX => createElement) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 4,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [],\n          \"message\": \"\",\n          \"name\": \"A\",\n          \"status\": \"INLINED\",\n        },\n        Object {\n          \"children\": Array [],\n          \"message\": \"\",\n          \"name\": \"B\",\n          \"status\": \"INLINED\",\n        },\n        Object {\n          \"children\": Array [],\n          \"message\": \"\",\n          \"name\": \"C\",\n          \"status\": \"INLINED\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 3,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`Delete element prop key: (createElement => JSX) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 4,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [],\n          \"message\": \"\",\n          \"name\": \"A\",\n          \"status\": \"INLINED\",\n        },\n        Object {\n          \"children\": Array [],\n          \"message\": \"\",\n          \"name\": \"B\",\n          \"status\": \"INLINED\",\n        },\n        Object {\n          \"children\": Array [],\n          \"message\": \"\",\n          \"name\": \"C\",\n          \"status\": \"INLINED\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 3,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`Delete element prop key: (createElement => createElement) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 4,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [],\n          \"message\": \"\",\n          \"name\": \"A\",\n          \"status\": \"INLINED\",\n        },\n        Object {\n          \"children\": Array [],\n          \"message\": \"\",\n          \"name\": \"B\",\n          \"status\": \"INLINED\",\n        },\n        Object {\n          \"children\": Array [],\n          \"message\": \"\",\n          \"name\": \"C\",\n          \"status\": \"INLINED\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 3,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`Dynamic ReactElement type #2: (JSX => JSX) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 4,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [],\n          \"message\": \"\",\n          \"name\": \"Foo\",\n          \"status\": \"INLINED\",\n        },\n        Object {\n          \"children\": Array [],\n          \"message\": \"\",\n          \"name\": \"Bar\",\n          \"status\": \"INLINED\",\n        },\n        Object {\n          \"children\": Array [],\n          \"message\": \"\",\n          \"name\": \"Bar\",\n          \"status\": \"INLINED\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 3,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`Dynamic ReactElement type #2: (JSX => createElement) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 4,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [],\n          \"message\": \"\",\n          \"name\": \"Foo\",\n          \"status\": \"INLINED\",\n        },\n        Object {\n          \"children\": Array [],\n          \"message\": \"\",\n          \"name\": \"Bar\",\n          \"status\": \"INLINED\",\n        },\n        Object {\n          \"children\": Array [],\n          \"message\": \"\",\n          \"name\": \"Bar\",\n          \"status\": \"INLINED\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 3,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`Dynamic ReactElement type #2: (createElement => JSX) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 4,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [],\n          \"message\": \"\",\n          \"name\": \"Foo\",\n          \"status\": \"INLINED\",\n        },\n        Object {\n          \"children\": Array [],\n          \"message\": \"\",\n          \"name\": \"Bar\",\n          \"status\": \"INLINED\",\n        },\n        Object {\n          \"children\": Array [],\n          \"message\": \"\",\n          \"name\": \"Bar\",\n          \"status\": \"INLINED\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 3,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`Dynamic ReactElement type #2: (createElement => createElement) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 4,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [],\n          \"message\": \"\",\n          \"name\": \"Foo\",\n          \"status\": \"INLINED\",\n        },\n        Object {\n          \"children\": Array [],\n          \"message\": \"\",\n          \"name\": \"Bar\",\n          \"status\": \"INLINED\",\n        },\n        Object {\n          \"children\": Array [],\n          \"message\": \"\",\n          \"name\": \"Bar\",\n          \"status\": \"INLINED\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 3,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`Dynamic ReactElement type #3: (JSX => JSX) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 3,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [],\n          \"message\": \"\",\n          \"name\": \"Foo\",\n          \"status\": \"INLINED\",\n        },\n        Object {\n          \"children\": Array [],\n          \"message\": \"\",\n          \"name\": \"Bar\",\n          \"status\": \"INLINED\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 2,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`Dynamic ReactElement type #3: (JSX => createElement) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 3,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [],\n          \"message\": \"\",\n          \"name\": \"Foo\",\n          \"status\": \"INLINED\",\n        },\n        Object {\n          \"children\": Array [],\n          \"message\": \"\",\n          \"name\": \"Bar\",\n          \"status\": \"INLINED\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 2,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`Dynamic ReactElement type #3: (createElement => JSX) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 3,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [],\n          \"message\": \"\",\n          \"name\": \"Foo\",\n          \"status\": \"INLINED\",\n        },\n        Object {\n          \"children\": Array [],\n          \"message\": \"\",\n          \"name\": \"Bar\",\n          \"status\": \"INLINED\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 2,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`Dynamic ReactElement type #3: (createElement => createElement) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 3,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [],\n          \"message\": \"\",\n          \"name\": \"Foo\",\n          \"status\": \"INLINED\",\n        },\n        Object {\n          \"children\": Array [],\n          \"message\": \"\",\n          \"name\": \"Bar\",\n          \"status\": \"INLINED\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 2,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`Dynamic ReactElement type #4: (JSX => JSX) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 2,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [],\n          \"message\": \"\",\n          \"name\": \"Foo\",\n          \"status\": \"INLINED\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 1,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`Dynamic ReactElement type #4: (JSX => createElement) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 2,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [],\n          \"message\": \"\",\n          \"name\": \"Foo\",\n          \"status\": \"INLINED\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 1,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`Dynamic ReactElement type #4: (createElement => JSX) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 2,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [],\n          \"message\": \"\",\n          \"name\": \"Foo\",\n          \"status\": \"INLINED\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 1,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`Dynamic ReactElement type #4: (createElement => createElement) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 2,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [],\n          \"message\": \"\",\n          \"name\": \"Foo\",\n          \"status\": \"INLINED\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 1,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`Dynamic ReactElement type: (JSX => JSX) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 3,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [],\n          \"message\": \"\",\n          \"name\": \"Foo\",\n          \"status\": \"INLINED\",\n        },\n        Object {\n          \"children\": Array [],\n          \"message\": \"\",\n          \"name\": \"Bar\",\n          \"status\": \"INLINED\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 2,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`Dynamic ReactElement type: (JSX => createElement) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 3,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [],\n          \"message\": \"\",\n          \"name\": \"Foo\",\n          \"status\": \"INLINED\",\n        },\n        Object {\n          \"children\": Array [],\n          \"message\": \"\",\n          \"name\": \"Bar\",\n          \"status\": \"INLINED\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 2,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`Dynamic ReactElement type: (createElement => JSX) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 3,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [],\n          \"message\": \"\",\n          \"name\": \"Foo\",\n          \"status\": \"INLINED\",\n        },\n        Object {\n          \"children\": Array [],\n          \"message\": \"\",\n          \"name\": \"Bar\",\n          \"status\": \"INLINED\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 2,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`Dynamic ReactElement type: (createElement => createElement) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 3,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [],\n          \"message\": \"\",\n          \"name\": \"Foo\",\n          \"status\": \"INLINED\",\n        },\n        Object {\n          \"children\": Array [],\n          \"message\": \"\",\n          \"name\": \"Bar\",\n          \"status\": \"INLINED\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 2,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`Dynamic context: (JSX => JSX) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 2,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [],\n          \"message\": \"\",\n          \"name\": \"SubChild\",\n          \"status\": \"INLINED\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"Child\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 1,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`Dynamic context: (JSX => createElement) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 2,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [],\n          \"message\": \"\",\n          \"name\": \"SubChild\",\n          \"status\": \"INLINED\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"Child\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 1,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`Dynamic context: (createElement => JSX) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 2,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [],\n          \"message\": \"\",\n          \"name\": \"SubChild\",\n          \"status\": \"INLINED\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"Child\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 1,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`Dynamic context: (createElement => createElement) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 2,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [],\n          \"message\": \"\",\n          \"name\": \"SubChild\",\n          \"status\": \"INLINED\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"Child\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 1,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`Dynamic props: (JSX => JSX) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 2,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [],\n          \"message\": \"\",\n          \"name\": \"Fn\",\n          \"status\": \"INLINED\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 1,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`Dynamic props: (JSX => createElement) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 2,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [],\n          \"message\": \"\",\n          \"name\": \"Fn\",\n          \"status\": \"INLINED\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 1,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`Dynamic props: (createElement => JSX) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 2,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [],\n          \"message\": \"\",\n          \"name\": \"Fn\",\n          \"status\": \"INLINED\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 1,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`Dynamic props: (createElement => createElement) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 2,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [],\n          \"message\": \"\",\n          \"name\": \"Fn\",\n          \"status\": \"INLINED\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 1,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`Equivalence: (JSX => JSX) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 1,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 0,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`Equivalence: (JSX => createElement) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 1,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 0,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`Equivalence: (createElement => JSX) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 1,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 0,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`Equivalence: (createElement => createElement) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 1,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 0,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`Event handlers: (JSX => JSX) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 1,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 0,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`Event handlers: (JSX => createElement) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 1,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 0,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`Event handlers: (createElement => JSX) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 1,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 0,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`Event handlers: (createElement => createElement) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 1,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 0,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`Handle mapped arrays 2: (JSX => JSX) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 2,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [],\n          \"message\": \"\",\n          \"name\": \"A\",\n          \"status\": \"INLINED\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 1,\n  \"optimizedNestedClosures\": 1,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`Handle mapped arrays 2: (JSX => createElement) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 2,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [],\n          \"message\": \"\",\n          \"name\": \"A\",\n          \"status\": \"INLINED\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 1,\n  \"optimizedNestedClosures\": 1,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`Handle mapped arrays 2: (createElement => JSX) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 2,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [],\n          \"message\": \"\",\n          \"name\": \"A\",\n          \"status\": \"INLINED\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 1,\n  \"optimizedNestedClosures\": 1,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`Handle mapped arrays 2: (createElement => createElement) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 2,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [],\n          \"message\": \"\",\n          \"name\": \"A\",\n          \"status\": \"INLINED\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 1,\n  \"optimizedNestedClosures\": 1,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`Handle mapped arrays 3: (JSX => JSX) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 1,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 0,\n  \"optimizedNestedClosures\": 1,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`Handle mapped arrays 3: (JSX => createElement) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 1,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 0,\n  \"optimizedNestedClosures\": 1,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`Handle mapped arrays 3: (createElement => JSX) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 1,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 0,\n  \"optimizedNestedClosures\": 1,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`Handle mapped arrays 3: (createElement => createElement) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 1,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 0,\n  \"optimizedNestedClosures\": 1,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`Handle mapped arrays from Array.from: (JSX => JSX) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 1,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 0,\n  \"optimizedNestedClosures\": 1,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`Handle mapped arrays from Array.from: (JSX => createElement) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 1,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 0,\n  \"optimizedNestedClosures\": 1,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`Handle mapped arrays from Array.from: (createElement => JSX) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 1,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 0,\n  \"optimizedNestedClosures\": 1,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`Handle mapped arrays from Array.from: (createElement => createElement) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 1,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 0,\n  \"optimizedNestedClosures\": 1,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`Handle mapped arrays: (JSX => JSX) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 2,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [],\n          \"message\": \"\",\n          \"name\": \"A\",\n          \"status\": \"INLINED\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 1,\n  \"optimizedNestedClosures\": 1,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`Handle mapped arrays: (JSX => createElement) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 2,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [],\n          \"message\": \"\",\n          \"name\": \"A\",\n          \"status\": \"INLINED\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 1,\n  \"optimizedNestedClosures\": 1,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`Handle mapped arrays: (createElement => JSX) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 2,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [],\n          \"message\": \"\",\n          \"name\": \"A\",\n          \"status\": \"INLINED\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 1,\n  \"optimizedNestedClosures\": 1,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`Handle mapped arrays: (createElement => createElement) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 2,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [],\n          \"message\": \"\",\n          \"name\": \"A\",\n          \"status\": \"INLINED\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 1,\n  \"optimizedNestedClosures\": 1,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`Havocing of ReactElements should not result in property assignments: (JSX => JSX) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 1,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 0,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`Havocing of ReactElements should not result in property assignments: (JSX => createElement) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 1,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 0,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`Havocing of ReactElements should not result in property assignments: (createElement => JSX) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 1,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 0,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`Havocing of ReactElements should not result in property assignments: (createElement => createElement) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 1,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 0,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`Hoist Fragment: (JSX => JSX) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 3,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [\n            Object {\n              \"children\": Array [],\n              \"message\": \"\",\n              \"name\": \"React.Fragment\",\n              \"status\": \"NORMAL\",\n            },\n          ],\n          \"message\": \"\",\n          \"name\": \"React.Fragment\",\n          \"status\": \"NORMAL\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"Root\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 0,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`Hoist Fragment: (JSX => createElement) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 3,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [\n            Object {\n              \"children\": Array [],\n              \"message\": \"\",\n              \"name\": \"React.Fragment\",\n              \"status\": \"NORMAL\",\n            },\n          ],\n          \"message\": \"\",\n          \"name\": \"React.Fragment\",\n          \"status\": \"NORMAL\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"Root\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 0,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`Hoist Fragment: (createElement => JSX) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 3,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [\n            Object {\n              \"children\": Array [],\n              \"message\": \"\",\n              \"name\": \"React.Fragment\",\n              \"status\": \"NORMAL\",\n            },\n          ],\n          \"message\": \"\",\n          \"name\": \"React.Fragment\",\n          \"status\": \"NORMAL\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"Root\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 0,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`Hoist Fragment: (createElement => createElement) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 3,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [\n            Object {\n              \"children\": Array [],\n              \"message\": \"\",\n              \"name\": \"React.Fragment\",\n              \"status\": \"NORMAL\",\n            },\n          ],\n          \"message\": \"\",\n          \"name\": \"React.Fragment\",\n          \"status\": \"NORMAL\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"Root\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 0,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`Inline key on component that does not return element: (JSX => JSX) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 3,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [],\n          \"message\": \"\",\n          \"name\": \"Delta\",\n          \"status\": \"INLINED\",\n        },\n        Object {\n          \"children\": Array [],\n          \"message\": \"\",\n          \"name\": \"Delta\",\n          \"status\": \"INLINED\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"Upsilon\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 2,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`Inline key on component that does not return element: (JSX => createElement) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 3,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [],\n          \"message\": \"\",\n          \"name\": \"Delta\",\n          \"status\": \"INLINED\",\n        },\n        Object {\n          \"children\": Array [],\n          \"message\": \"\",\n          \"name\": \"Delta\",\n          \"status\": \"INLINED\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"Upsilon\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 2,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`Inline key on component that does not return element: (createElement => JSX) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 3,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [],\n          \"message\": \"\",\n          \"name\": \"Delta\",\n          \"status\": \"INLINED\",\n        },\n        Object {\n          \"children\": Array [],\n          \"message\": \"\",\n          \"name\": \"Delta\",\n          \"status\": \"INLINED\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"Upsilon\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 2,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`Inline key on component that does not return element: (createElement => createElement) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 3,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [],\n          \"message\": \"\",\n          \"name\": \"Delta\",\n          \"status\": \"INLINED\",\n        },\n        Object {\n          \"children\": Array [],\n          \"message\": \"\",\n          \"name\": \"Delta\",\n          \"status\": \"INLINED\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"Upsilon\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 2,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`Inline keys: (JSX => JSX) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 3,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [],\n          \"message\": \"\",\n          \"name\": \"Omega\",\n          \"status\": \"INLINED\",\n        },\n        Object {\n          \"children\": Array [],\n          \"message\": \"\",\n          \"name\": \"Omega\",\n          \"status\": \"INLINED\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"Lambda\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 2,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`Inline keys: (JSX => createElement) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 3,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [],\n          \"message\": \"\",\n          \"name\": \"Omega\",\n          \"status\": \"INLINED\",\n        },\n        Object {\n          \"children\": Array [],\n          \"message\": \"\",\n          \"name\": \"Omega\",\n          \"status\": \"INLINED\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"Lambda\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 2,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`Inline keys: (createElement => JSX) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 3,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [],\n          \"message\": \"\",\n          \"name\": \"Omega\",\n          \"status\": \"INLINED\",\n        },\n        Object {\n          \"children\": Array [],\n          \"message\": \"\",\n          \"name\": \"Omega\",\n          \"status\": \"INLINED\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"Lambda\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 2,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`Inline keys: (createElement => createElement) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 3,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [],\n          \"message\": \"\",\n          \"name\": \"Omega\",\n          \"status\": \"INLINED\",\n        },\n        Object {\n          \"children\": Array [],\n          \"message\": \"\",\n          \"name\": \"Omega\",\n          \"status\": \"INLINED\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"Lambda\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 2,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`Inline unnecessary keys: (JSX => JSX) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 3,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [],\n          \"message\": \"\",\n          \"name\": \"Omega\",\n          \"status\": \"INLINED\",\n        },\n        Object {\n          \"children\": Array [],\n          \"message\": \"\",\n          \"name\": \"Omega\",\n          \"status\": \"INLINED\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"Lambda\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 2,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`Inline unnecessary keys: (JSX => createElement) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 3,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [],\n          \"message\": \"\",\n          \"name\": \"Omega\",\n          \"status\": \"INLINED\",\n        },\n        Object {\n          \"children\": Array [],\n          \"message\": \"\",\n          \"name\": \"Omega\",\n          \"status\": \"INLINED\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"Lambda\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 2,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`Inline unnecessary keys: (createElement => JSX) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 3,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [],\n          \"message\": \"\",\n          \"name\": \"Omega\",\n          \"status\": \"INLINED\",\n        },\n        Object {\n          \"children\": Array [],\n          \"message\": \"\",\n          \"name\": \"Omega\",\n          \"status\": \"INLINED\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"Lambda\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 2,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`Inline unnecessary keys: (createElement => createElement) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 3,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [],\n          \"message\": \"\",\n          \"name\": \"Omega\",\n          \"status\": \"INLINED\",\n        },\n        Object {\n          \"children\": Array [],\n          \"message\": \"\",\n          \"name\": \"Omega\",\n          \"status\": \"INLINED\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"Lambda\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 2,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`Model props: (JSX => JSX) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 1,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 0,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`Model props: (JSX => createElement) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 1,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 0,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`Model props: (createElement => JSX) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 1,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 0,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`Model props: (createElement => createElement) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 1,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 0,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`Mutations - not-safe 1: (JSX => JSX) 1`] = `\"Failed to render React component root \\\\\"Bar\\\\\" due to side-effects from mutating the binding \\\\\"x\\\\\"\"`;\n\nexports[`Mutations - not-safe 1: (JSX => createElement) 1`] = `\"Failed to render React component root \\\\\"Bar\\\\\" due to side-effects from mutating the binding \\\\\"x\\\\\"\"`;\n\nexports[`Mutations - not-safe 1: (createElement => JSX) 1`] = `\"Failed to render React component root \\\\\"Bar\\\\\" due to side-effects from mutating the binding \\\\\"x\\\\\"\"`;\n\nexports[`Mutations - not-safe 1: (createElement => createElement) 1`] = `\"Failed to render React component root \\\\\"Bar\\\\\" due to side-effects from mutating the binding \\\\\"x\\\\\"\"`;\n\nexports[`Mutations - not-safe 2: (JSX => JSX) 1`] = `\"Failed to render React component root \\\\\"Bar\\\\\" due to side-effects from mutating the binding \\\\\"x\\\\\"\"`;\n\nexports[`Mutations - not-safe 2: (JSX => createElement) 1`] = `\"Failed to render React component root \\\\\"Bar\\\\\" due to side-effects from mutating the binding \\\\\"x\\\\\"\"`;\n\nexports[`Mutations - not-safe 2: (createElement => JSX) 1`] = `\"Failed to render React component root \\\\\"Bar\\\\\" due to side-effects from mutating the binding \\\\\"x\\\\\"\"`;\n\nexports[`Mutations - not-safe 2: (createElement => createElement) 1`] = `\"Failed to render React component root \\\\\"Bar\\\\\" due to side-effects from mutating the binding \\\\\"x\\\\\"\"`;\n\nexports[`Mutations - safe 1: (JSX => JSX) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 1,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [],\n      \"message\": \"\",\n      \"name\": \"Bar\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 0,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`Mutations - safe 1: (JSX => createElement) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 1,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [],\n      \"message\": \"\",\n      \"name\": \"Bar\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 0,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`Mutations - safe 1: (createElement => JSX) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 1,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [],\n      \"message\": \"\",\n      \"name\": \"Bar\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 0,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`Mutations - safe 1: (createElement => createElement) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 1,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [],\n      \"message\": \"\",\n      \"name\": \"Bar\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 0,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`Mutations - safe 2: (JSX => JSX) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 1,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [],\n      \"message\": \"\",\n      \"name\": \"Bar\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 0,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`Mutations - safe 2: (JSX => createElement) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 1,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [],\n      \"message\": \"\",\n      \"name\": \"Bar\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 0,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`Mutations - safe 2: (createElement => JSX) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 1,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [],\n      \"message\": \"\",\n      \"name\": \"Bar\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 0,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`Mutations - safe 2: (createElement => createElement) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 1,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [],\n      \"message\": \"\",\n      \"name\": \"Bar\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 0,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`Mutations - safe 3: (JSX => JSX) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 1,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [],\n      \"message\": \"\",\n      \"name\": \"Bar\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 0,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`Mutations - safe 3: (JSX => createElement) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 1,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [],\n      \"message\": \"\",\n      \"name\": \"Bar\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 0,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`Mutations - safe 3: (createElement => JSX) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 1,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [],\n      \"message\": \"\",\n      \"name\": \"Bar\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 0,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`Mutations - safe 3: (createElement => createElement) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 1,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [],\n      \"message\": \"\",\n      \"name\": \"Bar\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 0,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`Null or undefined props: (JSX => JSX) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 1,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 0,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`Null or undefined props: (JSX => createElement) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 1,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 0,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`Null or undefined props: (createElement => JSX) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 1,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 0,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`Null or undefined props: (createElement => createElement) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 1,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 0,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`Pathological case: (JSX => JSX) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 188,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [\n            Object {\n              \"children\": Array [\n                Object {\n                  \"children\": Array [],\n                  \"message\": \"\",\n                  \"name\": \"React.Fragment\",\n                  \"status\": \"NORMAL\",\n                },\n              ],\n              \"message\": \"\",\n              \"name\": \"Theta\",\n              \"status\": \"INLINED\",\n            },\n            Object {\n              \"children\": Array [\n                Object {\n                  \"children\": Array [\n                    Object {\n                      \"children\": Array [\n                        Object {\n                          \"children\": Array [\n                            Object {\n                              \"children\": Array [\n                                Object {\n                                  \"children\": Array [],\n                                  \"message\": \"\",\n                                  \"name\": \"Mu\",\n                                  \"status\": \"INLINED\",\n                                },\n                                Object {\n                                  \"children\": Array [],\n                                  \"message\": \"\",\n                                  \"name\": \"Mu\",\n                                  \"status\": \"INLINED\",\n                                },\n                                Object {\n                                  \"children\": Array [],\n                                  \"message\": \"\",\n                                  \"name\": \"Mu\",\n                                  \"status\": \"INLINED\",\n                                },\n                              ],\n                              \"message\": \"\",\n                              \"name\": \"Zeta\",\n                              \"status\": \"INLINED\",\n                            },\n                          ],\n                          \"message\": \"\",\n                          \"name\": \"Pi\",\n                          \"status\": \"INLINED\",\n                        },\n                      ],\n                      \"message\": \"\",\n                      \"name\": \"React.Fragment\",\n                      \"status\": \"NORMAL\",\n                    },\n                    Object {\n                      \"children\": Array [\n                        Object {\n                          \"children\": Array [\n                            Object {\n                              \"children\": Array [],\n                              \"message\": \"\",\n                              \"name\": \"React.Fragment\",\n                              \"status\": \"NORMAL\",\n                            },\n                          ],\n                          \"message\": \"\",\n                          \"name\": \"Theta\",\n                          \"status\": \"INLINED\",\n                        },\n                      ],\n                      \"message\": \"\",\n                      \"name\": \"Lambda\",\n                      \"status\": \"INLINED\",\n                    },\n                    Object {\n                      \"children\": Array [\n                        Object {\n                          \"children\": Array [],\n                          \"message\": \"\",\n                          \"name\": \"React.Fragment\",\n                          \"status\": \"NORMAL\",\n                        },\n                      ],\n                      \"message\": \"\",\n                      \"name\": \"Xi\",\n                      \"status\": \"INLINED\",\n                    },\n                    Object {\n                      \"children\": Array [\n                        Object {\n                          \"children\": Array [],\n                          \"message\": \"\",\n                          \"name\": \"React.Fragment\",\n                          \"status\": \"NORMAL\",\n                        },\n                      ],\n                      \"message\": \"\",\n                      \"name\": \"Xi\",\n                      \"status\": \"INLINED\",\n                    },\n                    Object {\n                      \"children\": Array [\n                        Object {\n                          \"children\": Array [\n                            Object {\n                              \"children\": Array [],\n                              \"message\": \"\",\n                              \"name\": \"Mu\",\n                              \"status\": \"INLINED\",\n                            },\n                            Object {\n                              \"children\": Array [],\n                              \"message\": \"\",\n                              \"name\": \"Mu\",\n                              \"status\": \"INLINED\",\n                            },\n                            Object {\n                              \"children\": Array [],\n                              \"message\": \"\",\n                              \"name\": \"Mu\",\n                              \"status\": \"INLINED\",\n                            },\n                          ],\n                          \"message\": \"\",\n                          \"name\": \"Zeta\",\n                          \"status\": \"INLINED\",\n                        },\n                      ],\n                      \"message\": \"\",\n                      \"name\": \"React.Fragment\",\n                      \"status\": \"NORMAL\",\n                    },\n                  ],\n                  \"message\": \"\",\n                  \"name\": \"React.Fragment\",\n                  \"status\": \"NORMAL\",\n                },\n              ],\n              \"message\": \"\",\n              \"name\": \"Iota\",\n              \"status\": \"INLINED\",\n            },\n            Object {\n              \"children\": Array [\n                Object {\n                  \"children\": Array [],\n                  \"message\": \"\",\n                  \"name\": \"React.Fragment\",\n                  \"status\": \"NORMAL\",\n                },\n              ],\n              \"message\": \"\",\n              \"name\": \"Xi\",\n              \"status\": \"INLINED\",\n            },\n            Object {\n              \"children\": Array [\n                Object {\n                  \"children\": Array [],\n                  \"message\": \"\",\n                  \"name\": \"Mu\",\n                  \"status\": \"INLINED\",\n                },\n                Object {\n                  \"children\": Array [],\n                  \"message\": \"\",\n                  \"name\": \"Mu\",\n                  \"status\": \"INLINED\",\n                },\n                Object {\n                  \"children\": Array [],\n                  \"message\": \"\",\n                  \"name\": \"Mu\",\n                  \"status\": \"INLINED\",\n                },\n              ],\n              \"message\": \"\",\n              \"name\": \"Zeta\",\n              \"status\": \"INLINED\",\n            },\n            Object {\n              \"children\": Array [\n                Object {\n                  \"children\": Array [],\n                  \"message\": \"\",\n                  \"name\": \"React.Fragment\",\n                  \"status\": \"NORMAL\",\n                },\n                Object {\n                  \"children\": Array [\n                    Object {\n                      \"children\": Array [\n                        Object {\n                          \"children\": Array [],\n                          \"message\": \"\",\n                          \"name\": \"Mu\",\n                          \"status\": \"INLINED\",\n                        },\n                        Object {\n                          \"children\": Array [],\n                          \"message\": \"\",\n                          \"name\": \"Mu\",\n                          \"status\": \"INLINED\",\n                        },\n                        Object {\n                          \"children\": Array [],\n                          \"message\": \"\",\n                          \"name\": \"Mu\",\n                          \"status\": \"INLINED\",\n                        },\n                      ],\n                      \"message\": \"\",\n                      \"name\": \"Zeta\",\n                      \"status\": \"INLINED\",\n                    },\n                  ],\n                  \"message\": \"\",\n                  \"name\": \"Pi\",\n                  \"status\": \"INLINED\",\n                },\n              ],\n              \"message\": \"\",\n              \"name\": \"Epsilon\",\n              \"status\": \"INLINED\",\n            },\n            Object {\n              \"children\": Array [\n                Object {\n                  \"children\": Array [\n                    Object {\n                      \"children\": Array [\n                        Object {\n                          \"children\": Array [\n                            Object {\n                              \"children\": Array [\n                                Object {\n                                  \"children\": Array [\n                                    Object {\n                                      \"children\": Array [\n                                        Object {\n                                          \"children\": Array [],\n                                          \"message\": \"\",\n                                          \"name\": \"Mu\",\n                                          \"status\": \"INLINED\",\n                                        },\n                                        Object {\n                                          \"children\": Array [],\n                                          \"message\": \"\",\n                                          \"name\": \"Mu\",\n                                          \"status\": \"INLINED\",\n                                        },\n                                        Object {\n                                          \"children\": Array [],\n                                          \"message\": \"\",\n                                          \"name\": \"Mu\",\n                                          \"status\": \"INLINED\",\n                                        },\n                                      ],\n                                      \"message\": \"\",\n                                      \"name\": \"Zeta\",\n                                      \"status\": \"INLINED\",\n                                    },\n                                  ],\n                                  \"message\": \"\",\n                                  \"name\": \"Pi\",\n                                  \"status\": \"INLINED\",\n                                },\n                              ],\n                              \"message\": \"\",\n                              \"name\": \"React.Fragment\",\n                              \"status\": \"NORMAL\",\n                            },\n                            Object {\n                              \"children\": Array [\n                                Object {\n                                  \"children\": Array [\n                                    Object {\n                                      \"children\": Array [],\n                                      \"message\": \"\",\n                                      \"name\": \"React.Fragment\",\n                                      \"status\": \"NORMAL\",\n                                    },\n                                  ],\n                                  \"message\": \"\",\n                                  \"name\": \"Theta\",\n                                  \"status\": \"INLINED\",\n                                },\n                              ],\n                              \"message\": \"\",\n                              \"name\": \"Lambda\",\n                              \"status\": \"INLINED\",\n                            },\n                            Object {\n                              \"children\": Array [\n                                Object {\n                                  \"children\": Array [],\n                                  \"message\": \"\",\n                                  \"name\": \"React.Fragment\",\n                                  \"status\": \"NORMAL\",\n                                },\n                              ],\n                              \"message\": \"\",\n                              \"name\": \"Xi\",\n                              \"status\": \"INLINED\",\n                            },\n                            Object {\n                              \"children\": Array [\n                                Object {\n                                  \"children\": Array [],\n                                  \"message\": \"\",\n                                  \"name\": \"React.Fragment\",\n                                  \"status\": \"NORMAL\",\n                                },\n                              ],\n                              \"message\": \"\",\n                              \"name\": \"Xi\",\n                              \"status\": \"INLINED\",\n                            },\n                            Object {\n                              \"children\": Array [\n                                Object {\n                                  \"children\": Array [\n                                    Object {\n                                      \"children\": Array [],\n                                      \"message\": \"\",\n                                      \"name\": \"Mu\",\n                                      \"status\": \"INLINED\",\n                                    },\n                                    Object {\n                                      \"children\": Array [],\n                                      \"message\": \"\",\n                                      \"name\": \"Mu\",\n                                      \"status\": \"INLINED\",\n                                    },\n                                    Object {\n                                      \"children\": Array [],\n                                      \"message\": \"\",\n                                      \"name\": \"Mu\",\n                                      \"status\": \"INLINED\",\n                                    },\n                                  ],\n                                  \"message\": \"\",\n                                  \"name\": \"Zeta\",\n                                  \"status\": \"INLINED\",\n                                },\n                              ],\n                              \"message\": \"\",\n                              \"name\": \"React.Fragment\",\n                              \"status\": \"NORMAL\",\n                            },\n                          ],\n                          \"message\": \"\",\n                          \"name\": \"React.Fragment\",\n                          \"status\": \"NORMAL\",\n                        },\n                      ],\n                      \"message\": \"\",\n                      \"name\": \"Iota\",\n                      \"status\": \"INLINED\",\n                    },\n                    Object {\n                      \"children\": Array [],\n                      \"message\": \"\",\n                      \"name\": \"Mu\",\n                      \"status\": \"INLINED\",\n                    },\n                    Object {\n                      \"children\": Array [\n                        Object {\n                          \"children\": Array [],\n                          \"message\": \"\",\n                          \"name\": \"React.Fragment\",\n                          \"status\": \"NORMAL\",\n                        },\n                        Object {\n                          \"children\": Array [\n                            Object {\n                              \"children\": Array [\n                                Object {\n                                  \"children\": Array [],\n                                  \"message\": \"\",\n                                  \"name\": \"Mu\",\n                                  \"status\": \"INLINED\",\n                                },\n                                Object {\n                                  \"children\": Array [],\n                                  \"message\": \"\",\n                                  \"name\": \"Mu\",\n                                  \"status\": \"INLINED\",\n                                },\n                                Object {\n                                  \"children\": Array [],\n                                  \"message\": \"\",\n                                  \"name\": \"Mu\",\n                                  \"status\": \"INLINED\",\n                                },\n                              ],\n                              \"message\": \"\",\n                              \"name\": \"Zeta\",\n                              \"status\": \"INLINED\",\n                            },\n                          ],\n                          \"message\": \"\",\n                          \"name\": \"Pi\",\n                          \"status\": \"INLINED\",\n                        },\n                      ],\n                      \"message\": \"\",\n                      \"name\": \"Epsilon\",\n                      \"status\": \"INLINED\",\n                    },\n                    Object {\n                      \"children\": Array [\n                        Object {\n                          \"children\": Array [\n                            Object {\n                              \"children\": Array [],\n                              \"message\": \"\",\n                              \"name\": \"Mu\",\n                              \"status\": \"INLINED\",\n                            },\n                            Object {\n                              \"children\": Array [],\n                              \"message\": \"\",\n                              \"name\": \"Mu\",\n                              \"status\": \"INLINED\",\n                            },\n                            Object {\n                              \"children\": Array [],\n                              \"message\": \"\",\n                              \"name\": \"Mu\",\n                              \"status\": \"INLINED\",\n                            },\n                          ],\n                          \"message\": \"\",\n                          \"name\": \"Zeta\",\n                          \"status\": \"INLINED\",\n                        },\n                      ],\n                      \"message\": \"\",\n                      \"name\": \"Pi\",\n                      \"status\": \"INLINED\",\n                    },\n                  ],\n                  \"message\": \"\",\n                  \"name\": \"React.Fragment\",\n                  \"status\": \"NORMAL\",\n                },\n              ],\n              \"message\": \"\",\n              \"name\": \"Delta\",\n              \"status\": \"INLINED\",\n            },\n            Object {\n              \"children\": Array [\n                Object {\n                  \"children\": Array [\n                    Object {\n                      \"children\": Array [\n                        Object {\n                          \"children\": Array [\n                            Object {\n                              \"children\": Array [\n                                Object {\n                                  \"children\": Array [\n                                    Object {\n                                      \"children\": Array [\n                                        Object {\n                                          \"children\": Array [],\n                                          \"message\": \"\",\n                                          \"name\": \"Mu\",\n                                          \"status\": \"INLINED\",\n                                        },\n                                        Object {\n                                          \"children\": Array [],\n                                          \"message\": \"\",\n                                          \"name\": \"Mu\",\n                                          \"status\": \"INLINED\",\n                                        },\n                                        Object {\n                                          \"children\": Array [],\n                                          \"message\": \"\",\n                                          \"name\": \"Mu\",\n                                          \"status\": \"INLINED\",\n                                        },\n                                      ],\n                                      \"message\": \"\",\n                                      \"name\": \"Zeta\",\n                                      \"status\": \"INLINED\",\n                                    },\n                                  ],\n                                  \"message\": \"\",\n                                  \"name\": \"Pi\",\n                                  \"status\": \"INLINED\",\n                                },\n                              ],\n                              \"message\": \"\",\n                              \"name\": \"React.Fragment\",\n                              \"status\": \"NORMAL\",\n                            },\n                            Object {\n                              \"children\": Array [\n                                Object {\n                                  \"children\": Array [\n                                    Object {\n                                      \"children\": Array [],\n                                      \"message\": \"\",\n                                      \"name\": \"React.Fragment\",\n                                      \"status\": \"NORMAL\",\n                                    },\n                                  ],\n                                  \"message\": \"\",\n                                  \"name\": \"Theta\",\n                                  \"status\": \"INLINED\",\n                                },\n                              ],\n                              \"message\": \"\",\n                              \"name\": \"Lambda\",\n                              \"status\": \"INLINED\",\n                            },\n                            Object {\n                              \"children\": Array [\n                                Object {\n                                  \"children\": Array [],\n                                  \"message\": \"\",\n                                  \"name\": \"React.Fragment\",\n                                  \"status\": \"NORMAL\",\n                                },\n                              ],\n                              \"message\": \"\",\n                              \"name\": \"Xi\",\n                              \"status\": \"INLINED\",\n                            },\n                            Object {\n                              \"children\": Array [\n                                Object {\n                                  \"children\": Array [],\n                                  \"message\": \"\",\n                                  \"name\": \"React.Fragment\",\n                                  \"status\": \"NORMAL\",\n                                },\n                              ],\n                              \"message\": \"\",\n                              \"name\": \"Xi\",\n                              \"status\": \"INLINED\",\n                            },\n                            Object {\n                              \"children\": Array [\n                                Object {\n                                  \"children\": Array [\n                                    Object {\n                                      \"children\": Array [],\n                                      \"message\": \"\",\n                                      \"name\": \"Mu\",\n                                      \"status\": \"INLINED\",\n                                    },\n                                    Object {\n                                      \"children\": Array [],\n                                      \"message\": \"\",\n                                      \"name\": \"Mu\",\n                                      \"status\": \"INLINED\",\n                                    },\n                                    Object {\n                                      \"children\": Array [],\n                                      \"message\": \"\",\n                                      \"name\": \"Mu\",\n                                      \"status\": \"INLINED\",\n                                    },\n                                  ],\n                                  \"message\": \"\",\n                                  \"name\": \"Zeta\",\n                                  \"status\": \"INLINED\",\n                                },\n                              ],\n                              \"message\": \"\",\n                              \"name\": \"React.Fragment\",\n                              \"status\": \"NORMAL\",\n                            },\n                          ],\n                          \"message\": \"\",\n                          \"name\": \"React.Fragment\",\n                          \"status\": \"NORMAL\",\n                        },\n                      ],\n                      \"message\": \"\",\n                      \"name\": \"Iota\",\n                      \"status\": \"INLINED\",\n                    },\n                    Object {\n                      \"children\": Array [],\n                      \"message\": \"\",\n                      \"name\": \"Mu\",\n                      \"status\": \"INLINED\",\n                    },\n                    Object {\n                      \"children\": Array [\n                        Object {\n                          \"children\": Array [],\n                          \"message\": \"\",\n                          \"name\": \"React.Fragment\",\n                          \"status\": \"NORMAL\",\n                        },\n                        Object {\n                          \"children\": Array [\n                            Object {\n                              \"children\": Array [\n                                Object {\n                                  \"children\": Array [],\n                                  \"message\": \"\",\n                                  \"name\": \"Mu\",\n                                  \"status\": \"INLINED\",\n                                },\n                                Object {\n                                  \"children\": Array [],\n                                  \"message\": \"\",\n                                  \"name\": \"Mu\",\n                                  \"status\": \"INLINED\",\n                                },\n                                Object {\n                                  \"children\": Array [],\n                                  \"message\": \"\",\n                                  \"name\": \"Mu\",\n                                  \"status\": \"INLINED\",\n                                },\n                              ],\n                              \"message\": \"\",\n                              \"name\": \"Zeta\",\n                              \"status\": \"INLINED\",\n                            },\n                          ],\n                          \"message\": \"\",\n                          \"name\": \"Pi\",\n                          \"status\": \"INLINED\",\n                        },\n                      ],\n                      \"message\": \"\",\n                      \"name\": \"Epsilon\",\n                      \"status\": \"INLINED\",\n                    },\n                    Object {\n                      \"children\": Array [\n                        Object {\n                          \"children\": Array [\n                            Object {\n                              \"children\": Array [],\n                              \"message\": \"\",\n                              \"name\": \"Mu\",\n                              \"status\": \"INLINED\",\n                            },\n                            Object {\n                              \"children\": Array [],\n                              \"message\": \"\",\n                              \"name\": \"Mu\",\n                              \"status\": \"INLINED\",\n                            },\n                            Object {\n                              \"children\": Array [],\n                              \"message\": \"\",\n                              \"name\": \"Mu\",\n                              \"status\": \"INLINED\",\n                            },\n                          ],\n                          \"message\": \"\",\n                          \"name\": \"Zeta\",\n                          \"status\": \"INLINED\",\n                        },\n                      ],\n                      \"message\": \"\",\n                      \"name\": \"Pi\",\n                      \"status\": \"INLINED\",\n                    },\n                  ],\n                  \"message\": \"\",\n                  \"name\": \"React.Fragment\",\n                  \"status\": \"NORMAL\",\n                },\n              ],\n              \"message\": \"\",\n              \"name\": \"Delta\",\n              \"status\": \"INLINED\",\n            },\n            Object {\n              \"children\": Array [\n                Object {\n                  \"children\": Array [],\n                  \"message\": \"\",\n                  \"name\": \"React.Fragment\",\n                  \"status\": \"NORMAL\",\n                },\n              ],\n              \"message\": \"\",\n              \"name\": \"Xi\",\n              \"status\": \"INLINED\",\n            },\n            Object {\n              \"children\": Array [\n                Object {\n                  \"children\": Array [],\n                  \"message\": \"\",\n                  \"name\": \"React.Fragment\",\n                  \"status\": \"NORMAL\",\n                },\n              ],\n              \"message\": \"\",\n              \"name\": \"Xi\",\n              \"status\": \"INLINED\",\n            },\n            Object {\n              \"children\": Array [\n                Object {\n                  \"children\": Array [\n                    Object {\n                      \"children\": Array [\n                        Object {\n                          \"children\": Array [\n                            Object {\n                              \"children\": Array [\n                                Object {\n                                  \"children\": Array [],\n                                  \"message\": \"\",\n                                  \"name\": \"Mu\",\n                                  \"status\": \"INLINED\",\n                                },\n                                Object {\n                                  \"children\": Array [],\n                                  \"message\": \"\",\n                                  \"name\": \"Mu\",\n                                  \"status\": \"INLINED\",\n                                },\n                                Object {\n                                  \"children\": Array [],\n                                  \"message\": \"\",\n                                  \"name\": \"Mu\",\n                                  \"status\": \"INLINED\",\n                                },\n                              ],\n                              \"message\": \"\",\n                              \"name\": \"Zeta\",\n                              \"status\": \"INLINED\",\n                            },\n                          ],\n                          \"message\": \"\",\n                          \"name\": \"Pi\",\n                          \"status\": \"INLINED\",\n                        },\n                      ],\n                      \"message\": \"\",\n                      \"name\": \"React.Fragment\",\n                      \"status\": \"NORMAL\",\n                    },\n                    Object {\n                      \"children\": Array [\n                        Object {\n                          \"children\": Array [\n                            Object {\n                              \"children\": Array [],\n                              \"message\": \"\",\n                              \"name\": \"React.Fragment\",\n                              \"status\": \"NORMAL\",\n                            },\n                          ],\n                          \"message\": \"\",\n                          \"name\": \"Theta\",\n                          \"status\": \"INLINED\",\n                        },\n                      ],\n                      \"message\": \"\",\n                      \"name\": \"Lambda\",\n                      \"status\": \"INLINED\",\n                    },\n                    Object {\n                      \"children\": Array [\n                        Object {\n                          \"children\": Array [],\n                          \"message\": \"\",\n                          \"name\": \"React.Fragment\",\n                          \"status\": \"NORMAL\",\n                        },\n                      ],\n                      \"message\": \"\",\n                      \"name\": \"Xi\",\n                      \"status\": \"INLINED\",\n                    },\n                    Object {\n                      \"children\": Array [\n                        Object {\n                          \"children\": Array [],\n                          \"message\": \"\",\n                          \"name\": \"React.Fragment\",\n                          \"status\": \"NORMAL\",\n                        },\n                      ],\n                      \"message\": \"\",\n                      \"name\": \"Xi\",\n                      \"status\": \"INLINED\",\n                    },\n                    Object {\n                      \"children\": Array [\n                        Object {\n                          \"children\": Array [\n                            Object {\n                              \"children\": Array [],\n                              \"message\": \"\",\n                              \"name\": \"Mu\",\n                              \"status\": \"INLINED\",\n                            },\n                            Object {\n                              \"children\": Array [],\n                              \"message\": \"\",\n                              \"name\": \"Mu\",\n                              \"status\": \"INLINED\",\n                            },\n                            Object {\n                              \"children\": Array [],\n                              \"message\": \"\",\n                              \"name\": \"Mu\",\n                              \"status\": \"INLINED\",\n                            },\n                          ],\n                          \"message\": \"\",\n                          \"name\": \"Zeta\",\n                          \"status\": \"INLINED\",\n                        },\n                      ],\n                      \"message\": \"\",\n                      \"name\": \"React.Fragment\",\n                      \"status\": \"NORMAL\",\n                    },\n                  ],\n                  \"message\": \"\",\n                  \"name\": \"React.Fragment\",\n                  \"status\": \"NORMAL\",\n                },\n              ],\n              \"message\": \"\",\n              \"name\": \"Iota\",\n              \"status\": \"INLINED\",\n            },\n            Object {\n              \"children\": Array [\n                Object {\n                  \"children\": Array [\n                    Object {\n                      \"children\": Array [\n                        Object {\n                          \"children\": Array [\n                            Object {\n                              \"children\": Array [\n                                Object {\n                                  \"children\": Array [\n                                    Object {\n                                      \"children\": Array [\n                                        Object {\n                                          \"children\": Array [],\n                                          \"message\": \"\",\n                                          \"name\": \"Mu\",\n                                          \"status\": \"INLINED\",\n                                        },\n                                        Object {\n                                          \"children\": Array [],\n                                          \"message\": \"\",\n                                          \"name\": \"Mu\",\n                                          \"status\": \"INLINED\",\n                                        },\n                                        Object {\n                                          \"children\": Array [],\n                                          \"message\": \"\",\n                                          \"name\": \"Mu\",\n                                          \"status\": \"INLINED\",\n                                        },\n                                      ],\n                                      \"message\": \"\",\n                                      \"name\": \"Zeta\",\n                                      \"status\": \"INLINED\",\n                                    },\n                                  ],\n                                  \"message\": \"\",\n                                  \"name\": \"Pi\",\n                                  \"status\": \"INLINED\",\n                                },\n                              ],\n                              \"message\": \"\",\n                              \"name\": \"React.Fragment\",\n                              \"status\": \"NORMAL\",\n                            },\n                            Object {\n                              \"children\": Array [\n                                Object {\n                                  \"children\": Array [\n                                    Object {\n                                      \"children\": Array [],\n                                      \"message\": \"\",\n                                      \"name\": \"React.Fragment\",\n                                      \"status\": \"NORMAL\",\n                                    },\n                                  ],\n                                  \"message\": \"\",\n                                  \"name\": \"Theta\",\n                                  \"status\": \"INLINED\",\n                                },\n                              ],\n                              \"message\": \"\",\n                              \"name\": \"Lambda\",\n                              \"status\": \"INLINED\",\n                            },\n                            Object {\n                              \"children\": Array [\n                                Object {\n                                  \"children\": Array [],\n                                  \"message\": \"\",\n                                  \"name\": \"React.Fragment\",\n                                  \"status\": \"NORMAL\",\n                                },\n                              ],\n                              \"message\": \"\",\n                              \"name\": \"Xi\",\n                              \"status\": \"INLINED\",\n                            },\n                            Object {\n                              \"children\": Array [\n                                Object {\n                                  \"children\": Array [],\n                                  \"message\": \"\",\n                                  \"name\": \"React.Fragment\",\n                                  \"status\": \"NORMAL\",\n                                },\n                              ],\n                              \"message\": \"\",\n                              \"name\": \"Xi\",\n                              \"status\": \"INLINED\",\n                            },\n                            Object {\n                              \"children\": Array [\n                                Object {\n                                  \"children\": Array [\n                                    Object {\n                                      \"children\": Array [],\n                                      \"message\": \"\",\n                                      \"name\": \"Mu\",\n                                      \"status\": \"INLINED\",\n                                    },\n                                    Object {\n                                      \"children\": Array [],\n                                      \"message\": \"\",\n                                      \"name\": \"Mu\",\n                                      \"status\": \"INLINED\",\n                                    },\n                                    Object {\n                                      \"children\": Array [],\n                                      \"message\": \"\",\n                                      \"name\": \"Mu\",\n                                      \"status\": \"INLINED\",\n                                    },\n                                  ],\n                                  \"message\": \"\",\n                                  \"name\": \"Zeta\",\n                                  \"status\": \"INLINED\",\n                                },\n                              ],\n                              \"message\": \"\",\n                              \"name\": \"React.Fragment\",\n                              \"status\": \"NORMAL\",\n                            },\n                          ],\n                          \"message\": \"\",\n                          \"name\": \"React.Fragment\",\n                          \"status\": \"NORMAL\",\n                        },\n                      ],\n                      \"message\": \"\",\n                      \"name\": \"Iota\",\n                      \"status\": \"INLINED\",\n                    },\n                    Object {\n                      \"children\": Array [],\n                      \"message\": \"\",\n                      \"name\": \"Mu\",\n                      \"status\": \"INLINED\",\n                    },\n                    Object {\n                      \"children\": Array [\n                        Object {\n                          \"children\": Array [],\n                          \"message\": \"\",\n                          \"name\": \"React.Fragment\",\n                          \"status\": \"NORMAL\",\n                        },\n                        Object {\n                          \"children\": Array [\n                            Object {\n                              \"children\": Array [\n                                Object {\n                                  \"children\": Array [],\n                                  \"message\": \"\",\n                                  \"name\": \"Mu\",\n                                  \"status\": \"INLINED\",\n                                },\n                                Object {\n                                  \"children\": Array [],\n                                  \"message\": \"\",\n                                  \"name\": \"Mu\",\n                                  \"status\": \"INLINED\",\n                                },\n                                Object {\n                                  \"children\": Array [],\n                                  \"message\": \"\",\n                                  \"name\": \"Mu\",\n                                  \"status\": \"INLINED\",\n                                },\n                              ],\n                              \"message\": \"\",\n                              \"name\": \"Zeta\",\n                              \"status\": \"INLINED\",\n                            },\n                          ],\n                          \"message\": \"\",\n                          \"name\": \"Pi\",\n                          \"status\": \"INLINED\",\n                        },\n                      ],\n                      \"message\": \"\",\n                      \"name\": \"Epsilon\",\n                      \"status\": \"INLINED\",\n                    },\n                    Object {\n                      \"children\": Array [\n                        Object {\n                          \"children\": Array [\n                            Object {\n                              \"children\": Array [],\n                              \"message\": \"\",\n                              \"name\": \"Mu\",\n                              \"status\": \"INLINED\",\n                            },\n                            Object {\n                              \"children\": Array [],\n                              \"message\": \"\",\n                              \"name\": \"Mu\",\n                              \"status\": \"INLINED\",\n                            },\n                            Object {\n                              \"children\": Array [],\n                              \"message\": \"\",\n                              \"name\": \"Mu\",\n                              \"status\": \"INLINED\",\n                            },\n                          ],\n                          \"message\": \"\",\n                          \"name\": \"Zeta\",\n                          \"status\": \"INLINED\",\n                        },\n                      ],\n                      \"message\": \"\",\n                      \"name\": \"Pi\",\n                      \"status\": \"INLINED\",\n                    },\n                  ],\n                  \"message\": \"\",\n                  \"name\": \"React.Fragment\",\n                  \"status\": \"NORMAL\",\n                },\n              ],\n              \"message\": \"\",\n              \"name\": \"Delta\",\n              \"status\": \"INLINED\",\n            },\n            Object {\n              \"children\": Array [\n                Object {\n                  \"children\": Array [\n                    Object {\n                      \"children\": Array [\n                        Object {\n                          \"children\": Array [\n                            Object {\n                              \"children\": Array [\n                                Object {\n                                  \"children\": Array [],\n                                  \"message\": \"\",\n                                  \"name\": \"Mu\",\n                                  \"status\": \"INLINED\",\n                                },\n                                Object {\n                                  \"children\": Array [],\n                                  \"message\": \"\",\n                                  \"name\": \"Mu\",\n                                  \"status\": \"INLINED\",\n                                },\n                                Object {\n                                  \"children\": Array [],\n                                  \"message\": \"\",\n                                  \"name\": \"Mu\",\n                                  \"status\": \"INLINED\",\n                                },\n                              ],\n                              \"message\": \"\",\n                              \"name\": \"Zeta\",\n                              \"status\": \"INLINED\",\n                            },\n                          ],\n                          \"message\": \"\",\n                          \"name\": \"Pi\",\n                          \"status\": \"INLINED\",\n                        },\n                      ],\n                      \"message\": \"\",\n                      \"name\": \"React.Fragment\",\n                      \"status\": \"NORMAL\",\n                    },\n                    Object {\n                      \"children\": Array [\n                        Object {\n                          \"children\": Array [\n                            Object {\n                              \"children\": Array [],\n                              \"message\": \"\",\n                              \"name\": \"React.Fragment\",\n                              \"status\": \"NORMAL\",\n                            },\n                          ],\n                          \"message\": \"\",\n                          \"name\": \"Theta\",\n                          \"status\": \"INLINED\",\n                        },\n                      ],\n                      \"message\": \"\",\n                      \"name\": \"Lambda\",\n                      \"status\": \"INLINED\",\n                    },\n                    Object {\n                      \"children\": Array [\n                        Object {\n                          \"children\": Array [],\n                          \"message\": \"\",\n                          \"name\": \"React.Fragment\",\n                          \"status\": \"NORMAL\",\n                        },\n                      ],\n                      \"message\": \"\",\n                      \"name\": \"Xi\",\n                      \"status\": \"INLINED\",\n                    },\n                    Object {\n                      \"children\": Array [\n                        Object {\n                          \"children\": Array [],\n                          \"message\": \"\",\n                          \"name\": \"React.Fragment\",\n                          \"status\": \"NORMAL\",\n                        },\n                      ],\n                      \"message\": \"\",\n                      \"name\": \"Xi\",\n                      \"status\": \"INLINED\",\n                    },\n                    Object {\n                      \"children\": Array [\n                        Object {\n                          \"children\": Array [\n                            Object {\n                              \"children\": Array [],\n                              \"message\": \"\",\n                              \"name\": \"Mu\",\n                              \"status\": \"INLINED\",\n                            },\n                            Object {\n                              \"children\": Array [],\n                              \"message\": \"\",\n                              \"name\": \"Mu\",\n                              \"status\": \"INLINED\",\n                            },\n                            Object {\n                              \"children\": Array [],\n                              \"message\": \"\",\n                              \"name\": \"Mu\",\n                              \"status\": \"INLINED\",\n                            },\n                          ],\n                          \"message\": \"\",\n                          \"name\": \"Zeta\",\n                          \"status\": \"INLINED\",\n                        },\n                      ],\n                      \"message\": \"\",\n                      \"name\": \"React.Fragment\",\n                      \"status\": \"NORMAL\",\n                    },\n                  ],\n                  \"message\": \"\",\n                  \"name\": \"React.Fragment\",\n                  \"status\": \"NORMAL\",\n                },\n              ],\n              \"message\": \"\",\n              \"name\": \"Iota\",\n              \"status\": \"INLINED\",\n            },\n            Object {\n              \"children\": Array [\n                Object {\n                  \"children\": Array [],\n                  \"message\": \"\",\n                  \"name\": \"React.Fragment\",\n                  \"status\": \"NORMAL\",\n                },\n              ],\n              \"message\": \"\",\n              \"name\": \"Xi\",\n              \"status\": \"INLINED\",\n            },\n          ],\n          \"message\": \"\",\n          \"name\": \"React.Fragment\",\n          \"status\": \"NORMAL\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"Gamma\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 138,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`Pathological case: (JSX => createElement) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 188,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [\n            Object {\n              \"children\": Array [\n                Object {\n                  \"children\": Array [],\n                  \"message\": \"\",\n                  \"name\": \"React.Fragment\",\n                  \"status\": \"NORMAL\",\n                },\n              ],\n              \"message\": \"\",\n              \"name\": \"Theta\",\n              \"status\": \"INLINED\",\n            },\n            Object {\n              \"children\": Array [\n                Object {\n                  \"children\": Array [\n                    Object {\n                      \"children\": Array [\n                        Object {\n                          \"children\": Array [\n                            Object {\n                              \"children\": Array [\n                                Object {\n                                  \"children\": Array [],\n                                  \"message\": \"\",\n                                  \"name\": \"Mu\",\n                                  \"status\": \"INLINED\",\n                                },\n                                Object {\n                                  \"children\": Array [],\n                                  \"message\": \"\",\n                                  \"name\": \"Mu\",\n                                  \"status\": \"INLINED\",\n                                },\n                                Object {\n                                  \"children\": Array [],\n                                  \"message\": \"\",\n                                  \"name\": \"Mu\",\n                                  \"status\": \"INLINED\",\n                                },\n                              ],\n                              \"message\": \"\",\n                              \"name\": \"Zeta\",\n                              \"status\": \"INLINED\",\n                            },\n                          ],\n                          \"message\": \"\",\n                          \"name\": \"Pi\",\n                          \"status\": \"INLINED\",\n                        },\n                      ],\n                      \"message\": \"\",\n                      \"name\": \"React.Fragment\",\n                      \"status\": \"NORMAL\",\n                    },\n                    Object {\n                      \"children\": Array [\n                        Object {\n                          \"children\": Array [\n                            Object {\n                              \"children\": Array [],\n                              \"message\": \"\",\n                              \"name\": \"React.Fragment\",\n                              \"status\": \"NORMAL\",\n                            },\n                          ],\n                          \"message\": \"\",\n                          \"name\": \"Theta\",\n                          \"status\": \"INLINED\",\n                        },\n                      ],\n                      \"message\": \"\",\n                      \"name\": \"Lambda\",\n                      \"status\": \"INLINED\",\n                    },\n                    Object {\n                      \"children\": Array [\n                        Object {\n                          \"children\": Array [],\n                          \"message\": \"\",\n                          \"name\": \"React.Fragment\",\n                          \"status\": \"NORMAL\",\n                        },\n                      ],\n                      \"message\": \"\",\n                      \"name\": \"Xi\",\n                      \"status\": \"INLINED\",\n                    },\n                    Object {\n                      \"children\": Array [\n                        Object {\n                          \"children\": Array [],\n                          \"message\": \"\",\n                          \"name\": \"React.Fragment\",\n                          \"status\": \"NORMAL\",\n                        },\n                      ],\n                      \"message\": \"\",\n                      \"name\": \"Xi\",\n                      \"status\": \"INLINED\",\n                    },\n                    Object {\n                      \"children\": Array [\n                        Object {\n                          \"children\": Array [\n                            Object {\n                              \"children\": Array [],\n                              \"message\": \"\",\n                              \"name\": \"Mu\",\n                              \"status\": \"INLINED\",\n                            },\n                            Object {\n                              \"children\": Array [],\n                              \"message\": \"\",\n                              \"name\": \"Mu\",\n                              \"status\": \"INLINED\",\n                            },\n                            Object {\n                              \"children\": Array [],\n                              \"message\": \"\",\n                              \"name\": \"Mu\",\n                              \"status\": \"INLINED\",\n                            },\n                          ],\n                          \"message\": \"\",\n                          \"name\": \"Zeta\",\n                          \"status\": \"INLINED\",\n                        },\n                      ],\n                      \"message\": \"\",\n                      \"name\": \"React.Fragment\",\n                      \"status\": \"NORMAL\",\n                    },\n                  ],\n                  \"message\": \"\",\n                  \"name\": \"React.Fragment\",\n                  \"status\": \"NORMAL\",\n                },\n              ],\n              \"message\": \"\",\n              \"name\": \"Iota\",\n              \"status\": \"INLINED\",\n            },\n            Object {\n              \"children\": Array [\n                Object {\n                  \"children\": Array [],\n                  \"message\": \"\",\n                  \"name\": \"React.Fragment\",\n                  \"status\": \"NORMAL\",\n                },\n              ],\n              \"message\": \"\",\n              \"name\": \"Xi\",\n              \"status\": \"INLINED\",\n            },\n            Object {\n              \"children\": Array [\n                Object {\n                  \"children\": Array [],\n                  \"message\": \"\",\n                  \"name\": \"Mu\",\n                  \"status\": \"INLINED\",\n                },\n                Object {\n                  \"children\": Array [],\n                  \"message\": \"\",\n                  \"name\": \"Mu\",\n                  \"status\": \"INLINED\",\n                },\n                Object {\n                  \"children\": Array [],\n                  \"message\": \"\",\n                  \"name\": \"Mu\",\n                  \"status\": \"INLINED\",\n                },\n              ],\n              \"message\": \"\",\n              \"name\": \"Zeta\",\n              \"status\": \"INLINED\",\n            },\n            Object {\n              \"children\": Array [\n                Object {\n                  \"children\": Array [],\n                  \"message\": \"\",\n                  \"name\": \"React.Fragment\",\n                  \"status\": \"NORMAL\",\n                },\n                Object {\n                  \"children\": Array [\n                    Object {\n                      \"children\": Array [\n                        Object {\n                          \"children\": Array [],\n                          \"message\": \"\",\n                          \"name\": \"Mu\",\n                          \"status\": \"INLINED\",\n                        },\n                        Object {\n                          \"children\": Array [],\n                          \"message\": \"\",\n                          \"name\": \"Mu\",\n                          \"status\": \"INLINED\",\n                        },\n                        Object {\n                          \"children\": Array [],\n                          \"message\": \"\",\n                          \"name\": \"Mu\",\n                          \"status\": \"INLINED\",\n                        },\n                      ],\n                      \"message\": \"\",\n                      \"name\": \"Zeta\",\n                      \"status\": \"INLINED\",\n                    },\n                  ],\n                  \"message\": \"\",\n                  \"name\": \"Pi\",\n                  \"status\": \"INLINED\",\n                },\n              ],\n              \"message\": \"\",\n              \"name\": \"Epsilon\",\n              \"status\": \"INLINED\",\n            },\n            Object {\n              \"children\": Array [\n                Object {\n                  \"children\": Array [\n                    Object {\n                      \"children\": Array [\n                        Object {\n                          \"children\": Array [\n                            Object {\n                              \"children\": Array [\n                                Object {\n                                  \"children\": Array [\n                                    Object {\n                                      \"children\": Array [\n                                        Object {\n                                          \"children\": Array [],\n                                          \"message\": \"\",\n                                          \"name\": \"Mu\",\n                                          \"status\": \"INLINED\",\n                                        },\n                                        Object {\n                                          \"children\": Array [],\n                                          \"message\": \"\",\n                                          \"name\": \"Mu\",\n                                          \"status\": \"INLINED\",\n                                        },\n                                        Object {\n                                          \"children\": Array [],\n                                          \"message\": \"\",\n                                          \"name\": \"Mu\",\n                                          \"status\": \"INLINED\",\n                                        },\n                                      ],\n                                      \"message\": \"\",\n                                      \"name\": \"Zeta\",\n                                      \"status\": \"INLINED\",\n                                    },\n                                  ],\n                                  \"message\": \"\",\n                                  \"name\": \"Pi\",\n                                  \"status\": \"INLINED\",\n                                },\n                              ],\n                              \"message\": \"\",\n                              \"name\": \"React.Fragment\",\n                              \"status\": \"NORMAL\",\n                            },\n                            Object {\n                              \"children\": Array [\n                                Object {\n                                  \"children\": Array [\n                                    Object {\n                                      \"children\": Array [],\n                                      \"message\": \"\",\n                                      \"name\": \"React.Fragment\",\n                                      \"status\": \"NORMAL\",\n                                    },\n                                  ],\n                                  \"message\": \"\",\n                                  \"name\": \"Theta\",\n                                  \"status\": \"INLINED\",\n                                },\n                              ],\n                              \"message\": \"\",\n                              \"name\": \"Lambda\",\n                              \"status\": \"INLINED\",\n                            },\n                            Object {\n                              \"children\": Array [\n                                Object {\n                                  \"children\": Array [],\n                                  \"message\": \"\",\n                                  \"name\": \"React.Fragment\",\n                                  \"status\": \"NORMAL\",\n                                },\n                              ],\n                              \"message\": \"\",\n                              \"name\": \"Xi\",\n                              \"status\": \"INLINED\",\n                            },\n                            Object {\n                              \"children\": Array [\n                                Object {\n                                  \"children\": Array [],\n                                  \"message\": \"\",\n                                  \"name\": \"React.Fragment\",\n                                  \"status\": \"NORMAL\",\n                                },\n                              ],\n                              \"message\": \"\",\n                              \"name\": \"Xi\",\n                              \"status\": \"INLINED\",\n                            },\n                            Object {\n                              \"children\": Array [\n                                Object {\n                                  \"children\": Array [\n                                    Object {\n                                      \"children\": Array [],\n                                      \"message\": \"\",\n                                      \"name\": \"Mu\",\n                                      \"status\": \"INLINED\",\n                                    },\n                                    Object {\n                                      \"children\": Array [],\n                                      \"message\": \"\",\n                                      \"name\": \"Mu\",\n                                      \"status\": \"INLINED\",\n                                    },\n                                    Object {\n                                      \"children\": Array [],\n                                      \"message\": \"\",\n                                      \"name\": \"Mu\",\n                                      \"status\": \"INLINED\",\n                                    },\n                                  ],\n                                  \"message\": \"\",\n                                  \"name\": \"Zeta\",\n                                  \"status\": \"INLINED\",\n                                },\n                              ],\n                              \"message\": \"\",\n                              \"name\": \"React.Fragment\",\n                              \"status\": \"NORMAL\",\n                            },\n                          ],\n                          \"message\": \"\",\n                          \"name\": \"React.Fragment\",\n                          \"status\": \"NORMAL\",\n                        },\n                      ],\n                      \"message\": \"\",\n                      \"name\": \"Iota\",\n                      \"status\": \"INLINED\",\n                    },\n                    Object {\n                      \"children\": Array [],\n                      \"message\": \"\",\n                      \"name\": \"Mu\",\n                      \"status\": \"INLINED\",\n                    },\n                    Object {\n                      \"children\": Array [\n                        Object {\n                          \"children\": Array [],\n                          \"message\": \"\",\n                          \"name\": \"React.Fragment\",\n                          \"status\": \"NORMAL\",\n                        },\n                        Object {\n                          \"children\": Array [\n                            Object {\n                              \"children\": Array [\n                                Object {\n                                  \"children\": Array [],\n                                  \"message\": \"\",\n                                  \"name\": \"Mu\",\n                                  \"status\": \"INLINED\",\n                                },\n                                Object {\n                                  \"children\": Array [],\n                                  \"message\": \"\",\n                                  \"name\": \"Mu\",\n                                  \"status\": \"INLINED\",\n                                },\n                                Object {\n                                  \"children\": Array [],\n                                  \"message\": \"\",\n                                  \"name\": \"Mu\",\n                                  \"status\": \"INLINED\",\n                                },\n                              ],\n                              \"message\": \"\",\n                              \"name\": \"Zeta\",\n                              \"status\": \"INLINED\",\n                            },\n                          ],\n                          \"message\": \"\",\n                          \"name\": \"Pi\",\n                          \"status\": \"INLINED\",\n                        },\n                      ],\n                      \"message\": \"\",\n                      \"name\": \"Epsilon\",\n                      \"status\": \"INLINED\",\n                    },\n                    Object {\n                      \"children\": Array [\n                        Object {\n                          \"children\": Array [\n                            Object {\n                              \"children\": Array [],\n                              \"message\": \"\",\n                              \"name\": \"Mu\",\n                              \"status\": \"INLINED\",\n                            },\n                            Object {\n                              \"children\": Array [],\n                              \"message\": \"\",\n                              \"name\": \"Mu\",\n                              \"status\": \"INLINED\",\n                            },\n                            Object {\n                              \"children\": Array [],\n                              \"message\": \"\",\n                              \"name\": \"Mu\",\n                              \"status\": \"INLINED\",\n                            },\n                          ],\n                          \"message\": \"\",\n                          \"name\": \"Zeta\",\n                          \"status\": \"INLINED\",\n                        },\n                      ],\n                      \"message\": \"\",\n                      \"name\": \"Pi\",\n                      \"status\": \"INLINED\",\n                    },\n                  ],\n                  \"message\": \"\",\n                  \"name\": \"React.Fragment\",\n                  \"status\": \"NORMAL\",\n                },\n              ],\n              \"message\": \"\",\n              \"name\": \"Delta\",\n              \"status\": \"INLINED\",\n            },\n            Object {\n              \"children\": Array [\n                Object {\n                  \"children\": Array [\n                    Object {\n                      \"children\": Array [\n                        Object {\n                          \"children\": Array [\n                            Object {\n                              \"children\": Array [\n                                Object {\n                                  \"children\": Array [\n                                    Object {\n                                      \"children\": Array [\n                                        Object {\n                                          \"children\": Array [],\n                                          \"message\": \"\",\n                                          \"name\": \"Mu\",\n                                          \"status\": \"INLINED\",\n                                        },\n                                        Object {\n                                          \"children\": Array [],\n                                          \"message\": \"\",\n                                          \"name\": \"Mu\",\n                                          \"status\": \"INLINED\",\n                                        },\n                                        Object {\n                                          \"children\": Array [],\n                                          \"message\": \"\",\n                                          \"name\": \"Mu\",\n                                          \"status\": \"INLINED\",\n                                        },\n                                      ],\n                                      \"message\": \"\",\n                                      \"name\": \"Zeta\",\n                                      \"status\": \"INLINED\",\n                                    },\n                                  ],\n                                  \"message\": \"\",\n                                  \"name\": \"Pi\",\n                                  \"status\": \"INLINED\",\n                                },\n                              ],\n                              \"message\": \"\",\n                              \"name\": \"React.Fragment\",\n                              \"status\": \"NORMAL\",\n                            },\n                            Object {\n                              \"children\": Array [\n                                Object {\n                                  \"children\": Array [\n                                    Object {\n                                      \"children\": Array [],\n                                      \"message\": \"\",\n                                      \"name\": \"React.Fragment\",\n                                      \"status\": \"NORMAL\",\n                                    },\n                                  ],\n                                  \"message\": \"\",\n                                  \"name\": \"Theta\",\n                                  \"status\": \"INLINED\",\n                                },\n                              ],\n                              \"message\": \"\",\n                              \"name\": \"Lambda\",\n                              \"status\": \"INLINED\",\n                            },\n                            Object {\n                              \"children\": Array [\n                                Object {\n                                  \"children\": Array [],\n                                  \"message\": \"\",\n                                  \"name\": \"React.Fragment\",\n                                  \"status\": \"NORMAL\",\n                                },\n                              ],\n                              \"message\": \"\",\n                              \"name\": \"Xi\",\n                              \"status\": \"INLINED\",\n                            },\n                            Object {\n                              \"children\": Array [\n                                Object {\n                                  \"children\": Array [],\n                                  \"message\": \"\",\n                                  \"name\": \"React.Fragment\",\n                                  \"status\": \"NORMAL\",\n                                },\n                              ],\n                              \"message\": \"\",\n                              \"name\": \"Xi\",\n                              \"status\": \"INLINED\",\n                            },\n                            Object {\n                              \"children\": Array [\n                                Object {\n                                  \"children\": Array [\n                                    Object {\n                                      \"children\": Array [],\n                                      \"message\": \"\",\n                                      \"name\": \"Mu\",\n                                      \"status\": \"INLINED\",\n                                    },\n                                    Object {\n                                      \"children\": Array [],\n                                      \"message\": \"\",\n                                      \"name\": \"Mu\",\n                                      \"status\": \"INLINED\",\n                                    },\n                                    Object {\n                                      \"children\": Array [],\n                                      \"message\": \"\",\n                                      \"name\": \"Mu\",\n                                      \"status\": \"INLINED\",\n                                    },\n                                  ],\n                                  \"message\": \"\",\n                                  \"name\": \"Zeta\",\n                                  \"status\": \"INLINED\",\n                                },\n                              ],\n                              \"message\": \"\",\n                              \"name\": \"React.Fragment\",\n                              \"status\": \"NORMAL\",\n                            },\n                          ],\n                          \"message\": \"\",\n                          \"name\": \"React.Fragment\",\n                          \"status\": \"NORMAL\",\n                        },\n                      ],\n                      \"message\": \"\",\n                      \"name\": \"Iota\",\n                      \"status\": \"INLINED\",\n                    },\n                    Object {\n                      \"children\": Array [],\n                      \"message\": \"\",\n                      \"name\": \"Mu\",\n                      \"status\": \"INLINED\",\n                    },\n                    Object {\n                      \"children\": Array [\n                        Object {\n                          \"children\": Array [],\n                          \"message\": \"\",\n                          \"name\": \"React.Fragment\",\n                          \"status\": \"NORMAL\",\n                        },\n                        Object {\n                          \"children\": Array [\n                            Object {\n                              \"children\": Array [\n                                Object {\n                                  \"children\": Array [],\n                                  \"message\": \"\",\n                                  \"name\": \"Mu\",\n                                  \"status\": \"INLINED\",\n                                },\n                                Object {\n                                  \"children\": Array [],\n                                  \"message\": \"\",\n                                  \"name\": \"Mu\",\n                                  \"status\": \"INLINED\",\n                                },\n                                Object {\n                                  \"children\": Array [],\n                                  \"message\": \"\",\n                                  \"name\": \"Mu\",\n                                  \"status\": \"INLINED\",\n                                },\n                              ],\n                              \"message\": \"\",\n                              \"name\": \"Zeta\",\n                              \"status\": \"INLINED\",\n                            },\n                          ],\n                          \"message\": \"\",\n                          \"name\": \"Pi\",\n                          \"status\": \"INLINED\",\n                        },\n                      ],\n                      \"message\": \"\",\n                      \"name\": \"Epsilon\",\n                      \"status\": \"INLINED\",\n                    },\n                    Object {\n                      \"children\": Array [\n                        Object {\n                          \"children\": Array [\n                            Object {\n                              \"children\": Array [],\n                              \"message\": \"\",\n                              \"name\": \"Mu\",\n                              \"status\": \"INLINED\",\n                            },\n                            Object {\n                              \"children\": Array [],\n                              \"message\": \"\",\n                              \"name\": \"Mu\",\n                              \"status\": \"INLINED\",\n                            },\n                            Object {\n                              \"children\": Array [],\n                              \"message\": \"\",\n                              \"name\": \"Mu\",\n                              \"status\": \"INLINED\",\n                            },\n                          ],\n                          \"message\": \"\",\n                          \"name\": \"Zeta\",\n                          \"status\": \"INLINED\",\n                        },\n                      ],\n                      \"message\": \"\",\n                      \"name\": \"Pi\",\n                      \"status\": \"INLINED\",\n                    },\n                  ],\n                  \"message\": \"\",\n                  \"name\": \"React.Fragment\",\n                  \"status\": \"NORMAL\",\n                },\n              ],\n              \"message\": \"\",\n              \"name\": \"Delta\",\n              \"status\": \"INLINED\",\n            },\n            Object {\n              \"children\": Array [\n                Object {\n                  \"children\": Array [],\n                  \"message\": \"\",\n                  \"name\": \"React.Fragment\",\n                  \"status\": \"NORMAL\",\n                },\n              ],\n              \"message\": \"\",\n              \"name\": \"Xi\",\n              \"status\": \"INLINED\",\n            },\n            Object {\n              \"children\": Array [\n                Object {\n                  \"children\": Array [],\n                  \"message\": \"\",\n                  \"name\": \"React.Fragment\",\n                  \"status\": \"NORMAL\",\n                },\n              ],\n              \"message\": \"\",\n              \"name\": \"Xi\",\n              \"status\": \"INLINED\",\n            },\n            Object {\n              \"children\": Array [\n                Object {\n                  \"children\": Array [\n                    Object {\n                      \"children\": Array [\n                        Object {\n                          \"children\": Array [\n                            Object {\n                              \"children\": Array [\n                                Object {\n                                  \"children\": Array [],\n                                  \"message\": \"\",\n                                  \"name\": \"Mu\",\n                                  \"status\": \"INLINED\",\n                                },\n                                Object {\n                                  \"children\": Array [],\n                                  \"message\": \"\",\n                                  \"name\": \"Mu\",\n                                  \"status\": \"INLINED\",\n                                },\n                                Object {\n                                  \"children\": Array [],\n                                  \"message\": \"\",\n                                  \"name\": \"Mu\",\n                                  \"status\": \"INLINED\",\n                                },\n                              ],\n                              \"message\": \"\",\n                              \"name\": \"Zeta\",\n                              \"status\": \"INLINED\",\n                            },\n                          ],\n                          \"message\": \"\",\n                          \"name\": \"Pi\",\n                          \"status\": \"INLINED\",\n                        },\n                      ],\n                      \"message\": \"\",\n                      \"name\": \"React.Fragment\",\n                      \"status\": \"NORMAL\",\n                    },\n                    Object {\n                      \"children\": Array [\n                        Object {\n                          \"children\": Array [\n                            Object {\n                              \"children\": Array [],\n                              \"message\": \"\",\n                              \"name\": \"React.Fragment\",\n                              \"status\": \"NORMAL\",\n                            },\n                          ],\n                          \"message\": \"\",\n                          \"name\": \"Theta\",\n                          \"status\": \"INLINED\",\n                        },\n                      ],\n                      \"message\": \"\",\n                      \"name\": \"Lambda\",\n                      \"status\": \"INLINED\",\n                    },\n                    Object {\n                      \"children\": Array [\n                        Object {\n                          \"children\": Array [],\n                          \"message\": \"\",\n                          \"name\": \"React.Fragment\",\n                          \"status\": \"NORMAL\",\n                        },\n                      ],\n                      \"message\": \"\",\n                      \"name\": \"Xi\",\n                      \"status\": \"INLINED\",\n                    },\n                    Object {\n                      \"children\": Array [\n                        Object {\n                          \"children\": Array [],\n                          \"message\": \"\",\n                          \"name\": \"React.Fragment\",\n                          \"status\": \"NORMAL\",\n                        },\n                      ],\n                      \"message\": \"\",\n                      \"name\": \"Xi\",\n                      \"status\": \"INLINED\",\n                    },\n                    Object {\n                      \"children\": Array [\n                        Object {\n                          \"children\": Array [\n                            Object {\n                              \"children\": Array [],\n                              \"message\": \"\",\n                              \"name\": \"Mu\",\n                              \"status\": \"INLINED\",\n                            },\n                            Object {\n                              \"children\": Array [],\n                              \"message\": \"\",\n                              \"name\": \"Mu\",\n                              \"status\": \"INLINED\",\n                            },\n                            Object {\n                              \"children\": Array [],\n                              \"message\": \"\",\n                              \"name\": \"Mu\",\n                              \"status\": \"INLINED\",\n                            },\n                          ],\n                          \"message\": \"\",\n                          \"name\": \"Zeta\",\n                          \"status\": \"INLINED\",\n                        },\n                      ],\n                      \"message\": \"\",\n                      \"name\": \"React.Fragment\",\n                      \"status\": \"NORMAL\",\n                    },\n                  ],\n                  \"message\": \"\",\n                  \"name\": \"React.Fragment\",\n                  \"status\": \"NORMAL\",\n                },\n              ],\n              \"message\": \"\",\n              \"name\": \"Iota\",\n              \"status\": \"INLINED\",\n            },\n            Object {\n              \"children\": Array [\n                Object {\n                  \"children\": Array [\n                    Object {\n                      \"children\": Array [\n                        Object {\n                          \"children\": Array [\n                            Object {\n                              \"children\": Array [\n                                Object {\n                                  \"children\": Array [\n                                    Object {\n                                      \"children\": Array [\n                                        Object {\n                                          \"children\": Array [],\n                                          \"message\": \"\",\n                                          \"name\": \"Mu\",\n                                          \"status\": \"INLINED\",\n                                        },\n                                        Object {\n                                          \"children\": Array [],\n                                          \"message\": \"\",\n                                          \"name\": \"Mu\",\n                                          \"status\": \"INLINED\",\n                                        },\n                                        Object {\n                                          \"children\": Array [],\n                                          \"message\": \"\",\n                                          \"name\": \"Mu\",\n                                          \"status\": \"INLINED\",\n                                        },\n                                      ],\n                                      \"message\": \"\",\n                                      \"name\": \"Zeta\",\n                                      \"status\": \"INLINED\",\n                                    },\n                                  ],\n                                  \"message\": \"\",\n                                  \"name\": \"Pi\",\n                                  \"status\": \"INLINED\",\n                                },\n                              ],\n                              \"message\": \"\",\n                              \"name\": \"React.Fragment\",\n                              \"status\": \"NORMAL\",\n                            },\n                            Object {\n                              \"children\": Array [\n                                Object {\n                                  \"children\": Array [\n                                    Object {\n                                      \"children\": Array [],\n                                      \"message\": \"\",\n                                      \"name\": \"React.Fragment\",\n                                      \"status\": \"NORMAL\",\n                                    },\n                                  ],\n                                  \"message\": \"\",\n                                  \"name\": \"Theta\",\n                                  \"status\": \"INLINED\",\n                                },\n                              ],\n                              \"message\": \"\",\n                              \"name\": \"Lambda\",\n                              \"status\": \"INLINED\",\n                            },\n                            Object {\n                              \"children\": Array [\n                                Object {\n                                  \"children\": Array [],\n                                  \"message\": \"\",\n                                  \"name\": \"React.Fragment\",\n                                  \"status\": \"NORMAL\",\n                                },\n                              ],\n                              \"message\": \"\",\n                              \"name\": \"Xi\",\n                              \"status\": \"INLINED\",\n                            },\n                            Object {\n                              \"children\": Array [\n                                Object {\n                                  \"children\": Array [],\n                                  \"message\": \"\",\n                                  \"name\": \"React.Fragment\",\n                                  \"status\": \"NORMAL\",\n                                },\n                              ],\n                              \"message\": \"\",\n                              \"name\": \"Xi\",\n                              \"status\": \"INLINED\",\n                            },\n                            Object {\n                              \"children\": Array [\n                                Object {\n                                  \"children\": Array [\n                                    Object {\n                                      \"children\": Array [],\n                                      \"message\": \"\",\n                                      \"name\": \"Mu\",\n                                      \"status\": \"INLINED\",\n                                    },\n                                    Object {\n                                      \"children\": Array [],\n                                      \"message\": \"\",\n                                      \"name\": \"Mu\",\n                                      \"status\": \"INLINED\",\n                                    },\n                                    Object {\n                                      \"children\": Array [],\n                                      \"message\": \"\",\n                                      \"name\": \"Mu\",\n                                      \"status\": \"INLINED\",\n                                    },\n                                  ],\n                                  \"message\": \"\",\n                                  \"name\": \"Zeta\",\n                                  \"status\": \"INLINED\",\n                                },\n                              ],\n                              \"message\": \"\",\n                              \"name\": \"React.Fragment\",\n                              \"status\": \"NORMAL\",\n                            },\n                          ],\n                          \"message\": \"\",\n                          \"name\": \"React.Fragment\",\n                          \"status\": \"NORMAL\",\n                        },\n                      ],\n                      \"message\": \"\",\n                      \"name\": \"Iota\",\n                      \"status\": \"INLINED\",\n                    },\n                    Object {\n                      \"children\": Array [],\n                      \"message\": \"\",\n                      \"name\": \"Mu\",\n                      \"status\": \"INLINED\",\n                    },\n                    Object {\n                      \"children\": Array [\n                        Object {\n                          \"children\": Array [],\n                          \"message\": \"\",\n                          \"name\": \"React.Fragment\",\n                          \"status\": \"NORMAL\",\n                        },\n                        Object {\n                          \"children\": Array [\n                            Object {\n                              \"children\": Array [\n                                Object {\n                                  \"children\": Array [],\n                                  \"message\": \"\",\n                                  \"name\": \"Mu\",\n                                  \"status\": \"INLINED\",\n                                },\n                                Object {\n                                  \"children\": Array [],\n                                  \"message\": \"\",\n                                  \"name\": \"Mu\",\n                                  \"status\": \"INLINED\",\n                                },\n                                Object {\n                                  \"children\": Array [],\n                                  \"message\": \"\",\n                                  \"name\": \"Mu\",\n                                  \"status\": \"INLINED\",\n                                },\n                              ],\n                              \"message\": \"\",\n                              \"name\": \"Zeta\",\n                              \"status\": \"INLINED\",\n                            },\n                          ],\n                          \"message\": \"\",\n                          \"name\": \"Pi\",\n                          \"status\": \"INLINED\",\n                        },\n                      ],\n                      \"message\": \"\",\n                      \"name\": \"Epsilon\",\n                      \"status\": \"INLINED\",\n                    },\n                    Object {\n                      \"children\": Array [\n                        Object {\n                          \"children\": Array [\n                            Object {\n                              \"children\": Array [],\n                              \"message\": \"\",\n                              \"name\": \"Mu\",\n                              \"status\": \"INLINED\",\n                            },\n                            Object {\n                              \"children\": Array [],\n                              \"message\": \"\",\n                              \"name\": \"Mu\",\n                              \"status\": \"INLINED\",\n                            },\n                            Object {\n                              \"children\": Array [],\n                              \"message\": \"\",\n                              \"name\": \"Mu\",\n                              \"status\": \"INLINED\",\n                            },\n                          ],\n                          \"message\": \"\",\n                          \"name\": \"Zeta\",\n                          \"status\": \"INLINED\",\n                        },\n                      ],\n                      \"message\": \"\",\n                      \"name\": \"Pi\",\n                      \"status\": \"INLINED\",\n                    },\n                  ],\n                  \"message\": \"\",\n                  \"name\": \"React.Fragment\",\n                  \"status\": \"NORMAL\",\n                },\n              ],\n              \"message\": \"\",\n              \"name\": \"Delta\",\n              \"status\": \"INLINED\",\n            },\n            Object {\n              \"children\": Array [\n                Object {\n                  \"children\": Array [\n                    Object {\n                      \"children\": Array [\n                        Object {\n                          \"children\": Array [\n                            Object {\n                              \"children\": Array [\n                                Object {\n                                  \"children\": Array [],\n                                  \"message\": \"\",\n                                  \"name\": \"Mu\",\n                                  \"status\": \"INLINED\",\n                                },\n                                Object {\n                                  \"children\": Array [],\n                                  \"message\": \"\",\n                                  \"name\": \"Mu\",\n                                  \"status\": \"INLINED\",\n                                },\n                                Object {\n                                  \"children\": Array [],\n                                  \"message\": \"\",\n                                  \"name\": \"Mu\",\n                                  \"status\": \"INLINED\",\n                                },\n                              ],\n                              \"message\": \"\",\n                              \"name\": \"Zeta\",\n                              \"status\": \"INLINED\",\n                            },\n                          ],\n                          \"message\": \"\",\n                          \"name\": \"Pi\",\n                          \"status\": \"INLINED\",\n                        },\n                      ],\n                      \"message\": \"\",\n                      \"name\": \"React.Fragment\",\n                      \"status\": \"NORMAL\",\n                    },\n                    Object {\n                      \"children\": Array [\n                        Object {\n                          \"children\": Array [\n                            Object {\n                              \"children\": Array [],\n                              \"message\": \"\",\n                              \"name\": \"React.Fragment\",\n                              \"status\": \"NORMAL\",\n                            },\n                          ],\n                          \"message\": \"\",\n                          \"name\": \"Theta\",\n                          \"status\": \"INLINED\",\n                        },\n                      ],\n                      \"message\": \"\",\n                      \"name\": \"Lambda\",\n                      \"status\": \"INLINED\",\n                    },\n                    Object {\n                      \"children\": Array [\n                        Object {\n                          \"children\": Array [],\n                          \"message\": \"\",\n                          \"name\": \"React.Fragment\",\n                          \"status\": \"NORMAL\",\n                        },\n                      ],\n                      \"message\": \"\",\n                      \"name\": \"Xi\",\n                      \"status\": \"INLINED\",\n                    },\n                    Object {\n                      \"children\": Array [\n                        Object {\n                          \"children\": Array [],\n                          \"message\": \"\",\n                          \"name\": \"React.Fragment\",\n                          \"status\": \"NORMAL\",\n                        },\n                      ],\n                      \"message\": \"\",\n                      \"name\": \"Xi\",\n                      \"status\": \"INLINED\",\n                    },\n                    Object {\n                      \"children\": Array [\n                        Object {\n                          \"children\": Array [\n                            Object {\n                              \"children\": Array [],\n                              \"message\": \"\",\n                              \"name\": \"Mu\",\n                              \"status\": \"INLINED\",\n                            },\n                            Object {\n                              \"children\": Array [],\n                              \"message\": \"\",\n                              \"name\": \"Mu\",\n                              \"status\": \"INLINED\",\n                            },\n                            Object {\n                              \"children\": Array [],\n                              \"message\": \"\",\n                              \"name\": \"Mu\",\n                              \"status\": \"INLINED\",\n                            },\n                          ],\n                          \"message\": \"\",\n                          \"name\": \"Zeta\",\n                          \"status\": \"INLINED\",\n                        },\n                      ],\n                      \"message\": \"\",\n                      \"name\": \"React.Fragment\",\n                      \"status\": \"NORMAL\",\n                    },\n                  ],\n                  \"message\": \"\",\n                  \"name\": \"React.Fragment\",\n                  \"status\": \"NORMAL\",\n                },\n              ],\n              \"message\": \"\",\n              \"name\": \"Iota\",\n              \"status\": \"INLINED\",\n            },\n            Object {\n              \"children\": Array [\n                Object {\n                  \"children\": Array [],\n                  \"message\": \"\",\n                  \"name\": \"React.Fragment\",\n                  \"status\": \"NORMAL\",\n                },\n              ],\n              \"message\": \"\",\n              \"name\": \"Xi\",\n              \"status\": \"INLINED\",\n            },\n          ],\n          \"message\": \"\",\n          \"name\": \"React.Fragment\",\n          \"status\": \"NORMAL\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"Gamma\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 138,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`Pathological case: (createElement => JSX) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 188,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [\n            Object {\n              \"children\": Array [\n                Object {\n                  \"children\": Array [],\n                  \"message\": \"\",\n                  \"name\": \"React.Fragment\",\n                  \"status\": \"NORMAL\",\n                },\n              ],\n              \"message\": \"\",\n              \"name\": \"Theta\",\n              \"status\": \"INLINED\",\n            },\n            Object {\n              \"children\": Array [\n                Object {\n                  \"children\": Array [\n                    Object {\n                      \"children\": Array [\n                        Object {\n                          \"children\": Array [\n                            Object {\n                              \"children\": Array [\n                                Object {\n                                  \"children\": Array [],\n                                  \"message\": \"\",\n                                  \"name\": \"Mu\",\n                                  \"status\": \"INLINED\",\n                                },\n                                Object {\n                                  \"children\": Array [],\n                                  \"message\": \"\",\n                                  \"name\": \"Mu\",\n                                  \"status\": \"INLINED\",\n                                },\n                                Object {\n                                  \"children\": Array [],\n                                  \"message\": \"\",\n                                  \"name\": \"Mu\",\n                                  \"status\": \"INLINED\",\n                                },\n                              ],\n                              \"message\": \"\",\n                              \"name\": \"Zeta\",\n                              \"status\": \"INLINED\",\n                            },\n                          ],\n                          \"message\": \"\",\n                          \"name\": \"Pi\",\n                          \"status\": \"INLINED\",\n                        },\n                      ],\n                      \"message\": \"\",\n                      \"name\": \"React.Fragment\",\n                      \"status\": \"NORMAL\",\n                    },\n                    Object {\n                      \"children\": Array [\n                        Object {\n                          \"children\": Array [\n                            Object {\n                              \"children\": Array [],\n                              \"message\": \"\",\n                              \"name\": \"React.Fragment\",\n                              \"status\": \"NORMAL\",\n                            },\n                          ],\n                          \"message\": \"\",\n                          \"name\": \"Theta\",\n                          \"status\": \"INLINED\",\n                        },\n                      ],\n                      \"message\": \"\",\n                      \"name\": \"Lambda\",\n                      \"status\": \"INLINED\",\n                    },\n                    Object {\n                      \"children\": Array [\n                        Object {\n                          \"children\": Array [],\n                          \"message\": \"\",\n                          \"name\": \"React.Fragment\",\n                          \"status\": \"NORMAL\",\n                        },\n                      ],\n                      \"message\": \"\",\n                      \"name\": \"Xi\",\n                      \"status\": \"INLINED\",\n                    },\n                    Object {\n                      \"children\": Array [\n                        Object {\n                          \"children\": Array [],\n                          \"message\": \"\",\n                          \"name\": \"React.Fragment\",\n                          \"status\": \"NORMAL\",\n                        },\n                      ],\n                      \"message\": \"\",\n                      \"name\": \"Xi\",\n                      \"status\": \"INLINED\",\n                    },\n                    Object {\n                      \"children\": Array [\n                        Object {\n                          \"children\": Array [\n                            Object {\n                              \"children\": Array [],\n                              \"message\": \"\",\n                              \"name\": \"Mu\",\n                              \"status\": \"INLINED\",\n                            },\n                            Object {\n                              \"children\": Array [],\n                              \"message\": \"\",\n                              \"name\": \"Mu\",\n                              \"status\": \"INLINED\",\n                            },\n                            Object {\n                              \"children\": Array [],\n                              \"message\": \"\",\n                              \"name\": \"Mu\",\n                              \"status\": \"INLINED\",\n                            },\n                          ],\n                          \"message\": \"\",\n                          \"name\": \"Zeta\",\n                          \"status\": \"INLINED\",\n                        },\n                      ],\n                      \"message\": \"\",\n                      \"name\": \"React.Fragment\",\n                      \"status\": \"NORMAL\",\n                    },\n                  ],\n                  \"message\": \"\",\n                  \"name\": \"React.Fragment\",\n                  \"status\": \"NORMAL\",\n                },\n              ],\n              \"message\": \"\",\n              \"name\": \"Iota\",\n              \"status\": \"INLINED\",\n            },\n            Object {\n              \"children\": Array [\n                Object {\n                  \"children\": Array [],\n                  \"message\": \"\",\n                  \"name\": \"React.Fragment\",\n                  \"status\": \"NORMAL\",\n                },\n              ],\n              \"message\": \"\",\n              \"name\": \"Xi\",\n              \"status\": \"INLINED\",\n            },\n            Object {\n              \"children\": Array [\n                Object {\n                  \"children\": Array [],\n                  \"message\": \"\",\n                  \"name\": \"Mu\",\n                  \"status\": \"INLINED\",\n                },\n                Object {\n                  \"children\": Array [],\n                  \"message\": \"\",\n                  \"name\": \"Mu\",\n                  \"status\": \"INLINED\",\n                },\n                Object {\n                  \"children\": Array [],\n                  \"message\": \"\",\n                  \"name\": \"Mu\",\n                  \"status\": \"INLINED\",\n                },\n              ],\n              \"message\": \"\",\n              \"name\": \"Zeta\",\n              \"status\": \"INLINED\",\n            },\n            Object {\n              \"children\": Array [\n                Object {\n                  \"children\": Array [],\n                  \"message\": \"\",\n                  \"name\": \"React.Fragment\",\n                  \"status\": \"NORMAL\",\n                },\n                Object {\n                  \"children\": Array [\n                    Object {\n                      \"children\": Array [\n                        Object {\n                          \"children\": Array [],\n                          \"message\": \"\",\n                          \"name\": \"Mu\",\n                          \"status\": \"INLINED\",\n                        },\n                        Object {\n                          \"children\": Array [],\n                          \"message\": \"\",\n                          \"name\": \"Mu\",\n                          \"status\": \"INLINED\",\n                        },\n                        Object {\n                          \"children\": Array [],\n                          \"message\": \"\",\n                          \"name\": \"Mu\",\n                          \"status\": \"INLINED\",\n                        },\n                      ],\n                      \"message\": \"\",\n                      \"name\": \"Zeta\",\n                      \"status\": \"INLINED\",\n                    },\n                  ],\n                  \"message\": \"\",\n                  \"name\": \"Pi\",\n                  \"status\": \"INLINED\",\n                },\n              ],\n              \"message\": \"\",\n              \"name\": \"Epsilon\",\n              \"status\": \"INLINED\",\n            },\n            Object {\n              \"children\": Array [\n                Object {\n                  \"children\": Array [\n                    Object {\n                      \"children\": Array [\n                        Object {\n                          \"children\": Array [\n                            Object {\n                              \"children\": Array [\n                                Object {\n                                  \"children\": Array [\n                                    Object {\n                                      \"children\": Array [\n                                        Object {\n                                          \"children\": Array [],\n                                          \"message\": \"\",\n                                          \"name\": \"Mu\",\n                                          \"status\": \"INLINED\",\n                                        },\n                                        Object {\n                                          \"children\": Array [],\n                                          \"message\": \"\",\n                                          \"name\": \"Mu\",\n                                          \"status\": \"INLINED\",\n                                        },\n                                        Object {\n                                          \"children\": Array [],\n                                          \"message\": \"\",\n                                          \"name\": \"Mu\",\n                                          \"status\": \"INLINED\",\n                                        },\n                                      ],\n                                      \"message\": \"\",\n                                      \"name\": \"Zeta\",\n                                      \"status\": \"INLINED\",\n                                    },\n                                  ],\n                                  \"message\": \"\",\n                                  \"name\": \"Pi\",\n                                  \"status\": \"INLINED\",\n                                },\n                              ],\n                              \"message\": \"\",\n                              \"name\": \"React.Fragment\",\n                              \"status\": \"NORMAL\",\n                            },\n                            Object {\n                              \"children\": Array [\n                                Object {\n                                  \"children\": Array [\n                                    Object {\n                                      \"children\": Array [],\n                                      \"message\": \"\",\n                                      \"name\": \"React.Fragment\",\n                                      \"status\": \"NORMAL\",\n                                    },\n                                  ],\n                                  \"message\": \"\",\n                                  \"name\": \"Theta\",\n                                  \"status\": \"INLINED\",\n                                },\n                              ],\n                              \"message\": \"\",\n                              \"name\": \"Lambda\",\n                              \"status\": \"INLINED\",\n                            },\n                            Object {\n                              \"children\": Array [\n                                Object {\n                                  \"children\": Array [],\n                                  \"message\": \"\",\n                                  \"name\": \"React.Fragment\",\n                                  \"status\": \"NORMAL\",\n                                },\n                              ],\n                              \"message\": \"\",\n                              \"name\": \"Xi\",\n                              \"status\": \"INLINED\",\n                            },\n                            Object {\n                              \"children\": Array [\n                                Object {\n                                  \"children\": Array [],\n                                  \"message\": \"\",\n                                  \"name\": \"React.Fragment\",\n                                  \"status\": \"NORMAL\",\n                                },\n                              ],\n                              \"message\": \"\",\n                              \"name\": \"Xi\",\n                              \"status\": \"INLINED\",\n                            },\n                            Object {\n                              \"children\": Array [\n                                Object {\n                                  \"children\": Array [\n                                    Object {\n                                      \"children\": Array [],\n                                      \"message\": \"\",\n                                      \"name\": \"Mu\",\n                                      \"status\": \"INLINED\",\n                                    },\n                                    Object {\n                                      \"children\": Array [],\n                                      \"message\": \"\",\n                                      \"name\": \"Mu\",\n                                      \"status\": \"INLINED\",\n                                    },\n                                    Object {\n                                      \"children\": Array [],\n                                      \"message\": \"\",\n                                      \"name\": \"Mu\",\n                                      \"status\": \"INLINED\",\n                                    },\n                                  ],\n                                  \"message\": \"\",\n                                  \"name\": \"Zeta\",\n                                  \"status\": \"INLINED\",\n                                },\n                              ],\n                              \"message\": \"\",\n                              \"name\": \"React.Fragment\",\n                              \"status\": \"NORMAL\",\n                            },\n                          ],\n                          \"message\": \"\",\n                          \"name\": \"React.Fragment\",\n                          \"status\": \"NORMAL\",\n                        },\n                      ],\n                      \"message\": \"\",\n                      \"name\": \"Iota\",\n                      \"status\": \"INLINED\",\n                    },\n                    Object {\n                      \"children\": Array [],\n                      \"message\": \"\",\n                      \"name\": \"Mu\",\n                      \"status\": \"INLINED\",\n                    },\n                    Object {\n                      \"children\": Array [\n                        Object {\n                          \"children\": Array [],\n                          \"message\": \"\",\n                          \"name\": \"React.Fragment\",\n                          \"status\": \"NORMAL\",\n                        },\n                        Object {\n                          \"children\": Array [\n                            Object {\n                              \"children\": Array [\n                                Object {\n                                  \"children\": Array [],\n                                  \"message\": \"\",\n                                  \"name\": \"Mu\",\n                                  \"status\": \"INLINED\",\n                                },\n                                Object {\n                                  \"children\": Array [],\n                                  \"message\": \"\",\n                                  \"name\": \"Mu\",\n                                  \"status\": \"INLINED\",\n                                },\n                                Object {\n                                  \"children\": Array [],\n                                  \"message\": \"\",\n                                  \"name\": \"Mu\",\n                                  \"status\": \"INLINED\",\n                                },\n                              ],\n                              \"message\": \"\",\n                              \"name\": \"Zeta\",\n                              \"status\": \"INLINED\",\n                            },\n                          ],\n                          \"message\": \"\",\n                          \"name\": \"Pi\",\n                          \"status\": \"INLINED\",\n                        },\n                      ],\n                      \"message\": \"\",\n                      \"name\": \"Epsilon\",\n                      \"status\": \"INLINED\",\n                    },\n                    Object {\n                      \"children\": Array [\n                        Object {\n                          \"children\": Array [\n                            Object {\n                              \"children\": Array [],\n                              \"message\": \"\",\n                              \"name\": \"Mu\",\n                              \"status\": \"INLINED\",\n                            },\n                            Object {\n                              \"children\": Array [],\n                              \"message\": \"\",\n                              \"name\": \"Mu\",\n                              \"status\": \"INLINED\",\n                            },\n                            Object {\n                              \"children\": Array [],\n                              \"message\": \"\",\n                              \"name\": \"Mu\",\n                              \"status\": \"INLINED\",\n                            },\n                          ],\n                          \"message\": \"\",\n                          \"name\": \"Zeta\",\n                          \"status\": \"INLINED\",\n                        },\n                      ],\n                      \"message\": \"\",\n                      \"name\": \"Pi\",\n                      \"status\": \"INLINED\",\n                    },\n                  ],\n                  \"message\": \"\",\n                  \"name\": \"React.Fragment\",\n                  \"status\": \"NORMAL\",\n                },\n              ],\n              \"message\": \"\",\n              \"name\": \"Delta\",\n              \"status\": \"INLINED\",\n            },\n            Object {\n              \"children\": Array [\n                Object {\n                  \"children\": Array [\n                    Object {\n                      \"children\": Array [\n                        Object {\n                          \"children\": Array [\n                            Object {\n                              \"children\": Array [\n                                Object {\n                                  \"children\": Array [\n                                    Object {\n                                      \"children\": Array [\n                                        Object {\n                                          \"children\": Array [],\n                                          \"message\": \"\",\n                                          \"name\": \"Mu\",\n                                          \"status\": \"INLINED\",\n                                        },\n                                        Object {\n                                          \"children\": Array [],\n                                          \"message\": \"\",\n                                          \"name\": \"Mu\",\n                                          \"status\": \"INLINED\",\n                                        },\n                                        Object {\n                                          \"children\": Array [],\n                                          \"message\": \"\",\n                                          \"name\": \"Mu\",\n                                          \"status\": \"INLINED\",\n                                        },\n                                      ],\n                                      \"message\": \"\",\n                                      \"name\": \"Zeta\",\n                                      \"status\": \"INLINED\",\n                                    },\n                                  ],\n                                  \"message\": \"\",\n                                  \"name\": \"Pi\",\n                                  \"status\": \"INLINED\",\n                                },\n                              ],\n                              \"message\": \"\",\n                              \"name\": \"React.Fragment\",\n                              \"status\": \"NORMAL\",\n                            },\n                            Object {\n                              \"children\": Array [\n                                Object {\n                                  \"children\": Array [\n                                    Object {\n                                      \"children\": Array [],\n                                      \"message\": \"\",\n                                      \"name\": \"React.Fragment\",\n                                      \"status\": \"NORMAL\",\n                                    },\n                                  ],\n                                  \"message\": \"\",\n                                  \"name\": \"Theta\",\n                                  \"status\": \"INLINED\",\n                                },\n                              ],\n                              \"message\": \"\",\n                              \"name\": \"Lambda\",\n                              \"status\": \"INLINED\",\n                            },\n                            Object {\n                              \"children\": Array [\n                                Object {\n                                  \"children\": Array [],\n                                  \"message\": \"\",\n                                  \"name\": \"React.Fragment\",\n                                  \"status\": \"NORMAL\",\n                                },\n                              ],\n                              \"message\": \"\",\n                              \"name\": \"Xi\",\n                              \"status\": \"INLINED\",\n                            },\n                            Object {\n                              \"children\": Array [\n                                Object {\n                                  \"children\": Array [],\n                                  \"message\": \"\",\n                                  \"name\": \"React.Fragment\",\n                                  \"status\": \"NORMAL\",\n                                },\n                              ],\n                              \"message\": \"\",\n                              \"name\": \"Xi\",\n                              \"status\": \"INLINED\",\n                            },\n                            Object {\n                              \"children\": Array [\n                                Object {\n                                  \"children\": Array [\n                                    Object {\n                                      \"children\": Array [],\n                                      \"message\": \"\",\n                                      \"name\": \"Mu\",\n                                      \"status\": \"INLINED\",\n                                    },\n                                    Object {\n                                      \"children\": Array [],\n                                      \"message\": \"\",\n                                      \"name\": \"Mu\",\n                                      \"status\": \"INLINED\",\n                                    },\n                                    Object {\n                                      \"children\": Array [],\n                                      \"message\": \"\",\n                                      \"name\": \"Mu\",\n                                      \"status\": \"INLINED\",\n                                    },\n                                  ],\n                                  \"message\": \"\",\n                                  \"name\": \"Zeta\",\n                                  \"status\": \"INLINED\",\n                                },\n                              ],\n                              \"message\": \"\",\n                              \"name\": \"React.Fragment\",\n                              \"status\": \"NORMAL\",\n                            },\n                          ],\n                          \"message\": \"\",\n                          \"name\": \"React.Fragment\",\n                          \"status\": \"NORMAL\",\n                        },\n                      ],\n                      \"message\": \"\",\n                      \"name\": \"Iota\",\n                      \"status\": \"INLINED\",\n                    },\n                    Object {\n                      \"children\": Array [],\n                      \"message\": \"\",\n                      \"name\": \"Mu\",\n                      \"status\": \"INLINED\",\n                    },\n                    Object {\n                      \"children\": Array [\n                        Object {\n                          \"children\": Array [],\n                          \"message\": \"\",\n                          \"name\": \"React.Fragment\",\n                          \"status\": \"NORMAL\",\n                        },\n                        Object {\n                          \"children\": Array [\n                            Object {\n                              \"children\": Array [\n                                Object {\n                                  \"children\": Array [],\n                                  \"message\": \"\",\n                                  \"name\": \"Mu\",\n                                  \"status\": \"INLINED\",\n                                },\n                                Object {\n                                  \"children\": Array [],\n                                  \"message\": \"\",\n                                  \"name\": \"Mu\",\n                                  \"status\": \"INLINED\",\n                                },\n                                Object {\n                                  \"children\": Array [],\n                                  \"message\": \"\",\n                                  \"name\": \"Mu\",\n                                  \"status\": \"INLINED\",\n                                },\n                              ],\n                              \"message\": \"\",\n                              \"name\": \"Zeta\",\n                              \"status\": \"INLINED\",\n                            },\n                          ],\n                          \"message\": \"\",\n                          \"name\": \"Pi\",\n                          \"status\": \"INLINED\",\n                        },\n                      ],\n                      \"message\": \"\",\n                      \"name\": \"Epsilon\",\n                      \"status\": \"INLINED\",\n                    },\n                    Object {\n                      \"children\": Array [\n                        Object {\n                          \"children\": Array [\n                            Object {\n                              \"children\": Array [],\n                              \"message\": \"\",\n                              \"name\": \"Mu\",\n                              \"status\": \"INLINED\",\n                            },\n                            Object {\n                              \"children\": Array [],\n                              \"message\": \"\",\n                              \"name\": \"Mu\",\n                              \"status\": \"INLINED\",\n                            },\n                            Object {\n                              \"children\": Array [],\n                              \"message\": \"\",\n                              \"name\": \"Mu\",\n                              \"status\": \"INLINED\",\n                            },\n                          ],\n                          \"message\": \"\",\n                          \"name\": \"Zeta\",\n                          \"status\": \"INLINED\",\n                        },\n                      ],\n                      \"message\": \"\",\n                      \"name\": \"Pi\",\n                      \"status\": \"INLINED\",\n                    },\n                  ],\n                  \"message\": \"\",\n                  \"name\": \"React.Fragment\",\n                  \"status\": \"NORMAL\",\n                },\n              ],\n              \"message\": \"\",\n              \"name\": \"Delta\",\n              \"status\": \"INLINED\",\n            },\n            Object {\n              \"children\": Array [\n                Object {\n                  \"children\": Array [],\n                  \"message\": \"\",\n                  \"name\": \"React.Fragment\",\n                  \"status\": \"NORMAL\",\n                },\n              ],\n              \"message\": \"\",\n              \"name\": \"Xi\",\n              \"status\": \"INLINED\",\n            },\n            Object {\n              \"children\": Array [\n                Object {\n                  \"children\": Array [],\n                  \"message\": \"\",\n                  \"name\": \"React.Fragment\",\n                  \"status\": \"NORMAL\",\n                },\n              ],\n              \"message\": \"\",\n              \"name\": \"Xi\",\n              \"status\": \"INLINED\",\n            },\n            Object {\n              \"children\": Array [\n                Object {\n                  \"children\": Array [\n                    Object {\n                      \"children\": Array [\n                        Object {\n                          \"children\": Array [\n                            Object {\n                              \"children\": Array [\n                                Object {\n                                  \"children\": Array [],\n                                  \"message\": \"\",\n                                  \"name\": \"Mu\",\n                                  \"status\": \"INLINED\",\n                                },\n                                Object {\n                                  \"children\": Array [],\n                                  \"message\": \"\",\n                                  \"name\": \"Mu\",\n                                  \"status\": \"INLINED\",\n                                },\n                                Object {\n                                  \"children\": Array [],\n                                  \"message\": \"\",\n                                  \"name\": \"Mu\",\n                                  \"status\": \"INLINED\",\n                                },\n                              ],\n                              \"message\": \"\",\n                              \"name\": \"Zeta\",\n                              \"status\": \"INLINED\",\n                            },\n                          ],\n                          \"message\": \"\",\n                          \"name\": \"Pi\",\n                          \"status\": \"INLINED\",\n                        },\n                      ],\n                      \"message\": \"\",\n                      \"name\": \"React.Fragment\",\n                      \"status\": \"NORMAL\",\n                    },\n                    Object {\n                      \"children\": Array [\n                        Object {\n                          \"children\": Array [\n                            Object {\n                              \"children\": Array [],\n                              \"message\": \"\",\n                              \"name\": \"React.Fragment\",\n                              \"status\": \"NORMAL\",\n                            },\n                          ],\n                          \"message\": \"\",\n                          \"name\": \"Theta\",\n                          \"status\": \"INLINED\",\n                        },\n                      ],\n                      \"message\": \"\",\n                      \"name\": \"Lambda\",\n                      \"status\": \"INLINED\",\n                    },\n                    Object {\n                      \"children\": Array [\n                        Object {\n                          \"children\": Array [],\n                          \"message\": \"\",\n                          \"name\": \"React.Fragment\",\n                          \"status\": \"NORMAL\",\n                        },\n                      ],\n                      \"message\": \"\",\n                      \"name\": \"Xi\",\n                      \"status\": \"INLINED\",\n                    },\n                    Object {\n                      \"children\": Array [\n                        Object {\n                          \"children\": Array [],\n                          \"message\": \"\",\n                          \"name\": \"React.Fragment\",\n                          \"status\": \"NORMAL\",\n                        },\n                      ],\n                      \"message\": \"\",\n                      \"name\": \"Xi\",\n                      \"status\": \"INLINED\",\n                    },\n                    Object {\n                      \"children\": Array [\n                        Object {\n                          \"children\": Array [\n                            Object {\n                              \"children\": Array [],\n                              \"message\": \"\",\n                              \"name\": \"Mu\",\n                              \"status\": \"INLINED\",\n                            },\n                            Object {\n                              \"children\": Array [],\n                              \"message\": \"\",\n                              \"name\": \"Mu\",\n                              \"status\": \"INLINED\",\n                            },\n                            Object {\n                              \"children\": Array [],\n                              \"message\": \"\",\n                              \"name\": \"Mu\",\n                              \"status\": \"INLINED\",\n                            },\n                          ],\n                          \"message\": \"\",\n                          \"name\": \"Zeta\",\n                          \"status\": \"INLINED\",\n                        },\n                      ],\n                      \"message\": \"\",\n                      \"name\": \"React.Fragment\",\n                      \"status\": \"NORMAL\",\n                    },\n                  ],\n                  \"message\": \"\",\n                  \"name\": \"React.Fragment\",\n                  \"status\": \"NORMAL\",\n                },\n              ],\n              \"message\": \"\",\n              \"name\": \"Iota\",\n              \"status\": \"INLINED\",\n            },\n            Object {\n              \"children\": Array [\n                Object {\n                  \"children\": Array [\n                    Object {\n                      \"children\": Array [\n                        Object {\n                          \"children\": Array [\n                            Object {\n                              \"children\": Array [\n                                Object {\n                                  \"children\": Array [\n                                    Object {\n                                      \"children\": Array [\n                                        Object {\n                                          \"children\": Array [],\n                                          \"message\": \"\",\n                                          \"name\": \"Mu\",\n                                          \"status\": \"INLINED\",\n                                        },\n                                        Object {\n                                          \"children\": Array [],\n                                          \"message\": \"\",\n                                          \"name\": \"Mu\",\n                                          \"status\": \"INLINED\",\n                                        },\n                                        Object {\n                                          \"children\": Array [],\n                                          \"message\": \"\",\n                                          \"name\": \"Mu\",\n                                          \"status\": \"INLINED\",\n                                        },\n                                      ],\n                                      \"message\": \"\",\n                                      \"name\": \"Zeta\",\n                                      \"status\": \"INLINED\",\n                                    },\n                                  ],\n                                  \"message\": \"\",\n                                  \"name\": \"Pi\",\n                                  \"status\": \"INLINED\",\n                                },\n                              ],\n                              \"message\": \"\",\n                              \"name\": \"React.Fragment\",\n                              \"status\": \"NORMAL\",\n                            },\n                            Object {\n                              \"children\": Array [\n                                Object {\n                                  \"children\": Array [\n                                    Object {\n                                      \"children\": Array [],\n                                      \"message\": \"\",\n                                      \"name\": \"React.Fragment\",\n                                      \"status\": \"NORMAL\",\n                                    },\n                                  ],\n                                  \"message\": \"\",\n                                  \"name\": \"Theta\",\n                                  \"status\": \"INLINED\",\n                                },\n                              ],\n                              \"message\": \"\",\n                              \"name\": \"Lambda\",\n                              \"status\": \"INLINED\",\n                            },\n                            Object {\n                              \"children\": Array [\n                                Object {\n                                  \"children\": Array [],\n                                  \"message\": \"\",\n                                  \"name\": \"React.Fragment\",\n                                  \"status\": \"NORMAL\",\n                                },\n                              ],\n                              \"message\": \"\",\n                              \"name\": \"Xi\",\n                              \"status\": \"INLINED\",\n                            },\n                            Object {\n                              \"children\": Array [\n                                Object {\n                                  \"children\": Array [],\n                                  \"message\": \"\",\n                                  \"name\": \"React.Fragment\",\n                                  \"status\": \"NORMAL\",\n                                },\n                              ],\n                              \"message\": \"\",\n                              \"name\": \"Xi\",\n                              \"status\": \"INLINED\",\n                            },\n                            Object {\n                              \"children\": Array [\n                                Object {\n                                  \"children\": Array [\n                                    Object {\n                                      \"children\": Array [],\n                                      \"message\": \"\",\n                                      \"name\": \"Mu\",\n                                      \"status\": \"INLINED\",\n                                    },\n                                    Object {\n                                      \"children\": Array [],\n                                      \"message\": \"\",\n                                      \"name\": \"Mu\",\n                                      \"status\": \"INLINED\",\n                                    },\n                                    Object {\n                                      \"children\": Array [],\n                                      \"message\": \"\",\n                                      \"name\": \"Mu\",\n                                      \"status\": \"INLINED\",\n                                    },\n                                  ],\n                                  \"message\": \"\",\n                                  \"name\": \"Zeta\",\n                                  \"status\": \"INLINED\",\n                                },\n                              ],\n                              \"message\": \"\",\n                              \"name\": \"React.Fragment\",\n                              \"status\": \"NORMAL\",\n                            },\n                          ],\n                          \"message\": \"\",\n                          \"name\": \"React.Fragment\",\n                          \"status\": \"NORMAL\",\n                        },\n                      ],\n                      \"message\": \"\",\n                      \"name\": \"Iota\",\n                      \"status\": \"INLINED\",\n                    },\n                    Object {\n                      \"children\": Array [],\n                      \"message\": \"\",\n                      \"name\": \"Mu\",\n                      \"status\": \"INLINED\",\n                    },\n                    Object {\n                      \"children\": Array [\n                        Object {\n                          \"children\": Array [],\n                          \"message\": \"\",\n                          \"name\": \"React.Fragment\",\n                          \"status\": \"NORMAL\",\n                        },\n                        Object {\n                          \"children\": Array [\n                            Object {\n                              \"children\": Array [\n                                Object {\n                                  \"children\": Array [],\n                                  \"message\": \"\",\n                                  \"name\": \"Mu\",\n                                  \"status\": \"INLINED\",\n                                },\n                                Object {\n                                  \"children\": Array [],\n                                  \"message\": \"\",\n                                  \"name\": \"Mu\",\n                                  \"status\": \"INLINED\",\n                                },\n                                Object {\n                                  \"children\": Array [],\n                                  \"message\": \"\",\n                                  \"name\": \"Mu\",\n                                  \"status\": \"INLINED\",\n                                },\n                              ],\n                              \"message\": \"\",\n                              \"name\": \"Zeta\",\n                              \"status\": \"INLINED\",\n                            },\n                          ],\n                          \"message\": \"\",\n                          \"name\": \"Pi\",\n                          \"status\": \"INLINED\",\n                        },\n                      ],\n                      \"message\": \"\",\n                      \"name\": \"Epsilon\",\n                      \"status\": \"INLINED\",\n                    },\n                    Object {\n                      \"children\": Array [\n                        Object {\n                          \"children\": Array [\n                            Object {\n                              \"children\": Array [],\n                              \"message\": \"\",\n                              \"name\": \"Mu\",\n                              \"status\": \"INLINED\",\n                            },\n                            Object {\n                              \"children\": Array [],\n                              \"message\": \"\",\n                              \"name\": \"Mu\",\n                              \"status\": \"INLINED\",\n                            },\n                            Object {\n                              \"children\": Array [],\n                              \"message\": \"\",\n                              \"name\": \"Mu\",\n                              \"status\": \"INLINED\",\n                            },\n                          ],\n                          \"message\": \"\",\n                          \"name\": \"Zeta\",\n                          \"status\": \"INLINED\",\n                        },\n                      ],\n                      \"message\": \"\",\n                      \"name\": \"Pi\",\n                      \"status\": \"INLINED\",\n                    },\n                  ],\n                  \"message\": \"\",\n                  \"name\": \"React.Fragment\",\n                  \"status\": \"NORMAL\",\n                },\n              ],\n              \"message\": \"\",\n              \"name\": \"Delta\",\n              \"status\": \"INLINED\",\n            },\n            Object {\n              \"children\": Array [\n                Object {\n                  \"children\": Array [\n                    Object {\n                      \"children\": Array [\n                        Object {\n                          \"children\": Array [\n                            Object {\n                              \"children\": Array [\n                                Object {\n                                  \"children\": Array [],\n                                  \"message\": \"\",\n                                  \"name\": \"Mu\",\n                                  \"status\": \"INLINED\",\n                                },\n                                Object {\n                                  \"children\": Array [],\n                                  \"message\": \"\",\n                                  \"name\": \"Mu\",\n                                  \"status\": \"INLINED\",\n                                },\n                                Object {\n                                  \"children\": Array [],\n                                  \"message\": \"\",\n                                  \"name\": \"Mu\",\n                                  \"status\": \"INLINED\",\n                                },\n                              ],\n                              \"message\": \"\",\n                              \"name\": \"Zeta\",\n                              \"status\": \"INLINED\",\n                            },\n                          ],\n                          \"message\": \"\",\n                          \"name\": \"Pi\",\n                          \"status\": \"INLINED\",\n                        },\n                      ],\n                      \"message\": \"\",\n                      \"name\": \"React.Fragment\",\n                      \"status\": \"NORMAL\",\n                    },\n                    Object {\n                      \"children\": Array [\n                        Object {\n                          \"children\": Array [\n                            Object {\n                              \"children\": Array [],\n                              \"message\": \"\",\n                              \"name\": \"React.Fragment\",\n                              \"status\": \"NORMAL\",\n                            },\n                          ],\n                          \"message\": \"\",\n                          \"name\": \"Theta\",\n                          \"status\": \"INLINED\",\n                        },\n                      ],\n                      \"message\": \"\",\n                      \"name\": \"Lambda\",\n                      \"status\": \"INLINED\",\n                    },\n                    Object {\n                      \"children\": Array [\n                        Object {\n                          \"children\": Array [],\n                          \"message\": \"\",\n                          \"name\": \"React.Fragment\",\n                          \"status\": \"NORMAL\",\n                        },\n                      ],\n                      \"message\": \"\",\n                      \"name\": \"Xi\",\n                      \"status\": \"INLINED\",\n                    },\n                    Object {\n                      \"children\": Array [\n                        Object {\n                          \"children\": Array [],\n                          \"message\": \"\",\n                          \"name\": \"React.Fragment\",\n                          \"status\": \"NORMAL\",\n                        },\n                      ],\n                      \"message\": \"\",\n                      \"name\": \"Xi\",\n                      \"status\": \"INLINED\",\n                    },\n                    Object {\n                      \"children\": Array [\n                        Object {\n                          \"children\": Array [\n                            Object {\n                              \"children\": Array [],\n                              \"message\": \"\",\n                              \"name\": \"Mu\",\n                              \"status\": \"INLINED\",\n                            },\n                            Object {\n                              \"children\": Array [],\n                              \"message\": \"\",\n                              \"name\": \"Mu\",\n                              \"status\": \"INLINED\",\n                            },\n                            Object {\n                              \"children\": Array [],\n                              \"message\": \"\",\n                              \"name\": \"Mu\",\n                              \"status\": \"INLINED\",\n                            },\n                          ],\n                          \"message\": \"\",\n                          \"name\": \"Zeta\",\n                          \"status\": \"INLINED\",\n                        },\n                      ],\n                      \"message\": \"\",\n                      \"name\": \"React.Fragment\",\n                      \"status\": \"NORMAL\",\n                    },\n                  ],\n                  \"message\": \"\",\n                  \"name\": \"React.Fragment\",\n                  \"status\": \"NORMAL\",\n                },\n              ],\n              \"message\": \"\",\n              \"name\": \"Iota\",\n              \"status\": \"INLINED\",\n            },\n            Object {\n              \"children\": Array [\n                Object {\n                  \"children\": Array [],\n                  \"message\": \"\",\n                  \"name\": \"React.Fragment\",\n                  \"status\": \"NORMAL\",\n                },\n              ],\n              \"message\": \"\",\n              \"name\": \"Xi\",\n              \"status\": \"INLINED\",\n            },\n          ],\n          \"message\": \"\",\n          \"name\": \"React.Fragment\",\n          \"status\": \"NORMAL\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"Gamma\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 138,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`Pathological case: (createElement => createElement) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 188,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [\n            Object {\n              \"children\": Array [\n                Object {\n                  \"children\": Array [],\n                  \"message\": \"\",\n                  \"name\": \"React.Fragment\",\n                  \"status\": \"NORMAL\",\n                },\n              ],\n              \"message\": \"\",\n              \"name\": \"Theta\",\n              \"status\": \"INLINED\",\n            },\n            Object {\n              \"children\": Array [\n                Object {\n                  \"children\": Array [\n                    Object {\n                      \"children\": Array [\n                        Object {\n                          \"children\": Array [\n                            Object {\n                              \"children\": Array [\n                                Object {\n                                  \"children\": Array [],\n                                  \"message\": \"\",\n                                  \"name\": \"Mu\",\n                                  \"status\": \"INLINED\",\n                                },\n                                Object {\n                                  \"children\": Array [],\n                                  \"message\": \"\",\n                                  \"name\": \"Mu\",\n                                  \"status\": \"INLINED\",\n                                },\n                                Object {\n                                  \"children\": Array [],\n                                  \"message\": \"\",\n                                  \"name\": \"Mu\",\n                                  \"status\": \"INLINED\",\n                                },\n                              ],\n                              \"message\": \"\",\n                              \"name\": \"Zeta\",\n                              \"status\": \"INLINED\",\n                            },\n                          ],\n                          \"message\": \"\",\n                          \"name\": \"Pi\",\n                          \"status\": \"INLINED\",\n                        },\n                      ],\n                      \"message\": \"\",\n                      \"name\": \"React.Fragment\",\n                      \"status\": \"NORMAL\",\n                    },\n                    Object {\n                      \"children\": Array [\n                        Object {\n                          \"children\": Array [\n                            Object {\n                              \"children\": Array [],\n                              \"message\": \"\",\n                              \"name\": \"React.Fragment\",\n                              \"status\": \"NORMAL\",\n                            },\n                          ],\n                          \"message\": \"\",\n                          \"name\": \"Theta\",\n                          \"status\": \"INLINED\",\n                        },\n                      ],\n                      \"message\": \"\",\n                      \"name\": \"Lambda\",\n                      \"status\": \"INLINED\",\n                    },\n                    Object {\n                      \"children\": Array [\n                        Object {\n                          \"children\": Array [],\n                          \"message\": \"\",\n                          \"name\": \"React.Fragment\",\n                          \"status\": \"NORMAL\",\n                        },\n                      ],\n                      \"message\": \"\",\n                      \"name\": \"Xi\",\n                      \"status\": \"INLINED\",\n                    },\n                    Object {\n                      \"children\": Array [\n                        Object {\n                          \"children\": Array [],\n                          \"message\": \"\",\n                          \"name\": \"React.Fragment\",\n                          \"status\": \"NORMAL\",\n                        },\n                      ],\n                      \"message\": \"\",\n                      \"name\": \"Xi\",\n                      \"status\": \"INLINED\",\n                    },\n                    Object {\n                      \"children\": Array [\n                        Object {\n                          \"children\": Array [\n                            Object {\n                              \"children\": Array [],\n                              \"message\": \"\",\n                              \"name\": \"Mu\",\n                              \"status\": \"INLINED\",\n                            },\n                            Object {\n                              \"children\": Array [],\n                              \"message\": \"\",\n                              \"name\": \"Mu\",\n                              \"status\": \"INLINED\",\n                            },\n                            Object {\n                              \"children\": Array [],\n                              \"message\": \"\",\n                              \"name\": \"Mu\",\n                              \"status\": \"INLINED\",\n                            },\n                          ],\n                          \"message\": \"\",\n                          \"name\": \"Zeta\",\n                          \"status\": \"INLINED\",\n                        },\n                      ],\n                      \"message\": \"\",\n                      \"name\": \"React.Fragment\",\n                      \"status\": \"NORMAL\",\n                    },\n                  ],\n                  \"message\": \"\",\n                  \"name\": \"React.Fragment\",\n                  \"status\": \"NORMAL\",\n                },\n              ],\n              \"message\": \"\",\n              \"name\": \"Iota\",\n              \"status\": \"INLINED\",\n            },\n            Object {\n              \"children\": Array [\n                Object {\n                  \"children\": Array [],\n                  \"message\": \"\",\n                  \"name\": \"React.Fragment\",\n                  \"status\": \"NORMAL\",\n                },\n              ],\n              \"message\": \"\",\n              \"name\": \"Xi\",\n              \"status\": \"INLINED\",\n            },\n            Object {\n              \"children\": Array [\n                Object {\n                  \"children\": Array [],\n                  \"message\": \"\",\n                  \"name\": \"Mu\",\n                  \"status\": \"INLINED\",\n                },\n                Object {\n                  \"children\": Array [],\n                  \"message\": \"\",\n                  \"name\": \"Mu\",\n                  \"status\": \"INLINED\",\n                },\n                Object {\n                  \"children\": Array [],\n                  \"message\": \"\",\n                  \"name\": \"Mu\",\n                  \"status\": \"INLINED\",\n                },\n              ],\n              \"message\": \"\",\n              \"name\": \"Zeta\",\n              \"status\": \"INLINED\",\n            },\n            Object {\n              \"children\": Array [\n                Object {\n                  \"children\": Array [],\n                  \"message\": \"\",\n                  \"name\": \"React.Fragment\",\n                  \"status\": \"NORMAL\",\n                },\n                Object {\n                  \"children\": Array [\n                    Object {\n                      \"children\": Array [\n                        Object {\n                          \"children\": Array [],\n                          \"message\": \"\",\n                          \"name\": \"Mu\",\n                          \"status\": \"INLINED\",\n                        },\n                        Object {\n                          \"children\": Array [],\n                          \"message\": \"\",\n                          \"name\": \"Mu\",\n                          \"status\": \"INLINED\",\n                        },\n                        Object {\n                          \"children\": Array [],\n                          \"message\": \"\",\n                          \"name\": \"Mu\",\n                          \"status\": \"INLINED\",\n                        },\n                      ],\n                      \"message\": \"\",\n                      \"name\": \"Zeta\",\n                      \"status\": \"INLINED\",\n                    },\n                  ],\n                  \"message\": \"\",\n                  \"name\": \"Pi\",\n                  \"status\": \"INLINED\",\n                },\n              ],\n              \"message\": \"\",\n              \"name\": \"Epsilon\",\n              \"status\": \"INLINED\",\n            },\n            Object {\n              \"children\": Array [\n                Object {\n                  \"children\": Array [\n                    Object {\n                      \"children\": Array [\n                        Object {\n                          \"children\": Array [\n                            Object {\n                              \"children\": Array [\n                                Object {\n                                  \"children\": Array [\n                                    Object {\n                                      \"children\": Array [\n                                        Object {\n                                          \"children\": Array [],\n                                          \"message\": \"\",\n                                          \"name\": \"Mu\",\n                                          \"status\": \"INLINED\",\n                                        },\n                                        Object {\n                                          \"children\": Array [],\n                                          \"message\": \"\",\n                                          \"name\": \"Mu\",\n                                          \"status\": \"INLINED\",\n                                        },\n                                        Object {\n                                          \"children\": Array [],\n                                          \"message\": \"\",\n                                          \"name\": \"Mu\",\n                                          \"status\": \"INLINED\",\n                                        },\n                                      ],\n                                      \"message\": \"\",\n                                      \"name\": \"Zeta\",\n                                      \"status\": \"INLINED\",\n                                    },\n                                  ],\n                                  \"message\": \"\",\n                                  \"name\": \"Pi\",\n                                  \"status\": \"INLINED\",\n                                },\n                              ],\n                              \"message\": \"\",\n                              \"name\": \"React.Fragment\",\n                              \"status\": \"NORMAL\",\n                            },\n                            Object {\n                              \"children\": Array [\n                                Object {\n                                  \"children\": Array [\n                                    Object {\n                                      \"children\": Array [],\n                                      \"message\": \"\",\n                                      \"name\": \"React.Fragment\",\n                                      \"status\": \"NORMAL\",\n                                    },\n                                  ],\n                                  \"message\": \"\",\n                                  \"name\": \"Theta\",\n                                  \"status\": \"INLINED\",\n                                },\n                              ],\n                              \"message\": \"\",\n                              \"name\": \"Lambda\",\n                              \"status\": \"INLINED\",\n                            },\n                            Object {\n                              \"children\": Array [\n                                Object {\n                                  \"children\": Array [],\n                                  \"message\": \"\",\n                                  \"name\": \"React.Fragment\",\n                                  \"status\": \"NORMAL\",\n                                },\n                              ],\n                              \"message\": \"\",\n                              \"name\": \"Xi\",\n                              \"status\": \"INLINED\",\n                            },\n                            Object {\n                              \"children\": Array [\n                                Object {\n                                  \"children\": Array [],\n                                  \"message\": \"\",\n                                  \"name\": \"React.Fragment\",\n                                  \"status\": \"NORMAL\",\n                                },\n                              ],\n                              \"message\": \"\",\n                              \"name\": \"Xi\",\n                              \"status\": \"INLINED\",\n                            },\n                            Object {\n                              \"children\": Array [\n                                Object {\n                                  \"children\": Array [\n                                    Object {\n                                      \"children\": Array [],\n                                      \"message\": \"\",\n                                      \"name\": \"Mu\",\n                                      \"status\": \"INLINED\",\n                                    },\n                                    Object {\n                                      \"children\": Array [],\n                                      \"message\": \"\",\n                                      \"name\": \"Mu\",\n                                      \"status\": \"INLINED\",\n                                    },\n                                    Object {\n                                      \"children\": Array [],\n                                      \"message\": \"\",\n                                      \"name\": \"Mu\",\n                                      \"status\": \"INLINED\",\n                                    },\n                                  ],\n                                  \"message\": \"\",\n                                  \"name\": \"Zeta\",\n                                  \"status\": \"INLINED\",\n                                },\n                              ],\n                              \"message\": \"\",\n                              \"name\": \"React.Fragment\",\n                              \"status\": \"NORMAL\",\n                            },\n                          ],\n                          \"message\": \"\",\n                          \"name\": \"React.Fragment\",\n                          \"status\": \"NORMAL\",\n                        },\n                      ],\n                      \"message\": \"\",\n                      \"name\": \"Iota\",\n                      \"status\": \"INLINED\",\n                    },\n                    Object {\n                      \"children\": Array [],\n                      \"message\": \"\",\n                      \"name\": \"Mu\",\n                      \"status\": \"INLINED\",\n                    },\n                    Object {\n                      \"children\": Array [\n                        Object {\n                          \"children\": Array [],\n                          \"message\": \"\",\n                          \"name\": \"React.Fragment\",\n                          \"status\": \"NORMAL\",\n                        },\n                        Object {\n                          \"children\": Array [\n                            Object {\n                              \"children\": Array [\n                                Object {\n                                  \"children\": Array [],\n                                  \"message\": \"\",\n                                  \"name\": \"Mu\",\n                                  \"status\": \"INLINED\",\n                                },\n                                Object {\n                                  \"children\": Array [],\n                                  \"message\": \"\",\n                                  \"name\": \"Mu\",\n                                  \"status\": \"INLINED\",\n                                },\n                                Object {\n                                  \"children\": Array [],\n                                  \"message\": \"\",\n                                  \"name\": \"Mu\",\n                                  \"status\": \"INLINED\",\n                                },\n                              ],\n                              \"message\": \"\",\n                              \"name\": \"Zeta\",\n                              \"status\": \"INLINED\",\n                            },\n                          ],\n                          \"message\": \"\",\n                          \"name\": \"Pi\",\n                          \"status\": \"INLINED\",\n                        },\n                      ],\n                      \"message\": \"\",\n                      \"name\": \"Epsilon\",\n                      \"status\": \"INLINED\",\n                    },\n                    Object {\n                      \"children\": Array [\n                        Object {\n                          \"children\": Array [\n                            Object {\n                              \"children\": Array [],\n                              \"message\": \"\",\n                              \"name\": \"Mu\",\n                              \"status\": \"INLINED\",\n                            },\n                            Object {\n                              \"children\": Array [],\n                              \"message\": \"\",\n                              \"name\": \"Mu\",\n                              \"status\": \"INLINED\",\n                            },\n                            Object {\n                              \"children\": Array [],\n                              \"message\": \"\",\n                              \"name\": \"Mu\",\n                              \"status\": \"INLINED\",\n                            },\n                          ],\n                          \"message\": \"\",\n                          \"name\": \"Zeta\",\n                          \"status\": \"INLINED\",\n                        },\n                      ],\n                      \"message\": \"\",\n                      \"name\": \"Pi\",\n                      \"status\": \"INLINED\",\n                    },\n                  ],\n                  \"message\": \"\",\n                  \"name\": \"React.Fragment\",\n                  \"status\": \"NORMAL\",\n                },\n              ],\n              \"message\": \"\",\n              \"name\": \"Delta\",\n              \"status\": \"INLINED\",\n            },\n            Object {\n              \"children\": Array [\n                Object {\n                  \"children\": Array [\n                    Object {\n                      \"children\": Array [\n                        Object {\n                          \"children\": Array [\n                            Object {\n                              \"children\": Array [\n                                Object {\n                                  \"children\": Array [\n                                    Object {\n                                      \"children\": Array [\n                                        Object {\n                                          \"children\": Array [],\n                                          \"message\": \"\",\n                                          \"name\": \"Mu\",\n                                          \"status\": \"INLINED\",\n                                        },\n                                        Object {\n                                          \"children\": Array [],\n                                          \"message\": \"\",\n                                          \"name\": \"Mu\",\n                                          \"status\": \"INLINED\",\n                                        },\n                                        Object {\n                                          \"children\": Array [],\n                                          \"message\": \"\",\n                                          \"name\": \"Mu\",\n                                          \"status\": \"INLINED\",\n                                        },\n                                      ],\n                                      \"message\": \"\",\n                                      \"name\": \"Zeta\",\n                                      \"status\": \"INLINED\",\n                                    },\n                                  ],\n                                  \"message\": \"\",\n                                  \"name\": \"Pi\",\n                                  \"status\": \"INLINED\",\n                                },\n                              ],\n                              \"message\": \"\",\n                              \"name\": \"React.Fragment\",\n                              \"status\": \"NORMAL\",\n                            },\n                            Object {\n                              \"children\": Array [\n                                Object {\n                                  \"children\": Array [\n                                    Object {\n                                      \"children\": Array [],\n                                      \"message\": \"\",\n                                      \"name\": \"React.Fragment\",\n                                      \"status\": \"NORMAL\",\n                                    },\n                                  ],\n                                  \"message\": \"\",\n                                  \"name\": \"Theta\",\n                                  \"status\": \"INLINED\",\n                                },\n                              ],\n                              \"message\": \"\",\n                              \"name\": \"Lambda\",\n                              \"status\": \"INLINED\",\n                            },\n                            Object {\n                              \"children\": Array [\n                                Object {\n                                  \"children\": Array [],\n                                  \"message\": \"\",\n                                  \"name\": \"React.Fragment\",\n                                  \"status\": \"NORMAL\",\n                                },\n                              ],\n                              \"message\": \"\",\n                              \"name\": \"Xi\",\n                              \"status\": \"INLINED\",\n                            },\n                            Object {\n                              \"children\": Array [\n                                Object {\n                                  \"children\": Array [],\n                                  \"message\": \"\",\n                                  \"name\": \"React.Fragment\",\n                                  \"status\": \"NORMAL\",\n                                },\n                              ],\n                              \"message\": \"\",\n                              \"name\": \"Xi\",\n                              \"status\": \"INLINED\",\n                            },\n                            Object {\n                              \"children\": Array [\n                                Object {\n                                  \"children\": Array [\n                                    Object {\n                                      \"children\": Array [],\n                                      \"message\": \"\",\n                                      \"name\": \"Mu\",\n                                      \"status\": \"INLINED\",\n                                    },\n                                    Object {\n                                      \"children\": Array [],\n                                      \"message\": \"\",\n                                      \"name\": \"Mu\",\n                                      \"status\": \"INLINED\",\n                                    },\n                                    Object {\n                                      \"children\": Array [],\n                                      \"message\": \"\",\n                                      \"name\": \"Mu\",\n                                      \"status\": \"INLINED\",\n                                    },\n                                  ],\n                                  \"message\": \"\",\n                                  \"name\": \"Zeta\",\n                                  \"status\": \"INLINED\",\n                                },\n                              ],\n                              \"message\": \"\",\n                              \"name\": \"React.Fragment\",\n                              \"status\": \"NORMAL\",\n                            },\n                          ],\n                          \"message\": \"\",\n                          \"name\": \"React.Fragment\",\n                          \"status\": \"NORMAL\",\n                        },\n                      ],\n                      \"message\": \"\",\n                      \"name\": \"Iota\",\n                      \"status\": \"INLINED\",\n                    },\n                    Object {\n                      \"children\": Array [],\n                      \"message\": \"\",\n                      \"name\": \"Mu\",\n                      \"status\": \"INLINED\",\n                    },\n                    Object {\n                      \"children\": Array [\n                        Object {\n                          \"children\": Array [],\n                          \"message\": \"\",\n                          \"name\": \"React.Fragment\",\n                          \"status\": \"NORMAL\",\n                        },\n                        Object {\n                          \"children\": Array [\n                            Object {\n                              \"children\": Array [\n                                Object {\n                                  \"children\": Array [],\n                                  \"message\": \"\",\n                                  \"name\": \"Mu\",\n                                  \"status\": \"INLINED\",\n                                },\n                                Object {\n                                  \"children\": Array [],\n                                  \"message\": \"\",\n                                  \"name\": \"Mu\",\n                                  \"status\": \"INLINED\",\n                                },\n                                Object {\n                                  \"children\": Array [],\n                                  \"message\": \"\",\n                                  \"name\": \"Mu\",\n                                  \"status\": \"INLINED\",\n                                },\n                              ],\n                              \"message\": \"\",\n                              \"name\": \"Zeta\",\n                              \"status\": \"INLINED\",\n                            },\n                          ],\n                          \"message\": \"\",\n                          \"name\": \"Pi\",\n                          \"status\": \"INLINED\",\n                        },\n                      ],\n                      \"message\": \"\",\n                      \"name\": \"Epsilon\",\n                      \"status\": \"INLINED\",\n                    },\n                    Object {\n                      \"children\": Array [\n                        Object {\n                          \"children\": Array [\n                            Object {\n                              \"children\": Array [],\n                              \"message\": \"\",\n                              \"name\": \"Mu\",\n                              \"status\": \"INLINED\",\n                            },\n                            Object {\n                              \"children\": Array [],\n                              \"message\": \"\",\n                              \"name\": \"Mu\",\n                              \"status\": \"INLINED\",\n                            },\n                            Object {\n                              \"children\": Array [],\n                              \"message\": \"\",\n                              \"name\": \"Mu\",\n                              \"status\": \"INLINED\",\n                            },\n                          ],\n                          \"message\": \"\",\n                          \"name\": \"Zeta\",\n                          \"status\": \"INLINED\",\n                        },\n                      ],\n                      \"message\": \"\",\n                      \"name\": \"Pi\",\n                      \"status\": \"INLINED\",\n                    },\n                  ],\n                  \"message\": \"\",\n                  \"name\": \"React.Fragment\",\n                  \"status\": \"NORMAL\",\n                },\n              ],\n              \"message\": \"\",\n              \"name\": \"Delta\",\n              \"status\": \"INLINED\",\n            },\n            Object {\n              \"children\": Array [\n                Object {\n                  \"children\": Array [],\n                  \"message\": \"\",\n                  \"name\": \"React.Fragment\",\n                  \"status\": \"NORMAL\",\n                },\n              ],\n              \"message\": \"\",\n              \"name\": \"Xi\",\n              \"status\": \"INLINED\",\n            },\n            Object {\n              \"children\": Array [\n                Object {\n                  \"children\": Array [],\n                  \"message\": \"\",\n                  \"name\": \"React.Fragment\",\n                  \"status\": \"NORMAL\",\n                },\n              ],\n              \"message\": \"\",\n              \"name\": \"Xi\",\n              \"status\": \"INLINED\",\n            },\n            Object {\n              \"children\": Array [\n                Object {\n                  \"children\": Array [\n                    Object {\n                      \"children\": Array [\n                        Object {\n                          \"children\": Array [\n                            Object {\n                              \"children\": Array [\n                                Object {\n                                  \"children\": Array [],\n                                  \"message\": \"\",\n                                  \"name\": \"Mu\",\n                                  \"status\": \"INLINED\",\n                                },\n                                Object {\n                                  \"children\": Array [],\n                                  \"message\": \"\",\n                                  \"name\": \"Mu\",\n                                  \"status\": \"INLINED\",\n                                },\n                                Object {\n                                  \"children\": Array [],\n                                  \"message\": \"\",\n                                  \"name\": \"Mu\",\n                                  \"status\": \"INLINED\",\n                                },\n                              ],\n                              \"message\": \"\",\n                              \"name\": \"Zeta\",\n                              \"status\": \"INLINED\",\n                            },\n                          ],\n                          \"message\": \"\",\n                          \"name\": \"Pi\",\n                          \"status\": \"INLINED\",\n                        },\n                      ],\n                      \"message\": \"\",\n                      \"name\": \"React.Fragment\",\n                      \"status\": \"NORMAL\",\n                    },\n                    Object {\n                      \"children\": Array [\n                        Object {\n                          \"children\": Array [\n                            Object {\n                              \"children\": Array [],\n                              \"message\": \"\",\n                              \"name\": \"React.Fragment\",\n                              \"status\": \"NORMAL\",\n                            },\n                          ],\n                          \"message\": \"\",\n                          \"name\": \"Theta\",\n                          \"status\": \"INLINED\",\n                        },\n                      ],\n                      \"message\": \"\",\n                      \"name\": \"Lambda\",\n                      \"status\": \"INLINED\",\n                    },\n                    Object {\n                      \"children\": Array [\n                        Object {\n                          \"children\": Array [],\n                          \"message\": \"\",\n                          \"name\": \"React.Fragment\",\n                          \"status\": \"NORMAL\",\n                        },\n                      ],\n                      \"message\": \"\",\n                      \"name\": \"Xi\",\n                      \"status\": \"INLINED\",\n                    },\n                    Object {\n                      \"children\": Array [\n                        Object {\n                          \"children\": Array [],\n                          \"message\": \"\",\n                          \"name\": \"React.Fragment\",\n                          \"status\": \"NORMAL\",\n                        },\n                      ],\n                      \"message\": \"\",\n                      \"name\": \"Xi\",\n                      \"status\": \"INLINED\",\n                    },\n                    Object {\n                      \"children\": Array [\n                        Object {\n                          \"children\": Array [\n                            Object {\n                              \"children\": Array [],\n                              \"message\": \"\",\n                              \"name\": \"Mu\",\n                              \"status\": \"INLINED\",\n                            },\n                            Object {\n                              \"children\": Array [],\n                              \"message\": \"\",\n                              \"name\": \"Mu\",\n                              \"status\": \"INLINED\",\n                            },\n                            Object {\n                              \"children\": Array [],\n                              \"message\": \"\",\n                              \"name\": \"Mu\",\n                              \"status\": \"INLINED\",\n                            },\n                          ],\n                          \"message\": \"\",\n                          \"name\": \"Zeta\",\n                          \"status\": \"INLINED\",\n                        },\n                      ],\n                      \"message\": \"\",\n                      \"name\": \"React.Fragment\",\n                      \"status\": \"NORMAL\",\n                    },\n                  ],\n                  \"message\": \"\",\n                  \"name\": \"React.Fragment\",\n                  \"status\": \"NORMAL\",\n                },\n              ],\n              \"message\": \"\",\n              \"name\": \"Iota\",\n              \"status\": \"INLINED\",\n            },\n            Object {\n              \"children\": Array [\n                Object {\n                  \"children\": Array [\n                    Object {\n                      \"children\": Array [\n                        Object {\n                          \"children\": Array [\n                            Object {\n                              \"children\": Array [\n                                Object {\n                                  \"children\": Array [\n                                    Object {\n                                      \"children\": Array [\n                                        Object {\n                                          \"children\": Array [],\n                                          \"message\": \"\",\n                                          \"name\": \"Mu\",\n                                          \"status\": \"INLINED\",\n                                        },\n                                        Object {\n                                          \"children\": Array [],\n                                          \"message\": \"\",\n                                          \"name\": \"Mu\",\n                                          \"status\": \"INLINED\",\n                                        },\n                                        Object {\n                                          \"children\": Array [],\n                                          \"message\": \"\",\n                                          \"name\": \"Mu\",\n                                          \"status\": \"INLINED\",\n                                        },\n                                      ],\n                                      \"message\": \"\",\n                                      \"name\": \"Zeta\",\n                                      \"status\": \"INLINED\",\n                                    },\n                                  ],\n                                  \"message\": \"\",\n                                  \"name\": \"Pi\",\n                                  \"status\": \"INLINED\",\n                                },\n                              ],\n                              \"message\": \"\",\n                              \"name\": \"React.Fragment\",\n                              \"status\": \"NORMAL\",\n                            },\n                            Object {\n                              \"children\": Array [\n                                Object {\n                                  \"children\": Array [\n                                    Object {\n                                      \"children\": Array [],\n                                      \"message\": \"\",\n                                      \"name\": \"React.Fragment\",\n                                      \"status\": \"NORMAL\",\n                                    },\n                                  ],\n                                  \"message\": \"\",\n                                  \"name\": \"Theta\",\n                                  \"status\": \"INLINED\",\n                                },\n                              ],\n                              \"message\": \"\",\n                              \"name\": \"Lambda\",\n                              \"status\": \"INLINED\",\n                            },\n                            Object {\n                              \"children\": Array [\n                                Object {\n                                  \"children\": Array [],\n                                  \"message\": \"\",\n                                  \"name\": \"React.Fragment\",\n                                  \"status\": \"NORMAL\",\n                                },\n                              ],\n                              \"message\": \"\",\n                              \"name\": \"Xi\",\n                              \"status\": \"INLINED\",\n                            },\n                            Object {\n                              \"children\": Array [\n                                Object {\n                                  \"children\": Array [],\n                                  \"message\": \"\",\n                                  \"name\": \"React.Fragment\",\n                                  \"status\": \"NORMAL\",\n                                },\n                              ],\n                              \"message\": \"\",\n                              \"name\": \"Xi\",\n                              \"status\": \"INLINED\",\n                            },\n                            Object {\n                              \"children\": Array [\n                                Object {\n                                  \"children\": Array [\n                                    Object {\n                                      \"children\": Array [],\n                                      \"message\": \"\",\n                                      \"name\": \"Mu\",\n                                      \"status\": \"INLINED\",\n                                    },\n                                    Object {\n                                      \"children\": Array [],\n                                      \"message\": \"\",\n                                      \"name\": \"Mu\",\n                                      \"status\": \"INLINED\",\n                                    },\n                                    Object {\n                                      \"children\": Array [],\n                                      \"message\": \"\",\n                                      \"name\": \"Mu\",\n                                      \"status\": \"INLINED\",\n                                    },\n                                  ],\n                                  \"message\": \"\",\n                                  \"name\": \"Zeta\",\n                                  \"status\": \"INLINED\",\n                                },\n                              ],\n                              \"message\": \"\",\n                              \"name\": \"React.Fragment\",\n                              \"status\": \"NORMAL\",\n                            },\n                          ],\n                          \"message\": \"\",\n                          \"name\": \"React.Fragment\",\n                          \"status\": \"NORMAL\",\n                        },\n                      ],\n                      \"message\": \"\",\n                      \"name\": \"Iota\",\n                      \"status\": \"INLINED\",\n                    },\n                    Object {\n                      \"children\": Array [],\n                      \"message\": \"\",\n                      \"name\": \"Mu\",\n                      \"status\": \"INLINED\",\n                    },\n                    Object {\n                      \"children\": Array [\n                        Object {\n                          \"children\": Array [],\n                          \"message\": \"\",\n                          \"name\": \"React.Fragment\",\n                          \"status\": \"NORMAL\",\n                        },\n                        Object {\n                          \"children\": Array [\n                            Object {\n                              \"children\": Array [\n                                Object {\n                                  \"children\": Array [],\n                                  \"message\": \"\",\n                                  \"name\": \"Mu\",\n                                  \"status\": \"INLINED\",\n                                },\n                                Object {\n                                  \"children\": Array [],\n                                  \"message\": \"\",\n                                  \"name\": \"Mu\",\n                                  \"status\": \"INLINED\",\n                                },\n                                Object {\n                                  \"children\": Array [],\n                                  \"message\": \"\",\n                                  \"name\": \"Mu\",\n                                  \"status\": \"INLINED\",\n                                },\n                              ],\n                              \"message\": \"\",\n                              \"name\": \"Zeta\",\n                              \"status\": \"INLINED\",\n                            },\n                          ],\n                          \"message\": \"\",\n                          \"name\": \"Pi\",\n                          \"status\": \"INLINED\",\n                        },\n                      ],\n                      \"message\": \"\",\n                      \"name\": \"Epsilon\",\n                      \"status\": \"INLINED\",\n                    },\n                    Object {\n                      \"children\": Array [\n                        Object {\n                          \"children\": Array [\n                            Object {\n                              \"children\": Array [],\n                              \"message\": \"\",\n                              \"name\": \"Mu\",\n                              \"status\": \"INLINED\",\n                            },\n                            Object {\n                              \"children\": Array [],\n                              \"message\": \"\",\n                              \"name\": \"Mu\",\n                              \"status\": \"INLINED\",\n                            },\n                            Object {\n                              \"children\": Array [],\n                              \"message\": \"\",\n                              \"name\": \"Mu\",\n                              \"status\": \"INLINED\",\n                            },\n                          ],\n                          \"message\": \"\",\n                          \"name\": \"Zeta\",\n                          \"status\": \"INLINED\",\n                        },\n                      ],\n                      \"message\": \"\",\n                      \"name\": \"Pi\",\n                      \"status\": \"INLINED\",\n                    },\n                  ],\n                  \"message\": \"\",\n                  \"name\": \"React.Fragment\",\n                  \"status\": \"NORMAL\",\n                },\n              ],\n              \"message\": \"\",\n              \"name\": \"Delta\",\n              \"status\": \"INLINED\",\n            },\n            Object {\n              \"children\": Array [\n                Object {\n                  \"children\": Array [\n                    Object {\n                      \"children\": Array [\n                        Object {\n                          \"children\": Array [\n                            Object {\n                              \"children\": Array [\n                                Object {\n                                  \"children\": Array [],\n                                  \"message\": \"\",\n                                  \"name\": \"Mu\",\n                                  \"status\": \"INLINED\",\n                                },\n                                Object {\n                                  \"children\": Array [],\n                                  \"message\": \"\",\n                                  \"name\": \"Mu\",\n                                  \"status\": \"INLINED\",\n                                },\n                                Object {\n                                  \"children\": Array [],\n                                  \"message\": \"\",\n                                  \"name\": \"Mu\",\n                                  \"status\": \"INLINED\",\n                                },\n                              ],\n                              \"message\": \"\",\n                              \"name\": \"Zeta\",\n                              \"status\": \"INLINED\",\n                            },\n                          ],\n                          \"message\": \"\",\n                          \"name\": \"Pi\",\n                          \"status\": \"INLINED\",\n                        },\n                      ],\n                      \"message\": \"\",\n                      \"name\": \"React.Fragment\",\n                      \"status\": \"NORMAL\",\n                    },\n                    Object {\n                      \"children\": Array [\n                        Object {\n                          \"children\": Array [\n                            Object {\n                              \"children\": Array [],\n                              \"message\": \"\",\n                              \"name\": \"React.Fragment\",\n                              \"status\": \"NORMAL\",\n                            },\n                          ],\n                          \"message\": \"\",\n                          \"name\": \"Theta\",\n                          \"status\": \"INLINED\",\n                        },\n                      ],\n                      \"message\": \"\",\n                      \"name\": \"Lambda\",\n                      \"status\": \"INLINED\",\n                    },\n                    Object {\n                      \"children\": Array [\n                        Object {\n                          \"children\": Array [],\n                          \"message\": \"\",\n                          \"name\": \"React.Fragment\",\n                          \"status\": \"NORMAL\",\n                        },\n                      ],\n                      \"message\": \"\",\n                      \"name\": \"Xi\",\n                      \"status\": \"INLINED\",\n                    },\n                    Object {\n                      \"children\": Array [\n                        Object {\n                          \"children\": Array [],\n                          \"message\": \"\",\n                          \"name\": \"React.Fragment\",\n                          \"status\": \"NORMAL\",\n                        },\n                      ],\n                      \"message\": \"\",\n                      \"name\": \"Xi\",\n                      \"status\": \"INLINED\",\n                    },\n                    Object {\n                      \"children\": Array [\n                        Object {\n                          \"children\": Array [\n                            Object {\n                              \"children\": Array [],\n                              \"message\": \"\",\n                              \"name\": \"Mu\",\n                              \"status\": \"INLINED\",\n                            },\n                            Object {\n                              \"children\": Array [],\n                              \"message\": \"\",\n                              \"name\": \"Mu\",\n                              \"status\": \"INLINED\",\n                            },\n                            Object {\n                              \"children\": Array [],\n                              \"message\": \"\",\n                              \"name\": \"Mu\",\n                              \"status\": \"INLINED\",\n                            },\n                          ],\n                          \"message\": \"\",\n                          \"name\": \"Zeta\",\n                          \"status\": \"INLINED\",\n                        },\n                      ],\n                      \"message\": \"\",\n                      \"name\": \"React.Fragment\",\n                      \"status\": \"NORMAL\",\n                    },\n                  ],\n                  \"message\": \"\",\n                  \"name\": \"React.Fragment\",\n                  \"status\": \"NORMAL\",\n                },\n              ],\n              \"message\": \"\",\n              \"name\": \"Iota\",\n              \"status\": \"INLINED\",\n            },\n            Object {\n              \"children\": Array [\n                Object {\n                  \"children\": Array [],\n                  \"message\": \"\",\n                  \"name\": \"React.Fragment\",\n                  \"status\": \"NORMAL\",\n                },\n              ],\n              \"message\": \"\",\n              \"name\": \"Xi\",\n              \"status\": \"INLINED\",\n            },\n          ],\n          \"message\": \"\",\n          \"name\": \"React.Fragment\",\n          \"status\": \"NORMAL\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"Gamma\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 138,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`React.Children.map: (JSX => JSX) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 2,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [],\n          \"message\": \"\",\n          \"name\": \"Child\",\n          \"status\": \"INLINED\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 1,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`React.Children.map: (JSX => createElement) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 2,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [],\n          \"message\": \"\",\n          \"name\": \"Child\",\n          \"status\": \"INLINED\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 1,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`React.Children.map: (createElement => JSX) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 2,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [],\n          \"message\": \"\",\n          \"name\": \"Child\",\n          \"status\": \"INLINED\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 1,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`React.Children.map: (createElement => createElement) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 2,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [],\n          \"message\": \"\",\n          \"name\": \"Child\",\n          \"status\": \"INLINED\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 1,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`React.cloneElement 2: (JSX => JSX) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 1,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 0,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`React.cloneElement 2: (JSX => createElement) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 1,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 0,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`React.cloneElement 2: (createElement => JSX) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 1,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 0,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`React.cloneElement 2: (createElement => createElement) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 1,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 0,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`React.cloneElement: (JSX => JSX) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 3,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [\n            Object {\n              \"children\": Array [],\n              \"message\": \"\",\n              \"name\": \"MaybeShow\",\n              \"status\": \"INLINED\",\n            },\n          ],\n          \"message\": \"\",\n          \"name\": \"Override\",\n          \"status\": \"INLINED\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 2,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`React.cloneElement: (JSX => createElement) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 3,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [\n            Object {\n              \"children\": Array [],\n              \"message\": \"\",\n              \"name\": \"MaybeShow\",\n              \"status\": \"INLINED\",\n            },\n          ],\n          \"message\": \"\",\n          \"name\": \"Override\",\n          \"status\": \"INLINED\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 2,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`React.cloneElement: (createElement => JSX) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 3,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [\n            Object {\n              \"children\": Array [],\n              \"message\": \"\",\n              \"name\": \"MaybeShow\",\n              \"status\": \"INLINED\",\n            },\n          ],\n          \"message\": \"\",\n          \"name\": \"Override\",\n          \"status\": \"INLINED\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 2,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`React.cloneElement: (createElement => createElement) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 3,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [\n            Object {\n              \"children\": Array [],\n              \"message\": \"\",\n              \"name\": \"MaybeShow\",\n              \"status\": \"INLINED\",\n            },\n          ],\n          \"message\": \"\",\n          \"name\": \"Override\",\n          \"status\": \"INLINED\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 2,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`Render array twice: (JSX => JSX) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 2,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [],\n          \"message\": \"\",\n          \"name\": \"A\",\n          \"status\": \"INLINED\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 1,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`Render array twice: (JSX => createElement) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 2,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [],\n          \"message\": \"\",\n          \"name\": \"A\",\n          \"status\": \"INLINED\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 1,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`Render array twice: (createElement => JSX) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 2,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [],\n          \"message\": \"\",\n          \"name\": \"A\",\n          \"status\": \"INLINED\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 1,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`Render array twice: (createElement => createElement) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 2,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [],\n          \"message\": \"\",\n          \"name\": \"A\",\n          \"status\": \"INLINED\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 1,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`Render nested array children: (JSX => JSX) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 2,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [],\n          \"message\": \"\",\n          \"name\": \"A\",\n          \"status\": \"INLINED\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 1,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`Render nested array children: (JSX => createElement) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 2,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [],\n          \"message\": \"\",\n          \"name\": \"A\",\n          \"status\": \"INLINED\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 1,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`Render nested array children: (createElement => JSX) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 2,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [],\n          \"message\": \"\",\n          \"name\": \"A\",\n          \"status\": \"INLINED\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 1,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`Render nested array children: (createElement => createElement) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 2,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [],\n          \"message\": \"\",\n          \"name\": \"A\",\n          \"status\": \"INLINED\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 1,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`Return text: (JSX => JSX) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 3,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [],\n          \"message\": \"\",\n          \"name\": \"A\",\n          \"status\": \"INLINED\",\n        },\n        Object {\n          \"children\": Array [],\n          \"message\": \"\",\n          \"name\": \"B\",\n          \"status\": \"INLINED\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 2,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`Return text: (JSX => createElement) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 3,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [],\n          \"message\": \"\",\n          \"name\": \"A\",\n          \"status\": \"INLINED\",\n        },\n        Object {\n          \"children\": Array [],\n          \"message\": \"\",\n          \"name\": \"B\",\n          \"status\": \"INLINED\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 2,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`Return text: (createElement => JSX) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 3,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [],\n          \"message\": \"\",\n          \"name\": \"A\",\n          \"status\": \"INLINED\",\n        },\n        Object {\n          \"children\": Array [],\n          \"message\": \"\",\n          \"name\": \"B\",\n          \"status\": \"INLINED\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 2,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`Return text: (createElement => createElement) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 3,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [],\n          \"message\": \"\",\n          \"name\": \"A\",\n          \"status\": \"INLINED\",\n        },\n        Object {\n          \"children\": Array [],\n          \"message\": \"\",\n          \"name\": \"B\",\n          \"status\": \"INLINED\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 2,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`Return undefined: (JSX => JSX) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 2,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [],\n          \"message\": \"\",\n          \"name\": \"A\",\n          \"status\": \"INLINED\",\n        },\n        Object {\n          \"children\": Array [],\n          \"message\": \"undefined was returned from render\",\n          \"name\": \"A\",\n          \"status\": \"BAIL-OUT\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 1,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`Return undefined: (JSX => createElement) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 2,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [],\n          \"message\": \"\",\n          \"name\": \"A\",\n          \"status\": \"INLINED\",\n        },\n        Object {\n          \"children\": Array [],\n          \"message\": \"undefined was returned from render\",\n          \"name\": \"A\",\n          \"status\": \"BAIL-OUT\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 1,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`Return undefined: (createElement => JSX) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 2,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [],\n          \"message\": \"\",\n          \"name\": \"A\",\n          \"status\": \"INLINED\",\n        },\n        Object {\n          \"children\": Array [],\n          \"message\": \"undefined was returned from render\",\n          \"name\": \"A\",\n          \"status\": \"BAIL-OUT\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 1,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`Return undefined: (createElement => createElement) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 2,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [],\n          \"message\": \"\",\n          \"name\": \"A\",\n          \"status\": \"INLINED\",\n        },\n        Object {\n          \"children\": Array [],\n          \"message\": \"undefined was returned from render\",\n          \"name\": \"A\",\n          \"status\": \"BAIL-OUT\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 1,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`Runtime error: (JSX => JSX) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 1,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 0,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 0,\n}\n`;\n\nexports[`Runtime error: (JSX => JSX) 2`] = `\"Cannot read property 'push' of undefined\"`;\n\nexports[`Runtime error: (JSX => createElement) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 1,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 0,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 0,\n}\n`;\n\nexports[`Runtime error: (JSX => createElement) 2`] = `\"Cannot read property 'push' of undefined\"`;\n\nexports[`Runtime error: (createElement => JSX) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 1,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 0,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 0,\n}\n`;\n\nexports[`Runtime error: (createElement => JSX) 2`] = `\"Cannot read property 'push' of undefined\"`;\n\nexports[`Runtime error: (createElement => createElement) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 1,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 0,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 0,\n}\n`;\n\nexports[`Runtime error: (createElement => createElement) 2`] = `\"Cannot read property 'push' of undefined\"`;\n\nexports[`Simple 2: (JSX => JSX) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 2,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [],\n          \"message\": \"\",\n          \"name\": \"A\",\n          \"status\": \"INLINED\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 1,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`Simple 2: (JSX => createElement) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 2,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [],\n          \"message\": \"\",\n          \"name\": \"A\",\n          \"status\": \"INLINED\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 1,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`Simple 2: (createElement => JSX) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 2,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [],\n          \"message\": \"\",\n          \"name\": \"A\",\n          \"status\": \"INLINED\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 1,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`Simple 2: (createElement => createElement) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 2,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [],\n          \"message\": \"\",\n          \"name\": \"A\",\n          \"status\": \"INLINED\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 1,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`Simple 3: (JSX => JSX) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 2,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [],\n          \"message\": \"\",\n          \"name\": \"A\",\n          \"status\": \"INLINED\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 1,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`Simple 3: (JSX => createElement) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 2,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [],\n          \"message\": \"\",\n          \"name\": \"A\",\n          \"status\": \"INLINED\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 1,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`Simple 3: (createElement => JSX) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 2,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [],\n          \"message\": \"\",\n          \"name\": \"A\",\n          \"status\": \"INLINED\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 1,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`Simple 3: (createElement => createElement) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 2,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [],\n          \"message\": \"\",\n          \"name\": \"A\",\n          \"status\": \"INLINED\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 1,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`Simple 4: (JSX => JSX) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 3,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [],\n          \"message\": \"\",\n          \"name\": \"Child\",\n          \"status\": \"NEW_TREE\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 0,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 2,\n}\n`;\n\nexports[`Simple 4: (JSX => createElement) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 3,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [],\n          \"message\": \"\",\n          \"name\": \"Child\",\n          \"status\": \"NEW_TREE\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 0,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 2,\n}\n`;\n\nexports[`Simple 4: (createElement => JSX) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 3,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [],\n          \"message\": \"\",\n          \"name\": \"Child\",\n          \"status\": \"NEW_TREE\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 0,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 2,\n}\n`;\n\nexports[`Simple 4: (createElement => createElement) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 3,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [],\n          \"message\": \"\",\n          \"name\": \"Child\",\n          \"status\": \"NEW_TREE\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 0,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 2,\n}\n`;\n\nexports[`Simple 5: (JSX => JSX) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 3,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [],\n          \"message\": \"\",\n          \"name\": \"Child\",\n          \"status\": \"NEW_TREE\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 0,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 2,\n}\n`;\n\nexports[`Simple 5: (JSX => createElement) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 3,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [],\n          \"message\": \"\",\n          \"name\": \"Child\",\n          \"status\": \"NEW_TREE\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 0,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 2,\n}\n`;\n\nexports[`Simple 5: (createElement => JSX) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 3,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [],\n          \"message\": \"\",\n          \"name\": \"Child\",\n          \"status\": \"NEW_TREE\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 0,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 2,\n}\n`;\n\nexports[`Simple 5: (createElement => createElement) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 3,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [],\n          \"message\": \"\",\n          \"name\": \"Child\",\n          \"status\": \"NEW_TREE\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 0,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 2,\n}\n`;\n\nexports[`Simple 6: (JSX => JSX) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 1,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 0,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`Simple 6: (JSX => createElement) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 1,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 0,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`Simple 6: (createElement => JSX) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 1,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 0,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`Simple 6: (createElement => createElement) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 1,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 0,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`Simple 7: (JSX => JSX) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 1,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 0,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`Simple 7: (JSX => createElement) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 1,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 0,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`Simple 7: (createElement => JSX) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 1,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 0,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`Simple 7: (createElement => createElement) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 1,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 0,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`Simple 8: (JSX => JSX) 1`] = `\"Failed to render React component root \\\\\"App\\\\\" due to side-effects from mutating the binding \\\\\"lazyVariable\\\\\"\"`;\n\nexports[`Simple 8: (JSX => createElement) 1`] = `\"Failed to render React component root \\\\\"App\\\\\" due to side-effects from mutating the binding \\\\\"lazyVariable\\\\\"\"`;\n\nexports[`Simple 8: (createElement => JSX) 1`] = `\"Failed to render React component root \\\\\"App\\\\\" due to side-effects from mutating the binding \\\\\"lazyVariable\\\\\"\"`;\n\nexports[`Simple 8: (createElement => createElement) 1`] = `\"Failed to render React component root \\\\\"App\\\\\" due to side-effects from mutating the binding \\\\\"lazyVariable\\\\\"\"`;\n\nexports[`Simple 9: (JSX => JSX) 1`] = `\"Failed to render React component root \\\\\"App\\\\\" due to side-effects from mutating the binding \\\\\"lazyVariable\\\\\"\"`;\n\nexports[`Simple 9: (JSX => createElement) 1`] = `\"Failed to render React component root \\\\\"App\\\\\" due to side-effects from mutating the binding \\\\\"lazyVariable\\\\\"\"`;\n\nexports[`Simple 9: (createElement => JSX) 1`] = `\"Failed to render React component root \\\\\"App\\\\\" due to side-effects from mutating the binding \\\\\"lazyVariable\\\\\"\"`;\n\nexports[`Simple 9: (createElement => createElement) 1`] = `\"Failed to render React component root \\\\\"App\\\\\" due to side-effects from mutating the binding \\\\\"lazyVariable\\\\\"\"`;\n\nexports[`Simple 10: (JSX => JSX) 1`] = `\"Failed to render React component root \\\\\"App\\\\\" due to side-effects from mutating the binding \\\\\"lazyVariable\\\\\"\"`;\n\nexports[`Simple 10: (JSX => createElement) 1`] = `\"Failed to render React component root \\\\\"App\\\\\" due to side-effects from mutating the binding \\\\\"lazyVariable\\\\\"\"`;\n\nexports[`Simple 10: (createElement => JSX) 1`] = `\"Failed to render React component root \\\\\"App\\\\\" due to side-effects from mutating the binding \\\\\"lazyVariable\\\\\"\"`;\n\nexports[`Simple 10: (createElement => createElement) 1`] = `\"Failed to render React component root \\\\\"App\\\\\" due to side-effects from mutating the binding \\\\\"lazyVariable\\\\\"\"`;\n\nexports[`Simple 11: (JSX => JSX) 1`] = `\"Failed to render React component root \\\\\"App\\\\\" due to side-effects from mutating the binding \\\\\"lazyVariable\\\\\"\"`;\n\nexports[`Simple 11: (JSX => createElement) 1`] = `\"Failed to render React component root \\\\\"App\\\\\" due to side-effects from mutating the binding \\\\\"lazyVariable\\\\\"\"`;\n\nexports[`Simple 11: (createElement => JSX) 1`] = `\"Failed to render React component root \\\\\"App\\\\\" due to side-effects from mutating the binding \\\\\"lazyVariable\\\\\"\"`;\n\nexports[`Simple 11: (createElement => createElement) 1`] = `\"Failed to render React component root \\\\\"App\\\\\" due to side-effects from mutating the binding \\\\\"lazyVariable\\\\\"\"`;\n\nexports[`Simple 12: (JSX => JSX) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 2,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [],\n          \"message\": \"\",\n          \"name\": \"Author\",\n          \"status\": \"INLINED\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 1,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`Simple 12: (JSX => createElement) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 2,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [],\n          \"message\": \"\",\n          \"name\": \"Author\",\n          \"status\": \"INLINED\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 1,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`Simple 12: (createElement => JSX) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 2,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [],\n          \"message\": \"\",\n          \"name\": \"Author\",\n          \"status\": \"INLINED\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 1,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`Simple 12: (createElement => createElement) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 2,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [],\n          \"message\": \"\",\n          \"name\": \"Author\",\n          \"status\": \"INLINED\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 1,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`Simple 13: (JSX => JSX) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 2,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [],\n          \"message\": \"\",\n          \"name\": \"Child\",\n          \"status\": \"INLINED\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 1,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`Simple 13: (JSX => createElement) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 2,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [],\n          \"message\": \"\",\n          \"name\": \"Child\",\n          \"status\": \"INLINED\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 1,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`Simple 13: (createElement => JSX) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 2,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [],\n          \"message\": \"\",\n          \"name\": \"Child\",\n          \"status\": \"INLINED\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 1,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`Simple 13: (createElement => createElement) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 2,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [],\n          \"message\": \"\",\n          \"name\": \"Child\",\n          \"status\": \"INLINED\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 1,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`Simple 14: (JSX => JSX) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 1,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 0,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`Simple 14: (JSX => createElement) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 1,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 0,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`Simple 14: (createElement => JSX) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 1,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 0,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`Simple 14: (createElement => createElement) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 1,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 0,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`Simple 15: (JSX => JSX) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 1,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 0,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`Simple 15: (JSX => createElement) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 1,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 0,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`Simple 15: (createElement => JSX) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 1,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 0,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`Simple 15: (createElement => createElement) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 1,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 0,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`Simple 16: (JSX => JSX) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 1,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 0,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`Simple 16: (JSX => createElement) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 1,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 0,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`Simple 16: (createElement => JSX) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 1,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 0,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`Simple 16: (createElement => createElement) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 1,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 0,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`Simple 17: (JSX => JSX) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 1,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 0,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`Simple 17: (JSX => createElement) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 1,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 0,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`Simple 17: (createElement => JSX) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 1,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 0,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`Simple 17: (createElement => createElement) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 1,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 0,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`Simple 18: (JSX => JSX) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 1,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 0,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`Simple 18: (JSX => createElement) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 1,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 0,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`Simple 18: (createElement => JSX) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 1,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 0,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`Simple 18: (createElement => createElement) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 1,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 0,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`Simple 19: (JSX => JSX) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 3,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [],\n          \"message\": \"\",\n          \"name\": \"Child\",\n          \"status\": \"INLINED\",\n        },\n        Object {\n          \"children\": Array [],\n          \"message\": \"\",\n          \"name\": \"Child\",\n          \"status\": \"INLINED\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 2,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`Simple 19: (JSX => createElement) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 3,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [],\n          \"message\": \"\",\n          \"name\": \"Child\",\n          \"status\": \"INLINED\",\n        },\n        Object {\n          \"children\": Array [],\n          \"message\": \"\",\n          \"name\": \"Child\",\n          \"status\": \"INLINED\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 2,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`Simple 19: (createElement => JSX) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 3,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [],\n          \"message\": \"\",\n          \"name\": \"Child\",\n          \"status\": \"INLINED\",\n        },\n        Object {\n          \"children\": Array [],\n          \"message\": \"\",\n          \"name\": \"Child\",\n          \"status\": \"INLINED\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 2,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`Simple 19: (createElement => createElement) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 3,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [],\n          \"message\": \"\",\n          \"name\": \"Child\",\n          \"status\": \"INLINED\",\n        },\n        Object {\n          \"children\": Array [],\n          \"message\": \"\",\n          \"name\": \"Child\",\n          \"status\": \"INLINED\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 2,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`Simple 20: (JSX => JSX) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 3,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [],\n          \"message\": \"\",\n          \"name\": \"Child\",\n          \"status\": \"INLINED\",\n        },\n        Object {\n          \"children\": Array [],\n          \"message\": \"\",\n          \"name\": \"Child\",\n          \"status\": \"INLINED\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 2,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`Simple 20: (JSX => createElement) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 3,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [],\n          \"message\": \"\",\n          \"name\": \"Child\",\n          \"status\": \"INLINED\",\n        },\n        Object {\n          \"children\": Array [],\n          \"message\": \"\",\n          \"name\": \"Child\",\n          \"status\": \"INLINED\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 2,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`Simple 20: (createElement => JSX) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 3,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [],\n          \"message\": \"\",\n          \"name\": \"Child\",\n          \"status\": \"INLINED\",\n        },\n        Object {\n          \"children\": Array [],\n          \"message\": \"\",\n          \"name\": \"Child\",\n          \"status\": \"INLINED\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 2,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`Simple 20: (createElement => createElement) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 3,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [],\n          \"message\": \"\",\n          \"name\": \"Child\",\n          \"status\": \"INLINED\",\n        },\n        Object {\n          \"children\": Array [],\n          \"message\": \"\",\n          \"name\": \"Child\",\n          \"status\": \"INLINED\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 2,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`Simple 21: (JSX => JSX) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 2,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [],\n          \"message\": \"\",\n          \"name\": \"Child\",\n          \"status\": \"INLINED\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 1,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`Simple 21: (JSX => createElement) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 2,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [],\n          \"message\": \"\",\n          \"name\": \"Child\",\n          \"status\": \"INLINED\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 1,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`Simple 21: (createElement => JSX) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 2,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [],\n          \"message\": \"\",\n          \"name\": \"Child\",\n          \"status\": \"INLINED\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 1,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`Simple 21: (createElement => createElement) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 2,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [],\n          \"message\": \"\",\n          \"name\": \"Child\",\n          \"status\": \"INLINED\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 1,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`Simple 22: (JSX => JSX) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 3,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [],\n          \"message\": \"\",\n          \"name\": \"Child\",\n          \"status\": \"INLINED\",\n        },\n        Object {\n          \"children\": Array [],\n          \"message\": \"\",\n          \"name\": \"Child2\",\n          \"status\": \"INLINED\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 2,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`Simple 22: (JSX => createElement) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 3,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [],\n          \"message\": \"\",\n          \"name\": \"Child\",\n          \"status\": \"INLINED\",\n        },\n        Object {\n          \"children\": Array [],\n          \"message\": \"\",\n          \"name\": \"Child2\",\n          \"status\": \"INLINED\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 2,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`Simple 22: (createElement => JSX) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 3,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [],\n          \"message\": \"\",\n          \"name\": \"Child\",\n          \"status\": \"INLINED\",\n        },\n        Object {\n          \"children\": Array [],\n          \"message\": \"\",\n          \"name\": \"Child2\",\n          \"status\": \"INLINED\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 2,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`Simple 22: (createElement => createElement) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 3,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [],\n          \"message\": \"\",\n          \"name\": \"Child\",\n          \"status\": \"INLINED\",\n        },\n        Object {\n          \"children\": Array [],\n          \"message\": \"\",\n          \"name\": \"Child2\",\n          \"status\": \"INLINED\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 2,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`Simple 23: (JSX => JSX) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 2,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [],\n          \"message\": \"\",\n          \"name\": \"Child\",\n          \"status\": \"INLINED\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 1,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`Simple 23: (JSX => createElement) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 2,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [],\n          \"message\": \"\",\n          \"name\": \"Child\",\n          \"status\": \"INLINED\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 1,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`Simple 23: (createElement => JSX) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 2,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [],\n          \"message\": \"\",\n          \"name\": \"Child\",\n          \"status\": \"INLINED\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 1,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`Simple 23: (createElement => createElement) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 2,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [],\n          \"message\": \"\",\n          \"name\": \"Child\",\n          \"status\": \"INLINED\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 1,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`Simple 24: (JSX => JSX) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 2,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [],\n          \"message\": \"\",\n          \"name\": \"Bad\",\n          \"status\": \"INLINED\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 1,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`Simple 24: (JSX => createElement) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 2,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [],\n          \"message\": \"\",\n          \"name\": \"Bad\",\n          \"status\": \"INLINED\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 1,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`Simple 24: (createElement => JSX) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 2,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [],\n          \"message\": \"\",\n          \"name\": \"Bad\",\n          \"status\": \"INLINED\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 1,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`Simple 24: (createElement => createElement) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 2,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [],\n          \"message\": \"\",\n          \"name\": \"Bad\",\n          \"status\": \"INLINED\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 1,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`Simple 25: (JSX => JSX) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 2,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [],\n          \"message\": \"\",\n          \"name\": \"Child\",\n          \"status\": \"INLINED\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 1,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`Simple 25: (JSX => createElement) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 2,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [],\n          \"message\": \"\",\n          \"name\": \"Child\",\n          \"status\": \"INLINED\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 1,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`Simple 25: (createElement => JSX) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 2,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [],\n          \"message\": \"\",\n          \"name\": \"Child\",\n          \"status\": \"INLINED\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 1,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`Simple 25: (createElement => createElement) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 2,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [],\n          \"message\": \"\",\n          \"name\": \"Child\",\n          \"status\": \"INLINED\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 1,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`Simple 26: (JSX => JSX) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 1,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 0,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`Simple 26: (JSX => createElement) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 1,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 0,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`Simple 26: (createElement => JSX) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 1,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 0,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`Simple 26: (createElement => createElement) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 1,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 0,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`Simple 27: (JSX => JSX) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 1,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 0,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`Simple 27: (JSX => createElement) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 1,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 0,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`Simple 27: (createElement => JSX) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 1,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 0,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`Simple 27: (createElement => createElement) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 1,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 0,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`Simple 28: (JSX => JSX) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 1,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 0,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`Simple 28: (JSX => createElement) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 1,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 0,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`Simple 28: (createElement => JSX) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 1,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 0,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`Simple 28: (createElement => createElement) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 1,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 0,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`Simple 29: (JSX => JSX) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 1,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 0,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`Simple 29: (JSX => createElement) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 1,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 0,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`Simple 29: (createElement => JSX) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 1,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 0,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`Simple 29: (createElement => createElement) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 1,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 0,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`Simple children: (JSX => JSX) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 3,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [\n            Object {\n              \"children\": Array [],\n              \"message\": \"\",\n              \"name\": \"A\",\n              \"status\": \"INLINED\",\n            },\n          ],\n          \"message\": \"\",\n          \"name\": \"A\",\n          \"status\": \"INLINED\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 2,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`Simple children: (JSX => createElement) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 3,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [\n            Object {\n              \"children\": Array [],\n              \"message\": \"\",\n              \"name\": \"A\",\n              \"status\": \"INLINED\",\n            },\n          ],\n          \"message\": \"\",\n          \"name\": \"A\",\n          \"status\": \"INLINED\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 2,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`Simple children: (createElement => JSX) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 3,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [\n            Object {\n              \"children\": Array [],\n              \"message\": \"\",\n              \"name\": \"A\",\n              \"status\": \"INLINED\",\n            },\n          ],\n          \"message\": \"\",\n          \"name\": \"A\",\n          \"status\": \"INLINED\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 2,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`Simple children: (createElement => createElement) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 3,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [\n            Object {\n              \"children\": Array [],\n              \"message\": \"\",\n              \"name\": \"A\",\n              \"status\": \"INLINED\",\n            },\n          ],\n          \"message\": \"\",\n          \"name\": \"A\",\n          \"status\": \"INLINED\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 2,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`Simple fragments: (JSX => JSX) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 5,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [\n            Object {\n              \"children\": Array [],\n              \"message\": \"\",\n              \"name\": \"A\",\n              \"status\": \"INLINED\",\n            },\n            Object {\n              \"children\": Array [],\n              \"message\": \"\",\n              \"name\": \"B\",\n              \"status\": \"INLINED\",\n            },\n            Object {\n              \"children\": Array [],\n              \"message\": \"\",\n              \"name\": \"C\",\n              \"status\": \"INLINED\",\n            },\n          ],\n          \"message\": \"\",\n          \"name\": \"React.Fragment\",\n          \"status\": \"NORMAL\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 3,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`Simple fragments: (JSX => createElement) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 5,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [\n            Object {\n              \"children\": Array [],\n              \"message\": \"\",\n              \"name\": \"A\",\n              \"status\": \"INLINED\",\n            },\n            Object {\n              \"children\": Array [],\n              \"message\": \"\",\n              \"name\": \"B\",\n              \"status\": \"INLINED\",\n            },\n            Object {\n              \"children\": Array [],\n              \"message\": \"\",\n              \"name\": \"C\",\n              \"status\": \"INLINED\",\n            },\n          ],\n          \"message\": \"\",\n          \"name\": \"React.Fragment\",\n          \"status\": \"NORMAL\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 3,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`Simple fragments: (createElement => JSX) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 5,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [\n            Object {\n              \"children\": Array [],\n              \"message\": \"\",\n              \"name\": \"A\",\n              \"status\": \"INLINED\",\n            },\n            Object {\n              \"children\": Array [],\n              \"message\": \"\",\n              \"name\": \"B\",\n              \"status\": \"INLINED\",\n            },\n            Object {\n              \"children\": Array [],\n              \"message\": \"\",\n              \"name\": \"C\",\n              \"status\": \"INLINED\",\n            },\n          ],\n          \"message\": \"\",\n          \"name\": \"React.Fragment\",\n          \"status\": \"NORMAL\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 3,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`Simple fragments: (createElement => createElement) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 5,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [\n            Object {\n              \"children\": Array [],\n              \"message\": \"\",\n              \"name\": \"A\",\n              \"status\": \"INLINED\",\n            },\n            Object {\n              \"children\": Array [],\n              \"message\": \"\",\n              \"name\": \"B\",\n              \"status\": \"INLINED\",\n            },\n            Object {\n              \"children\": Array [],\n              \"message\": \"\",\n              \"name\": \"C\",\n              \"status\": \"INLINED\",\n            },\n          ],\n          \"message\": \"\",\n          \"name\": \"React.Fragment\",\n          \"status\": \"NORMAL\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 3,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`Simple refs: (JSX => JSX) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 2,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [],\n          \"message\": \"\",\n          \"name\": \"A\",\n          \"status\": \"INLINED\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 1,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`Simple refs: (JSX => createElement) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 2,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [],\n          \"message\": \"\",\n          \"name\": \"A\",\n          \"status\": \"INLINED\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 1,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`Simple refs: (createElement => JSX) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 2,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [],\n          \"message\": \"\",\n          \"name\": \"A\",\n          \"status\": \"INLINED\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 1,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`Simple refs: (createElement => createElement) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 2,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [],\n          \"message\": \"\",\n          \"name\": \"A\",\n          \"status\": \"INLINED\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 1,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`Simple with abstract props: (JSX => JSX) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 3,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [\n            Object {\n              \"children\": Array [],\n              \"message\": \"\",\n              \"name\": \"IWantThisToBeInlined\",\n              \"status\": \"INLINED\",\n            },\n          ],\n          \"message\": \"\",\n          \"name\": \"Button\",\n          \"status\": \"INLINED\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 2,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`Simple with abstract props: (JSX => createElement) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 3,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [\n            Object {\n              \"children\": Array [],\n              \"message\": \"\",\n              \"name\": \"IWantThisToBeInlined\",\n              \"status\": \"INLINED\",\n            },\n          ],\n          \"message\": \"\",\n          \"name\": \"Button\",\n          \"status\": \"INLINED\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 2,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`Simple with abstract props: (createElement => JSX) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 3,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [\n            Object {\n              \"children\": Array [],\n              \"message\": \"\",\n              \"name\": \"IWantThisToBeInlined\",\n              \"status\": \"INLINED\",\n            },\n          ],\n          \"message\": \"\",\n          \"name\": \"Button\",\n          \"status\": \"INLINED\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 2,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`Simple with abstract props: (createElement => createElement) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 3,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [\n            Object {\n              \"children\": Array [],\n              \"message\": \"\",\n              \"name\": \"IWantThisToBeInlined\",\n              \"status\": \"INLINED\",\n            },\n          ],\n          \"message\": \"\",\n          \"name\": \"Button\",\n          \"status\": \"INLINED\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 2,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`Simple with new expression: (JSX => JSX) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 1,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 0,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`Simple with new expression: (JSX => createElement) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 1,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 0,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`Simple with new expression: (createElement => JSX) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 1,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 0,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`Simple with new expression: (createElement => createElement) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 1,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 0,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`Simple with unary expressions: (JSX => JSX) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 2,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [],\n          \"message\": \"\",\n          \"name\": \"Child\",\n          \"status\": \"INLINED\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 1,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`Simple with unary expressions: (JSX => createElement) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 2,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [],\n          \"message\": \"\",\n          \"name\": \"Child\",\n          \"status\": \"INLINED\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 1,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`Simple with unary expressions: (createElement => JSX) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 2,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [],\n          \"message\": \"\",\n          \"name\": \"Child\",\n          \"status\": \"INLINED\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 1,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`Simple with unary expressions: (createElement => createElement) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 2,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [],\n          \"message\": \"\",\n          \"name\": \"Child\",\n          \"status\": \"INLINED\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 1,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`Simple: (JSX => JSX) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 4,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [],\n          \"message\": \"\",\n          \"name\": \"A\",\n          \"status\": \"INLINED\",\n        },\n        Object {\n          \"children\": Array [],\n          \"message\": \"\",\n          \"name\": \"B\",\n          \"status\": \"INLINED\",\n        },\n        Object {\n          \"children\": Array [],\n          \"message\": \"\",\n          \"name\": \"C\",\n          \"status\": \"INLINED\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 3,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`Simple: (JSX => createElement) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 4,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [],\n          \"message\": \"\",\n          \"name\": \"A\",\n          \"status\": \"INLINED\",\n        },\n        Object {\n          \"children\": Array [],\n          \"message\": \"\",\n          \"name\": \"B\",\n          \"status\": \"INLINED\",\n        },\n        Object {\n          \"children\": Array [],\n          \"message\": \"\",\n          \"name\": \"C\",\n          \"status\": \"INLINED\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 3,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`Simple: (createElement => JSX) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 4,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [],\n          \"message\": \"\",\n          \"name\": \"A\",\n          \"status\": \"INLINED\",\n        },\n        Object {\n          \"children\": Array [],\n          \"message\": \"\",\n          \"name\": \"B\",\n          \"status\": \"INLINED\",\n        },\n        Object {\n          \"children\": Array [],\n          \"message\": \"\",\n          \"name\": \"C\",\n          \"status\": \"INLINED\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 3,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`Simple: (createElement => createElement) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 4,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [],\n          \"message\": \"\",\n          \"name\": \"A\",\n          \"status\": \"INLINED\",\n        },\n        Object {\n          \"children\": Array [],\n          \"message\": \"\",\n          \"name\": \"B\",\n          \"status\": \"INLINED\",\n        },\n        Object {\n          \"children\": Array [],\n          \"message\": \"\",\n          \"name\": \"C\",\n          \"status\": \"INLINED\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 3,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`Two roots: (JSX => JSX) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 2,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [],\n      \"message\": \"\",\n      \"name\": \"A\",\n      \"status\": \"ROOT\",\n    },\n    Object {\n      \"children\": Array [],\n      \"message\": \"\",\n      \"name\": \"B\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 0,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 2,\n}\n`;\n\nexports[`Two roots: (JSX => createElement) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 2,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [],\n      \"message\": \"\",\n      \"name\": \"A\",\n      \"status\": \"ROOT\",\n    },\n    Object {\n      \"children\": Array [],\n      \"message\": \"\",\n      \"name\": \"B\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 0,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 2,\n}\n`;\n\nexports[`Two roots: (createElement => JSX) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 2,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [],\n      \"message\": \"\",\n      \"name\": \"A\",\n      \"status\": \"ROOT\",\n    },\n    Object {\n      \"children\": Array [],\n      \"message\": \"\",\n      \"name\": \"B\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 0,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 2,\n}\n`;\n\nexports[`Two roots: (createElement => createElement) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 2,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [],\n      \"message\": \"\",\n      \"name\": \"A\",\n      \"status\": \"ROOT\",\n    },\n    Object {\n      \"children\": Array [],\n      \"message\": \"\",\n      \"name\": \"B\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 0,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 2,\n}\n`;\n\nexports[`defaultProps 2: (JSX => JSX) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 2,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [],\n          \"message\": \"\",\n          \"name\": \"Child\",\n          \"status\": \"INLINED\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 1,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`defaultProps 2: (JSX => createElement) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 2,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [],\n          \"message\": \"\",\n          \"name\": \"Child\",\n          \"status\": \"INLINED\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 1,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`defaultProps 2: (createElement => JSX) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 2,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [],\n          \"message\": \"\",\n          \"name\": \"Child\",\n          \"status\": \"INLINED\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 1,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`defaultProps 2: (createElement => createElement) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 2,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [],\n          \"message\": \"\",\n          \"name\": \"Child\",\n          \"status\": \"INLINED\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 1,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`defaultProps: (JSX => JSX) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 2,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [],\n          \"message\": \"\",\n          \"name\": \"Child\",\n          \"status\": \"INLINED\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 1,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`defaultProps: (JSX => createElement) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 2,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [],\n          \"message\": \"\",\n          \"name\": \"Child\",\n          \"status\": \"INLINED\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 1,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`defaultProps: (createElement => JSX) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 2,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [],\n          \"message\": \"\",\n          \"name\": \"Child\",\n          \"status\": \"INLINED\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 1,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`defaultProps: (createElement => createElement) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 2,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [],\n          \"message\": \"\",\n          \"name\": \"Child\",\n          \"status\": \"INLINED\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 1,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`refs typeof: (JSX => JSX) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 0,\n  \"evaluatedRootNodes\": Array [],\n  \"inlinedComponents\": 0,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 0,\n}\n`;\n\nexports[`refs typeof: (JSX => createElement) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 0,\n  \"evaluatedRootNodes\": Array [],\n  \"inlinedComponents\": 0,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 0,\n}\n`;\n\nexports[`refs typeof: (createElement => JSX) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 0,\n  \"evaluatedRootNodes\": Array [],\n  \"inlinedComponents\": 0,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 0,\n}\n`;\n\nexports[`refs typeof: (createElement => createElement) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 0,\n  \"evaluatedRootNodes\": Array [],\n  \"inlinedComponents\": 0,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 0,\n}\n`;\n"
  },
  {
    "path": "test/react/__snapshots__/ReactDOM-test.js.snap",
    "content": "// Jest Snapshot v1, https://goo.gl/fbAQLP\n\nexports[`createPortal: (JSX => JSX) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 3,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [\n            Object {\n              \"children\": Array [\n                Object {\n                  \"children\": Array [],\n                  \"message\": \"\",\n                  \"name\": \"Foo\",\n                  \"status\": \"INLINED\",\n                },\n              ],\n              \"message\": \"\",\n              \"name\": \"ReactDOM.createPortal\",\n              \"status\": \"INLINED\",\n            },\n          ],\n          \"message\": \"\",\n          \"name\": \"Child\",\n          \"status\": \"INLINED\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 3,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`createPortal: (JSX => createElement) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 3,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [\n            Object {\n              \"children\": Array [\n                Object {\n                  \"children\": Array [],\n                  \"message\": \"\",\n                  \"name\": \"Foo\",\n                  \"status\": \"INLINED\",\n                },\n              ],\n              \"message\": \"\",\n              \"name\": \"ReactDOM.createPortal\",\n              \"status\": \"INLINED\",\n            },\n          ],\n          \"message\": \"\",\n          \"name\": \"Child\",\n          \"status\": \"INLINED\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 3,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`createPortal: (createElement => JSX) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 3,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [\n            Object {\n              \"children\": Array [\n                Object {\n                  \"children\": Array [],\n                  \"message\": \"\",\n                  \"name\": \"Foo\",\n                  \"status\": \"INLINED\",\n                },\n              ],\n              \"message\": \"\",\n              \"name\": \"ReactDOM.createPortal\",\n              \"status\": \"INLINED\",\n            },\n          ],\n          \"message\": \"\",\n          \"name\": \"Child\",\n          \"status\": \"INLINED\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 3,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`createPortal: (createElement => createElement) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 3,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [\n            Object {\n              \"children\": Array [\n                Object {\n                  \"children\": Array [],\n                  \"message\": \"\",\n                  \"name\": \"Foo\",\n                  \"status\": \"INLINED\",\n                },\n              ],\n              \"message\": \"\",\n              \"name\": \"ReactDOM.createPortal\",\n              \"status\": \"INLINED\",\n            },\n          ],\n          \"message\": \"\",\n          \"name\": \"Child\",\n          \"status\": \"INLINED\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 3,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n"
  },
  {
    "path": "test/react/__snapshots__/ReactNative-test.js.snap",
    "content": "// Jest Snapshot v1, https://goo.gl/fbAQLP\n\nexports[`Simple 2: (JSX => JSX) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 9,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [\n            Object {\n              \"children\": Array [\n                Object {\n                  \"children\": Array [],\n                  \"message\": \"\",\n                  \"name\": \"Context.Consumer\",\n                  \"status\": \"INLINED\",\n                },\n                Object {\n                  \"children\": Array [],\n                  \"message\": \"\",\n                  \"name\": \"Context.Provider\",\n                  \"status\": \"INLINED\",\n                },\n              ],\n              \"message\": \"\",\n              \"name\": \"TouchableText\",\n              \"status\": \"INLINED\",\n            },\n          ],\n          \"message\": \"\",\n          \"name\": \"\",\n          \"status\": \"FORWARD_REF\",\n        },\n        Object {\n          \"children\": Array [\n            Object {\n              \"children\": Array [\n                Object {\n                  \"children\": Array [],\n                  \"message\": \"\",\n                  \"name\": \"Context.Consumer\",\n                  \"status\": \"INLINED\",\n                },\n                Object {\n                  \"children\": Array [\n                    Object {\n                      \"children\": Array [\n                        Object {\n                          \"children\": Array [\n                            Object {\n                              \"children\": Array [],\n                              \"message\": \"\",\n                              \"name\": \"Context.Consumer\",\n                              \"status\": \"INLINED\",\n                            },\n                          ],\n                          \"message\": \"\",\n                          \"name\": \"TouchableText\",\n                          \"status\": \"INLINED\",\n                        },\n                      ],\n                      \"message\": \"\",\n                      \"name\": \"\",\n                      \"status\": \"FORWARD_REF\",\n                    },\n                  ],\n                  \"message\": \"\",\n                  \"name\": \"Context.Provider\",\n                  \"status\": \"INLINED\",\n                },\n              ],\n              \"message\": \"\",\n              \"name\": \"TouchableText\",\n              \"status\": \"INLINED\",\n            },\n          ],\n          \"message\": \"\",\n          \"name\": \"\",\n          \"status\": \"FORWARD_REF\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 8,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`Simple 2: (JSX => createElement) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 9,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [\n            Object {\n              \"children\": Array [\n                Object {\n                  \"children\": Array [],\n                  \"message\": \"\",\n                  \"name\": \"Context.Consumer\",\n                  \"status\": \"INLINED\",\n                },\n                Object {\n                  \"children\": Array [],\n                  \"message\": \"\",\n                  \"name\": \"Context.Provider\",\n                  \"status\": \"INLINED\",\n                },\n              ],\n              \"message\": \"\",\n              \"name\": \"TouchableText\",\n              \"status\": \"INLINED\",\n            },\n          ],\n          \"message\": \"\",\n          \"name\": \"\",\n          \"status\": \"FORWARD_REF\",\n        },\n        Object {\n          \"children\": Array [\n            Object {\n              \"children\": Array [\n                Object {\n                  \"children\": Array [],\n                  \"message\": \"\",\n                  \"name\": \"Context.Consumer\",\n                  \"status\": \"INLINED\",\n                },\n                Object {\n                  \"children\": Array [\n                    Object {\n                      \"children\": Array [\n                        Object {\n                          \"children\": Array [\n                            Object {\n                              \"children\": Array [],\n                              \"message\": \"\",\n                              \"name\": \"Context.Consumer\",\n                              \"status\": \"INLINED\",\n                            },\n                          ],\n                          \"message\": \"\",\n                          \"name\": \"TouchableText\",\n                          \"status\": \"INLINED\",\n                        },\n                      ],\n                      \"message\": \"\",\n                      \"name\": \"\",\n                      \"status\": \"FORWARD_REF\",\n                    },\n                  ],\n                  \"message\": \"\",\n                  \"name\": \"Context.Provider\",\n                  \"status\": \"INLINED\",\n                },\n              ],\n              \"message\": \"\",\n              \"name\": \"TouchableText\",\n              \"status\": \"INLINED\",\n            },\n          ],\n          \"message\": \"\",\n          \"name\": \"\",\n          \"status\": \"FORWARD_REF\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 8,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`Simple 2: (createElement => JSX) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 9,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [\n            Object {\n              \"children\": Array [\n                Object {\n                  \"children\": Array [],\n                  \"message\": \"\",\n                  \"name\": \"Context.Consumer\",\n                  \"status\": \"INLINED\",\n                },\n                Object {\n                  \"children\": Array [],\n                  \"message\": \"\",\n                  \"name\": \"Context.Provider\",\n                  \"status\": \"INLINED\",\n                },\n              ],\n              \"message\": \"\",\n              \"name\": \"TouchableText\",\n              \"status\": \"INLINED\",\n            },\n          ],\n          \"message\": \"\",\n          \"name\": \"\",\n          \"status\": \"FORWARD_REF\",\n        },\n        Object {\n          \"children\": Array [\n            Object {\n              \"children\": Array [\n                Object {\n                  \"children\": Array [],\n                  \"message\": \"\",\n                  \"name\": \"Context.Consumer\",\n                  \"status\": \"INLINED\",\n                },\n                Object {\n                  \"children\": Array [\n                    Object {\n                      \"children\": Array [\n                        Object {\n                          \"children\": Array [\n                            Object {\n                              \"children\": Array [],\n                              \"message\": \"\",\n                              \"name\": \"Context.Consumer\",\n                              \"status\": \"INLINED\",\n                            },\n                          ],\n                          \"message\": \"\",\n                          \"name\": \"TouchableText\",\n                          \"status\": \"INLINED\",\n                        },\n                      ],\n                      \"message\": \"\",\n                      \"name\": \"\",\n                      \"status\": \"FORWARD_REF\",\n                    },\n                  ],\n                  \"message\": \"\",\n                  \"name\": \"Context.Provider\",\n                  \"status\": \"INLINED\",\n                },\n              ],\n              \"message\": \"\",\n              \"name\": \"TouchableText\",\n              \"status\": \"INLINED\",\n            },\n          ],\n          \"message\": \"\",\n          \"name\": \"\",\n          \"status\": \"FORWARD_REF\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 8,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`Simple 2: (createElement => createElement) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 9,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [\n            Object {\n              \"children\": Array [\n                Object {\n                  \"children\": Array [],\n                  \"message\": \"\",\n                  \"name\": \"Context.Consumer\",\n                  \"status\": \"INLINED\",\n                },\n                Object {\n                  \"children\": Array [],\n                  \"message\": \"\",\n                  \"name\": \"Context.Provider\",\n                  \"status\": \"INLINED\",\n                },\n              ],\n              \"message\": \"\",\n              \"name\": \"TouchableText\",\n              \"status\": \"INLINED\",\n            },\n          ],\n          \"message\": \"\",\n          \"name\": \"\",\n          \"status\": \"FORWARD_REF\",\n        },\n        Object {\n          \"children\": Array [\n            Object {\n              \"children\": Array [\n                Object {\n                  \"children\": Array [],\n                  \"message\": \"\",\n                  \"name\": \"Context.Consumer\",\n                  \"status\": \"INLINED\",\n                },\n                Object {\n                  \"children\": Array [\n                    Object {\n                      \"children\": Array [\n                        Object {\n                          \"children\": Array [\n                            Object {\n                              \"children\": Array [],\n                              \"message\": \"\",\n                              \"name\": \"Context.Consumer\",\n                              \"status\": \"INLINED\",\n                            },\n                          ],\n                          \"message\": \"\",\n                          \"name\": \"TouchableText\",\n                          \"status\": \"INLINED\",\n                        },\n                      ],\n                      \"message\": \"\",\n                      \"name\": \"\",\n                      \"status\": \"FORWARD_REF\",\n                    },\n                  ],\n                  \"message\": \"\",\n                  \"name\": \"Context.Provider\",\n                  \"status\": \"INLINED\",\n                },\n              ],\n              \"message\": \"\",\n              \"name\": \"TouchableText\",\n              \"status\": \"INLINED\",\n            },\n          ],\n          \"message\": \"\",\n          \"name\": \"\",\n          \"status\": \"FORWARD_REF\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 8,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`Simple: (JSX => JSX) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 7,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [\n            Object {\n              \"children\": Array [\n                Object {\n                  \"children\": Array [],\n                  \"message\": \"\",\n                  \"name\": \"Context.Consumer\",\n                  \"status\": \"INLINED\",\n                },\n                Object {\n                  \"children\": Array [],\n                  \"message\": \"\",\n                  \"name\": \"Context.Provider\",\n                  \"status\": \"INLINED\",\n                },\n              ],\n              \"message\": \"\",\n              \"name\": \"TouchableText\",\n              \"status\": \"INLINED\",\n            },\n          ],\n          \"message\": \"\",\n          \"name\": \"\",\n          \"status\": \"FORWARD_REF\",\n        },\n        Object {\n          \"children\": Array [\n            Object {\n              \"children\": Array [\n                Object {\n                  \"children\": Array [],\n                  \"message\": \"\",\n                  \"name\": \"Context.Consumer\",\n                  \"status\": \"INLINED\",\n                },\n                Object {\n                  \"children\": Array [],\n                  \"message\": \"\",\n                  \"name\": \"Context.Provider\",\n                  \"status\": \"INLINED\",\n                },\n              ],\n              \"message\": \"\",\n              \"name\": \"TouchableText\",\n              \"status\": \"INLINED\",\n            },\n          ],\n          \"message\": \"\",\n          \"name\": \"\",\n          \"status\": \"FORWARD_REF\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 6,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`Simple: (JSX => createElement) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 7,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [\n            Object {\n              \"children\": Array [\n                Object {\n                  \"children\": Array [],\n                  \"message\": \"\",\n                  \"name\": \"Context.Consumer\",\n                  \"status\": \"INLINED\",\n                },\n                Object {\n                  \"children\": Array [],\n                  \"message\": \"\",\n                  \"name\": \"Context.Provider\",\n                  \"status\": \"INLINED\",\n                },\n              ],\n              \"message\": \"\",\n              \"name\": \"TouchableText\",\n              \"status\": \"INLINED\",\n            },\n          ],\n          \"message\": \"\",\n          \"name\": \"\",\n          \"status\": \"FORWARD_REF\",\n        },\n        Object {\n          \"children\": Array [\n            Object {\n              \"children\": Array [\n                Object {\n                  \"children\": Array [],\n                  \"message\": \"\",\n                  \"name\": \"Context.Consumer\",\n                  \"status\": \"INLINED\",\n                },\n                Object {\n                  \"children\": Array [],\n                  \"message\": \"\",\n                  \"name\": \"Context.Provider\",\n                  \"status\": \"INLINED\",\n                },\n              ],\n              \"message\": \"\",\n              \"name\": \"TouchableText\",\n              \"status\": \"INLINED\",\n            },\n          ],\n          \"message\": \"\",\n          \"name\": \"\",\n          \"status\": \"FORWARD_REF\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 6,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`Simple: (createElement => JSX) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 7,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [\n            Object {\n              \"children\": Array [\n                Object {\n                  \"children\": Array [],\n                  \"message\": \"\",\n                  \"name\": \"Context.Consumer\",\n                  \"status\": \"INLINED\",\n                },\n                Object {\n                  \"children\": Array [],\n                  \"message\": \"\",\n                  \"name\": \"Context.Provider\",\n                  \"status\": \"INLINED\",\n                },\n              ],\n              \"message\": \"\",\n              \"name\": \"TouchableText\",\n              \"status\": \"INLINED\",\n            },\n          ],\n          \"message\": \"\",\n          \"name\": \"\",\n          \"status\": \"FORWARD_REF\",\n        },\n        Object {\n          \"children\": Array [\n            Object {\n              \"children\": Array [\n                Object {\n                  \"children\": Array [],\n                  \"message\": \"\",\n                  \"name\": \"Context.Consumer\",\n                  \"status\": \"INLINED\",\n                },\n                Object {\n                  \"children\": Array [],\n                  \"message\": \"\",\n                  \"name\": \"Context.Provider\",\n                  \"status\": \"INLINED\",\n                },\n              ],\n              \"message\": \"\",\n              \"name\": \"TouchableText\",\n              \"status\": \"INLINED\",\n            },\n          ],\n          \"message\": \"\",\n          \"name\": \"\",\n          \"status\": \"FORWARD_REF\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 6,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`Simple: (createElement => createElement) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 7,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [\n            Object {\n              \"children\": Array [\n                Object {\n                  \"children\": Array [],\n                  \"message\": \"\",\n                  \"name\": \"Context.Consumer\",\n                  \"status\": \"INLINED\",\n                },\n                Object {\n                  \"children\": Array [],\n                  \"message\": \"\",\n                  \"name\": \"Context.Provider\",\n                  \"status\": \"INLINED\",\n                },\n              ],\n              \"message\": \"\",\n              \"name\": \"TouchableText\",\n              \"status\": \"INLINED\",\n            },\n          ],\n          \"message\": \"\",\n          \"name\": \"\",\n          \"status\": \"FORWARD_REF\",\n        },\n        Object {\n          \"children\": Array [\n            Object {\n              \"children\": Array [\n                Object {\n                  \"children\": Array [],\n                  \"message\": \"\",\n                  \"name\": \"Context.Consumer\",\n                  \"status\": \"INLINED\",\n                },\n                Object {\n                  \"children\": Array [],\n                  \"message\": \"\",\n                  \"name\": \"Context.Provider\",\n                  \"status\": \"INLINED\",\n                },\n              ],\n              \"message\": \"\",\n              \"name\": \"TouchableText\",\n              \"status\": \"INLINED\",\n            },\n          ],\n          \"message\": \"\",\n          \"name\": \"\",\n          \"status\": \"FORWARD_REF\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 6,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n"
  },
  {
    "path": "test/react/__snapshots__/Reconciliation-test.js.snap",
    "content": "// Jest Snapshot v1, https://goo.gl/fbAQLP\n\nexports[`Component type change 2: (JSX => JSX) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 3,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [],\n          \"message\": \"\",\n          \"name\": \"Bar\",\n          \"status\": \"INLINED\",\n        },\n        Object {\n          \"children\": Array [],\n          \"message\": \"\",\n          \"name\": \"Foo\",\n          \"status\": \"INLINED\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 2,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`Component type change 2: (JSX => createElement) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 3,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [],\n          \"message\": \"\",\n          \"name\": \"Bar\",\n          \"status\": \"INLINED\",\n        },\n        Object {\n          \"children\": Array [],\n          \"message\": \"\",\n          \"name\": \"Foo\",\n          \"status\": \"INLINED\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 2,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`Component type change 2: (createElement => JSX) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 3,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [],\n          \"message\": \"\",\n          \"name\": \"Bar\",\n          \"status\": \"INLINED\",\n        },\n        Object {\n          \"children\": Array [],\n          \"message\": \"\",\n          \"name\": \"Foo\",\n          \"status\": \"INLINED\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 2,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`Component type change 2: (createElement => createElement) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 3,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [],\n          \"message\": \"\",\n          \"name\": \"Bar\",\n          \"status\": \"INLINED\",\n        },\n        Object {\n          \"children\": Array [],\n          \"message\": \"\",\n          \"name\": \"Foo\",\n          \"status\": \"INLINED\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 2,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`Component type change 3: (JSX => JSX) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 3,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [],\n          \"message\": \"\",\n          \"name\": \"Foo\",\n          \"status\": \"INLINED\",\n        },\n        Object {\n          \"children\": Array [],\n          \"message\": \"\",\n          \"name\": \"Foo\",\n          \"status\": \"INLINED\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 2,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`Component type change 3: (JSX => createElement) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 3,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [],\n          \"message\": \"\",\n          \"name\": \"Foo\",\n          \"status\": \"INLINED\",\n        },\n        Object {\n          \"children\": Array [],\n          \"message\": \"\",\n          \"name\": \"Foo\",\n          \"status\": \"INLINED\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 2,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`Component type change 3: (createElement => JSX) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 3,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [],\n          \"message\": \"\",\n          \"name\": \"Foo\",\n          \"status\": \"INLINED\",\n        },\n        Object {\n          \"children\": Array [],\n          \"message\": \"\",\n          \"name\": \"Foo\",\n          \"status\": \"INLINED\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 2,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`Component type change 3: (createElement => createElement) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 3,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [],\n          \"message\": \"\",\n          \"name\": \"Foo\",\n          \"status\": \"INLINED\",\n        },\n        Object {\n          \"children\": Array [],\n          \"message\": \"\",\n          \"name\": \"Foo\",\n          \"status\": \"INLINED\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 2,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`Component type change 4: (JSX => JSX) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 5,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [],\n          \"message\": \"\",\n          \"name\": \"Foo\",\n          \"status\": \"INLINED\",\n        },\n        Object {\n          \"children\": Array [],\n          \"message\": \"\",\n          \"name\": \"Foo\",\n          \"status\": \"INLINED\",\n        },\n        Object {\n          \"children\": Array [],\n          \"message\": \"\",\n          \"name\": \"Foo\",\n          \"status\": \"INLINED\",\n        },\n        Object {\n          \"children\": Array [],\n          \"message\": \"\",\n          \"name\": \"Foo\",\n          \"status\": \"INLINED\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 4,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`Component type change 4: (JSX => createElement) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 5,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [],\n          \"message\": \"\",\n          \"name\": \"Foo\",\n          \"status\": \"INLINED\",\n        },\n        Object {\n          \"children\": Array [],\n          \"message\": \"\",\n          \"name\": \"Foo\",\n          \"status\": \"INLINED\",\n        },\n        Object {\n          \"children\": Array [],\n          \"message\": \"\",\n          \"name\": \"Foo\",\n          \"status\": \"INLINED\",\n        },\n        Object {\n          \"children\": Array [],\n          \"message\": \"\",\n          \"name\": \"Foo\",\n          \"status\": \"INLINED\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 4,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`Component type change 4: (createElement => JSX) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 5,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [],\n          \"message\": \"\",\n          \"name\": \"Foo\",\n          \"status\": \"INLINED\",\n        },\n        Object {\n          \"children\": Array [],\n          \"message\": \"\",\n          \"name\": \"Foo\",\n          \"status\": \"INLINED\",\n        },\n        Object {\n          \"children\": Array [],\n          \"message\": \"\",\n          \"name\": \"Foo\",\n          \"status\": \"INLINED\",\n        },\n        Object {\n          \"children\": Array [],\n          \"message\": \"\",\n          \"name\": \"Foo\",\n          \"status\": \"INLINED\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 4,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`Component type change 4: (createElement => createElement) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 5,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [],\n          \"message\": \"\",\n          \"name\": \"Foo\",\n          \"status\": \"INLINED\",\n        },\n        Object {\n          \"children\": Array [],\n          \"message\": \"\",\n          \"name\": \"Foo\",\n          \"status\": \"INLINED\",\n        },\n        Object {\n          \"children\": Array [],\n          \"message\": \"\",\n          \"name\": \"Foo\",\n          \"status\": \"INLINED\",\n        },\n        Object {\n          \"children\": Array [],\n          \"message\": \"\",\n          \"name\": \"Foo\",\n          \"status\": \"INLINED\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 4,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`Component type change 5: (JSX => JSX) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 5,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [],\n          \"message\": \"\",\n          \"name\": \"Bar\",\n          \"status\": \"INLINED\",\n        },\n        Object {\n          \"children\": Array [],\n          \"message\": \"\",\n          \"name\": \"Bar\",\n          \"status\": \"INLINED\",\n        },\n        Object {\n          \"children\": Array [],\n          \"message\": \"\",\n          \"name\": \"Foo\",\n          \"status\": \"INLINED\",\n        },\n        Object {\n          \"children\": Array [],\n          \"message\": \"\",\n          \"name\": \"Foo\",\n          \"status\": \"INLINED\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 4,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`Component type change 5: (JSX => createElement) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 5,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [],\n          \"message\": \"\",\n          \"name\": \"Bar\",\n          \"status\": \"INLINED\",\n        },\n        Object {\n          \"children\": Array [],\n          \"message\": \"\",\n          \"name\": \"Bar\",\n          \"status\": \"INLINED\",\n        },\n        Object {\n          \"children\": Array [],\n          \"message\": \"\",\n          \"name\": \"Foo\",\n          \"status\": \"INLINED\",\n        },\n        Object {\n          \"children\": Array [],\n          \"message\": \"\",\n          \"name\": \"Foo\",\n          \"status\": \"INLINED\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 4,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`Component type change 5: (createElement => JSX) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 5,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [],\n          \"message\": \"\",\n          \"name\": \"Bar\",\n          \"status\": \"INLINED\",\n        },\n        Object {\n          \"children\": Array [],\n          \"message\": \"\",\n          \"name\": \"Bar\",\n          \"status\": \"INLINED\",\n        },\n        Object {\n          \"children\": Array [],\n          \"message\": \"\",\n          \"name\": \"Foo\",\n          \"status\": \"INLINED\",\n        },\n        Object {\n          \"children\": Array [],\n          \"message\": \"\",\n          \"name\": \"Foo\",\n          \"status\": \"INLINED\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 4,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`Component type change 5: (createElement => createElement) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 5,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [],\n          \"message\": \"\",\n          \"name\": \"Bar\",\n          \"status\": \"INLINED\",\n        },\n        Object {\n          \"children\": Array [],\n          \"message\": \"\",\n          \"name\": \"Bar\",\n          \"status\": \"INLINED\",\n        },\n        Object {\n          \"children\": Array [],\n          \"message\": \"\",\n          \"name\": \"Foo\",\n          \"status\": \"INLINED\",\n        },\n        Object {\n          \"children\": Array [],\n          \"message\": \"\",\n          \"name\": \"Foo\",\n          \"status\": \"INLINED\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 4,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`Component type change 6: (JSX => JSX) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 3,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [],\n          \"message\": \"\",\n          \"name\": \"Foo\",\n          \"status\": \"INLINED\",\n        },\n        Object {\n          \"children\": Array [],\n          \"message\": \"\",\n          \"name\": \"Foo\",\n          \"status\": \"INLINED\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 2,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`Component type change 6: (JSX => createElement) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 3,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [],\n          \"message\": \"\",\n          \"name\": \"Foo\",\n          \"status\": \"INLINED\",\n        },\n        Object {\n          \"children\": Array [],\n          \"message\": \"\",\n          \"name\": \"Foo\",\n          \"status\": \"INLINED\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 2,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`Component type change 6: (createElement => JSX) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 3,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [],\n          \"message\": \"\",\n          \"name\": \"Foo\",\n          \"status\": \"INLINED\",\n        },\n        Object {\n          \"children\": Array [],\n          \"message\": \"\",\n          \"name\": \"Foo\",\n          \"status\": \"INLINED\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 2,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`Component type change 6: (createElement => createElement) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 3,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [],\n          \"message\": \"\",\n          \"name\": \"Foo\",\n          \"status\": \"INLINED\",\n        },\n        Object {\n          \"children\": Array [],\n          \"message\": \"\",\n          \"name\": \"Foo\",\n          \"status\": \"INLINED\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 2,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`Component type change 7: (JSX => JSX) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 3,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [],\n          \"message\": \"\",\n          \"name\": \"Foo\",\n          \"status\": \"INLINED\",\n        },\n        Object {\n          \"children\": Array [],\n          \"message\": \"\",\n          \"name\": \"Foo\",\n          \"status\": \"INLINED\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 2,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`Component type change 7: (JSX => createElement) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 3,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [],\n          \"message\": \"\",\n          \"name\": \"Foo\",\n          \"status\": \"INLINED\",\n        },\n        Object {\n          \"children\": Array [],\n          \"message\": \"\",\n          \"name\": \"Foo\",\n          \"status\": \"INLINED\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 2,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`Component type change 7: (createElement => JSX) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 3,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [],\n          \"message\": \"\",\n          \"name\": \"Foo\",\n          \"status\": \"INLINED\",\n        },\n        Object {\n          \"children\": Array [],\n          \"message\": \"\",\n          \"name\": \"Foo\",\n          \"status\": \"INLINED\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 2,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`Component type change 7: (createElement => createElement) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 3,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [],\n          \"message\": \"\",\n          \"name\": \"Foo\",\n          \"status\": \"INLINED\",\n        },\n        Object {\n          \"children\": Array [],\n          \"message\": \"\",\n          \"name\": \"Foo\",\n          \"status\": \"INLINED\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 2,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`Component type change 8: (JSX => JSX) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 3,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [],\n          \"message\": \"\",\n          \"name\": \"Foo\",\n          \"status\": \"INLINED\",\n        },\n        Object {\n          \"children\": Array [],\n          \"message\": \"\",\n          \"name\": \"Bar\",\n          \"status\": \"INLINED\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 2,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`Component type change 8: (JSX => createElement) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 3,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [],\n          \"message\": \"\",\n          \"name\": \"Foo\",\n          \"status\": \"INLINED\",\n        },\n        Object {\n          \"children\": Array [],\n          \"message\": \"\",\n          \"name\": \"Bar\",\n          \"status\": \"INLINED\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 2,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`Component type change 8: (createElement => JSX) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 3,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [],\n          \"message\": \"\",\n          \"name\": \"Foo\",\n          \"status\": \"INLINED\",\n        },\n        Object {\n          \"children\": Array [],\n          \"message\": \"\",\n          \"name\": \"Bar\",\n          \"status\": \"INLINED\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 2,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`Component type change 8: (createElement => createElement) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 3,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [],\n          \"message\": \"\",\n          \"name\": \"Foo\",\n          \"status\": \"INLINED\",\n        },\n        Object {\n          \"children\": Array [],\n          \"message\": \"\",\n          \"name\": \"Bar\",\n          \"status\": \"INLINED\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 2,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`Component type change 9: (JSX => JSX) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 3,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [],\n          \"message\": \"\",\n          \"name\": \"Foo\",\n          \"status\": \"INLINED\",\n        },\n        Object {\n          \"children\": Array [],\n          \"message\": \"\",\n          \"name\": \"Foo\",\n          \"status\": \"INLINED\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 2,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`Component type change 9: (JSX => createElement) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 3,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [],\n          \"message\": \"\",\n          \"name\": \"Foo\",\n          \"status\": \"INLINED\",\n        },\n        Object {\n          \"children\": Array [],\n          \"message\": \"\",\n          \"name\": \"Foo\",\n          \"status\": \"INLINED\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 2,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`Component type change 9: (createElement => JSX) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 3,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [],\n          \"message\": \"\",\n          \"name\": \"Foo\",\n          \"status\": \"INLINED\",\n        },\n        Object {\n          \"children\": Array [],\n          \"message\": \"\",\n          \"name\": \"Foo\",\n          \"status\": \"INLINED\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 2,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`Component type change 9: (createElement => createElement) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 3,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [],\n          \"message\": \"\",\n          \"name\": \"Foo\",\n          \"status\": \"INLINED\",\n        },\n        Object {\n          \"children\": Array [],\n          \"message\": \"\",\n          \"name\": \"Foo\",\n          \"status\": \"INLINED\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 2,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`Component type change 10: (JSX => JSX) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 3,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [],\n          \"message\": \"\",\n          \"name\": \"Bar\",\n          \"status\": \"INLINED\",\n        },\n        Object {\n          \"children\": Array [],\n          \"message\": \"\",\n          \"name\": \"Foo\",\n          \"status\": \"INLINED\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 2,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`Component type change 10: (JSX => createElement) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 3,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [],\n          \"message\": \"\",\n          \"name\": \"Bar\",\n          \"status\": \"INLINED\",\n        },\n        Object {\n          \"children\": Array [],\n          \"message\": \"\",\n          \"name\": \"Foo\",\n          \"status\": \"INLINED\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 2,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`Component type change 10: (createElement => JSX) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 3,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [],\n          \"message\": \"\",\n          \"name\": \"Bar\",\n          \"status\": \"INLINED\",\n        },\n        Object {\n          \"children\": Array [],\n          \"message\": \"\",\n          \"name\": \"Foo\",\n          \"status\": \"INLINED\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 2,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`Component type change 10: (createElement => createElement) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 3,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [],\n          \"message\": \"\",\n          \"name\": \"Bar\",\n          \"status\": \"INLINED\",\n        },\n        Object {\n          \"children\": Array [],\n          \"message\": \"\",\n          \"name\": \"Foo\",\n          \"status\": \"INLINED\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 2,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`Component type change 11: (JSX => JSX) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 3,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [],\n          \"message\": \"\",\n          \"name\": \"Bar\",\n          \"status\": \"INLINED\",\n        },\n        Object {\n          \"children\": Array [],\n          \"message\": \"\",\n          \"name\": \"Foo\",\n          \"status\": \"INLINED\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 2,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`Component type change 11: (JSX => createElement) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 3,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [],\n          \"message\": \"\",\n          \"name\": \"Bar\",\n          \"status\": \"INLINED\",\n        },\n        Object {\n          \"children\": Array [],\n          \"message\": \"\",\n          \"name\": \"Foo\",\n          \"status\": \"INLINED\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 2,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`Component type change 11: (createElement => JSX) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 3,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [],\n          \"message\": \"\",\n          \"name\": \"Bar\",\n          \"status\": \"INLINED\",\n        },\n        Object {\n          \"children\": Array [],\n          \"message\": \"\",\n          \"name\": \"Foo\",\n          \"status\": \"INLINED\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 2,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`Component type change 11: (createElement => createElement) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 3,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [],\n          \"message\": \"\",\n          \"name\": \"Bar\",\n          \"status\": \"INLINED\",\n        },\n        Object {\n          \"children\": Array [],\n          \"message\": \"\",\n          \"name\": \"Foo\",\n          \"status\": \"INLINED\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 2,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`Component type change: (JSX => JSX) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 6,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [\n            Object {\n              \"children\": Array [],\n              \"message\": \"\",\n              \"name\": \"Stateful\",\n              \"status\": \"NEW_TREE\",\n            },\n          ],\n          \"message\": \"\",\n          \"name\": \"SettingsPane\",\n          \"status\": \"INLINED\",\n        },\n        Object {\n          \"children\": Array [\n            Object {\n              \"children\": Array [],\n              \"message\": \"\",\n              \"name\": \"Stateful\",\n              \"status\": \"NEW_TREE\",\n            },\n          ],\n          \"message\": \"\",\n          \"name\": \"MessagePane\",\n          \"status\": \"INLINED\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 2,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 2,\n}\n`;\n\nexports[`Component type change: (JSX => createElement) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 6,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [\n            Object {\n              \"children\": Array [],\n              \"message\": \"\",\n              \"name\": \"Stateful\",\n              \"status\": \"NEW_TREE\",\n            },\n          ],\n          \"message\": \"\",\n          \"name\": \"SettingsPane\",\n          \"status\": \"INLINED\",\n        },\n        Object {\n          \"children\": Array [\n            Object {\n              \"children\": Array [],\n              \"message\": \"\",\n              \"name\": \"Stateful\",\n              \"status\": \"NEW_TREE\",\n            },\n          ],\n          \"message\": \"\",\n          \"name\": \"MessagePane\",\n          \"status\": \"INLINED\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 2,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 2,\n}\n`;\n\nexports[`Component type change: (createElement => JSX) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 6,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [\n            Object {\n              \"children\": Array [],\n              \"message\": \"\",\n              \"name\": \"Stateful\",\n              \"status\": \"NEW_TREE\",\n            },\n          ],\n          \"message\": \"\",\n          \"name\": \"SettingsPane\",\n          \"status\": \"INLINED\",\n        },\n        Object {\n          \"children\": Array [\n            Object {\n              \"children\": Array [],\n              \"message\": \"\",\n              \"name\": \"Stateful\",\n              \"status\": \"NEW_TREE\",\n            },\n          ],\n          \"message\": \"\",\n          \"name\": \"MessagePane\",\n          \"status\": \"INLINED\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 2,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 2,\n}\n`;\n\nexports[`Component type change: (createElement => createElement) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 6,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [\n            Object {\n              \"children\": Array [],\n              \"message\": \"\",\n              \"name\": \"Stateful\",\n              \"status\": \"NEW_TREE\",\n            },\n          ],\n          \"message\": \"\",\n          \"name\": \"SettingsPane\",\n          \"status\": \"INLINED\",\n        },\n        Object {\n          \"children\": Array [\n            Object {\n              \"children\": Array [],\n              \"message\": \"\",\n              \"name\": \"Stateful\",\n              \"status\": \"NEW_TREE\",\n            },\n          ],\n          \"message\": \"\",\n          \"name\": \"MessagePane\",\n          \"status\": \"INLINED\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 2,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 2,\n}\n`;\n\nexports[`Component type same: (JSX => JSX) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 3,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [],\n          \"message\": \"\",\n          \"name\": \"Foo\",\n          \"status\": \"INLINED\",\n        },\n        Object {\n          \"children\": Array [],\n          \"message\": \"\",\n          \"name\": \"Foo\",\n          \"status\": \"INLINED\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 2,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`Component type same: (JSX => createElement) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 3,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [],\n          \"message\": \"\",\n          \"name\": \"Foo\",\n          \"status\": \"INLINED\",\n        },\n        Object {\n          \"children\": Array [],\n          \"message\": \"\",\n          \"name\": \"Foo\",\n          \"status\": \"INLINED\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 2,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`Component type same: (createElement => JSX) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 3,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [],\n          \"message\": \"\",\n          \"name\": \"Foo\",\n          \"status\": \"INLINED\",\n        },\n        Object {\n          \"children\": Array [],\n          \"message\": \"\",\n          \"name\": \"Foo\",\n          \"status\": \"INLINED\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 2,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`Component type same: (createElement => createElement) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 3,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [],\n          \"message\": \"\",\n          \"name\": \"Foo\",\n          \"status\": \"INLINED\",\n        },\n        Object {\n          \"children\": Array [],\n          \"message\": \"\",\n          \"name\": \"Foo\",\n          \"status\": \"INLINED\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 2,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`Key change with fragments: (JSX => JSX) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 5,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [],\n          \"message\": \"\",\n          \"name\": \"Stateful\",\n          \"status\": \"NEW_TREE\",\n        },\n        Object {\n          \"children\": Array [\n            Object {\n              \"children\": Array [],\n              \"message\": \"\",\n              \"name\": \"Stateful\",\n              \"status\": \"NEW_TREE\",\n            },\n          ],\n          \"message\": \"\",\n          \"name\": \"React.Fragment\",\n          \"status\": \"NORMAL\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 0,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 2,\n}\n`;\n\nexports[`Key change with fragments: (JSX => createElement) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 5,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [],\n          \"message\": \"\",\n          \"name\": \"Stateful\",\n          \"status\": \"NEW_TREE\",\n        },\n        Object {\n          \"children\": Array [\n            Object {\n              \"children\": Array [],\n              \"message\": \"\",\n              \"name\": \"Stateful\",\n              \"status\": \"NEW_TREE\",\n            },\n          ],\n          \"message\": \"\",\n          \"name\": \"React.Fragment\",\n          \"status\": \"NORMAL\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 0,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 2,\n}\n`;\n\nexports[`Key change with fragments: (createElement => JSX) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 5,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [],\n          \"message\": \"\",\n          \"name\": \"Stateful\",\n          \"status\": \"NEW_TREE\",\n        },\n        Object {\n          \"children\": Array [\n            Object {\n              \"children\": Array [],\n              \"message\": \"\",\n              \"name\": \"Stateful\",\n              \"status\": \"NEW_TREE\",\n            },\n          ],\n          \"message\": \"\",\n          \"name\": \"React.Fragment\",\n          \"status\": \"NORMAL\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 0,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 2,\n}\n`;\n\nexports[`Key change with fragments: (createElement => createElement) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 5,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [],\n          \"message\": \"\",\n          \"name\": \"Stateful\",\n          \"status\": \"NEW_TREE\",\n        },\n        Object {\n          \"children\": Array [\n            Object {\n              \"children\": Array [],\n              \"message\": \"\",\n              \"name\": \"Stateful\",\n              \"status\": \"NEW_TREE\",\n            },\n          ],\n          \"message\": \"\",\n          \"name\": \"React.Fragment\",\n          \"status\": \"NORMAL\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 0,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 2,\n}\n`;\n\nexports[`Key change: (JSX => JSX) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 4,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [],\n          \"message\": \"\",\n          \"name\": \"Stateful\",\n          \"status\": \"NEW_TREE\",\n        },\n        Object {\n          \"children\": Array [],\n          \"message\": \"\",\n          \"name\": \"Stateful\",\n          \"status\": \"NEW_TREE\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 0,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 2,\n}\n`;\n\nexports[`Key change: (JSX => createElement) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 4,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [],\n          \"message\": \"\",\n          \"name\": \"Stateful\",\n          \"status\": \"NEW_TREE\",\n        },\n        Object {\n          \"children\": Array [],\n          \"message\": \"\",\n          \"name\": \"Stateful\",\n          \"status\": \"NEW_TREE\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 0,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 2,\n}\n`;\n\nexports[`Key change: (createElement => JSX) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 4,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [],\n          \"message\": \"\",\n          \"name\": \"Stateful\",\n          \"status\": \"NEW_TREE\",\n        },\n        Object {\n          \"children\": Array [],\n          \"message\": \"\",\n          \"name\": \"Stateful\",\n          \"status\": \"NEW_TREE\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 0,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 2,\n}\n`;\n\nexports[`Key change: (createElement => createElement) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 4,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [],\n          \"message\": \"\",\n          \"name\": \"Stateful\",\n          \"status\": \"NEW_TREE\",\n        },\n        Object {\n          \"children\": Array [],\n          \"message\": \"\",\n          \"name\": \"Stateful\",\n          \"status\": \"NEW_TREE\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 0,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 2,\n}\n`;\n\nexports[`Key nesting 2: (JSX => JSX) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 3,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [],\n          \"message\": \"\",\n          \"name\": \"Child\",\n          \"status\": \"INLINED\",\n        },\n        Object {\n          \"children\": Array [],\n          \"message\": \"\",\n          \"name\": \"Child\",\n          \"status\": \"INLINED\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 2,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`Key nesting 2: (JSX => createElement) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 3,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [],\n          \"message\": \"\",\n          \"name\": \"Child\",\n          \"status\": \"INLINED\",\n        },\n        Object {\n          \"children\": Array [],\n          \"message\": \"\",\n          \"name\": \"Child\",\n          \"status\": \"INLINED\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 2,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`Key nesting 2: (createElement => JSX) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 3,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [],\n          \"message\": \"\",\n          \"name\": \"Child\",\n          \"status\": \"INLINED\",\n        },\n        Object {\n          \"children\": Array [],\n          \"message\": \"\",\n          \"name\": \"Child\",\n          \"status\": \"INLINED\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 2,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`Key nesting 2: (createElement => createElement) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 3,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [],\n          \"message\": \"\",\n          \"name\": \"Child\",\n          \"status\": \"INLINED\",\n        },\n        Object {\n          \"children\": Array [],\n          \"message\": \"\",\n          \"name\": \"Child\",\n          \"status\": \"INLINED\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 2,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`Key nesting 3: (JSX => JSX) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 3,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [],\n          \"message\": \"\",\n          \"name\": \"Child\",\n          \"status\": \"INLINED\",\n        },\n        Object {\n          \"children\": Array [],\n          \"message\": \"\",\n          \"name\": \"Child\",\n          \"status\": \"INLINED\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 2,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`Key nesting 3: (JSX => createElement) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 3,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [],\n          \"message\": \"\",\n          \"name\": \"Child\",\n          \"status\": \"INLINED\",\n        },\n        Object {\n          \"children\": Array [],\n          \"message\": \"\",\n          \"name\": \"Child\",\n          \"status\": \"INLINED\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 2,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`Key nesting 3: (createElement => JSX) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 3,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [],\n          \"message\": \"\",\n          \"name\": \"Child\",\n          \"status\": \"INLINED\",\n        },\n        Object {\n          \"children\": Array [],\n          \"message\": \"\",\n          \"name\": \"Child\",\n          \"status\": \"INLINED\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 2,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`Key nesting 3: (createElement => createElement) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 3,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [],\n          \"message\": \"\",\n          \"name\": \"Child\",\n          \"status\": \"INLINED\",\n        },\n        Object {\n          \"children\": Array [],\n          \"message\": \"\",\n          \"name\": \"Child\",\n          \"status\": \"INLINED\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 2,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`Key nesting 4: (JSX => JSX) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 3,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [],\n          \"message\": \"\",\n          \"name\": \"Foo\",\n          \"status\": \"INLINED\",\n        },\n        Object {\n          \"children\": Array [],\n          \"message\": \"\",\n          \"name\": \"Bar\",\n          \"status\": \"INLINED\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 2,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`Key nesting 4: (JSX => createElement) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 3,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [],\n          \"message\": \"\",\n          \"name\": \"Foo\",\n          \"status\": \"INLINED\",\n        },\n        Object {\n          \"children\": Array [],\n          \"message\": \"\",\n          \"name\": \"Bar\",\n          \"status\": \"INLINED\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 2,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`Key nesting 4: (createElement => JSX) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 3,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [],\n          \"message\": \"\",\n          \"name\": \"Foo\",\n          \"status\": \"INLINED\",\n        },\n        Object {\n          \"children\": Array [],\n          \"message\": \"\",\n          \"name\": \"Bar\",\n          \"status\": \"INLINED\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 2,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`Key nesting 4: (createElement => createElement) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 3,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [],\n          \"message\": \"\",\n          \"name\": \"Foo\",\n          \"status\": \"INLINED\",\n        },\n        Object {\n          \"children\": Array [],\n          \"message\": \"\",\n          \"name\": \"Bar\",\n          \"status\": \"INLINED\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 2,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`Key nesting 5: (JSX => JSX) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 3,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [],\n          \"message\": \"\",\n          \"name\": \"Foo\",\n          \"status\": \"INLINED\",\n        },\n        Object {\n          \"children\": Array [],\n          \"message\": \"\",\n          \"name\": \"Bar\",\n          \"status\": \"INLINED\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 2,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`Key nesting 5: (JSX => createElement) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 3,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [],\n          \"message\": \"\",\n          \"name\": \"Foo\",\n          \"status\": \"INLINED\",\n        },\n        Object {\n          \"children\": Array [],\n          \"message\": \"\",\n          \"name\": \"Bar\",\n          \"status\": \"INLINED\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 2,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`Key nesting 5: (createElement => JSX) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 3,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [],\n          \"message\": \"\",\n          \"name\": \"Foo\",\n          \"status\": \"INLINED\",\n        },\n        Object {\n          \"children\": Array [],\n          \"message\": \"\",\n          \"name\": \"Bar\",\n          \"status\": \"INLINED\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 2,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`Key nesting 5: (createElement => createElement) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 3,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [],\n          \"message\": \"\",\n          \"name\": \"Foo\",\n          \"status\": \"INLINED\",\n        },\n        Object {\n          \"children\": Array [],\n          \"message\": \"\",\n          \"name\": \"Bar\",\n          \"status\": \"INLINED\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 2,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`Key nesting 6: (JSX => JSX) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 3,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [],\n          \"message\": \"\",\n          \"name\": \"Foo\",\n          \"status\": \"INLINED\",\n        },\n        Object {\n          \"children\": Array [],\n          \"message\": \"\",\n          \"name\": \"Bar\",\n          \"status\": \"INLINED\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 2,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`Key nesting 6: (JSX => createElement) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 3,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [],\n          \"message\": \"\",\n          \"name\": \"Foo\",\n          \"status\": \"INLINED\",\n        },\n        Object {\n          \"children\": Array [],\n          \"message\": \"\",\n          \"name\": \"Bar\",\n          \"status\": \"INLINED\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 2,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`Key nesting 6: (createElement => JSX) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 3,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [],\n          \"message\": \"\",\n          \"name\": \"Foo\",\n          \"status\": \"INLINED\",\n        },\n        Object {\n          \"children\": Array [],\n          \"message\": \"\",\n          \"name\": \"Bar\",\n          \"status\": \"INLINED\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 2,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`Key nesting 6: (createElement => createElement) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 3,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [],\n          \"message\": \"\",\n          \"name\": \"Foo\",\n          \"status\": \"INLINED\",\n        },\n        Object {\n          \"children\": Array [],\n          \"message\": \"\",\n          \"name\": \"Bar\",\n          \"status\": \"INLINED\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 2,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`Key nesting 7: (JSX => JSX) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 3,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [],\n          \"message\": \"\",\n          \"name\": \"Foo\",\n          \"status\": \"INLINED\",\n        },\n        Object {\n          \"children\": Array [],\n          \"message\": \"\",\n          \"name\": \"Bar\",\n          \"status\": \"INLINED\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 2,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`Key nesting 7: (JSX => createElement) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 3,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [],\n          \"message\": \"\",\n          \"name\": \"Foo\",\n          \"status\": \"INLINED\",\n        },\n        Object {\n          \"children\": Array [],\n          \"message\": \"\",\n          \"name\": \"Bar\",\n          \"status\": \"INLINED\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 2,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`Key nesting 7: (createElement => JSX) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 3,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [],\n          \"message\": \"\",\n          \"name\": \"Foo\",\n          \"status\": \"INLINED\",\n        },\n        Object {\n          \"children\": Array [],\n          \"message\": \"\",\n          \"name\": \"Bar\",\n          \"status\": \"INLINED\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 2,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`Key nesting 7: (createElement => createElement) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 3,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [],\n          \"message\": \"\",\n          \"name\": \"Foo\",\n          \"status\": \"INLINED\",\n        },\n        Object {\n          \"children\": Array [],\n          \"message\": \"\",\n          \"name\": \"Bar\",\n          \"status\": \"INLINED\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 2,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`Key nesting 8: (JSX => JSX) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 3,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [],\n          \"message\": \"\",\n          \"name\": \"Foo\",\n          \"status\": \"INLINED\",\n        },\n        Object {\n          \"children\": Array [],\n          \"message\": \"\",\n          \"name\": \"Bar\",\n          \"status\": \"INLINED\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 2,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`Key nesting 8: (JSX => createElement) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 3,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [],\n          \"message\": \"\",\n          \"name\": \"Foo\",\n          \"status\": \"INLINED\",\n        },\n        Object {\n          \"children\": Array [],\n          \"message\": \"\",\n          \"name\": \"Bar\",\n          \"status\": \"INLINED\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 2,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`Key nesting 8: (createElement => JSX) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 3,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [],\n          \"message\": \"\",\n          \"name\": \"Foo\",\n          \"status\": \"INLINED\",\n        },\n        Object {\n          \"children\": Array [],\n          \"message\": \"\",\n          \"name\": \"Bar\",\n          \"status\": \"INLINED\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 2,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`Key nesting 8: (createElement => createElement) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 3,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [],\n          \"message\": \"\",\n          \"name\": \"Foo\",\n          \"status\": \"INLINED\",\n        },\n        Object {\n          \"children\": Array [],\n          \"message\": \"\",\n          \"name\": \"Bar\",\n          \"status\": \"INLINED\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 2,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`Key nesting 9: (JSX => JSX) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 3,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [],\n          \"message\": \"\",\n          \"name\": \"Foo\",\n          \"status\": \"INLINED\",\n        },\n        Object {\n          \"children\": Array [],\n          \"message\": \"\",\n          \"name\": \"Bar\",\n          \"status\": \"INLINED\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 2,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`Key nesting 9: (JSX => createElement) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 3,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [],\n          \"message\": \"\",\n          \"name\": \"Foo\",\n          \"status\": \"INLINED\",\n        },\n        Object {\n          \"children\": Array [],\n          \"message\": \"\",\n          \"name\": \"Bar\",\n          \"status\": \"INLINED\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 2,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`Key nesting 9: (createElement => JSX) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 3,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [],\n          \"message\": \"\",\n          \"name\": \"Foo\",\n          \"status\": \"INLINED\",\n        },\n        Object {\n          \"children\": Array [],\n          \"message\": \"\",\n          \"name\": \"Bar\",\n          \"status\": \"INLINED\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 2,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`Key nesting 9: (createElement => createElement) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 3,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [],\n          \"message\": \"\",\n          \"name\": \"Foo\",\n          \"status\": \"INLINED\",\n        },\n        Object {\n          \"children\": Array [],\n          \"message\": \"\",\n          \"name\": \"Bar\",\n          \"status\": \"INLINED\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 2,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`Key nesting: (JSX => JSX) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 6,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [\n            Object {\n              \"children\": Array [],\n              \"message\": \"\",\n              \"name\": \"Stateful\",\n              \"status\": \"NEW_TREE\",\n            },\n          ],\n          \"message\": \"\",\n          \"name\": \"SettingsPane\",\n          \"status\": \"INLINED\",\n        },\n        Object {\n          \"children\": Array [\n            Object {\n              \"children\": Array [],\n              \"message\": \"\",\n              \"name\": \"Stateful\",\n              \"status\": \"NEW_TREE\",\n            },\n          ],\n          \"message\": \"\",\n          \"name\": \"MessagePane\",\n          \"status\": \"INLINED\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 2,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 2,\n}\n`;\n\nexports[`Key nesting: (JSX => createElement) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 6,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [\n            Object {\n              \"children\": Array [],\n              \"message\": \"\",\n              \"name\": \"Stateful\",\n              \"status\": \"NEW_TREE\",\n            },\n          ],\n          \"message\": \"\",\n          \"name\": \"SettingsPane\",\n          \"status\": \"INLINED\",\n        },\n        Object {\n          \"children\": Array [\n            Object {\n              \"children\": Array [],\n              \"message\": \"\",\n              \"name\": \"Stateful\",\n              \"status\": \"NEW_TREE\",\n            },\n          ],\n          \"message\": \"\",\n          \"name\": \"MessagePane\",\n          \"status\": \"INLINED\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 2,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 2,\n}\n`;\n\nexports[`Key nesting: (createElement => JSX) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 6,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [\n            Object {\n              \"children\": Array [],\n              \"message\": \"\",\n              \"name\": \"Stateful\",\n              \"status\": \"NEW_TREE\",\n            },\n          ],\n          \"message\": \"\",\n          \"name\": \"SettingsPane\",\n          \"status\": \"INLINED\",\n        },\n        Object {\n          \"children\": Array [\n            Object {\n              \"children\": Array [],\n              \"message\": \"\",\n              \"name\": \"Stateful\",\n              \"status\": \"NEW_TREE\",\n            },\n          ],\n          \"message\": \"\",\n          \"name\": \"MessagePane\",\n          \"status\": \"INLINED\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 2,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 2,\n}\n`;\n\nexports[`Key nesting: (createElement => createElement) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 6,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [\n            Object {\n              \"children\": Array [],\n              \"message\": \"\",\n              \"name\": \"Stateful\",\n              \"status\": \"NEW_TREE\",\n            },\n          ],\n          \"message\": \"\",\n          \"name\": \"SettingsPane\",\n          \"status\": \"INLINED\",\n        },\n        Object {\n          \"children\": Array [\n            Object {\n              \"children\": Array [],\n              \"message\": \"\",\n              \"name\": \"Stateful\",\n              \"status\": \"NEW_TREE\",\n            },\n          ],\n          \"message\": \"\",\n          \"name\": \"MessagePane\",\n          \"status\": \"INLINED\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 2,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 2,\n}\n`;\n\nexports[`Key not changing with fragments: (JSX => JSX) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 5,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [],\n          \"message\": \"\",\n          \"name\": \"Stateful\",\n          \"status\": \"NEW_TREE\",\n        },\n        Object {\n          \"children\": Array [\n            Object {\n              \"children\": Array [],\n              \"message\": \"\",\n              \"name\": \"Stateful\",\n              \"status\": \"NEW_TREE\",\n            },\n          ],\n          \"message\": \"\",\n          \"name\": \"React.Fragment\",\n          \"status\": \"NORMAL\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 0,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 2,\n}\n`;\n\nexports[`Key not changing with fragments: (JSX => createElement) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 5,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [],\n          \"message\": \"\",\n          \"name\": \"Stateful\",\n          \"status\": \"NEW_TREE\",\n        },\n        Object {\n          \"children\": Array [\n            Object {\n              \"children\": Array [],\n              \"message\": \"\",\n              \"name\": \"Stateful\",\n              \"status\": \"NEW_TREE\",\n            },\n          ],\n          \"message\": \"\",\n          \"name\": \"React.Fragment\",\n          \"status\": \"NORMAL\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 0,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 2,\n}\n`;\n\nexports[`Key not changing with fragments: (createElement => JSX) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 5,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [],\n          \"message\": \"\",\n          \"name\": \"Stateful\",\n          \"status\": \"NEW_TREE\",\n        },\n        Object {\n          \"children\": Array [\n            Object {\n              \"children\": Array [],\n              \"message\": \"\",\n              \"name\": \"Stateful\",\n              \"status\": \"NEW_TREE\",\n            },\n          ],\n          \"message\": \"\",\n          \"name\": \"React.Fragment\",\n          \"status\": \"NORMAL\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 0,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 2,\n}\n`;\n\nexports[`Key not changing with fragments: (createElement => createElement) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 5,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [],\n          \"message\": \"\",\n          \"name\": \"Stateful\",\n          \"status\": \"NEW_TREE\",\n        },\n        Object {\n          \"children\": Array [\n            Object {\n              \"children\": Array [],\n              \"message\": \"\",\n              \"name\": \"Stateful\",\n              \"status\": \"NEW_TREE\",\n            },\n          ],\n          \"message\": \"\",\n          \"name\": \"React.Fragment\",\n          \"status\": \"NORMAL\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 0,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 2,\n}\n`;\n\nexports[`Lazy branched elements 2: (JSX => JSX) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 2,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [],\n          \"message\": \"\",\n          \"name\": \"Button\",\n          \"status\": \"INLINED\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 1,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`Lazy branched elements 2: (JSX => createElement) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 2,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [],\n          \"message\": \"\",\n          \"name\": \"Button\",\n          \"status\": \"INLINED\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 1,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`Lazy branched elements 2: (createElement => JSX) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 2,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [],\n          \"message\": \"\",\n          \"name\": \"Button\",\n          \"status\": \"INLINED\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 1,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`Lazy branched elements 2: (createElement => createElement) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 2,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [],\n          \"message\": \"\",\n          \"name\": \"Button\",\n          \"status\": \"INLINED\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 1,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`Lazy branched elements: (JSX => JSX) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 1,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 0,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`Lazy branched elements: (JSX => createElement) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 1,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 0,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`Lazy branched elements: (createElement => JSX) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 1,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 0,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`Lazy branched elements: (createElement => createElement) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 1,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 0,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n"
  },
  {
    "path": "test/react/__snapshots__/RenderProps-test.js.snap",
    "content": "// Jest Snapshot v1, https://goo.gl/fbAQLP\n\nexports[`React Context 2: (JSX => JSX) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 4,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [\n            Object {\n              \"children\": Array [\n                Object {\n                  \"children\": Array [],\n                  \"message\": \"\",\n                  \"name\": \"Context.Consumer\",\n                  \"status\": \"INLINED\",\n                },\n              ],\n              \"message\": \"\",\n              \"name\": \"Child\",\n              \"status\": \"INLINED\",\n            },\n          ],\n          \"message\": \"\",\n          \"name\": \"Context.Provider\",\n          \"status\": \"INLINED\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 3,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`React Context 2: (JSX => createElement) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 4,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [\n            Object {\n              \"children\": Array [\n                Object {\n                  \"children\": Array [],\n                  \"message\": \"\",\n                  \"name\": \"Context.Consumer\",\n                  \"status\": \"INLINED\",\n                },\n              ],\n              \"message\": \"\",\n              \"name\": \"Child\",\n              \"status\": \"INLINED\",\n            },\n          ],\n          \"message\": \"\",\n          \"name\": \"Context.Provider\",\n          \"status\": \"INLINED\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 3,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`React Context 2: (createElement => JSX) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 4,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [\n            Object {\n              \"children\": Array [\n                Object {\n                  \"children\": Array [],\n                  \"message\": \"\",\n                  \"name\": \"Context.Consumer\",\n                  \"status\": \"INLINED\",\n                },\n              ],\n              \"message\": \"\",\n              \"name\": \"Child\",\n              \"status\": \"INLINED\",\n            },\n          ],\n          \"message\": \"\",\n          \"name\": \"Context.Provider\",\n          \"status\": \"INLINED\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 3,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`React Context 2: (createElement => createElement) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 4,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [\n            Object {\n              \"children\": Array [\n                Object {\n                  \"children\": Array [],\n                  \"message\": \"\",\n                  \"name\": \"Context.Consumer\",\n                  \"status\": \"INLINED\",\n                },\n              ],\n              \"message\": \"\",\n              \"name\": \"Child\",\n              \"status\": \"INLINED\",\n            },\n          ],\n          \"message\": \"\",\n          \"name\": \"Context.Provider\",\n          \"status\": \"INLINED\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 3,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`React Context 3: (JSX => JSX) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 2,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [\n            Object {\n              \"children\": Array [],\n              \"message\": \"\",\n              \"name\": \"Context.Consumer\",\n              \"status\": \"RENDER_PROPS\",\n            },\n          ],\n          \"message\": \"\",\n          \"name\": \"Child\",\n          \"status\": \"INLINED\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 1,\n  \"optimizedNestedClosures\": 1,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`React Context 3: (JSX => createElement) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 2,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [\n            Object {\n              \"children\": Array [],\n              \"message\": \"\",\n              \"name\": \"Context.Consumer\",\n              \"status\": \"RENDER_PROPS\",\n            },\n          ],\n          \"message\": \"\",\n          \"name\": \"Child\",\n          \"status\": \"INLINED\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 1,\n  \"optimizedNestedClosures\": 1,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`React Context 3: (createElement => JSX) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 2,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [\n            Object {\n              \"children\": Array [],\n              \"message\": \"\",\n              \"name\": \"Context.Consumer\",\n              \"status\": \"RENDER_PROPS\",\n            },\n          ],\n          \"message\": \"\",\n          \"name\": \"Child\",\n          \"status\": \"INLINED\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 1,\n  \"optimizedNestedClosures\": 1,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`React Context 3: (createElement => createElement) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 2,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [\n            Object {\n              \"children\": Array [],\n              \"message\": \"\",\n              \"name\": \"Context.Consumer\",\n              \"status\": \"RENDER_PROPS\",\n            },\n          ],\n          \"message\": \"\",\n          \"name\": \"Child\",\n          \"status\": \"INLINED\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 1,\n  \"optimizedNestedClosures\": 1,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`React Context 4: (JSX => JSX) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 7,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [\n            Object {\n              \"children\": Array [\n                Object {\n                  \"children\": Array [\n                    Object {\n                      \"children\": Array [],\n                      \"message\": \"\",\n                      \"name\": \"Context.Consumer\",\n                      \"status\": \"INLINED\",\n                    },\n                  ],\n                  \"message\": \"\",\n                  \"name\": \"Child\",\n                  \"status\": \"INLINED\",\n                },\n              ],\n              \"message\": \"\",\n              \"name\": \"Context.Provider\",\n              \"status\": \"INLINED\",\n            },\n            Object {\n              \"children\": Array [\n                Object {\n                  \"children\": Array [],\n                  \"message\": \"\",\n                  \"name\": \"Context.Consumer\",\n                  \"status\": \"INLINED\",\n                },\n              ],\n              \"message\": \"\",\n              \"name\": \"Child\",\n              \"status\": \"INLINED\",\n            },\n          ],\n          \"message\": \"\",\n          \"name\": \"Context.Provider\",\n          \"status\": \"INLINED\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 6,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`React Context 4: (JSX => createElement) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 7,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [\n            Object {\n              \"children\": Array [\n                Object {\n                  \"children\": Array [\n                    Object {\n                      \"children\": Array [],\n                      \"message\": \"\",\n                      \"name\": \"Context.Consumer\",\n                      \"status\": \"INLINED\",\n                    },\n                  ],\n                  \"message\": \"\",\n                  \"name\": \"Child\",\n                  \"status\": \"INLINED\",\n                },\n              ],\n              \"message\": \"\",\n              \"name\": \"Context.Provider\",\n              \"status\": \"INLINED\",\n            },\n            Object {\n              \"children\": Array [\n                Object {\n                  \"children\": Array [],\n                  \"message\": \"\",\n                  \"name\": \"Context.Consumer\",\n                  \"status\": \"INLINED\",\n                },\n              ],\n              \"message\": \"\",\n              \"name\": \"Child\",\n              \"status\": \"INLINED\",\n            },\n          ],\n          \"message\": \"\",\n          \"name\": \"Context.Provider\",\n          \"status\": \"INLINED\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 6,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`React Context 4: (createElement => JSX) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 7,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [\n            Object {\n              \"children\": Array [\n                Object {\n                  \"children\": Array [\n                    Object {\n                      \"children\": Array [],\n                      \"message\": \"\",\n                      \"name\": \"Context.Consumer\",\n                      \"status\": \"INLINED\",\n                    },\n                  ],\n                  \"message\": \"\",\n                  \"name\": \"Child\",\n                  \"status\": \"INLINED\",\n                },\n              ],\n              \"message\": \"\",\n              \"name\": \"Context.Provider\",\n              \"status\": \"INLINED\",\n            },\n            Object {\n              \"children\": Array [\n                Object {\n                  \"children\": Array [],\n                  \"message\": \"\",\n                  \"name\": \"Context.Consumer\",\n                  \"status\": \"INLINED\",\n                },\n              ],\n              \"message\": \"\",\n              \"name\": \"Child\",\n              \"status\": \"INLINED\",\n            },\n          ],\n          \"message\": \"\",\n          \"name\": \"Context.Provider\",\n          \"status\": \"INLINED\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 6,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`React Context 4: (createElement => createElement) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 7,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [\n            Object {\n              \"children\": Array [\n                Object {\n                  \"children\": Array [\n                    Object {\n                      \"children\": Array [],\n                      \"message\": \"\",\n                      \"name\": \"Context.Consumer\",\n                      \"status\": \"INLINED\",\n                    },\n                  ],\n                  \"message\": \"\",\n                  \"name\": \"Child\",\n                  \"status\": \"INLINED\",\n                },\n              ],\n              \"message\": \"\",\n              \"name\": \"Context.Provider\",\n              \"status\": \"INLINED\",\n            },\n            Object {\n              \"children\": Array [\n                Object {\n                  \"children\": Array [],\n                  \"message\": \"\",\n                  \"name\": \"Context.Consumer\",\n                  \"status\": \"INLINED\",\n                },\n              ],\n              \"message\": \"\",\n              \"name\": \"Child\",\n              \"status\": \"INLINED\",\n            },\n          ],\n          \"message\": \"\",\n          \"name\": \"Context.Provider\",\n          \"status\": \"INLINED\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 6,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`React Context 5: (JSX => JSX) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 5,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [\n            Object {\n              \"children\": Array [\n                Object {\n                  \"children\": Array [],\n                  \"message\": \"\",\n                  \"name\": \"Context.Consumer\",\n                  \"status\": \"INLINED\",\n                },\n              ],\n              \"message\": \"\",\n              \"name\": \"Child\",\n              \"status\": \"INLINED\",\n            },\n          ],\n          \"message\": \"\",\n          \"name\": \"Context.Provider\",\n          \"status\": \"INLINED\",\n        },\n        Object {\n          \"children\": Array [\n            Object {\n              \"children\": Array [],\n              \"message\": \"\",\n              \"name\": \"Context.Consumer\",\n              \"status\": \"RENDER_PROPS\",\n            },\n          ],\n          \"message\": \"\",\n          \"name\": \"Child\",\n          \"status\": \"INLINED\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 4,\n  \"optimizedNestedClosures\": 1,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`React Context 5: (JSX => createElement) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 5,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [\n            Object {\n              \"children\": Array [\n                Object {\n                  \"children\": Array [],\n                  \"message\": \"\",\n                  \"name\": \"Context.Consumer\",\n                  \"status\": \"INLINED\",\n                },\n              ],\n              \"message\": \"\",\n              \"name\": \"Child\",\n              \"status\": \"INLINED\",\n            },\n          ],\n          \"message\": \"\",\n          \"name\": \"Context.Provider\",\n          \"status\": \"INLINED\",\n        },\n        Object {\n          \"children\": Array [\n            Object {\n              \"children\": Array [],\n              \"message\": \"\",\n              \"name\": \"Context.Consumer\",\n              \"status\": \"RENDER_PROPS\",\n            },\n          ],\n          \"message\": \"\",\n          \"name\": \"Child\",\n          \"status\": \"INLINED\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 4,\n  \"optimizedNestedClosures\": 1,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`React Context 5: (createElement => JSX) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 5,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [\n            Object {\n              \"children\": Array [\n                Object {\n                  \"children\": Array [],\n                  \"message\": \"\",\n                  \"name\": \"Context.Consumer\",\n                  \"status\": \"INLINED\",\n                },\n              ],\n              \"message\": \"\",\n              \"name\": \"Child\",\n              \"status\": \"INLINED\",\n            },\n          ],\n          \"message\": \"\",\n          \"name\": \"Context.Provider\",\n          \"status\": \"INLINED\",\n        },\n        Object {\n          \"children\": Array [\n            Object {\n              \"children\": Array [],\n              \"message\": \"\",\n              \"name\": \"Context.Consumer\",\n              \"status\": \"RENDER_PROPS\",\n            },\n          ],\n          \"message\": \"\",\n          \"name\": \"Child\",\n          \"status\": \"INLINED\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 4,\n  \"optimizedNestedClosures\": 1,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`React Context 5: (createElement => createElement) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 5,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [\n            Object {\n              \"children\": Array [\n                Object {\n                  \"children\": Array [],\n                  \"message\": \"\",\n                  \"name\": \"Context.Consumer\",\n                  \"status\": \"INLINED\",\n                },\n              ],\n              \"message\": \"\",\n              \"name\": \"Child\",\n              \"status\": \"INLINED\",\n            },\n          ],\n          \"message\": \"\",\n          \"name\": \"Context.Provider\",\n          \"status\": \"INLINED\",\n        },\n        Object {\n          \"children\": Array [\n            Object {\n              \"children\": Array [],\n              \"message\": \"\",\n              \"name\": \"Context.Consumer\",\n              \"status\": \"RENDER_PROPS\",\n            },\n          ],\n          \"message\": \"\",\n          \"name\": \"Child\",\n          \"status\": \"INLINED\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 4,\n  \"optimizedNestedClosures\": 1,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`React Context 6: (JSX => JSX) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 4,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [\n            Object {\n              \"children\": Array [\n                Object {\n                  \"children\": Array [],\n                  \"message\": \"\",\n                  \"name\": \"Context.Consumer\",\n                  \"status\": \"INLINED\",\n                },\n              ],\n              \"message\": \"\",\n              \"name\": \"Child\",\n              \"status\": \"INLINED\",\n            },\n          ],\n          \"message\": \"\",\n          \"name\": \"Context.Provider\",\n          \"status\": \"INLINED\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 3,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`React Context 6: (JSX => createElement) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 4,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [\n            Object {\n              \"children\": Array [\n                Object {\n                  \"children\": Array [],\n                  \"message\": \"\",\n                  \"name\": \"Context.Consumer\",\n                  \"status\": \"INLINED\",\n                },\n              ],\n              \"message\": \"\",\n              \"name\": \"Child\",\n              \"status\": \"INLINED\",\n            },\n          ],\n          \"message\": \"\",\n          \"name\": \"Context.Provider\",\n          \"status\": \"INLINED\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 3,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`React Context 6: (createElement => JSX) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 4,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [\n            Object {\n              \"children\": Array [\n                Object {\n                  \"children\": Array [],\n                  \"message\": \"\",\n                  \"name\": \"Context.Consumer\",\n                  \"status\": \"INLINED\",\n                },\n              ],\n              \"message\": \"\",\n              \"name\": \"Child\",\n              \"status\": \"INLINED\",\n            },\n          ],\n          \"message\": \"\",\n          \"name\": \"Context.Provider\",\n          \"status\": \"INLINED\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 3,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`React Context 6: (createElement => createElement) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 4,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [\n            Object {\n              \"children\": Array [\n                Object {\n                  \"children\": Array [],\n                  \"message\": \"\",\n                  \"name\": \"Context.Consumer\",\n                  \"status\": \"INLINED\",\n                },\n              ],\n              \"message\": \"\",\n              \"name\": \"Child\",\n              \"status\": \"INLINED\",\n            },\n          ],\n          \"message\": \"\",\n          \"name\": \"Context.Provider\",\n          \"status\": \"INLINED\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 3,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`React Context 7: (JSX => JSX) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 3,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [\n            Object {\n              \"children\": Array [\n                Object {\n                  \"children\": Array [],\n                  \"message\": \"\",\n                  \"name\": \"Context.Consumer\",\n                  \"status\": \"RENDER_PROPS\",\n                },\n              ],\n              \"message\": \"\",\n              \"name\": \"Child\",\n              \"status\": \"INLINED\",\n            },\n          ],\n          \"message\": \"\",\n          \"name\": \"Context.Provider\",\n          \"status\": \"NORMAL\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 1,\n  \"optimizedNestedClosures\": 1,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`React Context 7: (JSX => createElement) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 3,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [\n            Object {\n              \"children\": Array [\n                Object {\n                  \"children\": Array [],\n                  \"message\": \"\",\n                  \"name\": \"Context.Consumer\",\n                  \"status\": \"RENDER_PROPS\",\n                },\n              ],\n              \"message\": \"\",\n              \"name\": \"Child\",\n              \"status\": \"INLINED\",\n            },\n          ],\n          \"message\": \"\",\n          \"name\": \"Context.Provider\",\n          \"status\": \"NORMAL\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 1,\n  \"optimizedNestedClosures\": 1,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`React Context 7: (createElement => JSX) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 3,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [\n            Object {\n              \"children\": Array [\n                Object {\n                  \"children\": Array [],\n                  \"message\": \"\",\n                  \"name\": \"Context.Consumer\",\n                  \"status\": \"RENDER_PROPS\",\n                },\n              ],\n              \"message\": \"\",\n              \"name\": \"Child\",\n              \"status\": \"INLINED\",\n            },\n          ],\n          \"message\": \"\",\n          \"name\": \"Context.Provider\",\n          \"status\": \"NORMAL\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 1,\n  \"optimizedNestedClosures\": 1,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`React Context 7: (createElement => createElement) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 3,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [\n            Object {\n              \"children\": Array [\n                Object {\n                  \"children\": Array [],\n                  \"message\": \"\",\n                  \"name\": \"Context.Consumer\",\n                  \"status\": \"RENDER_PROPS\",\n                },\n              ],\n              \"message\": \"\",\n              \"name\": \"Child\",\n              \"status\": \"INLINED\",\n            },\n          ],\n          \"message\": \"\",\n          \"name\": \"Context.Provider\",\n          \"status\": \"NORMAL\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 1,\n  \"optimizedNestedClosures\": 1,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`React Context from root tree 2: (JSX => JSX) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 7,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [\n            Object {\n              \"children\": Array [\n                Object {\n                  \"children\": Array [\n                    Object {\n                      \"children\": Array [],\n                      \"message\": \"\",\n                      \"name\": \"Context.Consumer\",\n                      \"status\": \"INLINED\",\n                    },\n                  ],\n                  \"message\": \"\",\n                  \"name\": \"Child\",\n                  \"status\": \"INLINED\",\n                },\n              ],\n              \"message\": \"\",\n              \"name\": \"Context.Provider\",\n              \"status\": \"INLINED\",\n            },\n            Object {\n              \"children\": Array [\n                Object {\n                  \"children\": Array [],\n                  \"message\": \"\",\n                  \"name\": \"Context.Consumer\",\n                  \"status\": \"INLINED\",\n                },\n              ],\n              \"message\": \"\",\n              \"name\": \"Child\",\n              \"status\": \"INLINED\",\n            },\n          ],\n          \"message\": \"\",\n          \"name\": \"Context.Provider\",\n          \"status\": \"INLINED\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 6,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`React Context from root tree 2: (JSX => createElement) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 7,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [\n            Object {\n              \"children\": Array [\n                Object {\n                  \"children\": Array [\n                    Object {\n                      \"children\": Array [],\n                      \"message\": \"\",\n                      \"name\": \"Context.Consumer\",\n                      \"status\": \"INLINED\",\n                    },\n                  ],\n                  \"message\": \"\",\n                  \"name\": \"Child\",\n                  \"status\": \"INLINED\",\n                },\n              ],\n              \"message\": \"\",\n              \"name\": \"Context.Provider\",\n              \"status\": \"INLINED\",\n            },\n            Object {\n              \"children\": Array [\n                Object {\n                  \"children\": Array [],\n                  \"message\": \"\",\n                  \"name\": \"Context.Consumer\",\n                  \"status\": \"INLINED\",\n                },\n              ],\n              \"message\": \"\",\n              \"name\": \"Child\",\n              \"status\": \"INLINED\",\n            },\n          ],\n          \"message\": \"\",\n          \"name\": \"Context.Provider\",\n          \"status\": \"INLINED\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 6,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`React Context from root tree 2: (createElement => JSX) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 7,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [\n            Object {\n              \"children\": Array [\n                Object {\n                  \"children\": Array [\n                    Object {\n                      \"children\": Array [],\n                      \"message\": \"\",\n                      \"name\": \"Context.Consumer\",\n                      \"status\": \"INLINED\",\n                    },\n                  ],\n                  \"message\": \"\",\n                  \"name\": \"Child\",\n                  \"status\": \"INLINED\",\n                },\n              ],\n              \"message\": \"\",\n              \"name\": \"Context.Provider\",\n              \"status\": \"INLINED\",\n            },\n            Object {\n              \"children\": Array [\n                Object {\n                  \"children\": Array [],\n                  \"message\": \"\",\n                  \"name\": \"Context.Consumer\",\n                  \"status\": \"INLINED\",\n                },\n              ],\n              \"message\": \"\",\n              \"name\": \"Child\",\n              \"status\": \"INLINED\",\n            },\n          ],\n          \"message\": \"\",\n          \"name\": \"Context.Provider\",\n          \"status\": \"INLINED\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 6,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`React Context from root tree 2: (createElement => createElement) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 7,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [\n            Object {\n              \"children\": Array [\n                Object {\n                  \"children\": Array [\n                    Object {\n                      \"children\": Array [],\n                      \"message\": \"\",\n                      \"name\": \"Context.Consumer\",\n                      \"status\": \"INLINED\",\n                    },\n                  ],\n                  \"message\": \"\",\n                  \"name\": \"Child\",\n                  \"status\": \"INLINED\",\n                },\n              ],\n              \"message\": \"\",\n              \"name\": \"Context.Provider\",\n              \"status\": \"INLINED\",\n            },\n            Object {\n              \"children\": Array [\n                Object {\n                  \"children\": Array [],\n                  \"message\": \"\",\n                  \"name\": \"Context.Consumer\",\n                  \"status\": \"INLINED\",\n                },\n              ],\n              \"message\": \"\",\n              \"name\": \"Child\",\n              \"status\": \"INLINED\",\n            },\n          ],\n          \"message\": \"\",\n          \"name\": \"Context.Provider\",\n          \"status\": \"INLINED\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 6,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`React Context from root tree 3: (JSX => JSX) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 7,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [\n            Object {\n              \"children\": Array [\n                Object {\n                  \"children\": Array [\n                    Object {\n                      \"children\": Array [],\n                      \"message\": \"\",\n                      \"name\": \"Context.Consumer\",\n                      \"status\": \"INLINED\",\n                    },\n                  ],\n                  \"message\": \"\",\n                  \"name\": \"Child\",\n                  \"status\": \"INLINED\",\n                },\n              ],\n              \"message\": \"\",\n              \"name\": \"Context.Provider\",\n              \"status\": \"INLINED\",\n            },\n            Object {\n              \"children\": Array [\n                Object {\n                  \"children\": Array [],\n                  \"message\": \"\",\n                  \"name\": \"Context.Consumer\",\n                  \"status\": \"INLINED\",\n                },\n              ],\n              \"message\": \"\",\n              \"name\": \"Child\",\n              \"status\": \"INLINED\",\n            },\n          ],\n          \"message\": \"\",\n          \"name\": \"Context.Provider\",\n          \"status\": \"INLINED\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 6,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`React Context from root tree 3: (JSX => createElement) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 7,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [\n            Object {\n              \"children\": Array [\n                Object {\n                  \"children\": Array [\n                    Object {\n                      \"children\": Array [],\n                      \"message\": \"\",\n                      \"name\": \"Context.Consumer\",\n                      \"status\": \"INLINED\",\n                    },\n                  ],\n                  \"message\": \"\",\n                  \"name\": \"Child\",\n                  \"status\": \"INLINED\",\n                },\n              ],\n              \"message\": \"\",\n              \"name\": \"Context.Provider\",\n              \"status\": \"INLINED\",\n            },\n            Object {\n              \"children\": Array [\n                Object {\n                  \"children\": Array [],\n                  \"message\": \"\",\n                  \"name\": \"Context.Consumer\",\n                  \"status\": \"INLINED\",\n                },\n              ],\n              \"message\": \"\",\n              \"name\": \"Child\",\n              \"status\": \"INLINED\",\n            },\n          ],\n          \"message\": \"\",\n          \"name\": \"Context.Provider\",\n          \"status\": \"INLINED\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 6,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`React Context from root tree 3: (createElement => JSX) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 7,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [\n            Object {\n              \"children\": Array [\n                Object {\n                  \"children\": Array [\n                    Object {\n                      \"children\": Array [],\n                      \"message\": \"\",\n                      \"name\": \"Context.Consumer\",\n                      \"status\": \"INLINED\",\n                    },\n                  ],\n                  \"message\": \"\",\n                  \"name\": \"Child\",\n                  \"status\": \"INLINED\",\n                },\n              ],\n              \"message\": \"\",\n              \"name\": \"Context.Provider\",\n              \"status\": \"INLINED\",\n            },\n            Object {\n              \"children\": Array [\n                Object {\n                  \"children\": Array [],\n                  \"message\": \"\",\n                  \"name\": \"Context.Consumer\",\n                  \"status\": \"INLINED\",\n                },\n              ],\n              \"message\": \"\",\n              \"name\": \"Child\",\n              \"status\": \"INLINED\",\n            },\n          ],\n          \"message\": \"\",\n          \"name\": \"Context.Provider\",\n          \"status\": \"INLINED\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 6,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`React Context from root tree 3: (createElement => createElement) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 7,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [\n            Object {\n              \"children\": Array [\n                Object {\n                  \"children\": Array [\n                    Object {\n                      \"children\": Array [],\n                      \"message\": \"\",\n                      \"name\": \"Context.Consumer\",\n                      \"status\": \"INLINED\",\n                    },\n                  ],\n                  \"message\": \"\",\n                  \"name\": \"Child\",\n                  \"status\": \"INLINED\",\n                },\n              ],\n              \"message\": \"\",\n              \"name\": \"Context.Provider\",\n              \"status\": \"INLINED\",\n            },\n            Object {\n              \"children\": Array [\n                Object {\n                  \"children\": Array [],\n                  \"message\": \"\",\n                  \"name\": \"Context.Consumer\",\n                  \"status\": \"INLINED\",\n                },\n              ],\n              \"message\": \"\",\n              \"name\": \"Child\",\n              \"status\": \"INLINED\",\n            },\n          ],\n          \"message\": \"\",\n          \"name\": \"Context.Provider\",\n          \"status\": \"INLINED\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 6,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`React Context from root tree 4: (JSX => JSX) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 3,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [\n            Object {\n              \"children\": Array [\n                Object {\n                  \"children\": Array [],\n                  \"message\": \"\",\n                  \"name\": \"Context.Consumer\",\n                  \"status\": \"RENDER_PROPS\",\n                },\n              ],\n              \"message\": \"\",\n              \"name\": \"Child\",\n              \"status\": \"INLINED\",\n            },\n          ],\n          \"message\": \"\",\n          \"name\": \"Context.Provider\",\n          \"status\": \"NORMAL\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 1,\n  \"optimizedNestedClosures\": 1,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`React Context from root tree 4: (JSX => createElement) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 3,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [\n            Object {\n              \"children\": Array [\n                Object {\n                  \"children\": Array [],\n                  \"message\": \"\",\n                  \"name\": \"Context.Consumer\",\n                  \"status\": \"RENDER_PROPS\",\n                },\n              ],\n              \"message\": \"\",\n              \"name\": \"Child\",\n              \"status\": \"INLINED\",\n            },\n          ],\n          \"message\": \"\",\n          \"name\": \"Context.Provider\",\n          \"status\": \"NORMAL\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 1,\n  \"optimizedNestedClosures\": 1,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`React Context from root tree 4: (createElement => JSX) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 3,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [\n            Object {\n              \"children\": Array [\n                Object {\n                  \"children\": Array [],\n                  \"message\": \"\",\n                  \"name\": \"Context.Consumer\",\n                  \"status\": \"RENDER_PROPS\",\n                },\n              ],\n              \"message\": \"\",\n              \"name\": \"Child\",\n              \"status\": \"INLINED\",\n            },\n          ],\n          \"message\": \"\",\n          \"name\": \"Context.Provider\",\n          \"status\": \"NORMAL\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 1,\n  \"optimizedNestedClosures\": 1,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`React Context from root tree 4: (createElement => createElement) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 3,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [\n            Object {\n              \"children\": Array [\n                Object {\n                  \"children\": Array [],\n                  \"message\": \"\",\n                  \"name\": \"Context.Consumer\",\n                  \"status\": \"RENDER_PROPS\",\n                },\n              ],\n              \"message\": \"\",\n              \"name\": \"Child\",\n              \"status\": \"INLINED\",\n            },\n          ],\n          \"message\": \"\",\n          \"name\": \"Context.Provider\",\n          \"status\": \"NORMAL\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 1,\n  \"optimizedNestedClosures\": 1,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`React Context from root tree: (JSX => JSX) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 6,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [\n            Object {\n              \"children\": Array [\n                Object {\n                  \"children\": Array [],\n                  \"message\": \"\",\n                  \"name\": \"Context.Consumer\",\n                  \"status\": \"INLINED\",\n                },\n              ],\n              \"message\": \"\",\n              \"name\": \"Child\",\n              \"status\": \"INLINED\",\n            },\n          ],\n          \"message\": \"\",\n          \"name\": \"Context.Provider\",\n          \"status\": \"INLINED\",\n        },\n        Object {\n          \"children\": Array [\n            Object {\n              \"children\": Array [],\n              \"message\": \"\",\n              \"name\": \"Context.Consumer\",\n              \"status\": \"INLINED\",\n            },\n          ],\n          \"message\": \"\",\n          \"name\": \"Child\",\n          \"status\": \"INLINED\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 5,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`React Context from root tree: (JSX => createElement) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 6,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [\n            Object {\n              \"children\": Array [\n                Object {\n                  \"children\": Array [],\n                  \"message\": \"\",\n                  \"name\": \"Context.Consumer\",\n                  \"status\": \"INLINED\",\n                },\n              ],\n              \"message\": \"\",\n              \"name\": \"Child\",\n              \"status\": \"INLINED\",\n            },\n          ],\n          \"message\": \"\",\n          \"name\": \"Context.Provider\",\n          \"status\": \"INLINED\",\n        },\n        Object {\n          \"children\": Array [\n            Object {\n              \"children\": Array [],\n              \"message\": \"\",\n              \"name\": \"Context.Consumer\",\n              \"status\": \"INLINED\",\n            },\n          ],\n          \"message\": \"\",\n          \"name\": \"Child\",\n          \"status\": \"INLINED\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 5,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`React Context from root tree: (createElement => JSX) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 6,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [\n            Object {\n              \"children\": Array [\n                Object {\n                  \"children\": Array [],\n                  \"message\": \"\",\n                  \"name\": \"Context.Consumer\",\n                  \"status\": \"INLINED\",\n                },\n              ],\n              \"message\": \"\",\n              \"name\": \"Child\",\n              \"status\": \"INLINED\",\n            },\n          ],\n          \"message\": \"\",\n          \"name\": \"Context.Provider\",\n          \"status\": \"INLINED\",\n        },\n        Object {\n          \"children\": Array [\n            Object {\n              \"children\": Array [],\n              \"message\": \"\",\n              \"name\": \"Context.Consumer\",\n              \"status\": \"INLINED\",\n            },\n          ],\n          \"message\": \"\",\n          \"name\": \"Child\",\n          \"status\": \"INLINED\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 5,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`React Context from root tree: (createElement => createElement) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 6,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [\n            Object {\n              \"children\": Array [\n                Object {\n                  \"children\": Array [],\n                  \"message\": \"\",\n                  \"name\": \"Context.Consumer\",\n                  \"status\": \"INLINED\",\n                },\n              ],\n              \"message\": \"\",\n              \"name\": \"Child\",\n              \"status\": \"INLINED\",\n            },\n          ],\n          \"message\": \"\",\n          \"name\": \"Context.Provider\",\n          \"status\": \"INLINED\",\n        },\n        Object {\n          \"children\": Array [\n            Object {\n              \"children\": Array [],\n              \"message\": \"\",\n              \"name\": \"Context.Consumer\",\n              \"status\": \"INLINED\",\n            },\n          ],\n          \"message\": \"\",\n          \"name\": \"Child\",\n          \"status\": \"INLINED\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 5,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`React Context: (JSX => JSX) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 4,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [\n            Object {\n              \"children\": Array [\n                Object {\n                  \"children\": Array [],\n                  \"message\": \"\",\n                  \"name\": \"Context.Consumer\",\n                  \"status\": \"INLINED\",\n                },\n              ],\n              \"message\": \"\",\n              \"name\": \"Child\",\n              \"status\": \"INLINED\",\n            },\n          ],\n          \"message\": \"\",\n          \"name\": \"Context.Provider\",\n          \"status\": \"INLINED\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 3,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`React Context: (JSX => createElement) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 4,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [\n            Object {\n              \"children\": Array [\n                Object {\n                  \"children\": Array [],\n                  \"message\": \"\",\n                  \"name\": \"Context.Consumer\",\n                  \"status\": \"INLINED\",\n                },\n              ],\n              \"message\": \"\",\n              \"name\": \"Child\",\n              \"status\": \"INLINED\",\n            },\n          ],\n          \"message\": \"\",\n          \"name\": \"Context.Provider\",\n          \"status\": \"INLINED\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 3,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`React Context: (createElement => JSX) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 4,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [\n            Object {\n              \"children\": Array [\n                Object {\n                  \"children\": Array [],\n                  \"message\": \"\",\n                  \"name\": \"Context.Consumer\",\n                  \"status\": \"INLINED\",\n                },\n              ],\n              \"message\": \"\",\n              \"name\": \"Child\",\n              \"status\": \"INLINED\",\n            },\n          ],\n          \"message\": \"\",\n          \"name\": \"Context.Provider\",\n          \"status\": \"INLINED\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 3,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`React Context: (createElement => createElement) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 4,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [\n            Object {\n              \"children\": Array [\n                Object {\n                  \"children\": Array [],\n                  \"message\": \"\",\n                  \"name\": \"Context.Consumer\",\n                  \"status\": \"INLINED\",\n                },\n              ],\n              \"message\": \"\",\n              \"name\": \"Child\",\n              \"status\": \"INLINED\",\n            },\n          ],\n          \"message\": \"\",\n          \"name\": \"Context.Provider\",\n          \"status\": \"INLINED\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 3,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`Relay QueryRenderer 2: (JSX => JSX) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 1,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [],\n          \"message\": \"\",\n          \"name\": \"QueryRenderer\",\n          \"status\": \"RENDER_PROPS\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 0,\n  \"optimizedNestedClosures\": 1,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`Relay QueryRenderer 2: (JSX => createElement) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 1,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [],\n          \"message\": \"\",\n          \"name\": \"QueryRenderer\",\n          \"status\": \"RENDER_PROPS\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 0,\n  \"optimizedNestedClosures\": 1,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`Relay QueryRenderer 2: (createElement => JSX) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 1,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [],\n          \"message\": \"\",\n          \"name\": \"QueryRenderer\",\n          \"status\": \"RENDER_PROPS\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 0,\n  \"optimizedNestedClosures\": 1,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`Relay QueryRenderer 2: (createElement => createElement) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 1,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [],\n          \"message\": \"\",\n          \"name\": \"QueryRenderer\",\n          \"status\": \"RENDER_PROPS\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 0,\n  \"optimizedNestedClosures\": 1,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`Relay QueryRenderer 3: (JSX => JSX) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 3,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [\n            Object {\n              \"children\": Array [],\n              \"message\": \"\",\n              \"name\": \"SomeClassThatShouldNotMakeRootAClass\",\n              \"status\": \"NEW_TREE\",\n            },\n          ],\n          \"message\": \"\",\n          \"name\": \"QueryRenderer\",\n          \"status\": \"RENDER_PROPS\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 0,\n  \"optimizedNestedClosures\": 1,\n  \"optimizedTrees\": 2,\n}\n`;\n\nexports[`Relay QueryRenderer 3: (JSX => createElement) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 3,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [\n            Object {\n              \"children\": Array [],\n              \"message\": \"\",\n              \"name\": \"SomeClassThatShouldNotMakeRootAClass\",\n              \"status\": \"NEW_TREE\",\n            },\n          ],\n          \"message\": \"\",\n          \"name\": \"QueryRenderer\",\n          \"status\": \"RENDER_PROPS\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 0,\n  \"optimizedNestedClosures\": 1,\n  \"optimizedTrees\": 2,\n}\n`;\n\nexports[`Relay QueryRenderer 3: (createElement => JSX) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 3,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [\n            Object {\n              \"children\": Array [],\n              \"message\": \"\",\n              \"name\": \"SomeClassThatShouldNotMakeRootAClass\",\n              \"status\": \"NEW_TREE\",\n            },\n          ],\n          \"message\": \"\",\n          \"name\": \"QueryRenderer\",\n          \"status\": \"RENDER_PROPS\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 0,\n  \"optimizedNestedClosures\": 1,\n  \"optimizedTrees\": 2,\n}\n`;\n\nexports[`Relay QueryRenderer 3: (createElement => createElement) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 3,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [\n            Object {\n              \"children\": Array [],\n              \"message\": \"\",\n              \"name\": \"SomeClassThatShouldNotMakeRootAClass\",\n              \"status\": \"NEW_TREE\",\n            },\n          ],\n          \"message\": \"\",\n          \"name\": \"QueryRenderer\",\n          \"status\": \"RENDER_PROPS\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 0,\n  \"optimizedNestedClosures\": 1,\n  \"optimizedTrees\": 2,\n}\n`;\n\nexports[`Relay QueryRenderer: (JSX => JSX) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 1,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [],\n          \"message\": \"\",\n          \"name\": \"QueryRenderer\",\n          \"status\": \"RENDER_PROPS\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 0,\n  \"optimizedNestedClosures\": 1,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`Relay QueryRenderer: (JSX => createElement) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 1,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [],\n          \"message\": \"\",\n          \"name\": \"QueryRenderer\",\n          \"status\": \"RENDER_PROPS\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 0,\n  \"optimizedNestedClosures\": 1,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`Relay QueryRenderer: (createElement => JSX) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 1,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [],\n          \"message\": \"\",\n          \"name\": \"QueryRenderer\",\n          \"status\": \"RENDER_PROPS\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 0,\n  \"optimizedNestedClosures\": 1,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`Relay QueryRenderer: (createElement => createElement) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 1,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [\n        Object {\n          \"children\": Array [],\n          \"message\": \"\",\n          \"name\": \"QueryRenderer\",\n          \"status\": \"RENDER_PROPS\",\n        },\n      ],\n      \"message\": \"\",\n      \"name\": \"App\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 0,\n  \"optimizedNestedClosures\": 1,\n  \"optimizedTrees\": 1,\n}\n`;\n"
  },
  {
    "path": "test/react/__snapshots__/ServerRendering-test.js.snap",
    "content": "// Jest Snapshot v1, https://goo.gl/fbAQLP\n\nexports[`Hacker News app: (JSX => JSX) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 0,\n  \"evaluatedRootNodes\": Array [],\n  \"inlinedComponents\": 0,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 0,\n}\n`;\n\nexports[`Hacker News app: (JSX => createElement) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 0,\n  \"evaluatedRootNodes\": Array [],\n  \"inlinedComponents\": 0,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 0,\n}\n`;\n\nexports[`Hacker News app: (createElement => JSX) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 0,\n  \"evaluatedRootNodes\": Array [],\n  \"inlinedComponents\": 0,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 0,\n}\n`;\n\nexports[`Hacker News app: (createElement => createElement) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 0,\n  \"evaluatedRootNodes\": Array [],\n  \"inlinedComponents\": 0,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 0,\n}\n`;\n\nexports[`PE Functional Components benchmark: (JSX => JSX) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 0,\n  \"evaluatedRootNodes\": Array [],\n  \"inlinedComponents\": 0,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 0,\n}\n`;\n\nexports[`PE Functional Components benchmark: (JSX => createElement) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 0,\n  \"evaluatedRootNodes\": Array [],\n  \"inlinedComponents\": 0,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 0,\n}\n`;\n\nexports[`PE Functional Components benchmark: (createElement => JSX) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 0,\n  \"evaluatedRootNodes\": Array [],\n  \"inlinedComponents\": 0,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 0,\n}\n`;\n\nexports[`PE Functional Components benchmark: (createElement => createElement) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 0,\n  \"evaluatedRootNodes\": Array [],\n  \"inlinedComponents\": 0,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 0,\n}\n`;\n"
  },
  {
    "path": "test/react/__snapshots__/Throw-test.js.snap",
    "content": "// Jest Snapshot v1, https://goo.gl/fbAQLP\n\nexports[`throw.js: (JSX => JSX) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 1,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [],\n      \"message\": \"\",\n      \"name\": \"MyComponent\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 0,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 0,\n}\n`;\n\nexports[`throw.js: (JSX => createElement) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 1,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [],\n      \"message\": \"\",\n      \"name\": \"MyComponent\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 0,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 0,\n}\n`;\n\nexports[`throw.js: (createElement => JSX) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 1,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [],\n      \"message\": \"\",\n      \"name\": \"MyComponent\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 0,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 0,\n}\n`;\n\nexports[`throw.js: (createElement => createElement) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 1,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [],\n      \"message\": \"\",\n      \"name\": \"MyComponent\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 0,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 0,\n}\n`;\n\nexports[`throw-conditional.js: (JSX => JSX) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 1,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [],\n      \"message\": \"\",\n      \"name\": \"MyComponent\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 0,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`throw-conditional.js: (JSX => createElement) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 1,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [],\n      \"message\": \"\",\n      \"name\": \"MyComponent\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 0,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`throw-conditional.js: (createElement => JSX) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 1,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [],\n      \"message\": \"\",\n      \"name\": \"MyComponent\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 0,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n\nexports[`throw-conditional.js: (createElement => createElement) 1`] = `\nReactStatistics {\n  \"componentsEvaluated\": 1,\n  \"evaluatedRootNodes\": Array [\n    Object {\n      \"children\": Array [],\n      \"message\": \"\",\n      \"name\": \"MyComponent\",\n      \"status\": \"ROOT\",\n    },\n  ],\n  \"inlinedComponents\": 0,\n  \"optimizedNestedClosures\": 0,\n  \"optimizedTrees\": 1,\n}\n`;\n"
  },
  {
    "path": "test/react/setupReactTests.js",
    "content": "/**\n * Copyright (c) 2017-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\n/* @flow */\n\nlet fs = require(\"fs\");\nlet path = require(\"path\");\nlet { prepackSources } = require(\"../../lib/prepack-node.js\");\nlet babel = require(\"babel-core\");\nlet React = require(\"react\");\nlet ReactDOM = require(\"react-dom\");\nlet ReactDOMServer = require(\"react-dom/server\");\nlet ReactNative = require(\"react-native\");\nlet PropTypes = require(\"prop-types\");\nlet ReactRelay = require(\"react-relay\");\nlet ReactTestRenderer = require(\"react-test-renderer\");\nlet { mergeAdjacentJSONTextNodes } = require(\"../../lib/utils/json.js\");\n\n/* eslint-disable no-undef */\nconst { expect } = global;\n\n// Patch console.error to reduce the noise\nlet originalConsoleError = global.console.error;\nlet excludeErrorsContaining = [\n  \"Nothing was returned from render. This usually means a return statement is missing. Or, to render nothing, return null\",\n  \"Consider adding an error boundary to your tree to customize error handling behavior.\",\n  \"Warning:\",\n];\nglobal.console.error = function(...args) {\n  let text = args[0];\n\n  if (typeof text === \"string\") {\n    for (let excludeError of excludeErrorsContaining) {\n      if (text.indexOf(excludeError) !== -1) {\n        return;\n      }\n    }\n  }\n  originalConsoleError.apply(this, args);\n};\n\nfunction cxShim(...args) {\n  let classNames = [];\n  for (let arg of args) {\n    if (typeof arg === \"string\") {\n      classNames.push(arg);\n    } else if (typeof arg === \"object\" && arg !== null) {\n      let keys = Object.keys(arg);\n      for (let key of keys) {\n        if (arg[key]) {\n          classNames.push(key);\n        }\n      }\n    }\n  }\n  return classNames.join(\" \");\n}\nglobal.cx = cxShim;\nfunction MockURI(url) {\n  this.url = url;\n}\nMockURI.prototype.addQueryData = function() {\n  this.url += \"&queryData\";\n  return this;\n};\nMockURI.prototype.makeString = function() {\n  return this.url;\n};\n\nconst babelHelpers = {\n  inherits(subClass, superClass) {\n    Object.assign(subClass, superClass);\n    subClass.prototype = Object.create(superClass && superClass.prototype);\n    subClass.prototype.constructor = subClass;\n    subClass.__superConstructor__ = superClass;\n    return superClass;\n  },\n  _extends: Object.assign,\n  extends: Object.assign,\n  objectWithoutProperties(obj, keys) {\n    var target = {};\n    var hasOwn = Object.prototype.hasOwnProperty;\n    for (var i in obj) {\n      if (!hasOwn.call(obj, i) || keys.indexOf(i) >= 0) {\n        continue;\n      }\n      target[i] = obj[i];\n    }\n    return target;\n  },\n  taggedTemplateLiteralLoose(strings, raw) {\n    strings.raw = raw;\n    return strings;\n  },\n  bind: Function.prototype.bind,\n};\n\nfunction setupReactTests() {\n  function compileSourceWithPrepack(\n    source: string,\n    useJSXOutput: boolean,\n    diagnosticLog: mixed[],\n    shouldRecover: (errorCode: string) => boolean\n  ): {|\n    compiledSource: string,\n    statistics: Object,\n  |} {\n    let code = `(function() {\n${source}\n})()`;\n    let prepackOptions = {\n      errorHandler: diag => {\n        diagnosticLog.push(diag);\n        if (diag.severity !== \"Warning\" && diag.severity !== \"Information\") {\n          if (shouldRecover(diag.errorCode)) {\n            return \"Recover\";\n          }\n          return \"Fail\";\n        }\n        return \"Recover\";\n      },\n      compatibility: \"fb-www\",\n      internalDebug: true,\n      serialize: true,\n      uniqueSuffix: \"\",\n      maxStackDepth: 100,\n      reactEnabled: true,\n      reactOutput: useJSXOutput ? \"jsx\" : \"create-element\",\n      reactOptimizeNestedFunctions: true,\n      arrayNestedOptimizedFunctionsEnabled: true,\n      inlineExpressions: true,\n      invariantLevel: 0,\n      stripFlow: true,\n    };\n    const serialized = prepackSources([{ filePath: \"\", fileContents: code, sourceMapContents: \"\" }], prepackOptions);\n    if (serialized == null || serialized.reactStatistics == null) {\n      throw new Error(\"React test runner failed during serialization\");\n    }\n    return {\n      compiledSource: serialized.code,\n      statistics: serialized.reactStatistics,\n    };\n  }\n\n  function transpileSource(source) {\n    return babel.transform(source, {\n      configFile: false,\n      presets: [\"@babel/preset-flow\"],\n      plugins: [\n        [\"@babel/plugin-proposal-object-rest-spread\", { loose: true, useBuiltIns: true }],\n        [\"@babel/plugin-transform-react-jsx\", { useBuiltIns: true }],\n      ],\n    }).code;\n  }\n\n  function runSource(source) {\n    let transformedSource = `\n      // Add global variable for spec compliance.\n      let global = this;\n      // Inject React since compiled JSX would reference it.\n      let React = require('react');\n      (function() {\n        ${transpileSource(source)}\n      })();\n    `;\n    /* eslint-disable no-new-func */\n    let fn = new Function(\"require\", \"module\", \"babelHelpers\", transformedSource);\n    let moduleShim = { exports: null };\n    let requireShim = name => {\n      switch (name) {\n        case \"React\":\n        case \"react\":\n          return React;\n        case \"react-dom\":\n        case \"ReactDOM\":\n          return ReactDOM;\n        case \"react-dom/server\":\n        case \"ReactDOMServer\":\n          return ReactDOMServer;\n        case \"ReactNative\":\n        case \"react-native\":\n          return ReactNative;\n        case \"PropTypes\":\n        case \"prop-types\":\n          return PropTypes;\n        case \"RelayModern\":\n          return ReactRelay;\n        case \"cx\":\n          return cxShim;\n        case \"FBEnvironment\":\n          return {};\n        case \"URI\":\n          return MockURI;\n        default:\n          throw new Error(`Unrecognized import: \"${name}\".`);\n      }\n    };\n\n    try {\n      // $FlowFixMe flow doesn't new Function\n      fn(requireShim, moduleShim, babelHelpers);\n    } catch (e) {\n      console.error(transformedSource);\n      throw e;\n    }\n    return moduleShim.exports;\n  }\n\n  function stubReactRelay(f: Function) {\n    let oldReactRelay = ReactRelay;\n    ReactRelay = {\n      QueryRenderer(props) {\n        return props.render({ props: {}, error: null });\n      },\n      createFragmentContainer() {\n        return null;\n      },\n      graphql() {\n        return null;\n      },\n    };\n    try {\n      return f();\n    } finally {\n      ReactRelay = oldReactRelay;\n    }\n  }\n\n  function runTestWithOptions(source, useJSXOutput, options, snapshotName) {\n    let {\n      firstRenderOnly = false,\n      // By default, we recover from PP0025 even though it's technically unsafe.\n      // We do the same in debug-fb-www script.\n      shouldRecover = errorCode => errorCode === \"PP0025\",\n      expectReconcilerError = false,\n      expectRuntimeError = false,\n      expectedCreateElementCalls,\n      data,\n    } = options;\n\n    let diagnosticLog = [];\n    let compiledSource, statistics;\n    try {\n      ({ compiledSource, statistics } = compileSourceWithPrepack(source, useJSXOutput, diagnosticLog, shouldRecover));\n    } catch (err) {\n      if (err.__isReconcilerFatalError && expectReconcilerError) {\n        expect(err.message).toMatchSnapshot(snapshotName);\n        return;\n      }\n      diagnosticLog.forEach(diag => {\n        console.error(diag);\n      });\n      throw err;\n    }\n\n    let totalElementCount = 0;\n    let originalCreateElement = React.createElement;\n    // $FlowFixMe: intentional for this test\n    React.createElement = (...args) => {\n      totalElementCount++;\n      return originalCreateElement(...args);\n    };\n    try {\n      expect(statistics).toMatchSnapshot(snapshotName);\n      let A = runSource(source);\n      let B = runSource(compiledSource);\n\n      expect(typeof A).toBe(typeof B);\n      if (A == null || B == null) {\n        // Test without exports just verifies that the file compiles.\n        return;\n      }\n\n      let config = {\n        createNodeMock(x) {\n          return x;\n        },\n      };\n      let rendererA = ReactTestRenderer.create(null, config);\n      let rendererB = ReactTestRenderer.create(null, config);\n\n      // Use the original version of the test in case transforming messes it up.\n      let { getTrials: getTrialsA, independent } = A;\n      let { getTrials: getTrialsB } = B;\n      // Run tests that assert the rendered output matches.\n      let resultA;\n      let resultB;\n      try {\n        resultA = getTrialsA(rendererA, A, data, false);\n        resultB = independent ? getTrialsB(rendererB, B, data, true) : getTrialsA(rendererB, B, data, false);\n      } catch (err) {\n        if (expectRuntimeError) {\n          expect(err.message).toMatchSnapshot(snapshotName);\n          return;\n        }\n        throw err;\n      }\n\n      // The test has returned many values for us to check\n      for (let i = 0; i < resultA.length; i++) {\n        let [nameA, valueA] = resultA[i];\n        let [nameB, valueB] = resultB[i];\n        if (typeof valueA === \"string\" && typeof valueB === \"string\") {\n          expect(valueA).toBe(valueB);\n        } else {\n          expect(mergeAdjacentJSONTextNodes(valueB, firstRenderOnly)).toEqual(\n            mergeAdjacentJSONTextNodes(valueA, firstRenderOnly)\n          );\n        }\n        expect(nameB).toEqual(nameA);\n      }\n    } finally {\n      // $FlowFixMe: intentional for this test\n      React.createElement = originalCreateElement;\n    }\n\n    if (typeof expectedCreateElementCalls === \"number\") {\n      // TODO: it would be nice to check original and prepacked ones separately.\n      expect(totalElementCount).toBe(expectedCreateElementCalls);\n    }\n  }\n\n  type TestOptions = {\n    firstRenderOnly?: boolean,\n    data?: mixed,\n    expectReconcilerError?: boolean,\n    expectRuntimeError?: boolean,\n    expectedCreateElementCalls?: number,\n    shouldRecover?: (errorCode: string) => boolean,\n  };\n\n  function runTest(fixturePath: string, options: TestOptions = {}) {\n    let source = fs.readFileSync(fixturePath).toString();\n    // Run tests that don't need the transform first so they can fail early.\n    runTestWithOptions(source, false, options, \"(createElement => createElement)\");\n\n    if (process.env.SKIP_REACT_JSX_TESTS !== \"true\") {\n      runTestWithOptions(source, true, options, \"(createElement => JSX)\");\n      let jsxSource = transpileSource(source);\n      runTestWithOptions(jsxSource, false, options, \"(JSX => createElement)\");\n      runTestWithOptions(jsxSource, true, options, \"(JSX => JSX)\");\n    }\n  }\n\n  return {\n    runTest,\n    stubReactRelay,\n  };\n}\n\nmodule.exports = setupReactTests;\n"
  },
  {
    "path": "test/serializer/abstract/AbstractFunctionWithResultType.js",
    "content": "// add at runtime:function __nextComponentID() { return 42; }\n(function() {\n  let f = global.__abstract ? __abstract(\":number\", \"__nextComponentID\") : __nextComponentID;\n  let t = typeof f();\n  inspect = function() {\n    return t;\n  };\n})();\n"
  },
  {
    "path": "test/serializer/abstract/AbstractNumericProperty.js",
    "content": "// add at runtime: global.z = { 0: \"test string\" };\nif (global.__assumeDataProperty)\n  __assumeDataProperty(\n    this,\n    \"z\",\n    __abstract({\n      0: __abstract(\"string\"),\n    })\n  );\nlet check = z && typeof z[0] === \"string\" && z[0];\ninspect = function() {\n  return check;\n};\n"
  },
  {
    "path": "test/serializer/abstract/AbstractOrNullOrUndefined.js",
    "content": "// add at runtime: global.o = { foo: undefined };\nif (global.__abstract)\n  o = __abstract(\n    {\n      foo: __abstractOrNullOrUndefined(\"number\"),\n    },\n    \"global.o\"\n  );\nlet check = o && typeof o.foo === \"number\" && o.foo >= 3;\n\ninspect = function() {\n  return check + \" \" + global.o.foo;\n};\n"
  },
  {
    "path": "test/serializer/abstract/AbstractPropertyDelete.js",
    "content": "// add at runtime:global.__obj1 = { a: 1 }; global.__obj2 = { a: 2 };\n\nlet obj1 = global.__abstract ? __abstract({}, \"global.__obj1\") : { a: 1 };\nlet obj2 = global.__abstract ? __abstract({}, \"global.__obj2\") : { a: 2 };\n\nif (global.__makePartial) {\n  __makePartial(obj1);\n  __makePartial(obj2);\n}\nif (global.__makeSimple) {\n  __makeSimple(obj1);\n  __makeSimple(obj2);\n}\n\nfunction additional1() {\n  obj1.c = 10;\n  delete obj1.b;\n  return obj1;\n}\n\nfunction additional2() {\n  obj2.c = 5;\n  delete obj2.b;\n  return obj2;\n}\n\nif (global.__optimize) {\n  __optimize(additional1);\n  __optimize(additional2);\n}\n\ninspect = function() {\n  let ret1 = additional1();\n  let ret2 = additional2();\n  let result = 0;\n  for (let key in ret1) {\n    result += ret1[key];\n    result += ret2[key];\n  }\n  return result;\n};\n"
  },
  {
    "path": "test/serializer/abstract/AbstractPropertyDelete2.js",
    "content": "// add at runtime:global.__obj1 = { a: Math.random(), b: 10 }; global.__obj2 = { a: Math.random(), b: 10 };\n\nlet obj1 = global.__abstract ? __abstract({}, \"global.__obj1\") : { a: Math.random(), b: 10 };\nlet obj2 = global.__abstract ? __abstract({}, \"global.__obj2\") : { a: Math.random(), b: 10 };\n\nif (global.__makePartial) {\n  __makePartial(obj1);\n  __makePartial(obj2);\n}\nif (global.__makeSimple) {\n  __makeSimple(obj1);\n  __makeSimple(obj2);\n}\n\nfunction additional1() {\n  obj1.c = 10;\n  delete obj1.a;\n  return obj1;\n}\n\nfunction additional2() {\n  obj2.c = 5;\n  delete obj2.a;\n  return obj2;\n}\n\nif (global.__optimize) {\n  __optimize(additional1);\n  __optimize(additional2);\n}\n\ninspect = function() {\n  let ret1 = additional1();\n  let ret2 = additional2();\n  let result = 0;\n  for (let key in ret1) {\n    result += ret1[key];\n    result += ret2[key];\n  }\n  result += ret1.b;\n  result += ret2.b;\n  return result;\n};\n"
  },
  {
    "path": "test/serializer/abstract/AbstractPropertyDelete3.js",
    "content": "// add at runtime:global.__obj1 = { \"extends\": Math.random(), b: 10 }; global.__obj2 = { \"while\": Math.random(), b: 10 };\n\nlet obj1 = global.__abstract ? __abstract({}, \"global.__obj1\") : { extends: Math.random(), b: 10 };\nlet obj2 = global.__abstract ? __abstract({}, \"global.__obj2\") : { while: Math.random(), b: 10 };\n\nif (global.__makePartial) {\n  __makePartial(obj1);\n  __makePartial(obj2);\n}\nif (global.__makeSimple) {\n  __makeSimple(obj1);\n  __makeSimple(obj2);\n}\n\nfunction additional1() {\n  obj1.c = 10;\n  delete obj1[\"extends\"];\n  return obj1;\n}\n\nfunction additional2() {\n  obj2.c = 5;\n  delete obj2[\"while\"];\n  return obj2;\n}\n\nif (global.__optimize) {\n  __optimize(additional1);\n  __optimize(additional2);\n}\n\ninspect = function() {\n  let ret1 = additional1();\n  let ret2 = additional2();\n  let result = 0;\n  for (let key in ret1) {\n    result += ret1[key];\n    result += ret2[key];\n  }\n  result += ret1.b;\n  result += ret2.b;\n  return result;\n};\n"
  },
  {
    "path": "test/serializer/abstract/AbstractPrototype.js",
    "content": "let obj = global.__abstract ? __abstract(\"object\", \"({})\") : {};\n\nfunction Constructor() {}\nConstructor.prototype = obj;\n\nlet obj2 = new Constructor();\n\ninspect = function() {\n  return Object.getPrototypeOf(obj2) === obj;\n};\n"
  },
  {
    "path": "test/serializer/abstract/Array.js",
    "content": "// throws introspection error\n\nvar l = __abstract(\"number\");\nvar a = new Array(l);\nif (a.length) {\n}\n"
  },
  {
    "path": "test/serializer/abstract/ArrayConcat.js",
    "content": "// add at runtime:function __nextComponentID() { return 42; }\n(function() {\n  let f = global.__abstract ? __abstract(\":number\", \"__nextComponentID\") : __nextComponentID;\n  let n = f();\n  let a = [].concat([n]);\n\n  inspect = function() {\n    return a[0];\n  };\n})();\n"
  },
  {
    "path": "test/serializer/abstract/ArrayInitializer.js",
    "content": "// does contain:[11, 22\n(function() {\n  let x = global.__abstract ? __abstract(\"boolean\", \"true\") : true;\n  let o = [];\n  o.push(11);\n  o.push(22);\n  if (x) {\n    o.push(3);\n  } else {\n  }\n  inspect = function() {\n    return o;\n  };\n})();\n"
  },
  {
    "path": "test/serializer/abstract/ArrayLength.js",
    "content": "var x = global.__abstract ? __abstract(\"boolean\", \"true\") : true;\nvar a = [];\nif (x) a.push(42);\ninspect = function() {\n  return a.length;\n};\n"
  },
  {
    "path": "test/serializer/abstract/ArrayLength2.js",
    "content": "var x = global.__abstract ? __abstract(\"boolean\", \"true\") : true;\nvar a = [];\nvar b = x ? a : [];\nif (b === a) {\n  a.push(42);\n}\ninspect = function() {\n  return a.length;\n};\n"
  },
  {
    "path": "test/serializer/abstract/ArrayLength3.js",
    "content": "// does contain:[1,, 3,, 5, 6]\n(function() {\n  let x = global.__abstract ? __abstract(\"boolean\", \"true\") : true;\n  let a = [1, , 3, , 5, 6, , , ,]; // Hole in the middle and end.\n  if (x) {\n    a.length = 100;\n  }\n  inspect = function() {\n    return a.length;\n  };\n})();\n"
  },
  {
    "path": "test/serializer/abstract/ArrayMap.js",
    "content": "let c = global.__abstract ? __abstract(\"boolean\", \"true\") : true;\n\nlet a = [1];\nif (c) a.push(2);\nlet x = a.map(x => x + 42);\n\nglobal.inspect = function() {\n  JSON.stringify(x);\n};\n"
  },
  {
    "path": "test/serializer/abstract/ArrayMap1.js",
    "content": "let c = global.__abstract ? __abstract(\"boolean\", \"true\") : true;\n\nlet a = [1];\nlet sum = 0;\nif (c) a.push(2);\nlet x = a.map(x => {\n  sum += x;\n  return x + 42;\n});\n\nglobal.inspect = function() {\n  sum + JSON.stringify(x);\n};\n"
  },
  {
    "path": "test/serializer/abstract/ArrayMap2.js",
    "content": "let c = global.__abstract ? __abstract(\"boolean\", \"true\") : true;\n\nlet a = [1];\nif (c) a.push(2);\nlet x;\ntry {\n  x = a.map(x => {\n    if (x === 2) throw x;\n    else return x + 42;\n  });\n} catch (e) {\n  x = e;\n}\n\nglobal.inspect = function() {\n  JSON.stringify(x);\n};\n"
  },
  {
    "path": "test/serializer/abstract/BinaryExpression.js",
    "content": "// throws introspection error\n\nvar x = __abstract(\"number\");\nvar y = {} + x;\n"
  },
  {
    "path": "test/serializer/abstract/BinaryExpression2.js",
    "content": "// throws introspection error\n\nvar b = global.__abstract ? __abstract(\"boolean\", \"true\") : true;\nvar x = global.__abstract ? __abstract(\"number\", \"123\") : 123;\nvar badOb = {\n  valueOf: function() {\n    throw 13;\n  },\n};\nvar ob = global.__abstract ? __abstract(\"object\", \"({ valueOf: function() { throw 13;} })\") : badOb;\nvar y = b ? ob : x;\n\ntry {\n  z = 100 + y;\n} catch (err) {\n  z = 200 + err;\n}\n\ninspect = function() {\n  return \"\" + z;\n};\n"
  },
  {
    "path": "test/serializer/abstract/BinaryExpression3.js",
    "content": "var b = global.__abstract ? __abstract(\"boolean\", \"true\") : true;\nvar x = global.__abstract ? __abstract(\"number\", \"123\") : 123;\nvar ob = {\n  valueOf: function() {\n    throw 13;\n  },\n};\nvar y = b ? ob : x;\n\nvar z;\ntry {\n  z = 100 + y;\n} catch (err) {\n  z = 200 + err;\n}\n\ninspect = function() {\n  return \"\" + z;\n};\n"
  },
  {
    "path": "test/serializer/abstract/Branching.js",
    "content": "if (Date.now() > 0) x = Date.now();\ninspect = function() {\n  return \"\";\n};\n"
  },
  {
    "path": "test/serializer/abstract/BranchingConsoleLog.js",
    "content": "let x = global.__abstract ? __abstract(\"boolean\", \"true\") : true;\nlet y = global.__abstract ? __abstract(\"boolean\", \"false\") : false;\n\nif (x) {\n  console.log(\"true\");\n} else {\n  console.log(\"false\");\n}\n\nif (y) {\n} else {\n  console.log(\"false\");\n}\n\ninspect = function() {\n  return \"\";\n};\n"
  },
  {
    "path": "test/serializer/abstract/Break.js",
    "content": "let x = global.__abstract ? __abstract(\"boolean\", \"true\") : true;\n\nlet arr = [];\n\nxyz: while (true) {\n  arr[0] = 123;\n  if (x) break xyz;\n  else break xyz;\n}\n\nvar z = arr;\n\ninspect = function() {\n  return \"\" + z;\n};\n"
  },
  {
    "path": "test/serializer/abstract/Break2.js",
    "content": "let x = global.__abstract ? __abstract(\"boolean\", \"true\") : true;\nlet arr = [];\n\nfunction foo() {\n  xyz: while (true) {\n    arr[0] = 123;\n    if (x) break;\n    else break xyz;\n  }\n}\n\nvar z = foo();\n\ninspect = function() {\n  return z;\n};\n"
  },
  {
    "path": "test/serializer/abstract/Break3.js",
    "content": "let foo = global.__abstract ? __abstract(\"boolean\", \"true\") : true;\n\nvar y = eval(`\n    do {\n      if (foo) {\n\tx = 1;\n\tbreak;\n      } else {\n\tx = 2;\n\tbreak;\n      }\n    } while (true);`);\n\ninspect = function() {\n  return y;\n};\n"
  },
  {
    "path": "test/serializer/abstract/Call.js",
    "content": "// throws introspection error\n\nvar g = __abstract(\"object\", \"String\");\ng();\n"
  },
  {
    "path": "test/serializer/abstract/Call2.js",
    "content": "function f() {\n  return 123;\n}\nvar g = global.__abstract ? global.__abstract(\"function\", \"f\") : f;\nvar z = g();\n\ninspect = function() {\n  return \"\" + z;\n};\n"
  },
  {
    "path": "test/serializer/abstract/Call3.js",
    "content": "var o = global.__abstract ? global.__abstract(\"number\", \"1\") : 1;\nvar obj = {};\nfunction bar(x) {\n  if (o > 1) {\n    obj.foo = function() {\n      return 1 + x;\n    };\n  } else if (o > 2) {\n    obj.foo = function() {\n      return 2 + x;\n    };\n  } else {\n    obj.foo = function() {\n      return 3 + x;\n    };\n  }\n}\nbar(5);\nvar z = obj.foo();\n\ninspect = function() {\n  return \"\" + z;\n};\n"
  },
  {
    "path": "test/serializer/abstract/Call4.js",
    "content": "function f(v) {\n  return v * 2;\n}\nvar g = global.__abstract ? global.__abstract(\"function\", \"f\") : f;\nlet v = Object.freeze([1]).map(g);\n\ninspect = function() {\n  return v;\n};\n"
  },
  {
    "path": "test/serializer/abstract/CantCatchIntrospectionError.js",
    "content": "// throws introspection error\nlet x = __abstract(\"boolean\", \"true\");\n\ntry {\n  var obj = __abstract(\"object\");\n  if (x) delete obj.someProperty;\n} catch (err) {\n  throw new Error(\"Cannot catch\");\n} finally {\n  throw new Error(\"Cannot finally\");\n}\n"
  },
  {
    "path": "test/serializer/abstract/CantCatchIntrospectionError1.js",
    "content": "// throws introspection error\nlet x = __abstract(\"boolean\", \"true\");\n\ntry {\n  var obj = __abstract(\"object\");\n  if (x) {\n  } else delete obj.someProperty;\n} catch (err) {\n  throw new Error(\"Cannot catch\");\n} finally {\n  throw new Error(\"Cannot finally\");\n}\n"
  },
  {
    "path": "test/serializer/abstract/CompareObjects.js",
    "content": "(function() {\n  var x = global.__abstract ? __abstract(\"object\", \"({})\") : {};\n  var c = x === global;\n  inspect = function() {\n    return c;\n  };\n})();\n"
  },
  {
    "path": "test/serializer/abstract/Compose.js",
    "content": "function bar(y) {\n  if (y) {\n    throw Error(\"Foo\");\n  }\n  return null;\n}\n\nfunction fn(x, y) {\n  if (x) {\n    bar(y);\n  }\n  return 123;\n}\n\nif (global.__optimize) __optimize(fn);\n\ninspect = function() {\n  return fn(true, false);\n};\n"
  },
  {
    "path": "test/serializer/abstract/ComposedCompletions.js",
    "content": "let n1 = global.__abstract ? __abstract(\"number\", \"4\") : 4;\n\nfunction f1() {\n  if (n1 === 1) return 10;\n  if (n1 === 2) throw 20;\n  if (n1 === 3) return 30;\n  if (n1 === 4) return 40;\n  throw 50;\n}\n\nvar x = f1();\n\ninspect = function() {\n  return x;\n};\n"
  },
  {
    "path": "test/serializer/abstract/ConcreteModel1.js",
    "content": "// emit concrete model\n\nif (global.__assumeDataProperty) {\n  __assumeDataProperty(this, \"fooFunc\", __abstract(\"function\", \"fooFunc\"));\n  __assumeDataProperty(this, \"barUndefined\", undefined);\n  __assumeDataProperty(this, \"barzAbstract\", __abstract());\n  __assumeDataProperty(global, \"inspect\", undefined);\n} else {\n  global.fooFunc = function() {};\n  global.barUndefined = undefined;\n  global.barzAbstract = undefined;\n}\nif (global.__makePartial) __makePartial(global);\n\ninspect = function() {\n  return global.fooFunc() === undefined && global.barUndefined === undefined && global.barzAbstract === undefined;\n};\n"
  },
  {
    "path": "test/serializer/abstract/ConcreteModel2.js",
    "content": "// emit concrete model\n\nif (global.__assumeDataProperty) {\n  __assumeDataProperty(global, \"inspect\", undefined);\n  __assumeDataProperty(\n    this,\n    \"nativeTraceBeginAsyncSection\",\n    function(tag, name, cookie) {\n      if (global.__residual)\n        return global.__residual(\n          \"void\",\n          function(tag, name, cookie, global) {\n            return global.nativeTraceBeginAsyncSection(tag, name, cookie);\n          },\n          tag,\n          name,\n          cookie,\n          global\n        );\n      else return this.nativeTraceBeginAsyncSection(tag, name, cookie);\n    },\n    \"VALUE_DEFINED_INVARIANT\"\n  );\n  __assumeDataProperty(\n    this,\n    \"nativeModuleProxy\",\n    __abstract(\n      {\n        nativePerformanceNow: __abstract(\"function\"),\n        UIManager: __abstract({\n          customBubblingEventTypes: __abstract(\"string\"),\n          customDirectEventTypes: __abstract(),\n          AndroidLazyViewManagersEnabled: __abstract(\"boolean\"),\n          ViewManagerNames: undefined,\n        }),\n        DeviceInfo: __abstract({\n          Dimensions: __abstract({\n            window: undefined,\n            screen: undefined,\n            windowPhysicalPixels: __abstract({\n              width: __abstract(\"number\"),\n            }),\n          }),\n        }),\n      },\n      \"global.nativeModuleProxy\"\n    )\n  );\n} else {\n  global.nativeTraceBeginAsyncSection = function(tag, name, cookie) {\n    if (global.__residual)\n      return global.__residual(\n        \"void\",\n        function(tag, name, cookie, global) {\n          return global.nativeTraceBeginAsyncSection(tag, name, cookie);\n        },\n        tag,\n        name,\n        cookie,\n        global\n      );\n    else return this.nativeTraceBeginAsyncSection(tag, name, cookie);\n  };\n  global.nativeModuleProxy = {\n    nativePerformanceNow: function() {},\n    UIManager: {\n      customBubblingEventTypes: \"__concreteModel\",\n      customDirectEventTypes: void 0,\n      AndroidLazyViewManagersEnabled: false,\n      ViewManagerNames: void 0,\n    },\n    DeviceInfo: {\n      Dimensions: {\n        window: void 0,\n        screen: void 0,\n        windowPhysicalPixels: {\n          width: 42,\n        },\n      },\n    },\n  };\n}\nif (global.__makePartial) __makePartial(global);\n\ninspect = function() {\n  return (\n    global.nativeTraceBeginAsyncSection !== undefined &&\n    global.nativeModuleProxy.nativePerformanceNow() === undefined &&\n    global.nativeModuleProxy.UIManager.customBubblingEventTypes !== undefined &&\n    global.nativeModuleProxy.UIManager.AndroidLazyViewManagersEnabled !== undefined &&\n    global.nativeModuleProxy.DeviceInfo.Dimensions.windowPhysicalPixels.width !== undefined\n  );\n};\n"
  },
  {
    "path": "test/serializer/abstract/Conditional.js",
    "content": "let x = global.__abstract ? __abstract(\"boolean\", \"true\") : true;\nlet y = x ? 1 : 2;\nvar z = y;\nvar z1 = x ? { a: 123 } : { y: 456 };\ninspect = function() {\n  return z + JSON.stringify(z1);\n};\n"
  },
  {
    "path": "test/serializer/abstract/ConditionalAbstractObjectValueDefineProperty.js",
    "content": "// does not contain:unnecessaryIndirection\n(function() {\n  let c1 = global.__abstract ? __abstract(\"boolean\", \"(true)\") : true;\n  let c2 = global.__abstract ? __abstract(\"boolean\", \"(!false)\") : true;\n  var a = { unnecessaryIndirection: 1 };\n  var b = { unnecessaryIndirection: 2 };\n  var c = { unnecessaryIndirection: 3 };\n  var obj1 = c1 ? a : b;\n  var obj2 = c2 ? obj1 : c;\n  Object.defineProperty(obj2, \"unnecessaryIndirection\", {\n    writable: true,\n    configurable: true,\n    enumerable: true,\n    value: 5,\n  });\n  global.result = a.unnecessaryIndirection;\n  inspect = function() {\n    return global.result;\n  };\n})();\n"
  },
  {
    "path": "test/serializer/abstract/ConditionalAbstractObjectValueDefineProperty2.js",
    "content": "(function() {\n  let c = global.__abstract ? __abstract(\"boolean\", \"(true)\") : true;\n  var a = { enumerableProp: 1 };\n  var b = { enumerableProp: 2 };\n  var obj = c ? a : b;\n  Object.defineProperty(obj, \"enumerableProp\", {\n    value: 3,\n  });\n  global.result = Object.getOwnPropertyDescriptor(a, \"enumerableProp\");\n  inspect = function() {\n    return global.result;\n  };\n})();\n"
  },
  {
    "path": "test/serializer/abstract/ConditionalAbstractObjectValueDelete.js",
    "content": "// does not contain:unnecessaryIndirection:\n(function() {\n  let c1 = global.__abstract ? __abstract(\"boolean\", \"(true)\") : true;\n  let c2 = global.__abstract ? __abstract(\"boolean\", \"(false)\") : false;\n  var a = { unnecessaryIndirection: 1 };\n  var b = { unnecessaryIndirection: 2 };\n  var c = { unnecessaryIndirection: 3 };\n  var obj1 = c1 ? a : b;\n  var obj2 = c2 ? obj1 : c;\n  delete obj2.unnecessaryIndirection;\n  global.result = a.unnecessaryIndirection;\n  inspect = function() {\n    return global.result;\n  };\n})();\n"
  },
  {
    "path": "test/serializer/abstract/ConditionalAbstractObjectValueGet.js",
    "content": "(function() {\n  let c = global.__abstract ? __abstract(\"boolean\", \"(true)\") : true;\n  let o = c ? {} : {};\n  global.foo = o.bar;\n  inspect = function() {\n    return global.foo;\n  };\n})();\n"
  },
  {
    "path": "test/serializer/abstract/ConditionalAbstractObjectValueGetOwnProperty.js",
    "content": "(function() {\n  let c = global.__abstract ? __abstract(\"boolean\", \"(true)\") : true;\n  let o = c\n    ? {}\n    : {\n        get foo() {\n          return 5;\n        },\n      };\n  global.desc = Object.getOwnPropertyDescriptor(o, \"foo\");\n  inspect = function() {\n    return global.desc;\n  };\n})();\n"
  },
  {
    "path": "test/serializer/abstract/ConditionalAbstractObjectValueGetPartial.js",
    "content": "// does not contain:unnecessaryIndirection:\n(function() {\n  let c1 = global.__abstract ? __abstract(\"boolean\", \"(true)\") : true;\n  let c2 = global.__abstract ? __abstract(\"boolean\", \"(!false)\") : true;\n  let key = global.__abstract ? __abstract(\"string\", \"('unnecessaryIndirection')\") : \"unnecessaryIndirection\";\n  var a = { unnecessaryIndirection: 1 };\n  var b = { unnecessaryIndirection: 2 };\n  var c = { unnecessaryIndirection: 3 };\n  var obj1 = c1 ? a : b;\n  var obj2 = c2 ? obj1 : c;\n  global.result = obj2[key];\n  inspect = function() {\n    return global.result;\n  };\n})();\n"
  },
  {
    "path": "test/serializer/abstract/ConditionalAbstractObjectValueGetWithPrototype.js",
    "content": "(function() {\n  let c = global.__abstract ? __abstract(\"boolean\", \"(true)\") : true;\n  let o1 = {};\n  o1.__proto__ = { bar: 42 };\n  let o2 = {};\n  let o = c ? o1 : o2;\n  global.foo = o.bar;\n  inspect = function() {\n    return global.foo;\n  };\n})();\n"
  },
  {
    "path": "test/serializer/abstract/ConditionalAbstractObjectValueSet.js",
    "content": "// does not contain:unnecessaryIndirection\n(function() {\n  let c1 = global.__abstract ? __abstract(\"boolean\", \"(true)\") : true;\n  let c2 = global.__abstract ? __abstract(\"boolean\", \"(!false)\") : true;\n  var a = { unnecessaryIndirection: 1 };\n  var b = { unnecessaryIndirection: 2 };\n  var c = { unnecessaryIndirection: 3 };\n  var obj1 = c1 ? a : b;\n  var obj2 = c2 ? obj1 : c;\n  obj2.unnecessaryIndirection = 5;\n  global.result = a.unnecessaryIndirection;\n  inspect = function() {\n    return global.result;\n  };\n})();\n"
  },
  {
    "path": "test/serializer/abstract/ConditionalAbstractObjectValueSetNewProperty.js",
    "content": "(function() {\n  let c = global.__abstract ? __abstract(\"boolean\", \"(true)\") : true;\n  var a = { x: 1 };\n  var b = {};\n  var obj = c ? a : b;\n  obj.x = 2;\n  global.result = a.x;\n  global.residualObject = b;\n  inspect = function() {\n    return global.result + \" \" + global.residualObject.x + \" \" + global.residualObject.hasOwnProperty(\"x\");\n  };\n})();\n"
  },
  {
    "path": "test/serializer/abstract/ConditionalAbstractObjectValueSetPartial.js",
    "content": "// does not contain:unnecessaryIndirection:\n(function() {\n  let c1 = global.__abstract ? __abstract(\"boolean\", \"(true)\") : true;\n  let c2 = global.__abstract ? __abstract(\"boolean\", \"(!false)\") : true;\n  let key = global.__abstract ? __abstract(\"string\", \"('unnecessaryIndirection')\") : \"unnecessaryIndirection\";\n  var a = { unnecessaryIndirection: 1 };\n  var b = { unnecessaryIndirection: 2 };\n  var c = { unnecessaryIndirection: 3 };\n  var obj1 = c1 ? a : b;\n  var obj2 = c2 ? obj1 : c;\n  obj2[key] = 5;\n  global.result = a.unnecessaryIndirection;\n  inspect = function() {\n    return global.result;\n  };\n})();\n"
  },
  {
    "path": "test/serializer/abstract/ConditionalEmptyProperty.js",
    "content": "(function() {\n  function fn(arg) {\n    var obj1 = {};\n    var obj2 = {};\n    if (arg) {\n      obj2.bar = true;\n    } else {\n      obj1.foo = true;\n    }\n    return { obj1, obj2 };\n  }\n\n  if (global.__optimize) __optimize(fn);\n\n  global.inspect = function() {\n    return JSON.stringify([fn(null), fn(undefined), fn(10)]);\n  };\n})();\n"
  },
  {
    "path": "test/serializer/abstract/ConditionalImpliedPropertyAssignment.js",
    "content": "(function() {\n  let b = global.__abstract ? __abstract(\"boolean\", \"(true)\") : true;\n  let obj = {};\n  if (b) {\n    global.obj = obj;\n  } else {\n    obj.x = 42;\n  }\n})();\n"
  },
  {
    "path": "test/serializer/abstract/ConstructFunctionReturnsAbstract.js",
    "content": "function F() {\n  this.a = 1;\n  this.b = 2;\n  if (global.__abstract) return global.__abstract(undefined, \"undefined\");\n}\n\nconst result = new F();\n\nglobal.inspect = () => JSON.stringify(result);\n"
  },
  {
    "path": "test/serializer/abstract/Continue.js",
    "content": "let x = global.__abstract ? __abstract(\"boolean\", \"true\") : true;\n\nlet arr = [];\n\nfor (let i of [1, 2, 3]) {\n  arr[i] = i * 10;\n  if (x) continue;\n  else continue;\n}\n\nz = arr;\n\ninspect = function() {\n  return \"\" + global.z;\n};\n"
  },
  {
    "path": "test/serializer/abstract/Continue2.js",
    "content": "let x = global.__abstract ? __abstract(\"boolean\", \"true\") : true;\n\nlet arr = [];\n\nfor (let i of [1, 2, 3]) {\n  arr[i] = i * 10;\n  if (x) continue;\n  else break;\n}\n\ninspect = function() {\n  return JSON.stringify(arr);\n};\n"
  },
  {
    "path": "test/serializer/abstract/DebugValue.js",
    "content": "let x = global.__abstract ? __abstract(\"boolean\", \"true\") : true;\nlet ob = x ? { a: 1 } : { b: 2 };\n\nglobal.__abstract ? __debugValue(ob) : {};\nglobal.__abstract ? __debugValue([ob, x]) : {};\n\ninspect = function() {\n  return true;\n};\n"
  },
  {
    "path": "test/serializer/abstract/DefineDeletedProperty.js",
    "content": "var c = global.__abstract ? __abstract(\"boolean\", \"(true)\") : true;\nvar obj = {};\nObject.defineProperty(obj, \"x\", { value: 1, enumerable: true, writable: true, configurable: true });\nif (c) delete obj.x;\nObject.defineProperty(obj, \"x\", { enumerable: true, writable: true, configurable: false });\n\ninspect = function() {\n  return Object.getOwnPropertyDescriptor(obj, \"x\");\n};\n"
  },
  {
    "path": "test/serializer/abstract/Delete.js",
    "content": "// throws introspection error\n\nvar obj = __makePartial({});\ndelete obj.someProperty;\n"
  },
  {
    "path": "test/serializer/abstract/Delete1.js",
    "content": "// throws introspection error\nvar obj = global.__abstract ? __abstract(\"object\", \"({ p: 41} )\") : { p: 41 };\ndelete obj.p;\nz = obj.p;\n\ninspect = function() {\n  return global.z;\n};\n"
  },
  {
    "path": "test/serializer/abstract/Delete2.js",
    "content": "let x = global.__abstract ? __abstract(\"boolean\", \"true\") : true;\n\nlet ob1 = { x: 123 };\nlet ob2 = { x: 456 };\nlet o = x ? ob1 : ob2;\n\ndelete o.x;\n\nz = o.x;\nz1 = ob1.x;\nz2 = ob2.x;\n\ninspect = function() {\n  return \"\" + global.z + global.z1 + global.z2;\n};\n"
  },
  {
    "path": "test/serializer/abstract/Delete3.js",
    "content": "let x = global.__abstract ? __abstract(\"boolean\", \"true\") : true;\n\nlet ob1 = { x: 123 };\nlet ob2 = { y: 456 };\nlet o = x ? ob1 : ob2;\n\ndelete o.x;\n\nz = o.x;\nz1 = ob1.x;\nz2 = ob2.x;\n\ninspect = function() {\n  return \"\" + global.z + global.z1 + global.z2;\n};\n"
  },
  {
    "path": "test/serializer/abstract/Delete4.js",
    "content": "// throws introspection error\nlet x = __abstract(\"boolean\", \"true\");\n\nlet ob1 = { x: 123 };\nlet ob2 = {\n  get x() {\n    return 456;\n  },\n};\nlet o = x ? ob1 : ob2;\n\ndelete o.x;\n"
  },
  {
    "path": "test/serializer/abstract/Delete5.js",
    "content": "// throws introspection error\nlet x = __abstract(\"boolean\", \"true\");\n\nlet ob1 = { x: 123 };\nlet ob2 = {};\nObject.defineProperty(ob2, \"x\", { writable: false, value: 456 });\nlet o = x ? ob1 : ob2;\n\ndelete o.x;\n"
  },
  {
    "path": "test/serializer/abstract/Delete6.js",
    "content": "let x = global.__abstract ? __abstract(\"boolean\", \"true\") : true;\n\nlet ob1 = { x: 123 };\nlet ob2 = { y: 456 };\nlet ob3 = {};\nlet o = x ? ob1 : ob2;\n\ndelete o.x;\nob1.x = ob3.x;\n\nz = ob1.x;\n\ninspect = function() {\n  return \"\" + global.z;\n};\n"
  },
  {
    "path": "test/serializer/abstract/Delete7.js",
    "content": "// throws introspection error\nlet x = global.__abstract ? __abstract(\"boolean\", \"true\") : true;\n\nlet proto = {};\nObject.defineProperty(proto, \"x\", { writable: false, value: 111 });\nlet ob1 = { x: 123 };\nObject.setPrototypeOf(ob1, proto);\nlet ob2 = { y: 456 };\nlet o = x ? ob1 : ob2;\n\ndelete o.x;\nob1.x = 789;\n"
  },
  {
    "path": "test/serializer/abstract/Delete8.js",
    "content": "// throws introspection error\nlet x = global.__abstract ? __abstract(\"boolean\", \"true\") : true;\n\nlet proto = { x: 111 };\nlet ob1 = {};\nObject.defineProperty(ob1, \"x\", { writable: false, configurable: true, value: 123 });\nObject.setPrototypeOf(ob1, proto);\nlet ob2 = { y: 456 };\nlet o = x ? ob1 : ob2;\n\ndelete o.x;\nob1.x = 789;\n"
  },
  {
    "path": "test/serializer/abstract/DeleteArrayProperty.js",
    "content": "var x = global.__abstract ? __abstract(\"boolean\", \"true\") : true;\nvar o = [42];\nif (x) delete o[0];\ninspect = function() {\n  return o[0];\n};\n"
  },
  {
    "path": "test/serializer/abstract/DeleteArrayProperty2.js",
    "content": "var x = global.__abstract ? __abstract(\"boolean\", \"true\") : true;\nvar a = [42];\nvar o = global.__makePartial ? __makePartial(a) : a;\nif (x) delete o[0];\ninspect = function() {\n  return o[0];\n};\n"
  },
  {
    "path": "test/serializer/abstract/DeleteFunctionProperty.js",
    "content": "var x = global.__abstract ? __abstract(\"boolean\", \"true\") : true;\nvar o = function f() {};\no.x = 42;\nif (x) delete o.x;\ninspect = function() {\n  return o.x;\n};\n"
  },
  {
    "path": "test/serializer/abstract/DeleteObjectProperty.js",
    "content": "var x = global.__abstract ? __abstract(\"boolean\", \"true\") : true;\nvar o = { x: 42 };\nif (x) delete o.x;\ninspect = function() {\n  return o.x;\n};\n"
  },
  {
    "path": "test/serializer/abstract/DeleteOnConditionalObject.js",
    "content": "let c = global.__abstract ? __abstract(\"boolean\", \"(true)\") : true;\n\nlet invokedSetter = false;\nlet obj1 = Object.create({\n  set x(v) {\n    invokedSetter = true;\n  },\n});\nlet obj2 = { x: 1 };\n\nlet conditionalObj = c ? obj1 : obj2;\n\ndelete conditionalObj.x;\n\ninspect = function() {\n  let hasProperty = \"x\" in obj2;\n  return JSON.stringify({ invokedSetter, hasProperty });\n};\n"
  },
  {
    "path": "test/serializer/abstract/Distribute.js",
    "content": "// does not contain:infeasible\n(function() {\n  let c = global.__abstract ? __abstract(\"boolean\", \"(true)\") : true;\n  let left = c ? 0 : 10;\n  let right = c ? 5 : 15;\n  let infeasible = left > right;\n  if (infeasible) throw new Error(\"infeasible!\");\n  inspect = function() {\n    return infeasible;\n  };\n})();\n"
  },
  {
    "path": "test/serializer/abstract/DoWhile.js",
    "content": "let n = global.__abstract ? __abstract(\"number\", \"10\") : 10;\nlet i = 0;\nlet j;\ndo {\n  i++;\n  j = 0;\n} while (i < n);\n\ninspect = function() {\n  return i + \" \" + j;\n};\n"
  },
  {
    "path": "test/serializer/abstract/DoWhile1.js",
    "content": "let n = global.__abstract ? __abstract(\"number\", \"10\") : 10;\nlet i = 0;\nlet j;\nlet k = 10;\ndo {\n  i++;\n  if (i > 1) {\n    j = 2;\n    k = i + 3;\n  }\n} while (i < n);\n\ninspect = function() {\n  return i + \" \" + j + \" \" + k;\n};\n"
  },
  {
    "path": "test/serializer/abstract/DoWhile10.js",
    "content": "let n = global.__abstract ? __abstract(\"number\", \"(3)\") : 3;\nlet i = 0;\nlet o = { x: 0 };\ndo {\n  o.x = i;\n  i++;\n} while (i < n);\n\ninspect = function() {\n  return JSON.stringify(o);\n};\n"
  },
  {
    "path": "test/serializer/abstract/DoWhile11.js",
    "content": "let n = global.__abstract ? __abstract(\"number\", \"(3)\") : 3;\nlet i = 0;\nlet o = [];\ndo {\n  o[i] = i;\n  i++;\n} while (i < n);\n\ninspect = function() {\n  return JSON.stringify(o);\n};\n"
  },
  {
    "path": "test/serializer/abstract/DoWhile12.js",
    "content": "var n = global.__abstract ? __abstract(\"number\", \"(2)\") : 2;\nlet i = 0;\ndo {\n  console.log(i++);\n} while (i++ < n);\n\ninspect = function() {\n  return i;\n};\n"
  },
  {
    "path": "test/serializer/abstract/DoWhile13.js",
    "content": "let template = global.__abstract\n  ? __abstract({ x: __abstract(\"number\") }, \"({ set x(v) { console.log(v); } })\")\n  : {\n      set x(v) {\n        console.log(v);\n      },\n    };\nlet n = global.__abstract ? __abstract(\"number\", \"(2)\") : 2;\nlet i = 0;\ndo {\n  template.x = 3;\n} while (++i < n);\n\ninspect = function() {\n  return template.x;\n};\n"
  },
  {
    "path": "test/serializer/abstract/DoWhile2.js",
    "content": "// throws introspection error\nlet n = global.__abstract ? __abstract(\"number\", \"10\") : 10;\nlet o = {};\nlet i = 0;\ndo {\n  i++;\n  if (i > 5) throw \"oopsie\";\n} while (i < n);\n\ninspect = function() {\n  return i;\n};\n"
  },
  {
    "path": "test/serializer/abstract/DoWhile2a.js",
    "content": "// does not contain:inspect\nlet n = global.__abstract ? __abstract(\"number\", \"10\") : 10;\nlet o = {};\nlet i = 0;\ndo {\n  i++;\n  throw \"oopsie\";\n} while (i < n);\n\ninspect = function() {\n  return i;\n};\n"
  },
  {
    "path": "test/serializer/abstract/DoWhile3.js",
    "content": "let n = global.__abstract ? __abstract(\"number\", \"10\") : 10;\nlet i = 0;\ndo {\n  i++;\n  break;\n} while (i < n);\nxyz: do {\n  i++;\n  break xyz;\n} while (i < n);\ndo {\n  5;\n} while (false);\ndo {} while (false);\ndo {\n  i++;\n} while (i < 12);\n\ninspect = function() {\n  return i;\n};\n"
  },
  {
    "path": "test/serializer/abstract/DoWhile4.js",
    "content": "// throws introspection error\nlet n = global.__abstract ? __abstract(\"number\", \"10\") : 10;\nlet i = 0;\ndo {\n  i++;\n  if (i > 5) break;\n} while (i < n);\n\ninspect = function() {\n  return i;\n};\n"
  },
  {
    "path": "test/serializer/abstract/DoWhile5.js",
    "content": "let n = global.__abstract ? __abstract(\"number\", \"10\") : 10;\nlet i = 0;\nlet j;\nlet k;\ndo {\n  j = i;\n  i++;\n  k = i + 2;\n} while (i < n);\n\ninspect = function() {\n  return i + \" \" + j + \" \" + k;\n};\n"
  },
  {
    "path": "test/serializer/abstract/DoWhile6.js",
    "content": "let n = global.__abstract ? __abstract(\"number\", \"10\") : 10;\nlet i = 0;\nlet ob = { j: 0 };\ndo {\n  i++;\n  ob.j = i;\n} while (ob.j < n);\n\ninspect = function() {\n  return i + \" \" + ob.j;\n};\n"
  },
  {
    "path": "test/serializer/abstract/DoWhile6a.js",
    "content": "let n = global.__abstract ? __abstract(\"number\", \"1\") : 1;\nlet i = 0;\nlet ob = { j: 0 };\ndo {\n  i++;\n  if (i > 1) ob.j = i;\n} while (i < n);\n\ninspect = function() {\n  return i + \" \" + ob.j;\n};\n"
  },
  {
    "path": "test/serializer/abstract/DoWhile6b.js",
    "content": "let n = global.__abstract ? __abstract(\"number\", \"1\") : 1;\nlet i = 0;\nlet ob = {};\ndo {\n  i++;\n  if (i > 1) ob.j = i;\n} while (i < n);\nlet k = ob.j;\n\ninspect = function() {\n  return k + \" \" + JSON.stringify(Reflect.ownKeys(ob));\n};\n"
  },
  {
    "path": "test/serializer/abstract/DoWhile6c.js",
    "content": "let n = global.__abstract ? __abstract(\"number\", \"2\") : 2;\nlet i = 0;\nlet ob = { j: 1 };\ndo {\n  i++;\n  if (i == 1) delete ob.j;\n  else ob.j = undefined;\n} while (i < n);\nlet k = ob.j;\n\ninspect = function() {\n  return k + \" \" + JSON.stringify(Reflect.ownKeys(ob));\n};\n"
  },
  {
    "path": "test/serializer/abstract/DoWhile6d.js",
    "content": "let n = global.__abstract ? __abstract(\"number\", \"1\") : 1;\nlet i = 0;\nlet ob = { j: 1 };\ndo {\n  i++;\n  if (i == 1) delete ob.j;\n  else ob.j = undefined;\n} while (i < n);\nlet k = ob.j;\n\ninspect = function() {\n  return k + \" \" + JSON.stringify(Reflect.ownKeys(ob));\n};\n"
  },
  {
    "path": "test/serializer/abstract/DoWhile7.js",
    "content": "let n = global.__abstract ? __abstract(\"number\", \"10\") : 10;\nlet i = 0;\nlet ob = {};\ndo {\n  i++;\n  ob[i] = 1;\n} while (i < n);\nlet x = ob[5];\n\ninspect = function() {\n  return i + \" \" + x + \" \" + JSON.stringify(ob);\n};\n"
  },
  {
    "path": "test/serializer/abstract/DoWhile8.js",
    "content": "let a = global.__abstract ? __abstract([], \"[1, 2, 3]\") : [1, 2, 3];\nlet n = global.__abstract ? __abstract(\"number\", \"(3)\") : 3;\nlet i = 0;\nlet b = [];\ndo {\n  b[i] = a[i++];\n} while (i < n);\nlet x = b[1];\nlet j = b.length;\n\ninspect = function() {\n  return i + \" \" + j + \" \" + x + \" \" + JSON.stringify(b);\n};\n"
  },
  {
    "path": "test/serializer/abstract/DoWhile8a.js",
    "content": "let a = global.__abstract ? __makeSimple(__abstract(\"array\", \"[1, 2, 3]\")) : [1, 2, 3];\nlet i = 0;\nlet b = [];\ndo {\n  b[i] = a[i++];\n} while (i < a.length);\nlet x = b[1];\nlet j = b.length;\n\ninspect = function() {\n  return i + \" \" + j + \" \" + x + \" \" + JSON.stringify(b);\n};\n"
  },
  {
    "path": "test/serializer/abstract/DoWhile9.js",
    "content": "// skip lazy objects\n\nlet n = global.__abstract ? __abstract(\"number\", \"(3)\") : 3;\nlet i = 0;\nlet o = null;\ndo {\n  o = { i };\n  i++;\n} while (i < n);\n\ninspect = function() {\n  return JSON.stringify(o);\n};\n"
  },
  {
    "path": "test/serializer/abstract/Error.js",
    "content": "// does not contain:setPrototypeOf\n// throws introspection error\nlet x = global.__abstract ? __abstract(\"string\", \"('abc')\") : \"abc\";\nlet err1 = new Error(x);\nerr1.name = x;\nlet err2 = new Error(err1);\n\ninspect = function() {\n  return \"\" + err2;\n};\n"
  },
  {
    "path": "test/serializer/abstract/ErrorMessageStringCoercion.js",
    "content": "let num = global.__abstract ? __abstract(\"number\", \"42\") : 42;\nlet err = new Error(num);\n\ninspect = function() {\n  return \"\" + err;\n};\n"
  },
  {
    "path": "test/serializer/abstract/Fibonacci.js",
    "content": "// skip this test for now\n// throws introspection error\nlet n = global.__abstract ? global.__abstract(\"number\", \"4\") : 4;\n\nfunction fibonacci(x) {\n  return x <= 1 ? x : fibonacci(x - 1) + fibonacci(x - 2);\n}\n\nlet x = fibonacci(n);\nlet y = typeof x;\n\ninspect = function() {\n  return x + \" \" + y;\n};\n"
  },
  {
    "path": "test/serializer/abstract/ForInStatement.js",
    "content": "// throws introspection error\nlet x = __abstract(\"boolean\", \"true\");\nlet ob = { a: 1 };\nif (x) {\n  delete ob.a;\n}\nfor (var p in ob) {\n  console.log(p);\n}\n"
  },
  {
    "path": "test/serializer/abstract/ForInStatement1.js",
    "content": "// throws introspection error\nlet x = __abstract(\"boolean\", \"true\");\nlet ob = x ? { a: 1 } : { b: 2 };\nlet tgt = {};\nfor (var p in ob) {\n  tgt[p] = p + p;\n}\n"
  },
  {
    "path": "test/serializer/abstract/ForInStatement10.js",
    "content": "// throws introspection error\n\nlet ob = global.__abstract ? __abstract({ x: 1 }, \"({ x: 1 })\") : { x: 1 };\nif (global.__makeSimple) __makeSimple(ob);\n\nlet tgt = {};\nfor (var p in ob) {\n  break;\n}\n"
  },
  {
    "path": "test/serializer/abstract/ForInStatement11.js",
    "content": "// throws introspection error\n\nlet ob = global.__abstract ? __abstract({ x: 1 }, \"({ x: 1 })\") : { x: 1 };\nif (global.__makeSimple) __makeSimple(ob);\n\nlet tgt = {};\nfor (var p in ob) {\n  console.log(p);\n}\n"
  },
  {
    "path": "test/serializer/abstract/ForInStatement11a.js",
    "content": "let ob = global.__makePartial ? __makePartial({ x: 1 }) : { x: 1 };\nlet ob2 = global.__makePartial ? __makePartial({ x: 2 }) : { x: 2 };\nif (global.__makeSimple) __makeSimple(ob);\nif (global.__makeSimple) __makeSimple(ob2);\n\nlet tgt = {};\nfor (var p in ob) {\n  tgt[p] = ob2[p];\n}\n\ninspect = function() {\n  return tgt.x;\n};\n"
  },
  {
    "path": "test/serializer/abstract/ForInStatement11b.js",
    "content": "let ob = global.__makePartial ? __makePartial({ x: 1 }) : { x: 1 };\nif (global.__makeSimple) __makeSimple(ob);\n\nlet ob2 = {};\nfor (var p in ob) {\n  ob2[p] = ob[p];\n}\n\nlet tgt = {};\nfor (var p in ob) {\n  tgt[p] = ob2[p];\n}\n\ninspect = function() {\n  return tgt.x;\n};\n"
  },
  {
    "path": "test/serializer/abstract/ForInStatement12.js",
    "content": "// add at runtime:let tmp = { w: undefined, nest: { x: 1 } };\nlet str = \"({ w: undefined, nest: { x: 1 } })\";\nlet ob = global.__abstract ? __abstract({ w: undefined, nest: __abstract({ x: 1 }) }, \"tmp\") : tmp;\n\nlet tgt = {};\n\nob = JSON.parse(JSON.stringify(ob));\nlet loc = ob.nest;\nob.w = {\n  a: loc.x / loc.x,\n  b: loc.x + loc.x,\n};\nfor (var p in ob) {\n  tgt[p] = ob[p];\n}\nlet final_p1 = tgt.w;\nlet finalv = final_p1.a;\n\ninspect = function() {\n  return finalv + tgt.w.a + tgt.w.b;\n};\n"
  },
  {
    "path": "test/serializer/abstract/ForInStatement2.js",
    "content": "// throws introspection error\nlet x = __abstract(\"boolean\", \"true\");\nlet ob = x ? { a: 1 } : { b: 2 };\nlet src = {};\nlet tgt = {};\nfor (var p in ob) {\n  tgt[p] = src[p];\n}\n"
  },
  {
    "path": "test/serializer/abstract/ForInStatement2a.js",
    "content": "let x = global.__abstract ? __abstract(\"boolean\", \"true\") : true;\nlet ob = x ? { a: 1 } : { b: 2 };\nlet src = global.__makePartial ? __makePartial({}) : {};\nif (global.__makeSimple) __makeSimple(src);\nlet tgt = {};\nfor (var p in ob) {\n  tgt[p] = src[p];\n}\n\ninspect = function() {\n  return tgt.a;\n};\n"
  },
  {
    "path": "test/serializer/abstract/ForInStatement3.js",
    "content": "// throws introspection error\nlet ob = __abstract({}, \"({})\");\nif (global.__makeSimple) __makeSimple(ob);\nlet x = __abstract(\"string\");\n\nob[x] = 123;\nlet tgt = {};\nfor (var p in ob) {\n  tgt[p] = ob[p];\n}\n"
  },
  {
    "path": "test/serializer/abstract/ForInStatement3a.js",
    "content": "// throws introspection error\nlet ob = __abstract({}, \"({})\");\nif (global.__makeSimple) __makeSimple(ob);\nlet x = __abstract(\"string\");\n\nob[x] = 123;\nlet tgt = {};\ntgt[x] = 456;\nfor (var p in ob) {\n  tgt[p] = ob[p];\n}\n"
  },
  {
    "path": "test/serializer/abstract/ForInStatement4.js",
    "content": "let ob = global.__abstract ? __abstract({ x: 1 }, \"({ x: 1 })\") : { x: 1 };\nif (global.__makeSimple) __makeSimple(ob);\n\nlet tgt = {};\nfor (var p in ob) {\n  tgt[p] = ob[p];\n}\n\ninspect = function() {\n  return \"\";\n};\n"
  },
  {
    "path": "test/serializer/abstract/ForInStatement5.js",
    "content": "// throws introspection error\n\nlet ob = global.__abstract ? __abstract({ x: 1 }, \"({ x: 1 })\") : { x: 1 };\nif (global.__makeSimple) __makeSimple(ob);\n\nlet tgt = {};\nfor (var p in ob) {\n  tgt[p] = ob[p + p];\n}\n"
  },
  {
    "path": "test/serializer/abstract/ForInStatement6.js",
    "content": "// throws introspection error\n\nlet ob = global.__abstract ? __abstract({ x: 1 }, \"({ x: 1 })\") : { x: 1 };\nif (global.__makeSimple) __makeSimple(ob);\n\nlet tgt = {};\nfor (var p in ob) {\n  tgt[p] = ob.x;\n}\n"
  },
  {
    "path": "test/serializer/abstract/ForInStatement7.js",
    "content": "// throws introspection error\n\nlet ob = global.__abstract ? __abstract({ x: 1 }, \"({ x: 1 })\") : { x: 1 };\nif (global.__makeSimple) __makeSimple(ob);\n\nlet tgt = {};\nfor (var p in ob) {\n  tgt.x = 1;\n}\n"
  },
  {
    "path": "test/serializer/abstract/ForInStatement8.js",
    "content": "// throws introspection error\n\nlet ob = global.__abstract ? __abstract({ x: 1 }, \"({ x: 1 })\") : { x: 1 };\nif (global.__makeSimple) __makeSimple(ob);\n\nlet tgt = {};\nfor (var p in ob) {\n  tgt = ob.x;\n}\n\nz = tgt;\n"
  },
  {
    "path": "test/serializer/abstract/ForInStatement9.js",
    "content": "// throws introspection error\n\nlet ob = global.__abstract ? __abstract({ x: 1 }, \"({ x: 1 })\") : { x: 1 };\nif (global.__makeSimple) __makeSimple(ob);\nfunction f() {}\n\nlet tgt = {};\nfor (var p in ob) {\n  new f();\n}\n\nz = tgt;\n"
  },
  {
    "path": "test/serializer/abstract/ForLoop.js",
    "content": "var x = global.__abstract ? (x = __abstract(\"number\", \"(1)\")) : 1;\nlet i;\n\nfor (i = 0; i < 2; i++) {\n  if (i === x) break;\n}\n\ninspect = function() {\n  return i;\n};\n"
  },
  {
    "path": "test/serializer/abstract/ForLoop1.js",
    "content": "var x = global.__abstract ? (x = __abstract(\"number\", \"(2)\")) : 2;\nlet i;\nlet j = 100;\n\nlabel: for (i = 0; i < 3; i++) {\n  if (i == x - 1) continue label;\n  if (i === x) continue;\n  j += 100;\n}\n\ninspect = function() {\n  return j;\n};\n"
  },
  {
    "path": "test/serializer/abstract/ForLoop2.js",
    "content": "for (; true; ) {\n  break;\n}\n"
  },
  {
    "path": "test/serializer/abstract/ForOfStatement.js",
    "content": "// throws introspection error\n\nvar x = __abstract(\"object\");\nfor (var y of x) {\n}\n"
  },
  {
    "path": "test/serializer/abstract/ForOfStatement2.js",
    "content": "// throws introspection error\n\nvar x = __abstract(\"object\");\nfunction foo() {\n  for (var e of x) return e;\n}\nlet p;\nfor ([p = foo()] of [[undefined]]) {\n}\n"
  },
  {
    "path": "test/serializer/abstract/Function.js",
    "content": "var __abstract = global.__abstract\n  ? global.__abstract\n  : function() {\n      return console.log;\n    };\n\nvar obj = __abstract(\"function\", \"console.log\");\nvar ident = 10;\nobj(\"literal \", 5, ident);\n\ninspect = function() {\n  return 0;\n};\n"
  },
  {
    "path": "test/serializer/abstract/GeneratorScoping1.js",
    "content": "(function() {\n  let a = global.__abstract ? __abstract(\"boolean\", \"(true)\") : true;\n  let obj = {};\n  global.early = obj; // assignments to intrinsics are emitted in chronological order via the generator\n  if (a) {\n    obj.f = Date.now(); // calls to Date.now() are also emitted along the same timeline, so this comes later\n  } else {\n    obj.f = -1;\n  }\n  inspect = function() {\n    return a ? obj.f > 0 : obj.f < 0;\n  };\n})();\n"
  },
  {
    "path": "test/serializer/abstract/GeneratorScoping2.js",
    "content": "(function() {\n  let a = global.__abstract ? __abstract(\"boolean\", \"(false)\") : false;\n  let x = global.__abstract ? __abstract(\"number\", \"(42)\") : 42;\n  let y = x * 2;\n  var z;\n  if (a) {\n    z = y;\n  } else {\n    z = y;\n  }\n  inspect = function() {\n    return z.toString();\n  };\n})();\n"
  },
  {
    "path": "test/serializer/abstract/GeneratorScoping3.js",
    "content": "(function() {\n  let a = global.__abstract ? __abstract(\"boolean\", \"(false)\") : false;\n  let x = global.__abstract ? __abstract(\"number\", \"(42)\") : 42;\n  let y = x * 2;\n  var z;\n  if (a) {\n    z = y;\n  } else {\n    z = function() {\n      return y;\n    };\n  }\n  inspect = function() {\n    return (z instanceof Function ? z() : z).toString();\n  };\n})();\n"
  },
  {
    "path": "test/serializer/abstract/GeneratorScoping4.js",
    "content": "(function() {\n  let x = global.__abstract ? __abstract(\"boolean\", \"/* x = */(true)\") : true;\n  let y = global.__abstract ? __abstract(\"boolean\", \"/* y = */(true)\") : true;\n  let obj = { p: 42 };\n  var f;\n  var g;\n  if (y) {\n    if (x) {\n      f = function() {\n        return obj;\n      };\n    } else {\n      g = function() {\n        return obj;\n      };\n    }\n  }\n  inspect = function() {\n    return (f || g)().p;\n  };\n})();\n"
  },
  {
    "path": "test/serializer/abstract/GetPrototypeOf.js",
    "content": "let x = global.__abstract ? __abstract(\"boolean\", \"true\") : true;\n\nlet p1 = { p: 1 };\nlet p2 = { p: 2 };\nlet o1 = Object.create(p1);\nlet o2 = Object.create(p2);\nlet o = x ? o1 : o2;\n\nvar z = Object.getPrototypeOf(o);\n\ninspect = function() {\n  return z.p;\n};\n"
  },
  {
    "path": "test/serializer/abstract/GetPrototypeOf2.js",
    "content": "let o = global.__abstract ? __abstract({}, \"{}\") : {};\n\nvar p = Object.getPrototypeOf(o);\n\ninspect = function() {\n  return p === Object.prototype;\n};\n"
  },
  {
    "path": "test/serializer/abstract/GetValue.js",
    "content": "// throws introspection error\n\nvar obj = __makePartial({});\nvar x = obj.someProperty;\n"
  },
  {
    "path": "test/serializer/abstract/GetValue10.js",
    "content": "var absx = global.__abstract ? __abstract(\"string\", '(\"x\")') : \"x\";\nvar absy = global.__abstract ? __abstract(\"string\", '(\"y\")') : \"y\";\nvar absz = global.__abstract ? __abstract(\"string\", '(\"z\")') : \"z\";\n\nfunction Foo() {}\nFoo.prototype.x = 111;\nvar obj = new Foo();\nr0 = obj[absx];\nobj[absy] = 123;\nobj[absz] = 456;\nr1 = obj.x;\nr2 = obj.y;\nr3 = obj.z;\nr4 = obj[absx];\nr5 = obj[absy];\nr6 = obj[absz];\n//obj[absx] = 777;\nr7 = obj.x;\n\ninspect = function() {\n  return (\n    JSON.stringify([global.r0, global.r1, global.r2, global.r3, global.r4, global.r5, global.r6, global.r7]) +\n    JSON.stringify(obj)\n  );\n};\n"
  },
  {
    "path": "test/serializer/abstract/GetValue2.js",
    "content": "// throws introspection error\n\nvar obj = __abstract(\"object\");\nvar x = obj[\"someProperty\"];\n"
  },
  {
    "path": "test/serializer/abstract/GetValue3.js",
    "content": "let x = global.__abstract ? __abstract(\"boolean\", \"true\") : true;\n\nlet ob = x ? { a: 1 } : { b: 2 };\n\nvar z = ob.a;\n\ninspect = function() {\n  return z;\n};\n"
  },
  {
    "path": "test/serializer/abstract/GetValue4.js",
    "content": "let x = global.__abstract ? __abstract(\"boolean\", \"true\") : true;\nlet calledGetter = false;\nlet ob = x\n  ? { a: 1 }\n  : {\n      get a() {\n        calledGetter = true;\n        return 2;\n      },\n    };\nlet y = ob.a;\ninspect = function() {\n  return JSON.stringify({ y, calledGetter });\n};\n"
  },
  {
    "path": "test/serializer/abstract/GetValue5.js",
    "content": "let x = global.__abstract ? __abstract(\"boolean\", \"true\") : true;\n\nlet proto = { a: 1 };\nlet o = { a: 2 };\nObject.setPrototypeOf(o, proto);\n\nlet ob = x ? o : { a: 3 };\n\ndelete ob.a;\nvar z = o.a;\n\ninspect = function() {\n  return z;\n};\n"
  },
  {
    "path": "test/serializer/abstract/GetValue6.js",
    "content": "let ob = global.__makePartial ? __makeSimple(__makePartial({})) : { a: 123 };\nif (global.__residual)\n  __residual(\n    \"void\",\n    o => {\n      o.a = 123;\n    },\n    ob\n  );\n\nvar z = ob.a;\n\ninspect = function() {\n  return z;\n};\n"
  },
  {
    "path": "test/serializer/abstract/GetValue7.js",
    "content": "var n = global.__abstract ? __abstract(\"string\", '(\"x\")') : \"x\";\nvar m = global.__abstract ? __abstract(\"string\", '(\"z\")') : \"z\";\n\nvar a = { x: 123, y: 444 };\nif (global.__makeSimple) global.__makeSimple(a);\nvar z = a[n];\n\na[n] = 456;\nvar z1 = a[n];\n\nb = {};\nif (global.__makeSimple) global.__makeSimple(b);\nvar z2 = b[m];\n\n//b[m] = 789;\nvar z3 = b[m];\n\ninspect = function() {\n  return \"\" + a.x + a.y + a[n] + z + z1 + z2 + z3;\n};\n"
  },
  {
    "path": "test/serializer/abstract/GetValue8.js",
    "content": "// cannot serialize\n\nlet ob = global.__makePartial ? __makeSimple(__makePartial({})) : {};\nvar n = global.__abstract ? __abstract(\"string\", '(\"a\")') : \"a\";\n\nz = ob[n];\n\ninspect = function() {\n  return global.z;\n};\n"
  },
  {
    "path": "test/serializer/abstract/GetValue9.js",
    "content": "let obj = global.__makePartial ? __makeSimple(__makePartial({})) : {};\nx = obj[5];\n\ninspect = function() {\n  return global.x === undefined;\n};\n"
  },
  {
    "path": "test/serializer/abstract/GlobalAbstractName.js",
    "content": "// does not contain:global\n(function() {\n  global.x = 42;\n  var y = global.__abstract ? __abstract(\"number\", \"global.x\") : 42;\n  inspect = function() {\n    return y;\n  };\n})();\n"
  },
  {
    "path": "test/serializer/abstract/If.js",
    "content": "let x = global.__abstract ? __abstract(\"boolean\", \"true\") : true;\nlet xx = global.__abstract ? __abstract(\"boolean\", \"false\") : false;\nlet y = 1;\nlet yy = 2;\nlet ob = { a: 1, b: 2 };\nvar a = 10;\nif (x) {\n  y = 2;\n  ob.a = 10;\n  if (xx) {\n    y = 3;\n    a = 30;\n    let b = 40;\n    ob.a = 20;\n    ob.b = 30;\n  } else {\n    y = 4;\n    a = 40;\n    ob.a = 30;\n    ob.b = 40;\n  }\n} else {\n  y = 3;\n  yy = 6;\n  a = 30;\n  ob.b = 40;\n}\nvar z = y;\nvar z1 = yy;\nvar z2 = ob.a;\nvar z3 = ob.b;\ninspect = function() {\n  return \"\" + a + z + z1 + z2 + z3;\n};\n"
  },
  {
    "path": "test/serializer/abstract/ImplicitAbstractConversion.js",
    "content": "let x = global.__abstract ? __abstract(\"number\", \"(3)\") : 3;\nlet ob = { valueOf: () => x };\nlet y = 123 * ob;\ninspect = function() {\n  return y;\n};\n"
  },
  {
    "path": "test/serializer/abstract/ImplicitAbstractConversion10.js",
    "content": "let x = global.__abstract ? __abstract(\"number\", \"(3)\") : 3;\nlet ob = { valueOf: () => x };\nlet y = 2 < x;\ninspect = function() {\n  return y;\n};\n"
  },
  {
    "path": "test/serializer/abstract/ImplicitAbstractConversion11.js",
    "content": "let y = 2 < \"abc\";\ninspect = function() {\n  return y;\n};\n"
  },
  {
    "path": "test/serializer/abstract/ImplicitAbstractConversion12.js",
    "content": "let y = \"abc\" > 2;\ninspect = function() {\n  return y;\n};\n"
  },
  {
    "path": "test/serializer/abstract/ImplicitAbstractConversion13.js",
    "content": "let x = global.__abstract ? __abstract(\"number\", \"(3)\") : 3;\nlet ob = { valueOf: () => x };\nlet y = 2 <= x;\ninspect = function() {\n  return y;\n};\n"
  },
  {
    "path": "test/serializer/abstract/ImplicitAbstractConversion14.js",
    "content": "let x = global.__abstract ? __abstract(\"number\", \"(3)\") : 3;\nlet ob = { valueOf: () => x };\nlet y = 2 >= x;\ninspect = function() {\n  return y;\n};\n"
  },
  {
    "path": "test/serializer/abstract/ImplicitAbstractConversion15.js",
    "content": "let y = 2 ** 3;\ninspect = function() {\n  return y;\n};\n"
  },
  {
    "path": "test/serializer/abstract/ImplicitAbstractConversion16.js",
    "content": "let x = global.__abstract ? __abstract(\"number\", \"(3)\") : 3;\nlet ob = { valueOf: () => x };\nlet y = 123 >= ob;\ninspect = function() {\n  return y;\n};\n"
  },
  {
    "path": "test/serializer/abstract/ImplicitAbstractConversion17.js",
    "content": "let x = global.__abstract ? __abstract(\"number\", \"(3)\") : 3;\nlet ob = { valueOf: () => x };\nlet y = ob >= 123;\ninspect = function() {\n  return y;\n};\n"
  },
  {
    "path": "test/serializer/abstract/ImplicitAbstractConversion18.js",
    "content": "let x = global.__abstract ? __abstract(\"number\", \"(3)\") : 3;\nlet ob = { valueOf: () => x };\nlet y = ob >= 2;\ninspect = function() {\n  return y;\n};\n"
  },
  {
    "path": "test/serializer/abstract/ImplicitAbstractConversion19.js",
    "content": "let y = 2 >= \"abc\";\ninspect = function() {\n  return y;\n};\n"
  },
  {
    "path": "test/serializer/abstract/ImplicitAbstractConversion2.js",
    "content": "let x = global.__abstract ? __abstract(\"number\", \"3\") : 3;\nlet ob = { valueOf: () => x };\nlet y = 123 / ob;\ninspect = function() {\n  return y;\n};\n"
  },
  {
    "path": "test/serializer/abstract/ImplicitAbstractConversion20.js",
    "content": "let x = global.__abstract ? __abstract(\"number\", \"(3)\") : 3;\nlet ob = { valueOf: () => x };\nlet y = ob >= 3;\ninspect = function() {\n  return y;\n};\n"
  },
  {
    "path": "test/serializer/abstract/ImplicitAbstractConversion21.js",
    "content": "let x = global.__abstract ? __abstract(\"number\", \"(3)\") : 3;\nlet ob = { valueOf: () => x };\nlet y = ob % 4;\ninspect = function() {\n  return y;\n};\n"
  },
  {
    "path": "test/serializer/abstract/ImplicitAbstractConversion22.js",
    "content": "let x = global.__abstract ? __abstract(\"number\", \"(3)\") : 3;\nlet ob = { valueOf: () => x };\nlet y = ob / 4;\ninspect = function() {\n  return y;\n};\n"
  },
  {
    "path": "test/serializer/abstract/ImplicitAbstractConversion23.js",
    "content": "let x = global.__abstract ? __abstract(\"number\", \"(3)\") : 3;\nlet ob = { valueOf: () => x };\nlet y = ob * 4;\ninspect = function() {\n  return y;\n};\n"
  },
  {
    "path": "test/serializer/abstract/ImplicitAbstractConversion24.js",
    "content": "let x = global.__abstract ? __abstract(\"number\", \"(3)\") : 3;\nlet ob = { valueOf: () => x };\nlet y = ob - 4;\ninspect = function() {\n  return y;\n};\n"
  },
  {
    "path": "test/serializer/abstract/ImplicitAbstractConversion25.js",
    "content": "let x = global.__abstract ? __abstract(\"number\", \"(3)\") : 3;\nlet ob = { valueOf: () => x };\nlet y = ob <= 123;\ninspect = function() {\n  return y;\n};\n"
  },
  {
    "path": "test/serializer/abstract/ImplicitAbstractConversion26.js",
    "content": "let x = global.__abstract ? __abstract(\"number\", \"(3)\") : 3;\nlet ob = { valueOf: () => x };\nlet y = ob <= \"123\";\ninspect = function() {\n  return y;\n};\n"
  },
  {
    "path": "test/serializer/abstract/ImplicitAbstractConversion27.js",
    "content": "let x = global.__abstract ? __abstract(\"number\", \"(3)\") : 3;\nlet ob = { valueOf: () => x };\nlet y = ob <= \"abc\";\ninspect = function() {\n  return y;\n};\n"
  },
  {
    "path": "test/serializer/abstract/ImplicitAbstractConversion28.js",
    "content": "let y = 3 <= \"abc\";\ninspect = function() {\n  return y;\n};\n"
  },
  {
    "path": "test/serializer/abstract/ImplicitAbstractConversion29.js",
    "content": "let y = 3 <= 5;\ninspect = function() {\n  return y;\n};\n"
  },
  {
    "path": "test/serializer/abstract/ImplicitAbstractConversion3.js",
    "content": "let x = global.__abstract ? __abstract(\"number\", \"3\") : 3;\nlet ob = { valueOf: () => x };\nlet y = 123 - ob;\ninspect = function() {\n  return y;\n};\n"
  },
  {
    "path": "test/serializer/abstract/ImplicitAbstractConversion30.js",
    "content": "let y = 1 >= 3;\ninspect = function() {\n  return y;\n};\n"
  },
  {
    "path": "test/serializer/abstract/ImplicitAbstractConversion31.js",
    "content": "let y = 14 >= 3;\ninspect = function() {\n  return y;\n};\n"
  },
  {
    "path": "test/serializer/abstract/ImplicitAbstractConversion32.js",
    "content": "let x = global.__abstract ? __abstract(\"number\", \"(3)\") : 3;\nlet ob = { valueOf: () => x };\nlet y = 2 ** x;\ninspect = function() {\n  return y;\n};\n"
  },
  {
    "path": "test/serializer/abstract/ImplicitAbstractConversion33.js",
    "content": "let x = global.__abstract ? __abstract(\"number\", \"(3)\") : 3;\nlet ob = { valueOf: () => x };\nlet y = ob ** 2;\ninspect = function() {\n  return y;\n};\n"
  },
  {
    "path": "test/serializer/abstract/ImplicitAbstractConversion36.js",
    "content": "let y = 123 * 4;\ninspect = function() {\n  return y;\n};\n"
  },
  {
    "path": "test/serializer/abstract/ImplicitAbstractConversion4.js",
    "content": "let x = global.__abstract ? __abstract(\"number\", \"(3)\") : 3;\nlet ob = { valueOf: () => x };\nlet y = 123 > ob;\ninspect = function() {\n  return y;\n};\n"
  },
  {
    "path": "test/serializer/abstract/ImplicitAbstractConversion5.js",
    "content": "let x = global.__abstract ? __abstract(\"number\", \"(3)\") : 3;\nlet ob = { valueOf: () => x };\nlet y = 2 ** ob;\ninspect = function() {\n  return y;\n};\n"
  },
  {
    "path": "test/serializer/abstract/ImplicitAbstractConversion6.js",
    "content": "let x = global.__abstract ? __abstract(\"number\", \"(3)\") : 3;\nlet ob = { valueOf: () => x };\nlet y = 2 == ob;\ninspect = function() {\n  return y;\n};\n"
  },
  {
    "path": "test/serializer/abstract/ImplicitAbstractConversion7.js",
    "content": "let x = global.__abstract ? __abstract(\"number\", \"(3)\") : 3;\nlet ob = { valueOf: () => x };\nlet y = ob == 2;\ninspect = function() {\n  return y;\n};\n"
  },
  {
    "path": "test/serializer/abstract/ImplicitAbstractConversion8.js",
    "content": "let x = global.__abstract ? __abstract(\"number\", \"(3)\") : 3;\nlet ob = { valueOf: () => x };\nlet y = x ** 2;\ninspect = function() {\n  return y;\n};\n"
  },
  {
    "path": "test/serializer/abstract/ImplicitAbstractConversion9.js",
    "content": "let x = global.__abstract ? __abstract(\"number\", \"(3)\") : 3;\nlet ob = { valueOf: () => x };\nlet y = x < 2;\ninspect = function() {\n  return y;\n};\n"
  },
  {
    "path": "test/serializer/abstract/Implies.js",
    "content": "var t1 = global.__abstract ? __abstract(\"boolean\", \"true\") : true;\nvar t2 = global.__abstract ? __abstract(\"boolean\", \"(true)\") : true;\nvar f1 = global.__abstract ? __abstract(\"boolean\", \"false\") : false;\nvar f2 = global.__abstract ? __abstract(\"boolean\", \"(false)\") : false;\nvar ob = global.__abstract ? __abstract({}, \"({})\") : {};\n\nlet c1 = t1 ? 1 : 2;\nlet c2 = t2 ? 3 : 4;\nlet alwayst = c1 < c2;\nlet alwaysf = c1 > c2;\n\nlet v1 = t1 && c1;\nlet v1a = t1 || c1;\nlet v1f = !t1 && c1;\nlet v1fa = !t1 || c1;\nlet v1ob = ob && c1;\n\nlet v2 = t1 && t2 && alwayst;\nlet v2a = t1 && (t2 || alwayst);\nlet v2f = !t1 && t2 && alwaysf;\nlet v2fa = !t1 && (t2 || alwaysf);\nlet v2fa2 = !t1 && (t2 && alwaysf);\nlet v2fa3 = !t1 && (c1 === 2 || f2);\n\nlet v3 = !t1;\nlet v4 = !(t1 ? t2 : f2);\nlet v5 = !(t1 ? alwayst : f2);\nlet v6 = !(t1 ? alwaysf : t2);\nlet v7 = t2 ? false : true;\nlet v8 = ob && {};\n\nlet v9 = alwayst && t1;\nlet v9a = alwaysf && t1;\nlet v10 = alwayst || t1;\nlet v10a = alwaysf || t1;\n\nif (t1) {\n  var x1 = v1;\n  x1a = v1a;\n  x1f = v1f;\n  x1fa = v1fa;\n  x1ob = v1ob;\n\n  var x2 = v2;\n  x2a = v2a;\n  x2f = v2f;\n  x2fa = v2fa;\n  x2fa2 = v2fa2;\n  x2fa3 = v2fa3;\n\n  var x3 = v3;\n  var x4 = v4;\n  var x5 = v5;\n  var x6 = v6;\n  var x7 = v7;\n  var x8 = v8;\n\n  var x9 = v9;\n  var x9a = v9a;\n  var x10 = v10;\n  var x10a = v10a;\n}\n\ninspect = function() {\n  return \"\" + x1 + x2 + x3 + x4 + x5 + x6 + x7 + x8 + x9 + x9a + x10 + x10a;\n};\n"
  },
  {
    "path": "test/serializer/abstract/In.js",
    "content": "// throws introspection error\nlet x = __abstract(\"boolean\", \"true\");\nlet ob = { a: 1 };\nif (x) {\n  delete ob.a;\n}\nz = \"a\" in ob;\n"
  },
  {
    "path": "test/serializer/abstract/In2.js",
    "content": "// throws introspection error\n\nvar b = global.__abstract ? __abstract(\"boolean\", \"true\") : true;\nvar p = global.__abstract ? __abstract(\"string\", '(\"abc\")') : \"abc\";\n\nvar x1 = \"xyz\" in {};\ntry {\n  x2 = \"xyz\" in b;\n} catch (err) {\n  if (err instanceof TypeError) x2 = true;\n}\ntry {\n  var x3 = p in b;\n} catch (err) {\n  if (err instanceof TypeError) x3 = true;\n}\n\ninspect = function() {\n  return \"\" + x1 + x3;\n};\n"
  },
  {
    "path": "test/serializer/abstract/In3.js",
    "content": "// throws introspection error\n\nvar b = global.__abstract ? __abstract(\"boolean\", \"true\") : true;\nvar a0 = { \"4\": 5 };\nvar a1 = global.__abstract ? __abstract(a0, \"({ '4': 5 })\") : a0;\nif (global.__makeSimple) global.__makeSimple(a1);\nvar tArr = new Int8Array(4);\nvar a2 = global.__abstract ? __abstract(tArr, \"tArr\") : tArr;\n\nx0 = \"4\" in a0;\nx1 = \"4\" in a1;\nx2 = \"4\" in a2;\n\ninspect = function() {\n  return \"\" + x0 + x1 + x2;\n};\n"
  },
  {
    "path": "test/serializer/abstract/Instanceof1.js",
    "content": "// throws introspection error\n\nfunction foo() {}\nObject.defineProperty(foo, Symbol.hasInstance, {\n  value: function() {\n    throw 123;\n  },\n});\nvar o = global.__abstract ? __abstract(\"object\", \"({})\") : {};\n\ntry {\n  x1 = o instanceof foo;\n} catch (err) {\n  x1 = err;\n}\n\ninspect = function() {\n  return \"\" + x1;\n};\n"
  },
  {
    "path": "test/serializer/abstract/Instanceof2.js",
    "content": "// throws introspection error\n\nvar b = global.__abstract ? __abstract(\"boolean\", \"true\") : true;\nvar o = global.__abstract ? __abstract(\"object\", \"({})\") : {};\n\ntry {\n  x1 = o instanceof b;\n} catch (err) {\n  x1 = err;\n}\n\ninspect = function() {\n  return \"\" + x1;\n};\n"
  },
  {
    "path": "test/serializer/abstract/Instanceof3.js",
    "content": "// throws introspection error\n\nfunction foo() {}\nObject.defineProperty(foo, Symbol.hasInstance, {\n  value: function() {\n    throw 123;\n  },\n});\nvar f = global.__abstract ? __abstract(\"function\", \"foo\") : foo;\nvar o = global.__abstract ? __abstract(\"object\", \"({})\") : {};\n\ntry {\n  x1 = o instanceof f;\n} catch (err) {\n  x1 = err;\n}\n\ninspect = function() {\n  return \"\" + x1;\n};\n"
  },
  {
    "path": "test/serializer/abstract/InternalProps.js",
    "content": "let x = global.__abstract ? __abstract(\"boolean\", \"true\") : true;\n\nlet ob = {};\nif (!x) {\n  Object.setPrototypeOf(ob, { a: 1 });\n} else {\n  Object.setPrototypeOf(ob, { a: 2 });\n}\n\nvar z = ob.a;\n\ninspect = function() {\n  return z;\n};\n"
  },
  {
    "path": "test/serializer/abstract/IntrinsicObjectCSE.js",
    "content": "// add at runtime:global.ob = { foo: { a: {} }, bar: { b: {} } };\nif (global.__abstract) {\n  __assumeDataProperty(\n    this,\n    \"ob\",\n    __abstract({\n      foo: __abstract({ a: __abstract({}) }),\n      bar: __abstract({ b: __abstract({}) }),\n    })\n  );\n}\n\nlet x = ob.foo.a;\nlet y = ob.bar.b;\n\ninspect = function() {\n  return x === y;\n};\n"
  },
  {
    "path": "test/serializer/abstract/IntrinsicUnion.js",
    "content": "// add at runtime:global.ob = { foo: { a: { toString: function() { return \"foo.a\"; }} }, bar: { b: {} } };\n// does not contain:1 : 2\nif (global.__abstract) {\n  __assumeDataProperty(\n    this,\n    \"ob\",\n    __abstract({\n      foo: __abstract({ a: __abstractOrUndefined({}) }),\n      bar: __abstract({ b: __abstractOrNullOrUndefined({}) }),\n    })\n  );\n}\n\nlet x = ob.foo.a;\nlet y = ob.bar.b;\n\nlet x2;\nif (x !== undefined) {\n  x2 = !x ? 1 : 2; // if x is properly a union of undefined and object, then !x should be false here\n}\n\ninspect = function() {\n  return x === y && x2 === 2;\n};\n"
  },
  {
    "path": "test/serializer/abstract/IntrinsicUnion2.js",
    "content": "// omit invariants\n// add at runtime:global.obj={};\nif (global.__assumeDataProperty) __assumeDataProperty(global, \"obj\", __abstractOrNull(\"object\"));\nif (global.__assumeDataProperty) __assumeDataProperty(global, \"inspect\", undefined);\nif (global.__makePartial) __makePartial(global);\n\nlet res;\nif (global.obj) res = global.obj;\nlet x = !!res ? (res ? {} : undefined) : null;\nlet y = !!(!res ? null : {});\nlet z = y ? (!res ? 1 : 2) : 3;\ninspect = function() {\n  return res + \" \" + x + \" \" + y + \" \" + z;\n};\n"
  },
  {
    "path": "test/serializer/abstract/InvariantsForNonAbstractProperties.js",
    "content": "// add at runtime:global.a = {p: 42, q: global, r: function() {}};\n// Count of Prepack model invariant violation:5\n(function() {\n  if (global.__assumeDataProperty)\n    __assumeDataProperty(global, \"a\", __abstract({ p: 42, q: global, r: function() {}, s: undefined }));\n  global.ap = a.p;\n  global.aq = a.q;\n  global.ar = a.r;\n  global.as = a.s;\n  inspect = function() {\n    return global.ap;\n  };\n})();\n"
  },
  {
    "path": "test/serializer/abstract/IsPrototypeOf.js",
    "content": "// throws introspection error\n\nlet x = global.__abstract ? __abstract(\"boolean\", \"true\") : true;\nlet ob = global.__makePartial ? __makeSimple(__makePartial({})) : {};\n\nlet p = x ? {} : ob.p;\n\ny = Object.prototype.isPrototypeOf(p);\n\ninspect = function() {\n  return \"\" + y;\n};\n"
  },
  {
    "path": "test/serializer/abstract/Issue2327InBinop.js",
    "content": "// expected RecoverableError: PP0004\n\nlet o = global.__abstractOrNull ? __abstractOrNull(\"object\", \"undefined\") : undefined;\nlet s = true;\n\nif (o != undefined) s = \"foobar\" in o;\nif (o != undefined) s = \"foobar\" in o;\n\nglobal.s = s;\n\ninspect = () => s; // Should be true\n"
  },
  {
    "path": "test/serializer/abstract/Issue2327InBinopUnconditional.js",
    "content": "// Copies of \"foobar\" in:1\n// expected RecoverableError: PP0004\n\nlet o = global.__abstract ? __abstract(\"object\", \"('foobar42')\") : \"foobar42\";\nlet s = true;\n\nif (o != undefined) s = \"foobar\" in o;\nif (o != undefined) s = \"foobar\" in o;\n\nglobal.s = s;\n\ninspect = () => s; // Should be true\n"
  },
  {
    "path": "test/serializer/abstract/Issue2327InstanceOfBinop.js",
    "content": "// expected RecoverableError: PP0004\n\nlet o = global.__abstractOrNull ? __abstractOrNull(\"object\", \"undefined\") : undefined;\nlet s = true;\n\nif (o != undefined) s = \"foobar\" instanceof o;\nif (o != undefined) s = \"foobar\" instanceof o;\n\nglobal.s = s;\n\ninspect = () => s; // Should be true\n"
  },
  {
    "path": "test/serializer/abstract/Issue2327InstanceOfBinopUnconditional.js",
    "content": "// Copies of \"foobar\" instanceof:1\n// expected RecoverableError: PP0004\n\nlet o = global.__abstract ? __abstract(\"object\", \"({})\") : {};\nlet s = true;\n\nif (o != undefined) s = \"foobar\" instanceof o;\nif (o != undefined) s = \"foobar\" instanceof o;\n\nglobal.s = s;\n\ninspect = () => s; // Should be true\n"
  },
  {
    "path": "test/serializer/abstract/Issue2327StringLength.js",
    "content": "let o = global.__abstractOrNull ? __abstractOrNull(\"string\", \"undefined\") : undefined;\nlet s;\n\nif (o != undefined) s = 5 + o.length;\nif (o != undefined) s = 7 + o.length;\n\nglobal.s = s;\n\ninspect = () => s;\n"
  },
  {
    "path": "test/serializer/abstract/Issue2327StringLengthUnconditional.js",
    "content": "// Copies of length:1\n\nlet o = global.__abstract ? __abstract(\"string\", \"('xyz')\") : \"xyz\";\nlet s;\n\nif (o != undefined) s = 5 + o.length;\nif (o != undefined) s = 7 + o.length;\n\nglobal.s = s;\n\ninspect = () => s;\n"
  },
  {
    "path": "test/serializer/abstract/Issue2327StringSlice.js",
    "content": "let o = global.__abstractOrNull ? __abstractOrNull(\"string\", \"undefined\") : undefined;\nlet s = \"ok\";\n\nif (o != undefined) s = \"X\" + o.slice(3);\nif (o != undefined) s = \"Y\" + o.slice(3);\n\nglobal.s = s;\n\ninspect = () => s;\n"
  },
  {
    "path": "test/serializer/abstract/Issue2327StringSliceUnconditional.js",
    "content": "// Copies of slice\\(:1\n\n(function() {\n  let o = global.__abstract ? __abstract(\"string\", \"('x y z')\") : \"x y z\";\n  let c = global.__abstract ? __abstract(\"boolean\", \"true\") : true;\n  let s = \"ok\";\n\n  if (c) s = \"X\" + o.slice(3);\n  if (c) s = \"Y\" + o.slice(3);\n\n  global.s = s;\n  inspect = () => s;\n})();\n"
  },
  {
    "path": "test/serializer/abstract/Issue2327StringSplit.js",
    "content": "let o = global.__abstractOrNull ? __abstractOrNull(\"string\", \"undefined\") : undefined;\nlet s = \"ok\";\n\nif (o != undefined) s = o.split();\nif (o != undefined) s = o.split();\n\nglobal.s = s;\n\ninspect = () => s;\n"
  },
  {
    "path": "test/serializer/abstract/JSONStringifyOnAbstract2411.js",
    "content": "// throws introspection error\n//\n(function() {\n  let o = __abstract(\"object\", \"(o)\");\n  let s;\n  s = \"A\" + JSON.stringify(o);\n\n  global.s = s;\n})();\n"
  },
  {
    "path": "test/serializer/abstract/JSONparse.js",
    "content": "// add at runtime: let t = { x: 1 };\nlet ob = global.__abstract ? __abstract({ x: 1 }, \"t\") : { x: 1 };\nvar str = JSON.stringify(ob);\nob.x = 3;\nlet ob2 = JSON.parse(str);\nlet ob2x = ob2.x;\nob2.x++;\nx = ob2.x;\nlet ob3 = JSON.parse(str);\ny = ob3.x;\nvar z = ob2x;\n\ninspect = function() {\n  return \"\" + str + ob.x + ob2.x + ob3.x + z;\n};\n"
  },
  {
    "path": "test/serializer/abstract/JSONparse2.js",
    "content": "let ob = global.__makePartial ? __makePartial({ x: 1 }) : { x: 1 };\nvar str = JSON.stringify(ob);\nob.x = 3;\nlet ob2 = JSON.parse(str);\nlet ob2x = ob2.x;\nob2.x++;\nx = ob2.x;\nlet ob3 = JSON.parse(str);\ny = ob3.x;\nvar z = ob2x;\n\ninspect = function() {\n  return \"\" + str + ob.x + ob2.x + ob3.x + z;\n};\n"
  },
  {
    "path": "test/serializer/abstract/ListOperationsCommentBubble.js",
    "content": "function createAttributedComment(props) {\n  let body = getBody(props);\n  let _ranges;\n  let ranges;\n\n  if (body && body.ranges) {\n    _ranges = body.ranges.filter(r => r.entity.__typename).map(r => ({\n      location: Number(r.offset),\n      length: Number(r.length),\n      decorationLine: r.entity.__typename.includes(\"User\") ? \"none\" : \"underline\",\n    }));\n  } else {\n    _ranges = [];\n  }\n\n  if (body && body.delight_ranges) {\n    let reduce_fn = (acc, x) => {\n      let color_style = x.campaign.comment_styles.find(cs => cs.style.includes(\"color\"));\n      let font_style = x.campaign.comment_styles.find(cs => cs.style.includes(\"font-weight\"));\n      if (color_style && font_style) {\n        let color = color_style.value;\n        let font = font_style.value;\n        return acc.concat({ location: Number(x.offset), length: Number(x.length), font: font, color: color });\n      } else return acc;\n    };\n    ranges = body.delight_ranges.reduce(reduce_fn, _ranges);\n  }\n\n  return {\n    text: body.text || \"\",\n    ranges: ranges,\n  };\n}\n\nfunction getBody(props) {\n  if (props.showTranslatedBody && props.comment.translated_body_for_viewer !== null) {\n    return props.comment.translated_body_for_viewer;\n  } else if (props.comment.body !== null) {\n    return props.comment.body;\n  } else return null;\n}\n\nglobal.__optimize && __optimize(createAttributedComment);\n\ninspect = () => {\n  let test_props = {\n    comment: {\n      body: {\n        text: \"Magnificent comment\",\n        ranges: [\n          {\n            entity: { __typename: [\"User\", \"Page\"] },\n            offset: 0,\n            length: 5,\n          },\n          {\n            entity: { __typename: [\"Page\"] },\n            offset: 0,\n            length: 5,\n          },\n          {\n            entity: {},\n            offset: 0,\n            length: 5,\n          },\n          {\n            entity: { __typename: [\"User\"] },\n            offset: 0,\n            length: 5,\n            campaign: { comment_styles: [{ style: [\"color\"], value: 7 }] },\n          },\n        ],\n        delight_ranges: [\n          {\n            offset: 0,\n            length: 5,\n            campaign: { comment_styles: [{ style: [\"color\"], value: 7 }, { style: [\"font-weight\"], value: 7 }] },\n          },\n          {\n            offset: 0,\n            length: 5,\n            campaign: { comment_styles: [{ style: [\"color\"], value: 7 }, { style: [\"font-weight\"], value: 7 }] },\n          },\n          {\n            offset: 0,\n            length: 5,\n            campaign: { comment_styles: [{ style: [\"color\"], value: 7 }, { style: [\"font-weight\"], value: 7 }] },\n          },\n        ],\n      },\n    },\n  };\n  return createAttributedComment(test_props);\n};\n"
  },
  {
    "path": "test/serializer/abstract/ListOperationsSimple.js",
    "content": "function foo(y) {\n  let inc = x => x + 1;\n  return y.map(inc);\n}\n\nglobal.__optimize && __optimize(foo);\n\ninspect = () => {\n  return foo([7, 8, 9, 10]);\n};\n"
  },
  {
    "path": "test/serializer/abstract/LogicalExpression.js",
    "content": "let x = global.__abstract ? __abstract(\"boolean\", \"true\") : true;\nlet y = global.__abstract ? __abstract(\"boolean\", \"true !== true\") : false;\nvar z = x && y;\nvar z0 = y || x;\n\nlet ob = global.__abstract ? __abstract(\"object\", \"({})\") : {};\nvar z1 = ob && 3;\nvar z2 = ob && y;\nvar z3 = false || ob || y;\n\nlet a = 111;\nlet b = y || (a = 123);\nvar z4 = a;\n\nvar z5 = 444;\nlet c = x && (z5 = 456);\n\nvar z6 = 444;\nlet d = y && (z6 = 456);\n\nvar z7 = 777;\nlet e = x || (z7 = 789);\n\nvar z8 = 777;\nlet f = y || (z8 = 789);\n\nlet g = true || (z8 = 111);\n\ninspect = function() {\n  return \"\" + z + z0 + z1 + z2 + z3 + z4 + z5 + z6 + z7 + z8;\n};\n"
  },
  {
    "path": "test/serializer/abstract/LogicalExpression2.js",
    "content": "let x = global.__abstract ? __abstract(\"boolean\", \"true\") : true;\nlet mustBeFalse = (x ? 1 : 2) > (x ? 3 : 4);\nlet mustBeTrue = (x ? 1 : 2) < (x ? 3 : 4);\nlet y = x ? \"abc\" : \"def\";\nlet b = x ? x : false;\nvar z = x && y;\nvar z1 = mustBeFalse || (mustBeFalse && y);\nvar z2 = x && y && \"xxx\";\nvar z3;\nvar z4;\nif (x || \"yyy\") z3 = \"zzz\";\nelse z3 = \"xyz\";\nif (x || false) z4 = \"zzz\";\nelse z4 = \"xyz\";\n\ninspect = function() {\n  return \"\" + z + z1 + z2 + z3 + z4;\n};\n"
  },
  {
    "path": "test/serializer/abstract/MakeFinal.js",
    "content": "function fn(abstractFunc) {\n  var x = { a: 2, b: 3 };\n  global.__makeFinal ? global.__makeFinal(x) : Object.freeze(x);\n  abstractFunc(x);\n  return x.a + x.b;\n}\n\nglobal.__optimize && __optimize(fn);\n\nglobal.inspect = function() {\n  return fn(function(x) {\n    // this would never happen, as the object passed\n    // in is final, aka \"frozen\", but it proves the\n    // isFinal logic works\n    x.a = 7;\n  });\n};\n"
  },
  {
    "path": "test/serializer/abstract/Map.js",
    "content": "let x = global.__abstract ? __abstract(\"boolean\", \"true\") : true;\n\nfunction makeMap(b) {\n  let m = new Map();\n  if (b) {\n    m.set(\"a\", 1);\n    m.set(\"foo\", 1);\n    m.set(\"bar\", 2);\n  } else {\n    m.set(\"a\", 2);\n    m.set(\"bar\", 2);\n    m.set(\"foo\", 1);\n  }\n  return m;\n}\n\nlet m1 = makeMap(x);\nlet m2 = makeMap(!x);\n\nvar x1 = m1.get(\"a\");\n\nvar x2 = [];\nfor (let [k, v] of m1) {\n  x2.push([k, v]);\n}\n\nvar x3 = [];\nfor (let [k, v] of m2) {\n  x3.push([k, v]);\n}\n\ninspect = function() {\n  return JSON.stringify([x1, x2, x3]);\n};\n"
  },
  {
    "path": "test/serializer/abstract/MathRound.js",
    "content": "var x = 42.42;\ny = global.__abstract ? __abstract(\"number\", x.toString()) : x;\nvar s = Math.round(y);\ninspect = function() {\n  return s;\n};\n"
  },
  {
    "path": "test/serializer/abstract/MightBeEmptyAssignment.js",
    "content": "(function() {\n  var a = {};\n  var c = global.__abstract ? __abstract(\"boolean\", \"true\") : \"c\";\n  if (c) {\n    a.foo = 42;\n    global.a = a;\n  }\n  inspect = function() {\n    return global.a.foo;\n  };\n})();\n"
  },
  {
    "path": "test/serializer/abstract/ModelFunction.js",
    "content": "// add at runtime: global.fun = console.log;\nvar result = [];\nglobal.log = function(arg) {\n  result.push(arg);\n};\nif (global.__assumeDataProperty) {\n  __assumeDataProperty(\n    global,\n    \"fun\",\n    function(arg1) {\n      __residual(\n        \"void\",\n        function(arg1, console) {\n          console.log(arg1);\n        },\n        arg1,\n        console\n      );\n    },\n    \"VALUE_DEFINED_INVARIANT\"\n  );\n}\n\nglobal.fun(\"literal\");\n\ninspect = function() {\n  return undefined;\n};\n"
  },
  {
    "path": "test/serializer/abstract/ModifiedBindingsCSE.js",
    "content": "// add at runtime:var a = 17;\n// Count of 42:1\n(function() {\n  let a = global.__abstract ? __abstract(\"number\", \"a\") : 17;\n  let b, c, d;\n  global.f = function() {\n    b = a + 42;\n    c = a + 42;\n    d = a + 42;\n  };\n  if (global.__optimize) __optimize(f);\n  inspect = function() {\n    global.f();\n    return b + c + d;\n  };\n})();\n"
  },
  {
    "path": "test/serializer/abstract/MutatingObjectsFromOuterScope.js",
    "content": "(function() {\n  let outer = {};\n  function f(x) {\n    outer.x = x;\n    return outer;\n  }\n  if (global.__optimize) __optimize(f);\n  global.f = f;\n  inspect = function() {\n    return f(42).x;\n  };\n})();\n"
  },
  {
    "path": "test/serializer/abstract/NegateObject.js",
    "content": "y = global.__abstract ? __abstract(\"object\", \"({})\") : {};\nlet z = !y;\nif (global.__isAbstract && __isAbstract(z)) throw new Error(\"bug!\");\nvar x = z;\ninspect = function() {\n  return x;\n};\n"
  },
  {
    "path": "test/serializer/abstract/NestedAbstractProperties.js",
    "content": "let o = global.__abstract\n  ? __abstract(\n      {\n        x: __abstract(\"number\"),\n      },\n      \"({x: 42})\"\n    )\n  : { x: 42 };\nvar a = o.x;\ninspect = function() {\n  return \"\" + a;\n};\n"
  },
  {
    "path": "test/serializer/abstract/NullPrototypePartialKey.js",
    "content": "let s = global.__abstract ? __abstract(\"string\", \"('foo')\") : \"foo\";\n\nlet x = Object.create(null);\nx.a = 1;\nx.b = 2;\n\nlet y = x[s];\n\ninspect = function() {\n  return y;\n};\n"
  },
  {
    "path": "test/serializer/abstract/Number.js",
    "content": "var n = new Number(123);\n\ninspect = function() {\n  return \"\" + n.valueOf() + \" \" + n.toExponential(5);\n};\n"
  },
  {
    "path": "test/serializer/abstract/ObjectAssign.js",
    "content": "let dims = global.__abstract\n  ? __abstract(\n      {\n        window: undefined,\n        screen: undefined,\n        windowPhysicalPixels: __abstract({\n          width: __abstract(\"number\", \"/* windowPhysicalPixels.width = */ 1\"),\n          height: __abstract(\"number\", \"/* windowPhysicalPixels.height = */ 1\"),\n          scale: __abstract(\"number\", \"/* windowPhysicalPixels.scale = */ 2\"),\n          fontScale: __abstract(\"number\", \"/* windowPhysicalPixels.fontScale = */4\"),\n        }),\n        screenPhysicalPixels: __abstract({\n          width: __abstract(\"number\", \"/* screenPhysicalPixels.width = */ 1\"),\n          height: __abstract(\"number\", \"/* screenPhysicalPixels.height = */1\"),\n          scale: __abstract(\"number\", \"/* screenPhysicalPixels.scale = */ 2\"),\n          fontScale: __abstract(\"number\", \"/*screenPhysicalPixels.fontScale = */4\"),\n        }),\n      },\n      `({\n  window: undefined,\n  screen: undefined,\n  windowPhysicalPixels: {\n    width: 1,\n    height: 1,\n    scale: 2,\n    fontScale: 4\n  },\n  screenPhysicalPixels: {\n    width: 1,\n    height: 1,\n    scale: 2,\n    fontScale: 4\n  }\n})`\n    )\n  : {\n      window: undefined,\n      screen: undefined,\n      windowPhysicalPixels: {\n        width: 1,\n        height: 1,\n        scale: 2,\n        fontScale: 4,\n      },\n      screenPhysicalPixels: {\n        width: 1,\n        height: 1,\n        scale: 2,\n        fontScale: 4,\n      },\n    };\n\ndims = JSON.parse(JSON.stringify(dims));\n// Note that the object returned by JSON.parse will never have getters, and it only has well-behaved properties.\n// Prepack already has some magic built-in to preserve the \"template shape\" when cloning an object via parse/stringify.\n\nlet windowPhysicalPixels = dims.windowPhysicalPixels;\ndims.window = {\n  width: windowPhysicalPixels.width / windowPhysicalPixels.scale,\n  height: windowPhysicalPixels.height / windowPhysicalPixels.scale,\n  scale: windowPhysicalPixels.scale,\n  fontScale: windowPhysicalPixels.fontScale,\n};\nlet screenPhysicalPixels = dims.screenPhysicalPixels;\ndims.screen = {\n  width: screenPhysicalPixels.width / screenPhysicalPixels.scale,\n  height: screenPhysicalPixels.height / screenPhysicalPixels.scale,\n  scale: screenPhysicalPixels.scale,\n  fontScale: screenPhysicalPixels.fontScale,\n};\n\ndelete dims.screenPhysicalPixels;\ndelete dims.windowPhysicalPixels;\n\nlet dimensions = {};\n// Object.assign currently triggers introspection error. We need to support this.\nObject.assign(dimensions, dims);\n\n// We also need to allow reading of well-defined properties after Object.assign\nglobal.x = dimensions.window;\nglobal.y = dimensions.screen;\n\ninspect = function() {\n  return JSON.stringify(global.x) + JSON.stringify(global.y);\n};\n"
  },
  {
    "path": "test/serializer/abstract/ObjectAssign10.js",
    "content": "var __evaluatePureFunction = this.__evaluatePureFunction || (f => f());\nvar obj =\n  global.__abstract && global.__makePartial && global.__makeSimple\n    ? __makeSimple(__makePartial(__abstract({}, \"({foo:1})\")))\n    : { foo: 1 };\nvar copyOfCopyOfObj;\n\n__evaluatePureFunction(() => {\n  var copyOfObj = Object.assign({}, obj);\n  copyOfCopyOfObj = Object.assign({}, copyOfObj);\n  copyOfObj.x = 10;\n});\n\ninspect = function() {\n  return JSON.stringify(copyOfCopyOfObj);\n};\n"
  },
  {
    "path": "test/serializer/abstract/ObjectAssign11.js",
    "content": "var __evaluatePureFunction = this.__evaluatePureFunction || (f => f());\nvar obj =\n  global.__abstract && global.__makePartial && global.__makeSimple\n    ? __makeSimple(__makePartial(__abstract({}, \"({foo:1})\")))\n    : { foo: 1 };\nvar copyOfObj;\n\n__evaluatePureFunction(() => {\n  copyOfObj = {};\n  Object.assign(copyOfObj, obj);\n  copyOfObj.x = 10;\n});\n\ninspect = function() {\n  return JSON.stringify(copyOfObj);\n};\n"
  },
  {
    "path": "test/serializer/abstract/ObjectAssign12.js",
    "content": "var __evaluatePureFunction = this.__evaluatePureFunction || (f => f());\nvar obj =\n  global.__abstract && global.__makePartial && global.__makeSimple\n    ? __makeSimple(__makePartial(__abstract({ foo: __abstract(\"number\") }, \"({foo:1})\")))\n    : { foo: 1 };\nvar copyOfObj;\n\n__evaluatePureFunction(() => {\n  copyOfObj = {};\n  Object.assign(copyOfObj, obj);\n  copyOfObj.foo = 2;\n});\n\ninspect = function() {\n  return JSON.stringify(copyOfObj);\n};\n"
  },
  {
    "path": "test/serializer/abstract/ObjectAssign13.js",
    "content": "var __evaluatePureFunction = this.__evaluatePureFunction || (f => f());\nvar obj =\n  global.__abstract && global.__makePartial && global.__makeSimple\n    ? __makeSimple(__makePartial(__abstract({}, \"({foo:1})\")))\n    : { foo: 1 };\nvar copyOfObj;\n\n__evaluatePureFunction(() => {\n  copyOfObj = {};\n  Object.assign(copyOfObj, obj);\n  Object.defineProperty(copyOfObj, \"x\", {\n    enumerable: true,\n    get() {\n      return 10;\n    },\n  });\n});\n\ninspect = function() {\n  return JSON.stringify(copyOfObj);\n};\n"
  },
  {
    "path": "test/serializer/abstract/ObjectAssign14.js",
    "content": "var __evaluatePureFunction = this.__evaluatePureFunction || (f => f());\nvar obj =\n  global.__abstract && global.__makePartial && global.__makeSimple\n    ? __makeSimple(__makePartial(__abstract({ foo: __abstract(\"number\") }, \"({foo:1})\")))\n    : { foo: 1 };\nvar copyOfObj;\n\n__evaluatePureFunction(() => {\n  copyOfObj = {};\n  Object.assign(copyOfObj, obj);\n  copyOfObj.foo = 2;\n});\n\ninspect = function() {\n  return JSON.stringify(copyOfObj);\n};\n"
  },
  {
    "path": "test/serializer/abstract/ObjectAssign15.js",
    "content": "var __evaluatePureFunction = this.__evaluatePureFunction || (f => f());\nvar obj =\n  global.__abstract && global.__makePartial && global.__makeSimple\n    ? __makeSimple(__makePartial(__abstract({ foo: __abstract(\"number\") }, \"({foo:1})\")))\n    : { foo: 1 };\nvar copyOfObj;\nvar y;\n\n__evaluatePureFunction(() => {\n  copyOfObj = {};\n  y = 0;\n  Object.assign(copyOfObj, obj);\n  Object.defineProperty(copyOfObj, \"foo\", {\n    enumerable: true,\n    set() {\n      y = 42;\n    },\n  });\n});\n\ninspect = function() {\n  return JSON.stringify(y);\n};\n"
  },
  {
    "path": "test/serializer/abstract/ObjectAssign16.js",
    "content": "var __evaluatePureFunction = this.__evaluatePureFunction || (f => f());\nvar obj =\n  global.__abstract && global.__makePartial && global.__makeSimple\n    ? __makeSimple(__makePartial(__abstract({ foo: __abstract(\"number\") }, \"({foo:1})\")))\n    : { foo: 1 };\nvar copyOfObj;\n\n__evaluatePureFunction(() => {\n  copyOfObj = {};\n  Object.assign(copyOfObj, obj);\n  delete copyOfObj.foo;\n});\n\ninspect = function() {\n  return JSON.stringify(copyOfObj);\n};\n"
  },
  {
    "path": "test/serializer/abstract/ObjectAssign17.js",
    "content": "var __evaluatePureFunction = this.__evaluatePureFunction || (f => f());\nvar obj =\n  global.__abstract && global.__makePartial && global.__makeSimple\n    ? __makeSimple(__makePartial(__abstract({}, \"({foo:1})\")))\n    : { foo: 1 };\nvar copyOfObj;\nvar y;\n\n__evaluatePureFunction(() => {\n  copyOfObj = {};\n  y = 0;\n\n  Object.assign(copyOfObj, obj);\n\n  var proto = {};\n  Object.defineProperty(proto, \"foo\", {\n    enumerable: true,\n    set() {\n      y = 42;\n    },\n  });\n  copyOfObj.__proto__ = proto;\n});\n\ninspect = function() {\n  return JSON.stringify(y);\n};\n"
  },
  {
    "path": "test/serializer/abstract/ObjectAssign18.js",
    "content": "// does contain: 1002\nvar obj =\n  global.__abstract && global.__makePartial && global.__makeSimple\n    ? __makeSimple(__makePartial(__abstract({}, \"({foo:1})\")))\n    : { foo: 1 };\nvar copyOfObj = Object.assign({}, obj, { foo: 2 });\nlet foo = copyOfObj.foo + 1000;\n\ninspect = function() {\n  return foo + \" \" + JSON.stringify(copyOfObj);\n};\n"
  },
  {
    "path": "test/serializer/abstract/ObjectAssign19.js",
    "content": "var __evaluatePureFunction = this.__evaluatePureFunction || (f => f());\nvar obj =\n  global.__abstract && global.__makePartial && global.__makeSimple\n    ? __makeSimple(__makePartial(__abstract({}, \"({foo:1})\")))\n    : { foo: 1 };\n\nvar copyOfObj;\n__evaluatePureFunction(() => {\n  copyOfObj = Object.assign({}, obj, { foo: 2 });\n});\n\ninspect = function() {\n  return JSON.stringify(copyOfObj);\n};\n"
  },
  {
    "path": "test/serializer/abstract/ObjectAssign2.js",
    "content": "let dims = {\n  window: undefined,\n  screen: undefined,\n  windowPhysicalPixels: {\n    width: 1,\n    height: 1,\n    scale: 2,\n    fontScale: 4,\n  },\n  screenPhysicalPixels: {\n    width: 1,\n    height: 1,\n    scale: 2,\n    fontScale: 4,\n  },\n};\n\nif (global.__makeSimple) __makeSimple(dims);\nif (global.__makePartial) __makePartial(dims);\n\nlet windowPhysicalPixels = dims.windowPhysicalPixels;\ndims.window = {\n  width: windowPhysicalPixels.width / windowPhysicalPixels.scale,\n  height: windowPhysicalPixels.height / windowPhysicalPixels.scale,\n  scale: windowPhysicalPixels.scale,\n  fontScale: windowPhysicalPixels.fontScale,\n};\nlet screenPhysicalPixels = dims.screenPhysicalPixels;\ndims.screen = {\n  width: screenPhysicalPixels.width / screenPhysicalPixels.scale,\n  height: screenPhysicalPixels.height / screenPhysicalPixels.scale,\n  scale: screenPhysicalPixels.scale,\n  fontScale: screenPhysicalPixels.fontScale,\n};\n\ndelete dims.screenPhysicalPixels;\ndelete dims.windowPhysicalPixels;\n\nlet dimensions = {};\nObject.assign(dimensions, dims);\n\n// We also need to allow reading of well-defined properties after Object.assign\nglobal.x = dimensions.window;\nglobal.y = dimensions.screen;\n\ninspect = function() {\n  return JSON.stringify(global.x) + JSON.stringify(global.y);\n};\n"
  },
  {
    "path": "test/serializer/abstract/ObjectAssign20.js",
    "content": "// abstract effects\n\nvar __evaluatePureFunction = this.__evaluatePureFunction || (f => f());\nvar obj =\n  global.__abstract && global.__makePartial && global.__makeSimple\n    ? __makeSimple(__makePartial(__abstract({}, \"({foo:1})\")))\n    : { foo: 1 };\nvar b = global.__abstract ? global.__abstract(\"boolean\", \"(true)\") : true;\n\nvar copyOfObj = {};\n__evaluatePureFunction(() => {\n  if (b) Object.assign(copyOfObj, obj, { foo: 2 });\n  else {\n    Object.assign(copyOfObj, obj, { foo: 3 });\n  }\n});\n\ninspect = function() {\n  return JSON.stringify(copyOfObj);\n};\n"
  },
  {
    "path": "test/serializer/abstract/ObjectAssign3.js",
    "content": "let ob = global.__abstract ? __abstract({ p: 1 }, \"({p: 1})\") : { p: 1 };\nif (global.__makeSimple) __makeSimple(ob);\n\nObject.assign = function(target, sources) {\n  for (let nextIndex = 1; nextIndex < arguments.length; nextIndex++) {\n    let nextSource = arguments[nextIndex];\n    if (nextSource == null) continue;\n    for (var key in nextSource) {\n      target[key] = nextSource[key];\n    }\n  }\n\n  return target;\n};\n\nglobal.z = Object.assign({}, ob);\n\ninspect = function() {\n  return global.z.p;\n};\n"
  },
  {
    "path": "test/serializer/abstract/ObjectAssign4.js",
    "content": "var obj =\n  global.__abstract && global.__makePartial && global.__makeSimple\n    ? __makeSimple(__makePartial(__abstract({}, \"({foo:1})\")))\n    : { foo: 1 };\nvar copyOfObj = Object.assign({}, obj);\n\ninspect = function() {\n  return JSON.stringify(copyOfObj);\n};\n"
  },
  {
    "path": "test/serializer/abstract/ObjectAssign5.js",
    "content": "var obj =\n  global.__abstract && global.__makePartial && global.__makeSimple\n    ? __makeSimple(__makePartial(__abstract({}, \"({foo:1})\")))\n    : { foo: 1 };\nvar copyOfObj = Object.assign({}, obj);\nvar copyOfCopyOfObj = Object.assign({}, copyOfObj);\n\ninspect = function() {\n  return JSON.stringify(copyOfCopyOfObj);\n};\n"
  },
  {
    "path": "test/serializer/abstract/ObjectAssign6.js",
    "content": "var __evaluatePureFunction = this.__evaluatePureFunction || (f => f());\nvar obj =\n  global.__abstract && global.__makePartial && global.__makeSimple\n    ? __makeSimple(__makePartial(__abstract({}, \"({foo:1})\")))\n    : { foo: 1 };\nvar copyOfObj;\n\n__evaluatePureFunction(() => {\n  copyOfObj = Object.assign({}, obj, { foo: 2 });\n});\n\ninspect = function() {\n  return JSON.stringify(copyOfObj);\n};\n"
  },
  {
    "path": "test/serializer/abstract/ObjectAssign7.js",
    "content": "var __evaluatePureFunction = this.__evaluatePureFunction || (f => f());\nvar obj =\n  global.__abstract && global.__makePartial && global.__makeSimple\n    ? __makeSimple(__makePartial(__abstract({}, \"({foo:1})\")))\n    : { foo: 1 };\nvar copyOfObj;\n\n__evaluatePureFunction(() => {\n  copyOfObj = Object.assign({}, { foo: 2 }, obj);\n});\n\ninspect = function() {\n  return JSON.stringify(copyOfObj);\n};\n"
  },
  {
    "path": "test/serializer/abstract/ObjectAssign8.js",
    "content": "var __evaluatePureFunction = this.__evaluatePureFunction || (f => f());\nvar obj =\n  global.__abstract && global.__makePartial && global.__makeSimple\n    ? __makeSimple(__makePartial(__abstract({}, \"({foo:1})\")))\n    : { foo: 1 };\nvar x;\n\n__evaluatePureFunction(() => {\n  x = {};\n  var y = {};\n  Object.assign(x, obj, y, { bar: 2 });\n  y.foo = 2;\n});\n\ninspect = function() {\n  return JSON.stringify(x);\n};\n"
  },
  {
    "path": "test/serializer/abstract/ObjectAssign9.js",
    "content": "var __evaluatePureFunction = this.__evaluatePureFunction || (f => f());\n__evaluatePureFunction(() => {\n  let dims = global.__abstract\n    ? __abstract(\n        {\n          window: undefined,\n          screen: undefined,\n          windowPhysicalPixels: __abstract({\n            width: __abstract(\"number\", \"/* windowPhysicalPixels.width = */ 1\"),\n            height: __abstract(\"number\", \"/* windowPhysicalPixels.height = */ 1\"),\n            scale: __abstract(\"number\", \"/* windowPhysicalPixels.scale = */ 2\"),\n            fontScale: __abstract(\"number\", \"/* windowPhysicalPixels.fontScale = */4\"),\n          }),\n          screenPhysicalPixels: __abstract({\n            width: __abstract(\"number\", \"/* screenPhysicalPixels.width = */ 1\"),\n            height: __abstract(\"number\", \"/* screenPhysicalPixels.height = */1\"),\n            scale: __abstract(\"number\", \"/* screenPhysicalPixels.scale = */ 2\"),\n            fontScale: __abstract(\"number\", \"/*screenPhysicalPixels.fontScale = */4\"),\n          }),\n        },\n        `({\n    window: undefined,\n    screen: undefined,\n    windowPhysicalPixels: {\n      width: 1,\n      height: 1,\n      scale: 2,\n      fontScale: 4\n    },\n    screenPhysicalPixels: {\n      width: 1,\n      height: 1,\n      scale: 2,\n      fontScale: 4\n    }\n  })`\n      )\n    : {\n        window: undefined,\n        screen: undefined,\n        windowPhysicalPixels: {\n          width: 1,\n          height: 1,\n          scale: 2,\n          fontScale: 4,\n        },\n        screenPhysicalPixels: {\n          width: 1,\n          height: 1,\n          scale: 2,\n          fontScale: 4,\n        },\n      };\n\n  dims = JSON.parse(JSON.stringify(dims));\n  // Note that the object returned by JSON.parse will never have getters, and it only has well-behaved properties.\n  // Prepack already has some magic built-in to preserve the \"template shape\" when cloning an object via parse/stringify.\n\n  let windowPhysicalPixels = dims.windowPhysicalPixels;\n  dims.window = {\n    width: windowPhysicalPixels.width / windowPhysicalPixels.scale,\n    height: windowPhysicalPixels.height / windowPhysicalPixels.scale,\n    scale: windowPhysicalPixels.scale,\n    fontScale: windowPhysicalPixels.fontScale,\n  };\n  let screenPhysicalPixels = dims.screenPhysicalPixels;\n  dims.screen = {\n    width: screenPhysicalPixels.width / screenPhysicalPixels.scale,\n    height: screenPhysicalPixels.height / screenPhysicalPixels.scale,\n    scale: screenPhysicalPixels.scale,\n    fontScale: screenPhysicalPixels.fontScale,\n  };\n\n  delete dims.screenPhysicalPixels;\n  delete dims.windowPhysicalPixels;\n\n  let dimensions = {};\n  Object.assign(dimensions, dims);\n  dimensions.extra = \"hello\";\n\n  inspect = function() {\n    return Object.keys(dimensions).join(\",\");\n  };\n});\n"
  },
  {
    "path": "test/serializer/abstract/ObjectCreate.js",
    "content": "// throws introspection error\n\nlet x = global.__abstract ? __abstract(\"boolean\", \"true\") : true;\nlet ob = global.__abstract ? __abstract(\"object\", \"({})\") : {};\nif (global.__makeSimple) global.__makeSimple(ob);\n\nlet p = x ? undefined : ob.p;\n\nvar y = Object.create(Object.prototype, p);\n\ninspect = function() {\n  return \"\" + y;\n};\n"
  },
  {
    "path": "test/serializer/abstract/ObjectExpression.js",
    "content": "let x = global.__abstract ? __abstract(\"boolean\", \"true\") : true;\nlet p = x ? \"x\" : \"y\";\nlet q = x ? \"y\" : \"z\";\nlet r = x ? \"f\" : \"g\";\n\nvar ob = { [p]: 1, [q]: 2 };\nvar ob2 = { [r]: function() {} };\n\ninspect = function() {\n  return ob.x + \" \" + ob.y + \" \" + ob2.f.name;\n};\n"
  },
  {
    "path": "test/serializer/abstract/Optional.js",
    "content": "function f() {\n  return 123;\n}\nvar g = global.__abstractOrNull ? __abstractOrNull(\"function\", \"null\") : null;\nvar z = undefined;\nif (g !== null) z = g();\n\ninspect = function() {\n  return \"\" + z;\n};\n"
  },
  {
    "path": "test/serializer/abstract/Optional2.js",
    "content": "function f() {\n  return 123;\n}\nvar g = global.__abstractOrUndefined ? __abstractOrUndefined(\"function\", \"f\") : f;\nif (g != null) {\n  var z = g();\n}\n\ninspect = function() {\n  return \"\" + z;\n};\n"
  },
  {
    "path": "test/serializer/abstract/Optional3.js",
    "content": "// Copies of f;:2\nfunction f() {\n  return 123;\n}\nvar g = global.__abstractOrNullOrUndefined ? __abstractOrNullOrUndefined(\"function\", \"f\") : f;\nvar z = g && g();\n\ninspect = function() {\n  return \"\" + z;\n};\n"
  },
  {
    "path": "test/serializer/abstract/Optional4.js",
    "content": "var g = global.__abstractOrNull ? __abstractOrNull(\"function\", \"null\") : null;\nvar z = g && g();\n\ninspect = function() {\n  return \"\" + z;\n};\n"
  },
  {
    "path": "test/serializer/abstract/Optional5.js",
    "content": "// add at runtime: let x = { items: \"abc\" };\nlet x = { items: \"abc\" };\nlet y = global.__abstractOrUndefined ? __abstractOrUndefined(x, \"x\") : x;\n\nfunction getCollectionData(collection) {\n  return {\n    filter: true,\n    collection: collection != null && collection.items,\n  };\n}\n\nvar z = getCollectionData(y);\n\ninspect = function() {\n  return JSON.stringify(z);\n};\n"
  },
  {
    "path": "test/serializer/abstract/OrdinaryToPrimitive.js",
    "content": "// throws introspection error\nlet x = {\n  toString() {\n    return Math.random() ? \"a\" : \"b\";\n  },\n};\nnew Date(x);\n"
  },
  {
    "path": "test/serializer/abstract/OwnKeys.js",
    "content": "// throws introspection error\nlet x = __abstract(\"boolean\", \"true\");\nlet ob = { a: 1 };\nif (x) {\n  delete ob.a;\n}\nlet keys = Reflect.ownKeys(ob);\nconsole.log(keys[0]);\n"
  },
  {
    "path": "test/serializer/abstract/PathConditions.js",
    "content": "// does not contain:|| 3 ===\nlet n1 = global.__abstract ? __abstract(\"number\", \"1\") : 1;\n\nfunction f1() {\n  if (n1 === 1) return 10;\n  if (n1 === 2) throw 20;\n  if (n1 === 3) return 30;\n  throw 40;\n}\n\ntry {\n  var x = f1();\n  if (n1 === 2) console.log(200);\n  if (n1 === 1 || n1 === 3) console.log(300);\n} catch (e) {\n  x = e;\n}\n\ninspect = function() {\n  return x;\n};\n"
  },
  {
    "path": "test/serializer/abstract/PathConditions2.js",
    "content": "let n1 = global.__abstract ? __abstract(\"number\", \"1\") : 1;\n\nfunction f1() {\n  if (n1 > 10) {\n    if (n1 > 20) {\n      throw 100;\n    } else {\n      return 200;\n    }\n  } else {\n    if (n1 > 3) {\n      if (n1 > 4) {\n        throw 300;\n      } else {\n        return 400;\n      }\n    } else {\n      if (n1 > 2) {\n        return 500;\n      }\n    }\n  }\n}\n\nvar x = f1();\n\ninspect = function() {\n  return x;\n};\n"
  },
  {
    "path": "test/serializer/abstract/PathConditions3.js",
    "content": "let n1 = global.__abstract ? __abstract(\"number\", \"1\") : 1;\n\nfunction f1() {\n  if (n1 > 10) {\n    if (n1 > 20) {\n      throw 100;\n    } else {\n      return 200;\n    }\n  } else {\n    if (n1 > 3) {\n      if (n1 > 4) {\n        throw 300;\n      } else {\n        return 400;\n      }\n    } else {\n      if (n1 > 2) {\n        return 500;\n      } else {\n        throw 600;\n      }\n    }\n  }\n}\n\ntry {\n  var x = f1();\n} catch (e) {\n  x = e;\n}\n\ninspect = function() {\n  return x;\n};\n"
  },
  {
    "path": "test/serializer/abstract/PossibleThrow.js",
    "content": "let x = global.__abstract ? __abstract(\"boolean\", \"true\") : true;\nlet y;\ntry {\n  if (x) {\n    y = 1;\n    throw Error();\n  } else {\n    y = 0;\n  }\n} catch (e) {}\n\ninspect = function() {\n  return y;\n};\n"
  },
  {
    "path": "test/serializer/abstract/PropagateFunctionResultType.js",
    "content": "// add at runtime: let __obj = {f: function() { return 19; }};\nlet obj = global.__abstract\n  ? __abstract({ f: __abstract(\":number\") }, \"__obj\")\n  : {\n      f: function() {\n        return 19;\n      },\n    };\nlet result = obj.f() + 23;\nglobal.inspect = function() {\n  return 42;\n};\n"
  },
  {
    "path": "test/serializer/abstract/Property.js",
    "content": "let x = global.__abstract ? __abstract(\"boolean\", \"true\") : true;\n\nlet ob = {};\nif (x) {\n  Object.defineProperty(ob, \"x\", { configurable: true, get: () => 2 });\n  ob.x = 123;\n}\nif (x) {\n} else {\n  Object.defineProperty(ob, \"y\", { configurable: true, set: () => {} });\n}\n\nlet ob2 = { y: 2 };\nif (!x) {\n  Object.defineProperty(ob2, \"x\", {\n    configurable: true,\n    get: () => this._x,\n    set: v => {\n      this._x = v;\n    },\n  });\n  ob2.x = 123;\n}\n\ninspect = function() {\n  return ob.x + \" \" + ob.y + \" \" + ob2.x;\n};\n"
  },
  {
    "path": "test/serializer/abstract/Property2.js",
    "content": "let x = global.__abstract ? __abstract(\"boolean\", \"true\") : true;\n\nlet ob = {};\nif (x) {\n  Object.defineProperty(ob, \"x\", { configurable: true, get: () => 2 });\n} else {\n  ob.x = 123;\n}\nif (!x) {\n} else {\n  Object.defineProperty(ob, \"y\", { configurable: true, get: () => 3 });\n}\n\nlet ob2 = { y: 2 };\nif (!x) {\n  Object.defineProperty(ob2, \"x\", {\n    configurable: true,\n    get: () => this._x,\n    set: v => {\n      this._x = v;\n    },\n  });\n} else {\n  ob2.x = 123;\n}\nob2.x = 456;\n\nlet ob3 = {};\nif (x) {\n  Object.defineProperty(ob3, \"x\", {\n    configurable: true,\n    get: () => this._x,\n    set: v => {\n      throw v;\n    },\n  });\n} else {\n  ob3.x = 123;\n}\ntry {\n  ob3.x = 789;\n} catch (e) {\n  ob3.e = e;\n}\n\nlet ob4 = {};\nif (x) {\n  Object.defineProperty(ob4, \"x\", { configurable: true, get: () => 4 });\n} else {\n  Object.defineProperty(ob4, \"x\", { configurable: false, get: () => 5 });\n}\n\nlet ob5 = {};\nif (x) {\n  Object.defineProperty(ob5, \"x\", {\n    configurable: true,\n    get: () => {\n      throw 4;\n    },\n  });\n} else {\n  Object.defineProperty(ob5, \"x\", { configurable: false, get: () => 5 });\n}\nvar z;\ntry {\n  z = ob5.x;\n} catch (e) {\n  z = \"caught \" + e;\n}\n\ninspect = function() {\n  return ob.x + \" \" + ob.y + \" \" + ob2.x + \" \" + ob3.x + \" \" + ob3.e + \" \" + z;\n};\n"
  },
  {
    "path": "test/serializer/abstract/Property3.js",
    "content": "// does not contain:456\nlet x = global.__abstract ? __abstract(\"boolean\", \"true\") : true;\n\nlet ob = {};\nif (x) {\n  ob.x = 123;\n} else {\n  ob.x = 456;\n}\nif (x) {\n  var y = ob;\n}\n\ninspect = function() {\n  return y;\n};\n"
  },
  {
    "path": "test/serializer/abstract/Property4.js",
    "content": "// does not contain:Date\n// omit invariants\nlet x = global.__abstract ? __abstract(\"boolean\", \"true\") : true;\n\nlet ob = {};\nif (x) {\n  ob.x = 123;\n} else {\n  ob.x = Date.now();\n}\nif (x) {\n  var y = ob;\n}\n\ninspect = function() {\n  return y;\n};\n"
  },
  {
    "path": "test/serializer/abstract/Property5.js",
    "content": "// does not contain:dead\nlet x = global.__abstract ? __abstract(\"boolean\", \"true\") : true;\n\nlet ob = {};\nif (x) {\n  ob.x = 123;\n} else {\n  let nested = { p: \"dead\" };\n  ob.x = { left: nested, right: nested };\n}\nif (x) {\n  var y = ob;\n}\n\ninspect = function() {\n  return y;\n};\n"
  },
  {
    "path": "test/serializer/abstract/PropertyAttributeConflict.js",
    "content": "// throws introspection error\n\nvar c = global.__abstract ? __abstract(\"boolean\", \"(true)\") : true;\nvar obj = { x: 1 };\nif (c) delete obj.x;\nObject.defineProperty(obj, \"x\", { value: 2 });\ninspect = function() {\n  return Object.getOwnPropertyDescriptor(obj, \"x\").enumerable;\n};\n"
  },
  {
    "path": "test/serializer/abstract/PutValue.js",
    "content": "// throws introspection error\nvar i = 42;\ni.someProperty = 43;\n\nvar obj = __makePartial({});\nobj.someProperty = 42;\n"
  },
  {
    "path": "test/serializer/abstract/PutValue10.js",
    "content": "// throws introspection error\nlet x = __abstract(\"boolean\", \"true\");\n\nlet target = { x: 1 };\nlet receiver = {};\nObject.defineProperty(receiver, \"x\", { writable: false, configurable: true, value: 2 });\n\nReflect.set(target, \"x\", 42, receiver);\n\nlet o = x ? receiver : {};\ndelete o.x;\n\nReflect.set(target, \"x\", 42, receiver);\n"
  },
  {
    "path": "test/serializer/abstract/PutValue11.js",
    "content": "var c = global.__abstract ? __abstract(\"boolean\", \"false\") : false;\nvar a = {};\nif (c) a.f = a;\n\ninspect = function() {\n  return \"f\" in a;\n};\n"
  },
  {
    "path": "test/serializer/abstract/PutValue12.js",
    "content": "var n = global.__abstract ? __abstract(\"string\", '/* n = */ (\"x\")') : \"x\";\nvar m = global.__abstract ? __abstract(\"string\", '/* m = */ (\"x\")') : \"x\";\nvar c = global.__abstract ? __abstract(\"boolean\", \"/* c = */ true\") : true;\n\na = { x: 123, y: 444 };\nif (global.__makeSimple) global.__makeSimple(a);\na[n] = 456;\n\nvar b = { xx: 123 };\nif (global.__makeSimple) global.__makeSimple(b);\nb[n] = 456;\nb[m] = 789;\nb[n] = 999;\nif (c) {\n  b[n] = 888;\n} else {\n  b[n] = 777;\n}\n\nvar z = a.x;\nvar z1 = b.xx;\nvar z2 = b.x;\n\ninspect = function() {\n  return \"\" + z + z1 + z2 + b[\"x\"];\n};\n"
  },
  {
    "path": "test/serializer/abstract/PutValue13.js",
    "content": "(function() {\n  let a = global.__abstract ? __abstract(\"boolean\", \"(false)\") : false;\n  let obj = {};\n  if (a) {\n    obj.notAnObject = Date.now();\n  }\n  inspect = function() {\n    return obj.notAnObject instanceof Object;\n  };\n})();\n"
  },
  {
    "path": "test/serializer/abstract/PutValue2.js",
    "content": "var obj = global.__makePartial ? __makePartial({ someProperty: 41 }) : {};\nobj.someProperty = 42;\nvar z = obj.someProperty;\n\ninspect = function() {\n  return \"\" + z;\n};\n"
  },
  {
    "path": "test/serializer/abstract/PutValue3.js",
    "content": "let x = global.__abstract ? __abstract(\"boolean\", \"true\") : true;\n\nlet obj = { x: 123 };\n\nvar o = x ? obj : { x: 456 };\n\no.x = 42;\n\ninspect = function() {\n  return JSON.stringify(o);\n};\n"
  },
  {
    "path": "test/serializer/abstract/PutValue4.js",
    "content": "let x = global.__abstract ? __abstract(\"boolean\", \"true\") : true;\n\nvar o1 = { x: 23 };\nvar o2 = { x: 12 };\nlet a = x ? o1 : o2;\na.x = 42;\nvar y = o1.x;\no1.x = 99;\n\ninspect = function() {\n  return \"\" + y + \"-\" + o1.x + \"-\" + o2.x;\n};\n"
  },
  {
    "path": "test/serializer/abstract/PutValue5.js",
    "content": "let x = global.__abstract ? __abstract(\"boolean\", \"true\") : true;\n\nlet obj = { x: 123 };\n\nvar o = x ? obj : { y: 456 };\n\no.y = 42;\n\ninspect = function() {\n  return JSON.stringify(o);\n};\n"
  },
  {
    "path": "test/serializer/abstract/PutValue6.js",
    "content": "// throws introspection error\nlet x = __abstract(\"boolean\", \"true\");\n\nlet obj = { set x(v) {} };\n\no = x ? obj : { x: 456 };\n\no.x = 42;\n"
  },
  {
    "path": "test/serializer/abstract/PutValue7.js",
    "content": "// throws introspection error\nlet x = global.__abstract ? __abstract(\"boolean\", \"true\") : true;\nlet ob1 = {};\nObject.defineProperty(ob1, \"p\", { writable: false, value: 1 });\nlet ob2 = {};\nObject.defineProperty(ob2, \"p\", { writable: true, value: 2 });\nglobal.ob = x ? ob1 : ob2;\nob.p = 3;\ninspect = function() {\n  return global.ob.p;\n};\n"
  },
  {
    "path": "test/serializer/abstract/PutValue8.js",
    "content": "// throws introspection error\nlet x = global.__abstract ? __abstract(\"boolean\", \"true\") : true;\nlet proto = {};\nObject.defineProperty(proto, \"p\", { writable: false, configurable: true, value: 1 });\nlet ob1 = {};\nObject.setPrototypeOf(ob1, proto);\nlet ob2 = {};\nob = x ? ob1 : ob2;\nObject.defineProperty(ob, \"p\", { writable: true, value: 2 });\nif (x) delete proto.p;\nob1.p = 3;\n"
  },
  {
    "path": "test/serializer/abstract/PutValue9.js",
    "content": "// throws introspection error\nlet x = __abstract(\"boolean\", \"true\");\n\nlet target = { x: 1 };\nlet receiver = {};\n\nObject.defineProperty(receiver, \"x\", { configurable: true, get: () => 2, set: v => void v });\n\nreceiver.x = 3;\n\nObject.defineProperty(receiver, \"x\", { configurable: true, get: () => 2 });\n\nreceiver.x = 4;\n\nReflect.set(target, \"x\", 42, receiver);\n\nlet o = x ? receiver : {};\ndelete o.x;\n\nReflect.set(target, \"x\", 42, receiver);\n"
  },
  {
    "path": "test/serializer/abstract/QualifiedCall.js",
    "content": "// add at runtime: global.bar = {x: 1};\nlet bar = global.__abstract ? __makeSimple(__abstract({ x: 1 }, \"global.bar\")) : { x: 1 };\n\nlet foo = global.__abstract\n  ? __abstract(\"function\", \"(function() { return this.x; })\")\n  : function() {\n      return this.x;\n    };\nbar.foo = foo;\nx = bar.foo();\n\nlet foo2 = global.__abstract\n  ? __abstract(\"function\", \"(function(a) { return this.x + a; })\")\n  : function(a) {\n      return this.x + a;\n    };\nbar[1] = foo2;\ny = bar[1](100);\n\n// Uncomment this when assignments to symbol properties are supported\n// let fooSym = Symbol.for(\"foo\");\n// bar[fooSym] = foo2;\n// y1 = bar[fooSym](150);\n\nz = foo2(200);\n\nvar c = global.__abstract ? __abstract(\"boolean\", \"true\") : true;\nlet foo3 = c ? foo2 : foo;\n\nz1 = foo3(300);\n\ninspect = function() {\n  return \"\" + global.x + global.y + global.z + global.z1;\n};\n"
  },
  {
    "path": "test/serializer/abstract/QualifiedCall2.js",
    "content": "// add at runtime: global.bar = {x: 1};\nlet bar = global.__abstract ? __makeSimple(__abstract({ x: 1 }, \"global.bar\")) : { x: 1 };\nlet foo = global.__abstract\n  ? __abstract(\"function\", \"(function() { return this.x; })\")\n  : function() {\n      return this.x;\n    };\n\nbar.foo = foo;\nvar x = bar.foo();\nbar.foo = function() {\n  return \"abc\";\n};\nvar y = bar.foo();\n\ninspect = function() {\n  return \"\" + x + y;\n};\n"
  },
  {
    "path": "test/serializer/abstract/QualifiedCall3.js",
    "content": "let bar = { x: 1 };\nlet foo = global.__abstract\n  ? __abstract(function() {\n      return this.x;\n    }, \"(function() { return this.x; })\")\n  : function() {\n      return this.x;\n    };\n\nbar.foo = foo;\nObject.freeze(bar);\nvar x = bar.foo();\nbar.foo = function() {\n  return \"abc\";\n};\nvar y = bar.foo();\n\ninspect = function() {\n  return \"\" + x + y;\n};\n"
  },
  {
    "path": "test/serializer/abstract/Refine.js",
    "content": "// does not contain: ? 10 :\n\nlet x = global.__abstract ? __abstract(\"boolean\", \"true\") : true;\nlet y;\nlet z;\nif (x) y = 10;\nif (x) z = y;\nelse z = 10;\n\ninspect = function() {\n  return z;\n};\n"
  },
  {
    "path": "test/serializer/abstract/Refine2.js",
    "content": "let x = global.__abstract ? __abstract(\"boolean\", \"false\") : false;\nlet f = function() {\n  return 42;\n};\nlet initialized = false;\nif (x) {\n  f = undefined;\n  initialized = true;\n}\nlet result;\nif (!initialized) {\n  result = f();\n}\n\ninspect = function() {\n  return result;\n};\n"
  },
  {
    "path": "test/serializer/abstract/Refine3.js",
    "content": "let x = global.__abstract ? __abstract(\"boolean\", \"false\") : false;\nlet f = function() {\n  return 42;\n};\nlet modules = [];\nif (x) {\n  modules[0] = { initialized: true, f: undefined, result: f() };\n} else {\n  modules[0] = { initialized: false, f, result: undefined };\n}\nlet module = modules[0];\nif (module && module.initialized) {\n} else if (module) {\n  // (!module || !x)\n  modules[0] = { initialized: true, f: undefined, result: module.f() };\n}\n\ninspect = function() {\n  return modules[0].result;\n};\n"
  },
  {
    "path": "test/serializer/abstract/Refine4.js",
    "content": "let x = global.__abstract ? __abstract(\"boolean\", \"true\") : true;\nlet ob = x ? { y: \"z\" } : null;\nvar z = ob != null && ob;\nvar z1 = ob != null || x || ob;\n\ninspect = function() {\n  return z.y + z1;\n};\n"
  },
  {
    "path": "test/serializer/abstract/Refine5.js",
    "content": "let x = global.__abstract ? __abstract(\"boolean\", \"true\") : true;\nlet ob = x ? { y: \"z\" } : undefined;\nvar z = ob != undefined && ob;\nvar z1 = ob != undefined || x || ob;\n\ninspect = function() {\n  return z.y + z1;\n};\n"
  },
  {
    "path": "test/serializer/abstract/Refine6.js",
    "content": "// does contain: \"def\" : \"ghi1\"\n// does contain: \"abc\" : \"ghi2\"\n\nlet x = global.__abstract ? __abstract(\"boolean\", \"false\") : false;\nlet ob = x ? { y: \"z\" } : null;\nvar z = ob == null ? (ob ? \"wrong\" : \"ok\") : \"wrong\";\n\nlet str = x ? \"abc\" : \"def\";\nvar z1 = str !== \"abc\" ? str : \"ghi1\";\nvar z2 = str === \"abc\" ? str : \"ghi2\";\n\ninspect = function() {\n  return z + z1 + z2;\n};\n"
  },
  {
    "path": "test/serializer/abstract/Refine7.js",
    "content": "// add at runtime:var global=this;this.nativePerformanceNow = Date.now;\nif (global.__assumeDataProperty)\n  __assumeDataProperty(\n    this,\n    \"nativePerformanceNow\",\n    function() {\n      if (this.__residual)\n        return this.__residual(\n          \"number\",\n          function(global) {\n            return global.nativePerformanceNow();\n          },\n          global\n        );\n      else return this.nativePerformanceNow();\n    },\n    \"SKIP_INVARIANT\"\n  );\nlet performanceNow = nativePerformanceNow;\n\nlet timespans = {};\n\nfunction addTimespan(key) {\n  timespans[key] = {};\n}\n\nfunction startTimespan(key) {\n  if (timespans[key]) return;\n  timespans[key] = { startTime: performanceNow() };\n}\n\nfunction stopTimespan(key) {\n  const timespan = timespans[key];\n  if (timespan && timespan.startTime) {\n    timespan.endTime = performanceNow();\n    // Following line has a problem\n    timespan.totalTime = timespan.endTime - (timespan.startTime || 0);\n  }\n}\n\nstartTimespan(\"hello\");\nstopTimespan(\"hello\");\n\ninspect = function() {\n  return true;\n};\n"
  },
  {
    "path": "test/serializer/abstract/RegressionTestForNestedGenerators.js",
    "content": "(function() {\n  var x = global.__abstract ? __abstract(\"boolean\", \"(true)\") : true;\n  if (x) {\n    var obj = {};\n    global.obj = obj;\n    obj.time = Date.now();\n  }\n  inspect = function() {\n    return global.obj.time > 0;\n  };\n})();\n"
  },
  {
    "path": "test/serializer/abstract/ReplaceFunctionBody.js",
    "content": "(function() {\n  function f() {\n    return 23;\n  }\n  function g() {\n    return 42;\n  }\n  if (global.__abstract) {\n    global.__replaceFunctionImplementation_unsafe(f, g);\n    global.inspect = f;\n  } else {\n    global.inspect = g;\n  }\n})();\n"
  },
  {
    "path": "test/serializer/abstract/Residual.js",
    "content": "let x = global.__abstract ? __abstract(\"number\", \"42\") : 42;\nvar y = global.__residual\n  ? __residual(\n      \"number\",\n      function(x) {\n        // Prepack doesn't (yet) partially evaluate a loop over an abstract value,\n        // so putting the otherwise side-effect free loop into a __residual block\n        // unblocks further processing.\n        let res = 0;\n        for (let i = 0; i < x; i++) res++;\n        return res;\n      },\n      x\n    )\n  : x;\ninspect = function() {\n  return y;\n};\n"
  },
  {
    "path": "test/serializer/abstract/ResidualExplicitParameters.js",
    "content": "(function() {\n  let x = 42;\n  let y = global.__residual_unsafe\n    ? __residual_unsafe(\"number\", function() {\n        return x;\n      })\n    : 42; // this variant takes no further arguments\n  inspect = function() {\n    return y;\n  };\n})();\n"
  },
  {
    "path": "test/serializer/abstract/ResidualExplicitParameters2.js",
    "content": "// cannot serialize\n(function() {\n  let x = 42;\n  let y = global.__residual\n    ? __residual(\"number\", function() {\n        return x;\n      })\n    : 42; // this variant takes no further arguments\n  inspect = function() {\n    return y;\n  };\n})();\n"
  },
  {
    "path": "test/serializer/abstract/ResidualInvariant1.js",
    "content": "function checker() {\n  let x = global.__abstract ? global.__abstract(\"number\", \"5\") : 5;\n  global.__assume && global.__assume(x !== 5, \"x should not be 5\");\n}\n\ninspect = () => {\n  try {\n    checker();\n    return \"x should not be 5\";\n  } catch (err) {\n    return err;\n  }\n};\n"
  },
  {
    "path": "test/serializer/abstract/ResidualInvariant2.js",
    "content": "function checker() {\n  let x = global.__abstract ? global.__abstract(\"number\", \"5\") : 5;\n  global.__assume && global.__assume(x === 5, \"x should not be 5\");\n}\n\ninspect = () => {\n  try {\n    checker();\n    return \"ok\";\n  } catch (err) {\n    throw Error(\"Safe assumption violated\");\n  }\n};\n"
  },
  {
    "path": "test/serializer/abstract/ResidualInvariant3.js",
    "content": "function checker() {\n  let x = global.__abstract ? global.__abstract(\"number\", \"5\") : 5;\n  global.__assume && global.__assume(x !== 5);\n}\n\ninspect = () => {\n  try {\n    checker();\n    return \"Error: Assumption violated\";\n  } catch (err) {\n    return err.message;\n  }\n};\n"
  },
  {
    "path": "test/serializer/abstract/ResidualInvariant4.js",
    "content": "function checker() {\n  let x = 5;\n  global.__assume(x !== 5);\n}\n\ninspect = function() {\n  let unsat;\n\n  try {\n    if (global.__optimize) {\n      global.__optimize(checker);\n    } else {\n      unsat = true;\n    }\n  } catch (err) {\n    unsat = err.message === \"Assumed condition cannot be true\";\n  }\n\n  return true;\n};\n"
  },
  {
    "path": "test/serializer/abstract/ResidualInvariantPathCondition.js",
    "content": "// does not contain:42\n\nfunction checker() {\n  let x = global.__abstract ? global.__abstract(\"boolean\", \"true\") : true;\n  global.__assume && global.__assume(x);\n  if (!x) {\n    global.foo = 42;\n  }\n}\n\nglobal.__optimize && __optimize(checker);\n\ninspect = () => {};\n"
  },
  {
    "path": "test/serializer/abstract/ResidualTemplate.js",
    "content": "let x = global.__abstract ? __abstract(\"number\", \"42\") : 42;\nvar o = global.__residual\n  ? __residual(\n      { x: __abstract(\"number\") },\n      function(x) {\n        // Prepack doesn't (yet) partially evaluate a loop over an abstract value,\n        // so putting the otherwise side-effect free loop into a __residual block\n        // unblocks further processing.\n        let res = 0;\n        for (let i = 0; i < x; i++) res++;\n        return { x: res };\n      },\n      x\n    ).x\n  : x;\ninspect = function() {\n  return o.x;\n};\n"
  },
  {
    "path": "test/serializer/abstract/ResidualVoid.js",
    "content": "var y = global.__residual\n  ? __residual(\"void\", function() {\n      // A void residual function that has some side-effect that doesn't affect the heap\n      let res = 0;\n    })\n  : undefined;\ninspect = function() {\n  return y;\n};\n"
  },
  {
    "path": "test/serializer/abstract/Return.js",
    "content": "let x = global.__abstract ? __abstract(\"boolean\", \"true\") : true;\n\nlet y = 1;\n\nfunction f(b) {\n  if (b) {\n    y = 2;\n    return 1;\n  } else {\n    y = 3;\n    return 2;\n  }\n}\n\nvar z = f(x);\nvar z1 = y;\n\ninspect = function() {\n  return \"\" + z + z1;\n};\n"
  },
  {
    "path": "test/serializer/abstract/Return1.js",
    "content": "let x = global.__abstract ? __abstract(\"boolean\", \"true\") : true;\n\nvar y = 1;\n\nfunction f(b) {\n  if (b) return 1;\n  y = 2;\n}\n\nvar z = f(x);\nvar z1 = y;\nvar z2 = f(!x);\nvar z3 = y;\n\ninspect = function() {\n  return \"\" + z + z1 + z2 + z3;\n};\n"
  },
  {
    "path": "test/serializer/abstract/Return10.js",
    "content": "// Copies of 42:1\n\n(function() {\n  x = global.__abstract ? __abstract(\"number\", \"5\") : 5;\n  if (x == 5) {\n    console.log(\"42\");\n  } else {\n    return;\n  }\n})();\n"
  },
  {
    "path": "test/serializer/abstract/Return1a.js",
    "content": "let x = global.__abstract ? __abstract(\"boolean\", \"true\") : true;\n\nvar y = 1;\n\nfunction f(b) {\n  if (b) {\n  } else return 1;\n  y = 2;\n}\n\nvar z = f(x);\nvar z1 = y;\nvar z2 = f(!x);\nvar z3 = y;\n\ninspect = function() {\n  return \"\" + z + z1 + z2 + z3;\n};\n"
  },
  {
    "path": "test/serializer/abstract/Return2.js",
    "content": "let x = global.__abstract ? __abstract(\"boolean\", \"true\") : true;\n\nvar y = 1;\n\nfunction f(b) {\n  if (b) return 1;\n  y = 2;\n  return 2;\n}\n\nvar z = f(x);\n\ninspect = function() {\n  return \"\" + y + z;\n};\n"
  },
  {
    "path": "test/serializer/abstract/Return2a.js",
    "content": "let x = global.__abstract ? __abstract(\"boolean\", \"true\") : true;\n\nvar y = 1;\n\nfunction f(b) {\n  if (b) {\n  } else return 1;\n  y = 2;\n  return 2;\n}\n\nvar z = f(!x);\n\ninspect = function() {\n  return \"\" + y + z;\n};\n"
  },
  {
    "path": "test/serializer/abstract/Return3.js",
    "content": "let x = global.__abstract ? __abstract(\"boolean\", \"true\") : true;\n\nvar y = 1;\nvar y1 = 2;\n\nfunction f(b) {\n  y = 2;\n  if (b) return 0;\n  y1 = 3;\n  if (x) {\n    return 1;\n  } else {\n    throw 2;\n  }\n}\n\nvar z = f(!x);\n\ninspect = function() {\n  return z;\n};\n"
  },
  {
    "path": "test/serializer/abstract/Return3a.js",
    "content": "let x = global.__abstract ? __abstract(\"boolean\", \"true\") : true;\n\nvar y = 1;\nvar y1 = 2;\n\nfunction f(b) {\n  y = 2;\n  if (b) {\n  } else return 0;\n  y1 = 3;\n  if (x) {\n    return 1;\n  } else {\n    throw 2;\n  }\n}\n\nvar z = f(!x);\n\ninspect = function() {\n  return z;\n};\n"
  },
  {
    "path": "test/serializer/abstract/Return4.js",
    "content": "let x = global.__abstract ? __abstract(\"boolean\", \"true\") : true;\n\nvar y = 1;\n\nfunction f(b) {\n  if (b) return 1;\n  y = 2;\n  if (b) return 2;\n  y = 3;\n  if (b) return 3;\n}\n\nvar z = f(!x);\n\ninspect = function() {\n  return \"\" + y + z;\n};\n"
  },
  {
    "path": "test/serializer/abstract/Return4a.js",
    "content": "let x = global.__abstract ? __abstract(\"boolean\", \"true\") : true;\n\nvar y = 1;\n\nfunction f(b) {\n  if (b) {\n  } else return 1;\n  y = 2;\n  if (b) {\n  } else return 2;\n  y = 3;\n  if (b) {\n  } else return 3;\n}\n\nvar z = f(x);\n\ninspect = function() {\n  return \"\" + y + z;\n};\n"
  },
  {
    "path": "test/serializer/abstract/Return5.js",
    "content": "let x = global.__abstract ? __abstract(\"boolean\", \"true\") : true;\n\nvar y = 1;\n\nfunction f(b) {\n  if (b) return 1;\n  y = 2;\n  if (b) return 2;\n  y = 3;\n  return 3;\n}\n\nvar z = f(!x);\n\ninspect = function() {\n  return \"\" + y + z;\n};\n"
  },
  {
    "path": "test/serializer/abstract/Return5a.js",
    "content": "let x = global.__abstract ? __abstract(\"boolean\", \"true\") : true;\n\nvar y = 1;\n\nfunction f(b) {\n  if (b) {\n  } else return 1;\n  y = 2;\n  if (b) {\n  } else return 2;\n  y = 3;\n  return 3;\n}\n\nvar z = f(x);\n\ninspect = function() {\n  return \"\" + y + z;\n};\n"
  },
  {
    "path": "test/serializer/abstract/Return6.js",
    "content": "let x = global.__abstract ? __abstract(\"boolean\", \"true\") : true;\n\nvar y = 1;\n\nfunction f(b) {\n  if (b) throw 1;\n  y = 2;\n}\n\nvar z = f(!x);\n\ninspect = function() {\n  return z;\n};\n"
  },
  {
    "path": "test/serializer/abstract/Return6a.js",
    "content": "let x = global.__abstract ? __abstract(\"number\", \"(1)\") : 1;\n\nlet i = 0;\n\nfunction f() {\n  if (i === x) return 10;\n  i++;\n  if (i === x) return 11;\n  i++;\n}\n\nf();\n\ninspect = function() {\n  return i;\n};\n"
  },
  {
    "path": "test/serializer/abstract/Return7.js",
    "content": "let c = 0;\nlet overflow = false;\nfunction check1() {\n  return global.__abstract ? global.__abstract(\"boolean\", \"/* check1 */ true\") : true;\n}\nfunction check2() {\n  return global.__abstract ? global.__abstract(\"boolean\", \"/* check2 */ true\") : true;\n}\nfunction call1() {\n  if (check1()) {\n    c = c + 1;\n    if (c > 2) {\n      overflow = true;\n      return 3;\n    }\n  }\n  return 4;\n}\nfunction call2() {\n  if (check2()) {\n    c = c + 1;\n    if (c > 2) {\n      overflow = true;\n      return 3;\n    }\n  }\n  return 4;\n}\na = call1();\nb = call2();\ninspect = function() {\n  return overflow;\n};\n"
  },
  {
    "path": "test/serializer/abstract/Return8.js",
    "content": "let x = global.__abstract ? __abstract(\"boolean\", \"true\") : true;\n\nvar y = 1;\n\nfunction f(b) {\n  if (b) throw 1;\n  y = 2;\n}\n\nfunction g(b) {\n  f(b);\n}\n\nvar z = g(x);\n\ninspect = function() {\n  return z;\n};\n"
  },
  {
    "path": "test/serializer/abstract/Return9.js",
    "content": "let b = global.__abstract ? __abstract(\"boolean\", \"true\") : true;\nfunction f() {}\n\nlet y = 1;\nfunction g() {\n  if (b) return \"foo\";\n  y = 2;\n  f();\n  return \"bar\";\n}\n\nvar x = g();\n\ninspect = function() {\n  return [x, y].join(\" \");\n};\n"
  },
  {
    "path": "test/serializer/abstract/Set.js",
    "content": "let x = global.__abstract ? __abstract(\"boolean\", \"true\") : true;\nlet bar0 = { y: 0 };\nlet bar1 = { y: 1 };\nlet bar2 = { y: 2 };\n\nfunction makeSet(b) {\n  let s = new Set();\n  if (b) {\n    s.add(bar0);\n    s.add(bar1);\n    s.add(bar2);\n  } else {\n    s.add(bar0);\n    s.add(bar2);\n    s.add(bar1);\n  }\n  return s;\n}\n\nlet s1 = makeSet(x);\nlet s2 = makeSet(!x);\n\nvar x1 = s1.add(bar0);\nvar x2 = s2.has(bar0);\n\nvar x3 = [];\nfor (let v of s1) {\n  x3.push(v);\n}\n\nvar x4 = [];\nfor (let v of s2) {\n  x4.push(v);\n}\n\nvar x5 = s1.delete(bar0);\n\nvar x6 = [];\nfor (let v of s1) {\n  x6.push(v);\n}\n\ninspect = function() {\n  return JSON.stringify([x1, x2, x3, x4, x5, x6]);\n};\n"
  },
  {
    "path": "test/serializer/abstract/SimpleObject.js",
    "content": "let o = global.__abstract ? __makeSimple(__abstract(\"object\", \"({})\")) : {};\nlet p = global.__abstract ? __makeSimple(__abstract(\"object\", \"({ toString: () => 'x' })\")) : { toString: () => \"x\" };\no[p] = p;\nvar x = Array.isArray(o);\nvar y = typeof o[p];\n\ninspect = function() {\n  return x + \" \" + y;\n};\n"
  },
  {
    "path": "test/serializer/abstract/SimpleObject2.js",
    "content": "// add at runtime: var __a = { success: true }\n(function() {\n  var template = {};\n  if (global.__makeSimple) __makeSimple(template);\n  var a = global.__abstract ? __abstract(template, \"__a\") : { success: true };\n  if (!a.success) {\n    throw a.exception;\n  }\n  inspect = function() {\n    return JSON.stringify(a);\n  };\n})();\n"
  },
  {
    "path": "test/serializer/abstract/SimpleObject3.js",
    "content": "// add at runtime: var foo = { props: { toolbox: {}, trackingCodes: null, feedProps: [],  unit: { firstItem: { edges: [{ node: 123 }] } } } };\nfunction render(_ref3) {\n  var _ref;\n  var props = _ref3.props;\n  if (props == null) return null;\n  var item =\n    (_ref = props.unit) != null\n      ? (_ref = _ref.firstItem) != null\n        ? (_ref = _ref.edges) != null\n          ? (_ref = _ref[0]) != null\n            ? _ref.node\n            : _ref\n          : _ref\n        : _ref\n      : _ref;\n  if (!item) {\n    return null;\n  } else {\n    return {\n      unit: props.unit,\n      item: item,\n      toolbox: props.toolbox,\n      trackingCodes: props.trackingCodes,\n      feedProps: props.feedProps,\n    };\n  }\n}\nlet wellBehavedObject = {\n  props: { toolbox: {}, trackingCodes: null, feedProps: [], unit: { firstItem: { edges: [{ node: 123 }] } } },\n};\nlet wellBehavedParameter = global.__abstract ? __abstract(\"object\", \"foo\") : wellBehavedObject;\nif (global.__makeSimple) __makeSimple(wellBehavedParameter, \"transitive\");\nvar prepackedRender = render(wellBehavedParameter);\n\ninspect = function() {\n  return JSON.stringify(prepackedRender);\n};\n"
  },
  {
    "path": "test/serializer/abstract/SimpleObject4.js",
    "content": "// add at runtime: var ob = { x: { y: { z: {  } } } };\nfunction render(ob) {\n  var x = ob.x;\n  if (x == null) return null;\n  var y = x.y;\n  if (y == null) return null;\n  return y.z;\n}\nlet absOb = global.__abstract ? __abstract(\"object\", \"ob\") : { x: { y: { z: {} } } };\nif (global.__makeSimple) __makeSimple(absOb, \"transitive\");\nvar prepackedRender = render(absOb);\n\ninspect = function() {\n  return JSON.stringify(prepackedRender);\n};\n"
  },
  {
    "path": "test/serializer/abstract/String.js",
    "content": "let x = global.__abstract ? __abstract(\"string\", \"('a,b,c,d,e')\") : \"a,b,c,d,e\";\nlet sliced = x.slice(2, 3);\nlet split = x.split(\",\", 2);\n\ninspect = function() {\n  return sliced + split.join(\":\");\n};\n"
  },
  {
    "path": "test/serializer/abstract/StringLength.js",
    "content": "let x = global.__abstract ? __abstract(\"string\", \"('a,b,c,d,e')\") : \"a,b,c,d,e\";\nlet length = x.length;\n\ninspect = function() {\n  return length;\n};\n"
  },
  {
    "path": "test/serializer/abstract/Switch.js",
    "content": "let x = global.__abstract ? __abstract(\"number\", \"1\") : 1;\nglobal.z1 = global.z2 = global.z3 = global.z4 = global.z5 = global.z6 = global.z7 = global.z8 = global.z9 = global.z10 = global.z11 = 10;\n\nswitch (x) {\n}\n\nswitch (x) {\n  case 0:\n    z1 = 11;\n    break;\n  case 1:\n    z1 = 12;\n    break;\n  case 2:\n    z1 = 13;\n    break;\n  default:\n    z1 = 14;\n    break;\n}\n\nswitch (x) {\n  case 2:\n    z2 = 11;\n    break;\n  case 1:\n    z2 = 12;\n    break;\n  case 0:\n    z2 = 13;\n    break;\n  default:\n    z2 = 14;\n    break;\n}\n\nswitch (x + 1) {\n  case 0:\n    z3 = 11;\n    break;\n  case 1:\n    z3 = 100;\n    break;\n  case 2:\n    z3 = 12;\n  case 3:\n    z3 = 14;\n  default:\n    z3 = 122;\n    break;\n}\n\nswitch (x) {\n  case x - 1:\n    z5 = 11;\n    break;\n  case x:\n    z5 = 12;\n    break;\n}\n\nswitch (x) {\n  case 5:\n    z6 = 100;\n    break;\n  case 6:\n    z6 = 101;\n    break;\n}\n\nswitch (x) {\n  case 5:\n    z7 = 100;\n    break;\n  case 6:\n    z7 = 101;\n    break;\n  default:\n    z7 = 12;\n    break;\n}\n\nswitch (x) {\n  case 5:\n    z8 = 100;\n    break;\n  default:\n    z8 = 12;\n    break;\n  case 6:\n    z8 = 101;\n    break;\n}\n\nswitch (x) {\n  case 5:\n    z9 = 100;\n    break;\n  default:\n    z9 = 12;\n  case 6:\n    z9 = 101;\n    break;\n}\n\nswitch (x) {\n  case 0:\n    throw 1;\n  case 1:\n    z10 = 12;\n    break;\n  case 2:\n    z10 = 13;\n    break;\n  default:\n    throw 2;\n}\n\nswitch (x) {\n  case 1:\n    if (z10 === 13) z11 = 12;\n    else throw 3;\n    break;\n  case 0:\n    throw 1;\n    break;\n  case 2:\n    z11 = 13;\n    break;\n  default:\n    throw 2;\n    break;\n}\n\ninspect = function() {\n  return (\n    \"\" +\n    global.z1 +\n    \" \" +\n    global.z2 +\n    \" \" +\n    global.z3 +\n    \" \" +\n    global.z4 +\n    \" \" +\n    global.z5 +\n    \" \" +\n    global.z6 +\n    \" \" +\n    global.z7 +\n    \" \" +\n    global.z8 +\n    \" \" +\n    global.z9 +\n    \" \" +\n    global.z10 +\n    \" \" +\n    global.z11\n  );\n};\n"
  },
  {
    "path": "test/serializer/abstract/Switch2.js",
    "content": "let x = global.__abstract ? __abstract(\"number\", \"1\") : 1;\nvar z1, z2, z3, z4, z5;\nz1 = z2 = z3 = z4 = z5 = 10;\n\nswitch (x) {\n  case 1:\n    z1 = 11;\n    break;\n  case 1:\n    z1 = 12;\n    break;\n  case 2:\n    z1 = 13;\n    break;\n  default:\n    z1 = 14;\n    break;\n}\n\nswitch (x) {\n  case 1:\n    z2 = 11;\n  case 1 + 1:\n    z2 += 12;\n    break;\n  case 2:\n    z2 = 13;\n    break;\n  default:\n    z2 = 14;\n    break;\n}\n\nswitch (\"\") {\n  case \"a\":\n    z3 = 11;\n    break;\n  case \"\" + \"\":\n    z3 = 12;\n  case \"\":\n    z3 = 13;\n    break;\n  default:\n    z3 = 14;\n    break;\n}\n\nswitch ([]) {\n  case []:\n    z4 = 11;\n  case []:\n    z4 = 12;\n  case {}:\n    z4 = 13;\n    break;\n  default:\n    z4 = 14;\n    break;\n}\n\n// add at runtime:function __nextComponentID() { return 1; }\nlet f = global.__abstract ? __abstract(\":number\", \"__nextComponentID\") : __nextComponentID;\n\nswitch (x) {\n  case 1:\n    z5 = 13;\n  case f():\n    z5 += 11;\n  case f():\n    z5 += 12;\n  default:\n    z5 = 14;\n}\n\ninspect = function() {\n  return \"\" + z1 + z2 + z3 + z4 + z5;\n};\n"
  },
  {
    "path": "test/serializer/abstract/Switch3.js",
    "content": "// Copies of value = 42:1\nlet input = global.__abstract ? __abstract(\"boolean\", \"true\") : true;\n\nlet selector = input ? \"A\" : \"B\";\nlet value = input ? 21 : 23;\nswitch (selector) {\n  case \"A\":\n    value = value * 2;\n    break;\n  case \"B\":\n    value = value + 19;\n    break;\n}\n\ninspect = function() {\n  return value;\n};\n"
  },
  {
    "path": "test/serializer/abstract/Switch4.js",
    "content": "let input = global.__abstract ? __abstract(\"boolean\", \"true\") : true;\n\nlet selector = input ? \"A\" : \"B\";\nlet value = 1;\nswitch (selector) {\n  case \"A\":\n    value = 2;\n    throw 123;\n  case \"B\":\n    value = 3;\n    break;\n}\n\ninspect = function() {\n  return value;\n};\n"
  },
  {
    "path": "test/serializer/abstract/SymbolAbstractValueDescription.js",
    "content": "// es6\nvar someNumber = 5;\nvar someString = \"hello\";\nvar abstractNumber = global.__abstract ? __abstract(\"number\", \"someNumber\") : 5;\nvar abstractString = global.__abstract ? __abstract(\"string\", \"someString\") : \"hello\";\nvar x = Symbol(abstractNumber);\nvar y = Symbol(abstractString);\ninspect = function() {\n  return y.toString() + x.toString();\n};\n"
  },
  {
    "path": "test/serializer/abstract/SymbolEqualityRegressionTest.js",
    "content": "// add at runtime:var c=false;var description=\"whatever\";\n(function() {\n  let c = global.__abstract ? __abstract(\"boolean\", \"c\") : false;\n  let description = global.__abstract ? __abstract(\"string\", \"description\") : \"whatever\";\n  let s = Symbol(description);\n  let t = Symbol(description);\n  let u = c ? s : t;\n  let bug = s === u;\n  inspect = function() {\n    return bug;\n  };\n})();\n"
  },
  {
    "path": "test/serializer/abstract/Symbols.js",
    "content": "// es6\n(function() {\n  var myObj = {};\n  var fooSym = Symbol(\"foo\");\n  var otherSym = Symbol(\"bar\");\n  myObj[\"foo\"] = \"bar\";\n  myObj[fooSym] = \"baz\";\n  myObj[otherSym] = \"bing\";\n  inspect = function() {\n    return myObj[otherSym];\n  };\n})();\n"
  },
  {
    "path": "test/serializer/abstract/Symbols2.js",
    "content": "// es6\n(function() {\n  var myObj = {};\n  var otherSym = Symbol(\"bar\");\n  myObj[\"foo\"] = \"bar\";\n  myObj[otherSym] = myObj;\n  inspect = function() {\n    return myObj[otherSym];\n  };\n})();\n"
  },
  {
    "path": "test/serializer/abstract/Symbols3.js",
    "content": "// es6\n(function() {\n  let x = global.__abstract ? __abstract(\"boolean\", \"(true)\") : true;\n  let obj = {};\n  let symbol = Symbol();\n  if (x) {\n    obj[symbol] = 42;\n  }\n  inspect = function() {\n    return obj[symbol];\n  };\n})();\n"
  },
  {
    "path": "test/serializer/abstract/Symbols4.js",
    "content": "// es6\n(function() {\n  //let x = global.__abstract ? __abstract(\"boolean\", \"(true)\") : true;\n  let obj = {};\n  let symbol = Symbol();\n  obj[symbol] = 42;\n  delete obj[symbol];\n  inspect = function() {\n    return symbol in obj;\n  };\n})();\n"
  },
  {
    "path": "test/serializer/abstract/Symbols5.js",
    "content": "(function() {\n  let x = global.__abstract ? __abstract(\"symbol\", \"(Symbol())\") : Symbol();\n  let y;\n  try {\n    y = +x;\n  } catch (e) {\n    y = e instanceof TypeError;\n  }\n  inspect = function() {\n    return y;\n  };\n})();\n"
  },
  {
    "path": "test/serializer/abstract/Symbols6.js",
    "content": "(function() {\n  let x = global.__abstract ? __abstract(\"symbol\", \"(Symbol())\") : Symbol();\n  let y;\n  try {\n    y = x - 10;\n  } catch (e) {\n    y = e instanceof TypeError;\n  }\n  inspect = function() {\n    return y;\n  };\n})();\n"
  },
  {
    "path": "test/serializer/abstract/Symbols7.js",
    "content": "(function() {\n  let x = global.__abstract ? __abstract(\"symbol\", \"(Symbol())\") : Symbol();\n  let y;\n  try {\n    y = x + 10;\n  } catch (e) {\n    y = e instanceof TypeError;\n  }\n  inspect = function() {\n    return y;\n  };\n})();\n"
  },
  {
    "path": "test/serializer/abstract/TemporalCSE.js",
    "content": "this.glob = 123;\nlet b = global.__abstract ? __abstract(\"boolean\", \"true\") : true;\nlet y;\nif (b) {\n  y = glob;\n}\nlet z;\nif (b) {\n  z = glob;\n}\n\ninspect = function() {\n  return y + \" \" + z;\n};\n"
  },
  {
    "path": "test/serializer/abstract/Throw.js",
    "content": "let x = global.__abstract ? __abstract(\"boolean\", \"true\") : true;\n\ntry {\n  if (x) throw \"is true\";\n  else throw \"is false\";\n} catch (e) {\n  var z = e;\n}\n\ninspect = function() {\n  return \"\" + z;\n};\n"
  },
  {
    "path": "test/serializer/abstract/Throw10.js",
    "content": "let c1 = global.__abstract ? __abstract(\"boolean\", \"true\") : true;\nlet c2 = global.__abstract ? __abstract(\"boolean\", \"false\") : false;\n\nfunction foo(cond) {\n  if (cond) throw \"I am an error too!\";\n}\n\nif (c2) {\n  foo(c1);\n}\n\ninspect = function() {\n  return \"success\";\n};\n"
  },
  {
    "path": "test/serializer/abstract/Throw2.js",
    "content": "// does not contain:setPrototypeOf\nlet x = global.__abstract ? __abstract(\"boolean\", \"true\") : true;\n\nvar z;\ntry {\n  if (x) throw new Error(\"is true\");\n  z = \"is false\";\n} catch (e) {\n  z = e;\n}\n\ninspect = function() {\n  return z;\n};\n"
  },
  {
    "path": "test/serializer/abstract/Throw3.js",
    "content": "let x = global.__abstract ? __abstract(\"boolean\", \"true\") : true;\n\nvar z;\ntry {\n  if (x) z = \"is true\";\n  else throw \"is false\";\n} catch (e) {\n  z = e;\n}\n\ninspect = function() {\n  return z;\n};\n"
  },
  {
    "path": "test/serializer/abstract/Throw4.js",
    "content": "let x = global.__abstract ? __abstract(\"boolean\", \"true\") : true;\n\nvar z;\ntry {\n  if (x) z = \"is true\";\n  else throw \"is false\";\n} finally {\n  z = \"is finally\";\n}\n\ninspect = function() {\n  return z;\n};\n"
  },
  {
    "path": "test/serializer/abstract/Throw5.js",
    "content": "let x = global.__abstract ? __abstract(\"boolean\", \"true\") : true;\n\nfunction foo(b) {\n  if (b) throw new Error(\"is true\");\n  return \"is false\";\n}\nvar z;\ntry {\n  z = foo(x);\n} catch (e) {\n  z = e;\n}\n\ninspect = function() {\n  return z;\n};\n"
  },
  {
    "path": "test/serializer/abstract/Throw5a.js",
    "content": "let x = global.__abstract ? __abstract(\"boolean\", \"true\") : true;\nlet y = global.__abstract ? __abstract(\"boolean\", \"false\") : false;\n\nvar z;\nif (x) {\n  if (y) throw new Error(\"x is true\");\n  z = 1;\n} else {\n  if (y) throw new Error(\"x is false\");\n  z = 2;\n}\n\ninspect = function() {\n  return z;\n};\n"
  },
  {
    "path": "test/serializer/abstract/Throw5b.js",
    "content": "let x = global.__abstract ? __abstract(\"boolean\", \"true\") : true;\nlet y = global.__abstract ? __abstract(\"boolean\", \"false\") : false;\n\nvar z;\nif (x) {\n  if (!y) {\n  } else throw new Error(\"x is true\");\n  z = 1;\n} else {\n  if (!y) {\n  } else throw new Error(\"x is false\");\n  z = 2;\n}\n\ninspect = function() {\n  return z;\n};\n"
  },
  {
    "path": "test/serializer/abstract/Throw5c.js",
    "content": "let x = global.__abstract ? __abstract(\"boolean\", \"true\") : true;\nlet y = global.__abstract ? __abstract(\"boolean\", \"false\") : false;\n\nvar z;\nif (x) {\n  if (y) throw new Error(\"x is true\");\n  z = 1;\n} else {\n  if (!y) {\n  } else throw new Error(\"x is false\");\n  z = 2;\n}\n\ninspect = function() {\n  return z;\n};\n"
  },
  {
    "path": "test/serializer/abstract/Throw5d.js",
    "content": "let x = global.__abstract ? __abstract(\"boolean\", \"true\") : true;\nlet y = global.__abstract ? __abstract(\"boolean\", \"false\") : false;\n\nvar z;\nif (x) {\n  if (!y) {\n  } else throw new Error(\"x is true\");\n  z = 1;\n} else {\n  if (y) throw new Error(\"x is false\");\n  z = 2;\n}\n\ninspect = function() {\n  return z;\n};\n"
  },
  {
    "path": "test/serializer/abstract/Throw6.js",
    "content": "let x = global.__abstract ? __abstract(\"boolean\", \"true\") : true;\n\nfunction foo(b) {\n  if (b) throw new Error(\"is true\");\n  return \"is false\";\n}\n\nvar z = foo(!x);\n\ninspect = function() {\n  return z;\n};\n"
  },
  {
    "path": "test/serializer/abstract/Throw6a.js",
    "content": "let a = global.__abstract ? __abstract(\"boolean\", \"false\") : false;\nlet b = global.__abstract ? __abstract(\"boolean\", \"(false)\") : false;\n\nfunction foo() {\n  if (a) throw new Error(\"one\");\n  if (b) throw new Error(\"true\");\n  return \"!a && !b\";\n}\n\nvar z = foo();\n\ninspect = function() {\n  return z;\n};\n"
  },
  {
    "path": "test/serializer/abstract/Throw6b.js",
    "content": "// Copies of _\\$0 = _\\$1.Date.now():1\nlet x = global.__abstract ? __abstract(\"boolean\", \"true\") : true;\n\nfunction foo(b) {\n  if (b) throw new Error(\"\" + Date.now());\n  return \"is false\";\n}\nlet z = foo(!x);\n\ninspect = function() {\n  return z;\n};\n"
  },
  {
    "path": "test/serializer/abstract/Throw8.js",
    "content": "function call(fn) {\n  var template = {};\n  if (global.__makeSimple) global.__makeSimple(template);\n  function residualCall(fn) {\n    var value;\n    var exception;\n    var success = true;\n    try {\n      value = fn();\n    } catch (e) {\n      exception = e;\n      success = false;\n    }\n    return { value, exception, success };\n  }\n  var res = global.__residual ? global.__residual(template, residualCall, fn) : residualCall(fn);\n  if (!res.success) {\n    throw res.exception;\n  }\n  return res.value;\n}\n\nvar fn = global.__abstract ? global.__abstract(\"function\", \"(function () { })\") : function() {};\n\nvar x = 1;\ntry {\n  call(fn);\n  x = 2;\n  //call(fn);\n  x = 3;\n} catch (err) {}\n\ninspect = function() {\n  return x;\n};\n"
  },
  {
    "path": "test/serializer/abstract/Throw9a.js",
    "content": "let x = global.__abstract ? global.__abstract(\"boolean\", \"true\") : true;\nlet y = global.__abstract ? global.__abstract(\"boolean\", \"false\") : false;\nlet z = global.__abstract ? global.__abstract(\"boolean\", \"(false)\") : false;\n\nfunction foo1() {\n  if (x) {\n    if (y) throw new Error(\"x is true\");\n    else return 1;\n  } else {\n    if (z) throw new Error(\"x is false\");\n    else return 2;\n  }\n}\n\nfunction foo2() {\n  if (x) {\n    if (!y) return 1;\n    else throw new Error(\"x is true\");\n  } else {\n    if (z) throw new Error(\"x is false\");\n    else return 2;\n  }\n}\n\nfunction foo3() {\n  if (x) {\n    if (y) throw new Error(\"x is true\");\n    else return 1;\n  } else {\n    if (!z) return 2;\n    throw new Error(\"x is false\");\n  }\n}\n\nfunction foo4() {\n  if (x) {\n    if (!y) return 1;\n    else throw new Error(\"x is true\");\n  } else {\n    if (!z) return 2;\n    throw new Error(\"x is false\");\n  }\n}\n\nvar z1;\nvar z2;\nvar z3;\nvar z4;\n\ntry {\n  z1 = foo1();\n} catch (e) {}\ntry {\n  z2 = foo2();\n} catch (e) {}\ntry {\n  z3 = foo3();\n} catch (e) {}\ntry {\n  z4 = foo4();\n} catch (e) {}\n\ninspect = function() {\n  return [z1, z2, z3, z4].join(\" \");\n};\n"
  },
  {
    "path": "test/serializer/abstract/Throw9b.js",
    "content": "let x = global.__abstract ? global.__abstract(\"boolean\", \"true\") : true;\nlet y = global.__abstract ? global.__abstract(\"boolean\", \"false\") : false;\nlet z = global.__abstract ? global.__abstract(\"boolean\", \"(false)\") : false;\n\nfunction foo1() {\n  if (x) {\n    if (y) throw new Error(\"x is true\");\n    else return 1;\n  } else {\n    throw new Error(\"x is false\");\n  }\n}\n\nfunction foo2() {\n  if (x) {\n    if (!y) return 1;\n    else throw new Error(\"x is true\");\n  } else {\n    throw new Error(\"x is false\");\n  }\n}\n\nfunction foo3() {\n  if (!x) {\n    throw new Error(\"x is false\");\n  } else {\n    if (z) throw new Error(\"x is true\");\n    return 2;\n  }\n}\n\nfunction foo4() {\n  if (!x) {\n    throw new Error(\"x is false\");\n  } else {\n    if (!z) return 2;\n    throw new Error(\"x is true\");\n  }\n}\n\nvar z1;\nvar z2;\nvar z3;\nvar z4;\n\ntry {\n  z1 = foo1();\n} catch (e) {}\ntry {\n  z2 = foo2();\n} catch (e) {}\ntry {\n  z3 = foo3();\n} catch (e) {}\ntry {\n  z4 = foo4();\n} catch (e) {}\n\ninspect = function() {\n  return [z1, z2, z3, z4].join(\" \");\n};\n"
  },
  {
    "path": "test/serializer/abstract/ThrowInConstructor.js",
    "content": "function F() {\n  const b = global.__abstract ? global.__abstract(\"boolean\", \"false\") : false;\n  if (b) throw new Error(\"abrupt\");\n  return { p: 42 };\n}\n\nconst result = new F();\n\nglobal.inspect = () => JSON.stringify(result);\n"
  },
  {
    "path": "test/serializer/abstract/ThrowInConstructor2.js",
    "content": "function F() {\n  const b = global.__abstract ? global.__abstract(\"boolean\", \"true\") : true;\n  return b ? { p: 42 } : 42;\n}\n\nconst result = new F();\n\nglobal.inspect = () => JSON.stringify(result);\n"
  },
  {
    "path": "test/serializer/abstract/ThrowInConstructor3.js",
    "content": "function F() {\n  const b1 = global.__abstract ? global.__abstract(\"boolean\", \"false\") : false;\n  const b2 = global.__abstract ? global.__abstract(\"boolean\", \"true\") : true;\n  if (b1) throw new Error(\"abrupt\");\n  return b2 ? { p: 42 } : 42;\n}\n\nconst result = new F();\n\nglobal.inspect = () => JSON.stringify(result);\n"
  },
  {
    "path": "test/serializer/abstract/ThrowInDoubleCatch.js",
    "content": "try {\n  try {\n    const b = __abstract(\"boolean\", \"false\");\n    if (b) throw new Error(\"throw\");\n  } catch (error) {}\n} catch (error) {\n  console.log(error.message);\n}\n"
  },
  {
    "path": "test/serializer/abstract/ToString.js",
    "content": "let x = global.__abstract ? __abstract(\"number\", \"42\") : 42;\nlet s = x.toString();\nlet t = s.toString();\ninspect = function() {\n  return t;\n};\n"
  },
  {
    "path": "test/serializer/abstract/ToString2.js",
    "content": "let x = global.__abstract ? global.__abstract(\"string\", \"('xxxx')\") : \"xxxx\";\nlet y = global.__abstract ? global.__abstract(\"number\", \"(3)\") : 3;\nlet ob = { toString: () => x };\nlet ob2 = { toString: () => x, valueOf: () => y };\nvar str = \"aaa\" + ob;\nvar num = 123 + ob2;\n\ninspect = function() {\n  return str + num;\n};\n"
  },
  {
    "path": "test/serializer/abstract/ToString3.js",
    "content": "var a = String(global.__abstract ? __abstract(\"string\", '\"foo\"') : \"foo\");\nvar b = String(global.__abstract ? __abstract(\"number\", \"42\") : 42);\nvar c = String(global.__abstract ? __abstract(\"boolean\", \"true\") : true);\n\ninspect = function() {\n  return JSON.stringify({ a, b, c });\n};\n"
  },
  {
    "path": "test/serializer/abstract/ToString4.js",
    "content": "function fn2(cond, obj) {\n  if (cond) {\n    return obj.x;\n  }\n  return false;\n}\n\nfunction fn(cond, obj1, obj2) {\n  var res1 = fn2(cond, obj1);\n  var res2 = fn2(cond, obj2);\n\n  if (res1 > 0) {\n    return res1.toString();\n  }\n  if (res2 > 0) {\n    return res1.toString();\n  }\n  return null;\n}\n\nvar cond = global.__abstract ? __abstract(\"boolean\", \"(false)\") : false;\nvar obj1 = global.__abstract\n  ? __abstract({ x: global.__abstract ? __abstract(\"boolean\", \"obj1.x\") : false }, \"({ x: false })\")\n  : { x: false };\n\nvar obj2 = global.__abstract\n  ? __abstract({ x: global.__abstract ? __abstract(\"boolean\", \"obj2.x\") : false }, \"({ x: false  })\")\n  : { x: false };\n\nvar result = fn(cond, obj1, obj2);\n"
  },
  {
    "path": "test/serializer/abstract/TypeDomain4.js",
    "content": "// does not contain:typeof\n(function() {\n  let a = global.__makeSimple ? global.__makeSimple(__abstract({}, \"{}\")) : {};\n  let b = global.__abstract ? global.__abstract(\"number\", \"100\") : 100;\n  let x = a.x === b;\n  let y = typeof x;\n\n  inspect = function() {\n    return y;\n  };\n})();\n"
  },
  {
    "path": "test/serializer/abstract/TypeDomain5.js",
    "content": "// does not contain:===\n(function() {\n  let x = global.__abstract ? global.__abstract(\"boolean\", \"true\") : true;\n  let a = {};\n  if (x) {\n    a = 100;\n  }\n  let y = a === 200;\n\n  inspect = function() {\n    return y;\n  };\n})();\n"
  },
  {
    "path": "test/serializer/abstract/TypeOf.js",
    "content": "var x = 42;\nvar y = global.__abstract ? global.__abstract(\"number\", x.toString()) : x;\nvar s = typeof y;\n\nlet f = y ? () => 1 : () => 2;\nvar t = typeof f;\n\nlet yy = y * y;\nvar u = typeof yy;\n\nlet b = y > 3;\nvar v = typeof b;\n\ninspect = function() {\n  return s + t + u + v;\n};\n"
  },
  {
    "path": "test/serializer/abstract/TypesDomain.js",
    "content": "let x = global.__abstract ? global.__abstract(\"boolean\", \"true\") : true;\n\nlet o = x ? {} : () => 1;\n\nvar z = o || \"no no no\";\n\nvar z1 = Number.isFinite(o);\n\ninspect = function() {\n  return \"\" + z + z1;\n};\n"
  },
  {
    "path": "test/serializer/abstract/TypesDomain2.js",
    "content": "// throws introspection error\n\nlet x = global.__abstract ? global.__abstract(\"boolean\", \"true\") : true;\n\nlet p = x ? 1 : {};\n\nvar z = isFinite(p);\n\ninspect = function() {\n  return \"\" + z;\n};\n"
  },
  {
    "path": "test/serializer/abstract/TypesDomain3.js",
    "content": "// throws introspection error\n\nlet x = global.__abstract ? global.__abstract(\"boolean\", \"true\") : true;\nlet ob = global.__abstract ? global.__abstract(\"object\", \"({})\") : {};\nif (global.__makeSimple) global.__makeSimple(ob);\n\nlet p = x ? 1 : ob.p;\n\nvar z = Number.isFinite(p);\n\ninspect = function() {\n  return \"\" + z;\n};\n"
  },
  {
    "path": "test/serializer/abstract/UnaryExpression.js",
    "content": "var x = global.__abstract ? global.__abstract(\"number\", \"42\") : 42;\nvar y1 = -x;\nvar y2 = ~x;\nvar y3 = !x;\nvar y4 = typeof x;\ninspect = function() {\n  return \"\" + y1 + y2 + y3 + y4;\n};\n"
  },
  {
    "path": "test/serializer/abstract/UnaryExpression2.js",
    "content": "// throws introspection error\n\nvar b = global.__abstract ? global.__abstract(\"boolean\", \"true\") : true;\nvar x = global.__abstract ? global.__abstract(\"number\", \"123\") : 123;\nvar badOb = {\n  valueOf: function() {\n    throw 13;\n  },\n};\nvar ob = global.__abstract ? global.__abstract(\"object\", \"({ valueOf: function() { throw 13;} })\") : badOb;\nvar y = b ? ob : x;\nvar z;\ntry {\n  z = -y;\n} catch (err) {\n  z = -err;\n}\n\ninspect = function() {\n  return \"\" + z;\n};\n"
  },
  {
    "path": "test/serializer/abstract/UnknownNumericKey.js",
    "content": "var n = global.__abstract ? global.__abstract(\"number\", \"(0)\") : 0;\nvar result = { 0: \"a\" }[n];\ninspect = function() {\n  return result;\n};\n"
  },
  {
    "path": "test/serializer/abstract/UnknownNumericKeyAssignment.js",
    "content": "var n = global.__abstract ? global.__abstract(\"number\", \"(0)\") : 0;\nvar obj = { 0: \"a\", 1: \"b\" };\nobj[n] = \"c\";\ninspect = function() {\n  return JSON.stringify(obj);\n};\n"
  },
  {
    "path": "test/serializer/abstract/UnknownObjectKey.js",
    "content": "var o = global.__abstract\n  ? global.__abstract(\"object\", '({toString() { return \"x\"; }})')\n  : {\n      toString() {\n        return \"x\";\n      },\n    };\nif (global.__makeSimple) global.__makeSimple(o);\nif (global.__makePartial) global.__makePartial(o);\nvar result = { x: \"a\" }[o];\ninspect = function() {\n  return result;\n};\n"
  },
  {
    "path": "test/serializer/abstract/UnknownObjectKeyAssignment.js",
    "content": "var o = global.__abstract\n  ? global.__abstract(\"object\", '({toString() { return \"x\"; }})')\n  : {\n      toString() {\n        return \"x\";\n      },\n    };\nif (global.__makeSimple) global.__makeSimple(o);\nif (global.__makePartial) global.__makePartial(o);\nvar obj = { x: \"a\" };\nobj[o] = \"b\";\ninspect = function() {\n  return obj.x;\n};\n"
  },
  {
    "path": "test/serializer/abstract/UnknownPropertyOnPrimitive.js",
    "content": "var b = global.__abstract ? global.__abstract(\"boolean\", \"(true)\") : true;\nvar n = global.__abstract ? global.__abstract(\"number\", \"(0)\") : 0;\nb[n] = \"noop\";\ninspect = function() {\n  return b[\"0\"];\n};\n"
  },
  {
    "path": "test/serializer/abstract/UpdateExpression.js",
    "content": "let x = global.__abstract ? global.__abstract(\"number\", \"42\") : 42;\nlet y = x++;\n++x;\nlet z = --y;\ny--;\ninspect = function() {\n  return \"\" + x + y + z;\n};\n"
  },
  {
    "path": "test/serializer/abstract/UpdateExpression2.js",
    "content": "let x = global.__abstract ? global.__abstract(\"number\", \"42\") : 42;\nlet obj = { x: x };\nlet arr = [x, { obj: obj }];\nlet y = obj.x++;\ny = ++arr[0];\nlet z = y;\nObject.defineProperty(obj, \"z\", {\n  get() {\n    return y;\n  },\n  set(value) {\n    z += value;\n  },\n});\ny -= arr[1].obj.z++;\ninspect = function() {\n  return \"\" + obj.x + y + arr[0] + z + obj.z;\n};\n"
  },
  {
    "path": "test/serializer/abstract/UpdateExpression3.js",
    "content": "var foo = { x: 42 };\nlet obj = global.__makePartial ? global.__makePartial({ x: __abstract(\"number\", \"foo.x\") }) : foo;\nlet y = obj.x++;\ninspect = function() {\n  return \"\" + obj.x + y;\n};\n"
  },
  {
    "path": "test/serializer/abstract/UpdateExpression4.js",
    "content": "// throws introspection error\n\nvar b = global.__abstract ? global.__abstract(\"boolean\", \"true\") : true;\nvar x = global.__abstract ? global.__abstract(\"number\", \"123\") : 123;\nbadOb = {\n  valueOf: function() {\n    throw 13;\n  },\n};\nvar ob = global.__abstract ? global.__abstract(\"object\", \"badOb\") : badOb;\nvar y = b ? ob : x;\n\ntry {\n  y++;\n} catch (err) {\n  y = 1234;\n}\nz = y;\n\ninspect = function() {\n  return \"\" + z;\n};\n"
  },
  {
    "path": "test/serializer/abstract/UseAbstractObjectValueTemplateInIsCall.js",
    "content": "let obj = global.__abstract ? __abstract({}, \"obj\") : {};\nlet func = global.__abstract ? __abstract(function() {}, \"func\") : function() {};\nglobal.result = typeof obj + \"/\" + typeof func;\nglobal.inspect = function() {\n  return global.result;\n};\n"
  },
  {
    "path": "test/serializer/abstract/WaitGenerator0.js",
    "content": "(function() {\n  let a = global.__abstract ? __abstract(\"boolean\", \"(true)\") : true;\n  let b = global.__abstract ? __abstract(\"boolean\", \"(true )\") : true;\n  let x;\n  if (a) {\n    if (b) {\n      x = Date.now(); // definition\n    }\n    var xx = x; // use of `x`\n  }\n  xxx = x; // use of `x`\n  inspect = function() {\n    return xx >= 0;\n  };\n})();\n"
  },
  {
    "path": "test/serializer/abstract/WaitGenerator0a.js",
    "content": "(function() {\n  let a = global.__abstract ? __abstract(\"boolean\", \"(true)\") : true;\n  let b = global.__abstract ? __abstract(\"boolean\", \"(true )\") : true;\n  let c = global.__abstract ? __abstract(\"boolean\", \"(true  )\") : true;\n  let x;\n  if (a) {\n    if (b) {\n      x = Date.now(); // definition\n    }\n    if (c) {\n      var xx = x; // use of `x`\n    } else {\n      xx = x; // use of `x`\n    }\n  }\n  var xxx = x; // use of `x`\n  inspect = function() {\n    return Object.is(xx, xxx) && xx >= 0;\n  };\n})();\n"
  },
  {
    "path": "test/serializer/abstract/WaitGenerator0b.js",
    "content": "(function() {\n  let a = global.__abstract ? __abstract(\"boolean\", \"(true)\") : true;\n  let b = global.__abstract ? __abstract(\"boolean\", \"(true )\") : true;\n  let c = global.__abstract ? __abstract(\"boolean\", \"(true  )\") : true;\n  let x;\n  if (a) {\n    if (b) {\n      x = Date.now(); // definition\n    }\n    if (c) {\n      var xx = x + 1; // use of `x`\n    } else {\n      xx = x + 2; // use of `x`\n    }\n  }\n  xxx = x + 3; // use of `x`\n  inspect = function() {\n    return xx >= 0;\n  };\n})();\n"
  },
  {
    "path": "test/serializer/abstract/WaitGenerator1.js",
    "content": "(function() {\n  let x = global.__abstract ? __abstract(\"boolean\", \"(true)\") : true;\n  let obj = { time: 99 };\n  var f;\n  if (x) {\n    obj.time = Date.now();\n    f = function() {\n      return obj;\n    };\n  } else {\n    f = function() {\n      return obj;\n    };\n  }\n  inspect = function() {\n    return f().time > 0;\n  };\n})();\n"
  },
  {
    "path": "test/serializer/abstract/WaitGenerator2.js",
    "content": "(function() {\n  let x = global.__abstract ? __abstract(\"boolean\", \"(true)\") : true;\n  global.obj = {};\n  if (x) {\n    var scope = Date.now();\n    global.obj.time = scope;\n  } else {\n    global.obj.time = 33;\n  }\n  inspect = function() {\n    return global.obj.time > 0;\n  };\n})();\n"
  },
  {
    "path": "test/serializer/abstract/WaitGenerator3.js",
    "content": "(function() {\n  let x = global.__abstract ? __abstract(\"boolean\", \"true\") : true;\n  global.obj = { time: 99 };\n  let dummy = {}; // Dummy closure binding to trigger global scope serialization in the middle of sub-generator.\n  if (x) {\n    global.obj.time = Date.now();\n    expose = function() {\n      return dummy;\n    };\n  } else {\n    global.obj.time = 33;\n  }\n  inspect = function() {\n    return global.obj.time > 0;\n  };\n})();\n"
  },
  {
    "path": "test/serializer/abstract/WaitGenerator4.js",
    "content": "(function() {\n  let x = global.__abstract ? __abstract(\"boolean\", \"(true)\") : true;\n  // Create second abstract value with a different name so that !x.equals(y).\n  let y = global.__abstract ? __abstract(\"boolean\", \"((true))\") : true;\n  let obj = { time: 99 };\n  var f;\n  if (x) {\n    if (y) {\n      // Wait for abstract value in sub-generator more than one depth.\n      obj.time = Date.now();\n    } else {\n      delete obj.time;\n    }\n    f = function() {\n      return obj;\n    };\n  } else {\n    f = function() {\n      return obj;\n    };\n  }\n  inspect = function() {\n    return f().time > 0;\n  };\n})();\n"
  },
  {
    "path": "test/serializer/abstract/WaitGenerator5.js",
    "content": "// The conditional abstract value \"obj.time\" is referenced both from residual function and global scope.\n(function() {\n  let x = global.__abstract ? __abstract(\"boolean\", \"(true)\") : true;\n  // Reference \"obj.time\" before its dependency abstract value \"scope\" to trigger wait generator body ordering.\n  residual = function() {\n    return obj.time > 0;\n  };\n  var obj = {};\n  if (x) {\n    var scope = Date.now();\n    obj.time = scope;\n  } else {\n    obj.time = -33;\n  }\n  global.obj = obj.time;\n  inspect = function() {\n    return global.obj.time > 0;\n  };\n})();\n"
  },
  {
    "path": "test/serializer/abstract/WeakMap.js",
    "content": "// es6\nlet x = global.__abstract ? __abstract(\"boolean\", \"true\") : true;\nlet foo = { x: \"yz\" };\nlet bar1 = { y: 1 };\nlet bar2 = { y: 2 };\n\nlet wm = new WeakMap();\n\nif (x) wm.set(foo, bar1);\nelse wm.set(foo, bar2);\n\nvar x1 = wm.get(foo);\nvar x2 = wm.has(foo);\nvar x3 = wm.has(bar1);\nvar x4 = wm.delete(foo);\nvar x5 = wm.has(foo);\nvar x6 = wm.get(foo);\nvar x7 = x ? wm.set(bar1, foo) : wm.set(bar2, foo);\n// The code below does not currently work but could be made to work with a bit more effort. See #1047.\n// x8 = wm.delete(bar1);\n\ninspect = function() {\n  return JSON.stringify([x1, x2, x3, x4, x5, x6, x7, \"x8\"]);\n};\n"
  },
  {
    "path": "test/serializer/abstract/WeakSet.js",
    "content": "// es6\nlet x = global.__abstract ? __abstract(\"boolean\", \"true\") : true;\nlet bar0 = { y: 0 };\nlet bar1 = { y: 1 };\nlet bar2 = { y: 2 };\n\nlet ws = new WeakSet();\nvar x1 = ws.add(bar0);\n\nif (x) ws.add(bar1);\nelse ws.add(bar2);\n\nvar x2 = ws.has(bar0);\nvar x3 = ws.delete(bar0);\n// The code below does not currently work but could be made to work with a bit more effort. See #1047.\n// x4 = ws.has(bar0);\n// x5 = ws.delete(bar0);\n// x6 = ws.has(bar0);\n\ninspect = function() {\n  return JSON.stringify([x1, x2, x3, \"x4\", \"x5\", \"x6\"]);\n};\n"
  },
  {
    "path": "test/serializer/abstract/WhileLoop.js",
    "content": "while (true) {\n  break;\n}\n"
  },
  {
    "path": "test/serializer/abstract/With.js",
    "content": "// throws introspection error\n\nlet obj = global.__abstract ? __abstract(\"object\", \"({x:1,y:3})\") : { x: 1, y: 3 };\nif (global.__makeSimple) global.__makeSimple(obj);\nlet y = 2;\nwith (obj) {\n  z = x + y;\n}\ninspect = function() {\n  return z;\n};\n"
  },
  {
    "path": "test/serializer/abstract/defineProperty.js",
    "content": "// throws introspection error\nlet x = global.__abstract ? __abstract(\"object\", \"({p: 1})\") : { p: 1 };\nObject.defineProperty(x, \"q\", { enumerable: false, value: 2 });\n"
  },
  {
    "path": "test/serializer/abstract/defineProperty2.js",
    "content": "// throws introspection error\nlet x = __abstract(\"boolean\", \"true\");\nlet ob1 = [];\nObject.defineProperty(ob1, \"length\", { writable: false, value: 0 });\nlet ob2 = [];\nlet ob = x ? ob1 : ob2;\nObject.defineProperty(ob, \"0\", { value: 1 });\n"
  },
  {
    "path": "test/serializer/abstract/getOwnPropertyDescriptor.js",
    "content": "let x = global.__makePartial ? __makePartial({ p: 1 }, \"({p: 1})\") : { p: 1 };\nObject.defineProperty(x, \"p\", { enumerable: false, value: 2 });\nvar z = Object.getOwnPropertyDescriptor(x, \"p\");\ninspect = function() {\n  return JSON.stringify(z);\n};\n"
  },
  {
    "path": "test/serializer/abstract/getOwnPropertyDescriptor2.js",
    "content": "// throws introspection error\nlet x = __makePartial({ p: 1 }, \"({p: 1})\");\nz = Object.getOwnPropertyDescriptor(x, \"q\");\nconsole.log(z);\n"
  },
  {
    "path": "test/serializer/abstract/getOwnPropertyDescriptor3.js",
    "content": "// throws introspection error\nlet x = __abstract(\"boolean\", \"true\");\nlet ob = { a: 1 };\nif (x) {\n  delete ob.a;\n}\nlet desc = Object.getOwnPropertyDescriptor(ob, \"a\");\nconsole.log(JSON.stringify(desc));\n"
  },
  {
    "path": "test/serializer/abstract/getOwnPropertyDescriptor4.js",
    "content": "let x = global.__abstract ? __abstract(\"boolean\", \"true\") : true;\nlet ob = x ? { a: 1 } : { b: 2 };\nlet desc = Object.getOwnPropertyDescriptor(ob, \"a\");\ninspect = function() {\n  return desc;\n};\n"
  },
  {
    "path": "test/serializer/abstract/getOwnPropertyDescriptor5.js",
    "content": "let x = global.__abstract ? __abstract(\"boolean\", \"true\") : true;\nlet ob = x ? { a: 1 } : { a: 2 };\nvar desc = Object.getOwnPropertyDescriptor(ob, \"a\");\nObject.defineProperty(ob, \"b\", desc);\nvar b = ob.b;\ninspect = function() {\n  return JSON.stringify(desc) + b;\n};\n"
  },
  {
    "path": "test/serializer/abstract/getOwnPropertyDescriptor6.js",
    "content": "let x = global.__abstract ? __abstract(\"boolean\", \"true\") : true;\nlet desc = Object.getOwnPropertyDescriptor(\n  {\n    get a() {\n      return 1;\n    },\n  },\n  \"a\"\n);\nlet ob1 = {};\nObject.defineProperty(ob1, \"a\", desc);\nlet ob2 = {};\nObject.defineProperty(ob2, \"a\", desc);\nlet ob = x ? ob1 : ob2;\nvar desc2 = Object.getOwnPropertyDescriptor(ob, \"a\");\ninspect = function() {\n  return JSON.stringify(desc2);\n};\n"
  },
  {
    "path": "test/serializer/abstract/getOwnPropertyDescriptor7.js",
    "content": "// es6\nlet nondet = global.__abstract ? __abstract(\"boolean\", \"true\") : true;\nglobal.a = undefined;\nlet descriptor;\nif (nondet) {\n  descriptor = Object.getOwnPropertyDescriptor(global, \"a\");\n  if (\"get\" in descriptor) global.b = \"impossible 1\";\n  Object.defineProperty(global, \"a\", {\n    get: function() {\n      return 123;\n    },\n  });\n} else {\n  descriptor = Object.getOwnPropertyDescriptor(global, \"a\");\n  if (\"get\" in descriptor) global.b = \"impossible 2\";\n  Object.defineProperty(global, \"a\", {\n    get: function() {\n      return 456;\n    },\n  });\n}\n\ninspect = function() {\n  return global.b === undefined && global.a === 123;\n};\n"
  },
  {
    "path": "test/serializer/abstract/getOwnPropertyDescriptor8.js",
    "content": "let desc = Object.getOwnPropertyDescriptor(Map.prototype, \"size\");\ninspect = function() {\n  return JSON.stringify(desc);\n};\n"
  },
  {
    "path": "test/serializer/abstract/getOwnPropertyDescriptor9.js",
    "content": "let x = global.__abstract ? __abstract(\"boolean\", \"true\") : true;\nlet nonEnumerableA = { a: 1 };\nObject.defineProperty(nonEnumerableA, \"a\", { enumerable: false });\nlet ob = x ? nonEnumerableA : { a: 2 };\nlet desc = Object.getOwnPropertyDescriptor(ob, \"a\");\ninspect = function() {\n  return desc;\n};\n"
  },
  {
    "path": "test/serializer/abstract/object-assign10.js",
    "content": "var obj =\n  global.__abstract && global.__makePartial && global.__makeSimple\n    ? __makeSimple(__makePartial(__abstract({ foo: __abstract(\"number\") }, \"({foo:1})\")))\n    : { foo: 1 };\n\nvar copyOfObj = {};\nObject.assign(copyOfObj, obj);\ndelete copyOfObj.foo;\n\ninspect = function() {\n  return JSON.stringify(copyOfObj);\n};\n"
  },
  {
    "path": "test/serializer/abstract/object-assign11.js",
    "content": "var obj =\n  global.__abstract && global.__makePartial && global.__makeSimple\n    ? __makeSimple(__makePartial(__abstract({}, \"({foo:1})\")))\n    : { foo: 1 };\n\nvar copyOfObj = {};\nvar y = 0;\nObject.assign(copyOfObj, obj);\n\nvar proto = {};\nObject.defineProperty(proto, \"foo\", {\n  enumerable: true,\n  set() {\n    y = 42;\n  },\n});\ncopyOfObj.__proto__ = proto;\n\ninspect = function() {\n  return JSON.stringify(y);\n};\n"
  },
  {
    "path": "test/serializer/abstract/object-assign12.js",
    "content": "var obj =\n  global.__abstract && global.__makePartial && global.__makeSimple\n    ? __makeSimple(__makePartial(__abstract({}, \"({foo:1})\")))\n    : { foo: 1 };\nvar copyOfObj = Object.assign({}, { foo: 2 }, obj);\ncopyOfObj.foo = 123;\nObject.assign(copyOfObj, obj);\nlet f = copyOfObj.foo;\n\ninspect = function() {\n  return f;\n};\n"
  },
  {
    "path": "test/serializer/abstract/object-assign2.js",
    "content": "var obj =\n  global.__abstract && global.__makePartial && global.__makeSimple\n    ? __makeSimple(__makePartial(__abstract({}, \"({foo:1})\")))\n    : { foo: 1 };\nvar copyOfObj = Object.assign({}, { foo: 2 }, obj);\n\ninspect = function() {\n  return JSON.stringify(copyOfObj);\n};\n"
  },
  {
    "path": "test/serializer/abstract/object-assign3.js",
    "content": "var obj =\n  global.__abstract && global.__makePartial && global.__makeSimple\n    ? __makeSimple(__makePartial(__abstract({}, \"({foo:1})\")))\n    : { foo: 1 };\n\nvar x = {};\nvar y = { [Symbol.split]: 3 };\nObject.assign(x, obj, y, { bar: 2 });\ny.foo = 2;\ny[Symbol.split] = 4;\n\ninspect = function() {\n  return JSON.stringify(x);\n};\n"
  },
  {
    "path": "test/serializer/abstract/object-assign4.js",
    "content": "// abstract effects\nvar __evaluatePureFunction = this.__evaluatePureFunction || (f => f());\nvar obj =\n  global.__abstract && global.__makePartial && global.__makeSimple\n    ? __makeSimple(__makePartial(__abstract({}, \"({foo:1})\")))\n    : { foo: 1 };\n\n// Intentionally allocate outside the pure scope.\nvar copyOfObj = {};\n\n__evaluatePureFunction(() => {\n  Object.assign(copyOfObj, obj);\n  // Normally at this point we would leak it,\n  // but we can't because it was created outside the pure scope.\n  copyOfObj.x = 10;\n});\n\ninspect = function() {\n  return JSON.stringify(copyOfObj);\n};\n"
  },
  {
    "path": "test/serializer/abstract/object-assign5.js",
    "content": "var obj =\n  global.__abstract && global.__makePartial && global.__makeSimple\n    ? __makeSimple(__makePartial(__abstract({}, \"({foo:1})\")))\n    : { foo: 1 };\n\nvar copyOfObj = Object.assign({}, obj);\nvar copyOfCopyOfObj = Object.assign({}, copyOfObj);\n\ncopyOfObj.x = 10;\n\ninspect = function() {\n  return JSON.stringify(copyOfCopyOfObj);\n};\n"
  },
  {
    "path": "test/serializer/abstract/object-assign5a.js",
    "content": "// skip this test for now\nvar obj =\n  global.__abstract && global.__makePartial && global.__makeSimple\n    ? __makeSimple(__makePartial(__abstract({}, \"({foo:1})\")))\n    : { foo: 1 };\n\nvar copyOfObj = Object.assign({}, obj);\ncopyOfObj[Symbol.split] = 10000;\nvar copyOfCopyOfObj = Object.assign({}, copyOfObj);\nlet copyOfCopyOfObjSplit = copyOfCopyOfObj[Symbol.split];\ncopyOfObj[Symbol.split] = 20000;\nlet copyOfObjSplit = copyOfObj[Symbol.split];\n\ninspect = function() {\n  return copyOfCopyOfObjSplit + JSON.stringify(copyOfCopyOfObj) + copyOfObjSplit;\n};\n"
  },
  {
    "path": "test/serializer/abstract/object-assign5b.js",
    "content": "// skip this test for now\nvar obj =\n  global.__abstract && global.__makePartial && global.__makeSimple\n    ? __makeSimple(__makePartial(__abstract({}, \"({foo:1, [Symbol.split]:999})\")))\n    : { foo: 1, [Symbol.split]: 999 };\n\nvar copyOfObj = Object.assign({}, obj);\nvar copyOfCopyOfObj = Object.assign({}, copyOfObj);\ncopyOfObj.x = 10;\nlet oldSplit = copyOfObj[Symbol.split];\ncopyOfObj[Symbol.split] = 3;\n\ninspect = function() {\n  return oldSplit + \" \" + JSON.stringify(copyOfCopyOfObj);\n};\n"
  },
  {
    "path": "test/serializer/abstract/object-assign6.js",
    "content": "var obj =\n  global.__abstract && global.__makePartial && global.__makeSimple\n    ? __makeSimple(__makePartial(__abstract({}, \"({foo:1})\")))\n    : { foo: 1 };\n\nvar copyOfObj = {};\nObject.assign(copyOfObj, obj);\ncopyOfObj.x = 10;\n\ninspect = function() {\n  return JSON.stringify(copyOfObj);\n};\n"
  },
  {
    "path": "test/serializer/abstract/object-assign7.js",
    "content": "var obj =\n  global.__abstract && global.__makePartial && global.__makeSimple\n    ? __makeSimple(__makePartial(__abstract({ foo: __abstract(\"number\") }, \"({foo:1})\")))\n    : { foo: 1 };\n\nvar copyOfObj = {};\nObject.assign(copyOfObj, obj);\ncopyOfObj.foo = 2;\n\ninspect = function() {\n  return JSON.stringify(copyOfObj);\n};\n"
  },
  {
    "path": "test/serializer/abstract/object-assign8.js",
    "content": "var obj =\n  global.__abstract && global.__makePartial && global.__makeSimple\n    ? __makeSimple(__makePartial(__abstract({}, \"({foo:1})\")))\n    : { foo: 1 };\n\nvar copyOfObj = {};\nObject.assign(copyOfObj, obj);\nObject.defineProperty(copyOfObj, \"x\", {\n  enumerable: true,\n  get() {\n    return 10;\n  },\n});\n\ninspect = function() {\n  return JSON.stringify(copyOfObj);\n};\n"
  },
  {
    "path": "test/serializer/abstract/object-assign9.js",
    "content": "var obj =\n  global.__abstract && global.__makePartial && global.__makeSimple\n    ? __makeSimple(__makePartial(__abstract({}, \"({foo:1})\")))\n    : { foo: 1 };\n\nvar copyOfObj = {};\nvar y = 0;\nObject.assign(copyOfObj, obj);\nObject.defineProperty(copyOfObj, \"foo\", {\n  enumerable: true,\n  set() {\n    y = 42;\n  },\n});\n\ninspect = function() {\n  return JSON.stringify(y);\n};\n"
  },
  {
    "path": "test/serializer/abstract/reflectHas.js",
    "content": "let ob = global.__makePartial ? __makePartial({ p: 1 }) : { p: 1 };\nvar z = Reflect.has(ob, \"p\");\n\nlet b = global.__abstract ? __abstract(\"boolean\", \"true\") : true;\nob = b ? { p: 1 } : { p: 2 };\nvar z1 = Reflect.has(ob, \"p\");\n\ninspect = function() {\n  return \"\" + z + z1;\n};\n"
  },
  {
    "path": "test/serializer/abstract/reflectHas1.js",
    "content": "// throws introspection error\n\nlet ob = __makePartial({ p: 1 }, \"({p: 1})\");\nz = Reflect.has(ob, \"q\");\n"
  },
  {
    "path": "test/serializer/abstract/reflectHas2.js",
    "content": "// throws introspection error\n\nlet b = __abstract(\"boolean\", \"true\");\nob = b ? { p: 1 } : { q: 2 };\nz1 = Reflect.has(ob, \"p\");\n"
  },
  {
    "path": "test/serializer/abstract/require_tracking.js",
    "content": "// es6\n// throws introspection error\n\nvar modules = Object.create(null);\n\n__d = define;\nfunction require(moduleId) {\n  var moduleIdReallyIsNumber = moduleId;\n  var module = modules[moduleIdReallyIsNumber];\n  return module && module.isInitialized ? module.exports : guardedLoadModule(moduleIdReallyIsNumber, module);\n}\n\nfunction define(factory, moduleId, dependencyMap) {\n  if (moduleId in modules) {\n    return;\n  }\n  modules[moduleId] = {\n    dependencyMap: dependencyMap,\n    exports: undefined,\n    factory: factory,\n    hasError: false,\n    isInitialized: false,\n  };\n\n  var _verboseName = arguments[3];\n  if (_verboseName) {\n    modules[moduleId].verboseName = _verboseName;\n    global.verboseNamesToModuleIds[_verboseName] = moduleId;\n  }\n}\n\nvar inGuard = false;\nfunction guardedLoadModule(moduleId, module) {\n  if (!inGuard && global.ErrorUtils) {\n    inGuard = true;\n    var returnValue = void 0;\n    try {\n      returnValue = loadModuleImplementation(moduleId, module);\n    } catch (e) {\n      global.ErrorUtils.reportFatalError(e);\n    }\n    inGuard = false;\n    return returnValue;\n  } else {\n    return loadModuleImplementation(moduleId, module);\n  }\n}\n\nfunction loadModuleImplementation(moduleId, module) {\n  var nativeRequire = global.nativeRequire;\n  if (!module && nativeRequire) {\n    nativeRequire(moduleId);\n    module = modules[moduleId];\n  }\n\n  if (!module) {\n    throw unknownModuleError(moduleId);\n  }\n\n  if (module.hasError) {\n    throw moduleThrewError(moduleId);\n  }\n\n  module.isInitialized = true;\n  var exports = (module.exports = {});\n  var _module = module,\n    factory = _module.factory,\n    dependencyMap = _module.dependencyMap;\n  try {\n    var _moduleObject = { exports: exports };\n\n    factory(global, require, _moduleObject, exports, dependencyMap);\n\n    module.factory = undefined;\n\n    return (module.exports = _moduleObject.exports);\n  } catch (e) {\n    module.hasError = true;\n    module.isInitialized = false;\n    module.exports = undefined;\n    throw e;\n  }\n}\n\nfunction unknownModuleError(id) {\n  var message = 'Requiring unknown module \"' + id + '\".';\n  return Error(message);\n}\n\nfunction moduleThrewError(id) {\n  return Error('Requiring module \"' + id + '\", which threw an exception.');\n}\n\n// === End require code ===\n\ndefine(function(global, require, module, exports) {\n  var y = require(2);\n  var obj = global.__abstract ? global.__abstract(undefined, \"({unsupported: true})\") : { unsupported: true };\n  if (obj.unsupported) {\n    exports.magic = 42 + y.foo;\n  } else {\n    exports.magic = 23 + y.foo;\n  }\n}, 0, null);\n\ndefine(function(global, require, module, exports) {\n  var x = require(0);\n  module.exports = function() {\n    return x;\n  };\n}, 1, null);\n\ndefine(function(global, require, module, exports) {\n  module.exports = { foo: 5 };\n}, 2, null);\n\nvar f = require(1);\n\ninspect = function() {\n  return f().magic;\n};\n"
  },
  {
    "path": "test/serializer/abstract/require_tracking2.js",
    "content": "// es6\n\nvar modules = Object.create(null);\n\n__d = define;\nfunction require(moduleId) {\n  var moduleIdReallyIsNumber = moduleId;\n  var module = modules[moduleIdReallyIsNumber];\n  return module && module.isInitialized ? module.exports : guardedLoadModule(moduleIdReallyIsNumber, module);\n}\n\nfunction define(factory, moduleId, dependencyMap) {\n  if (moduleId in modules) {\n    return;\n  }\n  modules[moduleId] = {\n    dependencyMap: dependencyMap,\n    exports: undefined,\n    factory: factory,\n    hasError: false,\n    isInitialized: false,\n  };\n\n  var _verboseName = arguments[3];\n  if (_verboseName) {\n    modules[moduleId].verboseName = _verboseName;\n    global.verboseNamesToModuleIds[_verboseName] = moduleId;\n  }\n}\n\nvar inGuard = false;\nfunction guardedLoadModule(moduleId, module) {\n  if (!inGuard && global.ErrorUtils) {\n    inGuard = true;\n    var returnValue = void 0;\n    try {\n      returnValue = loadModuleImplementation(moduleId, module);\n    } catch (e) {\n      global.ErrorUtils.reportFatalError(e);\n    }\n    inGuard = false;\n    return returnValue;\n  } else {\n    return loadModuleImplementation(moduleId, module);\n  }\n}\n\nfunction loadModuleImplementation(moduleId, module) {\n  var nativeRequire = global.nativeRequire;\n  if (!module && nativeRequire) {\n    nativeRequire(moduleId);\n    module = modules[moduleId];\n  }\n\n  if (!module) {\n    throw unknownModuleError(moduleId);\n  }\n\n  if (module.hasError) {\n    throw moduleThrewError(moduleId);\n  }\n\n  module.isInitialized = true;\n  var exports = (module.exports = {});\n  var _module = module,\n    factory = _module.factory,\n    dependencyMap = _module.dependencyMap;\n  try {\n    var _moduleObject = { exports: exports };\n\n    factory(global, require, _moduleObject, exports, dependencyMap);\n\n    module.factory = undefined;\n\n    return (module.exports = _moduleObject.exports);\n  } catch (e) {\n    module.hasError = true;\n    module.isInitialized = false;\n    module.exports = undefined;\n    throw e;\n  }\n}\n\nfunction unknownModuleError(id) {\n  var message = 'Requiring unknown module \"' + id + '\".';\n  return Error(message);\n}\n\nfunction moduleThrewError(id) {\n  return Error('Requiring module \"' + id + '\", which threw an exception.');\n}\n\n// === End require code ===\n\ndefine(function(global, require, module, exports) {\n  let condition = global.__abstract ? global.__abstract(\"boolean\", \"true\") : true;\n  let obj1 = global.__abstract ? global.__abstract(\"object\", \"({ foo: 5 })\") : { foo: 5 };\n  let obj2 = global.__abstract ? global.__abstract(\"object\", \"({ foo: 8 })\") : { foo: 8 };\n  module.exports = condition ? obj1 : obj2;\n}, 0, null);\n\ndefine(function(global, require, module, exports) {\n  //let condition = global.__abstract ? __abstract(\"boolean\", \"true\") : true;\n  let topNum = global.__abstract ? global.__abstract(\"number\", \"5\") : 5;\n  module.exports = topNum;\n}, 4, null);\n\ndefine(function(global, require, module, exports) {\n  var x = require(0);\n  module.exports = function() {\n    return x;\n  };\n}, 1, null);\n\ndefine(function(global, require, module, exports) {\n  module.exports = { foo: 5 };\n}, 2, null);\n\nvar f = require(1);\n\ninspect = function() {\n  return f().magic + require(1).foo;\n};\n"
  },
  {
    "path": "test/serializer/abstract/toLocaleString.js",
    "content": "// throws introspection error\n\nvar x = __abstract(\"number\");\nvar y = x.toLocaleString();\nif (y) {\n}\n"
  },
  {
    "path": "test/serializer/additional-functions/AdditionalFunCapturedScope.js",
    "content": "// serialized function clone count: 0\n// expected Warning: PP1007\nvar addit_funs = [];\n\nvar f = function(x) {\n  var i = x > 5 ? 0 : 1;\n  var fun = function() {\n    i += 1;\n    return i;\n  };\n  if (global.__optimize) global.__optimize(fun);\n  addit_funs.push(fun);\n  return fun;\n};\n\nvar g = [f(2), f(6), f(4), f(9)];\n\ninspect = function() {\n  addit_funs.forEach(x => x());\n  let res1 = g[0]() + \" \" + g[1]() + \" \" + g[2]() + \" \" + g[3]();\n  addit_funs.forEach(x => x());\n  let res2 = g[0]() + \" \" + g[1]() + \" \" + g[2]() + \" \" + g[3]();\n  return \"PASS\";\n  //return res1 + \" \" + res2;\n};\n"
  },
  {
    "path": "test/serializer/additional-functions/ArrayConcat.js",
    "content": "function fn(arg) {\n  var x = Array.from(arg).map(x => x);\n  return [\"start\"].concat(x).concat([\"end\"]);\n}\n\nif (global.__optimize) __optimize(fn);\n\ninspect = function() {\n  return JSON.stringify([fn([1, 2, 3]), fn([4, 5, 6])]);\n};\n"
  },
  {
    "path": "test/serializer/additional-functions/Class.js",
    "content": "(function() {\n  function f() {\n    class foo {\n      doSomething() {\n        return 42;\n      }\n    }\n    return foo;\n  }\n  if (global.__optimize) __optimize(f);\n  inspect = function() {\n    return new (f())().doSomething();\n  };\n})();\n"
  },
  {
    "path": "test/serializer/additional-functions/DeadCodeCheck.js",
    "content": "// does not contain:x.thisShouldNotAppear\n\nfunction fn(x) {\n  var a = x.thisShouldNotAppear;\n\n  return 10;\n}\n\nglobal.__optimize && __optimize(fn);\n\ninspect = function() {\n  return fn({});\n};\n"
  },
  {
    "path": "test/serializer/additional-functions/DeadOuterObject.js",
    "content": "// expected Warning: PP1007\n\n(function() {\n  let outer = {};\n  function f(x) {\n    outer.x = x;\n  }\n  if (global.__optimize) __optimize(f);\n  global.f = f;\n  inspect = function() {\n    return true;\n  };\n})();\n"
  },
  {
    "path": "test/serializer/additional-functions/DelayInitializations1.js",
    "content": "(function() {\n  function f() {\n    let obj = {};\n    return function() {\n      return obj;\n    };\n  }\n  global.__optimize && __optimize(f);\n  inspect = function() {\n    return f()() === f()();\n  };\n})();\n"
  },
  {
    "path": "test/serializer/additional-functions/DelayInitializations2.js",
    "content": "(function() {\n  function f(c) {\n    let obj = c ? {} : undefined;\n    return function() {\n      return obj;\n    };\n  }\n  global.__optimize && __optimize(f);\n  inspect = function() {\n    return f(true)() === f(true)();\n  };\n})();\n"
  },
  {
    "path": "test/serializer/additional-functions/DelayInitializations3.js",
    "content": "(function() {\n  function f() {\n    let a = global.__abstract ? __abstract(undefined, \"(42)\") : 42;\n    function nested() {\n      return a;\n    }\n    return nested;\n  }\n  global.__optimize && __optimize(f);\n  inspect = function() {\n    return \"\" + f()() + \"/\" + f()();\n  };\n})();\n"
  },
  {
    "path": "test/serializer/additional-functions/EmitPropertyRegressionTest.js",
    "content": "// expected Warning: PP0023\n(function() {\n  function URI(other) {\n    if (other.foo) {\n      setBarFrom(this, other.bar);\n      serialize(other.foo);\n      return true;\n    }\n    this.foo = other.noSuchMethod() || {};\n    return true;\n  }\n\n  function setBarFrom(uri, bar) {\n    if (!bar.something) {\n      throw new Error(\"no\");\n    }\n    uri.bar = bar;\n    return uri;\n  }\n\n  function serialize(obj) {\n    for (var k in obj) {\n    }\n  }\n\n  function fn(arg) {\n    var first = new URI(arg);\n    if (arg) {\n      new URI(first);\n    }\n  }\n\n  if (global.__optimize) __optimize(fn);\n\n  global.fn = fn;\n\n  inspect = function() {\n    return true;\n  }; // just make sure Prepack doesn't crash while generating code\n})();\n"
  },
  {
    "path": "test/serializer/additional-functions/Example1.js",
    "content": "// expected Warning: PP1007\n\nvar AGlobalObject = {};\nvar AGlobalValue = 5;\nvar BGlobalObject = { bar: 5 };\nvar BGlobalValue = 10;\n\nfunction hello() {\n  return \" hello \";\n}\n\nfunction world() {\n  return \" world \";\n}\n\nfunction fib(x) {\n  return x <= 1 ? x : fib(x - 1) + fib(x - 2);\n}\n\nfunction additional1() {\n  var x = 42;\n  AGlobalObject.foo = AGlobalValue * x;\n  if (x % 2 === 0) AGlobalValue = JSON.stringify(AGlobalObject);\n}\n\nfunction additional2() {\n  let x = BGlobalObject.bar;\n  delete BGlobalObject.bar;\n  BGlobalObject.baz = BGlobalValue % x;\n  let tmp = hello() + world();\n  let bigfib = fib(10);\n  BGlobalValue = tmp + bigfib;\n}\n\nif (global.__optimize) {\n  __optimize(additional1);\n  __optimize(additional2);\n}\n\ninspect = function() {\n  let originalA = AGlobalObject;\n  let originalA2 = AGlobalValue;\n  let originalB = BGlobalObject.bar;\n  let originalB2 = BGlobalValue;\n  additional1();\n  additional2();\n  return (\n    \"\" +\n    JSON.stringify(originalA) +\n    JSON.stringify(AGlobalObject) +\n    originalA2 +\n    AGlobalValue +\n    originalB +\n    JSON.stringify(BGlobalObject) +\n    originalB2 +\n    BGlobalValue\n  );\n};\n"
  },
  {
    "path": "test/serializer/additional-functions/FunctionApply.js",
    "content": "function inner(a, b, c) {\n  return {\n    a,\n    b,\n    c,\n  };\n}\n\nfunction fn(arg) {\n  var x = Array.from(arg).map(x => x);\n  return inner.apply(null, x);\n}\n\nif (global.__optimize) __optimize(fn);\n\ninspect = function() {\n  return JSON.stringify([fn([1, 2, 3]), fn([4, 5, 6])]);\n};\n"
  },
  {
    "path": "test/serializer/additional-functions/GlobalLetBinding.js",
    "content": "// expected Warning: PP1007\nlet x = undefined;\nlet y = undefined;\nglobal.f = function() {\n  x = {};\n};\n\nglobal.f1 = function() {\n  y = {};\n};\n\nif (global.__optimize) __optimize(f);\nglobal.inspect = function() {\n  global.f();\n  global.f1();\n  return x !== y;\n};\n"
  },
  {
    "path": "test/serializer/additional-functions/Issue1821RegressionTest.js",
    "content": "// expected Warning: PP0023\n(function() {\n  function URI(other) {\n    if (other) {\n      throw new Error();\n    }\n    this.foo = other.noSuchMethod();\n  }\n\n  function fn(arg) {\n    var first = new URI(arg);\n    return function() {\n      new URI(first);\n    };\n  }\n\n  if (global.__optimize) __optimize(fn);\n\n  global.fn = fn;\n  inspect = function() {\n    return 42;\n  }; // just don't crash the serializer\n})();\n"
  },
  {
    "path": "test/serializer/additional-functions/ModifiedBindingWithoutInitialValue.js",
    "content": "// expected Warning: PP1007\n// does not contain:dead\n(function() {\n  let b = { p: \"dead\" };\n  global.f = function() {\n    b = 42;\n    return 23;\n  };\n  if (global.__optimize) __optimize(f);\n  inspect = function() {\n    return global.f();\n  };\n})();\n"
  },
  {
    "path": "test/serializer/additional-functions/ModifiedBindingsCapturedScopesCalls.js",
    "content": "// expected Warning: PP1007\n// add at runtime:var a = 17;\n// Copies of \\|\\|:2\n(function() {\n  let a, b, c, d;\n  global.f = function() {\n    a = 1;\n    b = 2;\n    c = 3;\n    d = 4;\n  };\n  if (global.__optimize) __optimize(f);\n  inspect = function() {\n    global.f();\n    return a + b + c + d;\n  };\n})();\n"
  },
  {
    "path": "test/serializer/additional-functions/ModifiedObjectProperty.js",
    "content": "// expected Warning: PP0023\n(function() {\n  let p = {};\n  function f(c) {\n    let o = {};\n    if (c) {\n      o.foo = 42;\n      throw o;\n    }\n  }\n  if (global.__optimize) __optimize(f);\n  inspect = function() {\n    try {\n      f(true);\n    } catch (o) {\n      return o.foo;\n    }\n  };\n})();\n"
  },
  {
    "path": "test/serializer/additional-functions/ModifiedObjectPropertyWithAbstractKey.js",
    "content": "// expected Warning: PP1007\n(function() {\n  var cache = {};\n  function fn(args) {\n    var maybeTrue = args.unknown === 42;\n    var maybeNull = maybeTrue ? {} : null;\n\n    var cacheKey = maybeNull.foo;\n    var cachedValue = cache[cacheKey];\n    if (cachedValue) {\n      return cachedValue;\n    }\n\n    var result;\n    cache[cacheKey] = result;\n    return result;\n  }\n  if (global.__optimize) __optimize(fn);\n  global.fn = fn;\n  inspect = function() {\n    try {\n      fn(23);\n      return \"impossible\";\n    } catch (e) {\n      return e instanceof TypeError;\n    }\n  };\n})();\n"
  },
  {
    "path": "test/serializer/additional-functions/MutatedObject.js",
    "content": "function additional1(x, y) {\n  var cache = {};\n\n  if (!cache[x]) {\n    cache[x] = y;\n  }\n  return cache[x];\n}\n\nif (global.__optimize) __optimize(additional1);\n\ninspect = function inspect() {\n  return additional1(\"a\", 5);\n};\n"
  },
  {
    "path": "test/serializer/additional-functions/NestedOptimizedFunction1.js",
    "content": "// does not contain:1 + 2\n(function() {\n  function g() {\n    return 1 + 2;\n  }\n  function f() {\n    if (global.__optimize) __optimize(g);\n    return g;\n  }\n  if (global.__optimize) __optimize(f);\n  global.inspect = function() {\n    return f()();\n  };\n})();\n"
  },
  {
    "path": "test/serializer/additional-functions/NestedOptimizedFunction10.js",
    "content": "(function() {\n  function f() {\n    var shared = {};\n    function g() {\n      return shared;\n    }\n    return g;\n  }\n  var g = f();\n  if (global.__optimize) {\n    __optimize(f);\n    __optimize(g);\n  }\n  global.inspect = function() {\n    return f()() !== g();\n  };\n})();\n"
  },
  {
    "path": "test/serializer/additional-functions/NestedOptimizedFunction11.js",
    "content": "(function() {\n  function f() {\n    var shared = {};\n    function g0() {\n      return shared;\n    }\n    function g1() {\n      return shared;\n    }\n    if (global.__optimize) {\n      __optimize(g0);\n      __optimize(g1);\n    }\n    return [g0, g1];\n  }\n  if (global.__optimize) __optimize(f);\n  global.inspect = function() {\n    var a = f();\n    return a[0]() === a[1]();\n  };\n})();\n"
  },
  {
    "path": "test/serializer/additional-functions/NestedOptimizedFunction12.js",
    "content": "(function() {\n  function f() {\n    var shared = { huge: { huge: { huge: { huge: { huge: { huge: { huge: 42 } } } } } } };\n    function g0() {\n      return shared;\n    }\n    function g1() {\n      return shared;\n    }\n    if (global.__optimize) {\n      __optimize(g0);\n      __optimize(g1);\n    }\n    return [g0, g1];\n  }\n  var a = f();\n  global.inspect = function() {\n    return a[0]() === a[1]();\n  };\n})();\n"
  },
  {
    "path": "test/serializer/additional-functions/NestedOptimizedFunction13.js",
    "content": "(function() {\n  function f() {\n    let shared = Date.now();\n    function g0() {\n      return [shared, Date.now()];\n    }\n    function g1() {\n      return [shared, Date.now()];\n    }\n    if (global.__optimize) {\n      __optimize(g0);\n      __optimize(g1);\n    }\n    return [g0, g1];\n  }\n  if (global.__optimize) __optimize(f);\n  global.inspect = function() {\n    var a = f();\n    var a0 = a[0]();\n    var a1 = a[1]();\n    return a0[0] === a1[0] && a0[1] <= a1[1];\n  };\n})();\n"
  },
  {
    "path": "test/serializer/additional-functions/NestedOptimizedFunction14.js",
    "content": "// skip this test for now\n// we don't know how to optimize the union of two different functions\n(function() {\n  function f(x, y, z) {\n    var g;\n    if (x)\n      g = function() {\n        return y;\n      };\n    else\n      g = function() {\n        return z;\n      };\n    if (global.__optimize) __optimize(g);\n    return g;\n  }\n  if (global.__optimize) __optimize(f);\n  global.inspect = function() {\n    let y = f(true, 42, 23)();\n    let z = f(false, 42, 23)();\n    return y + \"|\" + z;\n  };\n})();\n"
  },
  {
    "path": "test/serializer/additional-functions/NestedOptimizedFunction15.js",
    "content": "(function() {\n  function fn() {\n    var self = global.__abstract ? global.__abstract(\"object\", \"this\") : this;\n\n    var fn2 = function(item) {\n      return [item, self];\n    };\n\n    if (global.__optimize) __optimize(fn2);\n    return { fn2, self };\n  }\n\n  if (global.__optimize) __optimize(fn);\n  global.inspect = function() {\n    var result = fn.call({ a: 1 });\n    return JSON.stringify(result.fn2());\n  };\n})();\n"
  },
  {
    "path": "test/serializer/additional-functions/NestedOptimizedFunction16.js",
    "content": "// skip this test for now\n(function() {\n  var fn2 = function(item, self) {\n    return [item, self];\n  };\n\n  function fn() {\n    var self = global.__abstract ? global.__abstract(\"object\", \"this\") : this;\n\n    var fn3 = fn2.bind(self);\n\n    if (global.__optimize) __optimize(fn3);\n    return { fn3, self };\n  }\n\n  if (global.__optimize) __optimize(fn);\n  global.inspect = function() {\n    var result = fn.call({ a: 1 });\n    return JSON.stringify(result.fn2());\n  };\n})();\n"
  },
  {
    "path": "test/serializer/additional-functions/NestedOptimizedFunction17.js",
    "content": "// arrayNestedOptimizedFunctionsEnabled\n\nfunction fn(props, cond, cond2, cond3) {\n  var arr = Array.from(props.x);\n  var newObj;\n  var value;\n\n  if (cond) {\n    var _ref8;\n    value =\n      (_ref8 = props.feedback) != null\n        ? (_ref8 = _ref8.display_comments) != null\n          ? _ref8.ordering_mode\n          : _ref8\n        : _ref8;\n\n    var res = arr.map(function(item) {\n      var fn2 = function() {\n        return value;\n      };\n\n      return [item[value], fn2];\n    });\n  }\n\n  return res;\n}\n\nglobal.__optimize && __optimize(fn);\n\nglobal.inspect = function() {\n  return true;\n};\n"
  },
  {
    "path": "test/serializer/additional-functions/NestedOptimizedFunction18.js",
    "content": "// arrayNestedOptimizedFunctionsEnabled\n\nfunction Component(x) {\n  this.val = x;\n}\n\nfunction foo(a, b, c, d) {\n  if (!a) {\n    return null;\n  }\n  var arr = Array.from(c);\n  var _ref11;\n  var x = (_ref11 = b) != null ? ((_ref11 = _ref11.feedback) != null ? _ref11.display_comments : _ref11) : _ref11;\n\n  var a = new Component(x);\n  var mappedArr = arr.map(function() {\n    return a;\n  });\n  return d(mappedArr);\n}\n\nglobal.__optimize && __optimize(foo);\n\ninspect = function() {\n  function func(arr) {\n    return arr.map(item => item.val).join();\n  }\n  var val = foo(\n    true,\n    {\n      feedback: {\n        display_comments: 5,\n      },\n    },\n    [, , ,],\n    func\n  );\n  return JSON.stringify(val);\n};\n"
  },
  {
    "path": "test/serializer/additional-functions/NestedOptimizedFunction19.js",
    "content": "// arrayNestedOptimizedFunctionsEnabled\n\nfunction fn(items, abstractFunc) {\n  var a = 10;\n  var arr = Array.from(items);\n\n  function fn2() {\n    abstractFunc(function() {\n      return a;\n    });\n  }\n\n  var mapped = arr.map(function() {\n    return fn2();\n  });\n\n  a = 11;\n\n  return [a, mapped];\n}\n\ninspect = function() {\n  var value;\n  function mutateBinding(caller) {\n    value = caller();\n  }\n  fn([1, 2, 3], mutateBinding);\n  return value;\n};\n\nglobal.__optimize && __optimize(fn);\n"
  },
  {
    "path": "test/serializer/additional-functions/NestedOptimizedFunction2.js",
    "content": "// does not contain:1 + 2\n(function() {\n  function f() {\n    function g() {\n      return 1 + 2;\n    }\n    if (global.__optimize) __optimize(g);\n    return g;\n  }\n  if (global.__optimize) __optimize(f);\n  global.inspect = function() {\n    return f()();\n  };\n})();\n"
  },
  {
    "path": "test/serializer/additional-functions/NestedOptimizedFunction20.js",
    "content": "// arrayNestedOptimizedFunctionsEnabled\n\nfunction fn(items, abstractFunc) {\n  var a = 10;\n  var b = function() {\n    return a;\n  };\n  var arr = Array.from(items);\n\n  function fn2() {\n    abstractFunc(function() {\n      return b;\n    });\n  }\n\n  var mapped = arr.map(function() {\n    return fn2();\n  });\n\n  b = function() {\n    return 20;\n  };\n\n  return [b, mapped];\n}\n\ninspect = function() {\n  var value;\n  function mutateBinding(caller) {\n    value = caller()();\n  }\n  fn([1, 2, 3], mutateBinding);\n  return value;\n};\n\nglobal.__optimize && __optimize(fn);\n"
  },
  {
    "path": "test/serializer/additional-functions/NestedOptimizedFunction21.js",
    "content": "// arrayNestedOptimizedFunctionsEnabled\n\nfunction f(c) {\n  var arr = Array.from(c);\n  let obj = { foo: 1 };\n\n  function nested(x) {\n    let mapped_inner = arr.map(x => obj);\n    return mapped_inner[0];\n  }\n\n  function op(x) {\n    return nested(x);\n  }\n\n  let mapped = arr.map(op);\n  let val = arr[0].foo;\n  let ret = mapped[0].foo;\n  obj.foo = 2;\n\n  return ret;\n}\n\nglobal.__optimize && __optimize(f);\n\ninspect = () => f([0]);\n"
  },
  {
    "path": "test/serializer/additional-functions/NestedOptimizedFunction22.js",
    "content": "// arrayNestedOptimizedFunctionsEnabled\n\nfunction fn2() {\n  var x = function() {\n    return 123;\n  };\n\n  return function() {\n    return x;\n  };\n}\n\nfunction fn(x) {\n  var arr = Array.from(x);\n  return arr.map(function() {\n    if (x) {\n      return fn2();\n    } else {\n      return null;\n    }\n  });\n}\n\ninspect = function() {\n  return fn([1])();\n};\n\nglobal.__optimize && __optimize(fn);\n"
  },
  {
    "path": "test/serializer/additional-functions/NestedOptimizedFunction3.js",
    "content": "(function() {\n  function f() {\n    function g() {\n      return {}; // Must maintain distinct identity of object\n    }\n    if (global.__optimize) __optimize(g);\n    return [g, g];\n  }\n  if (global.__optimize) __optimize(f);\n  global.inspect = function() {\n    var a = f();\n    return a[0]() !== a[1]();\n  };\n})();\n"
  },
  {
    "path": "test/serializer/additional-functions/NestedOptimizedFunction4.js",
    "content": "(function() {\n  function f() {\n    var shared = {};\n    function g() {\n      return shared;\n    }\n    if (global.__optimize) __optimize(g);\n    return [g, g, shared];\n  }\n  if (global.__optimize) __optimize(f);\n  global.inspect = function() {\n    var a = f();\n    return a[2] == a[0]() && a[2] == a[1]();\n  };\n})();\n"
  },
  {
    "path": "test/serializer/additional-functions/NestedOptimizedFunction6.js",
    "content": "(function() {\n  function f() {\n    var shared = {};\n    function g() {\n      var unique = {};\n      return [shared, unique];\n    }\n    if (global.__optimize) __optimize(g);\n    return [g, g, shared];\n  }\n  if (global.__optimize) __optimize(f);\n  global.inspect = function() {\n    var a = f();\n    let a0 = a[0]();\n    let a1 = a[1]();\n    let shared = a[2];\n    return a0[0] === shared && a1[0] === shared && a0[1] !== shared && a1[1] !== shared && a0[1] !== a1[1];\n  };\n})();\n"
  },
  {
    "path": "test/serializer/additional-functions/NestedOptimizedFunction7.js",
    "content": "// (It fails because of an output mismatch.)\n\n(function() {\n  function f() {\n    var shared = {};\n    function g() {\n      return shared;\n    }\n    return [g, g];\n  }\n  var a = f();\n  var g0 = a[0];\n  var g1 = a[1];\n  if (global.__optimize) {\n    __optimize(g0);\n    __optimize(g1);\n  }\n  global.inspect = function() {\n    return g0() === g1();\n  };\n})();\n"
  },
  {
    "path": "test/serializer/additional-functions/NestedOptimizedFunction8.js",
    "content": "// Copies of 42:1\n(function() {\n  function f(x) {\n    function g() {\n      return x;\n    }\n    return g;\n  }\n  var shared = { x: 42 };\n  var g0 = f(shared);\n  var g1 = f(shared);\n  if (global.__optimize) {\n    __optimize(g0);\n    __optimize(g1);\n  }\n  global.inspect = function() {\n    return g0() === g1();\n  };\n})();\n"
  },
  {
    "path": "test/serializer/additional-functions/NestedThrowEffects.js",
    "content": "// does not contain:.fakeB;\n(function() {\n  function URI() {}\n\n  function parse(alwaysNull, alwaysString) {\n    if (!alwaysString) {\n      return;\n    }\n    if (alwaysString instanceof URI) {\n      alwaysString.fakeA();\n    }\n    var derivedString = alwaysString.trim();\n    if (derivedString.fakeB()) {\n      return;\n    }\n    try {\n      alwaysNull.fakeC();\n    } catch (err) {}\n  }\n\n  function f(arg) {\n    var unknownString = \"\" + arg;\n    parse(null, unknownString);\n    new URI(unknownString);\n  }\n\n  if (global.__optimize) __optimize(f);\n\n  global.inspect = function() {\n    try {\n      f(\"a\");\n    } catch (err) {\n      if (err.message.endsWith(\"fakeB is not a function\")) {\n        return \"ok\";\n      } else {\n        return err.message;\n      }\n    }\n    throw new Error(\"Expected to throw.\");\n  };\n})();\n"
  },
  {
    "path": "test/serializer/additional-functions/ObjectCreationGeneratorRegressionTest.js",
    "content": "// expected Warning: PP0023\nfunction nullthrows(x) {\n  if (x != null) {\n    return x;\n  }\n  throw new Error(\"no\");\n}\n\nfunction App(props) {\n  nullthrows(props.className);\n  return {\n    className: props.className,\n  };\n}\n\nif (global.__optimize) __optimize(App);\n\ninspect = function() {\n  return 42;\n}; // just make sure no invariants in Prepack blow up\n"
  },
  {
    "path": "test/serializer/additional-functions/ObjectLifetime1.js",
    "content": "(function() {\n  let a = [1, 2, 3];\n  let f = function() {\n    return a;\n  };\n  if (global.__optimize) __optimize(f);\n  inspect = function() {\n    return f() === f();\n  };\n})();\n"
  },
  {
    "path": "test/serializer/additional-functions/ObjectLifetime2.js",
    "content": "// expected Warning: PP1007\n(function() {\n  let a = [1, 2, 3];\n  let f = function() {\n    let b = a;\n    a = undefined;\n    return b;\n  };\n  if (global.__optimize) __optimize(f);\n  inspect = function() {\n    var a1 = a;\n    var a2 = f();\n    return a1 === a2 && a === undefined;\n  };\n})();\n"
  },
  {
    "path": "test/serializer/additional-functions/OptimizedArrayFilterOpAliasing.js",
    "content": "// arrayNestedOptimizedFunctionsEnabled\n// does contain: return 42\n\nfunction f(c) {\n  var arr = Array.from(c);\n  let obj = { foo: 42 };\n\n  function op(x) {\n    return obj;\n  }\n\n  let mapped = arr.filter(op);\n  mapped[0].foo = 0;\n\n  return obj.foo;\n}\nglobal.__optimize && __optimize(f);\n\ninspect = () => f([0]);\n"
  },
  {
    "path": "test/serializer/additional-functions/OptimizedArrayFilterOpAliasing2.js",
    "content": "// arrayNestedOptimizedFunctionsEnabled\n// does not contain: return 42\n\nfunction f(c) {\n  var arr = Array.from(c);\n  let obj = { foo: 42 };\n\n  function op1(x) {\n    return obj;\n  }\n\n  function op2(x) {\n    return true;\n  }\n\n  let mapped = arr.map(op1);\n  let mapped2 = mapped.filter(op2);\n  mapped2[0].foo = 0;\n\n  return obj.foo;\n}\nglobal.__optimize && __optimize(f);\n\ninspect = () => f([0]);\n"
  },
  {
    "path": "test/serializer/additional-functions/OptimizedArrayFilterOpSpecialization.js",
    "content": "// arrayNestedOptimizedFunctionsEnabled\n// does contain:return true\n\nfunction f(c, g) {\n  var arr = Array.from(c);\n  let obj = { foo: true };\n\n  function op(x) {\n    return obj.foo;\n  }\n\n  let mapped = arr.filter(op);\n\n  return mapped;\n}\nglobal.__optimize && __optimize(f);\n\ninspect = () => f([0], () => {});\n"
  },
  {
    "path": "test/serializer/additional-functions/OptimizedArrayOpAliasing.js",
    "content": "// arrayNestedOptimizedFunctionsEnabled\n\nfunction f(c) {\n  var arr = Array.from(c);\n  let obj = { foo: 1 };\n\n  function op(x) {\n    return obj;\n  }\n\n  let mapped = arr.map(op);\n  let val = arr[0].foo;\n  obj.foo = 2;\n  let ret = mapped[0].foo;\n\n  return ret;\n}\nglobal.__optimize && __optimize(f);\n\ninspect = () => f([0]);\n"
  },
  {
    "path": "test/serializer/additional-functions/OptimizedArrayOpAliasing2.js",
    "content": "// arrayNestedOptimizedFunctionsEnabled\n// does not contain: return 42\n\nfunction f(c) {\n  var arr = Array.from(c);\n  let obj = { foo: 42 };\n\n  function op(x) {\n    return obj;\n  }\n\n  let mapped = arr.map(op);\n  mapped[0].foo = 0;\n\n  return obj.foo;\n}\nglobal.__optimize && __optimize(f);\n\ninspect = () => f([0]);\n"
  },
  {
    "path": "test/serializer/additional-functions/OptimizedArrayOpAliasing3.js",
    "content": "// arrayNestedOptimizedFunctionsEnabled\n// does not contain: return 42\n\nfunction f(c) {\n  var arr = Array.from(c);\n  let obj = { foo: 42 };\n\n  function op1(x) {\n    return obj;\n  }\n\n  function op2(x) {\n    return x;\n  }\n\n  let mapped = arr.map(op1);\n  let mapped2 = mapped.map(op2);\n  mapped2[0].foo = 0;\n\n  return obj.foo;\n}\nglobal.__optimize && __optimize(f);\n\ninspect = () => f([0]);\n"
  },
  {
    "path": "test/serializer/additional-functions/OptimizedArrayOpNoDefaultMaterialization.js",
    "content": "// arrayNestedOptimizedFunctionsEnabled\n// does not contain:foo = 1\n\nfunction f(c) {\n  var arr = Array.from(c);\n  let obj = { foo: 1 };\n\n  function op(x) {\n    return obj;\n  }\n\n  let mapped = arr.map(op);\n  obj.foo = 2;\n\n  return obj;\n}\nglobal.__optimize && __optimize(f);\n\ninspect = () => JSON.stringify(f([0]));\n"
  },
  {
    "path": "test/serializer/additional-functions/OptimizedArrayOpSpecialization.js",
    "content": "// arrayNestedOptimizedFunctionsEnabled\n// does contain:42\n\nfunction f(c, g) {\n  var arr = Array.from(c);\n  let obj = { foo: 1 };\n\n  function op(x) {\n    return obj.foo + 41;\n  }\n\n  let mapped = arr.map(op);\n\n  return mapped;\n}\nglobal.__optimize && __optimize(f);\n\ninspect = () => f([0], () => {});\n"
  },
  {
    "path": "test/serializer/additional-functions/OptimizedArrayOpSpecializationBailout.js",
    "content": "// arrayNestedOptimizedFunctionsEnabled\n// does not contain: 42\n\nfunction f(c) {\n  var arr = Array.from(c);\n  let x = 1;\n\n  function op(x) {\n    return x + 41;\n  }\n\n  let mapped = arr.map(op);\n  x = 2;\n  let mapped2 = mapped.map(op);\n\n  return mapped2;\n}\nglobal.__optimize && __optimize(f);\n\ninspect = () => f([0]);\n"
  },
  {
    "path": "test/serializer/additional-functions/OptimizedArrayOpSpecializationBailout2.js",
    "content": "// arrayNestedOptimizedFunctionsEnabled\n// does not contain: 42\n\nfunction f(c) {\n  var arr = Array.from(c);\n  let x = 1;\n\n  function op(x) {\n    return x + 41;\n  }\n\n  let mapped = arr.map(op);\n  x = 2;\n  let mapped2 = mapped.map(op);\n  let mapped3 = mapped2.map(op);\n\n  return mapped3;\n}\nglobal.__optimize && __optimize(f);\n\ninspect = () => f([0]);\n"
  },
  {
    "path": "test/serializer/additional-functions/OptimizedResidualOptimized.js",
    "content": "// does not contain:1 + 2\n(function() {\n  function f() {\n    function residual() {\n      let z = 3;\n      function g() {\n        return 1 + 2 + z;\n      }\n\n      global.__optimize && __optimize(g);\n      return g;\n    }\n    let g = residual();\n\n    return g;\n  }\n  if (global.__optimize) __optimize(f);\n  global.inspect = function() {\n    return f()();\n  };\n})();\n"
  },
  {
    "path": "test/serializer/additional-functions/OuterScopeCacheRegressionTest.js",
    "content": "// expected Warning: PP1007\nvar cache = {};\n\nfunction additional1(x, y) {\n  if (!cache[x]) {\n    cache[x] = y;\n  }\n  return cache[x];\n}\n\nif (global.__optimize) __optimize(additional1);\n\ninspect = function inspect() {\n  return additional1(\"a\", 5);\n};\n"
  },
  {
    "path": "test/serializer/additional-functions/ReadThenDelete.js",
    "content": "// expected Warning: PP1007\n\nvar AGlobalObject = {};\nvar AGlobalValue = 5;\nvar BGlobalObject = { bar: 5 };\nvar BGlobalValue = 10;\n\nfunction additional1() {\n  var x = 42;\n  AGlobalObject.foo = AGlobalValue * x;\n  if (x % 2 === 0) AGlobalValue = JSON.stringify(AGlobalObject);\n}\n\nfunction additional2() {\n  let x = BGlobalObject.bar;\n  BGlobalObject.baz = BGlobalValue % x;\n}\n\nif (global.__optimize) {\n  __optimize(additional1);\n  __optimize(additional2);\n}\n\ninspect = function() {\n  let originalA = AGlobalObject;\n  let originalA2 = AGlobalValue;\n  let originalB = BGlobalObject.bar;\n  let originalB2 = BGlobalValue;\n  additional1();\n  additional2();\n  return (\n    \"\" +\n    JSON.stringify(originalA) +\n    JSON.stringify(AGlobalObject) +\n    originalA2 +\n    AGlobalValue +\n    originalB +\n    JSON.stringify(BGlobalObject) +\n    originalB2 +\n    BGlobalValue\n  );\n};\n"
  },
  {
    "path": "test/serializer/additional-functions/ReferentializationRegressionTest.js",
    "content": "// Copies of 42:1\n(function() {\n  function f() {\n    return global.x;\n  }\n  f.prop = 42;\n  function g1() {\n    return f;\n  }\n  function g2() {\n    return f;\n  }\n  if (global.__optimize) {\n    __optimize(g1);\n    __optimize(g2);\n  }\n  global.inspect = function() {\n    return g1() === g2();\n  };\n})();\n"
  },
  {
    "path": "test/serializer/additional-functions/RegressionTestForIssue1881.js",
    "content": "// expected Warning: PP0023\n(function() {\n  function f(c) {\n    let o = {};\n    if (c) {\n      o.foo = 42;\n      return o;\n    }\n    throw o;\n  }\n  if (global.__optimize) __optimize(f);\n  global.f = f;\n  inspect = function() {\n    try {\n      f(false);\n    } catch (o) {\n      return o.foo;\n    }\n  };\n})();\n"
  },
  {
    "path": "test/serializer/additional-functions/RegressionTestForIssue1957.js",
    "content": "(function() {\n  function f(c) {\n    function g() {}\n    g.magic = 23;\n    if (c) {\n      throw new g();\n    }\n    return 42;\n  }\n  if (global.__optimize) __optimize(f);\n  global.f = f;\n  inspect = function() {\n    try {\n      f(true);\n    } catch (e) {\n      return f(false) + \"/\" + e.constructor.magic;\n    }\n  };\n})();\n"
  },
  {
    "path": "test/serializer/additional-functions/RegressionTestForIssue2090.js",
    "content": "(function() {\n  function fn(arg) {\n    if (arg.foo) {\n      return \"a\";\n    }\n    if (arg.bar === 0) {\n      return \"b\";\n    }\n    return Object.assign(\n      {\n        qux: function() {\n          arg.qux();\n        },\n      },\n      arg.baz()\n    );\n  }\n\n  if (global.__optimize) {\n    __optimize(fn);\n  }\n\n  global.inspect = function() {\n    return JSON.stringify([\n      fn({ foo: 1 }),\n      fn({ bar: 0 }),\n      fn({ foo: 1, bar: 0 }),\n      fn({\n        baz: function() {\n          return { a: 42 };\n        },\n      }),\n    ]);\n  };\n})();\n"
  },
  {
    "path": "test/serializer/additional-functions/ResidualFunctionBindingsMutatedByOptimizedFunctionRegressionTest.js",
    "content": "// expected Warning: PP1007\n(function() {\n  let x = 23;\n  function g() {\n    return x;\n  }\n  function f() {\n    x = 42;\n    return g;\n  }\n  if (global.__optimize) __optimize(f);\n  global.f = f;\n  inspect = function() {\n    return x + \"+19=\" + f()();\n  };\n})();\n"
  },
  {
    "path": "test/serializer/additional-functions/TargetsWithGenerators.js",
    "content": "(function() {\n  function f() {\n    let d = Date.now();\n    if (d === 1) {\n      return 1;\n    } else {\n      let e = Date.now();\n      if (e === 2) {\n        return 2;\n      } else if (e === undefined) {\n        return 42; /// This used to trigger because e didn't get initialized at the right time!\n      } else {\n        let f = Date.now();\n        if (f === 3) {\n          return 3;\n        } else {\n          return 4;\n        }\n      }\n    }\n  }\n  if (global.__optimize) __optimize(f);\n  inspect = f;\n})();\n"
  },
  {
    "path": "test/serializer/additional-functions/ThisArgument.js",
    "content": "(function() {\n  function f(z) {\n    var x = this.x;\n    var self = this;\n    return function(y) {\n      return self.x + y + z;\n    };\n  }\n\n  if (global.__optimize) __optimize(f);\n\n  global.inspect = function() {\n    var g = f.apply({ x: 11 });\n    return g(7);\n  };\n})();\n"
  },
  {
    "path": "test/serializer/additional-functions/ToObject.js",
    "content": "(function() {\n  function URIBase(uri) {\n    if (uri instanceof URIBase) {\n      serialize(uri.x);\n      this.x = undefined;\n    }\n  }\n\n  function serialize(obj) {\n    for (var k in obj) {\n    }\n  }\n\n  function App(props) {\n    new URIBase(new URIBase(props));\n    return null;\n  }\n\n  if (global.__optimize) __optimize(App);\n\n  global.App = App;\n\n  inspect = function() {\n    return true;\n  }; // just make sure Prepack doesn't crash while generating code\n})();\n"
  },
  {
    "path": "test/serializer/additional-functions/UnknownArray.js",
    "content": ""
  },
  {
    "path": "test/serializer/additional-functions/UpdateExpression.js",
    "content": "function additional1(x) {\n  return x++;\n}\n\nfunction additional2(x) {\n  ++x;\n  return x;\n}\n\nif (global.__optimize) {\n  __optimize(additional1);\n  __optimize(additional2);\n}\n\ninspect = function() {\n  let x = additional1(4);\n  let y = additional2(10);\n  return x + y;\n};\n"
  },
  {
    "path": "test/serializer/additional-functions/UpdateExpression2.js",
    "content": "function additional1(obj) {\n  var tmp = { x: obj.x };\n  tmp.x++;\n  return tmp;\n}\n\nfunction additional2(obj) {\n  var v = obj.x;\n  var tmp = { x: v };\n  ++tmp.x;\n  tmp.y = v;\n  return tmp;\n}\n\nif (global.__optimize) {\n  __optimize(additional1);\n  __optimize(additional2);\n}\n\ninspect = function() {\n  var obj = { x: 4 };\n  let o1 = additional1(obj);\n  let o2 = additional2(obj);\n  return JSON.stringify({ obj, o1, o2 });\n};\n"
  },
  {
    "path": "test/serializer/additional-functions/abstract-property-modification.js",
    "content": "// expected Warning: PP1007\n// does not contain:x = 5;\n// does not contain:y = 10;\n// add at runtime: global.a = {}; global.b = {};\nif (global.__abstract) {\n  global.a = __abstract({}, \"global.a\");\n  global.b = __abstract({}, \"global.b\");\n}\nif (global.__makeSimple) {\n  __makeSimple(global.a);\n  __makeSimple(global.b);\n}\nvar z = 42;\n\nfunction additional1() {\n  global.a.foo = z + \"foo\";\n  var x = 5;\n}\n\nfunction additional2() {\n  global.b.bar = z + \"bar\";\n  var y = 10;\n}\n\nif (global.__optimize) {\n  global.__optimize(additional1);\n  global.__optimize(additional2);\n}\n\ninspect = function() {\n  additional2();\n  additional1();\n  return JSON.stringify(global.a) + JSON.stringify(global.b);\n};\n"
  },
  {
    "path": "test/serializer/additional-functions/arguments.js",
    "content": "// does not contain:x = 5;\n\nfunction additional1(argument) {\n  var z = { foo: argument };\n  var x = 5;\n  return z;\n}\nif (global.__optimize) __optimize(additional1);\n\ninspect = function inspect() {\n  let z = additional1(7);\n  let z2 = additional1(10);\n\n  return \"\" + JSON.stringify(z) + \" \" + JSON.stringify(z2);\n};\n"
  },
  {
    "path": "test/serializer/additional-functions/arguments2.js",
    "content": "// does not contain:x = 5;\n\nfunction additional1(argument) {\n  var z = { foo: argument };\n  var x = 5;\n  return z;\n}\n\nfunction additional2(argument) {\n  var z = { bar: argument };\n  var x = 5;\n  return z;\n}\n\nif (global.__optimize) {\n  __optimize(additional1);\n  __optimize(additional2);\n}\n\ninspect = function inspect() {\n  let z = additional1(7);\n  let z2 = additional2(42);\n\n  return \"\" + JSON.stringify(z) + \" \" + JSON.stringify(z2);\n};\n"
  },
  {
    "path": "test/serializer/additional-functions/arguments3.js",
    "content": "// does not contain:x = 5;\n\nfunction additional1(argument, argument) {\n  var z = { foo: argument };\n  var x = 5;\n  return z;\n}\nif (global.__optimize) __optimize(additional1);\n\ninspect = function inspect() {\n  let z = additional1(7, 10);\n\n  return \"\" + JSON.stringify(z);\n};\n"
  },
  {
    "path": "test/serializer/additional-functions/arguments4.js",
    "content": "// does not contain:x = 5;\n\nfunction additional1(argument1, argument2) {\n  var z = { foo: argument1 };\n  var w = { bar: argument2 };\n  var x = 5;\n  return [w, z];\n}\nif (global.__optimize) __optimize(additional1);\n\ninspect = function inspect() {\n  let z = additional1(12, 3);\n\n  return \"\" + JSON.stringify(z);\n};\n"
  },
  {
    "path": "test/serializer/additional-functions/bad-functions2.js",
    "content": "// additional functions\n\nvar wildcard = global.__abstract ? global.__abstract(\"number\", \"123\") : 123;\nglobal.a = \"\";\n\nfunction additional1() {\n  global.a = \"foo\";\n}\n\nfunction additional2() {\n  if (wildcard) throw new Exception();\n}\n\ninspect = function() {\n  additional2();\n  additional1();\n  return global.a;\n};\n"
  },
  {
    "path": "test/serializer/additional-functions/capture-local.js",
    "content": "// does not contain:x = 5;\n// does not contain:y = 10;\n\nfunction additional1() {\n  var z = { foo: 5 };\n  global.x = function nested1() {\n    return z;\n  };\n  var x = 5;\n}\n\nfunction additional2() {\n  global.y = function nested2() {\n    return 6;\n  };\n  var y = 10;\n}\n\nif (global.__optimize) {\n  __optimize(additional1);\n  __optimize(additional2);\n}\n\ninspect = function inspect() {\n  additional1();\n  additional2();\n  let x_fun = global.x;\n  let x = global.x();\n  let y = global.y;\n  additional1();\n  additional2();\n\n  return \"\" + x.foo + y() + (x_fun === global.x) + (global.x() === x) + global.x().foo + global.y() + (global.y === y);\n};\n"
  },
  {
    "path": "test/serializer/additional-functions/conditions.js",
    "content": "function getURL(\n  getProtocol,\n  getIsGeneric,\n  getDomain,\n  getPort,\n  getPath,\n  serialize,\n  getQueryData,\n  getFragment,\n  getForceFragmentSeparator\n) {\n  var str = \"\";\n  var protocol = getProtocol();\n  if (protocol) {\n    str += protocol + \":\" + (getIsGeneric() ? \"\" : \"//\");\n  }\n  var domain = getDomain();\n  if (domain) {\n    str += domain;\n  }\n  var port = getPort();\n  if (port) {\n    str += \":\" + port;\n  }\n\n  var path = getPath();\n  if (path) {\n    str += path;\n  } else if (str) {\n    str += \"/\";\n  }\n  var queryStr = serialize(getQueryData());\n  if (queryStr) {\n    str += \"?\" + queryStr;\n  }\n  var fragment = getFragment();\n  if (fragment) {\n    str += \"#\" + fragment;\n  } else if (getForceFragmentSeparator()) {\n    str += \"#\";\n  }\n  return str;\n}\n\nglobal.__optimize && __optimize(getURL);\n\ninspect = function inspect() {\n  var getProtocol = function() {\n    return \"http://\";\n  };\n  var getIsGeneric = function() {\n    return true;\n  };\n  var getPort = function() {\n    return 80;\n  };\n  var getDomain = function() {\n    return \"foobar.com\";\n  };\n  var getPath = function() {\n    return \"test\";\n  };\n  var serialize = function(a) {\n    return a;\n  };\n  var getQueryData = function() {\n    return \"test\";\n  };\n  var getFragment = function() {\n    return \"frag\";\n  };\n  var getForceFragmentSeparator = function() {\n    return false;\n  };\n  return getURL(\n    getProtocol,\n    getIsGeneric,\n    getDomain,\n    getPort,\n    getPath,\n    serialize,\n    getQueryData,\n    getFragment,\n    getForceFragmentSeparator\n  );\n};\n"
  },
  {
    "path": "test/serializer/additional-functions/conditions2.js",
    "content": "// expected Warning: PP0023,PP1007\nif (!this.__evaluatePureFunction) {\n  this.__evaluatePureFunction = function(f) {\n    return f();\n  };\n}\n\nglobal.result = __evaluatePureFunction(() => {\n  var something_E = global.__abstract ? __abstract(undefined, \"({link_react_default_hash: {}})\") : {};\n\n  var babelHelpers = {\n    inherits(subClass, superClass) {\n      Object.assign(subClass, superClass);\n      subClass.prototype = Object.create(superClass && superClass.prototype);\n      subClass.prototype.constructor = subClass;\n      subClass.__superConstructor__ = superClass;\n      return superClass;\n    },\n    _extends: Object.assign,\n    extends: Object.assign,\n    objectWithoutProperties(obj, keys) {\n      var target = {};\n      var hasOwn = Object.prototype.hasOwnProperty;\n      for (var i in obj) {\n        if (!hasOwn.call(obj, i) || keys.indexOf(i) >= 0) {\n          continue;\n        }\n        target[i] = obj[i];\n      }\n      return target;\n    },\n    taggedTemplateLiteralLoose(strings, raw) {\n      strings.raw = raw;\n      return strings;\n    },\n    bind: Function.prototype.bind,\n  };\n\n  function invariant(condition, message) {\n    if (condition) return;\n    throw new Error(message);\n  }\n\n  var someModuleY = global.__abstract ? __abstract(undefined, \"({getURIBuilder() {return new global.URI();}})\") : {};\n  var ActorURIConfig = global.__abstract ? __abstract(undefined, \"({PARAMETER_ACTOR: 0})\") : { PARAMETER_ACTOR: 0 };\n  global.URI = global.__abstract\n    ? __abstract(undefined, \"(function (){return {addQueryData() {}}})\")\n    : function() {\n        return { addQueryData() {} };\n      };\n\n  var ActorURI = {\n    create: function create(uri, actorID) {\n      return new URI(uri).addQueryData(ActorURIConfig.PARAMETER_ACTOR, actorID);\n    },\n    PARAMETER_ACTOR: ActorURIConfig.PARAMETER_ACTOR,\n  };\n\n  var someModuleX = {\n    getDialogURI: function getDialogURI(_ref) {\n      var actorID = _ref.actorID;\n      var feedbackTargetID = _ref.feedbackTargetID;\n      var reactionKey = _ref.reactionKey;\n      return ActorURI.create(\n        someModuleY\n          .getURIBuilder()\n          .setString(\"foobar\", feedbackTargetID)\n          .setEnum(\"foobar\", reactionKey)\n          .getURI(),\n        actorID\n      );\n    },\n\n    getPageURI: function getPageURI(_ref2) {\n      var actorID = _ref2.actorID;\n      var feedbackTargetID = _ref2.feedbackTargetID;\n      return ActorURI.create(\n        someModuleY\n          .getURIBuilder()\n          .setString(\"foobar\", feedbackTargetID)\n          .getURI(),\n        actorID\n      );\n    },\n\n    getPrimerProps: function getPrimerProps(args) {\n      var pageURI = someModuleX.getPageURI(args);\n      var dialogURI = someModuleX.getDialogURI(args);\n      return {\n        ajaxify: dialogURI,\n        href: pageURI,\n        rel: \"foobar\",\n      };\n    },\n  };\n\n  var reactionEdge = global.__abstract ? __abstract(undefined, \"({reaction_type: {}})\") : { reaction_type: {} };\n  var actorID = global.__abstract ? __abstract(undefined, \"(1)\") : 1;\n  var reactionIndex = global.__abstract ? __abstract(undefined, \"(0)\") : 0;\n\n  function Main(props, state) {\n    var _ref2, _ref3, _ref4, _ref5;\n    var _props = props;\n    var feedbackTargetID = _props.feedbackTargetID;\n    var relay = _props.relay;\n    var selectedReactionIndex = state.selectedReactionIndex;\n    var i18nReactionCount = (_ref2 = reactionEdge) != null ? _ref2.i18n_reaction_count : _ref2;\n    var i18nReactionName =\n      (_ref3 = reactionEdge) != null ? ((_ref3 = _ref3.node) != null ? _ref3.localized_name : _ref3) : _ref3;\n    var reactionKey = (_ref4 = reactionEdge) != null ? ((_ref4 = _ref4.node) != null ? _ref4.key : _ref4) : _ref4;\n    var reactionType =\n      (_ref5 = reactionEdge) != null ? ((_ref5 = _ref5.node) != null ? _ref5.reaction_type : _ref5) : _ref5;\n\n    reactionType || invariant(0, \"Error 1\");\n\n    reactionKey || invariant(0, \"Error 2\");\n\n    var primerProps = someModuleX.getPrimerProps({\n      actorID: actorID,\n      feedbackTargetID: feedbackTargetID,\n      reactionKey: reactionKey,\n    });\n\n    var reactionsNotFocused = selectedReactionIndex === null;\n    var currentReactionIsFocused = selectedReactionIndex === reactionIndex;\n    var tabIndex = (reactionsNotFocused && reactionIndex === 0) || currentReactionIsFocused ? 0 : -1;\n\n    var placeholder = function(children) {\n      return { i18nReactionName, foo: true, children: children() };\n    };\n\n    return placeholder(function() {\n      return {\n        bar: true,\n        children: Second(props.children),\n      };\n    });\n  }\n\n  function Second(props) {\n    var _props = props;\n    var depressed = _props.depressed;\n    var disabled = _props.disabled;\n    var image = _props.image;\n    var imageRight = _props.imageRight;\n    var label = _props.label;\n    var labelIsHidden = _props.labelIsHidden;\n    var buttonProps = babelHelpers.objectWithoutProperties(_props, [\n      \"depressed\",\n      \"disabled\",\n      \"image\",\n      \"imageRight\",\n      \"label\",\n      \"labelIsHidden\",\n    ]);\n\n    var className = \"xxx\" + (disabled ? \" \" + \"xxx2\" : \"\") + (depressed ? \" \" + \"xxx3\" : \"\");\n\n    var imageChild = image;\n    if (imageChild) {\n      var imageProps = {};\n      if (label) {\n        imageProps.alt = \"\";\n        if (!labelIsHidden) {\n          imageProps.className = \"xxx4\";\n        }\n      }\n      imageChild = imageRightChild = { x: \"clone\" };\n    }\n\n    var imageRightChild = imageRight;\n    if (imageRightChild) {\n      var _imageProps = {};\n      if (label) {\n        _imageProps.alt = \"\";\n        if (!labelIsHidden) {\n          _imageProps.className = \"xxx5\";\n        }\n      }\n      imageRightChild = { x: \"clone\" };\n    }\n\n    function callback(children) {\n      return { x: \"final\", children: children(props.children) };\n    }\n\n    if (props.href) {\n      return callback(Third);\n    } else if (props.type && props.type !== \"submit\") {\n      return { x: \"final2\" };\n    } else {\n      return { x: \"final3\" };\n    }\n  }\n\n  var something_B = new RegExp(\"(^|\\\\.)somethingB\\\\.com$\", \"i\");\n\n  var something_D = [\"https\"];\n\n  function checkSomethingB(uri) {\n    if (uri.isEmpty() && uri.toString() !== \"#\") {\n      return false;\n    }\n\n    if (!uri.getDomain() && !uri.getProtocol()) {\n      return false;\n    }\n\n    return something_D.indexOf(uri.getProtocol()) !== -1 && something_B.test(uri.getDomain());\n  }\n\n  var something_C = [\"http\", \"https\"];\n  var something_A = null;\n\n  function checkSomethingA(uri) {\n    if (!something_A) {\n      something_A = new RegExp(\"(^|\\\\.)somethingA\\\\.com$\", \"i\");\n    }\n\n    if (uri.isEmpty() && uri.toString() !== \"#\") {\n      return false;\n    }\n\n    if (!uri.getDomain() && !uri.getProtocol()) {\n      return true;\n    }\n\n    return something_C.indexOf(uri.getProtocol()) !== -1 && something_A.test(uri.getDomain());\n  }\n\n  checkSomethingA.setRegex = function(regex) {\n    something_A = regex;\n  };\n\n  function checkSomethingC(uri) {\n    return checkSomethingA(uri) || checkSomethingB(uri) || checkSomethingD(uri);\n  }\n\n  function isOnionURI(uri) {\n    return uri.getDomain().endsWith(\".onion\");\n  }\n\n  var something_F = new RegExp(\"(^|\\\\.)(get|my)somethingD\\\\.com$\", \"i\");\n\n  var something_D = [\"https\"];\n\n  function checkSomethingD(uri) {\n    if (uri.isEmpty() && uri.toString() !== \"#\") {\n      return false;\n    }\n\n    if (!uri.getDomain() && !uri.getProtocol()) {\n      return false;\n    }\n\n    return something_D.indexOf(uri.getProtocol()) !== -1 && something_F.test(uri.getDomain());\n  }\n\n  var RELATIVE_PREFIX = /^(#|\\/\\w)/;\n  function shouldShim(href) {\n    if (RELATIVE_PREFIX.test(href)) {\n      return false;\n    }\n    var uri = new URI(href);\n    var protocol = uri.getProtocol();\n    return (protocol === \"http\" || protocol === \"https\") && !checkSomethingC(uri);\n  }\n\n  var killswitch = global.__abstract ? __abstract(undefined, \"(function killswitch(){})\") : function killswitch() {};\n\n  var dontUpgradeRegex = new RegExp(\"^(l|lm|h)\\\\..*$\", \"i\");\n  function upgradeUnshimmedLink(href) {\n    if (killswitch(\"LINK_UPGRADE_UNSHIMMED_JS\")) {\n      return null;\n    }\n    if (href.getProtocol() !== \"http\") {\n      return null;\n    }\n    if (!checkSomethingC(href)) {\n      return null;\n    }\n    if (dontUpgradeRegex.test(href.getDomain())) {\n      return null;\n    }\n    return href.setProtocol(\"https\");\n  }\n\n  var LinkReactUnsafeHrefConfig = global.__abstract\n    ? __abstract(undefined, \"({LinkHrefChecker: null})\")\n    : { LinkHrefChecker: null };\n  var LinkHrefChecker = LinkReactUnsafeHrefConfig.LinkHrefChecker;\n\n  function Third(props) {\n    var _props = props;\n    var allowedProtocol = _props.allowunsafehref;\n    var isSafeToSkipShim = _props.s;\n    var rawHref = _props.href;\n    var linkRef = _props.linkRef;\n    var target = _props.target;\n    var otherProps = babelHelpers.objectWithoutProperties(_props, [\n      \"allowunsafehref\",\n      \"s\",\n      \"href\",\n      \"linkRef\",\n      \"target\",\n    ]);\n\n    var href = \"#\";\n    var shimhash = null;\n\n    if (rawHref instanceof URI) {\n      href = rawHref.toString();\n    } else if (typeof rawHref === \"string\" && rawHref !== \"\" && rawHref !== \"#\") {\n      href = rawHref;\n    } else if (typeof rawHref === \"object\" && rawHref !== null) {\n      href = rawHref.url.toString();\n      shimhash = rawHref.shimhash ? rawHref.shimhash.toString() : shimhash;\n    } else {\n      href = \"#\";\n      shimhash = null;\n    }\n\n    if (LinkHrefChecker) {\n      LinkHrefChecker.logIfInvalidProtocol(href, allowedProtocol);\n    }\n\n    if (shimhash == null && shouldShim(href)) {\n      shimhash = something_E.link_react_default_hash;\n    }\n\n    var nofollow = shimhash != null;\n    var useRedirect = shimhash != null;\n    var useMetaReferrer = false;\n\n    var href_uri = new URI(href);\n\n    if (something_E.supports_meta_referrer) {\n      if (something_E.onion_always_shim && isOnionURI(href_uri)) {\n        useRedirect = true;\n      } else {\n        if (isSafeToSkipShim) {\n          useRedirect = false;\n        }\n        if (shimhash != null) {\n          useMetaReferrer = true;\n        }\n      }\n    }\n\n    var noopener = something_E.use_rel_no_opener && shimhash !== null && target === \"_blank\";\n\n    var upgraded_href = upgradeUnshimmedLink(href_uri);\n    if (upgraded_href != null) {\n      href = upgraded_href.toString();\n    }\n\n    var children = Forth(props.children);\n\n    return { x: \"final4\", children: children };\n  }\n\n  var loadLogging = global.__abstract\n    ? __abstract(undefined, \"(function loadLogging() {})\")\n    : function loadLogging() {};\n\n  function logMetaReferrer(href, shimhash) {\n    loadLogging(function(a, x) {\n      var uri = x\n        .getURIBuilder()\n        .setString(\"u\", href)\n        .setString(\"h\", shimhash)\n        .getURI();\n      new a(uri).send();\n    });\n  }\n\n  var LynxGeneration = {\n    getShimURI: function getShimURI() {\n      return new URI(\"/l.php\").setDomain(something_E.linkshim_host);\n    },\n\n    getLynxURIProtocol: function getLynxURIProtocol(targetURI) {\n      if (something_E.always_use_https) {\n        return \"https\";\n      }\n\n      return targetURI.getProtocol() === \"http\" ? \"http\" : \"https\";\n    },\n\n    getShimmedHref: function getShimmedHref(href, shimhash) {\n      var targetURI = new URI(href);\n      var protocol = LynxGeneration.getLynxURIProtocol(targetURI);\n      return LynxGeneration.getShimURI()\n        .setQueryData({ u: href, h: shimhash })\n        .setProtocol(protocol)\n        .toString();\n    },\n\n    temporarilySetMetaReferrer: function temporarilySetMetaReferrer(href, shimhash) {\n      var meta = $(\"meta_referrer\");\n      meta.content = something_E.switched_meta_referrer_policy;\n      setTimeout(function() {\n        meta.content = something_E.default_meta_referrer_policy;\n        logMetaReferrer(href, shimhash);\n      }, 100);\n    },\n\n    loadLogging: loadLogging,\n  };\n\n  function Forth(props) {\n    var _props2 = props;\n    var href = _props2.href;\n    var linkRef = _props2.linkRef;\n    var shimhash = _props2.shimhash;\n    var onClick = _props2.onClick;\n    var useRedirect = _props2.useRedirect;\n    var useMetaReferrer = _props2.useMetaReferrer;\n    var nofollow = _props2.nofollow;\n    var noopener = _props2.noopener;\n    var rel = _props2.rel;\n    var otherProps = babelHelpers.objectWithoutProperties(_props2, [\n      \"href\",\n      \"linkRef\",\n      \"shimhash\",\n      \"onClick\",\n      \"useRedirect\",\n      \"useMetaReferrer\",\n      \"nofollow\",\n      \"noopener\",\n      \"rel\",\n    ]);\n\n    var outputHref = href;\n    var outputRel = rel;\n\n    if (useRedirect) {\n      outputHref = LynxGeneration.getShimmedHref(href, shimhash || \"\");\n    }\n\n    if (nofollow) {\n      outputRel = outputRel ? outputRel + \" nofollow\" : \"nofollow\";\n    }\n\n    if (noopener) {\n      outputRel = outputRel ? outputRel + \" noopener\" : \"noopener\";\n    }\n\n    return {\n      x: \"final5\",\n      children: babelHelpers[\"extends\"]({}, otherProps, {\n        href: outputHref,\n        rel: outputRel,\n        ref: linkRef,\n        onClick: null,\n      }),\n    };\n  }\n\n  global.__optimize && __optimize(Main);\n\n  global.inspect = function() {\n    return Main({}, {});\n  };\n\n  return Main;\n});\n"
  },
  {
    "path": "test/serializer/additional-functions/conditions3.js",
    "content": "function cr(a, b, c) {\n  b.children = c;\n  return a(b);\n}\n\nfunction fn2(a) {\n  return JSON.stringify(a);\n}\n\nfunction ShimURI(str) {\n  this.str = str;\n}\nShimURI.isValidURI = function() {};\nShimURI.prototype.getProtocol = function() {\n  return \"http\";\n};\nShimURI.prototype.setProtocol = function() {};\nShimURI.prototype.getDomain = function() {\n  return \"lol\";\n};\nShimURI.prototype.getDomain = function() {\n  return \"lol.com\";\n};\nShimURI.prototype.toString = function() {\n  return \"http://foo.com\";\n};\n\nvar isXXXURI = global.__abstract\n  ? __abstract(\"function\", \"(function a() { return true; })\")\n  : function() {\n      return true;\n    };\nvar XXX2 = global.__abstract ? __abstract(\"function\", \"(function b() {})\") : function() {};\nvar XXX3 = global.__abstract ? __abstract(\"function\", \"(function c() {})\") : function() {};\nvar XXX6 = global.__abstract\n  ? __abstract(\"object\", \"({link_react_default_hash: '#', XXX9: true, XXX10: true})\")\n  : { link_react_default_hash: \"#\", XXX9: true, XXX10: true };\nvar XXX7 = global.__abstract\n  ? __abstract(\"function\", \"(function e() { return true; })\")\n  : function() {\n      return true;\n    };\nvar XXX5 = global.__abstract\n  ? __abstract(\"function\", \"(function f() { return true;  })\")\n  : function() {\n      return true;\n    };\nvar URI = global.__abstract ? __abstract(\"function\", \"(function () { return ShimURI; })()\") : ShimURI;\n\nvar dontUpgradeRegex = new RegExp(\"^(l|lm|h)\\\\..*$\", \"i\");\n\nfunction XXX8(href) {\n  if (XXX5(\"XXX4\")) {\n    return null;\n  }\n  if (href.getProtocol() !== \"http\") {\n    return null;\n  }\n  if (!isXXXishURI(href)) {\n    return null;\n  }\n  if (dontUpgradeRegex.test(href.getDomain())) {\n    return null;\n  }\n  return href.setProtocol(\"https\");\n}\n\nfunction isXXXishURI(uri) {\n  return isXXXURI(uri) || XXX2(uri) || XXX3(uri);\n}\n\nvar RELATIVE_PREFIX = /^(#|\\/\\w)/;\nfunction shouldShim(href) {\n  if (RELATIVE_PREFIX.test(href.toString())) {\n    return false;\n  }\n  var protocol = href.getProtocol();\n  return (protocol === \"http\" || protocol === \"https\") && !isXXXishURI(href);\n}\n\nfunction parseHref(rawHref) {\n  var href_string = \"#\";\n  var shimhash = null;\n\n  if (rawHref instanceof URI) {\n    href_string = rawHref.toString();\n  } else if (typeof rawHref === \"string\" && rawHref !== \"\" && rawHref !== \"#\") {\n    href_string = rawHref;\n  } else if (typeof rawHref === \"object\" && rawHref !== null) {\n    href_string = rawHref.url.toString();\n    shimhash = rawHref.shimhash ? rawHref.shimhash.toString() : shimhash;\n  } else {\n    href_string = \"#\";\n    shimhash = null;\n  }\n\n  var href = void 0;\n  if (URI.isValidURI(href_string)) {\n    href = new URI(href_string);\n  } else {\n    href = new URI(\"#\");\n  }\n\n  if (shimhash == null && shouldShim(href)) {\n    shimhash = XXX6.link_react_default_hash;\n  }\n\n  var upgraded_href = XXX8(href);\n  if (upgraded_href != null) {\n    href = upgraded_href;\n  }\n\n  return [href, shimhash];\n}\n\nfunction fn1(props) {\n  var _props = props;\n  var _allowedProtocol = _props.allowunsafehref;\n  var isSafeToSkipShim = _props.s;\n  var rawHref = _props.href;\n  var linkRef = _props.linkRef;\n  var target = _props.target;\n  var parsed_href = parseHref(rawHref);\n  var href = parsed_href[0];\n  var shimhash = parsed_href[1];\n\n  var nofollow = shimhash != null;\n  var useRedirect = shimhash != null;\n  var useMetaReferrer = false;\n\n  if (XXX6.XXX9) {\n    if (XXX6.XXX10 && XXX7(href)) {\n      useRedirect = true;\n    } else {\n      if (isSafeToSkipShim) {\n        useRedirect = false;\n      }\n      if (shimhash != null) {\n        useMetaReferrer = true;\n      }\n    }\n  }\n\n  var noopener = XXX6.use_rel_no_opener && shimhash !== null && target === \"_blank\";\n\n  return cr(\n    fn2,\n    Object.assign({}, props, {\n      href: href,\n      linkRef: linkRef,\n      nofollow: nofollow,\n      noopener: noopener,\n      shimhash: shimhash,\n      target: target,\n      useRedirect: useRedirect,\n      useMetaReferrer: useMetaReferrer,\n    })\n  );\n}\n\nglobal.__optimize && __optimize(fn1);\n\nglobal.inspect = function() {\n  return fn1({ href: \"http://foobar.com\", linkRef: \"123\" });\n};\n"
  },
  {
    "path": "test/serializer/additional-functions/create-local.js",
    "content": "// does not contain:x = 5;\n// does not contain:y = 10;\n\nfunction additional1() {\n  var z = { foo: 5 };\n  global.x = z;\n  var x = 5;\n}\n\nfunction additional2() {\n  var z = { bar: 6 };\n  global.y = z;\n  var y = 10;\n}\n\nif (global.__optimize) {\n  __optimize(additional1);\n  __optimize(additional2);\n}\n\ninspect = function() {\n  additional1();\n  additional2();\n  let x = global.x;\n  let y = global.y;\n  additional1();\n\n  return \"\" + x.foo + y.bar + (global.x === x) + global.x.foo;\n};\n"
  },
  {
    "path": "test/serializer/additional-functions/createdobject-modifications.js",
    "content": "// does not contain:x = 5;\n// does not contain:y = 10;\n\nglobal.foo = { x: 100, y: 200 };\nvar z = 42;\n\nfunction additional1() {\n  let local = {};\n  local.x = global.foo.x;\n  local.foo = z + local.x;\n  delete local.x;\n  var x = 5;\n  global.foo.x = local;\n}\n\nfunction additional2() {\n  let local = {};\n  local.y = global.foo.y;\n  local.bar = z + local.y;\n  delete local.y;\n  var y = 10;\n  global.foo.y = local;\n}\n\nif (global.__optimize) {\n  __optimize(additional1);\n  __optimize(additional2);\n}\n\ninspect = function() {\n  additional2();\n  additional1();\n  let foo = global.foo;\n  return \"\" + JSON.stringify(foo.x) + JSON.stringify(foo.y);\n};\n"
  },
  {
    "path": "test/serializer/additional-functions/createdobject.js",
    "content": "// does not contain:x = 5;\n// does not contain:y = 10;\nlet toCapture1 = {};\n\nfunction additional1() {\n  toCapture1 = 5;\n  var x = 5;\n  x = 10;\n  global.x = x;\n}\n\nfunction additional2() {\n  var y = 10;\n  y = 5;\n  global.y = y;\n}\n\nif (global.__optimize) {\n  __optimize(additional1);\n  __optimize(additional2);\n}\n\ninspect = function inspect() {\n  let z = toCapture1;\n  additional1();\n  let z2 = toCapture1;\n  additional2();\n\n  return \"\" + JSON.stringify(z) + JSON.stringify(z2) + JSON.stringify(toCapture1);\n};\n"
  },
  {
    "path": "test/serializer/additional-functions/dead-functions.js",
    "content": "(function() {\n  function g() {\n    return 42;\n  }\n  function f() {\n    return g();\n  }\n  if (global.__optimize) {\n    __optimize(f);\n    __optimize(g);\n  }\n  inspect = f;\n})();\n"
  },
  {
    "path": "test/serializer/additional-functions/func-nesting.js",
    "content": "inspect = undefined;\n(function() {\n  var Super = function Super() {\n    this.prop = \"bar\";\n  };\n\n  var ES5Class = (function(superclass) {\n    function Foo() {\n      superclass.apply(this, arguments);\n      this.state = \"hello\";\n    }\n\n    if (superclass) {\n      Foo.__proto__ = superclass;\n    }\n    Foo.prototype = Object.create(superclass && superclass.prototype);\n    Foo.prototype.constructor = Foo;\n    Foo.prototype.method = function() {\n      return \" world\";\n    };\n\n    return Foo;\n  })(Super);\n\n  function additional1() {\n    return new ES5Class();\n  }\n\n  function additional2() {}\n\n  if (global.__optimize) {\n    __optimize(additional1);\n    __optimize(additional2);\n  }\n\n  global.additional1 = additional1;\n  global.additional2 = additional2;\n\n  inspect = function inspect() {\n    let c1 = additional1();\n    let c2 = additional1();\n    additional2();\n\n    return \"START\" + c1 + \" \" + (c1.prototype === c2.prototype) + \" \" + (c1.method === c2.method);\n  };\n})();\n"
  },
  {
    "path": "test/serializer/additional-functions/modified-global-let-simple.js",
    "content": "let x = undefined;\nglobal.additional1 = function() {\n  x = {};\n  return 4;\n};\n\nglobal.additional2 = function() {\n  return 20;\n};\n\nif (global.__optimize) {\n  global.__optimize(additional1);\n  global.__optimize(additional2);\n}\n\ninspect = function() {\n  let prevX = x;\n  global.additional1();\n  return \"\" + prevX + \" \" + x;\n};\n"
  },
  {
    "path": "test/serializer/additional-functions/modifiedobjects.js",
    "content": "// does not contain:x = 5;\n// does not contain:y = 10;\nlet toCapture1 = {};\nlet toCapture2 = 5;\nlet toCapture3 = {};\nObject.defineProperty(global, \"foo\", { configurable: true, enumerable: false, value: 42 });\nObject.defineProperty(global, \"bar\", {\n  configurable: true,\n  enumerable: false,\n  get: function() {\n    return 43;\n  },\n});\n\nfunction additional1() {\n  toCapture1 = 5;\n  toCapture2 = undefined;\n  global.foo += 1;\n  foo += 1;\n  var x = 5;\n  x = 10;\n  global.x = x;\n}\n\nfunction additional2() {\n  var y = 10;\n  y = 5;\n  toCapture3 = y;\n  global.y = y;\n}\n\nif (global.__optimize) {\n  __optimize(additional1);\n  __optimize(additional2);\n}\n\ninspect = function inspect() {\n  let z = toCapture1;\n  let x = toCapture2;\n  let y = toCapture3;\n  additional1();\n  let z2 = toCapture1;\n  additional2();\n\n  return (\n    \"\" + z + z2 + x + y + toCapture1 + toCapture2 + toCapture3 + global.foo + global.bar + (global.foo === global.bar)\n  );\n};\n"
  },
  {
    "path": "test/serializer/additional-functions/named-function.js",
    "content": "function additional1() {\n  return {\n    foo: function foo() {\n      return 123;\n    },\n  };\n}\n\nif (this.__optimize) {\n  __optimize(additional1);\n}\n\ninspect = function() {\n  let x = additional1();\n\n  return x.foo();\n};\n"
  },
  {
    "path": "test/serializer/additional-functions/nested_function.js",
    "content": "// does not contain:var y = 5;\n// does not contain:var y = 10;\n\nfunction additional1() {\n  var x2 = { foo: 5 };\n  foo = function() {\n    return x2;\n  };\n  var y = 5;\n}\n\nfunction produceObject() {\n  return { bar: 5 };\n}\n\nfunction additional2() {\n  \"use strict\";\n  let x1 = produceObject();\n  global.bar = function() {\n    return x1;\n  };\n}\n\nif (global.__optimize) {\n  __optimize(additional1);\n  __optimize(additional2);\n}\n\ninspect = function() {\n  additional1();\n  additional2();\n  let bar1 = global.bar;\n  let foo1 = global.foo;\n  additional1();\n  additional2();\n\n  return (\n    \" \" +\n    JSON.stringify(global.bar()) +\n    global.foo().foo +\n    bar1() +\n    foo1().foo +\n    (bar1 === global.bar) +\n    (bar1() === global.bar()) +\n    (foo1() === global.foo())\n  );\n};\n"
  },
  {
    "path": "test/serializer/additional-functions/nested_function2.js",
    "content": "// does not contain:= 7;\n// does not contain:= 10;\n\nfunction additional1() {\n  var x2 = { foo: 5 };\n  foo = function() {\n    return x2;\n  };\n  var y = 7;\n}\n\nfunction additional2() {\n  let x = 10;\n}\n\nif (global.__optimize) {\n  __optimize(additional1);\n  __optimize(additional2);\n}\n\ninspect = function() {\n  additional1();\n  additional2();\n  let ret1 = global.foo();\n  let ret2 = global.foo();\n  ret1.x += 9;\n\n  return \" \" + JSON.stringify(ret1) + JSON.stringify(ret2) + (ret1 === ret2);\n};\n"
  },
  {
    "path": "test/serializer/additional-functions/nested_function3.js",
    "content": "// does not contain:= 7;\n// does not contain:= 10;\nlet x1 = { bar: 500 };\n\nfunction additional1() {\n  var x2 = { foo: 5 };\n  foo = function() {\n    return [x1, x2];\n  };\n  var y = 7;\n}\n\nfunction additional2() {\n  let x = 10;\n}\n\nif (global.__optimize) {\n  __optimize(additional1);\n  __optimize(additional2);\n}\n\ninspect = function() {\n  additional1();\n  additional2();\n  let [ret1, ret1_] = global.foo();\n  let [ret2, ret2_] = global.foo();\n  additional1();\n  let [ret3, ret3_] = global.foo();\n  let strings = [ret1, ret1_, ret2, ret2_, ret3, ret3_].map(JSON.stringify).join(\" \");\n\n  return (\n    strings +\n    (ret1 === ret2) +\n    (ret1 === ret3) +\n    (ret2 === ret3) +\n    (ret1_ === ret2_) +\n    (ret1_ === ret3_) +\n    (ret2_ === ret3_)\n  );\n};\n"
  },
  {
    "path": "test/serializer/additional-functions/nested_function4.js",
    "content": "// does not contain:= 7;\n// does not contain:= 10;\nlet addit_capture = { baz: 99 };\n\nfunction additional1() {\n  var x2 = { foo: addit_capture.baz + 500 };\n  foo = function() {\n    return [addit_capture, x2];\n  };\n  addit_capture.baz += 42;\n  var y = 7;\n}\n\nfunction additional2() {\n  let x = 10;\n}\n\nif (global.__optimize) {\n  __optimize(additional1);\n  __optimize(additional2);\n}\n\ninspect = function() {\n  additional1();\n  additional2();\n  let [ret1, ret1_] = global.foo();\n  let [ret2, ret2_] = global.foo();\n  additional1();\n  let [ret3, ret3_] = global.foo();\n  let strings = [ret1, ret1_, ret2, ret2_, ret3, ret3_].map(JSON.stringify).join(\" \");\n\n  return \"PASS\";\n  /*return strings + (ret1 === ret2) + (ret1 === ret3) + (ret2 === ret3) +\n    (ret1_ === ret2_) + (ret1_ === ret3_) + (ret2_ === ret3_);*/\n};\n"
  },
  {
    "path": "test/serializer/additional-functions/nested_modifybinding.js",
    "content": "// does not contain:var y = 5;\n// does not contain:var y = 10;\n\n(function() {\n  let top = 5;\n  function af1() {\n    let mutable = 3;\n    return function() {\n      return ++mutable + --top;\n    };\n  }\n  global.residual = function() {\n    return ++top;\n  };\n  global.f = af1;\n  if (global.__optimize) global.__optimize(af1);\n  inspect = function() {\n    return global.f()() + global.residual();\n  };\n})();\n"
  },
  {
    "path": "test/serializer/additional-functions/noconflict-captures.js",
    "content": "// does not contain:x = 5;\n// does not contain:y = 10;\n\nglobal.a = \"\";\nglobal.b = \"\";\nvar z = 42;\n\nfunction additional1() {\n  global.a = z + \"foo\";\n  var x = 5;\n}\n\nfunction additional2() {\n  global.b = z + \"bar\";\n  var y = 10;\n}\n\nif (global.__optimize) {\n  __optimize(additional1);\n  __optimize(additional2);\n}\n\ninspect = function() {\n  additional2();\n  additional1();\n  return global.a + global.b;\n};\n"
  },
  {
    "path": "test/serializer/additional-functions/noconflict-captures2.js",
    "content": "// does not contain:x = 5;\n// does not contain:y = 10;\n\nglobal.a = \"\";\nglobal.b = \"\";\nvar z = global.__abstract ? __abstract(\"number\", \"(42)\") : 42;\n\nfunction additional1() {\n  global.a = z + \"foo\";\n  var x = 5;\n}\n\nfunction additional2() {\n  global.b = z + \"bar\";\n  var y = 10;\n}\n\nif (global.__optimize) {\n  __optimize(additional1);\n  __optimize(additional2);\n}\n\ninspect = function() {\n  additional2();\n  additional1();\n  return global.a + global.b;\n};\n"
  },
  {
    "path": "test/serializer/additional-functions/noconflict-existantobject.js",
    "content": "// does not contain:x = 5;\n// does not contain:y = 10;\n\nglobal.c = {};\n\nfunction additional1() {\n  global.c.foo = 5;\n  var x = 5;\n}\n\nfunction additional2() {\n  global.c.bar = 2;\n  var y = 10;\n}\n\nif (global.__optimize) {\n  __optimize(additional1);\n  __optimize(additional2);\n}\n\ninspect = function() {\n  additional2();\n  additional1();\n  return global.b + global.c.foo + global.c.bar;\n};\n"
  },
  {
    "path": "test/serializer/additional-functions/noopfunc.js",
    "content": "// does not contain:x = 5;\n// does not contain:y = 10;\n\nglobal.a = \"\";\nglobal.b = \"\";\nvar z = 42;\n\nfunction additional1() {\n  var x = 5;\n}\n\nfunction additional2() {\n  global.b = z + \"bar\";\n  var y = 10;\n}\n\nif (global.__optimize) {\n  __optimize(additional1);\n  __optimize(additional2);\n}\n\ninspect = function() {\n  additional2();\n  additional1();\n  return global.a + global.b;\n};\n"
  },
  {
    "path": "test/serializer/additional-functions/possible_throw_object_assign.js",
    "content": "var f = function(x, y) {\n  if (y) Object.assign({}, x);\n  else throw new Error();\n};\n\nif (global.__optimize) __optimize(f);\n\nglobal.inspect = function() {\n  let normalRet = f({ foo: \"bar\" }, true);\n  let errorRet, error;\n  try {\n    errorRet = f({ baz: \"qux\" }, false);\n  } catch (e) {\n    error = e;\n  }\n  return JSON.stringify(normalRet) + \" \" + errorRet + \" \" + JSON.stringify(error);\n};\n"
  },
  {
    "path": "test/serializer/additional-functions/precise_captures.js",
    "content": "(function() {\n  function Bar() {\n    return 123;\n  }\n\n  function Foo() {\n    return Bar();\n  }\n\n  if (global.__optimize) __optimize(Foo);\n\n  global.Foo = Foo;\n\n  inspect = function() {\n    return Foo();\n  };\n})();\n"
  },
  {
    "path": "test/serializer/additional-functions/prelude-ordering.js",
    "content": "function additional1() {\n  var obj = { x: 42 };\n  return function() {\n    let ret = obj;\n    obj = {};\n    return ret;\n  };\n}\nfunction additional2() {}\n\nif (global.__optimize) {\n  __optimize(additional1);\n  __optimize(additional2);\n}\n\ninspect = function() {\n  return additional1()().x;\n};\n"
  },
  {
    "path": "test/serializer/additional-functions/property-deletion.js",
    "content": "// does not contain:x = 5;\n// does not contain:y = 10;\n\nglobal.foo = { x: 100, y: 200 };\nvar z = 42;\n\nfunction additional1() {\n  global.foo.foo = z + global.foo.x;\n  delete global.foo.x;\n  var x = 5;\n}\n\nfunction additional2() {\n  global.foo.bar = z + global.foo.y;\n  delete global.foo.y;\n  var y = 10;\n}\n\nif (global.__optimize) {\n  __optimize(additional1);\n  __optimize(additional2);\n}\n\ninspect = function() {\n  additional2();\n  additional1();\n  let foo = global.foo;\n  return \"\" + foo.x + foo.y + foo.foo + foo.bar;\n};\n"
  },
  {
    "path": "test/serializer/additional-functions/property-modification.js",
    "content": "// does not contain:x = 5;\n// does not contain:y = 10;\n\nglobal.a = {};\nglobal.b = {};\nvar z = 42;\n\nfunction additional1() {\n  global.a.foo = z + \"foo\";\n  var x = 5;\n}\n\nfunction additional2() {\n  global.b.bar = z + \"bar\";\n  var y = 10;\n}\n\nif (global.__optimize) {\n  __optimize(additional1);\n  __optimize(additional2);\n}\n\ninspect = function() {\n  additional2();\n  additional1();\n  return JSON.stringify(global.a) + JSON.stringify(global.b);\n};\n"
  },
  {
    "path": "test/serializer/additional-functions/referentialization.js",
    "content": "(function() {\n  function additional() {\n    var obj = {};\n    global.nested = function() {\n      obj = {};\n      obj.p = 100;\n      return obj;\n    };\n    return obj;\n  }\n  if (global.__optimize) {\n    global.__optimize(additional);\n  }\n  inspect = function() {\n    additional();\n    return JSON.stringify(global.nested());\n  };\n})();\n"
  },
  {
    "path": "test/serializer/additional-functions/referentialization2.js",
    "content": "(function() {\n  var obj = {};\n  function additional() {\n    global.nested = function() {\n      obj = {};\n      obj.p = 100;\n      return obj;\n    };\n    return obj;\n  }\n  if (global.__optimize) {\n    global.__optimize(additional);\n  }\n  inspect = function() {\n    additional();\n    return JSON.stringify(global.nested());\n  };\n})();\n"
  },
  {
    "path": "test/serializer/additional-functions/register_conditionally.js",
    "content": "let abstract_bool = global.__abstract ? global.__abstract(\"boolean\", \"(false)\") : false;\n\nfunction func1() {\n  let x = 5;\n  global.z = x;\n  return global.z;\n}\n\nfunction func2() {\n  let x = 5;\n  global.y = x;\n  return global.y;\n}\n\nif (global.__optimize && abstract_bool) {\n  __optimize(func1);\n  __optimize(func2);\n}\n\ninspect = function() {\n  return func1() + func2();\n};\n"
  },
  {
    "path": "test/serializer/additional-functions/register_test.js",
    "content": "// does not contain:x = 5;\n\nfunction func1() {\n  let x = 5;\n  global.z = x;\n  return global.z;\n}\n\nfunction func2() {\n  let x = 5;\n  global.y = x;\n  return global.y;\n}\n\nif (global.__optimize) {\n  __optimize(func1);\n  __optimize(func2);\n}\n\ninspect = function() {\n  return func1() + func2();\n};\n"
  },
  {
    "path": "test/serializer/additional-functions/require_opt.js",
    "content": "// es6\n// does not contain:var y = 5;\n// does not contain:var y = 10;\nvar modules = Object.create(null);\n\n__d = define;\nfunction require(moduleId) {\n  var moduleIdReallyIsNumber = moduleId;\n  var module = modules[moduleIdReallyIsNumber];\n  return module && module.isInitialized ? module.exports : guardedLoadModule(moduleIdReallyIsNumber, module);\n}\n\nfunction define(factory, moduleId, dependencyMap) {\n  if (moduleId in modules) {\n    return;\n  }\n  modules[moduleId] = {\n    dependencyMap: dependencyMap,\n    exports: undefined,\n    factory: factory,\n    hasError: false,\n    isInitialized: false,\n  };\n\n  var _verboseName = arguments[3];\n  if (_verboseName) {\n    modules[moduleId].verboseName = _verboseName;\n    global.verboseNamesToModuleIds[_verboseName] = moduleId;\n  }\n}\n\nvar inGuard = false;\nfunction guardedLoadModule(moduleId, module) {\n  if (!inGuard && global.ErrorUtils) {\n    inGuard = true;\n    var returnValue = void 0;\n    try {\n      returnValue = loadModuleImplementation(moduleId, module);\n    } catch (e) {\n      global.ErrorUtils.reportFatalError(e);\n    }\n    inGuard = false;\n    return returnValue;\n  } else {\n    return loadModuleImplementation(moduleId, module);\n  }\n}\n\nfunction loadModuleImplementation(moduleId, module) {\n  var nativeRequire = global.nativeRequire;\n  if (!module && nativeRequire) {\n    nativeRequire(moduleId);\n    module = modules[moduleId];\n  }\n\n  if (!module) {\n    throw unknownModuleError(moduleId);\n  }\n\n  if (module.hasError) {\n    throw moduleThrewError(moduleId);\n  }\n\n  module.isInitialized = true;\n  var exports = (module.exports = {});\n  var _module = module,\n    factory = _module.factory,\n    dependencyMap = _module.dependencyMap;\n  try {\n    var _moduleObject = { exports: exports };\n\n    factory(global, require, _moduleObject, exports, dependencyMap);\n\n    module.factory = undefined;\n\n    return (module.exports = _moduleObject.exports);\n  } catch (e) {\n    module.hasError = true;\n    module.isInitialized = false;\n    module.exports = undefined;\n    throw e;\n  }\n}\n\nfunction unknownModuleError(id) {\n  var message = 'Requiring unknown module \"' + id + '\".';\n  return Error(message);\n}\n\nfunction moduleThrewError(id) {\n  return Error('Requiring module \"' + id + '\", which threw an exception.');\n}\n\n// === End require code ===\n\ndefine(function(global, require, module, exports) {\n  let exportval = { foo: \" hello \" };\n  module.exports = exportval;\n}, 0, null);\n\ndefine(function(global, require, module, exports) {\n  var x1 = require(0);\n  var y = require(2);\n  module.exports = {\n    bar: \" goodbye\",\n    foo2: x1.foo,\n    baz: y.baz,\n  };\n}, 1, null);\n\ndefine(function(global, require, module, exports) {\n  module.exports = { baz: \" foo \" };\n}, 2, null);\n\nfunction additional1() {\n  var x2 = require(0);\n  global.foo = function() {\n    return x2;\n  };\n  var y = 5;\n}\n\nfunction additional2() {\n  //global.bar = function() { return require(0).baz + \"bar\"; }\n  global.bar = function() {\n    return 5;\n  };\n}\n\nif (global.__optimize) {\n  __optimize(additional1);\n  __optimize(additional2);\n}\n\ninspect = function() {\n  additional1();\n  additional2();\n\n  let requireequal = require(0) === global.foo();\n  let uninitialized = modules[1].exports === undefined && require(1).bar === \" goodbye\";\n  return \" \" + requireequal + uninitialized + global.bar();\n};\n"
  },
  {
    "path": "test/serializer/additional-functions/return-or-many-throw.js",
    "content": "// does not contain:z = 5;\n// add at runtime: global.x = 3;\n\nvar x;\nif (global.__abstract) x = __abstract(\"number\", \"(4)\");\nelse x = 4;\nvar obj = { foo: null };\n\nfunction func1(doNotThrow) {\n  let z = 5;\n  obj.foo = 10;\n  if (x > 10) {\n    obj.foo = 15;\n    if (doNotThrow) {\n      obj.foo = 18;\n      return 15;\n    } else {\n      throw new Error(\"X greater than 10 \" + x);\n    }\n  } else if (x > 5) {\n    if (doNotThrow) {\n      return 100;\n    } else {\n      obj.foo = 17;\n      throw new Error(\"X greater than 5 \" + x);\n    }\n  }\n  obj.foo = 20;\n  throw new Error(\"Returning \" + x);\n  //return x;\n}\n\nif (global.__optimize) __optimize(func1);\n\ninspect = function() {\n  let error;\n  let normalRet;\n  let ret;\n  try {\n    normalRet = func1(true);\n    ret = func1(false);\n  } catch (e) {\n    error = e.message;\n  }\n  return \"err: \" + error + \" ret \" + ret + \" normal ret \" + normalRet + \" foo \" + obj.foo;\n};\n"
  },
  {
    "path": "test/serializer/additional-functions/return-or-multiple-throw.js",
    "content": "// does not contain:z = 5;\n// add at runtime: global.x = 3;\n\nvar x;\nif (global.__abstract) x = __abstract(\"number\", \"(11)\");\nelse x = 11;\nvar obj = { foo: null };\n\nfunction func1() {\n  let z = 5;\n  obj.foo = 10;\n  if (x > 10) {\n    obj.foo = 15;\n    throw new Error(\"X greater than 10 \" + x);\n  } else if (x > 5) {\n    obj.foo = 17;\n    throw new Error(\"X greater than 5 \" + x);\n  }\n  obj.foo = 20;\n  return x;\n}\n\nif (global.__optimize) __optimize(func1);\n\ninspect = function() {\n  let error;\n  let ret;\n  try {\n    ret = func1();\n  } catch (e) {\n    error = e.message;\n  }\n  return \"err: \" + error + \" ret \" + ret + \" foo \" + global.foo;\n};\n"
  },
  {
    "path": "test/serializer/additional-functions/return-or-throw-modifybindings.js",
    "content": "// does not contain:z = 5;\n// add at runtime: global.x = 3;\nvar x;\nif (global.__abstract) x = __abstract(\"number\", \"(3)\");\nelse x = 3;\nvar foo;\n\nfunction func1() {\n  let z = 5;\n  foo = 10;\n  if (x > 10) {\n    foo = 15;\n    throw new Error(\"X greater than 10 \" + x);\n  }\n  foo = 20;\n  return x;\n}\n\nif (global.__optimize) __optimize(func1);\n\ninspect = function() {\n  let error;\n  let ret;\n  try {\n    ret = func1();\n  } catch (e) {\n    error = e.message;\n  }\n  return \"err: \" + error + \" ret \" + ret + \" foo \" + foo;\n};\n"
  },
  {
    "path": "test/serializer/additional-functions/return-or-throw-modifybindings2.js",
    "content": "// does not contain:z = 5;\n// add at runtime: global.x = 3;\nvar x;\nif (global.__abstract) x = __abstract(\"number\", \"(11)\");\nelse x = 11;\n\n(function() {\n  var foo;\n\n  function func1() {\n    let z = 5;\n    foo = 10;\n    if (x > 10) {\n      foo = 15;\n      throw new Error(\"X greater than 10 \" + x);\n    }\n    foo = 20;\n    return x;\n  }\n  global.func1 = func1;\n\n  if (global.__optimize) __optimize(func1);\n\n  global.inspect = function() {\n    let prevfoo = foo;\n    let error;\n    let ret;\n    try {\n      ret = func1();\n    } catch (e) {\n      error = e.message;\n    }\n    return \"prevfoo: \" + prevfoo + \" err: \" + error + \" ret \" + ret + \" foo \" + foo;\n  };\n})();\n"
  },
  {
    "path": "test/serializer/additional-functions/return-or-throw-modifybindings3.js",
    "content": "// does not contain:z = 5;\n// add at runtime: global.x = 3;\nvar x;\nif (global.__abstract) x = __abstract(\"number\", \"(3)\");\nelse x = 3;\n\n(function() {\n  var foo;\n\n  function func1() {\n    let z = 5;\n    foo = 10;\n    if (x > 10) {\n      foo = 15;\n      throw new Error(\"X greater than 10 \" + x);\n    }\n    foo = 20;\n    return x;\n  }\n  global.func1 = func1;\n\n  if (global.__optimize) __optimize(func1);\n\n  global.inspect = function() {\n    let error;\n    let ret;\n    try {\n      ret = func1();\n    } catch (e) {\n      error = e.message;\n    }\n    return \"err: \" + error + \" ret \" + ret + \" foo \" + foo;\n  };\n})();\n"
  },
  {
    "path": "test/serializer/additional-functions/return-or-throw-modifyproperties.js",
    "content": "// does not contain:z = 5;\n// add at runtime: global.x = 3;\nvar x;\nif (global.__abstract) x = __abstract(\"number\", \"(3)\");\nelse x = 3;\nvar obj = { foo: null };\n\nfunction func1() {\n  let z = 5;\n  obj.foo = 10;\n  if (x > 10) {\n    obj.foo = 15;\n    throw new Error(\"X greater than 10 \" + x);\n  }\n  obj.foo = 20;\n  return x;\n}\n\nif (global.__optimize) __optimize(func1);\n\ninspect = function() {\n  let error;\n  let ret;\n  try {\n    ret = func1();\n  } catch (e) {\n    error = e.message;\n  }\n  return \"err: \" + error + \" ret \" + ret + \" foo \" + global.foo;\n};\n"
  },
  {
    "path": "test/serializer/additional-functions/return-or-throw-modifyproperties2.js",
    "content": "// does not contain:z = 5;\n// add at runtime: global.x = 3;\nvar x;\nif (global.__abstract) x = __abstract(\"number\", \"(11)\");\nelse x = 11;\nvar obj = { foo: null };\n\nfunction func1() {\n  let z = 5;\n  obj.foo = 10;\n  if (x > 10) {\n    obj.foo = 15;\n    throw new Error(\"X greater than 10 \" + x);\n  }\n  obj.foo = 20;\n  return x;\n}\n\nif (global.__optimize) __optimize(func1);\n\ninspect = function() {\n  let error;\n  let ret;\n  try {\n    ret = func1();\n  } catch (e) {\n    error = e.message;\n  }\n  return \"err: \" + error + \" ret \" + ret + \" foo \" + global.foo;\n};\n"
  },
  {
    "path": "test/serializer/additional-functions/return-or-throw-simple.js",
    "content": "// does not contain:z = 5;\n// does contain:16:11\n// Copies of x = 25: 1\n// add at runtime: global.x = 3;\nvar x;\nif (global.__abstract) x = __abstract(\"number\", \"(3)\");\nelse x = 3;\n\nfunction func1() {\n  let z = 5;\n  if (x > 10) {\n    x = 15;\n    throw new Error(\"X greater than 10 \" + x);\n  } else if (x > 20) {\n    x = 25;\n    throw new Error(\"X greater than 20 \" + x);\n  }\n  return x;\n}\n\nif (global.__optimize) __optimize(func1);\n\ninspect = function() {\n  let error;\n  let ret;\n  try {\n    ret = func1();\n  } catch (e) {\n    error = e.message;\n  }\n  return \"err: \" + error + \" ret \" + ret;\n};\n"
  },
  {
    "path": "test/serializer/additional-functions/return-or-throw-simple1.js",
    "content": "var x = global.__abstract ? (x = __abstract(\"number\", \"(23)\")) : 23;\n\nfunction func1() {\n  let z = 5;\n  if (x > 20) {\n    x = 15;\n    throw new Error(\"X greater than 10 \" + x);\n  } else if (x > 10) {\n    x = 25;\n    throw new Error(\"X greater than 20 \" + x);\n  }\n  return x;\n}\n\nif (global.__optimize) __optimize(func1);\n\ninspect = function() {\n  let error;\n  let ret;\n  try {\n    ret = func1();\n  } catch (e) {\n    error = e.message;\n  }\n  return \"err: \" + error + \" ret \" + ret;\n};\n"
  },
  {
    "path": "test/serializer/additional-functions/return-value-simple.js",
    "content": "// does not contain:x = 5;\n// does not contain:y = 10;\n\nglobal.z = 100;\n\nfunction additional1() {\n  let x = 5;\n  var q = 5;\n  return 23;\n}\n\nfunction additional2() {\n  var y = 10;\n  return z + \"bar\";\n}\n\nif (global.__optimize) {\n  __optimize(additional1);\n  __optimize(additional2);\n}\n\ninspect = function() {\n  let x = additional2();\n  let y = additional1();\n  return x + y;\n};\n"
  },
  {
    "path": "test/serializer/additional-functions/self_referential.js",
    "content": "// does not contain:x = 5;\n\nfunction func1() {\n  let x = 5;\n  let z = [func1];\n  return z;\n}\n\nif (global.__optimize) {\n  __optimize(func1);\n}\n\ninspect = function() {\n  return func1()[0] === func1()[0];\n};\n"
  },
  {
    "path": "test/serializer/additional-functions/self_referential_simple.js",
    "content": "// does not contain:x = 5;\n\nfunction func1() {\n  let x = 5;\n  let z = func1;\n  return z;\n}\n\nif (global.__optimize) {\n  __optimize(func1);\n}\n\ninspect = function() {\n  return func1()[0] === func1()[0];\n};\n"
  },
  {
    "path": "test/serializer/additional-functions/write-in-conflict.js",
    "content": "// throws introspection error\n\nfunction additional1() {\n  a = \"foo\";\n}\n\nfunction additional2() {\n  return \"a\" in global;\n}\n\nif (global.__optimize) {\n  __optimize(additional1);\n  __optimize(additional2);\n}\n\nglobal.__residual ? __residual(\"void\", additional1) : additional1();\nx = additional2();\n\ninspect = function() {\n  return x;\n};\n"
  },
  {
    "path": "test/serializer/additional-functions/write-write-noconflict.js",
    "content": "// does not contain:x = 5;\n// does not contain:y = 10;\n// expected Warning: PP1007\n\nglobal.a = \"\";\nglobal.b = \"\";\n\nfunction additional1() {\n  global.a = \"foo\";\n  var x = 5;\n}\n\nfunction additional2() {\n  global.b = \"bar\";\n  var y = 10;\n}\n\nif (global.__optimize) {\n  __optimize(additional1);\n  __optimize(additional2);\n}\n\ninspect = function() {\n  additional2();\n  additional1();\n  return global.a + global.b;\n};\n"
  },
  {
    "path": "test/serializer/basic/Arguments.js",
    "content": "function g(i) {\n  function f() {\n    /* This function is too big to be inlined! */\n    return i + arguments[0];\n  }\n  return f;\n}\nvar h0 = g(0);\nvar h1 = g(1);\n\ninspect = function() {\n  return h1(42) - h0(42);\n};\n"
  },
  {
    "path": "test/serializer/basic/Arguments2.js",
    "content": "function f() {\n  return arguments;\n}\n\nvar x = f(42, \"b\", true);\n\ninspect = function() {\n  return \"\" + x[0] + x[1] + x[2] + x.length + (x.callee === f) + (x.caller !== undefined);\n};\n"
  },
  {
    "path": "test/serializer/basic/ArrayBuffer.js",
    "content": "var x = new ArrayBuffer(16);\n// Two typed arrays over the same buffer should share the same buffer\nvar y = new Int8Array(x);\ny[0] = 1;\nvar z = new Int16Array(x);\nz[0] = 2;\nvar a = new DataView(x);\na.setInt8(2, 3);\ninspect = function() {\n  return x.byteLength + y[0] + z[0] + y[2];\n};\n"
  },
  {
    "path": "test/serializer/basic/ArrayIndexedProperty.js",
    "content": "var a = [1, 2, 3];\nObject.defineProperty(a, 2, {\n  configurable: true,\n  enumerable: true,\n  get: function() {\n    throw new Error();\n  },\n});\ninspect = function() {\n  return a.length + typeof Object.getOwnPropertyDescriptor(a, 2).get;\n};\n"
  },
  {
    "path": "test/serializer/basic/ArrayInitializer2.js",
    "content": "// does contain:[11,, 333, 44]\n(function() {\n  let o = [11, 22, 33, 44];\n  o[\"2\"] = 333; // Index property.\n  delete o[1];\n  o[\"010\"] = 42; // None-index property.\n  inspect = function() {\n    return o;\n  };\n})();\n"
  },
  {
    "path": "test/serializer/basic/ArrayInitializer3.js",
    "content": "// does contain:[11, 22,, 44]\n(function() {\n  let o = [11, 22, 33, 44];\n  Object.defineProperty(o, \"2\", {\n    get: function() {\n      return \"changed\";\n    },\n  });\n  inspect = function() {\n    return o[2];\n  };\n})();\n"
  },
  {
    "path": "test/serializer/basic/ArrayPrototype.js",
    "content": "var na = Object.create(Array.prototype);\nvar a = [];\n\ninspect = function() {\n  a.push(123);\n  na.push(123);\n  return a[0] + na[0];\n};\n"
  },
  {
    "path": "test/serializer/basic/ArrayWithProperties.js",
    "content": "var a = [1, 2, 3];\na.foo = 42;\n\n// Array.toString() only shows indexed values\ninspect = function() {\n  return a + \" \" + a.foo;\n};\n"
  },
  {
    "path": "test/serializer/basic/AssumeDataProperty.js",
    "content": "if (global.__assumeDataProperty) __assumeDataProperty(global, \"o\", undefined);\nif (global.__assumeDataProperty) __assumeDataProperty(global, \"inspect\", undefined);\nif (global.__makePartial) __makePartial(global);\nvar o = 42;\ninspect = function() {\n  return o;\n};\n"
  },
  {
    "path": "test/serializer/basic/AssumeDataProperty2.js",
    "content": "if (global.__assumeDataProperty) __assumeDataProperty(global, \"special-identifier\", undefined);\nif (global.__assumeDataProperty) __assumeDataProperty(global, \"inspect\", undefined);\nif (global.__makePartial) __makePartial(global);\nglobal[\"special-identifier\"] = 42;\ninspect = function() {\n  return global[\"special-identifier\"];\n};\n"
  },
  {
    "path": "test/serializer/basic/AssumeDataProperty3.js",
    "content": "// add at runtime:global.obj={}; global.func = function() { return 5; };\nif (global.__assumeDataProperty) __assumeDataProperty(global, \"obj\", __abstractOrNull(\"object\"));\nif (global.__assumeDataProperty) __assumeDataProperty(global, \"func\", __abstract(\"function\"));\nif (global.__assumeDataProperty) __assumeDataProperty(global, \"inspect\", undefined);\nif (global.__makePartial) __makePartial(global);\n\nlet foo = {};\nif (global.obj) foo = global.obj;\ninspect = function() {\n  return \" \" + (global.obj === foo) + \" \" + global.func();\n};\n"
  },
  {
    "path": "test/serializer/basic/AssumeDataProperty4.js",
    "content": "// add at runtime:global.obj={};\nif (global.__assumeDataProperty) __assumeDataProperty(global, \"obj\", __abstractOrNull(\"object\"));\nif (global.__assumeDataProperty) __assumeDataProperty(global, \"inspect\", undefined);\nif (global.__makePartial) __makePartial(global);\n\nlet res = \"hi\";\nif (global.obj) res = global.obj;\ninspect = function() {\n  return res + \"\";\n};\n"
  },
  {
    "path": "test/serializer/basic/AvoidIdLeaks.js",
    "content": "// Making sure we don't leak ids in global scope\n\ninspect = function() {\n  return global._0 !== undefined;\n};\n"
  },
  {
    "path": "test/serializer/basic/AvoidUnnecessaryWrappedFunctions.js",
    "content": "// does not contain: function\ninspect = String.prototype.substring.bind(\" testing\", 1);\n"
  },
  {
    "path": "test/serializer/basic/Bind.js",
    "content": "// does not contain: bind\n(function() {\n  function f() {\n    return function() {\n      /* This comment makes this function too big to be inlined */ return 42;\n    };\n  }\n\n  var f1 = f();\n  var f2 = f();\n  inspect = function() {\n    return f1() + f2();\n  };\n})();\n"
  },
  {
    "path": "test/serializer/basic/BoundFunction.js",
    "content": "var o = { x: 42 };\no.f = function() {\n  return this.x;\n}.bind(o);\n\ninspect = function() {\n  return o.f();\n};\n"
  },
  {
    "path": "test/serializer/basic/BoundFunctionCreationOrder.js",
    "content": "(function() {\n  function wrap(obj) {\n    function A() {\n      return obj.hello();\n    }\n    function B() {\n      return obj.world();\n    }\n    A.B = B;\n    return A;\n  }\n\n  let fooObj = {};\n  let fooFn = wrap(fooObj);\n  let barFn = wrap(fooObj);\n  fooObj.bar = barFn;\n\n  global.foo = fooFn;\n\n  global.inspect = function() {\n    return true;\n  };\n})();\n"
  },
  {
    "path": "test/serializer/basic/BoundFunctionProperties.js",
    "content": "global.func = function(a, b, c) {};\nglobal.bound = global.func.bind(null);\nglobal.bound.foo = 123;\ninspect = function() {\n  return global.func.length + \"-\" + global.bound.length + \"-\" + global.bound.foo;\n};\n"
  },
  {
    "path": "test/serializer/basic/BoundFunctionProperties2.js",
    "content": "global.func = function(a, b, c) {};\nObject.defineProperty(global.func, \"length\", { configurable: true, enumerable: false, writable: true, value: 42 });\nglobal.bound = global.func.bind(null);\nglobal.bound.foo = 123;\nObject.defineProperty(global.bound, \"length\", { configurable: true, enumerable: false, writable: true, value: 84 });\ninspect = function() {\n  return global.func.length + \"-\" + global.bound.length + \"-\" + global.bound.foo;\n};\n"
  },
  {
    "path": "test/serializer/basic/CapturedScope.js",
    "content": "// serialized function clone count: 0\n// does not contain:__scope_2_unique27277, __scope_2_unique27277\nfunction f(x) {\n  var valueA = 0;\n  var valueB = 1;\n  var valueC = 2;\n\n  function a() {\n    // no inline\n    valueA++;\n    return b();\n  }\n\n  function b() {\n    // no inline\n    valueA++;\n    valueB++;\n    return c();\n  }\n\n  function c() {\n    x ? valueC++ : (valueC += 2);\n    return valueA * valueB * valueC;\n  }\n\n  return a;\n}\n\nvar s = f(true);\nvar r = f(false);\n\ninspect = function() {\n  return s() + \" \" + r();\n};\n"
  },
  {
    "path": "test/serializer/basic/CapturedScope10.js",
    "content": "// serialized function clone count: 0\nvar f = function(x) {\n  var i = x > 5 ? 0 : 1;\n  var j = x % 2 === 0 ? 3 : 5;\n  return function() {\n    i += 1;\n    j -= 3;\n    return i + j;\n  };\n};\n\nvar g = [f(2), f(6), f(3), f(9)];\n\ninspect = function() {\n  return g[0]() + \" \" + g[1]() + \" \" + g[2]() + \" \" + g[3]();\n};\n"
  },
  {
    "path": "test/serializer/basic/CapturedScope11.js",
    "content": "var addit_funs = [];\n\nvar f = function(x) {\n  var i = x > 5 ? 0 : 1;\n  var fun = function() {\n    i += 1;\n    return i;\n  };\n  addit_funs.push(fun);\n  return fun;\n};\n\nvar g = [f(2), f(6), f(4), f(9)];\ng.forEach(x => x());\n\ninspect = function() {\n  let res1 = g[0]() + \" \" + g[1]() + \" \" + g[2]() + \" \" + g[3]();\n  addit_funs.forEach(x => x());\n  let res2 = g[0]() + \" \" + g[1]() + \" \" + g[2]() + \" \" + g[3]();\n  return res1 + \" \" + res2;\n};\n"
  },
  {
    "path": "test/serializer/basic/CapturedScope2.js",
    "content": "// serialized function clone count: 0\nvar f = function(x) {\n  var i = x > 5 ? 0 : 1;\n  return function() {\n    i += 1;\n    return i;\n  };\n};\n\nvar g = [f(2), f(6), f(4), f(9)];\n\ninspect = function() {\n  return g[0]() + \" \" + g[1]() + \" \" + g[2]() + \" \" + g[3]();\n};\n"
  },
  {
    "path": "test/serializer/basic/CapturedScope3.js",
    "content": "// serialized function clone count: 0\nfunction p(object, name, desc) {\n  var value;\n  var valueSet = false;\n\n  function get() {\n    if (!valueSet) {\n      valueSet = true;\n      set(desc.get());\n    }\n    return value;\n  }\n\n  function set(newValue) {\n    value = newValue;\n    valueSet = true;\n\n    Object.defineProperty(object, name, {\n      value: newValue,\n      configurable: true,\n      enumerable: true,\n      writable: true,\n    });\n  }\n\n  Object.defineProperty(object, name, {\n    get: get,\n    set: set,\n    configurable: true,\n    enumerable: true,\n  });\n}\n\nvar x = {};\nvar y = {};\n\np(x, \"foo\", {\n  get: function get() {\n    return 5;\n  },\n});\np(x, \"foo\", {\n  get: function get() {\n    return 7;\n  },\n});\np(y, \"bar\", {\n  get: function get() {\n    return 8;\n  },\n});\n\ninspect = function() {\n  return x.foo + \" \" + y.bar;\n};\n"
  },
  {
    "path": "test/serializer/basic/CapturedScope4.js",
    "content": "// serialized function clone count: 0\nfunction f(x) {\n  var valueA = 0;\n  var valueB = 1;\n  var valueC = 0;\n\n  function a() {\n    // Prevent Inline foo bar\n    valueA++;\n    valueC++;\n    return b();\n  }\n\n  function b() {\n    // Prevent Inline foo bar\n    valueB++;\n    valueA++;\n    valueC++;\n    return valueB * valueA * valueC;\n  }\n\n  return [a, b];\n}\n\nvar s = f();\nvar r = f();\n\ninspect = function() {\n  return s[0]() + \" \" + r[1]();\n};\n"
  },
  {
    "path": "test/serializer/basic/CapturedScope5.js",
    "content": "// serialized function clone count: 0\nfunction f(x) {\n  var valueA = 1;\n  var valueB = 2;\n  var valueC = 3;\n\n  function a() {\n    // Prevent Inline foo bar\n    valueA++;\n    valueC++;\n    return c();\n  }\n\n  function b() {\n    // Prevent Inline foo bar\n    valueB++;\n    return c();\n  }\n\n  function c() {\n    valueC++;\n    return valueB * valueA * valueC;\n  }\n\n  function d() {\n    var valueF = 10;\n\n    function g() {\n      valueA = valueB * valueF;\n      return c();\n    }\n\n    return [g];\n  }\n\n  return [a, b, c, d];\n}\n\nvar s = f();\nvar r = f();\n\ninspect = function() {\n  return s[0]() + \" \" + r[1]() + \" \" + r[2]() + \" \" + r[3]()[0]();\n};\n"
  },
  {
    "path": "test/serializer/basic/CapturedScope6.js",
    "content": "// Tests multiple captured scopes in generated function\n// serialized function clone count: 0\nfunction f(x) {\n  var valueA = 1;\n\n  function a() {\n    // Prevent Inline foo bar\n    return valueA++;\n  }\n\n  function c() {\n    var valueC = 10;\n\n    return function() {\n      valueC++;\n      return valueA * valueC;\n    };\n  }\n\n  return [a, c()];\n}\n\nvar s = f();\nvar r = f();\n\ninspect = function() {\n  return s[0]() + \" \" + s[1]() + \" \" + s[1]() + \" \" + r[1]();\n};\n"
  },
  {
    "path": "test/serializer/basic/CapturedScope7.js",
    "content": "(function() {\n  function f() {\n    let a = 1;\n    let b = 2;\n    return [\n      function() {\n        return a++; /* This comment makes this function too big to be inlined. */\n      },\n      function() {\n        return b++; /* This comment makes this function too big to be inlined. */\n      },\n    ];\n  }\n  var F = f();\n  inspect = function() {\n    F[0]();\n    return F[1]();\n  };\n})();\n"
  },
  {
    "path": "test/serializer/basic/CapturedScope8.js",
    "content": "(function() {\n  let f = function(x) {\n    return function() {\n      for (let i = 0; i < 100; i++) x++;\n      return x;\n    };\n  };\n  global.g = [f(2), f(6)];\n  inspect = function() {\n    global.g[0]();\n    return global.g[1]();\n  };\n})();\n"
  },
  {
    "path": "test/serializer/basic/CapturedScope9.js",
    "content": "// Verify only one copy of initialized scope values are generated.\n// Copies of 13:1\n(function() {\n  let x = 13,\n    y = 35;\n  let f = function() {\n    x += 3;\n    y -= 39;\n    return x + y;\n  };\n  let g = function() {\n    x -= 2;\n    y += 19;\n    return x + y;\n  };\n  inspect = function() {\n    return f() + g() + f();\n  };\n})();\n"
  },
  {
    "path": "test/serializer/basic/CapturedScopeArrayAccess1.js",
    "content": "// does not contain: superLongName\n(function() {\n  let superLongName1 = 1;\n  let superLongName2 = 2;\n  let superLongName3 = 3;\n  function g(i) {\n    let g1 = function() {\n      return superLongName1++ + superLongName2++;\n    };\n    let g2 = function() {\n      return superLongName2++ + superLongName3++;\n    };\n    return i === 1 ? g1 : g2;\n  }\n  let f1 = g(1);\n  let f2 = g(2);\n  inspect = function() {\n    return f1() + f2();\n  };\n})();\n"
  },
  {
    "path": "test/serializer/basic/CapturedScopeArrayAccess2.js",
    "content": "// does not contain: superLongName\n(function() {\n  function g(i) {\n    let superLongName1 = 1;\n    let superLongName2 = 2;\n    let superLongName3 = 3;\n    let g1 = function() {\n      return superLongName1++ + superLongName2++;\n    };\n    let g2 = function() {\n      return superLongName2++ + superLongName3++;\n    };\n    return i === 1 ? g1 : g2;\n  }\n  let f1 = g(1);\n  let f2 = g(2);\n  inspect = function() {\n    return f1() + f2();\n  };\n})();\n"
  },
  {
    "path": "test/serializer/basic/CapturedScopeParameterOrdering.js",
    "content": "(function() {\n  function f() {\n    let x = 0;\n    function g() {\n      return function(p) {\n        return [p, x++]; /* This comment makes this function too big for inlining */\n      };\n    }\n    return [g(), g(), g()];\n  }\n  let a = f();\n  inspect = function() {\n    return a[0](42)[0];\n  };\n})();\n"
  },
  {
    "path": "test/serializer/basic/CapturedScopesAndIndexedVars.js",
    "content": "(function() {\n  let f = function() {\n    var o = {};\n    return function(replace) {\n      if (replace) o = {};\n      return o;\n    };\n  };\n\n  let g1 = f();\n  let g2 = f();\n  let g3 = f();\n  let g4 = f();\n\n  inspect = function() {\n    return (((\"\" + g1(false) === g1(false) + g2(false)) !== g2(true) + g3(true)) !== g1(true) + g4(true)) !== g1(true);\n  };\n})();\n"
  },
  {
    "path": "test/serializer/basic/CircularFuncs.js",
    "content": "// serialized function clone count: 0\nfunction f(x) {\n  var valueA = 0;\n  var valueB = 1;\n  var valueC = 2;\n\n  function a() {\n    // no inline\n    valueA++;\n    return b();\n  }\n\n  function b() {\n    // no inline\n    valueA++;\n    valueB++;\n    return c();\n  }\n\n  function c() {\n    if (valueA % 3) a();\n    x ? valueC++ : (valueC += 2);\n    return valueA * valueB * valueC;\n  }\n\n  return a;\n}\n\nvar s = f(true);\nvar r = f(false);\n\ninspect = function() {\n  return s() + \" \" + r();\n};\n"
  },
  {
    "path": "test/serializer/basic/CircularFunctions.js",
    "content": "// serialized function clone count: 0\nfunction f(x) {\n  var valueA = 0;\n  var valueB = 1;\n  var valueC = 2;\n\n  function a() {\n    // no inline\n    valueA++;\n    return b();\n  }\n\n  function b() {\n    // no inline\n    valueA++;\n    valueB++;\n    return c();\n  }\n\n  function c() {\n    if (valueA % 3) a();\n    x ? valueC++ : (valueC += 2);\n    return valueA * valueB * valueC;\n  }\n\n  return a;\n}\n\nvar s = f(true);\nvar r = f(false);\n\ninspect = function() {\n  return s() + \" \" + r();\n};\n"
  },
  {
    "path": "test/serializer/basic/ClassExpression.js",
    "content": "const Foo = class {\n  constructor() {\n    this.x = 10;\n  }\n  method(y) {\n    return this.x + y;\n  }\n};\n\ninspect = function() {\n  var foo = new Foo();\n  return [foo, foo.method(10)];\n};\n"
  },
  {
    "path": "test/serializer/basic/ClassExpression2.js",
    "content": "/* eslint-disable */\nclass Foo {\n  constructor() {\n    this.x = 10;\n  }\n  method(y) {\n    return this.x + y;\n  }\n}\n/* eslint-enable */\n\nconst Bar = class extends Foo {\n  constructor() {\n    super();\n    this.y = 10;\n  }\n  method(z) {\n    return this.x + this.y + z;\n  }\n};\n\ninspect = function() {\n  var foo = new Bar();\n  return [foo, foo.method(10)];\n};\n"
  },
  {
    "path": "test/serializer/basic/ClassExpression3.js",
    "content": "global.method1 = Symbol();\n\nclass Foo {\n  constructor() {\n    this.x = 10;\n  }\n  [\"method\"](y) {\n    return this.x + y;\n  }\n}\n\nglobal.Bar = class extends Foo {\n  [global.method1](z) {\n    return this.x + this.y + z;\n  }\n  get y() {\n    return 10;\n  }\n  set y(x) {\n    // NO-OP\n  }\n};\n\ninspect = function() {\n  var foo = new global.Bar();\n  return [foo, foo[global.method1](10)];\n};\n"
  },
  {
    "path": "test/serializer/basic/ClassExpression4.js",
    "content": "global.method1 = Symbol();\nglobal.y = Symbol();\n\nclass Foo {\n  constructor(x) {\n    this.x = x;\n  }\n  [\"method\"](y) {\n    return this.x + y;\n  }\n}\n\nglobal.Bar = class extends Foo {\n  constructor() {\n    super(10);\n  }\n  [global.method1](z) {\n    return this.x + this[global.y] + z;\n  }\n  get [global.y]() {\n    return 10;\n  }\n  set [global.y](x) {\n    // NO-OP\n  }\n};\n\ninspect = function() {\n  var foo = new global.Bar();\n  return [foo, foo[global.method1](10)];\n};\n"
  },
  {
    "path": "test/serializer/basic/ClassExpression5.js",
    "content": "global.x = 0;\n\nclass Bar {\n  constructor(y) {\n    global.x = y + 10;\n  }\n}\n\nclass Foo extends Bar {\n  constructor(y) {\n    super(y);\n  }\n}\n\nnew Foo(1);\n\ninspect = function() {\n  return global.x;\n};\n"
  },
  {
    "path": "test/serializer/basic/ClassExpression6.js",
    "content": "global.x = 0;\n\nvar A = class {\n  constructor(y) {\n    global.x = y + 10;\n  }\n  render() {}\n};\n\nvar b = new A();\n\nvar C = class extends b.constructor {\n  constructor(y) {\n    super(y);\n  }\n};\n\nnew C(1);\n\ninspect = function() {\n  return global.x;\n};\n"
  },
  {
    "path": "test/serializer/basic/ClassExpression7.js",
    "content": "global.C = class {};\nglobal.C.prototype.foo = 42;\n\ninspect = function() {\n  return JSON.stringify(global.C);\n};\n"
  },
  {
    "path": "test/serializer/basic/Closure.js",
    "content": "var f = function() {\n  var i = 0;\n  return function() {\n    i += 1;\n    return i;\n  };\n};\n\nvar g = f();\n\ninspect = function() {\n  return g() + \" \" + g();\n};\n"
  },
  {
    "path": "test/serializer/basic/Closure2.js",
    "content": "var f = function() {\n  for (var i = 0; ; ) {\n    var j = 0;\n    return function() {\n      j += 1;\n      return j;\n    };\n  }\n};\n\nvar g = f();\n\ninspect = function() {\n  return g() + \" \" + g();\n};\n"
  },
  {
    "path": "test/serializer/basic/Closure3.js",
    "content": "var f = function() {\n  var i = 42;\n  return function() {\n    return i;\n  };\n};\n\nvar g = f();\n\ninspect = function() {\n  return g() + \" \" + g();\n};\n"
  },
  {
    "path": "test/serializer/basic/Closure4.js",
    "content": "var g, h;\nvar f = function() {\n  var i = 42;\n  g = function() {\n    return i;\n  };\n  h = function() {\n    i += 1;\n    return i;\n  };\n};\n\nf();\n\ninspect = function() {\n  return g() + \" \" + h() + \" \" + g();\n};\n"
  },
  {
    "path": "test/serializer/basic/ClosureRefReplacement.js",
    "content": "/* @flow */\n// Test is to make sure that something is not renamed twice (e.g. require > _7 > _2)\n// which used to happen one of the variable names generated by prepack already\n// existed in the orinal file.\n\nfunction require() {\n  return {};\n}\n\nvar _7 = {\n  foo: \" hello \",\n};\n\nvar _a = {\n  factory: {},\n};\nvar _8 = {\n  foo: {},\n  \"1\": _a,\n};\n\nvar modules = _8;\n\nfunction f() {\n  var x = _7.foo === \" hello \" && modules.foo === undefined && require().bar === \" goodbye\";\n  return x;\n}\n\nfunction _d() {\n  return f();\n}\n\ninspect = _d;\n"
  },
  {
    "path": "test/serializer/basic/ClosureRefVisitor.js",
    "content": "// jsc\n(function() {\n  let o = {\n    encode: function encode(s) {\n      return unescape(encodeURI(s));\n    },\n  };\n  inspect = function() {\n    return o;\n  };\n  if (global.__makePartial) {\n    __makePartial(global);\n  }\n})();\n"
  },
  {
    "path": "test/serializer/basic/ClosureRefVisitor2.js",
    "content": "// omit invariants\n(function() {\n  var f = function() {\n    return function() {\n      return function() {\n        return this.x;\n      }.bind({ x: 42 });\n    };\n  };\n  var g1 = f();\n  var g2 = f();\n  var g3 = f();\n  inspect = function() {\n    return g1() + g2() + g3();\n  };\n})();\n"
  },
  {
    "path": "test/serializer/basic/ClosureRefVisitor3.js",
    "content": "// Copies of arguments:1\n(function() {\n  var f = function() {\n    return function() {\n      /* This function is way too big to be inlined. */\n      return function(x) {\n        return arguments[0];\n      };\n    };\n  };\n  var g1 = f();\n  var g2 = f();\n  var g3 = f();\n  inspect = function() {\n    return g1()(1) + g2()(2) + g3()(3);\n  };\n})();\n"
  },
  {
    "path": "test/serializer/basic/ClosureRefVisitor4.js",
    "content": "// Copies of arguments:1\n(function() {\n  var f = function(x) {\n    var y = arguments[0];\n    return function() {\n      /* This function is way too big to be inlined. */\n      return function(z) {\n        return y + arguments[0];\n      };\n    };\n  };\n  var g1 = f(1);\n  var g2 = f(2);\n  var g3 = f(3);\n  inspect = function() {\n    return g1()(4) + g2()(5) + g3()(6);\n  };\n})();\n"
  },
  {
    "path": "test/serializer/basic/ConditionalReturn.js",
    "content": "let b = global.__abstract ? __abstract(\"boolean\", \"true\") : true;\n\nlet n1;\nif (b) n1 = 5;\nlet n2 = global.__abstract ? __abstract(\"number\", \"7\") : 7;\n\nfunction f() {\n  if (!b) return;\n  return n2 - n1;\n}\n\ninspect = function() {\n  return f();\n};\n"
  },
  {
    "path": "test/serializer/basic/ConditionalReturn2.js",
    "content": "let b = global.__abstract ? global.__abstract(\"boolean\", \"(true)\") : true;\nlet b1 = global.__abstract ? global.__abstract(\"boolean\", \"((true))\") : true;\nlet n1;\nif (!b1) n1 = 5;\nlet n2 = global.__abstract ? __abstract(\"number\", \"7\") : 7;\n\nfunction f() {\n  if (b) {\n    if (b1) {\n      return;\n    }\n  } else return;\n\n  return n2 - n1;\n}\n\n// should be undefined\ninspect = function() {\n  return f();\n};\n"
  },
  {
    "path": "test/serializer/basic/ConditionalReturn3.js",
    "content": "let a = global.__abstract ? __abstract(\"boolean\", \"(true)\") : true;\nlet b = global.__abstract ? __abstract(\"boolean\", \"((true))\") : true;\n\nlet na;\nif (!a) na = 10;\n\nlet nb;\nif (!b) nb = 20;\n\nlet n2 = global.__abstract ? __abstract(\"number\", \"7\") : 7;\n\nfunction f() {\n  if (b) return;\n  return nb - n2;\n}\n\nfunction g() {\n  if (a) return;\n  f();\n  return na - n2;\n}\n\ng();\ninspect = function() {\n  return true;\n};\n"
  },
  {
    "path": "test/serializer/basic/CyclicArray.js",
    "content": "var a = [0, 1, 2, 3, 4];\na[2] = a;\n\ninspect = function() {\n  return a[2][2][2][2][2][4];\n};\n"
  },
  {
    "path": "test/serializer/basic/CyclicDependencies.js",
    "content": "var a = { v: 42 };\nvar b = { a: a };\na.b = b;\n\ninspect = function() {\n  return a.b.a.b.a.b.a.b.a.b.a.b.a.b.a.v;\n};\n"
  },
  {
    "path": "test/serializer/basic/Date.js",
    "content": "(function() {\n  var x = new Date(42);\n  inspect = function() {\n    return x.getTime();\n  };\n})();\n"
  },
  {
    "path": "test/serializer/basic/DefineProperty.js",
    "content": "// Copies of enumerable:1\n(function() {\n  var obj = {};\n  Object.defineProperty(global, \"a\", { enumerable: false, configurable: false, writable: true, value: 42 });\n  Object.defineProperty(global, \"b\", { enumerable: false, configurable: false, writable: true, value: 23 });\n  inspect = function() {\n    return global.a + global.b;\n  };\n})();\n"
  },
  {
    "path": "test/serializer/basic/DefinePropertySameNameDiffDesc.js",
    "content": "// Copies of enumerable:2\n\n(function() {\n  global.obj = 13;\n  Object.defineProperty(global, \"obj\", { enumerable: false, configurable: true, writable: true, value: 42 });\n  Object.defineProperty(global, \"obj\", { enumerable: true, configurable: true, writable: true, value: 23 });\n  inspect = function() {\n    return JSON.stringify(Object.getOwnPropertyDescriptor(global, \"obj\"));\n  };\n})();\n"
  },
  {
    "path": "test/serializer/basic/DelayInitWithDifferentValues.js",
    "content": "(function() {\n  function f(y) {\n    let x = 0;\n    return function() {\n      return [x++, y.value];\n    };\n  }\n  let f1 = f({ value: 1 });\n  let f2 = f({ value: 2 });\n  let f3 = f({ value: 3 });\n  inspect = function() {\n    f1()[1] + f2()[1] + f3()[1];\n  };\n})();\n"
  },
  {
    "path": "test/serializer/basic/DelayInitializations.js",
    "content": "(function() {\n  function f() {\n    let a = global.__abstract ? __abstract(undefined, \"(42)\") : 42;\n    function nested() {\n      return a;\n    }\n    return nested;\n  }\n  function g() {\n    let a = global.__abstract ? __abstract(undefined, \"(23)\") : 23;\n    function nested() {\n      return a;\n    }\n    return nested;\n  }\n  let ff = f();\n  let gg = g();\n  inspect = function() {\n    return ff() + gg();\n  };\n})();\n"
  },
  {
    "path": "test/serializer/basic/DelayInitializations2.js",
    "content": "(function() {\n  let a = global.__abstract ? __abstract(undefined, \"(42)\") : 42;\n  function f() {\n    return a++;\n  }\n  global.inspect = function() {\n    f() + f();\n  };\n})();\n"
  },
  {
    "path": "test/serializer/basic/DelayedValuePropertyOrdering.js",
    "content": "(function() {\n  let o = { a: undefined, b: {} };\n  o.a = o;\n\n  global.inspect = function() {\n    for (let name in o) {\n      return name;\n    }\n  };\n})();\n"
  },
  {
    "path": "test/serializer/basic/DelayedValuePropertyOrdering2.js",
    "content": "(function() {\n  let x = global.__abstract ? __abstract(\"boolean\", \"false\") : false;\n  let o = { a: undefined, b: {} };\n  o.a = o; // delay\n  if (x) delete o.a; // might have been deleted\n\n  global.inspect = function() {\n    for (let name in o) {\n      return name;\n    }\n  };\n})();\n"
  },
  {
    "path": "test/serializer/basic/DontInlineFunctionsWithCapturedScopes.js",
    "content": "// Copies of \\+\\+:1\n(function() {\n  var f = function() {\n    var mutable = 10;\n    return function() {\n      ++mutable;\n    };\n  };\n\n  global.g1 = f();\n  global.g2 = f();\n  global.g3 = f();\n  global.g4 = f();\n\n  inspect = function() {\n    return global.g1() + global.g2() + global.g3() + global.g4();\n  };\n})();\n"
  },
  {
    "path": "test/serializer/basic/DuplicateFactoryFunctions.js",
    "content": "(function() {\n  function f() {\n    return function() {\n      // This is too big to be inlined, really. Way too big.\n      // This is too big to be inlined, really. Way too big.\n      return 1 + 3;\n    };\n  }\n  function g() {\n    return function() {\n      return f();\n    };\n  }\n  let gs = [g(), g(), g(), g()];\n  for (let g of gs) if (global.__optimize) __optimize(g);\n  global.gs = gs;\n  global.f = f;\n  global.inspect = function() {\n    return global.f()();\n  };\n})();\n"
  },
  {
    "path": "test/serializer/basic/EfficientPrototypeSetting.js",
    "content": "// does not contain:__proto__ =\n(function() {\n  var x = { x: 1 };\n  var proto = { p: 2 };\n  x.__proto__ = proto;\n  inspect = function() {\n    let p = Object.getPrototypeOf(x);\n    return p === proto;\n  };\n})();\n"
  },
  {
    "path": "test/serializer/basic/EmitFunctionExpression.js",
    "content": "// does contain: function (\n// does not contain: function _\nfunction f() {\n  return 42;\n}\ninspect = function() {\n  return f();\n};\n"
  },
  {
    "path": "test/serializer/basic/EmptyBlocks.js",
    "content": "// does not contain:    {}\n(function() {\n  function fib(x) {\n    let y = Date.now();\n    return x <= 1 ? x : fib(x - 1) + fib(x - 2);\n  }\n\n  let x = Date.now();\n  if (x * 2 > 42) x = fib(10);\n  global.result = x;\n  inspect = function() {\n    return global.result;\n  };\n})();\n"
  },
  {
    "path": "test/serializer/basic/ErrorPrototypeToString.js",
    "content": "function a() {\n  let e = new Error(\"\");\n  e.name = \"\";\n  return e.toString();\n}\n\nfunction b() {\n  let e = new Error(\"\");\n  e.name = \"b\";\n  return e.toString();\n}\n\nfunction c() {\n  let e = new Error(\"c\");\n  e.name = \"\";\n  return e.toString();\n}\n\nfunction d() {\n  let e = new Error(\"c\");\n  e.name = \"c\";\n  return e.toString();\n}\n\nvar x = a() + \";\" + b() + \";\" + c() + \";\" + d();\ninspect = function() {\n  return x;\n};\n"
  },
  {
    "path": "test/serializer/basic/ExceedStackDepth.js",
    "content": "// exceeds stack limit\n// throws introspection error\nlet immediate = function(future) {\n  if (Date.now() > future) {\n    return \"exit value\";\n  }\n\n  return immediate(future);\n};\n\nlet n = immediate(Date.now() - 1);\n\ninspect = function() {\n  return n;\n};\n"
  },
  {
    "path": "test/serializer/basic/Factories1.js",
    "content": "// skip lazy objects\n// Copies of property: 2\n// omit invariants\n(function() {\n  var a = { property: 1 };\n  var b = { property: 2 };\n  var c = { property: 3 };\n  var d = { property: 4 };\n  var e = { property: 5 };\n  var heap = [a, a, b, b, c, c, d, d, e, e];\n  inspect = function() {\n    return heap[0][\"property\"];\n  };\n})();\n"
  },
  {
    "path": "test/serializer/basic/Factories2.js",
    "content": "// skip lazy objects\n// Copies of default: 2\n(function() {\n  var a = { default: 1, foo: 11 };\n  var b = { default: 2, foo: 12 };\n  var c = { default: 3, foo: 13 };\n  var d = { default: 4, foo: 14 };\n  var e = { default: 5, foo: 15 };\n  var heap = [a, a, b, b, c, c, d, d, e, e];\n  inspect = function() {\n    return heap[0][\"default\"];\n  };\n})();\n"
  },
  {
    "path": "test/serializer/basic/FactorifyMixNodeTypes.js",
    "content": "const a = { x: 1, y: 2, z: 3 };\nconst b = { x: 1, y: 4, z: 5 };\nconst c = { x: 1, y: 6, z: 7 };\nconst d = { x: 1, y: 8, z: 9 };\nconst e = { x: 1, y: 2, z: 10 };\n\n// Hold two references to each object so they are not inlined.\nconst ref1 = { a, b, c, d };\nconst ref2 = { a, b, c, d };\n\nglobal.inspect = () => JSON.stringify({ ref1, ref2, e });\n"
  },
  {
    "path": "test/serializer/basic/FactorifyVoid0.js",
    "content": "// skip lazy objects\n// Copies of void 0:1\n// omit invariants\n(function() {\n  a = { x: 1, y: undefined };\n  b = { x: 1, y: undefined };\n  c = { x: 1, y: undefined };\n  d = { x: 1, y: undefined };\n  e = { x: 1, y: undefined };\n  // let's make sure we have at least two references to each value, so that they don't get inlined.\n  dummy1 = [a, b, c, d, e];\n  dummy2 = [a, b, c, d, e];\n  inspect = function() {\n    global.a.x + global.b.x + global.c.x + global.d.x + global.e.x;\n  };\n})();\n"
  },
  {
    "path": "test/serializer/basic/ForInStatement1.js",
    "content": "(function() {\n  let ob = { a: 1, b: 2 };\n  let tgt = {};\n  for (let p in ob) {\n    tgt[p] = p + p;\n    break;\n  }\n  let tgt2 = {};\n  let p2;\n  xyz: for (p2 in tgt) {\n    tgt2[p2] = p2 + p2;\n    break xyz;\n  }\n  for (var p3 in null) {\n    throw \"should not get here\";\n  }\n  for (var p4 in undefined) {\n    throw \"should not get here\";\n  }\n  inspect = function() {\n    return tgt.a + tgt2.a;\n  };\n})();\n"
  },
  {
    "path": "test/serializer/basic/ForOfStatement1.js",
    "content": "(function() {\n  function foo() {\n    return eval(`\n      let ob = [1, 2];\n      xyz: for (const p of ob) {\n        let p2;\n        for (p2 of ob) {\n          if (p === 1) continue xyz;\n          p2;\n          break xyz;\n        }\n      }`);\n  }\n  for (var p0 of [1]) {\n    /*empty*/\n  }\n  let bar = foo();\n  let tgt = {};\n  for (let [p2 = \"pp\"] of [[undefined]]) {\n    tgt[p2] = \"tpp\";\n  }\n  let p3;\n  for ({ p3 = \"ppp\" } of [{}]) {\n    tgt[p3] = \"tppp\";\n  }\n  for (var p4 of [1, 2]) {\n    tgt[\"p4\"] = p4;\n  }\n  for (var { p5 = \"pppp\" } of [{}]) {\n    tgt[p5] = \"tpppp\";\n    break;\n  }\n  try {\n    for (var { p6 = null.nonsense } of [{}]) {\n      tgt[p6] = \"tppppp\";\n    }\n  } catch (e) {\n    tgt[\"e\"] = e.constructor.name;\n  }\n  try {\n    for (null.p7 of [{}]) {\n      tgt[p7] = \"tpppp\";\n    }\n  } catch (e) {\n    tgt[\"ee\"] = e.constructor.name;\n  }\n  (function() {\n    for (var p8 in [1]) {\n      return;\n    }\n  })();\n  inspect = function() {\n    return bar + tgt.pp + tgt.ppp + tgt.p4 + tgt.p5 + tgt.e + tgt.ee;\n  };\n})();\n"
  },
  {
    "path": "test/serializer/basic/FrozenLazyObject.js",
    "content": "(function() {\n  let o = { foo: 42 };\n  Object.freeze(o);\n  global.o = o;\n  inspect = function() {\n    return o.foo;\n  };\n})();\n"
  },
  {
    "path": "test/serializer/basic/Function.js",
    "content": "var i = 0;\nvar f = function() {\n  i += 1;\n  return i.toString();\n};\n\ninspect = function() {\n  return f() + \" \" + f();\n};\n"
  },
  {
    "path": "test/serializer/basic/FunctionBodyClone1.js",
    "content": "(function() {\n  function foo() {\n    var mutable = 10;\n    return function() {\n      return ++mutable;\n    };\n  }\n\n  global.g = foo();\n  // Put parent residual function after nested function\n  // to make sure any AST change to nested function does not affect parent.\n  global.f = foo;\n  inspect = function() {\n    return global.f()();\n  };\n})();\n"
  },
  {
    "path": "test/serializer/basic/FunctionBodyClone2.js",
    "content": "(function() {\n  function foo() {\n    var mutable = 10;\n    return function() {\n      return ++mutable;\n    };\n  }\n\n  global.g1 = foo();\n  global.g2 = foo();\n  // Put parent residual function after nested function\n  // to make sure any AST change to nested function does not affect parent.\n  global.f = foo;\n  inspect = function() {\n    return global.f()();\n  };\n})();\n"
  },
  {
    "path": "test/serializer/basic/FunctionOrdering.js",
    "content": "(function() {\n  global.first = function() {\n    // Function ordering: 1\n    second();\n    return 10;\n  };\n  var second = function() {\n    // Function ordering: 2\n    return 20;\n  };\n  inspect = function() {\n    return global.first() + second();\n  };\n})();\n"
  },
  {
    "path": "test/serializer/basic/FunctionPrototype.js",
    "content": "(function() {\n  function f() {}\n  let p = f.prototype;\n  inspect = function() {\n    return p === f.prototype;\n  };\n})();\n"
  },
  {
    "path": "test/serializer/basic/FunctionPrototype2.js",
    "content": "(function() {\n  function f() {}\n  f.prototype.foo = 42;\n  inspect = function() {\n    return f.prototype.foo;\n  };\n})();\n"
  },
  {
    "path": "test/serializer/basic/FunctionPrototypeAssignmentIsSimple.js",
    "content": "// does not contain:defineProperty\n(function() {\n  function f() {}\n  f.prototype = 42;\n  inspect = function() {\n    return f.prototype;\n  };\n})();\n"
  },
  {
    "path": "test/serializer/basic/FunctionUndelayOrdering.js",
    "content": "(function() {\n  var f = function(obj) {\n    return function() {\n      /*This comment will make the function too big to inline*/\n      return obj;\n    };\n  };\n  var obj1 = {};\n  var obj2 = {};\n  var g1 = f(obj1);\n  obj1.foo = g1;\n  var g2 = f(obj2);\n  obj1.bar = g2;\n  inspect = function() {\n    return JSON.stringify(obj1.foo());\n  };\n})();\n"
  },
  {
    "path": "test/serializer/basic/GenerateInvariants.js",
    "content": "// does contain:Prepack model invariant violation\n(function() {\n  let foo = global.__abstract ? __abstract({ x: __abstract(\"number\") }, \"({x : 1})\") : { x: 1 };\n  global.foox = foo.x;\n  global.inspect = function() {};\n})();\n"
  },
  {
    "path": "test/serializer/basic/GlobalMustBePassedInWhenUsed.js",
    "content": "// does contain:.call(this)\n(function() {\n  var _$0 = this;\n\n  x = 42;\n\n  function _0() {\n    return _$0.x;\n  }\n\n  inspect = _0;\n}.call(this));\n"
  },
  {
    "path": "test/serializer/basic/GlobalProperty.js",
    "content": "global.foo = 42;\n\ninspect = function() {\n  return global.foo;\n};\n"
  },
  {
    "path": "test/serializer/basic/GlobalProperty2.js",
    "content": "global.foo = 42;\n\ninspect = function() {\n  global.foo += 1;\n  return global.foo;\n};\n"
  },
  {
    "path": "test/serializer/basic/GlobalProperty3.js",
    "content": "Object.defineProperty(global, \"foo\", { configurable: true, enumerable: false, value: 41 });\nObject.defineProperty(global, \"bar\", {\n  configurable: true,\n  enumerable: false,\n  get: function() {\n    return 43;\n  },\n});\n\ninspect = function() {\n  global.foo += 1;\n  return global.foo === global.bar;\n};\n"
  },
  {
    "path": "test/serializer/basic/GlobalPropertyGetter.js",
    "content": "// es6\n// We use the name \"console\" because it already exists.\n// Adding a non-existing property will break our test-runner in Node 7.x.x.\nObject.defineProperty(global, \"console\", {\n  configurable: true,\n  enumerable: true,\n  get: function() {\n    throw new Error(\"42\");\n  },\n});\n\ninspect = function() {\n  try {\n    return console;\n  } catch (e) {\n    return e.message;\n  }\n};\n"
  },
  {
    "path": "test/serializer/basic/GlobalPropertyNotValidIdentifier.js",
    "content": "global[\"foo-bar\"] = 42;\ninspect = function() {\n  return global[\"foo-bar\"];\n};\n"
  },
  {
    "path": "test/serializer/basic/GlobalPropertyStrict.js",
    "content": "\"use strict\";\nglobal.foo = 42;\n\nglobal.inspect = function() {\n  return global.foo;\n};\n"
  },
  {
    "path": "test/serializer/basic/GlobalPropertyStrict2.js",
    "content": "(function() {\n  \"use strict\";\n  function a(x) {\n    return x;\n  }\n  global.a = a;\n})();\ninspect = function() {\n  return global.a(22);\n};\n"
  },
  {
    "path": "test/serializer/basic/GlobalThing.js",
    "content": "// does contain: globalThing\nvar globalThing;\ninspect = function() {\n  return globalThing;\n};\n"
  },
  {
    "path": "test/serializer/basic/GlobalVar.js",
    "content": "// does contain:var x\nvar x = 1;\n"
  },
  {
    "path": "test/serializer/basic/HelloWorld.js",
    "content": "function hello() {\n  return \"hello\";\n}\nfunction world() {\n  return \"world\";\n}\nvar s = hello() + \" \" + world();\n\ninspect = function() {\n  return s;\n};\n"
  },
  {
    "path": "test/serializer/basic/HoistFunctionDeclarations.js",
    "content": "(function() {\n  function f() {\n    return obj.f;\n  }\n  let obj = { f: f.prototype };\n  obj.obj = obj;\n  inspect = function() {\n    return f() === obj.f;\n  };\n})();\n"
  },
  {
    "path": "test/serializer/basic/IncrementalMemoization.js",
    "content": "// Copies of String: 1\n// omit invariants\n(function() {\n  let indexOf = String.prototype.indexOf;\n  let substr = String.prototype.substr;\n  inspect = function() {\n    return indexOf.name + substr.name;\n  };\n})();\n"
  },
  {
    "path": "test/serializer/basic/Integral.js",
    "content": "let a = 1 << 1;\nlet b = 1 >> 1;\nlet c = 1 >>> 1;\nlet d = 1 + 1;\nlet e = 1 - 1;\nlet f = 1 & 1;\nlet g = 1 | 1;\nlet h = 1 ^ 1;\nlet i = +a;\nlet j = -a;\nlet k = ~a;\nlet l = a++;\nlet m = ++a;\nlet n = a--;\nlet o = --a;\nlet p = 1;\nlet z = a + b + c + d + e + f + g + h + i + j + k + l + m + n + o + p;\n\nlet na = 1.1;\nlet nb = 1.1 + 1;\nlet nc = 1.1 - 1;\nlet nd = +na;\nlet ne = -nb;\nlet nf = na++;\nlet ng = na--;\nlet nh = ++na;\nlet ni = na++;\n\nif (global.__isIntegral) {\n  if (!__isIntegral(a)) throw new Error(\"bug!\");\n  if (!__isIntegral(b)) throw new Error(\"bug!\");\n  if (!__isIntegral(c)) throw new Error(\"bug!\");\n  if (!__isIntegral(d)) throw new Error(\"bug!\");\n  if (!__isIntegral(e)) throw new Error(\"bug!\");\n  if (!__isIntegral(f)) throw new Error(\"bug!\");\n  if (!__isIntegral(g)) throw new Error(\"bug!\");\n  if (!__isIntegral(h)) throw new Error(\"bug!\");\n  if (!__isIntegral(i)) throw new Error(\"bug!\");\n  if (!__isIntegral(l)) throw new Error(\"bug!\");\n  if (!__isIntegral(m)) throw new Error(\"bug!\");\n  if (!__isIntegral(n)) throw new Error(\"bug!\");\n  if (!__isIntegral(o)) throw new Error(\"bug!\");\n  if (!__isIntegral(p)) throw new Error(\"bug!\");\n  if (!__isIntegral(z)) throw new Error(\"bug!\");\n\n  if (__isIntegral(na)) throw new Error(\"bug!\");\n  if (__isIntegral(nb)) throw new Error(\"bug!\");\n  if (__isIntegral(nc)) throw new Error(\"bug!\");\n  if (__isIntegral(nd)) throw new Error(\"bug!\");\n  if (__isIntegral(ne)) throw new Error(\"bug!\");\n  if (__isIntegral(nf)) throw new Error(\"bug!\");\n  if (__isIntegral(ng)) throw new Error(\"bug!\");\n  if (__isIntegral(nh)) throw new Error(\"bug!\");\n  if (__isIntegral(ni)) throw new Error(\"bug!\");\n}\n\ninspect = function() {\n  return z;\n};\n"
  },
  {
    "path": "test/serializer/basic/IntrinsicPutValue.js",
    "content": "Object[\"0\"] = 1;\ninspect = function() {\n  return Object[\"0\"];\n};\n"
  },
  {
    "path": "test/serializer/basic/IntrinsicSerialization.js",
    "content": "(function() {\n  let old = Array.prototype.forEach;\n  Array.prototype.forEach = function() {};\n  Array.prototype.forEach = old;\n  inspect = function() {\n    return Array.prototype.forEach.name;\n  };\n})();\n"
  },
  {
    "path": "test/serializer/basic/Issue2555RegressionTest.js",
    "content": "(function() {\n  function A() {\n    B;\n  }\n  function B() {}\n\n  let p = Object.create(A.prototype);\n  B.prototype = Object.create(p);\n\n  global.inspect = function() {\n    return p.prototype === A;\n  };\n})();\n"
  },
  {
    "path": "test/serializer/basic/Issue2555RegressionTest2.js",
    "content": "(function() {\n  function createClass(ctor, superClass) {\n    if (superClass) {\n      ctor.prototype = Object.create(superClass.prototype);\n    }\n    ctor.prototype.constructor = ctor;\n  }\n\n  function mixin(ctor, methods) {\n    var keyCopier = function(key) {\n      ctor.prototype[key] = methods[key];\n    };\n    Object.keys(methods).forEach(keyCopier);\n    Object.getOwnPropertySymbols && Object.getOwnPropertySymbols(methods).forEach(keyCopier);\n    return ctor;\n  }\n\n  function Iterable(value) {}\n  function Iterator(next) {}\n\n  createClass(Seq, Iterable);\n  function Seq(value) {}\n\n  createClass(IndexedSeq, Seq);\n  function IndexedSeq(value) {}\n\n  createClass(SetSeq, Seq);\n  function SetSeq(value) {\n    indexedSeqFromValue;\n  }\n\n  SetSeq.prototype.toSetSeq = function() {\n    return this;\n  };\n\n  Seq.isSeq = isSeq;\n  Seq.Set = SetSeq;\n  Seq.Indexed = IndexedSeq;\n\n  createClass(ArraySeq, IndexedSeq);\n  function ArraySeq(array) {}\n\n  createClass(IterableSeq, IndexedSeq);\n  function IterableSeq(iterable) {}\n\n  createClass(IteratorSeq, IndexedSeq);\n  function IteratorSeq(iterator) {}\n\n  createClass(ToIndexedSequence, IndexedSeq);\n  function ToIndexedSequence(iter) {}\n\n  Iterable.Iterator = Iterator;\n\n  mixin(Iterable, {\n    foo: function() {\n      ToIndexedSequence;\n    },\n  });\n\n  function isSeq(maybeSeq) {}\n\n  function indexedSeqFromValue(value) {\n    maybeIndexedSeqFromValue;\n  }\n\n  function seqFromValue(value) {\n    ObjectSeq;\n  }\n\n  function maybeIndexedSeqFromValue(value) {\n    ArraySeq;\n    IteratorSeq;\n    IterableSeq;\n  }\n\n  global.foo = Iterable;\n\n  global.inspect = function() {\n    return true;\n  }; // This test only exists to test against an ordering in the code generation which the linter would detect.\n})();\n"
  },
  {
    "path": "test/serializer/basic/IteratorPrototype.js",
    "content": "// es6\nlet IteratorPrototype = [][Symbol.iterator]().__proto__.__proto__;\n\ninspect = function() {\n  return IteratorPrototype;\n};\n"
  },
  {
    "path": "test/serializer/basic/JSCCollections.js",
    "content": "// jsc\n(function() {\n  let o = new Object();\n  let m = new Map();\n  m.set(o, o);\n  let s = new Set();\n  s.add(o);\n  inspect = function() {\n    return m.size + s.size;\n  };\n})();\n"
  },
  {
    "path": "test/serializer/basic/KeysAsNumbers.js",
    "content": "// does not contain:\"99\n(function() {\n  let a = { 991: -5, a: 1 };\n  Object.defineProperty(a, 992, { configurable: false, enumerable: false, writable: true, value: -10 });\n  Object.defineProperty(a, \"b\", { configurable: false, enumerable: false, writable: true, value: 3 });\n  let sum = function(a) {\n    let res = 0;\n    for (let i = 0; i < a.length; i++) res += a[i];\n    return res;\n  };\n  inspect = function() {\n    return sum(a) === -11;\n  };\n})();\n"
  },
  {
    "path": "test/serializer/basic/LargeDelayedValue.js",
    "content": "(function() {\n  let obj = { a: 1, b: 2, c: 3, d: 4, e: 5, f: 6, g: 7, h: 8, i: 9, j: 10, k: 11, l: 12 };\n  global.a = [\n    function() {\n      return obj;\n    },\n    function() {\n      return obj;\n    },\n  ];\n  inspect = function() {\n    global.a[0]().length + global.a[1]().length;\n  };\n})();\n"
  },
  {
    "path": "test/serializer/basic/LetGlobal.js",
    "content": "let x = 0;\nvar y = 1;\n\nfunction f() {\n  let w = { x: 5 };\n  var z = { z: 6 };\n  x += 1;\n  y += 1;\n  let foo = function() {\n    w.x += z.z + 1;\n  };\n  foo();\n  return x + w.x + y;\n}\ninspect = f;\n"
  },
  {
    "path": "test/serializer/basic/ManyFunctionInstantiations.js",
    "content": "var f = function(i) {\n  return function() {\n    /* don't inline don't inline don't inline I am too big */\n    return i;\n  };\n};\n\nvar g = function(i) {\n  return function() {\n    /* don't inline don't inline don't inline I am too big */\n    return i;\n  };\n};\n\nvar h = [f(1), g(2), f(3), g(4), f(5), g(6)];\n\ninspect = function() {\n  return h[0]() + \" \" + h[1]() + \" \" + h[2]() + \" \" + h[3]() + \" \" + h[4]() + \" \" + h[5]();\n};\n"
  },
  {
    "path": "test/serializer/basic/Map.js",
    "content": "function Map() {\n  return Map;\n}\nvar f = Map;\n\ninspect = function() {\n  return f == f();\n};\n"
  },
  {
    "path": "test/serializer/basic/Map2.js",
    "content": "var m = new Map([[\"a\", 1], [\"b\", 2]]);\nm.foo = 123;\n\nvar z = m;\n\ninspect = function() {\n  return m.size === 2 && m instanceof Map && m.foo === 123 && m.get(\"a\") === 1 && m.get(\"b\") === 2;\n};\n"
  },
  {
    "path": "test/serializer/basic/MapIteratorPrototype.js",
    "content": "// es6\nlet MapIteratorPrototype = new Map()[Symbol.iterator]().__proto__;\n\ninspect = function() {\n  return MapIteratorPrototype;\n};\n"
  },
  {
    "path": "test/serializer/basic/MapNotDeadMember.js",
    "content": "// es6\n// does contain:__dead_object_signature__\n\nlet alive = new Object();\nlet dead = new String(\"__dead_object_signature__\");\n\nvar s = new Map();\n\ns.set(alive, 1);\ns.set(dead, 1);\n\ninspect = function() {\n  return \"containsAlive: \" + s.has(alive);\n};\n"
  },
  {
    "path": "test/serializer/basic/MemoizeGlobalPropertiesRegExp.js",
    "content": "(function() {\n  let re = RegExp;\n  RegExp = function() {\n    throw new Error();\n  };\n  RegExp = new re(\"ab+c\");\n})();\n\ninspect = function() {\n  return RegExp;\n};\n"
  },
  {
    "path": "test/serializer/basic/MissingInitialElement.js",
    "content": "var a = [, 0];\ninspect = function() {\n  return a[0];\n};\n"
  },
  {
    "path": "test/serializer/basic/NestedFunctions1.js",
    "content": "// Copies of x: 2\n(function() {\n  global.f = function() {\n    return function() {\n      /* This makes the function too big to inline. */\n      var x = 10;\n      return 2 * x;\n    };\n  };\n  global.g1 = f();\n  global.g2 = f();\n  inspect = function() {\n    return global.g1() + global.g2();\n  };\n})();\n"
  },
  {
    "path": "test/serializer/basic/NestedFunctions2.js",
    "content": "// Copies of x: 2\n(function() {\n  global.f = function() {\n    return function() {\n      return function() {\n        /* This makes the function too big to inline. */\n        var x = 10;\n        return 2 * x;\n      };\n    };\n  };\n  global.g1 = f();\n  global.g2 = f();\n  global.h1 = g1();\n  global.h2 = g1();\n  inspect = function() {\n    return global.g1()() + global.g2()() + global.h1() + global.h2();\n  };\n})();\n"
  },
  {
    "path": "test/serializer/basic/NestedFunctions3.js",
    "content": "// Copies of x0: 3\nvar f = function() {\n  return function() {\n    var x0 = 1;\n    var x1 = x0 + x0;\n    var x2 = x1 + x1;\n    var x3 = x2 + x2;\n    var x4 = x3 + x3;\n    return x4;\n  };\n};\nvar g = f();\n"
  },
  {
    "path": "test/serializer/basic/NestedFunctions4.js",
    "content": "// TODO: add copies checking after handling FunctionDeclaration\nvar f = function() {\n  function nested() {\n    var x0 = 1;\n    var x1 = x0 + x0;\n    var x2 = x1 + x1;\n    var x3 = x2 + x2;\n    var x4 = x3 + x3;\n    return x4;\n  }\n  return nested;\n};\nvar g = f();\ninspect = function() {\n  return g();\n};\n"
  },
  {
    "path": "test/serializer/basic/NestedFunctions5.js",
    "content": "var f = function() {\n  return nested; // note that declaration comes later --- this is okay!\n  function nested() {\n    var x0 = 1;\n    var x1 = x0 + x0;\n    var x2 = x1 + x1;\n    var x3 = x2 + x2;\n    var x4 = x3 + x3;\n    return x4;\n  }\n};\nvar g = f();\ninspect = function() {\n  return f()();\n};\n"
  },
  {
    "path": "test/serializer/basic/NonObjectPrototypes.js",
    "content": "(function() {\n  var x = {};\n  x.__proto__ = 42;\n  inspect = function() {\n    return x.__proto__;\n  };\n})();\n"
  },
  {
    "path": "test/serializer/basic/NonOrdinarySetPrototypeOf.js",
    "content": "const root = {};\nconst proxy = new Proxy(Object.create(root), {});\nconst leaf = Object.create(proxy);\n\n// This should not detect a cycle,\n// because proxy does not use the\n// ordinary object definition for [[SetPrototypeOf]].\n// See also test262/test/annexB/built-ins/Object/prototype/__proto__/set-cycle-shadowed.js\nObject.setPrototypeOf(root, leaf);\n\ninspect = function() {\n  return (\n    Object.getPrototypeOf(root) === leaf &&\n    Object.getPrototypeOf(leaf) === proxy &&\n    Object.getPrototypeOf(proxy) === root\n  );\n};\n"
  },
  {
    "path": "test/serializer/basic/NonStrictComplex.js",
    "content": "/**\n * Copyright 2004-present Facebook. All Rights Reserved.\n */\n(function() {\n  var isStrict = function() {\n    return function() {\n      // This function is too big to be inlined.\n      return !!this;\n    };\n  };\n  let f1 = isStrict();\n  let f2 = isStrict();\n  let f3 = isStrict();\n  inspect = function() {\n    return f1() && f2() && f3();\n  };\n})();\n"
  },
  {
    "path": "test/serializer/basic/NullPrototype.js",
    "content": "(function() {\n  var x = {};\n  x.__proto__ = null;\n  inspect = function() {\n    x.__proto__ === null;\n  };\n})();\n"
  },
  {
    "path": "test/serializer/basic/ObjectFreeze1.js",
    "content": "// does contain:freeze\n// does not contain:defineProperty\n(function() {\n  var o = { x: 23, y: 42 };\n  Object.freeze(o);\n  global.inspect = function() {\n    o.z = \"bug\";\n    return o.z;\n  };\n})();\n"
  },
  {
    "path": "test/serializer/basic/ObjectFreeze2.js",
    "content": "// does contain:freeze\n// does not contain:defineProperty\n(function() {\n  var f = function() {};\n  Object.freeze(f);\n  global.inspect = function() {\n    f.z = \"bug\";\n    return f.z;\n  };\n})();\n"
  },
  {
    "path": "test/serializer/basic/ObjectFreeze3.js",
    "content": "// does contain:freeze\n// does not contain:defineProperty\n(function() {\n  var a = [1, 2, 3];\n  Object.freeze(a);\n  global.inspect = function() {\n    a.z = \"bug\";\n    return a.z;\n  };\n})();\n"
  },
  {
    "path": "test/serializer/basic/ObjectFreeze4.js",
    "content": "// does contain:freeze\n// does not contain:defineProperty\n(function() {\n  var re = RegExp();\n  Object.freeze(re);\n  global.inspect = function() {\n    re.z = \"bug\";\n    return re.z;\n  };\n})();\n"
  },
  {
    "path": "test/serializer/basic/ObjectFreeze5.js",
    "content": "// does contain:freeze\n(function() {\n  var o = { x: 23, y: 42 };\n  Object.defineProperty(o, \"foo\", { enumerable: false, writable: false, configurable: false, value: 42 });\n  Object.freeze(o);\n  global.inspect = function() {\n    o.z = \"bug\";\n    return o.z + Object.getOwnPropertyDescriptor(o, \"foo\").enumerable;\n  };\n})();\n"
  },
  {
    "path": "test/serializer/basic/ObjectPreventExtensions1.js",
    "content": "// does contain:preventExtensions\n// does not contain:defineProperty\n(function() {\n  var o = { x: 23, y: 42 };\n  Object.preventExtensions(o);\n  global.inspect = function() {\n    o.z = \"bug\";\n    return o.z;\n  };\n})();\n"
  },
  {
    "path": "test/serializer/basic/ObjectSeal1.js",
    "content": "// does contain:seal\n// does not contain:defineProperty\n(function() {\n  var o = { x: 23, y: 42 };\n  Object.seal(o);\n  global.inspect = function() {\n    o.z = \"bug\";\n    return o.z;\n  };\n})();\n"
  },
  {
    "path": "test/serializer/basic/ObjectSeal2.js",
    "content": "// does contain:seal\n(function() {\n  var o = { x: 23, y: 42 };\n  Object.defineProperty(o, \"foo\", { enumerable: false, writable: false, configurable: false, value: 42 });\n  Object.seal(o);\n  global.inspect = function() {\n    o.z = \"bug\";\n    return o.z + Object.getOwnPropertyDescriptor(o, \"foo\").writable;\n  };\n})();\n"
  },
  {
    "path": "test/serializer/basic/OmitInvariants.js",
    "content": "// omit invariants\n// does not contain:Prepack model invariant violation\n(function() {\n  let foo = global.__abstract ? __abstract({ x: __abstract(\"number\") }, \"({x : 1})\") : { x: 1 };\n  global.foox = foo.x;\n  global.inspect = function() {};\n})();\n"
  },
  {
    "path": "test/serializer/basic/OmitUnknownScopeSelectorError.js",
    "content": "// omit invariants\n// does not contain:Unknown scope selector\n(function() {\n  var x = 2;\n  var y = 2;\n  function getAnswer() {\n    return x + y;\n  }\n  function setX(newX) {\n    x = newX;\n  }\n  global.getAnswer = getAnswer;\n  global.setX = setX;\n})();\n"
  },
  {
    "path": "test/serializer/basic/OverridingFunctionPrototype.js",
    "content": "(function() {\n  function f() {}\n  let p = f.prototype;\n  f.prototype = {};\n  Object.defineProperty(f.prototype, \"constructor\", {\n    configurable: true,\n    enumerable: false,\n    writable: true,\n    value: f,\n  });\n  inspect = function() {\n    return f.prototype === p;\n  };\n})();\n"
  },
  {
    "path": "test/serializer/basic/PathConditionDeadCode.js",
    "content": "let b = global.__abstract ? __abstract(\"boolean\", \"true\") : true;\nlet n1;\nif (b) n1 = 5;\nlet n2 = global.__abstract ? __abstract(\"number\", \"7\") : 7;\nvar x = 0;\nfunction f() {\n  if (!b) return;\n  if (b) throw \"foo\";\n  //dead\n  x = 42;\n}\n\ninspect = function() {\n  return f();\n};\n"
  },
  {
    "path": "test/serializer/basic/PathConditionThrow.js",
    "content": "let b = global.__abstract ? __abstract(\"boolean\", \"true\") : true;\nlet n1;\nif (b) n1 = 5;\nlet n2 = global.__abstract ? __abstract(\"number\", \"7\") : 7;\n\nfunction f() {\n  let yy = g();\n  return n2 - yy;\n}\n\nfunction g() {\n  if (!b) throw 10;\n  return n2 - n1;\n}\n\ninspect = function() {\n  return f();\n};\n"
  },
  {
    "path": "test/serializer/basic/Promise.js",
    "content": "function fn(resolve) {\n  setTimeout(function() {\n    resolve();\n  }, 100);\n}\n\ninspect = function() {\n  return new Promise(fn);\n};\n"
  },
  {
    "path": "test/serializer/basic/PropertyAssignment.js",
    "content": "// add at runtime:var foo = {};\n// Copies of .bar:2\n// omit invariants\nvar ob = global.__makeSimple ? __makeSimple(__abstract({}, \"foo\")) : {};\nob.bar = { a: 1 };\n\ninspect = function() {\n  return JSON.stringify(ob.bar);\n};\n"
  },
  {
    "path": "test/serializer/basic/PropertyGetter.js",
    "content": "var s = {};\nObject.defineProperty(s, \"p\", {\n  configurable: true,\n  enumerable: true,\n  get: function() {\n    throw new Error(\"42\");\n  },\n});\n\ninspect = function() {\n  try {\n    return s.p;\n  } catch (e) {\n    return e.message;\n  }\n};\n"
  },
  {
    "path": "test/serializer/basic/PropertySetter.js",
    "content": "var s = String;\nObject.defineProperty(s, \"p\", {\n  configurable: true,\n  enumerable: true,\n  set: function() {\n    throw new Error(\"42\");\n  },\n});\ntry {\n  s.p = \"gotcha\";\n} catch (e) {\n  Object.defineProperty(s, \"p\", {\n    get: function() {\n      return 42;\n    },\n    set: function() {},\n  });\n}\ns.p = \"ok now\";\n\ninspect = function() {\n  return s.p;\n};\n"
  },
  {
    "path": "test/serializer/basic/Prototypes.js",
    "content": "// es6\n(function() {\n  var a = [\n    \"Object\",\n    \"Array\",\n    \"Function\",\n    \"Symbol\",\n    \"String\",\n    \"Number\",\n    \"Boolean\",\n    \"Date\",\n    \"RegExp\",\n    \"Set\",\n    \"Map\",\n    \"DataView\",\n    \"ArrayBuffer\",\n    \"WeakMap\",\n    \"WeakSet\",\n  ];\n  a = a.map(name => Object.create(global[name].prototype));\n  inspect = function() {\n    a.map(p => p.__proto__.constructor.name).join(\",\");\n  };\n})();\n"
  },
  {
    "path": "test/serializer/basic/Prototypes2.js",
    "content": "(function() {\n  var vString = new String(\"foo\");\n  var vBoolean = new Boolean(true);\n  var vNumber = new Number(123);\n  var vRegExp = new RegExp(\"x\", \"g\");\n  var vFunction = function() {\n    return 42;\n  };\n  var a = [vString, vBoolean, vNumber, vRegExp, vFunction];\n  inspect = function() {\n    function describe(v) {\n      if (v instanceof RegExp) return v.source;\n      if (v instanceof Function) return v();\n      return v;\n    }\n    return a.map(v => v.constructor.name + \":\" + describe(v)).join(\", \");\n  };\n})();\n"
  },
  {
    "path": "test/serializer/basic/Proxy.js",
    "content": "let p = new Proxy(\n  {},\n  {\n    get: function() {\n      return 42;\n    },\n  }\n);\ninspect = function() {\n  return p.x;\n};\n"
  },
  {
    "path": "test/serializer/basic/Recursion.js",
    "content": "var f = function(i) {\n  return i > 0 ? f(i - 1) + 1 : 0;\n};\n\ninspect = function() {\n  return f(42);\n};\n"
  },
  {
    "path": "test/serializer/basic/Recursion2.js",
    "content": "var f = (function() {\n  var Map2 = function() {\n    return Map2;\n  };\n  return Map2;\n})();\n\ninspect = function() {\n  return f() == f()() ? true : false;\n};\n"
  },
  {
    "path": "test/serializer/basic/RecursiveMutatedFunctionIdentifier.js",
    "content": "(function() {\n  let v;\n  function init() {\n    init = function() {};\n    v = {};\n  }\n  function work() {\n    let a = (init(), v);\n    let b = (init(), v);\n    return a == b;\n  }\n  global.inspect = work;\n})();\n"
  },
  {
    "path": "test/serializer/basic/ReferentializeBug.js",
    "content": "(function() {\n  function f() {\n    let obj = { x: 0 };\n    function g() {\n      return function() {\n        obj = { x: obj.x + 1 }; /* This comment makes this function too big to be inlined. */\n      };\n    }\n    function h() {\n      return obj.x;\n    }\n    return [g(), g(), g(), h];\n  }\n  var a = f();\n  inspect = function() {\n    return a[3]();\n  };\n})();\n"
  },
  {
    "path": "test/serializer/basic/ReferentializeInitializer.js",
    "content": "(function() {\n  function f() {\n    let obj = { count: 0 };\n    return function(reset) {\n      if (reset) obj = { count: 0 };\n      return obj.count++;\n    };\n  }\n  var g = f();\n  inspect = function() {\n    return \"\" + g(false) + g(true) + g(false);\n  };\n})();\n"
  },
  {
    "path": "test/serializer/basic/RegExp.js",
    "content": "regexp = /Facebook/i;\nregexp2 = /books/;\nregexp3 = new RegExp(\"/\");\n\nregexp2.lastIndex = 8;\ni = \"but books are books\".match(regexp2);\nj = regexp2.lastIndex;\n\nk = \"and /books/ are books too\".match(regexp3);\n\ninspect = function() {\n  return \"\" + global.i + global.j + global.k + \"Facebook is cool\".match(global.regexp).index;\n};\n"
  },
  {
    "path": "test/serializer/basic/ResidualIdentityObservation.js",
    "content": "(function() {\n  var a = { x: 4 };\n  function f() {\n    return a;\n  }\n  function g() {\n    return a;\n  }\n  inspect = function() {\n    return f() === g();\n  };\n})();\n"
  },
  {
    "path": "test/serializer/basic/ResidualIdentityObservation2.js",
    "content": "(function() {\n  var a = { x: 4 };\n  function f() {\n    return a;\n  }\n  inspect = function() {\n    return f() === f();\n  };\n})();\n"
  },
  {
    "path": "test/serializer/basic/Set.js",
    "content": "var m = new Set([\"a\", \"b\"]);\nm.foo = 123;\nm.add(m);\n\nz = m;\n\ninspect = function() {\n  return m instanceof Set && m.foo === 123 && m.has(\"a\") && m.has(\"b\") && m.has(m) && m.size === 3;\n};\n"
  },
  {
    "path": "test/serializer/basic/SetNotDeadMember.js",
    "content": "// es6\n// does contain:__dead_object_signature__\n\nlet alive = new Object();\nlet dead = new String(\"__dead_object_signature__\");\n\nvar s = new Set([alive, dead]);\n\ninspect = function() {\n  return \"containsAlive: \" + s.has(alive);\n};\n"
  },
  {
    "path": "test/serializer/basic/SetTimeout.js",
    "content": "// es6\nvar st = global.setTimeout;\nvar y;\nglobal.setTimeout = function(x) {\n  return st(x, y);\n};\n\ninspect = function() {\n  return (global.setTimeout ? \"global.setTimeout\" : \"\") + (st ? \"st\" : \"\");\n};\n"
  },
  {
    "path": "test/serializer/basic/SimpleCircularFunctions.js",
    "content": "let cond = 0;\n\nfunction a() {\n  cond += 1;\n  b();\n}\nfunction b() {\n  if (cond < 2) a();\n}\n\ninspect = function() {\n  a();\n  return cond;\n};\n"
  },
  {
    "path": "test/serializer/basic/SimpleInheritanceChains.js",
    "content": "(function() {\n  function A() {}\n  function B() {}\n  B.prototype = Object.create(A.prototype);\n  inspect = function() {\n    return A.prototype === B.prototype.__proto__;\n  };\n})();\n"
  },
  {
    "path": "test/serializer/basic/StrictComplex.js",
    "content": "/**\n * Copyright 2004-present Facebook. All Rights Reserved.\n */\n(function() {\n  var isStrict = function() {\n    \"use strict\";\n    return function() {\n      // This function is too big to be inlined.\n      return !!this;\n    };\n  };\n  let f1 = isStrict();\n  let f2 = isStrict();\n  let f3 = isStrict();\n  inspect = function() {\n    return f1() && f2() && f3();\n  };\n})();\n"
  },
  {
    "path": "test/serializer/basic/StrictGlobals.js",
    "content": "(function() {\n  \"use strict\";\n  let moduleTable = {};\n  function require(id) {\n    return {};\n  }\n  global.require = require;\n})();\n\nthree = require(\"three\");\n"
  },
  {
    "path": "test/serializer/basic/StrictSimple.js",
    "content": "/**\n * Copyright 2004-present Facebook. All Rights Reserved.\n */\n(function() {\n  var isStrict = function() {\n    \"use strict\";\n    return !!this;\n  };\n  inspect = function() {\n    return isStrict();\n  };\n})();\n"
  },
  {
    "path": "test/serializer/basic/StringPrototype.js",
    "content": "String.prototype.x = 42;\n\ninspect = function() {\n  return String.prototype.x;\n};\n"
  },
  {
    "path": "test/serializer/basic/Symbols.js",
    "content": "// es6\nvar it = Symbol.iterator;\n\ninspect = function() {\n  return it === Symbol.iterator;\n};\n"
  },
  {
    "path": "test/serializer/basic/Symbols2.js",
    "content": "// es6\n(function() {\n  let a = Symbol.for(\"test\");\n  let b = Symbol.for(\"test\");\n  inspect = function() {\n    return \"\" + (a === Symbol.for(\"test\"));\n  };\n})();\n"
  },
  {
    "path": "test/serializer/basic/Uint8Array.js",
    "content": "var x = new Uint8Array([1, 2, 3]);\nx.foo = \"bar\";\n\ninspect = function() {\n  return x.length + \" \" + x[0] + x[1] + x[2] + x[3] + x.foo;\n};\n"
  },
  {
    "path": "test/serializer/basic/Undefined.js",
    "content": "// does not contain:undefined\n// omit invariants\n(function() {\n  var x = undefined;\n  inspect = function() {\n    return x;\n  };\n})();\n"
  },
  {
    "path": "test/serializer/basic/UndefinedAsLocalVariableName.js",
    "content": "(function() {\n  let x = undefined;\n  inspect = function() {\n    let undefined = 42;\n    return undefined === x;\n  };\n})();\n"
  },
  {
    "path": "test/serializer/basic/UniqueNames.js",
    "content": "(function() {\n  function bar() {\n    try {\n      return global._0.name;\n    } catch (e) {\n      return \"exception\";\n    }\n  }\n  inspect = function() {\n    return bar();\n  };\n})();\n"
  },
  {
    "path": "test/serializer/basic/UnknownScopeSelectorError.js",
    "content": "// does contain:Unknown scope selector\n(function() {\n  var x = 2;\n  var y = 2;\n  function getAnswer() {\n    return x + y;\n  }\n  function setX(newX) {\n    x = newX;\n  }\n  global.getAnswer = getAnswer;\n  global.setX = setX;\n})();\n"
  },
  {
    "path": "test/serializer/basic/Values.js",
    "content": "function g(i) {\n  function f() {\n    /* This comment is here so that the function gets too big to be considered for inlining by our serialiser. */\n    return i + arguments[0];\n  }\n  return f;\n}\nvar h0 = g(0);\nvar h1 = g(1);\n\ninspect = function() {\n  return h1(42) - h0(42);\n};\n"
  },
  {
    "path": "test/serializer/basic/WeakMap.js",
    "content": "// es6\nlet a = { a: 1 };\nlet b = { b: 3 };\nlet c = { c: 5 };\nvar m = new WeakMap([[a, 2], [b, 4]]);\nm.foo = 123;\nm.set(c, m);\nm.set(m, 6);\n\nz = m;\n\ninspect = function() {\n  return (\n    m.size === 4 &&\n    m instanceof WeakMap &&\n    m.foo === 123 &&\n    m.get(a) === 2 &&\n    m.get(b) === 4 &&\n    m.get(m) === 6 &&\n    m.get(c) === m\n  );\n};\n"
  },
  {
    "path": "test/serializer/basic/WeakMapDeadMember.js",
    "content": "// es6\n// does not contain:__dead_object_signature__\n\nlet alive = new Object();\nlet dead = new String(\"__dead_object_signature__\");\n\nvar s = new WeakMap();\n\ns.set(alive, 1);\ns.set(dead, 1);\n\ninspect = function() {\n  return \"containsAlive: \" + s.has(alive);\n};\n"
  },
  {
    "path": "test/serializer/basic/WeakMapInternalReference.js",
    "content": "// es6\n// does contain:__not_dead_object_signature__\n\nlet obj1 = new Object();\nlet obj2 = new Object();\nlet obj3 = new String(\"__not_dead_object_signature__\");\nvar m = new WeakMap();\n\nm.set(obj1, obj3);\nm.set(obj2, obj1);\n\ninspect = function() {\n  return \"containsRootObject: \" + global.s.has(obj2);\n};\n"
  },
  {
    "path": "test/serializer/basic/WeakSet.js",
    "content": "// es6\nlet a = { a: 1 };\nlet b = { b: 2 };\nvar m = new WeakSet([a, b]);\nm.foo = 123;\n\nvar z = m;\n\ninspect = function() {\n  return m instanceof WeakSet && m.foo === 123 && m.has(a) === 1 && m.has(b) === 2 && m.size === 2;\n};\n"
  },
  {
    "path": "test/serializer/basic/WeakSetDeadMember.js",
    "content": "// es6\n// does not contain:__dead_object_signature__\n\nlet alive = new Object();\nlet dead = new String(\"__dead_object_signature__\");\n\nvar s = new WeakSet([alive, dead]);\n\ninspect = function() {\n  return \"containsAlive: \" + s.has(alive);\n};\n"
  },
  {
    "path": "test/serializer/basic/__output.js",
    "content": "(function() {\n  function f() {\n    return \"__output\" in global;\n  }\n  if (global.__abstract) {\n    // we are running under Prepack\n    global.__output = { inspect: f };\n  } else {\n    // we are not running under Prepack\n    global.inspect = f;\n  }\n})();\n"
  },
  {
    "path": "test/serializer/basic/setTimeoutAndInterval.js",
    "content": "// es6\n// does contain:keep me\n(function() {\n  let f = function() {\n    /* keep me */\n  };\n  let id1 = global.setTimeout(f, 1000);\n  let id2 = global.setInterval(f, 1000);\n  global.clearTimeout(id1);\n  global.clearInterval(id2);\n  inspect = function() {\n    return true;\n  };\n})();\n"
  },
  {
    "path": "test/serializer/instant-render/EmptyBuiltInArray.js",
    "content": "// instant render\n// add at runtime:var __empty = {};\n\nfunction f(c) {\n  var a = [];\n  a[1] = 42;\n  if (c) {\n    a[0] = 42;\n  }\n\n  return a;\n}\n\nglobal.__optimize && __optimize(f);\n\nlet real_inspect = function() {\n  let result = f(false);\n  return JSON.stringify(result);\n};\n\nlet fake_inspect = function() {\n  return JSON.stringify([{}, 42]);\n};\n\ninspect = global.__optimize ? real_inspect : fake_inspect;\n"
  },
  {
    "path": "test/serializer/instant-render/EmptyBuiltInArrayLength.js",
    "content": "// instant render\n// add at runtime:var __empty = {};\n\nfunction f(c) {\n  var a = [5, 6, 7];\n  let l0 = a.length;\n  if (c) {\n    a[3] = 42;\n  }\n  let l1 = a.length;\n\n  return [l0, l1];\n}\n\nglobal.__optimize && __optimize(f);\n\ninspect = function() {\n  return JSON.stringify([f(false), f(true)]);\n};\n"
  },
  {
    "path": "test/serializer/instant-render/EmptyBuiltInProps.js",
    "content": "// instant render\n// add at runtime:var __empty = {};\n\nfunction f(c) {\n  var a = {};\n  if (c) {\n    a.foo = 42;\n  }\n\n  return a;\n}\n\nglobal.__optimize && __optimize(f);\n\nlet real_inspect = function() {\n  let result = f(false);\n  return JSON.stringify(result);\n};\n\nlet fake_inspect = function() {\n  return JSON.stringify({ foo: {} });\n};\n\ninspect = global.__optimize ? real_inspect : fake_inspect;\n"
  },
  {
    "path": "test/serializer/instant-render/FunctionArgumentModeling.js",
    "content": "// instant render\n// does contain:\"TypecheckOpt\"\n// does contain:\"TypecheckNumbernumber\"\n// does contain:__prop_int(\n// does contain:__prop_string(\n// does contain:__prop_string_list(\n\nfunction gen_getter(valid) {\n  return function(o, k) {\n    if (valid.indexOf(k) < 0) throw new Error(\"Wrong getter\");\n    return o[k];\n  };\n}\nglobal.__prop_int = gen_getter([\"age\", \"width\", \"height\"]);\nglobal.__prop_string = gen_getter([\"name\", \"friendlyName\"]);\nglobal.__prop_string_list = gen_getter([\"friendNames\"]);\n// attempt to access anything else should produce errors\n\n(function() {\n  let universe = {\n    Profile: {\n      kind: \"object\",\n      jsType: \"object\",\n      graphQLType: \"ProfileData\",\n      properties: {\n        name: {\n          shape: {\n            kind: \"scalar\",\n            jsType: \"string\",\n            graphQLType: \"String\",\n          },\n          optional: false,\n        },\n        friendlyName: {\n          shape: {\n            kind: \"scalar\",\n            jsType: \"string\",\n            graphQLType: \"String\",\n          },\n          optional: false,\n        },\n        age: {\n          shape: {\n            kind: \"scalar\",\n            jsType: \"integral\",\n            graphQLType: \"Int\",\n          },\n          optional: true,\n        },\n        friendNames: {\n          shape: {\n            kind: \"array\",\n            jsType: \"array\",\n            graphQLType: \"[String!]\",\n            elementShape: {\n              shape: {\n                kind: \"scalar\",\n                jsType: \"string\",\n                graphQLType: \"String\",\n              },\n              optional: false,\n            },\n          },\n          optional: true,\n        },\n      },\n    },\n    Props: {\n      kind: \"object\",\n      jsType: \"object\",\n      properties: {\n        userProfile: {\n          shape: {\n            kind: \"link\",\n            shapeName: \"Profile\",\n          },\n          optional: false,\n        },\n        screenSize: {\n          shape: {\n            kind: \"object\",\n            jsType: \"object\",\n            properties: {\n              width: {\n                shape: {\n                  kind: \"link\",\n                  shapeName: \"Size\",\n                },\n                optional: false,\n              },\n              height: {\n                shape: {\n                  kind: \"link\",\n                  shapeName: \"Size\",\n                },\n                optional: false,\n              },\n            },\n          },\n          optional: true,\n        },\n      },\n    },\n    Size: {\n      kind: \"scalar\",\n      jsType: \"integral\",\n    },\n  };\n\n  let toBeOptimizedModel = {\n    arguments: {\n      props: \"Props\",\n    },\n    universe,\n  };\n\n  function toBeOptimized(props) {\n    return [\n      props.userProfile.name,\n      props.userProfile.friendlyName,\n      props.userProfile.friendlyName ? props.userProfile.friendlyName[0] : undefined,\n      props.userProfile.age,\n      props.userProfile.friendNames ? props.userProfile.friendNames[2] : undefined,\n      props.screenSize ? props.screenSize.width : undefined,\n      props.screenSize ? props.screenSize.height : undefined,\n      \"TypecheckOpt\" + typeof props.screenSize,\n      \"TypecheckNumber\" + typeof props.screenSize.width,\n    ];\n  }\n  if (global.__optimize) {\n    __optimize(toBeOptimized, JSON.stringify(toBeOptimizedModel));\n  }\n\n  global.inspect = function() {\n    let props = {\n      userProfile: {\n        name: \"A\",\n        friendlyName: undefined,\n        age: 10,\n        friendNames: [\"B\", \"C\", \"D\"],\n      },\n      screenSize: {\n        width: 10,\n        height: 10,\n      },\n    };\n    return toBeOptimized(props);\n  };\n})();\n"
  },
  {
    "path": "test/serializer/instant-render/NotNull.js",
    "content": "// instant render\n// add at runtime:global.__cannotBecomeObject = a => a === undefined || a === null;\n// does not contain:void 0\n\nlet a = global.__abstract ? __abstract(undefined, \"(true)\") : true;\n\nlet x1 = a === undefined || a === null;\nlet x2 = a === undefined || null === a;\nlet x3 = undefined === a || a === null;\nlet x4 = undefined === a || null === a;\n\nlet x5 = a === null || a === undefined;\nlet x6 = a === null || undefined === a;\nlet x7 = null === a || a === undefined;\nlet x8 = null === a || undefined === a;\n\nglobal.inspect = function() {\n  return [x1, x2, x3, x4, x5, x6, x7, x8].join(\" \");\n};\n"
  },
  {
    "path": "test/serializer/optimizations/CommonSubExpr.js",
    "content": "let x = global.__abstract ? __abstract(\"number\", \"10\") : 10;\nglobal.a = x + 1;\nglobal.b = x + 1;\n\ninspect = function() {\n  return global.a + global.b;\n};\n"
  },
  {
    "path": "test/serializer/optimizations/CommonSubExpr2.js",
    "content": "var x = global.__abstract ? __abstract(\"number\", \"1\") : 1;\nvar y = global.__abstract ? __abstract(\"number\", \"2\") : 2;\n\nvar useFoo = true;\n\nfunction foo(v) {\n  if (v > 2) {\n    return \"hello\";\n  } else {\n    return \"world\";\n  }\n}\n\nlet a;\nif (x > 100) {\n  if (useFoo) {\n    a = foo(y);\n  } else {\n    a = x;\n  }\n} else {\n  a = foo(y);\n}\nresult = a;\n\ninspect = function() {\n  return global.result;\n};\n"
  },
  {
    "path": "test/serializer/optimizations/CommonSubExpr3.js",
    "content": "var x = global.__abstract ? __abstract(\"number\", \"1\") : 1;\nvar y = global.__abstract ? __abstract(\"number\", \"2\") : 2;\n\nvar useFoo = true;\n\nfunction foo(v) {\n  if (v > 2) {\n    return \"hello\";\n  } else {\n    return \"world\";\n  }\n}\n\nvar a;\nif (x > 100) {\n  if (useFoo) {\n    a = foo(y);\n  } else {\n    a = x;\n  }\n} else {\n  a = foo(y);\n}\n\ninspect = function() {\n  return a;\n};\n"
  },
  {
    "path": "test/serializer/optimizations/DedupeGenerator.js",
    "content": "// Copies of Date.now():1\n(function() {\n  function fib(x) {\n    let y = Date.now();\n    return x <= 1 ? x : fib(x - 1) + fib(x - 2);\n  }\n\n  let x = Date.now();\n  if (x * 2 > 42) x = fib(10);\n  global.result = x;\n})();\n"
  },
  {
    "path": "test/serializer/optimizations/DelayInitCaptures.js",
    "content": "function f() {\n  let x = [];\n  let y = [];\n  function a() {\n    // ================================================= no inline\n    x.push(\"hi\");\n  }\n  function b() {\n    // ================================================= no inline\n    y.push(\"bye\");\n  }\n  function c() {\n    // ================================================= no inline\n    return x.length + y.length;\n  }\n  return [a, b, c];\n}\n\nvar res = f();\nvar a = res[0];\nvar b = res[1];\nvar c = res[2];\n\ninspect = function() {\n  a();\n  b();\n  return c();\n};\n"
  },
  {
    "path": "test/serializer/optimizations/DelayInitMult.js",
    "content": "function f() {\n  var valueA = [];\n  var valueB = {};\n\n  function fun1() {\n    // no inline =============================================\n    // reference valueA then modify it\n    let len = valueA.length;\n    valueA = [];\n    valueA.push(\"hello\");\n    return valueA;\n  }\n\n  function fun2() {\n    // no inline =============================================\n    // modify valueB then reference it\n    valueB = {};\n    valueB.x = \"hello\";\n    return valueB.length;\n  }\n\n  function print() {\n    // no inline =============================================\n    // Reference both valueA and valueB\n    return valueA.toString() + valueB.toString();\n  }\n\n  return [fun1, fun2, print];\n}\n\nvar res = f();\nvar a = res[0];\nvar b = res[1];\nvar c = res[2];\n\ninspect = function() {\n  let toPrint = b() + \" \";\n  toPrint += a();\n  return toPrint + \" \" + c();\n};\n"
  },
  {
    "path": "test/serializer/optimizations/collapse_cases.js",
    "content": "// Copies of [1, 2, 3]:1\n// Copies of [4, 5, 6]:1\n// Copies of case:5\n(function() {\n  var f1 = function() {\n    var x = 1,\n      y = 2,\n      z = 3;\n    return function() {\n      return x++ + y++ + z++;\n    };\n  };\n  var f2 = function() {\n    var x = 4,\n      y = 5,\n      z = 6;\n    return function() {\n      return x++ + y++ + z++;\n    };\n  };\n\n  global.g1 = f1();\n  global.g2 = f2();\n  global.g3 = f1();\n  global.g4 = f2();\n  global.g5 = f1();\n  inspect = function() {\n    return global.g1() + global.g2() + global.g3() + global.g4();\n  };\n})();\n"
  },
  {
    "path": "test/serializer/optimizations/eagerlyRequireModuleDependencies.js",
    "content": "let c = 0;\nfunction __d(f, id, deps) {}\nfunction __r(id) {\n  __d(function() {}, id, id === 0 ? [1] : []);\n  c++;\n}\nif (global.__abstract) {\n  // prepacking\n  global.__eagerlyRequireModuleDependencies(() => {\n    __r(0);\n  });\n} else {\n  c = 2;\n}\ninspect = function() {\n  return c;\n};\n"
  },
  {
    "path": "test/serializer/optimizations/getOwnPropertySymbols.js",
    "content": "function objectSpread(target) {\n  for (var i = 1; i < arguments.length; i++) {\n    var source = arguments[i] != null ? arguments[i] : {};\n    var ownKeys = Object.keys(source);\n\n    if (typeof Object.getOwnPropertySymbols === \"function\") {\n      ownKeys = ownKeys.concat(\n        Object.getOwnPropertySymbols(source).filter(function(sym) {\n          return Object.getOwnPropertyDescriptor(source, sym).enumerable;\n        })\n      );\n    }\n\n    ownKeys.forEach(function(key) {\n      babelHelpers.defineProperty(target, key, source[key]);\n    });\n  }\n\n  return target;\n}\n\nfunction fn(baseHeaders, contentEncoding, userAgent) {\n  var headers = objectSpread({}, baseHeaders);\n\n  if (contentEncoding) {\n    headers[\"Content-Encoding\"] = contentEncoding;\n  }\n\n  if (userAgent) {\n    headers[\"User-Agent\"] = userAgent;\n  }\n\n  return headers;\n}\n\nglobal.__optimize && __optimize(fn);\n\ninspect = function() {\n  return JSON.stringify(fn({ a: 1, b: 2 }, \"123\", \"456\"));\n};\n"
  },
  {
    "path": "test/serializer/optimizations/non_numeric_arg_require.js",
    "content": "function f1(arg) {\n  return { x: 5 };\n}\nfunction f2(arg1, arg2) {\n  return { x: 6 };\n}\n\nvar require = f1;\nvar x = require(\"hello\");\n\nfunction f() {\n  // none of these should be replaced\n  let x = require(\"hello\");\n  let y = require(1);\n  require = f2;\n  let z = require(0, 1);\n  return x.x + y.x + z.x;\n}\n\ninspect = function() {\n  // the require( 0) should be entirely eliminated, but the require(1) will remain\n  return f();\n};\n"
  },
  {
    "path": "test/serializer/optimizations/proto.js",
    "content": "let proto = { a: 123 };\nlet o = {};\nObject.setPrototypeOf(o, proto);\nglobal.x = o;\ninspect = function() {\n  return Object.getPrototypeOf(global.x).a;\n};\n"
  },
  {
    "path": "test/serializer/optimizations/require_accelerate.js",
    "content": "// es6\n\nvar modules = Object.create(null);\n\n__d = define;\nfunction require(moduleId) {\n  var moduleIdReallyIsNumber = moduleId;\n  var module = modules[moduleIdReallyIsNumber];\n  return module && module.isInitialized ? module.exports : guardedLoadModule(moduleIdReallyIsNumber, module);\n}\n\nfunction define(factory, moduleId, dependencyMap) {\n  if (moduleId in modules) {\n    return;\n  }\n  modules[moduleId] = {\n    dependencyMap: dependencyMap,\n    exports: undefined,\n    factory: factory,\n    hasError: false,\n    isInitialized: false,\n  };\n\n  var _verboseName = arguments[3];\n  if (_verboseName) {\n    modules[moduleId].verboseName = _verboseName;\n    global.verboseNamesToModuleIds[_verboseName] = moduleId;\n  }\n}\n\nvar inGuard = false;\nfunction guardedLoadModule(moduleId, module) {\n  if (!inGuard && global.ErrorUtils) {\n    inGuard = true;\n    var returnValue = void 0;\n    try {\n      returnValue = loadModuleImplementation(moduleId, module);\n    } catch (e) {\n      global.ErrorUtils.reportFatalError(e);\n    }\n    inGuard = false;\n    return returnValue;\n  } else {\n    return loadModuleImplementation(moduleId, module);\n  }\n}\n\nfunction loadModuleImplementation(moduleId, module) {\n  var nativeRequire = global.nativeRequire;\n  if (!module && nativeRequire) {\n    nativeRequire(moduleId);\n    module = modules[moduleId];\n  }\n\n  if (!module) {\n    throw unknownModuleError(moduleId);\n  }\n\n  if (module.hasError) {\n    throw moduleThrewError(moduleId);\n  }\n\n  module.isInitialized = true;\n  var exports = (module.exports = {});\n  var _module = module,\n    factory = _module.factory,\n    dependencyMap = _module.dependencyMap;\n  try {\n    var _moduleObject = { exports: exports };\n\n    factory(global, require, _moduleObject, exports, dependencyMap);\n\n    module.factory = undefined;\n\n    return (module.exports = _moduleObject.exports);\n  } catch (e) {\n    module.hasError = true;\n    module.isInitialized = false;\n    module.exports = undefined;\n    throw e;\n  }\n}\n\nfunction unknownModuleError(id) {\n  var message = 'Requiring unknown module \"' + id + '\".';\n  return Error(message);\n}\n\nfunction moduleThrewError(id) {\n  return Error('Requiring module \"' + id + '\", which threw an exception.');\n}\n\n// === End require code ===\n\ndefine(function(global, require, module, exports) {\n  var nondet = global.__abstract ? __abstract(\"boolean\", \"true\") : true;\n  if (nondet) {\n    require(1);\n  }\n}, 0, null);\n\ndefine(function(global, require, module, exports) {}, 1, null);\n\nvar f = require(0);\nrequire(1); // without accelerating requires (and without refinement), Prepack can't handle this.\n\ninspect = function() {\n  42;\n};\n"
  },
  {
    "path": "test/serializer/optimizations/require_delay.js",
    "content": "// es6\n\nvar modules = Object.create(null);\n\n__d = define;\nfunction require(moduleId) {\n  var moduleIdReallyIsNumber = moduleId;\n  var module = modules[moduleIdReallyIsNumber];\n  return module && module.isInitialized ? module.exports : guardedLoadModule(moduleIdReallyIsNumber, module);\n}\n\nfunction define(factory, moduleId, dependencyMap) {\n  if (moduleId in modules) {\n    return;\n  }\n  modules[moduleId] = {\n    dependencyMap: dependencyMap,\n    exports: undefined,\n    factory: factory,\n    hasError: false,\n    isInitialized: false,\n  };\n\n  var _verboseName = arguments[3];\n  if (_verboseName) {\n    modules[moduleId].verboseName = _verboseName;\n    global.verboseNamesToModuleIds[_verboseName] = moduleId;\n  }\n}\n\nvar inGuard = false;\nfunction guardedLoadModule(moduleId, module) {\n  if (!inGuard && global.ErrorUtils) {\n    inGuard = true;\n    var returnValue = void 0;\n    try {\n      returnValue = loadModuleImplementation(moduleId, module);\n    } catch (e) {\n      global.ErrorUtils.reportFatalError(e);\n    }\n    inGuard = false;\n    return returnValue;\n  } else {\n    return loadModuleImplementation(moduleId, module);\n  }\n}\n\nfunction loadModuleImplementation(moduleId, module) {\n  var nativeRequire = global.nativeRequire;\n  if (!module && nativeRequire) {\n    nativeRequire(moduleId);\n    module = modules[moduleId];\n  }\n\n  if (!module) {\n    throw unknownModuleError(moduleId);\n  }\n\n  if (module.hasError) {\n    throw moduleThrewError(moduleId);\n  }\n\n  module.isInitialized = true;\n  var exports = (module.exports = {});\n  var _module = module,\n    factory = _module.factory,\n    dependencyMap = _module.dependencyMap;\n  try {\n    var _moduleObject = { exports: exports };\n\n    factory(global, require, _moduleObject, exports, dependencyMap);\n\n    module.factory = undefined;\n\n    return (module.exports = _moduleObject.exports);\n  } catch (e) {\n    module.hasError = true;\n    module.isInitialized = false;\n    module.exports = undefined;\n    throw e;\n  }\n}\n\nfunction unknownModuleError(id) {\n  var message = 'Requiring unknown module \"' + id + '\".';\n  return Error(message);\n}\n\nfunction moduleThrewError(id) {\n  return Error('Requiring module \"' + id + '\", which threw an exception.');\n}\n\n// === End require code ===\n\ndefine(function(global, require, module, exports) {\n  var obj = global.__abstract ? __abstract({ unsupported: true }, \"({unsupported: true})\") : { unsupported: true };\n  if (obj.unsupported) {\n    exports.magic = 42;\n  } else {\n    exports.magic = 23;\n  }\n}, 0, null);\n\ndefine(function(global, require, module, exports) {\n  var x = require(0);\n  module.exports = function() {\n    return x;\n  };\n}, 1, null);\n\nvar f = require(1);\n\ninspect = function() {\n  return f().magic;\n};\n"
  },
  {
    "path": "test/serializer/optimizations/require_hoist.js",
    "content": "// es6\nvar modules = Object.create(null);\n\n__d = define;\nfunction require(moduleId) {\n  var moduleIdReallyIsNumber = moduleId;\n  var module = modules[moduleIdReallyIsNumber];\n  return module && module.isInitialized ? module.exports : guardedLoadModule(moduleIdReallyIsNumber, module);\n}\n\nfunction define(factory, moduleId, dependencyMap) {\n  if (moduleId in modules) {\n    return;\n  }\n  modules[moduleId] = {\n    dependencyMap: dependencyMap,\n    exports: undefined,\n    factory: factory,\n    hasError: false,\n    isInitialized: false,\n  };\n\n  var _verboseName = arguments[3];\n  if (_verboseName) {\n    modules[moduleId].verboseName = _verboseName;\n    global.verboseNamesToModuleIds[_verboseName] = moduleId;\n  }\n}\n\nvar inGuard = false;\nfunction guardedLoadModule(moduleId, module) {\n  if (!inGuard && global.ErrorUtils) {\n    inGuard = true;\n    var returnValue = void 0;\n    try {\n      returnValue = loadModuleImplementation(moduleId, module);\n    } catch (e) {\n      global.ErrorUtils.reportFatalError(e);\n    }\n    inGuard = false;\n    return returnValue;\n  } else {\n    return loadModuleImplementation(moduleId, module);\n  }\n}\n\nfunction loadModuleImplementation(moduleId, module) {\n  var nativeRequire = global.nativeRequire;\n  if (!module && nativeRequire) {\n    nativeRequire(moduleId);\n    module = modules[moduleId];\n  }\n\n  if (!module) {\n    throw unknownModuleError(moduleId);\n  }\n\n  if (module.hasError) {\n    throw moduleThrewError(moduleId);\n  }\n\n  module.isInitialized = true;\n  var exports = (module.exports = {});\n  var _module = module,\n    factory = _module.factory,\n    dependencyMap = _module.dependencyMap;\n  try {\n    var _moduleObject = { exports: exports };\n\n    factory(global, require, _moduleObject, exports, dependencyMap);\n\n    module.factory = undefined;\n\n    return (module.exports = _moduleObject.exports);\n  } catch (e) {\n    module.hasError = true;\n    module.isInitialized = false;\n    module.exports = undefined;\n    throw e;\n  }\n}\n\nfunction unknownModuleError(id) {\n  var message = 'Requiring unknown module \"' + id + '\".';\n  return Error(message);\n}\n\nfunction moduleThrewError(id) {\n  return Error('Requiring module \"' + id + '\", which threw an exception.');\n}\n\n// === End require code ===\n\nlet a = global.__abstract ? __abstract(\"boolean\", \"(false)\") : false;\nlet x = global.__abstract ? __abstract(\"number\", \"(42)\") : 42;\ndefine(function(global, require, module, exports) {\n  module.exports = require(1);\n}, 0, null);\ndefine(function(global, require, module, exports) {\n  let y = x * 2;\n  if (a) {\n    global.z = y;\n  } else {\n    global.z = y;\n  }\n  module.exports = global.z;\n}, 1, null);\nrequire(0);\ninspect = function() {\n  return global.z.toString();\n};\n"
  },
  {
    "path": "test/serializer/optimizations/require_mightHaveBeenDeleted.js",
    "content": "// add at runtime:let flag=false;\n// es6\n\nvar modules = Object.create(null);\n\n__d = define;\nfunction require(moduleId) {\n  var moduleIdReallyIsNumber = moduleId;\n  var module = modules[moduleIdReallyIsNumber];\n  return module && module.isInitialized ? module.exports : guardedLoadModule(moduleIdReallyIsNumber, module);\n}\n\nfunction define(factory, moduleId, dependencyMap) {\n  if (moduleId in modules) {\n    return;\n  }\n  modules[moduleId] = {\n    dependencyMap: dependencyMap,\n    exports: undefined,\n    factory: factory,\n    hasError: false,\n    isInitialized: false,\n  };\n\n  var _verboseName = arguments[3];\n  if (_verboseName) {\n    modules[moduleId].verboseName = _verboseName;\n    global.verboseNamesToModuleIds[_verboseName] = moduleId;\n  }\n}\n\nvar inGuard = false;\nfunction guardedLoadModule(moduleId, module) {\n  if (!inGuard && global.ErrorUtils) {\n    inGuard = true;\n    var returnValue = void 0;\n    try {\n      returnValue = loadModuleImplementation(moduleId, module);\n    } catch (e) {\n      global.ErrorUtils.reportFatalError(e);\n    }\n    inGuard = false;\n    return returnValue;\n  } else {\n    return loadModuleImplementation(moduleId, module);\n  }\n}\n\nfunction loadModuleImplementation(moduleId, module) {\n  var nativeRequire = global.nativeRequire;\n  if (!module && nativeRequire) {\n    nativeRequire(moduleId);\n    module = modules[moduleId];\n  }\n\n  if (!module) {\n    throw unknownModuleError(moduleId);\n  }\n\n  if (module.hasError) {\n    throw moduleThrewError(moduleId);\n  }\n\n  module.isInitialized = true;\n  var exports = (module.exports = {});\n  var _module = module,\n    factory = _module.factory,\n    dependencyMap = _module.dependencyMap;\n  try {\n    var _moduleObject = { exports: exports };\n\n    factory(global, require, _moduleObject, exports, dependencyMap);\n\n    module.factory = undefined;\n\n    return (module.exports = _moduleObject.exports);\n  } catch (e) {\n    module.hasError = true;\n    module.isInitialized = false;\n    module.exports = undefined;\n    throw e;\n  }\n}\n\nfunction unknownModuleError(id) {\n  var message = 'Requiring unknown module \"' + id + '\".';\n  return Error(message);\n}\n\nfunction moduleThrewError(id) {\n  return Error('Requiring module \"' + id + '\", which threw an exception.');\n}\n\n// === End require code ===\n\nvar target = {};\n\ndefine(function(global, require, module, exports) {\n  module.exports = target;\n}, 0, null);\n\ndefine(function(global, require, module, exports) {\n  module.exports = require(0);\n}, 1, null);\n\nlet __flag = global.__abstract ? __abstract(\"boolean\", \"flag\") : flag;\nif (__flag) require(0);\n\ninspect = function() {\n  return require(1) === target;\n};\n"
  },
  {
    "path": "test/serializer/optimizations/require_opt.js",
    "content": "// es6\n// does not contain:require(0)\nvar modules = Object.create(null);\n\n__d = define;\nfunction require(moduleId) {\n  var moduleIdReallyIsNumber = moduleId;\n  var module = modules[moduleIdReallyIsNumber];\n  return module && module.isInitialized ? module.exports : guardedLoadModule(moduleIdReallyIsNumber, module);\n}\n\nfunction define(factory, moduleId, dependencyMap) {\n  if (moduleId in modules) {\n    return;\n  }\n  modules[moduleId] = {\n    dependencyMap: dependencyMap,\n    exports: undefined,\n    factory: factory,\n    hasError: false,\n    isInitialized: false,\n  };\n\n  var _verboseName = arguments[3];\n  if (_verboseName) {\n    modules[moduleId].verboseName = _verboseName;\n    global.verboseNamesToModuleIds[_verboseName] = moduleId;\n  }\n}\n\nvar inGuard = false;\nfunction guardedLoadModule(moduleId, module) {\n  if (!inGuard && global.ErrorUtils) {\n    inGuard = true;\n    var returnValue = void 0;\n    try {\n      returnValue = loadModuleImplementation(moduleId, module);\n    } catch (e) {\n      global.ErrorUtils.reportFatalError(e);\n    }\n    inGuard = false;\n    return returnValue;\n  } else {\n    return loadModuleImplementation(moduleId, module);\n  }\n}\n\nfunction loadModuleImplementation(moduleId, module) {\n  var nativeRequire = global.nativeRequire;\n  if (!module && nativeRequire) {\n    nativeRequire(moduleId);\n    module = modules[moduleId];\n  }\n\n  if (!module) {\n    throw unknownModuleError(moduleId);\n  }\n\n  if (module.hasError) {\n    throw moduleThrewError(moduleId);\n  }\n\n  module.isInitialized = true;\n  var exports = (module.exports = {});\n  var _module = module,\n    factory = _module.factory,\n    dependencyMap = _module.dependencyMap;\n  try {\n    var _moduleObject = { exports: exports };\n\n    factory(global, require, _moduleObject, exports, dependencyMap);\n\n    module.factory = undefined;\n\n    return (module.exports = _moduleObject.exports);\n  } catch (e) {\n    module.hasError = true;\n    module.isInitialized = false;\n    module.exports = undefined;\n    throw e;\n  }\n}\n\nfunction unknownModuleError(id) {\n  var message = 'Requiring unknown module \"' + id + '\".';\n  return Error(message);\n}\n\nfunction moduleThrewError(id) {\n  return Error('Requiring module \"' + id + '\", which threw an exception.');\n}\n\n// === End require code ===\n\ndefine(function(global, require, module, exports) {\n  module.exports = { foo: \" hello \" };\n}, 0, null);\n\ndefine(function(global, require, module, exports) {\n  var x = require(0);\n  var y = require(2);\n  module.exports = {\n    bar: \" goodbye\",\n    foo2: x.foo,\n    baz: y.baz,\n  };\n}, 1, null);\n\ndefine(function(global, require, module, exports) {\n  module.exports = { baz: \" foo \" };\n}, 2, null);\n\nvar x = require(0);\n\nfunction f() {\n  return x.foo === \" hello \" && modules[1].exports === undefined && require(1).bar === \" goodbye\";\n}\n\ninspect = function() {\n  // the require( 0) should be entirely eliminated from 1's factory function\n  // but the require(2) will remain\n  return f();\n};\n"
  },
  {
    "path": "test/serializer/optimizations/require_opt_with_dependencies.js",
    "content": "// es6\n// does not contain:require(dependencies[0])\n\nvar modules = Object.create(null);\n\n__d = define;\nfunction require(moduleId) {\n  var moduleIdReallyIsNumber = moduleId;\n  var module = modules[moduleIdReallyIsNumber];\n  return module && module.isInitialized ? module.exports : guardedLoadModule(moduleIdReallyIsNumber, module);\n}\n\nfunction define(factory, moduleId, dependencyMap) {\n  if (moduleId in modules) {\n    return;\n  }\n  modules[moduleId] = {\n    dependencyMap: dependencyMap,\n    exports: undefined,\n    factory: factory,\n    hasError: false,\n    isInitialized: false,\n  };\n\n  var _verboseName = arguments[3];\n  if (_verboseName) {\n    modules[moduleId].verboseName = _verboseName;\n    global.verboseNamesToModuleIds[_verboseName] = moduleId;\n  }\n}\n\nvar inGuard = false;\nfunction guardedLoadModule(moduleId, module) {\n  if (!inGuard && global.ErrorUtils) {\n    inGuard = true;\n    var returnValue = void 0;\n    try {\n      returnValue = loadModuleImplementation(moduleId, module);\n    } catch (e) {\n      global.ErrorUtils.reportFatalError(e);\n    }\n    inGuard = false;\n    return returnValue;\n  } else {\n    return loadModuleImplementation(moduleId, module);\n  }\n}\n\nfunction loadModuleImplementation(moduleId, module) {\n  var nativeRequire = global.nativeRequire;\n  if (!module && nativeRequire) {\n    nativeRequire(moduleId);\n    module = modules[moduleId];\n  }\n\n  if (!module) {\n    throw unknownModuleError(moduleId);\n  }\n\n  if (module.hasError) {\n    throw moduleThrewError(moduleId);\n  }\n\n  module.isInitialized = true;\n  var exports = (module.exports = {});\n  var _module = module,\n    factory = _module.factory,\n    dependencyMap = _module.dependencyMap;\n  try {\n    var _moduleObject = { exports: exports };\n\n    factory(global, require, _moduleObject, exports, dependencyMap);\n\n    module.factory = undefined;\n\n    return (module.exports = _moduleObject.exports);\n  } catch (e) {\n    module.hasError = true;\n    module.isInitialized = false;\n    module.exports = undefined;\n    throw e;\n  }\n}\n\nfunction unknownModuleError(id) {\n  var message = 'Requiring unknown module \"' + id + '\".';\n  return Error(message);\n}\n\nfunction moduleThrewError(id) {\n  return Error('Requiring module \"' + id + '\", which threw an exception.');\n}\n\n// === End require code ===\n\ndefine(function(global, require, module, exports) {\n  module.exports = { foo: \" hello \" };\n}, 0, null);\n\ndefine(function(global, require, module, exports, dependencies) {\n  var x = require(dependencies[0]);\n  var y = require(dependencies[1]);\n  module.exports = {\n    bar: \" goodbye\",\n    foo2: x.foo,\n    baz: y.baz,\n  };\n}, 1, [0, 2]);\n\ndefine(function(global, require, module, exports) {\n  module.exports = { baz: \" foo \" };\n}, 2, null);\n\nvar x = require(0);\n\nfunction f() {\n  return x.foo === \" hello \" && modules[1].exports === undefined && require(1).bar === \" goodbye\";\n}\n\ninspect = function() {\n  // the require(dependencies[ 0]) should be entirely eliminated from 1's factory function\n  // but the require(dependencies[1]) will remain\n  return f();\n};\n"
  },
  {
    "path": "test/serializer/optimizations/require_removefactoryfunctions.js",
    "content": "// es6\n// removeModuleFactoryFunctions\n// does not contain:require(0)\n// does not contain:magic-string-1\n// does contain:magic-string-2\nvar modules = Object.create(null);\n\n__d = define;\nfunction require(moduleId) {\n  var moduleIdReallyIsNumber = moduleId;\n  var module = modules[moduleIdReallyIsNumber];\n  return module && module.isInitialized ? module.exports : guardedLoadModule(moduleIdReallyIsNumber, module);\n}\n\nfunction define(factory, moduleId, dependencyMap) {\n  if (moduleId in modules) {\n    return;\n  }\n  modules[moduleId] = {\n    dependencyMap: dependencyMap,\n    exports: undefined,\n    factory: factory,\n    hasError: false,\n    isInitialized: false,\n  };\n\n  var _verboseName = arguments[3];\n  if (_verboseName) {\n    modules[moduleId].verboseName = _verboseName;\n    global.verboseNamesToModuleIds[_verboseName] = moduleId;\n  }\n}\n\nvar inGuard = false;\nfunction guardedLoadModule(moduleId, module) {\n  if (!inGuard && global.ErrorUtils) {\n    inGuard = true;\n    var returnValue = void 0;\n    try {\n      returnValue = loadModuleImplementation(moduleId, module);\n    } catch (e) {\n      global.ErrorUtils.reportFatalError(e);\n    }\n    inGuard = false;\n    return returnValue;\n  } else {\n    return loadModuleImplementation(moduleId, module);\n  }\n}\n\nfunction loadModuleImplementation(moduleId, module) {\n  var nativeRequire = global.nativeRequire;\n  if (!module && nativeRequire) {\n    nativeRequire(moduleId);\n    module = modules[moduleId];\n  }\n\n  if (!module) {\n    throw unknownModuleError(moduleId);\n  }\n\n  if (module.hasError) {\n    throw moduleThrewError(moduleId);\n  }\n\n  module.isInitialized = true;\n  var exports = (module.exports = {});\n  var _module = module,\n    factory = _module.factory,\n    dependencyMap = _module.dependencyMap;\n  try {\n    var _moduleObject = { exports: exports };\n\n    factory(global, require, _moduleObject, exports, dependencyMap);\n\n    module.factory = undefined;\n\n    return (module.exports = _moduleObject.exports);\n  } catch (e) {\n    module.hasError = true;\n    module.isInitialized = false;\n    module.exports = undefined;\n    throw e;\n  }\n}\n\nfunction unknownModuleError(id) {\n  var message = 'Requiring unknown module \"' + id + '\".';\n  return Error(message);\n}\n\nfunction moduleThrewError(id) {\n  return Error('Requiring module \"' + id + '\", which threw an exception.');\n}\n\n// === End require code ===\n\nfunction defineModules() {\n  define(function(global, require, module, exports) {\n    let z = \"magic-string-1\";\n    module.exports = { foo: \" hello \" };\n  }, 0, null);\n\n  define(function(global, require, module, exports) {\n    var x = require(0);\n    var y = require(2);\n    let z = \"magic-string-2\";\n    module.exports = {\n      bar: \" goodbye\",\n      foo2: x.foo,\n      baz: y.baz,\n    };\n  }, 1, null);\n\n  define(function(global, require, module, exports) {\n    module.exports = { baz: \" foo \" };\n  }, 2, null);\n}\n\ndefineModules();\n\nvar x = require(0);\n\nfunction f() {\n  return x.foo === \" hello \" && modules[1].exports === undefined && require(1).bar === \" goodbye\";\n}\n\ninspect = function() {\n  // the require( 0) should be entirely eliminated from 1's factory function\n  // but the require(2) will remain\n  return f();\n};\n"
  },
  {
    "path": "test/serializer/optimizations/require_spec_accelerate_delay.js",
    "content": "// es6\n// initialize more modules\n\nvar modules = Object.create(null);\n\n__d = define;\nfunction require(moduleId) {\n  var moduleIdReallyIsNumber = moduleId;\n  var module = modules[moduleIdReallyIsNumber];\n  return module && module.isInitialized ? module.exports : guardedLoadModule(moduleIdReallyIsNumber, module);\n}\n\nfunction define(factory, moduleId, dependencyMap) {\n  if (moduleId in modules) {\n    return;\n  }\n  modules[moduleId] = {\n    dependencyMap: dependencyMap,\n    exports: undefined,\n    factory: factory,\n    hasError: false,\n    isInitialized: false,\n  };\n\n  var _verboseName = arguments[3];\n  if (_verboseName) {\n    modules[moduleId].verboseName = _verboseName;\n    global.verboseNamesToModuleIds[_verboseName] = moduleId;\n  }\n}\n\nvar inGuard = false;\nfunction guardedLoadModule(moduleId, module) {\n  if (!inGuard && global.ErrorUtils) {\n    inGuard = true;\n    var returnValue = void 0;\n    try {\n      returnValue = loadModuleImplementation(moduleId, module);\n    } catch (e) {\n      global.ErrorUtils.reportFatalError(e);\n    }\n    inGuard = false;\n    return returnValue;\n  } else {\n    return loadModuleImplementation(moduleId, module);\n  }\n}\n\nfunction loadModuleImplementation(moduleId, module) {\n  var nativeRequire = global.nativeRequire;\n  if (!module && nativeRequire) {\n    nativeRequire(moduleId);\n    module = modules[moduleId];\n  }\n\n  if (!module) {\n    throw unknownModuleError(moduleId);\n  }\n\n  if (module.hasError) {\n    throw moduleThrewError(moduleId);\n  }\n\n  module.isInitialized = true;\n  var exports = (module.exports = {});\n  var _module = module,\n    factory = _module.factory,\n    dependencyMap = _module.dependencyMap;\n  try {\n    var _moduleObject = { exports: exports };\n\n    factory(global, require, _moduleObject, exports, dependencyMap);\n\n    module.factory = undefined;\n\n    return (module.exports = _moduleObject.exports);\n  } catch (e) {\n    module.hasError = true;\n    module.isInitialized = false;\n    module.exports = undefined;\n    throw e;\n  }\n}\n\nfunction unknownModuleError(id) {\n  var message = 'Requiring unknown module \"' + id + '\".';\n  return Error(message);\n}\n\nfunction moduleThrewError(id) {\n  return Error('Requiring module \"' + id + '\", which threw an exception.');\n}\n\n// === End require code ===\n\ndefine(function(global, require, module, exports) {\n  var nondet = global.__abstract ? __abstract(\"boolean\", \"true\") : true;\n  if (nondet) {\n    require(1);\n  }\n  module.exports = 1;\n}, 0, null);\n\ndefine(function(global, require, module, exports) {\n  module.exports = 2;\n}, 1, null);\n\ndefine(function(global, require, module, exports) {\n  module.exports = require(3) + 3;\n}, 2, null);\n\ndefine(function(global, require, module, exports) {\n  module.exports = require(4) + require(0) + 4;\n}, 3, null);\n\ndefine(function(global, require, module, exports) {\n  module.exports = 5;\n}, 4, null);\n\nvar x = require(2);\n\ninspect = function() {\n  return x;\n};\n"
  },
  {
    "path": "test/serializer/optimizations/require_speculatively.js",
    "content": "// es6\n// does not contain:r(0)\n// initialize more modules\n\nvar modules = Object.create(null);\n__d = define;\n\nrequire = function(moduleId) {\n  var moduleIdReallyIsNumber = moduleId;\n  var module = modules[moduleIdReallyIsNumber];\n  return module && module.isInitialized ? module.exports : guardedLoadModule(moduleIdReallyIsNumber, module);\n};\n\nfunction define(factory, moduleId, dependencyMap) {\n  if (moduleId in modules) {\n    return;\n  }\n  modules[moduleId] = {\n    dependencyMap: dependencyMap,\n    exports: undefined,\n    factory: factory,\n    hasError: false,\n    isInitialized: false,\n  };\n\n  var _verboseName = arguments[3];\n  if (_verboseName) {\n    modules[moduleId].verboseName = _verboseName;\n    global.verboseNamesToModuleIds[_verboseName] = moduleId;\n  }\n}\n\nvar inGuard = false;\nfunction guardedLoadModule(moduleId, module) {\n  if (!inGuard && global.ErrorUtils) {\n    inGuard = true;\n    var returnValue = void 0;\n    try {\n      returnValue = loadModuleImplementation(moduleId, module);\n    } catch (e) {\n      global.ErrorUtils.reportFatalError(e);\n    }\n    inGuard = false;\n    return returnValue;\n  } else {\n    return loadModuleImplementation(moduleId, module);\n  }\n}\n\nfunction loadModuleImplementation(moduleId, module) {\n  var nativeRequire = global.nativeRequire;\n  if (!module && nativeRequire) {\n    nativeRequire(moduleId);\n    module = modules[moduleId];\n  }\n\n  if (!module) {\n    throw unknownModuleError(moduleId);\n  }\n\n  if (module.hasError) {\n    throw moduleThrewError(moduleId);\n  }\n\n  module.isInitialized = true;\n  var exports = (module.exports = {});\n  var _module = module,\n    factory = _module.factory,\n    dependencyMap = _module.dependencyMap;\n  try {\n    var _moduleObject = { exports: exports };\n\n    factory(global, require, _moduleObject, exports, dependencyMap);\n    module.factory = undefined;\n\n    return (module.exports = _moduleObject.exports);\n  } catch (e) {\n    module.hasError = true;\n    module.isInitialized = false;\n    module.exports = undefined;\n    throw e;\n  }\n}\n\nfunction unknownModuleError(id) {\n  var message = 'Requiring unknown module \"' + id + '\".';\n  return Error(message);\n}\n\nfunction moduleThrewError(id) {\n  return Error('Requiring module \"' + id + '\", which threw an exception.');\n}\n\n// === End require code ===\n\ndefine(function(global, require, module, exports) {\n  module.exports = { foo: \" hello \" };\n}, 0, null);\n\ndefine(function(global, r, module, exports) {\n  module.exports = function() {\n    return r(0);\n  };\n}, 1, null);\n\ninspect = function() {\n  return require(0).foo;\n};\n\nvar verboseNamesToModuleIds = {};\nvar ErrorUtils = undefined;\nvar nativeRequire = undefined;\nif (global.__makePartial) __makePartial(this);\n"
  },
  {
    "path": "test/serializer/optimizations/require_speculatively_specific.js",
    "content": "// es6\n// does not contain:27 + 15\n// does contain:42\n// does contain:3 + 4\n// initialize more modules:0\n\nvar modules = Object.create(null);\n__d = define;\n\nrequire = function(moduleId) {\n  var moduleIdReallyIsNumber = moduleId;\n  var module = modules[moduleIdReallyIsNumber];\n  return module && module.isInitialized ? module.exports : guardedLoadModule(moduleIdReallyIsNumber, module);\n};\n\nfunction define(factory, moduleId, dependencyMap) {\n  if (moduleId in modules) {\n    return;\n  }\n  modules[moduleId] = {\n    dependencyMap: dependencyMap,\n    exports: undefined,\n    factory: factory,\n    hasError: false,\n    isInitialized: false,\n  };\n\n  var _verboseName = arguments[3];\n  if (_verboseName) {\n    modules[moduleId].verboseName = _verboseName;\n    global.verboseNamesToModuleIds[_verboseName] = moduleId;\n  }\n}\n\nvar inGuard = false;\nfunction guardedLoadModule(moduleId, module) {\n  if (!inGuard && global.ErrorUtils) {\n    inGuard = true;\n    var returnValue = void 0;\n    try {\n      returnValue = loadModuleImplementation(moduleId, module);\n    } catch (e) {\n      global.ErrorUtils.reportFatalError(e);\n    }\n    inGuard = false;\n    return returnValue;\n  } else {\n    return loadModuleImplementation(moduleId, module);\n  }\n}\n\nfunction loadModuleImplementation(moduleId, module) {\n  var nativeRequire = global.nativeRequire;\n  if (!module && nativeRequire) {\n    nativeRequire(moduleId);\n    module = modules[moduleId];\n  }\n\n  if (!module) {\n    throw unknownModuleError(moduleId);\n  }\n\n  if (module.hasError) {\n    throw moduleThrewError(moduleId);\n  }\n\n  module.isInitialized = true;\n  var exports = (module.exports = {});\n  var _module = module,\n    factory = _module.factory,\n    dependencyMap = _module.dependencyMap;\n  try {\n    var _moduleObject = { exports: exports };\n\n    factory(global, require, _moduleObject, exports, dependencyMap);\n    module.factory = undefined;\n\n    return (module.exports = _moduleObject.exports);\n  } catch (e) {\n    module.hasError = true;\n    module.isInitialized = false;\n    module.exports = undefined;\n    throw e;\n  }\n}\n\nfunction unknownModuleError(id) {\n  var message = 'Requiring unknown module \"' + id + '\".';\n  return Error(message);\n}\n\nfunction moduleThrewError(id) {\n  return Error('Requiring module \"' + id + '\", which threw an exception.');\n}\n\n// === End require code ===\n\ndefine(function(global, require, module, exports) {\n  module.exports = { foo: 27 + 15 };\n}, 0, null);\n\ndefine(function(global, r, module, exports) {\n  let useless = 3 + 4;\n  module.exports = function() {\n    return r(0);\n  };\n}, 1, null);\n\ninspect = function() {\n  return require(0).foo;\n};\n\nvar verboseNamesToModuleIds = {};\nvar ErrorUtils = undefined;\nvar nativeRequire = undefined;\nif (global.__makePartial) __makePartial(this);\n"
  },
  {
    "path": "test/serializer/optimizations/require_throws.js",
    "content": "let b = global.__abstract ? global.__abstract(\"boolean\", \"true\") : true;\n\nvar modules = Object.create(null);\n\n__d = define;\nfunction require(moduleId) {\n  var moduleIdReallyIsNumber = moduleId;\n  var module = modules[moduleIdReallyIsNumber];\n  return module && module.isInitialized ? module.exports : guardedLoadModule(moduleIdReallyIsNumber, module);\n}\n\nfunction define(factory, moduleId, dependencyMap) {\n  if (moduleId in modules) {\n    return;\n  }\n  modules[moduleId] = {\n    dependencyMap: dependencyMap,\n    exports: undefined,\n    factory: factory,\n    hasError: false,\n    isInitialized: false,\n  };\n\n  var _verboseName = arguments[3];\n  if (_verboseName) {\n    modules[moduleId].verboseName = _verboseName;\n    global.verboseNamesToModuleIds[_verboseName] = moduleId;\n  }\n}\n\nvar inGuard = false;\nfunction guardedLoadModule(moduleId, module) {\n  if (!inGuard && global.ErrorUtils) {\n    inGuard = true;\n    var returnValue = void 0;\n    try {\n      returnValue = loadModuleImplementation(moduleId, module);\n    } catch (e) {\n      global.ErrorUtils.reportFatalError(e);\n    }\n    inGuard = false;\n    return returnValue;\n  } else {\n    return loadModuleImplementation(moduleId, module);\n  }\n}\n\nfunction loadModuleImplementation(moduleId, module) {\n  var nativeRequire = global.nativeRequire;\n  if (!module && nativeRequire) {\n    nativeRequire(moduleId);\n    module = modules[moduleId];\n  }\n\n  if (!module) {\n    throw unknownModuleError(moduleId);\n  }\n\n  if (module.hasError) {\n    throw moduleThrewError(moduleId);\n  }\n\n  module.isInitialized = true;\n  var exports = (module.exports = {});\n  var _module = module,\n    factory = _module.factory,\n    dependencyMap = _module.dependencyMap;\n  try {\n    var _moduleObject = { exports: exports };\n\n    factory(global, require, _moduleObject, exports, dependencyMap);\n\n    module.factory = undefined;\n\n    return (module.exports = _moduleObject.exports);\n  } catch (e) {\n    module.hasError = true;\n    module.isInitialized = false;\n    module.exports = undefined;\n    throw e;\n  }\n}\n\nfunction unknownModuleError(id) {\n  var message = 'Requiring unknown module \"' + id + '\".';\n  return Error(message);\n}\n\nfunction moduleThrewError(id) {\n  return Error('Requiring module \"' + id + '\", which threw an exception.');\n}\n\n// === End require code ===\n\ndefine(function(global, require, module, exports) {\n  var obj = global.__abstract\n    ? global.__makeSimple(global.__abstract({ unsupported: true }, \"({unsupported: true})\"))\n    : { unsupported: true };\n  if (obj.unsupported) {\n    exports.magic = 42;\n  } else {\n    exports.magic = 23;\n  }\n  if (!b) throw \"something bad\";\n  exports.notmagic = 666;\n}, 0, null);\n\ndefine(function(global, require, module, exports) {\n  var x = require(0);\n  module.exports = function() {\n    return x.notmagic;\n  };\n}, 1, null);\n\nvar f = require(1);\n\ninspect = function() {\n  return f().magic;\n};\n"
  },
  {
    "path": "test/serializer/optimizations/require_throws1.js",
    "content": "let b = global.__abstract ? __abstract(\"boolean\", \"true\") : true;\n\nvar modules = Object.create(null);\n\n__d = define;\nfunction require(moduleId) {\n  var moduleIdReallyIsNumber = moduleId;\n  var module = modules[moduleIdReallyIsNumber];\n  return module && module.isInitialized ? module.exports : guardedLoadModule(moduleIdReallyIsNumber, module);\n}\n\nfunction define(factory, moduleId, dependencyMap) {\n  if (moduleId in modules) {\n    return;\n  }\n  modules[moduleId] = {\n    dependencyMap: dependencyMap,\n    exports: undefined,\n    factory: factory,\n    hasError: false,\n    isInitialized: false,\n  };\n\n  var _verboseName = arguments[3];\n  if (_verboseName) {\n    modules[moduleId].verboseName = _verboseName;\n    global.verboseNamesToModuleIds[_verboseName] = moduleId;\n  }\n}\n\nvar inGuard = false;\nfunction guardedLoadModule(moduleId, module) {\n  if (!inGuard && global.ErrorUtils) {\n    inGuard = true;\n    var returnValue = void 0;\n    try {\n      returnValue = loadModuleImplementation(moduleId, module);\n    } catch (e) {\n      global.ErrorUtils.reportFatalError(e);\n    }\n    inGuard = false;\n    return returnValue;\n  } else {\n    return loadModuleImplementation(moduleId, module);\n  }\n}\n\nfunction loadModuleImplementation(moduleId, module) {\n  var nativeRequire = global.nativeRequire;\n  if (!module && nativeRequire) {\n    nativeRequire(moduleId);\n    module = modules[moduleId];\n  }\n\n  if (!module) {\n    throw unknownModuleError(moduleId);\n  }\n\n  if (module.hasError) {\n    throw moduleThrewError(moduleId);\n  }\n\n  module.isInitialized = true;\n  var exports = (module.exports = {});\n  var _module = module,\n    factory = _module.factory,\n    dependencyMap = _module.dependencyMap;\n  try {\n    var _moduleObject = { exports: exports };\n\n    factory(global, require, _moduleObject, exports, dependencyMap);\n\n    module.factory = undefined;\n\n    return (module.exports = _moduleObject.exports);\n  } catch (e) {\n    module.hasError = true;\n    module.isInitialized = false;\n    module.exports = undefined;\n    throw e;\n  }\n}\n\nfunction unknownModuleError(id) {\n  var message = 'Requiring unknown module \"' + id + '\".';\n  return Error(message);\n}\n\nfunction moduleThrewError(id) {\n  return Error('Requiring module \"' + id + '\", which threw an exception.');\n}\n\n// === End require code ===\n\ndefine(function(global, require, module, exports) {\n  throw new Error('Requiring module \"0\", which threw an exception.');\n}, 0, null);\n\ndefine(function(global, require, module, exports) {\n  var x = require(0);\n  module.exports = function() {\n    return x.notmagic;\n  };\n}, 1, null);\n\nvar f = require(1);\n\ninspect = function() {\n  return f();\n};\n"
  },
  {
    "path": "test/serializer/optimizations/require_unsupported.js",
    "content": "// throws introspection error\n\nvar modules = Object.create(null);\n\n__d = define;\nfunction require(moduleId) {\n  var moduleIdReallyIsNumber = moduleId;\n  var module = modules[moduleIdReallyIsNumber];\n  return module && module.isInitialized ? module.exports : guardedLoadModule(moduleIdReallyIsNumber, module);\n}\n\nfunction define(factory, moduleId, dependencyMap) {\n  if (moduleId in modules) {\n    return;\n  }\n  modules[moduleId] = {\n    dependencyMap: dependencyMap,\n    exports: undefined,\n    factory: factory,\n    hasError: false,\n    isInitialized: false,\n  };\n\n  var _verboseName = arguments[3];\n  if (_verboseName) {\n    modules[moduleId].verboseName = _verboseName;\n    global.verboseNamesToModuleIds[_verboseName] = moduleId;\n  }\n}\n\nvar inGuard = false;\nfunction guardedLoadModule(moduleId, module) {\n  if (!inGuard && global.ErrorUtils) {\n    inGuard = true;\n    var returnValue = void 0;\n    try {\n      returnValue = loadModuleImplementation(moduleId, module);\n    } catch (e) {\n      global.ErrorUtils.reportFatalError(e);\n    }\n    inGuard = false;\n    return returnValue;\n  } else {\n    return loadModuleImplementation(moduleId, module);\n  }\n}\n\nfunction loadModuleImplementation(moduleId, module) {\n  var nativeRequire = global.nativeRequire;\n  if (!module && nativeRequire) {\n    nativeRequire(moduleId);\n    module = modules[moduleId];\n  }\n\n  if (!module) {\n    throw unknownModuleError(moduleId);\n  }\n\n  if (module.hasError) {\n    throw moduleThrewError(moduleId);\n  }\n\n  module.isInitialized = true;\n  var exports = (module.exports = {});\n  var _module = module,\n    factory = _module.factory,\n    dependencyMap = _module.dependencyMap;\n  try {\n    var _moduleObject = { exports: exports };\n\n    factory(global, require, _moduleObject, exports, dependencyMap);\n\n    module.factory = undefined;\n\n    return (module.exports = _moduleObject.exports);\n  } catch (e) {\n    module.hasError = true;\n    module.isInitialized = false;\n    module.exports = undefined;\n    throw e;\n  }\n}\n\nfunction unknownModuleError(id) {\n  var message = 'Requiring unknown module \"' + id + '\".';\n  return Error(message);\n}\n\nfunction moduleThrewError(id) {\n  return Error('Requiring module \"' + id + '\", which threw an exception.');\n}\n\n// === End require code ===\n\ndefine(function(global, require, module, exports) {\n  if (__abstract({}, \"({})\").unsupported) {\n  }\n}, 0, null);\n\ndefine(function(global, require, module, exports) {\n  module.exports = require(0);\n}, 1, null);\n\nrequire(1);\n"
  },
  {
    "path": "test/serializer/optimizations/residualDeadCode.js",
    "content": "// does not contain:eliminate\n// contains:preserve\n// contains:do\n(function() {\n  let f = false;\n  let t = true;\n\n  global.inspect = function() {\n    if (f) {\n      console.log(\"eliminate me\");\n    }\n    if (f) {\n      console.log(\"eliminate me\");\n    } else {\n      console.log(\"preserve\");\n    }\n    if (t) {\n    } else {\n      console.log(\"eliminate me\");\n    }\n\n    f ? console.log(\"eliminate me\") : null;\n    t ? null : console.log(\"eliminate me\");\n\n    f && console.log(\"eliminate me\");\n    t || console.log(\"eliminate me\");\n\n    while (f) console.log(\"eliminate me\");\n    do {\n      break;\n    } while (f);\n\n    0 ? console.log(\"eliminate me\") : null;\n    1 ? null : console.log(\"eliminate me\");\n    \"\" ? console.log(\"eliminate me\") : null;\n    \" \" ? null : console.log(\"eliminate me\");\n    (function() {} ? null : console.log(\"eliminate me\"));\n    (() => {}) ? null : console.log(\"eliminate me\");\n    /a/ ? null : console.log(\"eliminate me\");\n    (class {} ? null : console.log(\"eliminate me\"));\n    ({} ? null : console.log(\"eliminate me\"));\n    [] ? null : console.log(\"eliminate me\");\n    null ? console.log(\"eliminate me\") : null;\n\n    return 42;\n  };\n})();\n"
  },
  {
    "path": "test/serializer/optimizations/simplify.js",
    "content": "let b = global.__abstract ? __abstract(\"boolean\", \"true\") : true;\nlet ob1 = b ? { foo: 42 } : undefined;\nlet ob2 = b ? { foo: 24 } : null;\n\nvar x = \"no can do\";\nvar y;\nif (ob1 == null || undefined == ob2) x = \"no can do\";\nelse {\n  x = ob1.foo;\n  y = ob2.foo;\n}\nif (ob1 != null) {\n  x = ob1.foo;\n}\nif (null == ob1) {\n  x = \"no can do\";\n}\n\ninspect = function() {\n  return x + \" \" + y;\n};\n"
  },
  {
    "path": "test/serializer/optimizations/simplify10.js",
    "content": "// add at runtime:var c=true;\nlet c = global.__abstract ? __abstract(\"boolean\", \"c\") : true;\nlet s = NaN;\nlet u = c ? s : 42;\nlet v = c ? 43 : s;\n\ninspect = function() {\n  return u + \" \" + v;\n};\n"
  },
  {
    "path": "test/serializer/optimizations/simplify11.js",
    "content": "(function() {\n  function fn(arg) {\n    return arg == null ? \"a\" : arg && \"b\";\n  }\n\n  if (global.__optimize) __optimize(fn);\n\n  global.inspect = function() {\n    return JSON.stringify([fn(null), fn(undefined), fn({})]);\n  };\n})();\n"
  },
  {
    "path": "test/serializer/optimizations/simplify12.js",
    "content": "// does not contain:{}\nlet x = global.__abstract ? __abstract(\"boolean\", \"(1 === 1)\") : true;\nlet y = global.__abstract ? __abstract(\"boolean\", \"(2 === 2)\") : true;\nlet a = x ? null : {};\nlet b = y ? null : a;\nvar c = b === null;\nlet a1 = x ? undefined : {};\nlet b1 = y ? undefined : a1;\nvar c1 = b1 === undefined;\nlet a2 = x ? undefined : {};\nlet b2 = y ? null : a2;\nvar c2 = b2 == undefined;\nvar c3 = b2 == null;\n\ninspect = function() {\n  return [c, c1, c2, c3].join(\" \");\n};\n"
  },
  {
    "path": "test/serializer/optimizations/simplify2.js",
    "content": "let b = global.__abstract ? __abstract(\"boolean\", \"false\") : false;\nlet ob1 = b ? undefined : { foo: 42 };\nlet ob2 = b ? null : { foo: 24 };\n\nvar x, y;\nif (undefined === ob1 || ob2 === null) x = \"no can do\";\nelse {\n  x = ob1.foo;\n  y = ob2.foo;\n}\n\ninspect = function() {\n  return x + \" \" + y;\n};\n"
  },
  {
    "path": "test/serializer/optimizations/simplify3.js",
    "content": "let b = global.__abstract ? __abstract(\"boolean\", \"false\") : false;\nlet ob1 = b ? undefined : { foo: 42 };\nlet ob1a = !b ? { foo: 422 } : undefined;\nlet ob2 = b ? null : { foo: 24 };\nlet ob2a = !b ? { foo: 244 } : null;\nlet ob3 = b ? ob1 : ob2;\n\nvar x, y;\nx = \"no can do\";\nif (undefined != ob1) {\n  x = ob1.foo;\n}\nif (undefined != ob1a) {\n  x = ob1a.foo;\n}\nif (ob1a == undefined) {\n  x = \"no can do\";\n}\ny = \"no can do\";\nif (ob2 != null) {\n  y = ob2.foo;\n}\nif (ob2a != null) {\n  y = ob2a.foo;\n}\nif (ob2a == null) {\n  y = \"no can do\";\n}\nif (ob3 != null) {\n  y = \"no can do\";\n}\n\ninspect = function() {\n  return x + \" \" + y;\n};\n"
  },
  {
    "path": "test/serializer/optimizations/simplify4.js",
    "content": "let b = global.__abstract ? __abstract(\"boolean\", \"false\") : false;\nlet ob1 = b ? undefined : { foo: 42 };\nlet ob1a = !b ? { foo: 422 } : undefined;\nlet ob2 = b ? null : { foo: 24 };\nlet ob2a = !b ? { foo: 244 } : null;\nlet ob3 = b ? ob1 : ob2;\n\nvar x, y;\nx = \"no can do\";\nif (undefined !== ob1) {\n  x = ob1.foo;\n}\nif (undefined !== ob1a) {\n  x = ob1a.foo;\n}\nif (ob1a === undefined) {\n  x = \"no can do\";\n}\ny = \"no can do\";\nif (ob2 !== null) {\n  y = ob2.foo;\n}\nif (ob2a !== null) {\n  y = ob2a.foo;\n}\nif (ob2a === null) {\n  y = \"no can do\";\n}\nif (ob3 !== null) {\n  y = \"no can do\";\n}\n\ninspect = function() {\n  return x + \" \" + y;\n};\n"
  },
  {
    "path": "test/serializer/optimizations/simplify5.js",
    "content": "let n = global.__abstract ? __abstract(\"number\", \"1\") : 1;\nlet o = global.__abstract ? __abstract(\"object\", \"({})\") : {};\nlet opt = n ? o : undefined;\n\nvar x, y, z;\nx = !!n;\ny = opt !== undefined;\n\nif (!!n) {\n  z = n ? 10 : 20;\n}\n\ninspect = function() {\n  return \"\" + x + \" \" + y + \" \" + z;\n};\n"
  },
  {
    "path": "test/serializer/optimizations/simplify6.js",
    "content": "// does not contain: {}\nlet x = global.abstract ? __abstract(undefined, \"5\") : 5;\nlet xIsNull = x == null;\nlet y = xIsNull ? null : {};\nif (y) global.result = true;\n\ninspect = function() {\n  return global.result;\n};\n"
  },
  {
    "path": "test/serializer/optimizations/simplify7.js",
    "content": "// does not contain: \"no\"\nlet s = global.__abstract ? __abstract(\"string\", \"('s')\") : \"s\";\n\nvar y, z;\nif (s ? \"t\" : \"\") {\n  y = s ? \"yes\" : \"no\";\n}\n\ninspect = function() {\n  return y + \" \" + z;\n};\n"
  },
  {
    "path": "test/serializer/optimizations/simplify8.js",
    "content": "// does not contain: bar\nlet a = global.__abstractOrNull ? __abstractOrNull(\"object\", \"({ foo: 0 })\") : {};\nlet b = a == null;\nlet c = !b;\nlet ob = b ? null : { bar: 1 };\nlet obstr = c ? \"str\" : ob;\n\ninspect = function() {\n  return obstr;\n};\n"
  },
  {
    "path": "test/serializer/optimizations/simplify8a.js",
    "content": "// does not contain: bar\nlet a = global.__abstractOrNull ? __abstractOrNull(\"object\", \"({ foo: 0 })\") : {};\nlet b = a == null;\nlet c = !b;\nlet ob = b ? null : { bar: 1 };\nlet obstr = ob ? \"ob\" : \"str\";\n\ninspect = function() {\n  return obstr;\n};\n"
  },
  {
    "path": "test/serializer/optimizations/simplify8b.js",
    "content": "// does not contain: bar\nlet a = global.__abstract ? __abstract(\"boolean\", \"(true)\") : true;\nlet ob = a ? null : { bar: 1 };\nlet nob = !ob && \"not an object\";\n\ninspect = function() {\n  return nob;\n};\n"
  },
  {
    "path": "test/serializer/optimizations/simplify8c.js",
    "content": "// does not contain: bar\nlet _$G_derived = global.__abstractOrNull ? __abstractOrNull(\"object\", \"({ foo: 0 })\") : {};\nlet _$H_derived = global.__abstractOrNull ? __abstractOrNull(\"object\", \"({ foo: 1 })\") : {};\nlet _$I_derived = global.__abstractOrNull ? __abstractOrNull(\"object\", \"({ foo: 2 })\") : {};\nlet _$J_derived = global.__abstractOrNull ? __abstractOrNull(\"object\", \"({ foo: 3 })\") : {};\nlet _$K_derived = global.__abstractOrNull ? __abstractOrNull(\"object\", \"({ foo: 4 })\") : {};\n\nlet _1Ex_ = _$G_derived != null;\n\nlet _1F0_ = _$H_derived != null;\n\nlet _1F3_ = _$I_derived != null;\n\nlet _1F6_ = _$J_derived != null;\n\nlet _1FD_ = _1F6_ ? _$K_derived : _$J_derived;\n\nlet _1FC_ = _1F3_ ? _1FD_ : _$I_derived;\n\nlet _1FB_ = _1F0_ ? _1FC_ : _$H_derived;\n\nlet _1FA_item = _1Ex_ ? _1FB_ : _$G_derived;\n\nlet _1F9_ = !_1FA_item;\n\nlet _1FW_ = {\n  bar: 1,\n};\n\nlet _1FV_rendered = _1F9_ ? null : _1FW_;\n\nlet _1FU_ = !_1FV_rendered;\n\nif (!_1FU_) {\n  var x = 123;\n}\nif (_1FU_) {\n  var x = 456;\n}\n\ninspect = function() {\n  return x;\n};\n"
  },
  {
    "path": "test/serializer/optimizations/simplify9.js",
    "content": "let ob = global.__abstract ? __makeSimple(__abstract(\"object\", \"({a: 1})\")) : { a: 1 };\nlet a = ob.a;\n\nlet _1aw_ = !a;\n\nlet _1bx_ = _1aw_ ? null : ob;\n\nlet _1bw_ = !_1bx_;\n\nif (!_1bw_) {\n  var y = _1bw_ ? 123 : 456;\n}\n\ninspect = function() {\n  return y;\n};\n"
  },
  {
    "path": "test/serializer/optimizations/simplifyCompNullOrUndefined.js",
    "content": "let x = global.__abstract ? __abstract(undefined, \"undefined\") : undefined;\n\nif (x == null) global.result = x === null;\n\ninspect = () => global.result;\n"
  },
  {
    "path": "test/serializer/optimizations/simplifyCompNullOrUndefined2.js",
    "content": "// does contain result = false\n\nlet x = global.__abstract ? __abstract(undefined, \"undefined\") : undefined;\n\nif (x != null) global.result = x === undefined;\n\ninspect = () => global.result;\n"
  },
  {
    "path": "test/serializer/optimizations/simplifyCompNullOrUndefined3.js",
    "content": "function f(obj) {\n  let y = obj.foo;\n  if (y == null) {\n    return y === undefined;\n  }\n}\nglobal.__optimize && __optimize(f);\ninspect = () => f({ foo: null });\n"
  },
  {
    "path": "test/serializer/optimizations/simplifyEqNull.js",
    "content": "// does not contain: ==\nfunction abstract(t, n) {\n  if (global.__abstract) return __abstract(t, n);\n  return eval(n);\n}\nvar n = abstract(\"number\", \"1\");\nvar numberIsNull = n == null;\nvar b = abstract(\"boolean\", \"false\");\nvar booleanIsNull = b == null;\nvar s = abstract(\"string\", \"'foo'\");\nvar stringIsNull = s == null;\nvar o = abstract(\"object\", \"({})\");\nvar objectIsNull = o == null;\n\ninspect = function() {\n  return [numberIsNull, booleanIsNull, stringIsNull, objectIsNull].join(\" \");\n};\n"
  },
  {
    "path": "test/serializer/optimizations/simplifyEqUndefined.js",
    "content": "// does not contain: ==\nfunction abstract(t, n) {\n  if (global.__abstract) return __abstract(t, n);\n  return eval(n);\n}\nvar n = abstract(\"number\", \"1\");\nvar numberIsUndefined = n == undefined;\nvar b = abstract(\"boolean\", \"false\");\nvar booleanIsUndefined = b == undefined;\nvar s = abstract(\"string\", \"'foo'\");\nvar stringIsUndefined = s == undefined;\nvar o = abstract(\"object\", \"({})\");\nvar stringIsUndefined = o == undefined;\n\ninspect = function() {\n  return [numberIsUndefined, booleanIsUndefined, stringIsUndefined, stringIsUndefined].join(\" \");\n};\n"
  },
  {
    "path": "test/serializer/optimizations/simplifyMultipleIfs1.js",
    "content": "// omit invariants\n// Copies of if \\(:2\nvar x = global.__abstract ? __abstract(\"boolean\", \"x\") : \"x\";\n\nif (x) {\n  console.log(\"Hello\");\n}\n\nif (x) {\n  console.log(\" World\");\n}\n\nif (x) {\n  console.log(\"!\");\n}\n\nif (!x) {\n  console.log(\"Hello World!\");\n}\n"
  },
  {
    "path": "test/serializer/optimizations/simplifyMultipleIfs2.js",
    "content": "// omit invariants\n// Copies of if \\(:2\nvar x = global.__abstract ? __abstract(\"boolean\", \"x\") : \"x\";\nvar y = global.__abstract ? __abstract(\"boolean\", \"y\") : \"y\";\n\nif (x) {\n  console.log(\"Hello World!\");\n}\n\nif (x && y) {\n  console.log(\"Hello\");\n}\n\nif (x && y) {\n  console.log(\" World!\");\n}\n"
  },
  {
    "path": "test/serializer/optimizations/simplifyStrictEq.js",
    "content": "// does not contain: ===\nfunction abstract(t, n) {\n  if (global.__abstract) return __abstract(t, n);\n  return eval(n);\n}\nvar n = abstract(\"number\", \"1\");\nvar numberIsNull = n === null;\nvar b = abstract(\"boolean\", \"false\");\nvar booleanIsNull = n === null;\nvar s = abstract(\"string\", \"'foo'\");\nvar stringIsNull = n === null;\nvar o = abstract(\"object\", \"({})\");\nvar objectIsNull = o === null;\nvar stringIsNumber = n === s;\nvar stringIsUndefined = s === undefined;\n\ninspect = function() {\n  return [numberIsNull, booleanIsNull, stringIsNull, objectIsNull, stringIsNumber, stringIsUndefined].join(\" \");\n};\n"
  },
  {
    "path": "test/serializer/optimized-functions/2248-repro.js",
    "content": "function fn(str, start) {\n  var size = str.length;\n  var posA = 0;\n  if (start > 0) {\n    for (; start > 0 && posA < size; start--) {\n      posA += 1 + str.charCodeAt(posA);\n    }\n    if (posA >= size) {\n      return posA;\n    }\n  }\n}\n\nif (global.__optimize) __optimize(fn);\n\nglobal.inspect = function() {\n  let res1 = fn(\"abcdef\", 1);\n  return res1;\n};\n"
  },
  {
    "path": "test/serializer/optimized-functions/AbstractDate.js",
    "content": "(function() {\n  function f(x) {\n    return new Date(x).getUTCDay();\n  }\n\n  global.__optimize && __optimize(f);\n\n  global.inspect = function() {\n    return f(1529579851072000);\n  };\n})();\n"
  },
  {
    "path": "test/serializer/optimized-functions/ArgumentProperty.js",
    "content": "function fn(arg) {\n  if (arg !== null) {\n    if (arg.foo) {\n      return 42;\n    }\n  }\n}\n\nif (global.__optimize) {\n  __optimize(fn);\n}\n\ninspect = function() {\n  return JSON.stringify([fn(null), fn({}), fn({ foo: true })]);\n};\n"
  },
  {
    "path": "test/serializer/optimized-functions/ArrayAccess.js",
    "content": "// does not contain:\"0\"\n// omit invariants\n(function() {\n  function f(x) {\n    return x[0];\n  }\n  global.__optimize && __optimize(f);\n  global.inspect = function() {\n    return f([42]);\n  };\n})();\n"
  },
  {
    "path": "test/serializer/optimized-functions/ArrayFrom.js",
    "content": "function inner(props) {\n  var foo = Array.from(props.foo);\n  var bar = foo.filter(Boolean);\n\n  bar[0];\n\n  if (bar.length === 0) {\n    return null;\n  }\n\n  return 42;\n}\n\nfunction fn(arg) {\n  if (!arg.condition) {\n    return null;\n  }\n  return inner(arg);\n}\n\nif (global.__optimize) __optimize(fn);\n\ninspect = function() {\n  return JSON.stringify([\n    fn({ condition: false }),\n    fn({ condition: true, foo: [] }),\n    fn({ condition: true, foo: [false] }),\n    fn({ condition: true, foo: [true] }),\n    fn({ condition: true, foo: [false, 5] }),\n    fn({ condition: true, foo: [true, 5] }),\n  ]);\n};\n"
  },
  {
    "path": "test/serializer/optimized-functions/ArrayFrom10.js",
    "content": "// arrayNestedOptimizedFunctionsEnabled\n\nfunction f(c) {\n  var arr = Array.from(c);\n  arr[0] = 42;\n  return arr;\n}\n\nglobal.__optimize && __optimize(f);\n\ninspect = () => {\n  return f([{ foo: 0 }]);\n};\n"
  },
  {
    "path": "test/serializer/optimized-functions/ArrayFrom11.js",
    "content": "function fn(x, y) {\n  var a = Array.from(x);\n  var b = Array.from(x);\n  var c = y ? a : b;\n  return c.length && c[0];\n}\n\nthis.__optimize && __optimize(fn);\n\ninspect = function() {\n  return fn([\"foo\", 1, 2], true);\n};\n"
  },
  {
    "path": "test/serializer/optimized-functions/ArrayFrom2.js",
    "content": "function fn(arg) {\n  if (!arg.condition) {\n    return null;\n  }\n\n  var fooArr = Array.from(arg.foo);\n  return arg.calculate(function() {\n    var x = fooArr;\n\n    return function() {\n      return x;\n    };\n  });\n}\n\nif (global.__optimize) __optimize(fn);\n\ninspect = function() {\n  var x = fn({ condition: false });\n  var y = fn({\n    condition: true,\n    foo: 10,\n    calculate(f) {\n      return f;\n    },\n  });\n  var z = y();\n  var y2 = fn({\n    condition: true,\n    foo: [1, 2, 3],\n    calculate(f) {\n      return f;\n    },\n  });\n  var z2 = y();\n  return JSON.stringify(z, z2);\n};\n"
  },
  {
    "path": "test/serializer/optimized-functions/ArrayFrom3.js",
    "content": "// arrayNestedOptimizedFunctionsEnabled\n\nfunction fn(x, y) {\n  var edges = Array.from(x);\n  var items = edges\n    .map(function(a) {\n      return a;\n    })\n    .filter(Boolean);\n\n  var result = !y ? [] : items.slice(y.startIndex, y.startIndex + y.length);\n\n  result.reverse();\n\n  return result;\n}\n\nthis.__optimize && __optimize(fn);\n\ninspect = function() {\n  return JSON.stringify(fn([1, 2, 3], { startIndex: 0, length: 3 }));\n};\n"
  },
  {
    "path": "test/serializer/optimized-functions/ArrayFrom4.js",
    "content": "function inner(props, x) {\n  var foo = Array.from(props.foo);\n  var bar = foo.filter(Boolean);\n\n  x(bar);\n  bar[0] = 0;\n\n  return bar[0];\n}\n\nfunction fn(arg, x) {\n  if (!arg.condition) {\n    return null;\n  }\n  return inner(arg, x);\n}\n\nif (global.__optimize) __optimize(fn);\n\ninspect = function() {\n  return JSON.stringify([\n    fn({ condition: false }, function(a) {\n      a[0] = 1;\n    }),\n    fn({ condition: true, foo: [] }, function(a) {\n      a[0] = 1;\n    }),\n    fn({ condition: true, foo: [null, false] }, function(a) {\n      a[0] = 1;\n    }),\n    fn({ condition: true, foo: [null, true] }, function(a) {\n      a[0] = 1;\n    }),\n    fn({ condition: true, foo: [null, false, 5] }, function(a) {\n      a[0] = 1;\n    }),\n    fn({ condition: true, foo: [null, true, 5] }, function(a) {\n      a[0] = 1;\n    }),\n  ]);\n};\n"
  },
  {
    "path": "test/serializer/optimized-functions/ArrayFrom5.js",
    "content": "function fn(x, y) {\n  var foo = Array.from(x);\n\n  return foo[y] + 5;\n}\n\nif (global.__optimize) __optimize(fn);\n\ninspect = function() {\n  return JSON.stringify([10], 0);\n};\n"
  },
  {
    "path": "test/serializer/optimized-functions/ArrayFrom6.js",
    "content": "// does not contain:// this function should be inlined\n// arrayNestedOptimizedFunctionsEnabled\n\n(function() {\n  function add(a, b) {\n    // this function should be inlined\n    return a + b;\n  }\n\n  function fn(x) {\n    var arr = Array.from(x);\n    return arr.map(function(item) {\n      return add(item.a, item.b) + 1 + 2;\n    });\n  }\n\n  this.__optimize && __optimize(fn);\n\n  inspect = function() {\n    return JSON.stringify(fn([{ a: 1, b: 2 }, { a: 5, b: 6 }]));\n  };\n})();\n"
  },
  {
    "path": "test/serializer/optimized-functions/ArrayFrom7.js",
    "content": "// does not contain:// this function should be inlined\n// arrayNestedOptimizedFunctionsEnabled\n\n(function() {\n  var obj = {\n    c: 5,\n    d: 11,\n  };\n\n  function add(a, b) {\n    // this function should be inlined\n    return a + b;\n  }\n\n  function fn(x) {\n    var arr = Array.from(x);\n    return arr.map(function(item) {\n      return add(item.a, item.b) + obj.c + obj.d;\n    });\n  }\n\n  this.__optimize && __optimize(fn);\n\n  inspect = function() {\n    return JSON.stringify(fn([{ a: 1, b: 2 }, { a: 5, b: 6 }]));\n  };\n})();\n"
  },
  {
    "path": "test/serializer/optimized-functions/ArrayFrom8.js",
    "content": "// does contain:// this function should not be inlined\n// arrayNestedOptimizedFunctionsEnabled\n\n(function() {\n  var obj = {\n    c: 5,\n    d: 11,\n  };\n\n  function add(a, b) {\n    // this function should not be inlined\n    return a + b;\n  }\n\n  function fn(x) {\n    var arr = Array.from(x);\n    return arr.map(function(item) {\n      obj.c++;\n      return add(item.a, item.b) + obj.c + obj.d;\n    });\n  }\n\n  this.__optimize && __optimize(fn);\n\n  inspect = function() {\n    return JSON.stringify(fn([{ a: 1, b: 2 }, { a: 5, b: 6 }]));\n  };\n})();\n"
  },
  {
    "path": "test/serializer/optimized-functions/ArrayFrom9.js",
    "content": "// does contain:// this function should not be inlined\n// arrayNestedOptimizedFunctionsEnabled\n\n(function() {\n  function add(a, b) {\n    // this function should not be inlined\n    return a + b;\n  }\n\n  function fn(x) {\n    var obj = {\n      c: 5,\n      d: 11,\n    };\n\n    var arr = Array.from(x);\n    return arr.map(function(item) {\n      obj.c++;\n      return add(item.a, item.b) + obj.c + obj.d;\n    });\n  }\n\n  this.__optimize && __optimize(fn);\n\n  inspect = function() {\n    return JSON.stringify(fn([{ a: 1, b: 2 }, { a: 5, b: 6 }]));\n  };\n})();\n"
  },
  {
    "path": "test/serializer/optimized-functions/ArrayIndexOf.js",
    "content": "function inner(props) {\n  var foo = Array.from(props.foo);\n  var bar = foo.filter(Boolean);\n  var idx = bar.indexOf(5);\n\n  return idx;\n}\n\nfunction fn(arg) {\n  if (!arg.condition) {\n    return null;\n  }\n  return inner(arg);\n}\n\nif (global.__optimize) __optimize(fn);\n\ninspect = function() {\n  return JSON.stringify([\n    fn({ condition: false }),\n    fn({ condition: true, foo: [] }),\n    fn({ condition: true, foo: [false] }),\n    fn({ condition: true, foo: [true] }),\n    fn({ condition: true, foo: [false, 5] }),\n    fn({ condition: true, foo: [true, 5] }),\n  ]);\n};\n"
  },
  {
    "path": "test/serializer/optimized-functions/ArrayReverse.js",
    "content": "function inner(props) {\n  var foo = Array.from(props.foo);\n  var bar = foo.filter(Boolean);\n  bar.reverse();\n\n  return bar;\n}\n\nfunction fn(arg) {\n  if (!arg.condition) {\n    return null;\n  }\n  return inner(arg);\n}\n\nif (global.__optimize) __optimize(fn);\n\ninspect = function() {\n  return JSON.stringify([\n    fn({ condition: false }),\n    fn({ condition: true, foo: [1, 2, 3] }),\n    fn({ condition: true, foo: [false, 1, 2] }),\n    fn({ condition: true, foo: [true, 1, 2] }),\n    fn({ condition: true, foo: [false, 5, 4] }),\n    fn({ condition: true, foo: [true, 5, 8] }),\n  ]);\n};\n"
  },
  {
    "path": "test/serializer/optimized-functions/ArrowFunction.js",
    "content": "// does contain:=> {\n\nconst foo = x => {\n  return x + 1;\n};\n\nif (global.__optimize) __optimize(foo);\n\ninspect = function() {\n  return foo(5);\n};\n"
  },
  {
    "path": "test/serializer/optimized-functions/ArrowFunction2.js",
    "content": "// does contain:=> {\n\nfunction foo(x) {\n  this.x = x;\n  const bar = () => {\n    return this.x;\n  };\n  if (global.__optimize) __optimize(bar);\n  this.bar = bar;\n}\n\nif (global.__optimize) __optimize(foo);\n\ninspect = function() {\n  return foo(5).bar();\n};\n"
  },
  {
    "path": "test/serializer/optimized-functions/CallWithThrow.js",
    "content": "function URI(uri) {\n  this.a = \"\";\n  var b = bar(uri) || {};\n  if (b.foo && b.foo()) {\n    throw new Error(\"foo\");\n  }\n  this.a = b;\n  return this;\n}\n\nfunction bar(uri) {\n  var str = \"\";\n  if (uri.a) {\n    str += uri.a;\n  }\n  return str;\n}\n\nfunction fn(arg) {\n  new URI(new URI(arg));\n}\n\nif (global.__optimize) __optimize(fn);\n\ninspect = function() {\n  try {\n    fn({ a: \"hello\" });\n    return \"ok\";\n  } catch (err) {\n    return err;\n  }\n};\n"
  },
  {
    "path": "test/serializer/optimized-functions/CommonParentScopeCapture.js",
    "content": "(function() {\n  function middle(cond) {\n    if (cond) {\n      var value = 42;\n      function inner1() {\n        return value;\n      }\n      function inner2() {\n        return value;\n      }\n      global.__optimize && __optimize(inner1);\n      global.__optimize && __optimize(inner2);\n      return [inner1, inner2];\n    }\n  }\n  function outer(cond) {\n    return [middle(cond), middle(cond)];\n  }\n  global.outer = outer;\n  global.__optimize && __optimize(outer);\n\n  global.inspect = function() {\n    let [[i1, i2], [i3, i4]] = outer(true);\n    return i1() + i2() + i3() + i4();\n  };\n})();\n"
  },
  {
    "path": "test/serializer/optimized-functions/ComposeJoins.js",
    "content": "function fn(_ref) {\n  var className = _ref.className;\n  var comment = _ref.comment;\n  var author = comment.author;\n  var authorID = author && author.id;\n  var authorName = author && author.name;\n  if (!author || !authorID || authorName == null) {\n    return null;\n  }\n  if (author.url) {\n    return {\n      props: {\n        className: null,\n\n        uid: authorID,\n      },\n      children: authorName,\n    };\n  } else {\n    return {\n      props: { className: className },\n      children: authorName,\n    };\n  }\n}\n\nthis.__optimize && __optimize(fn);\n"
  },
  {
    "path": "test/serializer/optimized-functions/ConditionalArray.js",
    "content": "// does contain:1-2-3\n\nfunction fn(a) {\n  var array = a === null ? [1, 2, 3] : [4, 5, 6];\n\n  return array.join(\"-\");\n}\n\nglobal.__optimize && __optimize(fn);\n\ninspect = function() {\n  return JSON.stringify({\n    a: fn(null),\n    b: fn(true),\n  });\n};\n"
  },
  {
    "path": "test/serializer/optimized-functions/ConditionalArray2.js",
    "content": "function fn(a, b) {\n  var array = a === null ? b : [4, 5, 6];\n\n  return array.join(\"-\");\n}\n\nglobal.__optimize && __optimize(fn);\n\ninspect = function() {\n  return JSON.stringify({\n    a: fn(null, [1, 2, 3]),\n    b: fn(true, [1, 2, 3]),\n  });\n};\n"
  },
  {
    "path": "test/serializer/optimized-functions/ConditionalArray3.js",
    "content": "function fn(a, b) {\n  var array = a === null ? b : [4, 5, 6];\n\n  return array.reverse().join(\"-\");\n}\n\nglobal.__optimize && __optimize(fn);\n\ninspect = function() {\n  return JSON.stringify({\n    a: fn(null, [1, 2, 3]),\n    b: fn(true, [1, 2, 3]),\n  });\n};\n"
  },
  {
    "path": "test/serializer/optimized-functions/ConditionalArray4.js",
    "content": "function fn(a, b) {\n  var array = a === null ? Array.from(b) : [4, 5, 6];\n\n  return array.reverse().join(\"-\");\n}\n\nglobal.__optimize && __optimize(fn);\n\ninspect = function() {\n  return JSON.stringify({\n    a: fn(null, [1, 2, 3]),\n    b: fn(true, [1, 2, 3]),\n  });\n};\n"
  },
  {
    "path": "test/serializer/optimized-functions/ConditionalArray5.js",
    "content": "function fn(a, b) {\n  var array = a === null ? Array.from(b) : [4, 5, 6];\n\n  array.push(0);\n  array.reverse();\n  array.unshift(10);\n  array.push(1);\n  array.pop();\n  array.shift();\n  array.splice(1, 0, 15);\n  array = array\n    .concat(array.slice())\n    .reverse()\n    .map(function(x) {\n      return x + 1;\n    });\n\n  return array.filter(Boolean).join(\"-\") + array.toString();\n}\n\nglobal.__optimize && __optimize(fn);\n\ninspect = function() {\n  return JSON.stringify({\n    a: fn(null, [1, 2, 3]),\n    b: fn(true, [1, 2, 3]),\n  });\n};\n"
  },
  {
    "path": "test/serializer/optimized-functions/ConditionalGet.js",
    "content": "// inline expressions\n// Copies of \\{\\}:0\n// Copies of = 2:0\n\nfunction fn(x, b) {\n  var a = x ? b : { a: 2 };\n  return a.a;\n}\n\nthis.__optimize && __optimize(fn);\n\ninspect = function() {\n  return fn(false, { a: 1 });\n};\n"
  },
  {
    "path": "test/serializer/optimized-functions/ConditionalGet2.js",
    "content": "// inline expressions\n// Copies of \\{\\}:0\n// Copies of = 2:0\n\nfunction fn(x) {\n  var a = x || { a: 2 };\n  return a.a;\n}\n\nthis.__optimize && __optimize(fn);\n\ninspect = function() {\n  return fn({ a: 1 });\n};\n"
  },
  {
    "path": "test/serializer/optimized-functions/ConditionalGet3.js",
    "content": "// inline expressions\n// Copies of \\{\\}:0\n// Copies of = 2:0\n\nfunction fn(x) {\n  var a = x && { a: 2 };\n  return a.a;\n}\n\nthis.__optimize && __optimize(fn);\n\ninspect = function() {\n  return fn({ a: 1 });\n};\n"
  },
  {
    "path": "test/serializer/optimized-functions/ConditionalObjectAssign.js",
    "content": "function fn(x) {\n  var a = x ? { a: 1 } : { a: 2 };\n\n  return Object.assign({}, a, { b: 1 });\n}\n\nglobal.__optimize && __optimize(fn);\n\ninspect = function() {\n  return JSON.stringify({ x: fn(false), y: fn(true) });\n};\n"
  },
  {
    "path": "test/serializer/optimized-functions/ConditionalObjectAssign2.js",
    "content": "function fn(x, y) {\n  var a = x ? y : { a: 2 };\n\n  return Object.assign({}, a, { b: 1 });\n}\n\nglobal.__optimize && __optimize(fn);\n\ninspect = function() {\n  let res = JSON.stringify({ x: fn(true, { x: 5 }), y: fn(false, { x: 4 }) });\n  // This is done because Prepack re-orders the keys on the object, which affects\n  // JSON.stringify output with V8 as keys are output in the order they're inserted\n  // and the output will mismatch even though the objects are the same.\n  let expected = `{\"x\":{\"x\":5,\"b\":1},\"y\":{\"b\":1,\"a\":2}}`;\n  let expectedKeysOrderer = `{\"x\":{\"x\":5,\"b\":1},\"y\":{\"a\":2,\"b\":1}}`;\n  return res === expected || res === expectedKeysOrderer;\n};\n"
  },
  {
    "path": "test/serializer/optimized-functions/ConditionalObjectAssign3.js",
    "content": "function fn(x, y, z) {\n  var a = x ? y : z || { a: 2 };\n\n  return Object.assign({}, a, { b: 1 });\n}\n\nglobal.__optimize && __optimize(fn);\n\ninspect = function() {\n  return JSON.stringify({ x: fn(false, { a: 1 }, true), y: fn(true, { a: 1 }, false) });\n};\n"
  },
  {
    "path": "test/serializer/optimized-functions/ConditionalObjectAssign4.js",
    "content": "function fn(x) {\n  var a = x || { b: 5 };\n\n  return Object.assign({}, a, { b: 1 });\n}\n\nglobal.__optimize && __optimize(fn);\n\ninspect = function() {\n  return JSON.stringify({ x: fn(false), y: fn({ b: 10 }) });\n};\n"
  },
  {
    "path": "test/serializer/optimized-functions/ConditionalObjectAssign5.js",
    "content": "function fn(x) {\n  var a = x && { b: 5 };\n\n  return Object.assign({}, a, { b: 1 });\n}\n\nglobal.__optimize && __optimize(fn);\n\ninspect = function() {\n  return JSON.stringify({ x: fn(null), y: fn({ b: 10 }) });\n};\n"
  },
  {
    "path": "test/serializer/optimized-functions/ConditionalReturn.js",
    "content": "(function() {\n  function foo(x) {\n    if (!x) {\n      return null;\n    }\n    return x != null ? x : null;\n  }\n\n  global.__optimize && __optimize(foo);\n\n  global.inspect = function() {\n    return JSON.stringify([foo(null), foo(undefined), foo(0), foo(1), foo({})]);\n  };\n})();\n"
  },
  {
    "path": "test/serializer/optimized-functions/ConditionalReturn2.js",
    "content": "function bar() {\n  return 123;\n}\n\nfunction fn(x) {\n  if (!x) {\n    return bar();\n  }\n\n  var foo = x.foo;\n  if (!foo) {\n    return 456;\n  }\n}\n\nthis.__optimize && __optimize(fn);\n\ninspect = function() {\n  return JSON.stringify(fn());\n};\n"
  },
  {
    "path": "test/serializer/optimized-functions/ConditionallyLeakedBinding.js",
    "content": "(function() {\n  function f(c, g) {\n    let x = 23;\n    let y = 0;\n    if (c) {\n      x = Date.now();\n      function h() {\n        y = x;\n        x++;\n      }\n      g(h);\n      return x - y;\n    } else {\n      x = Date.now();\n      return x - y;\n    }\n  }\n  global.__optimize && __optimize(f);\n  global.inspect = function() {\n    return f(true, g => g());\n  };\n})();\n"
  },
  {
    "path": "test/serializer/optimized-functions/ConditionallyLeakedObject1.js",
    "content": "(function() {\n  function f(g, c) {\n    let o = { foo: 42 };\n    if (c) {\n      g(o);\n    } else {\n      o.foo = 2;\n    }\n\n    return o;\n  }\n\n  global.__optimize && __optimize(f);\n  inspect = function() {\n    return JSON.stringify(f(o => o, false));\n  };\n})();\n"
  },
  {
    "path": "test/serializer/optimized-functions/ConditionallyLeakedObject2.js",
    "content": "(function() {\n  function f(g, c) {\n    let o = { foo: 42 };\n    if (c) {\n      g(o);\n    } else {\n      o.x = 1;\n    }\n\n    return o;\n  }\n\n  global.__optimize && __optimize(f);\n  inspect = function() {\n    return JSON.stringify(f(o => o, false));\n  };\n})();\n"
  },
  {
    "path": "test/serializer/optimized-functions/ConditionallyOptimizedFunction.js",
    "content": "// does not contain:1 + 2\n(function() {\n  function g() {\n    return 1 + 2;\n  }\n  if (global.__optimize && __abstract(\"boolean\", \"true\")) __optimize(g);\n  global.inspect = function() {\n    return g();\n  };\n})();\n"
  },
  {
    "path": "test/serializer/optimized-functions/ConditionallyReachable.js",
    "content": "(function() {\n  function f(c) {\n    let h;\n    if (c) {\n      h = function() {\n        return 23 + 42;\n      };\n      function g() {\n        return h();\n      }\n      global.__optimize && __optimize(g);\n      return g;\n    }\n  }\n  global.__optimize && __optimize(f);\n  global.f = f;\n\n  global.inspect = function() {\n    return f(true)() + \" \" + f(false);\n  };\n})();\n"
  },
  {
    "path": "test/serializer/optimized-functions/DeadModifiedBindings.js",
    "content": "// does not contain:reachMe\n(function() {\n  var x;\n  function g() {\n    x = { canYou: \"reachMe?\" };\n  }\n  function f() {\n    g();\n    return 42;\n  }\n  if (global.__optimize) __optimize(f);\n  global.inspect = f;\n})();\n"
  },
  {
    "path": "test/serializer/optimized-functions/DeadObjectAssign.js",
    "content": "// Copies of assign\\(:0\n\nglobal.f = function() {\n  var x = global.__abstract ? global.__abstract({}, \"({})\") : {};\n  global.__makeSimple && __makeSimple(x);\n  Object.assign({}, x);\n  return 1;\n};\n\nif (global.__optimize) __optimize(f);\n\nglobal.inspect = function() {\n  return global.f();\n};\n"
  },
  {
    "path": "test/serializer/optimized-functions/DeadObjectAssign10.js",
    "content": "// Copies of _\\$8\\(:1\n// Copies of var _\\$8 = _\\$7.assign;:1\n// inline expressions\n\n// _$8 is the variable for Object.assign. See DeadObjectAssign4.js for\n// a larger explanation.\n\nfunction f(foo, bar) {\n  var a = Object.assign({}, foo, bar, { a: 1 });\n  var b = Object.assign({}, a, { a: 2 });\n  var c = Object.assign({}, b, { a: 2 }, { d: 5 });\n  return c;\n}\n\nif (global.__optimize) __optimize(f);\n\nglobal.inspect = function() {\n  return JSON.stringify(f({ b: 1 }, { c: 2 }));\n};\n"
  },
  {
    "path": "test/serializer/optimized-functions/DeadObjectAssign11.js",
    "content": "// Copies of _\\$8\\(:1\n// Copies of var _\\$8 = _\\$7.assign;:1\n// inline expressions\n\n// _$8 is the variable for Object.assign. See DeadObjectAssign4.js for\n// a larger explanation.\n\nfunction f(foo, bar) {\n  var a = Object.assign({}, foo, bar, { a: 1 });\n  foo = {};\n  var b = Object.assign({}, a, { a: 2 });\n  bar = {};\n  var c = Object.assign({}, b, { a: 2 }, { d: 5 });\n  return c;\n}\n\nif (global.__optimize) __optimize(f);\n\nglobal.inspect = function() {\n  return JSON.stringify(f({ b: 1 }, { c: 2 }));\n};\n"
  },
  {
    "path": "test/serializer/optimized-functions/DeadObjectAssign12.js",
    "content": "// Copies of _\\$G\\(:2\n// Copies of var _\\$G = _\\$F.assign;:1\n// inline expressions\n\n// _$G is the variable for Object.assign. See DeadObjectAssign4.js for\n// a larger explanation.\n\nfunction f(x, foo, bar) {\n  var a = Object.assign({}, foo, bar, { a: 1 });\n  foo = {};\n  var b;\n  if (x) {\n    b = Object.assign({}, a, { a: 2 });\n  } else {\n    b = Object.assign({}, a, { a: 5 });\n  }\n  var c = Object.assign({}, b, { a: 2 }, { d: 5 });\n  return c;\n}\n\nif (global.__optimize) __optimize(f);\n\nglobal.inspect = function() {\n  return JSON.stringify(f(false, { b: 1 }, { c: 2 }));\n};\n"
  },
  {
    "path": "test/serializer/optimized-functions/DeadObjectAssign13.js",
    "content": "// Copies of _\\$7\\(:2\n// Copies of var _\\$7 = _\\$6.assign;:1\n// inline expressions\n\n// _$7 is the variable for Object.assign. See DeadObjectAssign4.js for\n// a larger explanation.\n\nfunction f(x, foo) {\n  var a = Object.assign({}, foo);\n\n  return x ? Object.assign({}, a, { a: 1 }) : Object.assign({}, a, { a: 2 });\n}\n\nif (global.__optimize) __optimize(f);\n\nglobal.inspect = function() {\n  return JSON.stringify(f(false, { a: 3 }));\n};\n"
  },
  {
    "path": "test/serializer/optimized-functions/DeadObjectAssign14.js",
    "content": "// Copies of _\\$4\\(:2\n// Copies of var _\\$4 = _\\$3.assign;:1\n// inline expressions\n\n// _$4 is the variable for Object.assign. See DeadObjectAssign4.js for\n// a larger explanation.\n\nfunction f(x, foo) {\n  var a = Object.assign({}, foo);\n  var b = Object.assign({}, a);\n  // b gets visited\n  var someVal = b;\n  if (x) {\n    // a gets visited\n    someVal = a;\n  }\n  // a should still exist\n  return someVal;\n}\n\nif (global.__optimize) __optimize(f);\n\nglobal.inspect = function() {\n  return JSON.stringify(f(false, { a: 3 }));\n};\n"
  },
  {
    "path": "test/serializer/optimized-functions/DeadObjectAssign15.js",
    "content": "// Copies of _\\$4\\(:2\n// Copies of var _\\$4 = _\\$3.assign;:1\n// inline expressions\n\n// _$4 is the variable for Object.assign. See DeadObjectAssign4.js for\n// a larger explanation.\n\nfunction f(x, foo) {\n  var a = Object.assign({}, foo);\n  var b = Object.assign({}, a);\n  // b gets visited\n  var someVal = b;\n  if (x) {\n    // a gets visited\n    function foo() {\n      return a;\n    }\n    someVal = foo;\n  }\n  // a should still exist\n  return someVal;\n}\n\nif (global.__optimize) __optimize(f);\n\nglobal.inspect = function() {\n  return JSON.stringify(f(false, { a: 3 }));\n};\n"
  },
  {
    "path": "test/serializer/optimized-functions/DeadObjectAssign16.js",
    "content": "// Copies of _\\$4\\(:2\n// Copies of var _\\$4 = _\\$3.assign;:1\n// inline expressions\n\n// _$4 is the variable for Object.assign. See DeadObjectAssign4.js for\n// a larger explanation.\n\nfunction f(o) {\n  var p = Object.assign({}, o);\n  o.x = 42;\n  var q = Object.assign({}, p);\n  return q;\n}\n\nif (global.__optimize) __optimize(f);\n\nglobal.inspect = function() {\n  return JSON.stringify(f({ x: 10 }));\n};\n"
  },
  {
    "path": "test/serializer/optimized-functions/DeadObjectAssign17.js",
    "content": "// Copies of _\\$A\\(:1\n// Copies of var _\\$A = _\\$9.assign;:1\n// inline expressions\n\n// _$A is the variable for Object.assign. See DeadObjectAssign4.js for\n// a larger explanation.\n\nfunction f(o) {\n  var p = Object.assign({}, o, { a: 1 });\n  var p2 = Object.assign({}, o, { a: 2 });\n  var q = Object.assign({}, p, { a: 3 });\n  var q2 = Object.assign({}, q, { a: 4 });\n  return q2;\n}\n\nif (global.__optimize) __optimize(f);\n\nglobal.inspect = function() {\n  return JSON.stringify(f({ a: 10 }));\n};\n"
  },
  {
    "path": "test/serializer/optimized-functions/DeadObjectAssign18.js",
    "content": "// Copies of _\\$A\\(:2\n// Copies of var _\\$A = _\\$9.assign;:1\n// inline expressions\n\n// _$A is the variable for Object.assign. See DeadObjectAssign4.js for\n// a larger explanation.\n\nfunction f(o) {\n  var p = Object.assign({}, o, { a: 1 });\n  var q = Object.assign({}, p, { a: 3 });\n  var p2 = Object.assign({}, o, { a: 2 });\n  var q2 = Object.assign({}, p2, { a: 4 });\n  return [q, q2];\n}\n\nif (global.__optimize) __optimize(f);\n\nglobal.inspect = function() {\n  return JSON.stringify(f({ a: 10 }));\n};\n"
  },
  {
    "path": "test/serializer/optimized-functions/DeadObjectAssign19.js",
    "content": "// Copies of _\\$E\\(:2\n// Copies of var _\\$E = _\\$D.assign;:1\n// inline expressions\n\n// _$H is the variable for Object.assign. See DeadObjectAssign4.js for\n// a larger explanation.\n\nfunction f(o) {\n  var p = Object.assign({}, o, { a: 1 });\n  var p2 = Object.assign({}, o, { a: 2 });\n  p2.a = 100;\n  var q = Object.assign({}, p, { a: 3 });\n  var q2 = Object.assign({}, q, { a: 4 });\n  var q2 = Object.assign({}, q2, p2, { a: 1 }, p2);\n  return q2;\n}\n\nif (global.__optimize) __optimize(f);\n\nglobal.inspect = function() {\n  return JSON.stringify(f({ a: 10 }));\n};\n"
  },
  {
    "path": "test/serializer/optimized-functions/DeadObjectAssign2.js",
    "content": "// Copies of .assign;:1\n\nglobal.f = function() {\n  var x = global.__abstract ? global.__abstract({}, \"({a: 1})\") : { a: 1 };\n  var val = {};\n  Object.assign(val, x);\n  return [1, val];\n};\n\nif (global.__optimize) __optimize(f);\n\nglobal.inspect = function() {\n  return JSON.stringify(global.f());\n};\n"
  },
  {
    "path": "test/serializer/optimized-functions/DeadObjectAssign20.js",
    "content": "// Copies of _\\$5\\(:1\n// Copies of var _\\$5 = _\\$4.assign;:1\n// inline expressions\n\n// _$5 is the variable for Object.assign. See DeadObjectAssign4.js for\n// a larger explanation.\n\nfunction f(o) {\n  var p = Object.assign({}, o);\n  var l = {};\n  var q = Object.assign({}, p, l);\n  l.x = 42;\n  var r = Object.assign({}, q);\n  return r;\n}\n\nif (global.__optimize) __optimize(f);\n\nglobal.inspect = function() {\n  return JSON.stringify(f({ x: 10 }));\n};\n"
  },
  {
    "path": "test/serializer/optimized-functions/DeadObjectAssign21.js",
    "content": "// Copies of _\\$8\\(:3\n// Copies of var _\\$8 = _\\$7.assign;:1\n// inline expressions\n\n// _$8 is the variable for Object.assign. See DeadObjectAssign4.js for\n// a larger explanation.\n\nfunction f(o) {\n  var p = Object.assign({}, o, { a: 1 });\n  var q = Object.assign({}, p, { a: 3 });\n  var p2 = Object.assign({}, o, { a: 2 });\n  var q2 = Object.assign({}, p2, { a: 4 });\n  return [q, q2];\n}\n\nif (global.__optimize) __optimize(f);\n\nglobal.inspect = function() {\n  return JSON.stringify(f({ a: 10 }));\n};\n\nfunction f(o1, o2, g, h) {\n  let a = Object.assign({}, o1);\n  let b = Object.assign({}, o2);\n  g(a, b);\n  let p = Object.assign({}, o1);\n  h(o2); // can mutate o1 !\n  let q = Object.assign({}, p);\n  return q;\n}\n\nif (global.__optimize) __optimize(f);\n\ninspect = function() {\n  return f(\n    {},\n    {},\n    function(o1, o2) {\n      o2.o1 = o1;\n    },\n    function(o2) {\n      o2.o1.x = 42;\n    }\n  ).x;\n};\n"
  },
  {
    "path": "test/serializer/optimized-functions/DeadObjectAssign22.js",
    "content": "// Copies of _\\$6\\(:2\n// Copies of var _\\$6 = _\\$5.assign;:1\n// inline expressions\n\n// _$A is the variable for Object.assign. See DeadObjectAssign4.js for\n// a larger explanation.\n\nfunction f(o) {\n  var p = Object.assign({}, o, { a: 1 });\n  var q = Object.assign({}, p, { a: 3 });\n  var p2 = Object.assign({}, o, { a: 2 });\n  var q2 = Object.assign({}, p2, { a: 4 });\n  return [q, q2];\n}\n\nif (global.__optimize) __optimize(f);\n\nglobal.inspect = function() {\n  return JSON.stringify(f({ a: 10 }));\n};\n\nfunction f(o2, g, h) {\n  let o1 = {};\n  g(o1, o2); // leaks o1\n  let p = Object.assign({}, o1);\n  h(o2); // can mutate o1 !\n  let q = Object.assign({}, p);\n  return q;\n}\n\nif (global.__optimize) __optimize(f);\n\ninspect = function() {\n  return f(\n    {},\n    function(o1, o2) {\n      o2.o1 = o1;\n    },\n    function(o2) {\n      o2.o1.x = 42;\n    }\n  ).x;\n};\n"
  },
  {
    "path": "test/serializer/optimized-functions/DeadObjectAssign23.js",
    "content": "// Copies of _\\$C\\(:1\n// Copies of var _\\$C = _\\$B.assign;:1\n// inline expressions\n\n// _$C is the variable for Object.assign. See DeadObjectAssign4.js for\n// a larger explanation.\n\nfunction fn(obj, x) {\n  var a = Object.assign({}, x, { a: 1 });\n  var b = Object.assign({}, x, { b: 1 });\n\n  if (obj.cond) {\n    var c = Object.assign({}, a, b);\n\n    return c.a + c.b;\n  }\n}\n\nthis.__optimize && __optimize(fn);\n\ninspect = function() {\n  return fn(\n    {\n      cond: true,\n    },\n    { a: 0, b: 0 }\n  );\n};\n"
  },
  {
    "path": "test/serializer/optimized-functions/DeadObjectAssign24.js",
    "content": "// Copies of _\\$D\\(:1\n// Copies of var _\\$D = _\\$C.assign;:1\n// inline expressions\n\n// _$C is the variable for Object.assign. See DeadObjectAssign4.js for\n// a larger explanation.\n\nfunction fn(obj, x) {\n  var a = Object.assign({}, x, { a: 1 });\n  var b = Object.assign({}, x, { b: 1 });\n\n  if (obj.cond) {\n    var c = Object.assign({}, a, b, a);\n\n    return c.a + c.b;\n  }\n}\n\nthis.__optimize && __optimize(fn);\n\ninspect = function() {\n  return fn(\n    {\n      cond: true,\n    },\n    { a: 0, b: 0 }\n  );\n};\n"
  },
  {
    "path": "test/serializer/optimized-functions/DeadObjectAssign3.js",
    "content": "// Copies of assign\\(:0\n\nglobal.f = function() {\n  var x = global.__abstract ? global.__abstract({}, \"({})\") : {};\n  global.__makeSimple && __makeSimple(x);\n  var val = {};\n  Object.assign(val, x);\n  return 1;\n};\n\nif (global.__optimize) __optimize(f);\n\nglobal.inspect = function() {\n  return global.f();\n};\n"
  },
  {
    "path": "test/serializer/optimized-functions/DeadObjectAssign4.js",
    "content": "// Copies of _\\$4\\(:1\n// Copies of var _\\$4 = _\\$3.assign;:1\n// inline expressions\n\n// Why? _$3 is the variable for Object.assign, and there should be\n// two copies of it. One for it's declaration and one for its reference.\n// We use inline expressions on all test iterations to ensure the copies\n// count is always constant.\n\nfunction f(foo) {\n  var a = Object.assign({}, foo);\n  var b = Object.assign({}, a);\n  return b;\n}\n\nif (global.__optimize) __optimize(f);\n\nglobal.inspect = function() {\n  return f({});\n};\n"
  },
  {
    "path": "test/serializer/optimized-functions/DeadObjectAssign5.js",
    "content": "// Copies of _\\$4\\(:2\n// Copies of var _\\$4 = _\\$3.assign;:1\n// inline expressions\n\n// _$4 is the variable for Object.assign. See DeadObjectAssign4.js for\n// a larger explanation.\n\nfunction f(foo) {\n  var a = Object.assign({}, foo);\n  var b = Object.assign({}, a);\n  return [a, b];\n}\n\nif (global.__optimize) __optimize(f);\n\nglobal.inspect = function() {\n  return JSON.stringify(f({}));\n};\n"
  },
  {
    "path": "test/serializer/optimized-functions/DeadObjectAssign6.js",
    "content": "// Copies of _\\$5\\(:2\n// Copies of var _\\$5 = _\\$4.assign;:1\n// inline expressions\n\n// _$5 is the variable for Object.assign. See DeadObjectAssign4.js for\n// a larger explanation.\n\nfunction f(foo) {\n  var a = Object.assign({}, foo);\n  var bar = a.x;\n  var b = Object.assign({}, a);\n  return [b, bar];\n}\n\nif (global.__optimize) __optimize(f);\n\nglobal.inspect = function() {\n  return JSON.stringify(f({ x: 1 }));\n};\n"
  },
  {
    "path": "test/serializer/optimized-functions/DeadObjectAssign7.js",
    "content": "// Copies of _\\$5\\(:1\n// Copies of var _\\$5 = _\\$4.assign;:1\n// inline expressions\n\n// _$5 is the variable for Object.assign. See DeadObjectAssign4.js for\n// a larger explanation.\n\nfunction f(foo) {\n  var a = Object.assign({}, foo);\n  var bar = a.x;\n  var b = Object.assign({}, a);\n  return [a, bar];\n}\n\nif (global.__optimize) __optimize(f);\n\nglobal.inspect = function() {\n  return JSON.stringify(f({ x: 1 }));\n};\n"
  },
  {
    "path": "test/serializer/optimized-functions/DeadObjectAssign8.js",
    "content": "// Copies of _\\$6:2\n// inline expressions\n\n// _$6 is the variable for Object.assign. See DeadObjectAssign4.js for\n// a larger explanation.\n\nfunction f(foo, bar) {\n  var a = Object.assign({}, foo, bar, { a: 1 });\n  var b = Object.assign({}, a);\n  return b;\n}\n\nif (global.__optimize) __optimize(f);\n\nglobal.inspect = function() {\n  return JSON.stringify(f({ b: 1 }, { c: 2 }));\n};\n"
  },
  {
    "path": "test/serializer/optimized-functions/DeadObjectAssign9.js",
    "content": "// Copies of _\\$6\\(:1\n// Copies of var _\\$6 = _\\$5.assign;:1\n// inline expressions\n\n// _$6 is the variable for Object.assign. See DeadObjectAssign4.js for\n// a larger explanation.\n\nfunction f(foo, bar) {\n  var a = Object.assign({}, foo, bar, { a: 1 });\n  var b = Object.assign({}, a, { a: 2 });\n  return b;\n}\n\nif (global.__optimize) __optimize(f);\n\nglobal.inspect = function() {\n  return JSON.stringify(f({ b: 1 }, { c: 2 }));\n};\n"
  },
  {
    "path": "test/serializer/optimized-functions/DefineOptFuncInsideFuncInsideOptFunc.js",
    "content": "// arrayNestedOptimizedFunctionsEnabled\n// skip lint\n// The original issue here was that nested is defined inside of fn2 which is a non-optimized function\n// called by fn (an optimized function). That caused Prepack to not detect that nested was nested\n// in optimize.\n\nfunction fn2(props) {\n  var _ref11;\n  var commentsConnection =\n    (_ref11 = props) != null ? ((_ref11 = _ref11.feedback) != null ? _ref11.display_comments : _ref11) : _ref11;\n\n  var func = props.func;\n\n  var nested = function() {\n    return func(commentsConnection);\n  };\n  if (global.__optimize) __optimize(nested);\n  return props.items.map(nested);\n}\n\nfunction fn(props) {\n  var items = Array.from(props.items);\n\n  var func = function(commentsConnection) {\n    return commentsConnection;\n  };\n\n  return fn2({\n    items: items,\n    func: func,\n    feedback: props.feedback,\n  });\n}\n\ninspect = function() {\n  return JSON.stringify(fn({ items: [0, 1, 2], feedback: { display_comments: [1, 2, 3] } }));\n};\n\nif (global.__optimize) __optimize(fn);\n"
  },
  {
    "path": "test/serializer/optimized-functions/Empty.js",
    "content": "var x = global.__abstract ? (x = __abstract(\"boolean\", \"true\")) : true;\n\nfunction foo() {\n  let ob = {};\n  if (!x) ob.bar = 123;\n  return ob.bar;\n}\n\nif (global.__optimize) __optimize(foo);\n\ninspect = function() {\n  return foo();\n};\n"
  },
  {
    "path": "test/serializer/optimized-functions/ForLoop.js",
    "content": "// throws introspection error\nvar x = global.__abstract ? (x = __abstract(\"number\", \"(2)\")) : 2;\n\nfunction func1() {\n  for (let i = 0; i < 3; i++) {\n    if (i === x) {\n      break;\n    }\n    if (i === 2) {\n      throw new Error(\"X is 2\");\n    }\n  }\n}\n\nif (global.__optimize) __optimize(func1);\n\ninspect = function() {\n  return func1();\n};\n"
  },
  {
    "path": "test/serializer/optimized-functions/ForLoop2.js",
    "content": "(function() {\n  function fn() {\n    var arr = [0];\n    for (var i = 0; i < arr.length; i++) {\n      break;\n    }\n    return 10;\n  }\n\n  if (global.__optimize) {\n    __optimize(fn);\n  }\n\n  global.inspect = function() {\n    return fn();\n  };\n})();\n"
  },
  {
    "path": "test/serializer/optimized-functions/ForLoop3.js",
    "content": "// expected Warning,RecoverableError: PP1007, PP0023, PP1002\n// throws introspection error\n(function() {\n  function fn(arg) {\n    if (arg.foo()) {\n      var arr = [0];\n      for (var k = 0; k < arr.length; ++k) {\n        break;\n      }\n    }\n    throw new Error(\"no\");\n  }\n\n  if (global.__optimize) __optimize(fn);\n\n  global.inspect = function() {\n    try {\n      fn({ foo() {} });\n    } catch (err) {\n      return err.message;\n    }\n    return \"expected an error\";\n  };\n})();\n"
  },
  {
    "path": "test/serializer/optimized-functions/HavocBindings1.js",
    "content": "(function() {\n  function f(g) {\n    let x = 23;\n    function f() {\n      x = x + 42;\n    }\n    g(f);\n    return x;\n  }\n  global.__optimize && __optimize(f);\n  global.inspect = function() {\n    return f(g => g());\n  };\n})();\n"
  },
  {
    "path": "test/serializer/optimized-functions/HavocBindings10.js",
    "content": "// This test is there to check for a regression where code was generated\n// that used a variable before it was declared, which trips the linter.\n// The issue arose when joining a binding from a declarative environment record that only existed in one branch of the joined executions.\n(function() {\n  function makeClosure(bar) {\n    if (bar) return null;\n    var captured = bar;\n    return function closure() {\n      return captured;\n    };\n  }\n\n  function fn(arg) {\n    if (arg) return undefined;\n    var state = {};\n    state.closure = makeClosure(arg.bar);\n    arg.baz(state);\n  }\n\n  global.fn = fn;\n\n  if (global.__optimize) {\n    __optimize(fn);\n  }\n\n  inspect = function() {\n    return fn(true);\n  };\n})();\n"
  },
  {
    "path": "test/serializer/optimized-functions/HavocBindings11.js",
    "content": "if (!global.__evaluatePureFunction) global.__evaluatePureFunction = f => f();\n\nconst havoc = global.__abstract ? global.__abstract(\"function\", \"(() => {})\") : () => {};\n\nconst result = global.__evaluatePureFunction(() => {\n  let x = 23;\n  function incrementX() {\n    x = x + 42;\n  }\n  if (global.__optimize) __optimize(incrementX);\n  havoc(incrementX);\n  return x;\n});\n\nglobal.inspect = () => result;\n"
  },
  {
    "path": "test/serializer/optimized-functions/HavocBindings2.js",
    "content": "(function() {\n  function f(g) {\n    var x = 23;\n    function f() {\n      x = x + 42;\n    }\n    g(f);\n    return x;\n  }\n  global.__optimize && __optimize(f);\n  global.inspect = function() {\n    return f(g => g());\n  };\n})();\n"
  },
  {
    "path": "test/serializer/optimized-functions/HavocBindings3.js",
    "content": "(function() {\n  function f(g) {\n    let x = 23;\n    function f() {\n      return x;\n    }\n    let a = [];\n    a.push(g(f));\n    x = 42;\n    a.push(g(f));\n    return a;\n  }\n  global.__optimize && __optimize(f);\n  global.inspect = function() {\n    return f(g => g());\n  };\n})();\n"
  },
  {
    "path": "test/serializer/optimized-functions/HavocBindings4.js",
    "content": "(function() {\n  function f(c, g) {\n    let x = 23;\n    let y;\n    if (c) {\n      x = Date.now();\n      function h() {\n        y = x;\n        x++;\n      }\n      g(h);\n      return x - y;\n    } else {\n      x = Date.now();\n      function h() {\n        y = x;\n        x++;\n      }\n      g(h);\n      return x - y;\n    }\n  }\n  global.__optimize && __optimize(f);\n  global.inspect = function() {\n    return f(true, g => g());\n  };\n})();\n"
  },
  {
    "path": "test/serializer/optimized-functions/HavocBindings5.js",
    "content": "function foo(a, b, c) {\n  if (!a) {\n    return null;\n  }\n  var b = Object.assign({}, c);\n\n  return a.callFunc(function() {\n    return b.foo;\n  });\n}\n\ninspect = function() {\n  return JSON.stringify(\n    foo({\n      a: {\n        callFunc(x) {\n          return x();\n        },\n      },\n      b: {\n        foo() {\n          return \"works!\";\n        },\n      },\n      c: {},\n    })\n  );\n};\n\nthis.__optimize && __optimize(foo);\n"
  },
  {
    "path": "test/serializer/optimized-functions/HavocBindings7.js",
    "content": "// does contain:42\n(function() {\n  function f(g) {\n    const x = 23;\n    function f() {\n      return x;\n    }\n    g(f);\n    return x + 19;\n  }\n  global.__optimize && __optimize(f);\n  global.inspect = function() {\n    return f(g => g());\n  };\n})();\n"
  },
  {
    "path": "test/serializer/optimized-functions/HavocBindings8.js",
    "content": "function fn(x, y, abstractVal) {\n  var value = x.toString();\n\n  if (y) {\n    abstractVal(function() {\n      value += \"-next\";\n    });\n  }\n  return value;\n}\n\nglobal.__optimize && __optimize(fn);\n\ninspect = function() {\n  return fn(10, false, function() {});\n};\n"
  },
  {
    "path": "test/serializer/optimized-functions/HavocBindings9.js",
    "content": "(function() {\n  function f(c, g) {\n    let x = 23;\n    let y;\n    if (c) {\n      x = Date.now();\n      function h() {\n        y = x;\n        x++;\n      }\n      g(h);\n      return x - y;\n    } else {\n      x = Date.now();\n      function h() {\n        y = x;\n        x++;\n      }\n      g(h);\n      return x - y;\n    }\n  }\n  global.__optimize && __optimize(f);\n  global.inspect = function() {\n    return f(true, g => g());\n  };\n})();\n"
  },
  {
    "path": "test/serializer/optimized-functions/HavocBindingsRegression.js",
    "content": "(function() {\n  function f(g) {\n    var x = {};\n    global.__makeFinal && __makeFinal(x);\n    function f() {\n      x = 42;\n    }\n    g(f);\n    return x;\n  }\n  global.__optimize && __optimize(f);\n  global.inspect = function() {\n    return f(g => g());\n  };\n})();\n"
  },
  {
    "path": "test/serializer/optimized-functions/HavocNestedBindings1.js",
    "content": "(function() {\n  function f(g) {\n    let x = 23;\n    function incrementX() {\n      x = x + 42;\n    }\n    global.__optimize && __optimize(incrementX);\n\n    g(incrementX);\n    return x;\n  }\n  global.__optimize && __optimize(f);\n  global.inspect = function() {\n    return f(g => g());\n  };\n})();\n"
  },
  {
    "path": "test/serializer/optimized-functions/HavocNestedBindings2.js",
    "content": "(function() {\n  function f(g) {\n    function definesX() {\n      let x = 23;\n      function incrementX() {\n        x = x + 42;\n      }\n\n      global.__optimize && __optimize(incrementX);\n      return [incrementX, x];\n    }\n    let [f1, x1] = definesX();\n    g(f1);\n    return x1;\n  }\n  global.__optimize && __optimize(f);\n  global.inspect = function() {\n    return f(g => g());\n  };\n})();\n"
  },
  {
    "path": "test/serializer/optimized-functions/HavocObjects1.js",
    "content": "(function() {\n  function f(c, g) {\n    let wrapper = { x: 23, y: undefined };\n    if (c) {\n      wrapper.x = Date.now();\n      function h() {\n        wrapper.y = wrapper.x;\n        wrapper.x++;\n      }\n      g(h);\n      return wrapper.x - wrapper.y;\n    } else {\n      wrapper.x = Date.now();\n      function h() {\n        wrapper.y = wrapper.x;\n        wrapper.x++;\n      }\n      g(h);\n      return wrapper.x - wrapper.y;\n    }\n  }\n  global.__optimize && __optimize(f);\n  global.inspect = function() {\n    return f(true, g => g());\n  };\n})();\n"
  },
  {
    "path": "test/serializer/optimized-functions/HavocObjects2.js",
    "content": "function Component(x, result) {\n  this.val = x;\n  this.result = result;\n  this.do = function(x) {\n    return this.val + result;\n  }.bind(this);\n}\n\nfunction foo(a, b, c, result) {\n  if (!a) {\n    return null;\n  }\n  var _ref11;\n  var x = (_ref11 = b) != null ? ((_ref11 = _ref11.feedback) != null ? _ref11.display_comments : _ref11) : _ref11;\n\n  var a = new Component(x, result);\n  var func = a.do;\n\n  return c(func);\n}\n\nglobal.__optimize && __optimize(foo);\n\ninspect = function() {\n  function func(x) {\n    return x();\n  }\n  var val = foo(\n    true,\n    {\n      feedback: {\n        display_comments: 5,\n      },\n    },\n    func,\n    10\n  );\n  return JSON.stringify(val);\n};\n"
  },
  {
    "path": "test/serializer/optimized-functions/HavocObjects3.js",
    "content": "(function() {\n  function f(c, g) {\n    \"use strict\";\n    let wrapper = { x: 23, y: undefined };\n    if (c) {\n      wrapper.x = Date.now();\n      function h() {\n        wrapper.y = wrapper.x;\n        wrapper.x++;\n      }\n      g(h);\n      return wrapper.x - wrapper.y;\n    } else {\n      wrapper.x = Date.now();\n      function h() {\n        wrapper.y = wrapper.x;\n        wrapper.x++;\n      }\n      g(h);\n      return wrapper.x - wrapper.y;\n    }\n  }\n  global.__optimize && __optimize(f);\n  global.inspect = function() {\n    return f(true, g => g());\n  };\n})();\n"
  },
  {
    "path": "test/serializer/optimized-functions/HavocObjects4.js",
    "content": "(function() {\n  function f(c, g) {\n    let obj = {};\n    Object.defineProperty(obj, \"x\", { writable: true, configurable: true, enumerable: false, value: 42 });\n    function h() {\n      return Object.getPropertyDescriptor(obj, \"x\").enumerable;\n    }\n    return g(h);\n  }\n  global.__optimize && __optimize(f);\n  global.inspect = function() {\n    return f(g => g());\n  };\n})();\n"
  },
  {
    "path": "test/serializer/optimized-functions/HavocObjects5.js",
    "content": "(function() {\n  function f(c, d, g) {\n    let o = { foo: 42 };\n    if (c) {\n      if (d) {\n        o.foo = Date.now();\n      } else {\n        delete o.foo;\n      }\n      return g(function() {\n        return \"foo\" in o;\n      });\n    }\n  }\n  global.__optimize && __optimize(f);\n  global.inspect = function() {\n    return f(true, false, h => h());\n  };\n})();\n"
  },
  {
    "path": "test/serializer/optimized-functions/InstantRenderArrayOps1.js",
    "content": "// instant render\n// does contain:42\n\nfunction f(c) {\n  var arr = Array.from(c);\n  let obj = { foo: 1 };\n\n  function op(x) {\n    return obj.foo + 41;\n  }\n\n  let mapped = arr.map(op);\n\n  return mapped;\n}\nglobal.__optimize && __optimize(f);\n\ninspect = () => f([0]);\n"
  },
  {
    "path": "test/serializer/optimized-functions/InstantRenderArrayOps2.js",
    "content": "// instant render\n// does contain:42\n\nfunction f(c) {\n  var arr = Array.from(c);\n  let foo = 1;\n\n  function op(x) {\n    return foo + 41;\n  }\n\n  let mapped = arr.map(op);\n\n  return mapped;\n}\nglobal.__optimize && __optimize(f);\n\ninspect = () => f([0]);\n"
  },
  {
    "path": "test/serializer/optimized-functions/InstantRenderArrayOpsBenignMutation.js",
    "content": "// instant render\n\nfunction f(c) {\n  var arr = Array.from(c);\n  let obj = { foo: 1 };\n\n  function op(x) {\n    return obj;\n  }\n\n  let mapped = arr.map(op);\n  obj.foo = 2; // Allowed - the non-final value of obj is not referenced\n\n  return obj;\n}\nglobal.__optimize && __optimize(f);\n\ninspect = () => JSON.stringify(f([0]));\n"
  },
  {
    "path": "test/serializer/optimized-functions/Issue1640ImplicitThis.js",
    "content": "(function() {\n  function f(x) {\n    this.x = 5 + x;\n    var self = this;\n    this.doSomething = function(y) {\n      return self.x + y;\n    };\n  }\n\n  if (global.__optimize) __optimize(f);\n\n  global.inspect = function() {\n    var obj = new f(10);\n    return obj.doSomething(20);\n  };\n})();\n"
  },
  {
    "path": "test/serializer/optimized-functions/Issue1856.js",
    "content": "let p = {};\nfunction f(c) {\n  let o = {};\n  if (c) {\n    o.__proto__ = p;\n    throw o;\n  }\n}\nif (global.__optimize) __optimize(f);\ninspect = function() {\n  try {\n    f(true);\n  } catch (e) {\n    return e.$Prototype === p;\n  }\n};\n"
  },
  {
    "path": "test/serializer/optimized-functions/Issue2151.js",
    "content": "function bad(v) {\n  if (v == null) {\n    return null;\n  }\n  var a = v.a,\n    b = v.b;\n  if (a == null || b == null) {\n    return a && b;\n  }\n  return v;\n}\n\nif (global.__optimize) __optimize(bad);\n\ninspect = function() {\n  return bad(null);\n};\n"
  },
  {
    "path": "test/serializer/optimized-functions/Issue2262Regression.js",
    "content": "(function() {\n  let p = {};\n  function f(c) {\n    let o = {};\n    if (c) {\n      if (global.__makePartial) __makePartial(o);\n      throw o;\n    }\n  }\n  if (global.__optimize) __optimize(f);\n  inspect = function() {\n    try {\n      f(true);\n      return false;\n    } catch (e) {\n      return true;\n    }\n  };\n})();\n"
  },
  {
    "path": "test/serializer/optimized-functions/Issue2266Regression.js",
    "content": "// expected Warning:\nfunction outer() {\n  function inner() {\n    return 42;\n  }\n  if (global.__optimize) __optimize(inner);\n  return inner;\n}\nif (global.__optimize) __optimize(outer);\nglobal.inspect = function() {\n  return outer()();\n};\n"
  },
  {
    "path": "test/serializer/optimized-functions/Issue2358-2.js",
    "content": "function fn(x, y, obj, cond) {\n  var arr = x;\n  var arr2 = y;\n\n  var a = obj.a;\n\n  var mapper1 = function(item) {\n    if (cond) {\n      return a;\n    }\n  };\n  global.__optimize && __optimize(mapper1);\n  var res = arr.map(mapper1);\n\n  var mapper2 = function(item) {\n    if (cond) {\n      return a;\n    }\n  };\n  global.__optimize && __optimize(mapper2);\n  var res2 = arr2.map(mapper2);\n\n  return [res, res2];\n}\n\nglobal.__optimize && __optimize(fn);\n\nglobal.inspect = function() {\n  return JSON.stringify(fn([1, 2], [3, 4], { a: 5 }, true));\n};\n"
  },
  {
    "path": "test/serializer/optimized-functions/Issue2358.js",
    "content": "// arrayNestedOptimizedFunctionsEnabled\n\nfunction fn(x, y, obj, cond) {\n  var arr = Array.from(x);\n  var arr2 = Array.from(y);\n\n  var a = obj.a;\n\n  var res = arr.map(function(item) {\n    if (cond) {\n      return a;\n    }\n  });\n\n  var res2 = arr2.map(function(item) {\n    if (cond) {\n      return a;\n    }\n  });\n\n  return [res, res2];\n}\n\nglobal.__optimize && __optimize(fn);\n\nglobal.inspect = function() {\n  return JSON.stringify(fn([1, 2], [3, 4], { a: 5 }, true));\n};\n"
  },
  {
    "path": "test/serializer/optimized-functions/Issue2359-1.js",
    "content": "// arrayNestedOptimizedFunctionsEnabled\n\nfunction fn(x, cond, abstractFunc) {\n  var arr = Array.from(x);\n\n  var a = {};\n\n  if (cond) {\n    abstractFunc(function() {\n      a = 1;\n    });\n\n    var z = a.x;\n\n    var res = arr.map(function() {\n      return z;\n    });\n  }\n\n  return res;\n}\n\nglobal.__optimize && __optimize(fn);\n\nglobal.inspect = function() {\n  return fn([1, 2], true, function(argF) {\n    argF();\n  });\n};\n"
  },
  {
    "path": "test/serializer/optimized-functions/Issue2359-2.js",
    "content": "function fn(arr, abstractFunc) {\n  var a = {};\n\n  abstractFunc(function() {\n    a = 1;\n  });\n\n  var z = a.x;\n\n  var mapper = function(item) {\n    return z;\n  };\n\n  global.__optimize && __optimize(mapper);\n  var res = arr.map(mapper);\n\n  return res;\n}\n\nglobal.__optimize && __optimize(fn);\n\nglobal.inspect = function() {\n  return fn([1, 2], function(argF) {\n    argF();\n  });\n};\n"
  },
  {
    "path": "test/serializer/optimized-functions/Issue2388.js",
    "content": "var foo;\n(function() {\n  function f() {\n    let x = 23;\n    function g() {\n      x = x + 1;\n      // x doesn't leak here\n    }\n    function h(gg) {\n      function hh() {\n        x = x + 1;\n      }\n      gg(hh); // leaks x\n    }\n    global.__optimize && __optimize(g);\n    global.__optimize && __optimize(h);\n    return [g, h];\n  }\n  global.__optimize && __optimize(f);\n  foo = f;\n})();\n\nglobal.inspect = function() {\n  let [g, h] = foo();\n  return h(g);\n};\n"
  },
  {
    "path": "test/serializer/optimized-functions/Issue2392-1.js",
    "content": "// arrayNestedOptimizedFunctionsEnabled\n\nfunction fn(x, obj, cond, cond4) {\n  var arr = Array.from(x);\n\n  var f = function(item) {\n    return cond4 ? a : 5;\n  };\n  if (cond) {\n    var a = obj.a;\n    return arr.map(f);\n  }\n}\n\nglobal.__optimize && __optimize(fn);\n\nglobal.inspect = function() {\n  return true;\n};\n"
  },
  {
    "path": "test/serializer/optimized-functions/Issue2392-2.js",
    "content": "// arrayNestedOptimizedFunctionsEnabled\n\nfunction fn(x, obj, cond, cond2, cond3, cond4) {\n  var arr = Array.from(x);\n  var a;\n  var b;\n  var res;\n\n  if (cond) {\n    a = obj.a;\n    if (cond2) {\n      b = obj.b;\n      if (cond3) {\n        res = arr.map(function(item) {\n          return cond4 ? a : b;\n        });\n      }\n    }\n  }\n  return res;\n}\n\nglobal.__optimize && __optimize(fn);\n\nglobal.inspect = function() {\n  return true;\n};\n"
  },
  {
    "path": "test/serializer/optimized-functions/Issue2398.js",
    "content": "// arrayNestedOptimizedFunctionsEnabled\n\nfunction fn(props, cond) {\n  var arr = Array.from(props.x);\n  var newObj;\n\n  if (cond) {\n    var _ref8;\n    var value =\n      (_ref8 = props.feedback) != null\n        ? (_ref8 = _ref8.display_comments) != null\n          ? _ref8.ordering_mode\n          : _ref8\n        : _ref8;\n\n    var fn2 = function() {\n      return value;\n    };\n\n    var res = arr.map(function(item) {\n      return item[value];\n    });\n  }\n\n  return [res, fn2];\n}\n\nglobal.__optimize && __optimize(fn);\n\nglobal.inspect = function() {\n  let [res, fn2] = fn(\n    {\n      x: [1, 2],\n      feedback: {\n        display_comments: {\n          ordering_mode: \"foo\",\n        },\n      },\n    },\n    true\n  );\n  res.push(fn2());\n  return JSON.stringify(res);\n};\n"
  },
  {
    "path": "test/serializer/optimized-functions/Issue2399.js",
    "content": "(function() {\n  function outer(cond) {\n    if (cond) {\n      var value = 42;\n      function inner1() {\n        return value;\n      }\n      function inner2() {\n        return value;\n      }\n      global.__optimize && __optimize(inner1);\n      global.__optimize && __optimize(inner2);\n      return [inner1, inner2];\n    }\n  }\n  global.outer = outer;\n  global.__optimize && __optimize(outer);\n\n  global.inspect = function() {\n    let [i1, i2] = outer(true);\n    return i1() + i2();\n  };\n})();\n"
  },
  {
    "path": "test/serializer/optimized-functions/Issue2422.js",
    "content": "// does not contain:23\n(function() {\n  function f(c) {\n    let h;\n    if (c) {\n      h = function() {\n        return 23 + 42;\n      };\n      function g() {\n        return h();\n      }\n      global.__optimize && __optimize(g);\n      return g;\n    }\n  }\n  global.__optimize && __optimize(f);\n  global.f = f;\n\n  global.inspect = function() {\n    f(true)();\n  };\n})();\n"
  },
  {
    "path": "test/serializer/optimized-functions/Issue2423.js",
    "content": "// does not contain:23\n(function() {\n  function f(c) {\n    let h;\n    if (c) {\n      h = function() {\n        return 23 + 42;\n      };\n      function g() {\n        return h();\n      }\n      global.__optimize && __optimize(g);\n      return g;\n    }\n  }\n  global.__optimize && __optimize(f);\n  global.f = f;\n\n  global.inspect = function() {\n    return f(true)();\n  };\n})();\n"
  },
  {
    "path": "test/serializer/optimized-functions/LeakObjectWithSetter.js",
    "content": "(function() {\n  function f(g) {\n    let o = {\n      foo: 1,\n      set x(v) {\n        this.foo += 1;\n      },\n    };\n    g(o);\n    return o;\n  }\n\n  global.__optimize && __optimize(f);\n  inspect = () => {\n    JSON.stringify(f(o => o));\n  };\n})();\n"
  },
  {
    "path": "test/serializer/optimized-functions/LeakedCustomObjectInMultipleScopes.js",
    "content": "function f(g, c) {\n  let o = { foo: {} };\n  o.__proto__ = {};\n\n  if (c) {\n    g(o);\n  } else {\n    o.foo = { bar: 5 };\n    g(o);\n  }\n  return o;\n}\n\nglobal.__optimize && __optimize(f);\ninspect = function() {\n  return f(o => o);\n};\n"
  },
  {
    "path": "test/serializer/optimized-functions/LeakedObjectCodeDuplication.js",
    "content": "// Copies of 42:1\nfunction f(g) {\n  var o = {};\n  o.foo = 42;\n  g(o);\n  return o;\n}\n\nglobal.__optimize && __optimize(f);\ninspect = function() {\n  return f(o => o);\n};\n"
  },
  {
    "path": "test/serializer/optimized-functions/LoopBailout.js",
    "content": "function fn(props, splitPoint) {\n  var text = props.text || \"\";\n\n  text = text.replace(/\\s*$/, \"\");\n\n  if (splitPoint !== null) {\n    while (text[splitPoint - 1] === \"\\n\") {\n      splitPoint--;\n    }\n  }\n  return splitPoint;\n}\n\nglobal.__optimize && __optimize(fn);\n\ninspect = function() {\n  return fn({ text: \"foo\\nfoo\" }, 5);\n};\n"
  },
  {
    "path": "test/serializer/optimized-functions/LoopBailout10.js",
    "content": "function fn(x, counter) {\n  var i = 0;\n  for (; i !== x; ) {\n    counter.x++;\n    i++;\n    var val1 = counter.x,\n      val2 = val1 + 1;\n  }\n  return val2;\n}\n\nglobal.__optimize && __optimize(fn);\n\ninspect = function() {\n  return fn(100, { x: 2 });\n};\n"
  },
  {
    "path": "test/serializer/optimized-functions/LoopBailout11.js",
    "content": "function fn(x, counter) {\n  var i = 0;\n  var val2 = undefined;\n  for (; i !== x; ) {\n    counter.x++;\n    i++;\n    val2 = i;\n  }\n  return val2;\n}\n\nglobal.__optimize && __optimize(fn);\n\ninspect = function() {\n  return fn(100, { x: 2 });\n};\n"
  },
  {
    "path": "test/serializer/optimized-functions/LoopBailout12.js",
    "content": "function fn(x, counter) {\n  var i = 0;\n  var val2 = undefined;\n  for (; i !== x; ) {\n    var foo = {};\n    counter.x++;\n    i++;\n    foo.x = x;\n  }\n  return foo;\n}\n\nglobal.__optimize && __optimize(fn);\n\ninspect = function() {\n  return fn(100, { x: 2 }).x;\n};\n"
  },
  {
    "path": "test/serializer/optimized-functions/LoopBailout13.js",
    "content": "function fn(x, counter) {\n  var i = 0;\n  var val2 = undefined;\n  for (; i !== x; ) {\n    var foo = {};\n    counter.x++;\n    i++;\n    foo.counter = counter;\n  }\n  return foo;\n}\n\nglobal.__optimize && __optimize(fn);\n\ninspect = function() {\n  return fn(100, { x: 2 }).counter.x;\n};\n"
  },
  {
    "path": "test/serializer/optimized-functions/LoopBailout14.js",
    "content": "function fn(x, counter) {\n  var i = 0;\n  var val2 = undefined;\n  for (; i !== x; ) {\n    var foo = {};\n    counter.x++;\n    i++;\n    foo.counter = counter;\n  }\n  return foo.counter.x + 10;\n}\n\nglobal.__optimize && __optimize(fn);\n\ninspect = function() {\n  return fn(100, { x: 2 });\n};\n"
  },
  {
    "path": "test/serializer/optimized-functions/LoopBailout15.js",
    "content": "function fn(secondaryPattern, replaceWith, wholeNumber) {\n  var replaced;\n  while ((replaced = wholeNumber.replace(secondaryPattern, replaceWith)) != wholeNumber) {\n    wholeNumber = replaced;\n  }\n  return wholeNumber;\n}\n\nglobal.__optimize && __optimize(fn);\n\ninspect = function() {\n  return fn(\"1\", \"2\", \"121341\");\n};\n"
  },
  {
    "path": "test/serializer/optimized-functions/LoopBailout16.js",
    "content": "function fn(x, total, val) {\n  var replaced;\n  let wholeNumber = val.toString();\n  if (x === true) {\n    for (var i = 0; i < total; i++) {\n      wholeNumber++;\n    }\n  }\n  return wholeNumber;\n}\n\nglobal.__optimize && __optimize(fn);\n\ninspect = function() {\n  return fn(false, 10, 5);\n};\n"
  },
  {
    "path": "test/serializer/optimized-functions/LoopBailout17.js",
    "content": "(function() {\n  global._DateFormatConfig = {\n    formats: {\n      \"l, F j, Y\": \"l, F j, Y\",\n    },\n  };\n\n  var DateFormatConfig = global.__abstract ? __abstract({}, \"(global._DateFormatConfig)\") : global._DateFormatConfig;\n  global.__makeSimple && __makeSimple(DateFormatConfig);\n\n  var MONTH_NAMES = void 0;\n  var WEEKDAY_NAMES = void 0;\n\n  var DateStrings = {\n    getWeekdayName: function getWeekdayName(weekday) {\n      if (!WEEKDAY_NAMES) {\n        WEEKDAY_NAMES = [\"Sunday\", \"Monday\", \"Tuesday\", \"Wednesday\", \"Thursday\", \"Friday\", \"Saturday\"];\n      }\n\n      return WEEKDAY_NAMES[weekday];\n    },\n    _initializeMonthNames: function _initializeMonthNames() {\n      MONTH_NAMES = [\n        \"January\",\n        \"February\",\n        \"March\",\n        \"April\",\n        \"May\",\n        \"June\",\n        \"July\",\n        \"August\",\n        \"September\",\n        \"October\",\n        \"November\",\n        \"December\",\n      ];\n    },\n\n    getMonthName: function getMonthName(month) {\n      if (!MONTH_NAMES) {\n        DateStrings._initializeMonthNames();\n      }\n\n      return MONTH_NAMES[month - 1];\n    },\n  };\n\n  function formatDate(date, format, options) {\n    options = options || {};\n\n    if (typeof date === \"string\") {\n      date = parseInt(date, 10);\n    }\n    if (typeof date === \"number\") {\n      date = new Date(date * 1000);\n    }\n    var localizedFormat = DateFormatConfig.formats[format];\n    var prefix = \"getUTC\";\n    var dateDay = date[prefix + \"Date\"]();\n    var dateDayOfWeek = date[prefix + \"Day\"]();\n    var dateMonth = date[prefix + \"Month\"]();\n    var dateYear = date[prefix + \"FullYear\"]();\n\n    var output = \"\";\n    for (var i = 0; i < localizedFormat.length; i++) {\n      var character = localizedFormat.charAt(i);\n\n      switch (character) {\n        case \"j\":\n          output += dateDay;\n          break;\n        case \"l\":\n          output += DateStrings.getWeekdayName(dateDayOfWeek);\n          break;\n        case \"F\":\n        case \"f\":\n          output += DateStrings.getMonthName(dateMonth + 1);\n          break;\n        case \"Y\":\n          output += dateYear;\n          break;\n        default:\n          output += character;\n      }\n    }\n\n    return output;\n  }\n\n  function fn(a, b) {\n    return formatDate(a, \"l, F j, Y\");\n  }\n\n  global.fn = fn;\n\n  global.__optimize && __optimize(fn);\n\n  global.inspect = function() {\n    return JSON.stringify(global.fn(\"1529579851072\"));\n  };\n})();\n"
  },
  {
    "path": "test/serializer/optimized-functions/LoopBailout18.js",
    "content": "function fn(x) {\n  for (\n    var _iterator = x.entries(),\n      _isArray = Array.isArray(_iterator),\n      _i = 0,\n      _iterator = _isArray ? _iterator : _iterator[Symbol.iterator]();\n    ;\n\n  ) {\n    // ...\n\n    var _ref;\n\n    if (_isArray) {\n      if (_i >= _iterator.length) break;\n      _ref = _iterator[_i++];\n    } else {\n      _i = _iterator.next();\n      if (_i.done) break;\n      _ref = _i.value;\n    }\n\n    var item = _ref;\n  }\n}\n\nglobal.__optimize && __optimize(fn);\n\ninspect = function() {\n  return JSON.stringify(fn([1, 2, 3, 4, 5]));\n};\n"
  },
  {
    "path": "test/serializer/optimized-functions/LoopBailout19.js",
    "content": "function fn(x, oldItems) {\n  var items = [];\n  for (var i; i < x; ) {\n    i++;\n    var oldItem = oldItems[i];\n    items.push(oldItem + 2);\n  }\n  return items;\n}\n\nglobal.__optimize && __optimize(fn);\n\ninspect = function() {\n  return JSON.stringify(fn(5, [1, 2, 3, 4, 5]));\n};\n"
  },
  {
    "path": "test/serializer/optimized-functions/LoopBailout2.js",
    "content": "function fn(x, oldItems) {\n  var items = [];\n  for (let i = 0; i < x; i++) {\n    var oldItem = oldItems[i];\n    items.push(oldItem + 2);\n  }\n  return items;\n}\n\nglobal.__optimize && __optimize(fn);\n\ninspect = function() {\n  return JSON.stringify(fn(5, [1, 2, 3, 4, 5]));\n};\n"
  },
  {
    "path": "test/serializer/optimized-functions/LoopBailout3.js",
    "content": "function Model(x, oldItems) {\n  this.oldItems = oldItems;\n  var items = [];\n  for (let i = 0; i < x; i++) {\n    var oldItem = this.oldItems[i];\n    items.push(oldItem + 2);\n  }\n  this.items = items;\n}\n\nglobal.__optimize && __optimize(Model);\n\ninspect = function() {\n  var model = new Model(5, [1, 2, 3, 4, 5]);\n  return JSON.stringify(model.items);\n};\n"
  },
  {
    "path": "test/serializer/optimized-functions/LoopBailout4.js",
    "content": "function Model(x, oldItems) {\n  this.items = [];\n  for (let i = 0; i < x; i++) {\n    var oldItem = oldItems[i];\n    this.items.push(oldItem + 2);\n  }\n}\n\nglobal.__optimize && __optimize(Model);\n\ninspect = function() {\n  var model = new Model(5, [1, 2, 3, 4, 5]);\n  return JSON.stringify(model.items);\n};\n"
  },
  {
    "path": "test/serializer/optimized-functions/LoopBailout5.js",
    "content": "function Model(x, oldItems) {\n  this.items = [];\n  for (let i = 0; i < 10; i++) {\n    for (let i = 0; i < x; i++) {\n      var oldItem = oldItems[i];\n      this.items.push(oldItem + 2);\n    }\n  }\n}\n\nglobal.__optimize && __optimize(Model);\n\ninspect = function() {\n  var model = new Model(5, [1, 2, 3, 4, 5]);\n  return JSON.stringify(model.items);\n};\n"
  },
  {
    "path": "test/serializer/optimized-functions/LoopBailout6.js",
    "content": "function fn(x, oldItems) {\n  var items = [];\n  var i = 0;\n  while (i < x) {\n    var oldItem = oldItems[i];\n    items.push(oldItem + 2);\n    i++;\n  }\n  return items;\n}\n\nglobal.__optimize && __optimize(fn);\n\ninspect = function() {\n  return JSON.stringify(fn(5, [1, 2, 3, 4, 5]));\n};\n"
  },
  {
    "path": "test/serializer/optimized-functions/LoopBailout7.js",
    "content": "// expected Warning,RecoverableError: PP1007, PP0023, PP1002\n// throws introspection error\nfunction fn(x, oldItems) {\n  var items = [];\n  for (; i !== x; ) {\n    var oldItem = oldItems[i];\n    items.push(oldItem + 2);\n    i++;\n  }\n  return items;\n}\n\nglobal.__optimize && __optimize(fn);\n\ninspect = function() {\n  return JSON.stringify(fn(5, [1, 2, 3, 4, 5]));\n};\n"
  },
  {
    "path": "test/serializer/optimized-functions/LoopBailout8.js",
    "content": "function fn(x, counter) {\n  var i = 0;\n  for (; i !== x; ) {\n    counter.x++;\n    i++;\n  }\n  return counter.x;\n}\n\nglobal.__optimize && __optimize(fn);\n\ninspect = function() {\n  return fn(100, { x: 2 });\n};\n"
  },
  {
    "path": "test/serializer/optimized-functions/LoopBailout9.js",
    "content": "function fn(x, counter) {\n  var i = 0;\n  for (; i !== x; ) {\n    counter.x++;\n    i++;\n    var val = counter.x;\n  }\n  return val;\n}\n\nglobal.__optimize && __optimize(fn);\n\ninspect = function() {\n  return fn(100, { x: 2 });\n};\n"
  },
  {
    "path": "test/serializer/optimized-functions/MissingModifiedBinding.js",
    "content": "(function() {\n  function mkLocation() {\n    var x;\n    function setter(y) {\n      x = y;\n    }\n    function getter() {\n      return x;\n    }\n    if (global.__optimize) __optimize(setter);\n    return { setter, getter };\n  }\n  if (global.__optimize) __optimize(mkLocation);\n  global.inspect = function() {\n    var l = mkLocation();\n    l.setter(42);\n    return l.getter();\n  };\n})();\n"
  },
  {
    "path": "test/serializer/optimized-functions/ModifiedResidualBindings.js",
    "content": "let outermost;\nfunction foo() {\n  let inner1 = 0;\n  return [() => inner1, () => inner1++];\n}\n(function() {\n  let outer;\n  let [getter, incrementer] = foo();\n  function toOptimize() {\n    let inner2;\n    incrementer();\n    return getter();\n  }\n  global.bar = toOptimize;\n  global.getter = getter;\n  global.__optimize && global.__optimize(toOptimize);\n})();\n\nglobal.inspect = function() {\n  let x = global.getter();\n  let y = global.bar();\n  let z = global.getter();\n  return x + \" \" + y + \" \" + z;\n};\n"
  },
  {
    "path": "test/serializer/optimized-functions/ModifiedResidualBindings2.js",
    "content": "let outermost;\nfunction foo() {\n  let inner1 = 0;\n  return [() => inner1, () => inner1++];\n}\nglobal.__optimize && global.__optimize(foo);\n(function() {\n  let outer;\n  let [getter, incrementer] = foo();\n  function toOptimize() {\n    let inner2;\n    incrementer();\n    return getter();\n  }\n  global.bar = toOptimize;\n  global.getter = getter;\n  global.__optimize && global.__optimize(toOptimize);\n})();\n\nglobal.inspect = function() {\n  let x = global.getter();\n  let y = global.bar();\n  let z = global.getter();\n  return x + \" \" + y + \" \" + z;\n};\n"
  },
  {
    "path": "test/serializer/optimized-functions/ModifiedResidualBindings3.js",
    "content": "let outermost;\n(function() {\n  let outer = 0;\n  function toOptimize() {\n    function foo() {\n      let inner1 = outer;\n      return [() => inner1, () => inner1++];\n    }\n    global.__optimize && global.__optimize(foo);\n    let [getter, incrementer] = foo();\n    let inner2;\n    global.getter = getter;\n    incrementer();\n    return getter();\n  }\n  global.bar = toOptimize;\n  global.__optimize && global.__optimize(toOptimize);\n})();\n\nglobal.inspect = function() {\n  let x = global.getter();\n  let y = global.bar();\n  let z = global.getter();\n  return x + \" \" + y + \" \" + z;\n};\n"
  },
  {
    "path": "test/serializer/optimized-functions/NestedConditions.js",
    "content": "(function() {\n  function fn1(arg) {\n    if (arg.foo) {\n      if (arg.bar) {\n        return 1;\n      } else {\n        // return 2;\n      }\n    } else {\n      // return 3;\n    }\n  }\n\n  function fn2(arg) {\n    if (arg.foo) {\n      if (arg.bar) {\n        // return 1;\n      } else {\n        return 2;\n      }\n    } else {\n      // return 3;\n    }\n  }\n\n  function fn3(arg) {\n    if (arg.foo) {\n      if (arg.bar) {\n        // return 1;\n      } else {\n        // return 2;\n      }\n    } else {\n      return 3;\n    }\n  }\n\n  function fn4(arg) {\n    if (arg.foo) {\n      if (arg.bar) {\n        return 1;\n      } else {\n        return 2;\n      }\n    } else {\n      // return 3;\n    }\n  }\n\n  function fn5(arg) {\n    if (arg.foo) {\n      if (arg.bar) {\n        return 1;\n      } else {\n        // return 2;\n      }\n    } else {\n      return 3;\n    }\n  }\n\n  function fn6(arg) {\n    if (arg.foo) {\n      if (arg.bar) {\n        // return 1;\n      } else {\n        return 2;\n      }\n    } else {\n      return 3;\n    }\n  }\n\n  function fn7(arg) {\n    if (arg.foo) {\n      if (arg.bar) {\n        return 1;\n      } else {\n        return 2;\n      }\n    } else {\n      return 3;\n    }\n  }\n\n  function fn8(arg) {\n    if (arg.foo) {\n      // return 3;\n    } else {\n      if (arg.bar) {\n        return 1;\n      } else {\n        // return 2;\n      }\n    }\n  }\n\n  function fn9(arg) {\n    if (arg.foo) {\n      // return 3;\n    } else {\n      if (arg.bar) {\n        // return 1;\n      } else {\n        return 2;\n      }\n    }\n  }\n\n  function fn10(arg) {\n    if (arg.foo) {\n      return 3;\n    } else {\n      if (arg.bar) {\n        // return 1;\n      } else {\n        // return 2;\n      }\n    }\n  }\n\n  function fn11(arg) {\n    if (arg.foo) {\n      // return 3;\n    } else {\n      if (arg.bar) {\n        return 1;\n      } else {\n        return 2;\n      }\n    }\n  }\n\n  function fn12(arg) {\n    if (arg.foo) {\n      return 3;\n    } else {\n      if (arg.bar) {\n        return 1;\n      } else {\n        // return 2;\n      }\n    }\n  }\n\n  function fn13(arg) {\n    if (arg.foo) {\n      return 3;\n    } else {\n      if (arg.bar) {\n        // return 1;\n      } else {\n        return 2;\n      }\n    }\n  }\n\n  function fn14(arg) {\n    if (arg.foo) {\n      return 3;\n    } else {\n      if (arg.bar) {\n        return 1;\n      } else {\n        return 2;\n      }\n    }\n  }\n\n  function fn15(arg) {\n    if (arg.foo) {\n      if (arg.bar) {\n        return 1;\n      } else {\n        // return 2;\n      }\n    } else {\n      if (arg.qux) {\n        // return 3;\n      } else {\n        // return 4;\n      }\n    }\n  }\n\n  function fn16(arg) {\n    if (arg.foo) {\n      if (arg.bar) {\n        // return 1;\n      } else {\n        return 2;\n      }\n    } else {\n      if (arg.qux) {\n        // return 3;\n      } else {\n        // return 4;\n      }\n    }\n  }\n\n  function fn17(arg) {\n    if (arg.foo) {\n      if (arg.bar) {\n        // return 1;\n      } else {\n        // return 2;\n      }\n    } else {\n      if (arg.qux) {\n        return 3;\n      } else {\n        // return 4;\n      }\n    }\n  }\n\n  function fn18(arg) {\n    if (arg.foo) {\n      if (arg.bar) {\n        // return 1;\n      } else {\n        // return 2;\n      }\n    } else {\n      if (arg.qux) {\n        // return 3;\n      } else {\n        return 4;\n      }\n    }\n  }\n\n  function fn19(arg) {\n    if (arg.foo) {\n      if (arg.bar) {\n        return 1;\n      } else {\n        return 2;\n      }\n    } else {\n      if (arg.qux) {\n        // return 3;\n      } else {\n        // return 4;\n      }\n    }\n  }\n\n  function fn20(arg) {\n    if (arg.foo) {\n      if (arg.bar) {\n        return 1;\n      } else {\n        // return 2;\n      }\n    } else {\n      if (arg.qux) {\n        return 3;\n      } else {\n        // return 4;\n      }\n    }\n  }\n\n  function fn21(arg) {\n    if (arg.foo) {\n      if (arg.bar) {\n        return 1;\n      } else {\n        // return 2;\n      }\n    } else {\n      if (arg.qux) {\n        // return 3;\n      } else {\n        return 4;\n      }\n    }\n  }\n\n  function fn22(arg) {\n    if (arg.foo) {\n      if (arg.bar) {\n        // return 1;\n      } else {\n        return 2;\n      }\n    } else {\n      if (arg.qux) {\n        return 3;\n      } else {\n        // return 4;\n      }\n    }\n  }\n\n  function fn23(arg) {\n    if (arg.foo) {\n      if (arg.bar) {\n        // return 1;\n      } else {\n        return 2;\n      }\n    } else {\n      if (arg.qux) {\n        // return 3;\n      } else {\n        return 4;\n      }\n    }\n  }\n\n  function fn24(arg) {\n    if (arg.foo) {\n      if (arg.bar) {\n        // return 1;\n      } else {\n        // return 2;\n      }\n    } else {\n      if (arg.qux) {\n        return 3;\n      } else {\n        return 4;\n      }\n    }\n  }\n\n  function fn25(arg) {\n    if (arg.foo) {\n      if (arg.bar) {\n        // return 1;\n      } else {\n        return 2;\n      }\n    } else {\n      if (arg.qux) {\n        return 3;\n      } else {\n        return 4;\n      }\n    }\n  }\n\n  function fn26(arg) {\n    if (arg.foo) {\n      if (arg.bar) {\n        return 1;\n      } else {\n        // return 2;\n      }\n    } else {\n      if (arg.qux) {\n        return 3;\n      } else {\n        return 4;\n      }\n    }\n  }\n\n  function fn27(arg) {\n    if (arg.foo) {\n      if (arg.bar) {\n        return 1;\n      } else {\n        return 2;\n      }\n    } else {\n      if (arg.qux) {\n        // return 3;\n      } else {\n        return 4;\n      }\n    }\n  }\n\n  function fn28(arg) {\n    if (arg.foo) {\n      if (arg.bar) {\n        return 1;\n      } else {\n        return 2;\n      }\n    } else {\n      if (arg.qux) {\n        return 3;\n      } else {\n        // return 4;\n      }\n    }\n  }\n\n  function fn29(arg) {\n    if (arg.foo) {\n      if (arg.bar) {\n        return 1;\n      } else {\n        return 2;\n      }\n    } else {\n      if (arg.qux) {\n        return 3;\n      } else {\n        return 4;\n      }\n    }\n  }\n\n  if (global.__optimize) {\n    __optimize(fn1);\n    __optimize(fn2);\n    __optimize(fn3);\n    __optimize(fn4);\n    __optimize(fn5);\n    __optimize(fn6);\n    __optimize(fn7);\n    __optimize(fn8);\n    __optimize(fn9);\n    __optimize(fn10);\n    __optimize(fn11);\n    __optimize(fn12);\n    __optimize(fn13);\n    __optimize(fn14);\n    __optimize(fn15);\n    __optimize(fn16);\n    __optimize(fn17);\n    __optimize(fn18);\n    __optimize(fn19);\n    __optimize(fn20);\n    __optimize(fn21);\n    __optimize(fn22);\n    __optimize(fn23);\n    __optimize(fn24);\n    __optimize(fn25);\n    __optimize(fn26);\n    __optimize(fn27);\n    __optimize(fn28);\n    __optimize(fn29);\n  }\n\n  global.inspect = function() {\n    const cases = [\n      { foo: true, bar: true },\n      { foo: false, bar: true },\n      { foo: true, bar: false },\n      { foo: false, bar: false },\n    ];\n    return JSON.stringify([\n      ...cases.map(fn1),\n      ...cases.map(fn2),\n      ...cases.map(fn3),\n      ...cases.map(fn4),\n      ...cases.map(fn5),\n      ...cases.map(fn6),\n      ...cases.map(fn7),\n      ...cases.map(fn8),\n      ...cases.map(fn9),\n      ...cases.map(fn10),\n      ...cases.map(fn11),\n      ...cases.map(fn12),\n      ...cases.map(fn13),\n      ...cases.map(fn14),\n      ...cases.map(fn15),\n      ...cases.map(fn16),\n      ...cases.map(fn17),\n      ...cases.map(fn18),\n      ...cases.map(fn19),\n      ...cases.map(fn20),\n      ...cases.map(fn21),\n      ...cases.map(fn22),\n      ...cases.map(fn23),\n      ...cases.map(fn24),\n      ...cases.map(fn25),\n      ...cases.map(fn26),\n      ...cases.map(fn27),\n      ...cases.map(fn28),\n      ...cases.map(fn29),\n    ]);\n  };\n})();\n"
  },
  {
    "path": "test/serializer/optimized-functions/NestedConditionsRedeclare.js",
    "content": "(function() {\n  function fn(arg) {\n    if (arg.foo()) {\n      if (arg.bar()) {\n        return 42;\n      }\n    }\n  }\n\n  if (global.__optimize) {\n    __optimize(fn);\n  }\n\n  global.inspect = function() {\n    let count = 0;\n    fn({ foo: () => (count++, true), bar: () => (count++, true) });\n    return count;\n  };\n})();\n"
  },
  {
    "path": "test/serializer/optimized-functions/NestedConditionsRightPath.js",
    "content": "(function() {\n  function fn(arg) {\n    if (arg.foo()) {\n      if (arg.bar()) {\n        return 1;\n      }\n    } else {\n      return 2;\n    }\n  }\n\n  if (global.__optimize) {\n    __optimize(fn);\n  }\n\n  global.inspect = function() {\n    let count = 0;\n    fn({ foo: () => (count++, false), bar: () => (count++, true) });\n    return count;\n  };\n})();\n"
  },
  {
    "path": "test/serializer/optimized-functions/NestedOptimizeSameFunction.js",
    "content": "// expected RecoverableError: PP1009\n// does not contain: = 5\n\nfunction fn() {\n  let garbage = 5;\n  return \"hello\";\n}\n\nfunction outer() {\n  let garbage = 5;\n  global.__optimize && __optimize(fn);\n  return \"world\";\n}\n\nglobal.__optimize && __optimize(fn);\nglobal.__optimize && __optimize(outer);\n\ninspect = function() {\n  return outer() + \" \" + fn();\n};\n"
  },
  {
    "path": "test/serializer/optimized-functions/NestedTemporalJoinConditions.js",
    "content": "function fn(str, start, length) {\n  var size = str.length;\n  var posA = 0;\n  if (start > 0) {\n    if (posA >= size) {\n      return posA;\n    }\n  }\n}\n\nif (global.__optimize) __optimize(fn);\n\nglobal.inspect = function() {\n  return true;\n};\n"
  },
  {
    "path": "test/serializer/optimized-functions/NullCheck.js",
    "content": "function func1(v) {\n  if (v == null) return null;\n  var a = v.a;\n  if (a == null) return null;\n  return a;\n}\n\nif (global.__optimize) __optimize(func1);\n\ninspect = function() {\n  return func1();\n};\n"
  },
  {
    "path": "test/serializer/optimized-functions/NullThrows.js",
    "content": "var x = global.__abstract ? (x = __abstract(undefined, \"({ check: true })\")) : { check: true };\n\nfunction nullthrows(x) {\n  var message = arguments.length <= 1 || arguments[1] === undefined ? \"Got unexpected null or undefined\" : arguments[1];\n  if (x != null) {\n    return x;\n  }\n  var error = new Error(message);\n\n  error.framesToPop = 1;\n  throw error;\n}\n\nfunction func1() {\n  nullthrows(x.check);\n  return {\n    check: x.check,\n  };\n}\n\nif (global.__optimize) __optimize(func1);\n\ninspect = function() {\n  return func1();\n};\n"
  },
  {
    "path": "test/serializer/optimized-functions/ObjectAssign.js",
    "content": "// Copies of .assign;:1\nglobal.f = function(x, y) {\n  if (y) return Object.assign({}, x);\n  else throw new Error();\n};\n\nif (global.__optimize) __optimize(f);\n\nglobal.inspect = function() {\n  return global.f({ p: 42 }, true).p;\n};\n"
  },
  {
    "path": "test/serializer/optimized-functions/ObjectAssign2.js",
    "content": "// does contain:10\n\nfunction fn(source1) {\n  var target = {};\n  var usefulStuff = {\n    makeNumber() {\n      return 5;\n    },\n  };\n  Object.assign(target, source1, usefulStuff);\n\n  return target.makeNumber() + 5;\n}\n\nglobal.__optimize && __optimize(fn);\n\ninspect = function() {\n  return fn({});\n};\n"
  },
  {
    "path": "test/serializer/optimized-functions/ObjectAssign3.js",
    "content": "// does contain:12\n\nfunction fn(source1, source2) {\n  var target = {};\n  var usefulStuff = {\n    makeNumber() {\n      return 5;\n    },\n  };\n\n  var usefulStuff2 = {\n    makeNumber() {\n      return 7;\n    },\n  };\n  Object.assign(target, source1, usefulStuff, source2, usefulStuff2);\n\n  return target.makeNumber() + 5;\n}\n\nglobal.__optimize && __optimize(fn);\n\ninspect = function() {\n  return fn({}, {});\n};\n"
  },
  {
    "path": "test/serializer/optimized-functions/ObjectAssign4.js",
    "content": "// does not contain:12\n\nfunction fn(source1, source2, someAbstract) {\n  var target = {};\n  var usefulStuff = {\n    makeNumber() {\n      return 5;\n    },\n  };\n\n  var usefulStuff2 = {\n    makeNumber() {\n      return 7;\n    },\n  };\n  someAbstract(usefulStuff2);\n  Object.assign(target, source1, usefulStuff, source2, usefulStuff2);\n\n  return target.makeNumber() + 5;\n}\n\nglobal.__optimize && __optimize(fn);\n\ninspect = function() {\n  return fn({}, {}, function() {});\n};\n"
  },
  {
    "path": "test/serializer/optimized-functions/ObjectAssign5.js",
    "content": "// does not contain:12\n\nfunction fn(source1, source2, someAbstract) {\n  var target = {};\n  var usefulStuff = {\n    makeNumber() {\n      return 5;\n    },\n  };\n\n  var usefulStuff2 = {\n    makeNumber() {\n      return 7;\n    },\n  };\n  someAbstract(usefulStuff2);\n  Object.assign(target, source1, undefined, usefulStuff, null, source2, usefulStuff2);\n\n  return target.makeNumber() + 5;\n}\n\nglobal.__optimize && __optimize(fn);\n\ninspect = function() {\n  return fn({}, {}, function() {});\n};\n"
  },
  {
    "path": "test/serializer/optimized-functions/ObjectAssign6.js",
    "content": "function fn(abstract) {\n  var a = Object.assign({}, { x: 1 }, abstract);\n  return a.x;\n}\n\nglobal.__optimize && __optimize(fn);\n\ninspect = function() {\n  return fn({ x: 2 });\n};\n"
  },
  {
    "path": "test/serializer/optimized-functions/ObjectAssign7.js",
    "content": "// does not contain:Object.assign\n\nfunction fn(abstract) {\n  var a = Object.assign({}, { x: 1 }, abstract, { x: 25 });\n  return a.x;\n}\n\nglobal.__optimize && __optimize(fn);\n\ninspect = function() {\n  return fn({ x: 2 });\n};\n"
  },
  {
    "path": "test/serializer/optimized-functions/ObjectAssign8.js",
    "content": "// Copies of return 1;:1\n// We essentially expect \"fn\" to optimize to \"function () { return 1; }\"\n\nfunction fn() {\n  var a = {};\n  var b = {\n    prop1: 1,\n    prop2: 2,\n  };\n  global.__makePartial && __makePartial(b);\n  global.__makeSimple && __makeSimple(b);\n  var c = {\n    prop3: 3,\n    prop4: 4,\n  };\n  Object.assign(a, b, c);\n  return a.prop1;\n}\n\nglobal.__optimize && __optimize(fn);\n\ninspect = function() {\n  return fn();\n};\n"
  },
  {
    "path": "test/serializer/optimized-functions/ObjectAssign9.js",
    "content": "function fn2(shouldError) {\n  if (shouldError) {\n    throw new Error(\"Error\");\n  }\n  return {\n    thisValueShouldExist: true,\n  };\n}\n\nfunction fn(shouldError) {\n  var a = Object.assign({}, fn2(shouldError));\n  return a.thisValueShouldExist;\n}\n\nthis.__optimize && __optimize(fn);\n\ninspect = function() {\n  return fn(false);\n};\n"
  },
  {
    "path": "test/serializer/optimized-functions/ObjectAssignProps.js",
    "content": "function MaybeThrow(props) {\n  if (props.b === false) {\n    return \"Good\";\n  }\n  throw new Error(\"no\");\n}\n\nfunction App(props) {\n  if (props.a === true) {\n    var newProps = {};\n\n    Object.assign(newProps, props, {\n      children: \"div\",\n    });\n    return MaybeThrow(newProps);\n  }\n  return \"Bad\";\n}\n\ninspect = function() {\n  return App({ a: true, b: false });\n};\n\nif (this.__optimize) __optimize(App);\n"
  },
  {
    "path": "test/serializer/optimized-functions/OptimizeInSpeculativeContext.js",
    "content": "// does not contain:= 5\nlet obj1 = global.__abstract\n  ? __abstract(\"object\", '({get foo() { return \"bar\"; }})')\n  : {\n      get foo() {\n        return \"bar\";\n      },\n    };\nlet obj2 = global.__abstract ? __abstract(\"object\", '({foo:{bar:\"baz\"}})') : { foo: { bar: \"baz\" } };\nif (global.__makeSimple) {\n  __makeSimple(obj2);\n}\n\nfunction additional1() {\n  function foo() {\n    let garbage = 5;\n    return 2;\n  }\n  if (global.__optimize) __optimize(foo);\n  global.foo = foo;\n  return String(obj1.foo);\n}\n\nfunction additional2() {\n  function bar() {\n    let garbage = 5;\n    return 5;\n  }\n  if (global.__optimize) __optimize(bar);\n  global.bar = bar;\n  return String(obj2.foo.bar);\n}\n\nif (global.__optimize) {\n  __optimize(additional1);\n  __optimize(additional2);\n}\n\ninspect = function() {\n  let ret2 = additional2();\n  let ret1 = additional1();\n  ret1 + \" \" + global.foo() + \" \" + global.bar();\n  return ret1 + ret2;\n};\n"
  },
  {
    "path": "test/serializer/optimized-functions/OptimizedConditionalFunction.js",
    "content": "// does not contain:1 + 2\n(function() {\n  let f = (global.__abstract\n  ? __abstract(\"boolean\", \"true\")\n  : true)\n    ? {\n        g: function g() {\n          return 1 + 2;\n        },\n      }\n    : {};\n  if (global.__optimize) __optimize(f.g);\n  global.inspect = function() {\n    return f.g();\n  };\n})();\n"
  },
  {
    "path": "test/serializer/optimized-functions/OptimizedResidualOptimized.js",
    "content": "(function() {\n  function middle(cond) {\n    if (cond) {\n      var value = { x: 42 };\n      function inner1() {\n        return value;\n      }\n      function inner2() {\n        return value;\n      }\n      global.__optimize && __optimize(inner1);\n      global.__optimize && __optimize(inner2);\n      return [inner1, inner2];\n    }\n  }\n  function outer(cond) {\n    return [middle(cond), middle(cond)];\n  }\n  global.outer = outer;\n  global.__optimize && __optimize(outer);\n\n  global.inspect = function() {\n    let funcs = [].concat.apply([], outer(true));\n    let objs = funcs.map(f => f());\n    return \" \" + (objs[0] === objs[1]) + \" \" + (objs[1] === objs[2]);\n  };\n})();\n"
  },
  {
    "path": "test/serializer/optimized-functions/ParentInitializesLocal.js",
    "content": "(function() {\n  function f() {\n    let obj = { p: 42 };\n    function g() {\n      return obj.p;\n    }\n    function h() {\n      return obj.p;\n    }\n    if (global.__optimize) {\n      __optimize(g);\n      __optimize(h);\n    }\n    return [g, h];\n  }\n  global.__optimize && __optimize(f);\n  global.f = f;\n\n  global.inspect = function() {\n    let [g, h] = f();\n    return g() + h();\n  };\n})();\n"
  },
  {
    "path": "test/serializer/optimized-functions/ParentInitializesLocal2.js",
    "content": "(function() {\n  function f() {\n    let obj = { p: 42 };\n    function g() {\n      function h() {\n        return obj.p;\n      }\n      global.__optimize && __optimize(h);\n      return h;\n    }\n    if (global.__optimize) __optimize(g);\n    return g;\n  }\n  global.__optimize && __optimize(f);\n  global.f = f;\n\n  global.inspect = function() {\n    let g = f();\n    return g()();\n  };\n})();\n"
  },
  {
    "path": "test/serializer/optimized-functions/PropertyDeref.js",
    "content": "function fn(arg) {\n  return arg != null && arg.x && arg.y;\n}\n\nif (global.__optimize) __optimize(fn);\n\ninspect = function() {\n  return JSON.stringify([fn(null), fn(undefined), fn({ x: false, y: 5 }), fn({ x: 5, y: 10 })]);\n};\n"
  },
  {
    "path": "test/serializer/optimized-functions/RegressionTestForIssue1837.js",
    "content": "(function() {\n  function fn1(x, y) {\n    for (var i = 0; i < y.length; ++i) {\n      if (x[y[i]]) {\n        break;\n      }\n    }\n  }\n\n  function fn2(count) {\n    if (count >= 0) {\n      return [\"1\", \"*\"];\n    } else {\n      return [\"2\", \"*\"];\n    }\n  }\n\n  function fn(props) {\n    fn1({ \"*\": 1 }, fn2(props.foo));\n  }\n\n  global.__optimize && __optimize(fn);\n\n  global.inspect = function() {\n    return JSON.stringify([fn({ foo: -1 }), fn({ foo: 1 })]);\n  };\n})();\n"
  },
  {
    "path": "test/serializer/optimized-functions/RegressionTestForIssue1840.js",
    "content": "(function() {\n  function URI(uri) {\n    this.p = \"\";\n    var foo = uri.p;\n    maybeThrow(this, foo);\n  }\n\n  function maybeThrow(x, foo) {\n    if (foo.hello) {\n      throw new Error(\"foo\");\n    }\n    x.p = foo;\n    return x;\n  }\n\n  var obj;\n  function parseHref(rawHref) {\n    new URI(rawHref);\n    if (!obj) {\n      obj = {};\n    }\n    return 5;\n  }\n\n  function App(props) {\n    parseHref(new URI(props));\n  }\n\n  __optimizeReactComponentTree(App, {\n    firstRenderOnly: true,\n  });\n\n  module.exports = App;\n})();\n"
  },
  {
    "path": "test/serializer/optimized-functions/RegressionTestForIssue1848.js",
    "content": "require(\"react\");\n\n__evaluatePureFunction(function() {\n  var React = require(\"react\");\n\n  function URI(arg) {\n    if (arg instanceof URI) {\n      arg.foo();\n    }\n    if ({}.hasOwnProperty(arg)) {\n      return;\n    }\n    return URI();\n  }\n\n  function App(props) {\n    var arg = \"http://hi/\" + props.x;\n    var href;\n    if (URI(arg)) {\n      href = URI(arg);\n    } else {\n      href = URI(\"#\");\n    }\n    return React.createElement(\"a\");\n  }\n\n  __optimizeReactComponentTree(App, {\n    firstRenderOnly: true,\n  });\n\n  module.exports = App;\n});\n"
  },
  {
    "path": "test/serializer/optimized-functions/RegressionTestForIssue1883.js",
    "content": "(function() {\n  function save(obj, x) {\n    if (!obj[x]) {\n      obj[x] = x;\n    }\n  }\n\n  function fn(arg) {\n    var obj = {};\n    if (arg != null) {\n      save(obj);\n    } else {\n      save(obj, arg === 1 ? \"a\" : \"b\");\n      save(obj);\n    }\n    return obj;\n  }\n\n  if (global.__optimize) __optimize(fn);\n\n  global.inspect = function() {\n    return JSON.stringify([fn(null), fn(undefined), fn(1), fn({})]);\n  };\n})();\n"
  },
  {
    "path": "test/serializer/optimized-functions/RegressionTestForIssue2015.js",
    "content": "function inner(a, b) {\n  var foo = a.foo;\n\n  b(function() {\n    foo[0] = 1;\n  });\n\n  return foo;\n}\n\nfunction fn(a, b) {\n  if (!a.condition) {\n    return null;\n  }\n  return inner(a, b);\n}\n\nif (global.__optimize) __optimize(fn);\ninspect = function() {\n  return fn({});\n}; // basically, just make sure we don't crash\n"
  },
  {
    "path": "test/serializer/optimized-functions/RegressionTestForIssue2056.js",
    "content": "function fn(arg) {\n  var value = arg.x !== null ? arg.x : 0;\n\n  function fn2() {\n    return value;\n  }\n  global.__optimize && __optimize(fn2);\n\n  return Array.from(arg.arr).map(fn2);\n}\n\nglobal.__optimize && __optimize(fn);\n\nglobal.inspect = function() {\n  return JSON.stringify([fn({ arr: [1, 2, 3], x: 1 }), fn({ arr: [1, 2, 3], x: null })]);\n};\n"
  },
  {
    "path": "test/serializer/optimized-functions/Switch.js",
    "content": "function fn(arg) {\n  var res = fn2(arg);\n  switch (res) {\n    case \"a\":\n      return 1;\n  }\n}\n\nfunction fn2(arg) {\n  if (arg > 1) {\n    return \"c\";\n  } else if (arg > 0) {\n    return \"b\";\n  }\n  return \"a\";\n}\n\nglobal.__optimize && __optimize(fn);\n\ninspect = function() {\n  return JSON.stringify([fn(0), fn(1)]);\n};\n"
  },
  {
    "path": "test/serializer/optimized-functions/Switch2.js",
    "content": "let x = global.__abstract ? __abstract(\"number\", \"1\") : 1;\n\nfunction f(x) {\n  switch (x) {\n    default:\n      return 42;\n  }\n}\n\nglobal.__optimize && __optimize(f);\n\ninspect = function() {\n  return f(x);\n};\n"
  },
  {
    "path": "test/serializer/optimized-functions/Switch3.js",
    "content": "let x = global.__abstract ? __abstract(\"number\", \"1\") : 1;\n\nfunction g(x) {\n  switch (x) {\n    case 0:\n      return 12;\n    case 1:\n      return 24;\n    default:\n      return 42;\n  }\n}\n\nglobal.__optimize && __optimize(g);\n\ninspect = function() {\n  return g(x);\n};\n"
  },
  {
    "path": "test/serializer/optimized-functions/Switch4.js",
    "content": "let x = global.__abstract ? __abstract(\"number\", \"1\") : 1;\nlet c = global.__abstract ? __abstract(\"boolean\", \"true\") : true;\n\nfunction h(x, c) {\n  switch (x) {\n    case 0:\n      if (c) return 42;\n      else return 99;\n    case 1:\n      return 23;\n  }\n}\n\nglobal.__optimize && __optimize(h);\n\ninspect = function() {\n  return h(x, c);\n};\n"
  },
  {
    "path": "test/serializer/optimized-functions/Switch5.js",
    "content": "let x = global.__abstract ? __abstract(\"number\", \"5\") : 5;\n\n// throws introspection error\nfunction g(max) {\n  let counter = 0;\n  for (let i = 0; i < max; i++) {\n    switch (i) {\n      case 0:\n        counter++;\n        break;\n      case 1:\n        counter += 2;\n        break;\n      case 2:\n        counter += 3;\n        break;\n      case 3:\n        continue;\n      default:\n        return counter;\n    }\n  }\n}\n\nglobal.__optimize && __optimize(g);\n\ninspect = function() {\n  return g(x);\n};\n"
  },
  {
    "path": "test/serializer/optimized-functions/Switch6.js",
    "content": "let x = global.__abstract ? __abstract(\"number\", \"1\") : 1;\n\n// throws introspection error\nfunction f(x) {\n  switch (x) {\n    case 0:\n      throw 12;\n    case 1:\n      throw 24;\n    default:\n      throw 42;\n  }\n}\n\nglobal.__optimize && __optimize(f);\n\ninspect = function() {\n  return f(x);\n};\n"
  },
  {
    "path": "test/serializer/optimized-functions/SymbolGet.js",
    "content": "function fn(x) {\n  return x[Symbol.hasInstance];\n}\n\nthis.__optimize && __optimize(fn);\n\ninspect = function() {\n  class Array1 {\n    static [Symbol.hasInstance](instance) {\n      return Array.isArray(instance);\n    }\n  }\n\n  return fn(Array1)([]);\n};\n"
  },
  {
    "path": "test/serializer/optimized-functions/ThrowOrReturn.js",
    "content": "var x = global.__abstract ? (x = __abstract(undefined, \"({ check: false })\")) : { check: false };\n\nfunction func1() {\n  if (x.check) {\n    throw new Error(\"This should never happen\");\n  }\n  return 1;\n}\n\nif (global.__optimize) __optimize(func1);\n\ninspect = function() {\n  return func1();\n};\n"
  },
  {
    "path": "test/serializer/optimized-functions/ThrowOrReturn2.js",
    "content": "function foo(cond) {\n  var d = {};\n\n  if (cond) {\n    throw \"I am an error!\";\n  }\n\n  return d;\n}\n\nfunction fn(cond, cond2) {\n  var a = {};\n  var b = {\n    prop1: 1,\n  };\n  if (global.__makeSimple) {\n    global.__makePartial(b);\n    global.__makeSimple(b);\n  }\n  Object.assign(a, b);\n\n  if (cond2) {\n    var res = Object.assign(foo(cond), b);\n    return res.prop1;\n  }\n\n  return a.prop1;\n}\n\nif (global.__optimize) __optimize(fn);\n\ninspect = function() {\n  return fn(true, false);\n};\n"
  },
  {
    "path": "test/serializer/optimized-functions/ThrowOrReturn3.js",
    "content": "function fn2(sholdError) {\n  if (sholdError) {\n    throw new Error(\"Error\");\n  }\n  return {\n    thisValueShouldExist: true,\n  };\n}\n\nfunction fn(sholdError) {\n  var a = Object.assign({}, fn2(sholdError));\n  return a.thisValueShouldExist;\n}\n\nif (global.__optimize) __optimize(fn);\n\ninspect = function() {\n  return fn(true, false);\n};\n"
  },
  {
    "path": "test/serializer/optimized-functions/ToString.js",
    "content": "// does not contain:.toString()\nfunction fn(someString) {\n  var x = global.__abstract ? __abstract(\"string\", \"someString\") : someString;\n\n  return x.toString();\n}\n\ninspect = function() {\n  return fn(\"Hello world\");\n};\n\nthis.__optimize && __optimize(fn);\n"
  },
  {
    "path": "test/serializer/optimized-functions/ToString2.js",
    "content": "function fn(cond, a, b) {\n  var y;\n\n  if (cond) {\n    var x = global.__abstract ? __abstract(\"number\", \"a\") : a;\n    y = x.toString();\n  } else {\n    var x = global.__abstract ? __abstract(\"number\", \"b\") : b;\n    y = x.toString();\n  }\n  return y;\n}\n\ninspect = function() {\n  return fn(true, 1, 2);\n};\n\nthis.__optimize && __optimize(fn);\n"
  },
  {
    "path": "test/serializer/optimized-functions/ToString3.js",
    "content": "// inline expressions\n\nfunction fn(cond, cond2, a, b, c) {\n  var x = global.__abstract ? __abstract(\"number\", \"a\") : a;\n  var y;\n  var z;\n  var obj = Object.assign({}, b, { x });\n\n  if (cond) {\n    y = obj.x.toString() + c;\n    z = y.split(\"\");\n  } else {\n    if (cond2) {\n      return null;\n    }\n    y = obj.x.toString() + \" \" + c;\n    z = y.split(\"\");\n  }\n  return z;\n}\n\ninspect = function() {\n  return fn(false, false, 2, {}, 5);\n};\n\nthis.__optimize && __optimize(fn);\n"
  },
  {
    "path": "test/serializer/optimized-functions/ToString4.js",
    "content": "function fn2(cond, items) {\n  if (cond) {\n    return items.length;\n  }\n  return 0;\n}\n\nfunction fn(cond, x, y) {\n  var items = Array.from(x);\n  var items2 = Array.from(y);\n\n  var len = fn2(cond, items);\n  var len2 = fn2(cond, items2);\n\n  if (len > 0) {\n    return len.toString();\n  }\n  if (len2 > 0) {\n    return len.toString();\n  }\n  return \"Should hit this!\";\n}\n\nthis.__optimize && __optimize(fn);\n\ninspect = function() {\n  return fn(false, [], []);\n};\n"
  },
  {
    "path": "test/serializer/optimized-functions/TransitiveMaterializationDirect.js",
    "content": "// arrayNestedOptimizedFunctionsEnabled\n\nfunction f(c) {\n  var arr = Array.from(c);\n  let obj = { foo: 1 };\n\n  function op(x) {\n    return obj;\n  }\n\n  let mapped = arr.map(op);\n  let val = arr[0].foo;\n  let ret = mapped[0].foo;\n  obj.foo = 2;\n\n  return ret;\n}\nglobal.__optimize && __optimize(f);\n\ninspect = () => f([0]);\n"
  },
  {
    "path": "test/serializer/optimized-functions/TransitiveMaterializationViaAbstractValue.js",
    "content": "// arrayNestedOptimizedFunctionsEnabled\n\nfunction f(c, b) {\n  var arr = Array.from(c);\n  let obj = b ? { foo: 1 } : { foo: 2 };\n\n  function op(x) {\n    return obj;\n  }\n\n  let mapped = arr.map(op);\n  let val = arr[0].foo;\n  let ret = mapped[0].foo;\n  obj.foo = 2;\n\n  return ret;\n}\n\nglobal.__optimize && __optimize(f);\n\ninspect = () => f([0], true);\n"
  },
  {
    "path": "test/serializer/optimized-functions/TransitiveMaterializationViaFunctionCall.js",
    "content": "// arrayNestedOptimizedFunctionsEnabled\n\nfunction f(c, b) {\n  var arr = Array.from(c);\n  let obj = { foo: 1 };\n\n  function nested(x) {\n    return b ? x : undefined;\n  }\n\n  function op(x) {\n    return nested(x);\n  }\n\n  let mapped = arr.map(op);\n  let val = arr[0].foo;\n  let ret = mapped[0].foo;\n  obj.foo = 2;\n\n  return ret;\n}\n\nglobal.__optimize && __optimize(f);\n\ninspect = () => f([0], true);\n"
  },
  {
    "path": "test/serializer/optimized-functions/TransitiveMaterializationViaFunctionProperty.js",
    "content": "// arrayNestedOptimizedFunctionsEnabled\n\nfunction f(c) {\n  var arr = Array.from(c);\n  let obj = { foo: 1 };\n\n  function op(x) {\n    return op.obj;\n  }\n\n  op.obj = obj;\n\n  let mapped = arr.map(op);\n  let val = arr[0].foo;\n  let ret = mapped[0].foo;\n  obj.foo = 2;\n\n  return ret;\n}\nglobal.__optimize && __optimize(f);\n\ninspect = () => f([0]);\n"
  },
  {
    "path": "test/serializer/optimized-functions/TransitiveMaterializationViaLeakedBinding.js",
    "content": "// arrayNestedOptimizedFunctionsEnabled\n\nfunction f(c, g) {\n  var arr = Array.from(c);\n  var leaked = undefined;\n  let obj = { foo: 1 };\n\n  function leak() {\n    return leaked;\n  }\n  g(leak);\n  leaked = obj;\n\n  function op(x) {\n    return leaked;\n  }\n\n  let mapped = arr.map(op);\n  let val = arr[0].foo;\n  let ret = mapped[0].foo;\n  obj.foo = 2;\n\n  return ret;\n}\nglobal.__optimize && __optimize(f);\n\ninspect = () => f([0], () => {});\n"
  },
  {
    "path": "test/serializer/optimized-functions/TransitiveMaterializationViaObjectProp.js",
    "content": "// arrayNestedOptimizedFunctionsEnabled\n\nfunction f(c) {\n  var arr = Array.from(c);\n  let obj = { foo: 1 };\n  let obj2 = { bar: obj };\n\n  function op(x) {\n    return obj2;\n  }\n\n  let mapped = arr.map(op);\n  let val = arr[0].foo;\n  let ret = mapped[0].foo;\n  obj.foo = 2;\n\n  return ret;\n}\nglobal.__optimize && __optimize(f);\n\ninspect = () => f([0]);\n"
  },
  {
    "path": "test/serializer/optimized-functions/TransitiveMaterializationViaThisBinding.js",
    "content": "// arrayNestedOptimizedFunctionsEnabled\n\nfunction f(c) {\n  var arr = Array.from(c);\n  let obj = { foo: 1 };\n\n  function op(x) {\n    return this;\n  }\n\n  let bop = op.bind(obj);\n  let mapped = arr.map(bop);\n  let val = arr[0].foo;\n  let ret = mapped[0].foo;\n  obj.foo = 2;\n\n  return ret;\n}\nglobal.__optimize && __optimize(f);\n\ninspect = () => f([0]);\n"
  },
  {
    "path": "test/serializer/optimized-functions/UnknownProperty.js",
    "content": "var cache = {};\nfunction f(x, y) {\n  cache[x] = y;\n}\nif (global.__optimize) __optimize(f);\n\ninspect = function() {\n  f(42, 5);\n  return cache[42];\n};\n"
  },
  {
    "path": "test/serializer/optimized-functions/UnknownProperty2.js",
    "content": "var cache = {};\nfunction f(x, y) {\n  cache[x] = y;\n  cache[x + 1] = y * 2;\n}\nif (global.__optimize) __optimize(f);\n\ninspect = function() {\n  f(42, 5);\n  return cache[42] + \" \" + cache[43];\n};\n"
  },
  {
    "path": "test/serializer/optimized-functions/WrongReferentializationScope.js",
    "content": "(function() {\n  function mkLocation() {\n    var x;\n    function mkSetter() {\n      function setter(y) {\n        x = y;\n      }\n      return setter;\n    }\n    function mkGetter() {\n      function getter() {\n        return x;\n      }\n      return getter;\n    }\n    if (global.__optimize) __optimize(mkSetter);\n    if (global.__optimize) __optimize(mkGetter);\n    return { mkSetter, mkGetter };\n  }\n  if (global.__optimize) __optimize(mkLocation);\n  global.inspect = function() {\n    let l1 = mkLocation();\n    let l2 = mkLocation();\n    l1.mkSetter()(42);\n    l2.mkSetter()(23);\n    return l1.mkGetter()();\n  };\n})();\n"
  },
  {
    "path": "test/serializer/optimized-functions/WrongScopeTripleNested.js",
    "content": "(function() {\n  function outer() {\n    let x = {};\n    function middle() {\n      function inner() {\n        return x;\n      }\n      if (global.__optimize) __optimize(inner);\n      return inner;\n    }\n    if (global.__optimize) __optimize(middle);\n    return middle;\n  }\n  if (global.__optimize) __optimize(outer);\n  global.inspect = function() {\n    return outer()()() === outer()()();\n  };\n})();\n"
  },
  {
    "path": "test/serializer/optimized-functions/double-call.js",
    "content": "function fn2(x, y) {\n  return {\n    val: x !== null ? y : undefined,\n  };\n}\n\nfunction fn(x, y) {\n  var x = fn2(x, y);\n  var y = fn2(x, y);\n\n  return [x, y];\n}\n\nglobal.__optimize && __optimize(fn);\n\ninspect = function() {\n  var x = JSON.stringify([fn(null, 1), fn(true, 2)]);\n  return x;\n};\n"
  },
  {
    "path": "test/serializer/optimized-functions/instanceof.js",
    "content": "// does not contain:instanceof\n\nfunction fn(a) {\n  var x = Object.assign(a);\n\n  if (global.__makeSimple) {\n    __makeSimple(x);\n  }\n  if (undefined instanceof x) {\n    return \"impossible\";\n  }\n  if (null instanceof x) {\n    return \"also impossible\";\n  }\n  if (false instanceof x) {\n    return \"also impossible 2\";\n  }\n  if (true instanceof x) {\n    return \"also impossible 3\";\n  }\n  if (0 instanceof x) {\n    return \"also impossible 4\";\n  }\n  if (1 instanceof x) {\n    return \"also impossible 5\";\n  }\n  if (\"\" instanceof x) {\n    return \"also impossible 6\";\n  }\n}\n\nthis.__optimize && __optimize(fn);\n\ninspect = function() {\n  return fn(Object);\n};\n"
  },
  {
    "path": "test/serializer/optimized-functions/issue-2252-3.js",
    "content": "// skip lint because __optimize isn't defined\nfunction fn2(props) {\n  var _ref11;\n  var commentsConnection =\n    (_ref11 = props) != null ? ((_ref11 = _ref11.feedback) != null ? _ref11.display_comments : _ref11) : _ref11;\n\n  var nested = function() {\n    return commentsConnection;\n  };\n  global.__optimize && __optimize(nested);\n  return props.items.map(nested);\n}\n\nfunction fn(props) {\n  return fn2({\n    items: props.items,\n    feedback: props.feedback,\n  });\n}\n\ninspect = function() {\n  return JSON.stringify(fn({ items: [0, 1, 2], feedback: { display_comments: [1, 2, 3] } }));\n};\n\nglobal.__optimize && __optimize(fn);\n"
  },
  {
    "path": "test/serializer/optimized-functions/simple-nesting.js",
    "content": "// does not contain:1 + 2\n(function() {\n  function render1() {\n    function render2() {\n      return 1 + 2; // This should get prepacked!\n    }\n    if (global.__optimize) __optimize(render2);\n    return render2;\n  }\n\n  if (global.__optimize) __optimize(render1);\n\n  global.render1 = render1;\n  global.inspect = function() {\n    return render1()();\n  };\n})();\n"
  },
  {
    "path": "test/serializer/pure-functions/AbstractCall.js",
    "content": "let forEach = global.__abstract\n  ? __abstract(\"function\", '(function(callback) { callback(\"a\", 0); callback(\"b\", 1); })')\n  : function(callback) {\n      callback(\"a\", 0);\n      callback(\"b\", 1);\n    };\nlet set = global.__abstract\n  ? __abstract(\"function\", \"(function(obj, name, value) { obj[name] = value; })\")\n  : function(obj, name, value) {\n      obj[name] = value;\n    };\n\nfunction additional1() {\n  var count = 0;\n  forEach(function() {\n    count++;\n  });\n  foo = function() {\n    return count;\n  };\n}\n\nfunction additional2() {\n  let obj = { x: 0, y: 1 };\n  set(obj, \"x\", 2);\n  set(obj, \"y\", obj.x);\n  bar = function() {\n    return obj;\n  };\n}\n\nif (global.__optimize) {\n  __optimize(additional1);\n  __optimize(additional2);\n}\n\ninspect = function() {\n  additional1();\n  additional2();\n  let ret1 = global.foo();\n  let ret2 = global.bar();\n  return JSON.stringify({ ret1, ret2 });\n};\n"
  },
  {
    "path": "test/serializer/pure-functions/AbstractCallUnknownType.js",
    "content": "let obj = global.__abstract\n  ? __abstract(\"object\", \"({foo: function() { return 1; }})\")\n  : {\n      foo: function() {\n        return 1;\n      },\n    };\nif (global.__makeSimple) {\n  __makeSimple(obj);\n}\nlet condition = global.__abstract ? __abstract(\"boolean\", \"true\") : true;\n\nfunction additional1() {\n  return obj.foo();\n}\n\nfunction additional2() {\n  function fn() {\n    return 5;\n  }\n  let fnOrString = condition ? fn : \"string\";\n  return fnOrString();\n}\n\nif (global.__optimize) {\n  __optimize(additional1);\n  __optimize(additional2);\n}\n\ninspect = function() {\n  let ret1 = additional1();\n  let ret2 = additional2();\n  return ret1 + ret2;\n};\n"
  },
  {
    "path": "test/serializer/pure-functions/AbstractCallUnknownType2.js",
    "content": "let obj = {};\nif (global.__makeSimple) {\n  __makeSimple(obj);\n}\nif (global.__makePartial) {\n  __makePartial(obj);\n}\nlet condition = global.__abstract ? __abstract(\"boolean\", \"false\") : false;\n\nfunction additional1() {\n  return obj.foo();\n}\n\nfunction additional2() {\n  function fn() {\n    return 5;\n  }\n  let fnOrString = condition ? fn : \"string\";\n  return fnOrString();\n}\n\nif (global.__optimize) {\n  __optimize(additional1);\n  __optimize(additional2);\n}\n\ninspect = function() {\n  let didThrow1 = false;\n  let didThrow2 = false;\n  try {\n    additional1();\n  } catch (x) {\n    didThrow1 = true;\n  }\n  try {\n    additional2();\n  } catch (x) {\n    didThrow2 = true;\n  }\n  return didThrow1 + \", \" + didThrow2;\n};\n"
  },
  {
    "path": "test/serializer/pure-functions/AbstractComputedProperty.js",
    "content": "if (!global.__evaluatePureFunction) {\n  global.__evaluatePureFunction = f => f();\n}\n\n__evaluatePureFunction(() => {\n  var x =\n    (global.__abstract ? __abstract(undefined, \"({foo: 123})\") : { foo: 123 }) ||\n    (global.__abstract ? __abstract(undefind, \"(false)\") : false);\n  var y = global.__abstract ? __abstract(undefined, \"('foo')\") : \"foo\";\n\n  global.x = x[y];\n});\n\ninspect = function() {\n  return global.x;\n};\n"
  },
  {
    "path": "test/serializer/pure-functions/AbstractComputedPropertyAssignment.js",
    "content": "if (!global.__evaluatePureFunction) {\n  global.__evaluatePureFunction = f => f();\n}\n\nx = __evaluatePureFunction(() => {\n  var x = global.__abstract ? __abstract(undefined, \"({foo: 123})\") : { foo: 123 };\n  var y = global.__abstract ? __abstract(undefined, \"('foo')\") : \"foo\";\n\n  x[y] = 5;\n\n  return x;\n});\n\ninspect = function() {\n  return global.x.foo;\n};\n"
  },
  {
    "path": "test/serializer/pure-functions/AbstractObject.js",
    "content": "let c = global.__abstract ? __abstract(\"boolean\", \"(true)\") : true;\n\nfunction test(fn) {\n  let knownObj = { x: 1 };\n  let knownObj2 = { y: 3 };\n  let conditionalObj = c ? knownObj : knownObj2;\n  fn(conditionalObj); // This must havoc both known objects\n  return \"Result-\" + (knownObj.x + 3);\n}\n\nif (global.__optimize) {\n  __optimize(test);\n}\n\ninspect = function() {\n  return test(function(o) {\n    o.x++;\n  });\n};\n"
  },
  {
    "path": "test/serializer/pure-functions/AbstractObject2.js",
    "content": "let c = global.__abstract ? __abstract(\"boolean\", \"(true)\") : true;\nlet unknownObj = global.__abstract ? __abstract(\"object\", \"({})\") : {};\n\nfunction test(fn) {\n  let knownObj = { x: 1 };\n  let conditionalUnknownObj = c ? knownObj : unknownObj;\n  fn(conditionalUnknownObj); // This must havoc the known obj\n  return \"Result-\" + (knownObj.x + 3);\n}\n\nif (global.__optimize) {\n  __optimize(test);\n}\n\ninspect = function() {\n  return test(function(o) {\n    o.x++;\n  });\n};\n"
  },
  {
    "path": "test/serializer/pure-functions/AbstractObjectOptimizable.js",
    "content": "// does contain:Result-4\n\nlet unknownObj = global.__abstract ? __abstract(\"object\", \"({})\") : {};\n\nfunction test(fn) {\n  let knownObj = { x: 1 };\n  let equalityTest = knownObj === unknownObj;\n  fn(equalityTest); // This should not havoc the known obj\n  return \"Result-\" + (knownObj.x + 3);\n}\n\nif (global.__optimize) {\n  __optimize(test);\n}\n\ninspect = function() {\n  return test(function() {});\n};\n"
  },
  {
    "path": "test/serializer/pure-functions/AbstractPropertyObjectKey.js",
    "content": "if (!global.__evaluatePureFunction) {\n  global.__evaluatePureFunction = f => f();\n}\n\ninspect = __evaluatePureFunction(() => {\n  let c = global.__abstract ? __abstract(\"boolean\", \"(true)\") : true;\n  let objAsKey = {\n    y: 1,\n    get toString() {\n      this.y = 2;\n      return function() {\n        return \"x\";\n      };\n    },\n  };\n  let abstractKey = c ? objAsKey : \"y\";\n  let obj = { x: 3 };\n  let x = obj[abstractKey];\n  let y = objAsKey.y;\n  return function() {\n    return JSON.stringify({ x, y });\n  };\n});\n"
  },
  {
    "path": "test/serializer/pure-functions/AbstractPropertyObjectKeyAssignment.js",
    "content": "if (!global.__evaluatePureFunction) {\n  global.__evaluatePureFunction = f => f();\n}\n\ninspect = __evaluatePureFunction(() => {\n  let c = global.__abstract ? __abstract(\"boolean\", \"(true)\") : true;\n  let objAsKey = {\n    y: 1,\n    get toString() {\n      this.y = 2;\n      return function() {\n        return \"x\";\n      };\n    },\n  };\n  let abstractKey = c ? objAsKey : \"y\";\n  let obj = { x: 3 };\n  obj[abstractKey] = 5;\n  let y = objAsKey.y;\n  return function() {\n    return JSON.stringify({ obj, y });\n  };\n});\n"
  },
  {
    "path": "test/serializer/pure-functions/AbstractPropertyRead.js",
    "content": "let obj1 = global.__abstract\n  ? __abstract(\"object\", '({get foo() { return \"bar\"; }})')\n  : {\n      get foo() {\n        return \"bar\";\n      },\n    };\nlet obj2 = global.__abstract ? __abstract(\"object\", '({foo:{bar:\"baz\"}})') : { foo: { bar: \"baz\" } };\nif (global.__makeSimple) {\n  __makeSimple(obj2);\n}\n\nfunction additional1() {\n  return obj1.foo;\n}\n\nfunction additional2() {\n  return obj2.foo.bar;\n}\n\nif (global.__optimize) {\n  __optimize(additional1);\n  __optimize(additional2);\n}\n\ninspect = function() {\n  let ret1 = additional1();\n  let ret2 = additional2();\n  return ret1 + ret2;\n};\n"
  },
  {
    "path": "test/serializer/pure-functions/AbstractPropertyRead2.js",
    "content": "let obj1 = global.__abstract\n  ? __abstract(\"object\", '({get foo() { return \"bar\"; }})')\n  : {\n      get foo() {\n        return \"bar\";\n      },\n    };\nlet obj2 = global.__abstract ? __abstract(\"object\", '({foo:{extends:\"baz\"}})') : { foo: { extends: \"baz\" } };\nif (global.__makeSimple) {\n  __makeSimple(obj2);\n}\n\nfunction additional1() {\n  return obj1.foo;\n}\n\nfunction additional2() {\n  return obj2.foo[\"extends\"];\n}\n\nif (global.__optimize) {\n  __optimize(additional1);\n  __optimize(additional2);\n}\n\ninspect = function() {\n  let ret1 = additional1();\n  let ret2 = additional2();\n  return ret1 + ret2;\n};\n"
  },
  {
    "path": "test/serializer/pure-functions/AbstractPropertyRead3.js",
    "content": "// does contain: \"barone\"\n\nvar __evaluatePureFunction = this.__evaluatePureFunction || (f => f());\nlet absFunc = global.__abstract ? __abstract(\"function\", \"(x => x)\") : x => x;\n\nlet x, y;\n__evaluatePureFunction(() => {\n  let obj1 = { foo: \"bar\" };\n  Object.freeze(obj1);\n  absFunc(obj1);\n  x = obj1.foo + \"one\";\n});\n\ninspect = function() {\n  return x;\n};\n"
  },
  {
    "path": "test/serializer/pure-functions/AbstractPropertyRead4.js",
    "content": "// does contain: \"barone\"\n// does not contain: \"23\"\n\nvar __evaluatePureFunction = this.__evaluatePureFunction || (f => f());\nlet absFunc = global.__abstract ? __abstract(\"function\", \"(x => x)\") : x => x;\n\nlet x, y;\n__evaluatePureFunction(() => {\n  let obj1 = { foo: \"bar\" };\n  Object.freeze(obj1);\n  let obj2 = { one: obj1, two: 2 };\n  absFunc(obj2);\n  x = obj1.foo + \"one\";\n  y = obj2.two + \"3\";\n});\n\ninspect = function() {\n  return x + \" \" + y;\n};\n"
  },
  {
    "path": "test/serializer/pure-functions/AbstractPropertyRead5.js",
    "content": "// abstract effects\n\nvar __evaluatePureFunction = this.__evaluatePureFunction || (f => f());\nlet props = global.__abstract\n  ? __makeSimple(__abstract(\"object\", \"({ item : { profile: { id: 123 }, sponsored_data: null } })\"))\n  : { item: { profile: { id: 123 }, sponsored_data: null } };\n\nlet x;\nfunction foo() {\n  var profile = props.item.profile;\n  if (!profile) {\n    return null;\n  }\n  var profileId = profile.id;\n  if (profileId) {\n    return profileId;\n  }\n  var isSponsored = props.item.sponsored_data == null ? false : true;\n  return isSponsored;\n}\nx = __evaluatePureFunction(() => {\n  return foo();\n});\n\ninspect = function() {\n  return x;\n};\n"
  },
  {
    "path": "test/serializer/pure-functions/AbstractPropertyRead6.js",
    "content": "// abstract effects\n\nvar __evaluatePureFunction = this.__evaluatePureFunction || (f => f());\nlet props = global.__abstract\n  ? __makeSimple(__abstract(\"object\", \"({ profile: { id: 123 } })\"))\n  : { profile: { id: 123 } };\n\nlet x;\nfunction foo() {\n  if (props.profile) return;\n  if (props.profile.id) return;\n}\nx = __evaluatePureFunction(() => {\n  return foo();\n});\n\ninspect = function() {\n  return x;\n};\n"
  },
  {
    "path": "test/serializer/pure-functions/BinaryExpressions.js",
    "content": "let obj1 = global.__abstract\n  ? __abstract(\"object\", \"({foo: {valueOf() { return 42; }}})\")\n  : {\n      foo: {\n        valueOf() {\n          return 42;\n        },\n      },\n    };\nlet obj2 = global.__abstract\n  ? __abstract(\"object\", \"({foo: {bar: {valueOf() { return 42; }}}})\")\n  : {\n      foo: {\n        bar: {\n          valueOf() {\n            return 42;\n          },\n        },\n      },\n    };\n\nfunction additional1() {\n  return \"\" + obj1.foo;\n}\n\nfunction additional2() {\n  return obj2.foo.bar + 10;\n}\n\nif (global.__optimize) {\n  __optimize(additional1);\n  __optimize(additional2);\n}\n\ninspect = function() {\n  let ret1 = additional1();\n  let ret2 = additional2();\n  return JSON.stringify({ ret1, ret2 });\n};\n"
  },
  {
    "path": "test/serializer/pure-functions/BinaryExpressions2.js",
    "content": "let obj1 = global.__abstract\n  ? __abstract(\"object\", \"({foo: {valueOf() { return 42; }}})\")\n  : {\n      foo: {\n        valueOf() {\n          return 42;\n        },\n      },\n    };\nlet obj2 = global.__abstract\n  ? __abstract(\"object\", \"({foo: {bar: {valueOf() { return 42; }}}})\")\n  : {\n      foo: {\n        bar: {\n          valueOf() {\n            return 42;\n          },\n        },\n      },\n    };\n\nfunction additional1() {\n  return 42 < obj1.foo;\n}\n\nfunction additional2() {\n  return obj2.foo.bar > 42;\n}\n\nif (global.__optimize) {\n  __optimize(additional1);\n  __optimize(additional2);\n}\n\ninspect = function() {\n  let ret1 = additional1();\n  let ret2 = additional2();\n  return JSON.stringify({ ret1, ret2 });\n};\n"
  },
  {
    "path": "test/serializer/pure-functions/BinaryExpressions3.js",
    "content": "let obj1 = global.__abstract\n  ? __abstract(\"object\", \"({valueOf() { this.x = 10; return 42; }})\")\n  : {\n      valueOf() {\n        this.x = 10;\n        return 42;\n      },\n    };\n\nfunction additional1() {\n  var y = Object.create(obj1);\n  y + \"\";\n  return y.x;\n}\n\nfunction additional2() {\n  var x = {\n    valueOf: global.__abstract\n      ? __abstract(\"function\", \"(function() { this.foo++; return 10; })\")\n      : function() {\n          this.foo++;\n          return 10;\n        },\n    foo: 0,\n  };\n  return x + \"\" + x.foo;\n}\n\nif (global.__optimize) {\n  __optimize(additional1);\n  __optimize(additional2);\n}\n\ninspect = function() {\n  return additional1() + \"\" + additional2();\n};\n"
  },
  {
    "path": "test/serializer/pure-functions/CastStringOnUnknown.js",
    "content": "let obj1 = global.__abstract\n  ? __abstract(\"object\", '({get foo() { return \"bar\"; }})')\n  : {\n      get foo() {\n        return \"bar\";\n      },\n    };\nlet obj2 = global.__abstract ? __abstract(\"object\", '({foo:{bar:\"baz\"}})') : { foo: { bar: \"baz\" } };\nif (global.__makeSimple) {\n  __makeSimple(obj2);\n}\n\nfunction additional1() {\n  return String(obj1.foo);\n}\n\nfunction additional2() {\n  return String(obj2.foo.bar);\n}\n\nif (global.__optimize) {\n  __optimize(additional1);\n  __optimize(additional2);\n}\n\ninspect = function() {\n  let ret1 = additional1();\n  let ret2 = additional2();\n  return ret1 + ret2;\n};\n"
  },
  {
    "path": "test/serializer/pure-functions/ConditionalHavocedGet.js",
    "content": "function foo(havoc, condition) {\n  let obj = { x: 1, y: 2 };\n  let havocedObj = { x: 3, y: 4 };\n  let conditionalObj = condition ? havocedObj : obj;\n  havoc(havocedObj);\n  return conditionalObj.x;\n}\n\nif (global.__optimize) __optimize(foo);\n\ninspect = function() {\n  let calls1 = 0;\n  let returnValue1 = foo(obj => {\n    Object.defineProperty(obj, \"x\", {\n      get() {\n        // Should not be called.\n        calls1++;\n        return 5;\n      },\n    });\n  }, false);\n  let calls2 = 0;\n  let returnValue2 = foo(obj => {\n    Object.defineProperty(obj, \"x\", {\n      get() {\n        // Should be called.\n        calls2++;\n        return 6;\n      },\n    });\n  }, true);\n  return JSON.stringify({ calls1, returnValue1, calls2, returnValue2 });\n};\n"
  },
  {
    "path": "test/serializer/pure-functions/ConditionalHavocedGetPartial.js",
    "content": "function foo(havoc, key, condition) {\n  let obj = { x: 1, y: 2 };\n  let havocedObj = { x: 3, y: 4 };\n  let conditionalObj = condition ? havocedObj : obj;\n  havoc(havocedObj);\n  return conditionalObj[key];\n}\n\nif (global.__optimize) __optimize(foo);\n\ninspect = function() {\n  let calls1 = 0;\n  let returnValue1 = foo(\n    obj => {\n      Object.defineProperty(obj, \"x\", {\n        get() {\n          // Should not be called.\n          calls1++;\n          return 5;\n        },\n      });\n    },\n    \"x\",\n    false\n  );\n  let calls2 = 0;\n  let returnValue2 = foo(\n    obj => {\n      Object.defineProperty(obj, \"x\", {\n        get() {\n          // Should be called.\n          calls2++;\n          return 6;\n        },\n      });\n    },\n    \"x\",\n    true\n  );\n  return JSON.stringify({ calls1, returnValue1, calls2, returnValue2 });\n};\n"
  },
  {
    "path": "test/serializer/pure-functions/ConditionalHavocedSet.js",
    "content": "let c = global.__abstract ? __abstract(\"boolean\", \"(false)\") : false;\n\nfunction foo(havoc, key) {\n  let obj = {\n    x(v) {\n      this.y = v;\n    },\n    y: 2,\n  };\n  let havocedObj = { x: 3, y: 4 };\n  let conditionalObj = c ? havocedObj : obj;\n  havoc(havocedObj);\n  conditionalObj.x = 5;\n  return obj.y;\n}\n\nif (global.__optimize) __optimize(foo);\n\ninspect = function() {\n  let called = false;\n  let returnValue = foo(obj => {\n    Object.defineProperty(obj, \"x\", {\n      set(value) {\n        // Should not be called.\n        called = true;\n      },\n    });\n  }, \"x\");\n  return JSON.stringify({ called, returnValue });\n};\n"
  },
  {
    "path": "test/serializer/pure-functions/ConditionalHavocedSetPartial.js",
    "content": "let c = global.__abstract ? __abstract(\"boolean\", \"(false)\") : false;\n\nfunction foo(havoc, key) {\n  let obj = { x: 1, y: 2 };\n  let havocedObj = { x: 3, y: 4 };\n  let conditionalObj = c ? havocedObj : obj;\n  havoc(havocedObj);\n  conditionalObj[key] = 5;\n  return obj.x;\n}\n\nif (global.__optimize) __optimize(foo);\n\ninspect = function() {\n  let called = false;\n  let returnValue = foo(obj => {\n    Object.defineProperty(obj, \"x\", {\n      set(value) {\n        // Should not be called.\n        called = true;\n      },\n    });\n  }, \"x\");\n  return JSON.stringify({ called, returnValue });\n};\n"
  },
  {
    "path": "test/serializer/pure-functions/ConditionalObjectPartialKey.js",
    "content": "let s = global.__abstract ? __abstract(\"string\", \"('foo')\") : \"foo\";\n\nfunction test(c) {\n  let read = false;\n  let read2 = false;\n  let write = false;\n  let write2 = false;\n  let knownObj = {\n    get foo() {\n      read = true;\n      return 1;\n    },\n    set foo(v) {\n      write = true;\n    },\n  };\n  let knownObj2 = {\n    get foo() {\n      read2 = true;\n      return 2;\n    },\n    set foo(v) {\n      write2 = true;\n    },\n  };\n  let conditionalObj = c ? knownObj : knownObj2;\n  conditionalObj[s] = 3;\n  let value = conditionalObj[s];\n  return \"Value: \" + value + \" Touched: \" + read + \" \" + read2 + \"Written: \" + write + \" \" + write2;\n}\n\nif (global.__optimize) {\n  __optimize(test);\n}\n\ninspect = function() {\n  return test(true);\n};\n"
  },
  {
    "path": "test/serializer/pure-functions/FatalErrorAfterJoins.js",
    "content": "if (!global.__evaluatePureFunction) global.__evaluatePureFunction = f => f();\n\nconst result = global.__evaluatePureFunction(() => {\n  let x, y, z;\n\n  function f() {\n    const getNumber = global.__abstract ? global.__abstract(\"function\", \"(() => 1)\") : () => 1;\n    const b1 = global.__abstract ? global.__abstract(\"boolean\", \"true\") : true;\n    const b2 = global.__abstract ? global.__abstract(\"boolean\", \"!false\") : true;\n    const b3 = global.__abstract ? global.__abstract(\"boolean\", \"!!true\") : true;\n\n    x = getNumber();\n    if (!b1) throw new Error(\"abrupt\");\n    y = getNumber();\n    if (!b2) throw new Error(\"abrupt\");\n    z = getNumber();\n    if (!b3) throw new Error(\"abrupt\");\n\n    if (global.__fatal) global.__fatal();\n\n    return x + y + z;\n  }\n\n  f();\n\n  return x + y + z;\n});\n\nglobal.inspect = () => result;\n"
  },
  {
    "path": "test/serializer/pure-functions/FatalErrorAfterModifiedBinding.js",
    "content": "if (!global.__evaluatePureFunction) global.__evaluatePureFunction = f => f();\n\nconst result = global.__evaluatePureFunction(() => {\n  let x;\n\n  function f() {\n    const getNumber = global.__abstract ? global.__abstract(\"function\", \"(() => 1)\") : () => 1;\n\n    x = getNumber();\n    if (global.__fatal) global.__fatal();\n  }\n\n  f();\n\n  return x;\n});\n\nglobal.inspect = () => result;\n"
  },
  {
    "path": "test/serializer/pure-functions/ForInBailout.js",
    "content": "if (!global.__evaluatePureFunction) global.__evaluatePureFunction = f => f();\n\nconst result = global.__evaluatePureFunction(() => {\n  const ks = [];\n\n  const n = global.__abstract ? __abstract(\"number\", \"5\") : 5;\n  const o = { a: 1, b: 2, c: 3 };\n\n  for (let i = 0; i < n; i++) {\n    for (var k in o) {\n      ks.push(k);\n    }\n    ks.push(k);\n  }\n  ks.push(k);\n\n  return ks;\n});\n\nglobal.inspect = () => JSON.stringify(result);\n"
  },
  {
    "path": "test/serializer/pure-functions/GetterOnAbstractPrototype.js",
    "content": "var FooPrototype = global.__abstract\n  ? __abstract(\"object\", \"({ get legacyCache() { return this._cache || (this._cache = {}); } })\")\n  : {\n      get legacyCache() {\n        return this._cache || (this._cache = {});\n      },\n    };\nfunction Foo() {}\nFoo.prototype = FooPrototype;\n\nfunction fn() {\n  var Bar = new Foo();\n  Object.defineProperty(Bar, \"_cache\", {\n    writable: true,\n    value: undefined,\n  });\n  Object.defineProperty(Bar, \"cache\", {\n    get() {\n      return this._cache || (this._cache = {});\n    },\n  });\n  return [Bar.legacyCache, Bar.cache];\n}\n\nglobal.fn = fn;\nif (global.__optimize) {\n  __optimize(fn);\n}\n\ninspect = function() {\n  let [cache1, cache2] = fn();\n  return cache1 === cache2;\n};\n"
  },
  {
    "path": "test/serializer/pure-functions/GetterOnAbstractPrototype2.js",
    "content": "var FooPrototype = global.__abstract\n  ? __abstract(\"object\", \"({ get name() { return this._name; } })\")\n  : {\n      get name() {\n        return this._name;\n      },\n    };\nfunction Foo(name) {\n  // Field initializer\n  Object.defineProperty(this, \"_name\", {\n    writable: true,\n    value: name,\n  });\n}\nFoo.prototype = FooPrototype;\n\nfunction fn() {\n  var Bar = new Foo(\"Sebastian\");\n  Object.defineProperty(Bar, \"setName\", {\n    value: function(name) {\n      return (this._name = name);\n    },\n  });\n  var name = Bar.name;\n  Bar.setName(\"Nikolai\");\n  return name;\n}\n\nglobal.fn = fn;\nif (global.__optimize) {\n  __optimize(fn);\n}\n\ninspect = function() {\n  return fn();\n};\n"
  },
  {
    "path": "test/serializer/pure-functions/HavocBinding.js",
    "content": "if (!global.__evaluatePureFunction) global.__evaluatePureFunction = f => f();\n\nconst x = global.__evaluatePureFunction(() => {\n  const x = { p: 42 };\n\n  const havoc = global.__abstract ? __abstract(\"function\", \"(() => {})\") : () => {};\n  havoc(() => x);\n\n  return x;\n});\n\nglobal.inspect = () => {\n  return JSON.stringify(x);\n};\n"
  },
  {
    "path": "test/serializer/pure-functions/HavocBindingImmutable.js",
    "content": "if (!global.__evaluatePureFunction) global.__evaluatePureFunction = f => f();\n\nconst havoc = global.__abstract ? global.__abstract(\"function\", \"(() => {})\") : () => {};\n\nconst result = global.__evaluatePureFunction(() => {\n  const b = global.__abstract ? global.__abstract(\"boolean\", \"true\") : true;\n\n  if (b) {\n    var g = function f(i) {\n      return i === 0 ? 0 : f(i - 1) + 1;\n    };\n    havoc(g);\n  } else {\n    return;\n  }\n\n  return g(5);\n});\n\nglobal.inspect = () => result;\n"
  },
  {
    "path": "test/serializer/pure-functions/Invariants.js",
    "content": "var invariant = function(condition, message) {\n  if (condition) return;\n  throw new Error(message);\n};\n\nif (!global.__evaluatePureFunction) {\n  global.__evaluatePureFunction = f => f();\n}\n\n__evaluatePureFunction(() => {\n  var x = global.__abstract\n    ? __abstract(\"object\", \"({foo: {foo2: {}}, bar: {bar2: {}}})\")\n    : { foo: { foo2: {} }, bar: { bar2: {} } };\n\n  if (global.__makeSimple) {\n    __makeSimple(x);\n  }\n\n  var foo = x.foo;\n  var bar = x.bar;\n\n  var foo2 = foo.foo2;\n  var bar2 = foo.bar2;\n\n  foo2 || invariant(0, \"Should not error 1!\");\n  bar2 || invariant(0, \"Should not error 2!\");\n});\n"
  },
  {
    "path": "test/serializer/pure-functions/Invariants2.js",
    "content": "var invariant = function(condition, message) {\n  if (condition) return;\n  throw new Error(message);\n};\n\nif (!global.__evaluatePureFunction) {\n  global.__evaluatePureFunction = f => f();\n}\n\n__evaluatePureFunction(() => {\n  var x = global.__abstract\n    ? __abstract(\"object\", \"({foo: {foo2: {}}, bar: {bar2: {}}})\")\n    : { foo: { foo2: {} }, bar: { bar2: {} } };\n\n  if (global.__makeSimple) {\n    __makeSimple(x);\n  }\n\n  var foo = x.foo;\n  var bar = x.bar;\n\n  var foo2 = foo.foo2 || invariant(0, \"Should not error 1!\");\n  var bar2 = foo.bar2 || invariant(0, \"Should not error 2!\");\n\n  foo2 || bar2 || invariant(0, \"Should not error 3!\");\n});\n"
  },
  {
    "path": "test/serializer/pure-functions/Invariants3.js",
    "content": "var invariant = function(condition, message) {\n  if (condition) return;\n  throw new Error(message);\n};\n\nif (!global.__evaluatePureFunction) {\n  global.__evaluatePureFunction = f => f();\n}\n\nvar result;\n\n__evaluatePureFunction(() => {\n  var x = global.__abstract\n    ? __abstract(\"object\", \"({foo: {foo2: {}}, bar: {bar2: {}}})\")\n    : { foo: { foo2: {} }, bar: { bar2: {} } };\n\n  if (global.__makeSimple) {\n    __makeSimple(x);\n  }\n\n  var foo = x.foo;\n  var bar = x.bar;\n\n  var foo2 = foo.foo2 || invariant(0, \"Should not error 1!\");\n  var bar2 = bar.bar2 || invariant(0, \"Should not error 2!\");\n\n  var a = {\n    foo2: foo2 || invariant(0, \"Should not error 3!\"),\n  };\n  var b = {\n    bar2: bar2 || invariant(0, \"Should not error 4!\"),\n  };\n\n  result = a || b;\n});\n\ninspect = function() {\n  return result;\n};\n"
  },
  {
    "path": "test/serializer/pure-functions/Issue2418.js",
    "content": "if (!global.__evaluatePureFunction) global.__evaluatePureFunction = f => f();\n\nglobal.__evaluatePureFunction(function() {\n  function EventSubscriptionVendor() {\n    this._currentSubscription = null;\n  }\n\n  function EventEmitter() {\n    this._subscriber = new EventSubscriptionVendor();\n  }\n\n  var e = new EventEmitter();\n  var havoc = global.__abstract ? global.__abstract(\"function\", \"(() => {})\") : () => {};\n  havoc(() => e.p);\n\n  new EventEmitter();\n});\n"
  },
  {
    "path": "test/serializer/pure-functions/NewExpression.js",
    "content": "var Foo = global.__abstract\n  ? __abstract(undefined, \"(function () { this.x = 10 })\")\n  : function() {\n      this.x = 10;\n    };\n\nfunction additional1() {\n  return new Foo();\n}\n\nif (global.__optimize) {\n  __optimize(additional1);\n}\n\ninspect = function() {\n  return JSON.stringify(additional1());\n};\n"
  },
  {
    "path": "test/serializer/pure-functions/ObjectAssign.js",
    "content": "var obj = global.__abstract && global.__makePartial ? __makePartial(__abstract({}, \"({foo:1})\")) : { foo: 1 };\n\nfunction additional1() {\n  return Object.assign({}, obj);\n}\n\nfunction additional2() {\n  return Object.assign(obj, { bar: 1 });\n}\n\nif (global.__optimize) {\n  __optimize(additional1);\n  __optimize(additional2);\n}\n\ninspect = function() {\n  var obj1 = additional1();\n  var obj2 = additional2();\n  return JSON.stringify({ obj1, obj2 });\n};\n"
  },
  {
    "path": "test/serializer/pure-functions/ObjectAssign2.js",
    "content": "(function() {\n  var someAbstract = global.__abstract ? __abstract(\"function\", \"(function() {})\") : () => {};\n  var evaluatePureFunction = global.__evaluatePureFunction || (f => f());\n\n  var result;\n  evaluatePureFunction(() => {\n    function calculate(y) {\n      var z = { c: 3, e: 1 };\n      if (global.__makePartial) __makePartial(z);\n      if (global.__makeSimple) __makeSimple(z);\n      someAbstract(z);\n\n      var x = { a: 1, b: 1, c: 1 };\n      return Object.assign(x, y, z);\n    }\n    result = calculate({ b: 2, d: 1 });\n  });\n\n  global.inspect = function() {\n    return JSON.stringify(result);\n  };\n})();\n"
  },
  {
    "path": "test/serializer/pure-functions/PutValueOnAbstract.js",
    "content": "if (!this.__evaluatePureFunction) {\n  this.__evaluatePureFunction = function(f) {\n    return f();\n  };\n}\n\nvar symbol = Symbol();\n\nvar result = __evaluatePureFunction(() => {\n  var somethingUnknown = global.__abstract ? __abstract(undefined, \"({})\") : {};\n  somethingUnknown.foo = 123;\n  somethingUnknown[\"0\"] = \"bar\";\n  somethingUnknown[symbol] = 5;\n  return somethingUnknown;\n});\n\ninspect = function() {\n  return JSON.stringify([result.foo, result[0], result[symbol]]);\n};\n"
  },
  {
    "path": "test/serializer/pure-functions/PutValueOnAbstract2.js",
    "content": "if (!this.__evaluatePureFunction) {\n  this.__evaluatePureFunction = function(f) {\n    return f();\n  };\n}\n\nvar symbol = Symbol();\n\nvar result = __evaluatePureFunction(() => {\n  var obj = { y: 0 };\n  var somethingUnknown = global.__abstract\n    ? __abstract(undefined, \"({set x(v) { v.y++; }})\")\n    : {\n        set x(v) {\n          v.y++;\n        },\n      };\n  somethingUnknown.x = obj;\n  return obj.y;\n});\n\ninspect = function() {\n  return result;\n};\n"
  },
  {
    "path": "test/serializer/pure-functions/SetterOnHavocedPrototype.js",
    "content": "var obj = global.__abstract && global.__makePartial ? __makePartial(__abstract({}, \"({foo:1})\")) : { foo: 1 };\n\nfunction fn(cb) {\n  var foo = {\n    set x(v) {\n      this.y = 1;\n    },\n  };\n  var bar = Object.create(foo);\n  bar.y = 2;\n  cb(foo);\n  bar.x = 3;\n  return bar.y;\n}\n\nif (global.__optimize) {\n  __optimize(fn);\n}\n\ninspect = function() {\n  return fn(o => o);\n};\n"
  },
  {
    "path": "test/serializer/pure-functions/StackOverflow.js",
    "content": "if (!global.__evaluatePureFunction) global.__evaluatePureFunction = f => f();\n\n// This means `Modules.prototype.getRequire` and `Modules.prototype.getDefine` can cache the result of\n// `Module.prototype._getGlobalProperty`. Otherwise the execution of `_getGlobalProperty` will blow the Prepack stack in\n// tracer code and we won’t observe our bug.\nglobal.require = () => {};\nglobal.__d = () => {};\n\nconst result = global.__evaluatePureFunction(() => {\n  function loop(i) {\n    if (i === 1000) {\n      return \"Hello, world\";\n    }\n    // Prevent tail recursion optimizations from applying.\n    return loop(i + 1) + \"!\";\n  }\n  return loop(0);\n});\n\nglobal.inspect = () => result;\n"
  },
  {
    "path": "test/serializer/pure-functions/ToObject.js",
    "content": "var obj =\n  global.__abstract && global.__makePartial && global.__makeSimple\n    ? __makePartial(__makeSimple(__abstract({}, \"({foo:1})\")))\n    : { foo: 1 };\nvar num = global.__abstract ? __abstract(\"number\", \"(1)\") : 1;\nvar val = global.__abstract ? __abstract(undefined, \"(true)\") : true;\nvar str = global.__abstract ? __abstract(\"string\", \"('123')\") : \"123\";\n\nfunction f1() {\n  return Object.assign(obj.foo);\n}\n\nfunction f2() {\n  return Object.prototype.valueOf.call(obj.foo);\n}\n\nfunction f3() {\n  return Object.getPrototypeOf(num);\n}\n\nfunction f4() {\n  return Object.getPrototypeOf(val);\n}\n\nfunction f5() {\n  return str.valueOf;\n}\n\nif (global.__optimize) {\n  __optimize(f1);\n  __optimize(f2);\n  __optimize(f3);\n  __optimize(f4);\n  __optimize(f5);\n}\n\ninspect = function() {\n  return JSON.stringify({ f1: f1().name, f2: f2().name, f3: f3().name, f4: f4().name, f5: f5().name });\n};\n"
  },
  {
    "path": "test/serializer/pure-functions/UnaryExpressions.js",
    "content": "let obj1 = global.__abstract\n  ? __abstract(\"object\", \"({foo: {valueOf() { return 42; }}})\")\n  : {\n      foo: {\n        valueOf() {\n          return 42;\n        },\n      },\n    };\nlet obj2 = global.__abstract\n  ? __abstract(\"object\", \"({foo: {bar: {valueOf() { return 42; }}}})\")\n  : {\n      foo: {\n        bar: {\n          valueOf() {\n            return 42;\n          },\n        },\n      },\n    };\n\nfunction additional1() {\n  return \"\" + +obj1.foo + -obj1.foo;\n}\n\nfunction additional2() {\n  return ~obj2.foo.bar + 10;\n}\n\nif (global.__optimize) {\n  __optimize(additional1);\n  __optimize(additional2);\n}\n\ninspect = function() {\n  let ret1 = additional1();\n  let ret2 = additional2();\n  return JSON.stringify({ ret1, ret2 });\n};\n"
  },
  {
    "path": "test/serializer/pure-functions/UnknownGetter.js",
    "content": "if (!global.__evaluatePureFunction) {\n  global.__evaluatePureFunction = f => f();\n}\n\n__evaluatePureFunction(() => {\n  let c = global.__abstract ? __abstract(\"boolean\", \"(true)\") : true;\n  let unknown = global.__abstract ? __abstract(\"string\", '(\"x\")') : \"x\";\n  let objWithGetter = {\n    y: 1,\n    get x() {\n      this.y = 2;\n      return 3;\n    },\n  };\n  let objWithoutGetter = {\n    y: 4,\n    x: 5,\n    get z() {},\n  };\n  let abstractObj = c ? objWithGetter : objWithoutGetter;\n  function Foo() {}\n  Foo.prototype = abstractObj;\n  let objWithProto = new Foo();\n  var x = objWithProto[unknown];\n  var y1 = abstractObj.y;\n  var y2 = objWithProto.y;\n\n  inspect = function() {\n    return JSON.stringify({ x, y1, y2 });\n  };\n});\n"
  },
  {
    "path": "test/serializer/pure-functions/UnknownSetter.js",
    "content": "if (!global.__evaluatePureFunction) {\n  global.__evaluatePureFunction = f => f();\n}\n\nvar result = __evaluatePureFunction(() => {\n  let c = global.__abstract ? __abstract(\"boolean\", \"(true)\") : true;\n  let unknown = global.__abstract ? __abstract(\"string\", '(\"x\")') : \"x\";\n  var knownObject = { a: 0 };\n  let objWithSetter = {\n    y: 1,\n    set x(v) {\n      this.y = 2;\n      v.a++;\n    },\n  };\n  let objWithDifferentSetter = {\n    y: 4,\n    x: 5,\n    set z(v) {},\n  };\n  let abstractObj = c ? objWithSetter : objWithDifferentSetter;\n  function Foo() {}\n  Foo.prototype = abstractObj;\n  let objWithProto = new Foo();\n  objWithProto[unknown] = knownObject;\n  let y1 = abstractObj.y;\n  let y2 = objWithProto.y;\n  let a = knownObject.a;\n  return { a, y1, y2 };\n});\n\ninspect = function() {\n  return JSON.stringify(result);\n};\n"
  },
  {
    "path": "test/serializer/pure-functions/hasOwnProperty.js",
    "content": "var obj = global.__abstract && global.__makePartial ? __makePartial(__abstract({}, \"({foo:1})\")) : { foo: 1 };\nif (global.__makeSimple) __makeSimple(obj);\n\nfunction additional1() {\n  var foo = obj.foo;\n  return Object.prototype.hasOwnProperty.call(foo, \"bar\");\n}\n\nfunction additional2() {\n  var foo = obj.foo;\n  var dontHavocThis = {\n    bar: 2,\n    toString: function() {\n      return \"bar\";\n    },\n  };\n  Object.prototype.hasOwnProperty.call(foo, dontHavocThis);\n  if (global.__isAbstract && __isAbstract(dontHavocThis.bar)) {\n    return \"This should not be abstract.\";\n  }\n  return dontHavocThis.bar;\n}\n\nif (global.__optimize) {\n  __optimize(additional1);\n  __optimize(additional2);\n}\n\ninspect = function() {\n  var obj1 = additional1();\n  var obj2 = additional2();\n  return JSON.stringify({ obj1, obj2 });\n};\n"
  },
  {
    "path": "test/serializer/pure-functions/hasOwnProperty2.js",
    "content": "var obj = global.__abstract && global.__makePartial ? __makePartial(__abstract({}, \"({foo:1})\")) : { foo: 1 };\nif (global.__makeSimple) __makeSimple(obj);\n\nfunction additional1() {\n  var foo = obj.foo;\n  var hasOwn = Object.prototype.hasOwnProperty;\n  var dontHavocThis = {\n    bar: 2,\n    toString: function() {\n      return \"bar\";\n    },\n  };\n  var x = 0;\n  if (hasOwn.call(foo, dontHavocThis)) {\n    x = 1;\n  } else {\n    x = 2;\n  }\n  if (global.__isAbstract && __isAbstract(dontHavocThis.bar)) {\n    return \"This should not be abstract.\";\n  }\n  return x;\n}\n\nfunction additional2() {\n  var foo = obj.foo;\n  var hasOwn = Object.prototype.hasOwnProperty.bind(foo);\n  var dontHavocThis = {\n    bar: 2,\n    toString: function() {\n      return \"bar\";\n    },\n  };\n  var x = 0;\n  if (hasOwn(dontHavocThis)) {\n    x = 1;\n  } else {\n    x = 2;\n  }\n  if (global.__isAbstract && __isAbstract(dontHavocThis.bar)) {\n    return \"This should not be abstract.\";\n  }\n  return x;\n}\n\nif (global.__optimize) {\n  __optimize(additional1);\n  __optimize(additional2);\n}\n\ninspect = function() {\n  var obj1 = additional1();\n  var obj2 = additional2();\n  return JSON.stringify({ obj1, obj2 });\n};\n"
  },
  {
    "path": "test/serializer/react/jsx/default-props.js",
    "content": "// es6\n// react\n// babel:jsx\n\nfunction MyComponent(props) {\n  return <span>{props.title}</span>;\n}\nMyComponent.defaultProps = {\n  title: \"Hello world\",\n  children: \"No children!\",\n};\n\nfunction ChildComponent(props) {\n  return <span>{props.title}</span>;\n}\nChildComponent.defaultProps = {\n  title: \"I am a child\",\n};\n\nfunction createElement(type, options, ...children) {\n  let key = null;\n  let ref = null;\n\n  if (options != null) {\n    if (options.key !== undefined) {\n      key = options.key;\n      delete options.key;\n    }\n    if (options.ref !== undefined) {\n      ref = options.ref;\n      delete options.ref;\n    }\n  }\n  let props = Object.assign({}, options);\n  if (children !== undefined) {\n    if (children.length === 1) {\n      props.children = children[0];\n    } else {\n      props.children = children;\n    }\n  }\n  return {\n    $$typeof: Symbol.for(\"react.element\"),\n    props,\n    key,\n    ref,\n    type,\n    _owner: undefined,\n  };\n}\n\nglobal.React = {\n  createElement,\n};\n\nglobal.reactElement = (\n  <MyComponent>\n    <ChildComponent title={\"I am a child (overwritten)\"} />\n  </MyComponent>\n);\n\ninspect = function() {\n  return global.reactElement;\n};\n"
  },
  {
    "path": "test/serializer/react/jsx/element-simple.js",
    "content": "// es6\n// react\n// babel:jsx\n\nfunction MyComponent() {\n  // ...\n}\n\nfunction createElement(type, options, ...children) {\n  let key = null;\n  let ref = null;\n\n  if (options != null) {\n    if (options.key !== undefined) {\n      key = options.key;\n      delete options.key;\n    }\n    if (options.ref !== undefined) {\n      ref = options.ref;\n      delete options.ref;\n    }\n  }\n  let props = Object.assign({}, options);\n  if (children !== undefined) {\n    if (children.length === 1) {\n      props.children = children[0];\n    } else {\n      props.children = children;\n    }\n  }\n  return {\n    $$typeof: Symbol.for(\"react.element\"),\n    props,\n    key,\n    ref,\n    type,\n    _owner: undefined,\n  };\n}\n\nglobal.React = {\n  createElement,\n};\n\nglobal.reactElement = createElement(\n  \"div\",\n  null,\n  createElement(\n    MyComponent,\n    {\n      foo: \"bar\",\n    },\n    \"Hello world\"\n  )\n);\n\ninspect = function() {\n  return global.reactElement;\n};\n"
  },
  {
    "path": "test/serializer/react/jsx/jsx-simple.js",
    "content": "// es6\n// react\n// babel:jsx\n\nfunction MyComponent() {\n  // ...\n}\n\nconst Container = {\n  MyComponent,\n};\n\nfunction createElement(type, options, ...children) {\n  let key = null;\n  let ref = null;\n\n  if (options != null) {\n    if (options.key !== undefined) {\n      key = options.key;\n      delete options.key;\n    }\n    if (options.ref !== undefined) {\n      ref = options.ref;\n      delete options.ref;\n    }\n  }\n  let props = Object.assign({}, options);\n  if (children !== undefined) {\n    if (children.length === 1) {\n      props.children = children[0];\n    } else {\n      props.children = children;\n    }\n  }\n  return {\n    $$typeof: Symbol.for(\"react.element\"),\n    props,\n    key,\n    ref,\n    type,\n    _owner: undefined,\n  };\n}\n\nglobal.React = {\n  createElement,\n};\n\nglobal.reactElement = (\n  <div>\n    <MyComponent foo=\"bar\">Hello world</MyComponent>\n  </div>\n);\nglobal.reactElementB = (\n  <div>\n    <Container.MyComponent foo=\"bar\">Hello world</Container.MyComponent>\n  </div>\n);\n\ninspect = function() {\n  return [global.reactElement, global.reactElementB];\n};\n"
  },
  {
    "path": "test/serializer/react/jsx/jsx-spread.js",
    "content": "// es6\n// react\n// babel:jsx\n\nconst Container = {\n  MyComponent,\n};\n\nfunction createElement(type, options, ...children) {\n  let key = null;\n  let ref = null;\n\n  if (options != null) {\n    if (options.key !== undefined) {\n      key = options.key;\n      delete options.key;\n    }\n    if (options.ref !== undefined) {\n      ref = options.ref;\n      delete options.ref;\n    }\n  }\n  let props = Object.assign({}, options);\n  if (children !== undefined) {\n    if (children.length === 1) {\n      props.children = children[0];\n    } else {\n      props.children = children;\n    }\n  }\n  return {\n    $$typeof: Symbol.for(\"react.element\"),\n    props,\n    key,\n    ref,\n    type,\n    _owner: undefined,\n  };\n}\n\nglobal.React = {\n  createElement,\n};\n\nfunction MyComponent(props) {\n  return (\n    <span>\n      Title: {props.title}, Number: {props.number}\n    </span>\n  );\n}\n\nlet props = {\n  title: \"Hello world\",\n  number: 50,\n};\n\nglobal.reactElement = (\n  <div>\n    <MyComponent {...props}>Hello world</MyComponent>\n  </div>\n);\n\ninspect = function() {\n  return global.reactElement;\n};\n"
  },
  {
    "path": "test/serializer/react/jsx/key-children.js",
    "content": "// es6\n// react\n// babel:jsx\n\nfunction createElement(type, options, ...children) {\n  let key = null;\n  let ref = null;\n\n  if (options != null) {\n    if (options.key !== undefined) {\n      key = options.key;\n      delete options.key;\n    }\n    if (options.ref !== undefined) {\n      ref = options.ref;\n      delete options.ref;\n    }\n  }\n  let props = Object.assign({}, options);\n  if (children !== undefined) {\n    if (children.length === 1) {\n      props.children = children[0];\n    } else {\n      props.children = children;\n    }\n  }\n  return {\n    $$typeof: Symbol.for(\"react.element\"),\n    props,\n    key,\n    ref,\n    type,\n    _owner: undefined,\n  };\n}\n\nglobal.React = {\n  createElement,\n};\n\nglobal.toggle = true;\n\nglobal.reactElement = (\n  <div>\n    <span>Span 1</span>\n    Text node\n    {[\n      <span>Span 2</span>,\n      \"Text node\",\n      [\n        <em key=\"a\">Em 1</em>,\n        <em key=\"b\">Em 2</em>,\n        \"Text node\",\n        <em key=\"c\">Em 3</em>,\n        toggle ? <em key=\"d\">Em 4</em> : <em key=\"d\">Em 5</em>,\n      ],\n      <span>Span 3</span>,\n    ]}\n    <span>Span 4</span>\n  </div>\n);\n\ninspect = function() {\n  return global.reactElement;\n};\n"
  },
  {
    "path": "test/serializer/trivial/Console.js",
    "content": "inspect = function() {\n  console.log(\"A\");\n  console.warn(\"B\");\n  console.error(\"C\");\n  console.log({});\n  console.warn({});\n  console.error({});\n};\n"
  },
  {
    "path": "test/serializer/trivial/Empty.js",
    "content": "// no effect\n"
  },
  {
    "path": "test/serializer/trivial/FunctionExpressionApplication.js",
    "content": "// no effect\n(function() {})();\n"
  },
  {
    "path": "test/serializer/trivial/GlobalVariable.js",
    "content": "// does not contain:void 0\nvar x = 1;\nx = 2;\ninspect = function() {\n  return x;\n};\n"
  },
  {
    "path": "test/serializer/trivial/GlobalVariable2.js",
    "content": "// does contain:void 0\nvar x = 1;\nx = 2;\nx = undefined;\ninspect = function() {\n  return x;\n};\n"
  },
  {
    "path": "test/serializer/trivial/If.js",
    "content": "// no effect\n// omit invariants\nlet x = global.__abstract ? __abstract(\"boolean\", \"true\") : true;\nlet o = new Object();\nif (x) o.x = 42;\nelse o.x = 23;\n"
  },
  {
    "path": "test/serializer/trivial/LocalVariable.js",
    "content": "// no effect\nlet x = 42;\n"
  },
  {
    "path": "test/serializer/trivial/ObjectCreation.js",
    "content": "// no effect\n// omit invariants\n(function() {\n  var o = new Object();\n  o.x = 42;\n})();\n"
  },
  {
    "path": "test/source-maps/Stacktrace.js",
    "content": "f = function() {\n  throw new TypeError(\"not really\");\n};\n"
  },
  {
    "path": "test/std-in/StdIn.js",
    "content": "// @flow\nfunction hello() {\n  return \"Hello\";\n}\nfunction world() {\n  return \"world\";\n}\nlet greeting = hello() + \" \" + world();\nconsole.log(greeting + \" from std-in\");\n"
  },
  {
    "path": "webpack.config.js",
    "content": "/**\n * Copyright (c) 2017-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\nconst path = require(\"path\");\n\nprocess.env.NODE_ENV = \"production\";\n\nconst WebpackConfig = {\n  entry: \"./\",\n  output: {\n    path: path.join(__dirname),\n    filename: \"prepack.min.js\",\n    library: \"Prepack\",\n  },\n  parallelism: 1,\n  profile: true,\n  mode: \"production\",\n  optimization: {\n    minimize: true,\n  },\n  module: {\n    rules: [\n      {\n        test: /\\.js$/,\n        use: {\n          loader: \"babel-loader\",\n        },\n      },\n    ],\n  },\n};\n\nmodule.exports = WebpackConfig;\n"
  },
  {
    "path": "website/.gitignore",
    "content": ".*.haste_cache.*\n*~\n/node_modules\n/lib\nnpm-debug.log\n.DS_Store\nbuild/\n.vscode\ncoverage*/\ntest/\n"
  },
  {
    "path": "website/CNAME",
    "content": "prepack.io"
  },
  {
    "path": "website/README.md",
    "content": "# prepack.io\n\nThis website lives at [prepack.io](http://prepack.io)."
  },
  {
    "path": "website/circle.yml",
    "content": "general:\n  branches:\n    ignore:\n      - gh-pages\n"
  },
  {
    "path": "website/css/prism.css",
    "content": "/* PrismJS 1.15.0\nhttps://prismjs.com/download.html#themes=prism-tomorrow&languages=clike+javascript */\n/**\n * prism.js tomorrow night eighties for JavaScript, CoffeeScript, CSS and HTML\n * Based on https://github.com/chriskempson/tomorrow-theme\n * @author Rose Pritchard\n */\n\n code[class*=\"language-\"],\n pre[class*=\"language-\"] {\n   color: #ccc;\n   background: none;\n   font-family: Consolas, Monaco, 'Andale Mono', 'Ubuntu Mono', monospace;\n   text-align: left;\n   white-space: pre;\n   word-spacing: normal;\n   word-break: normal;\n   word-wrap: normal;\n   line-height: 1.5;\n \n   -moz-tab-size: 4;\n   -o-tab-size: 4;\n   tab-size: 4;\n \n   -webkit-hyphens: none;\n   -moz-hyphens: none;\n   -ms-hyphens: none;\n   hyphens: none;\n \n }\n \n /* Code blocks */\n pre[class*=\"language-\"] {\n   padding: 1em;\n   margin: .5em 0;\n   overflow: auto;\n }\n \n :not(pre) > code[class*=\"language-\"],\n pre[class*=\"language-\"] {\n   background: #2d2d2d;\n }\n \n /* Inline code */\n :not(pre) > code[class*=\"language-\"] {\n   padding: .1em;\n   border-radius: .3em;\n   white-space: normal;\n }\n \n .token.comment,\n .token.block-comment,\n .token.prolog,\n .token.doctype,\n .token.cdata {\n   color: #999;\n }\n \n .token.punctuation {\n   color: #ccc;\n }\n \n .token.tag,\n .token.attr-name,\n .token.namespace,\n .token.deleted {\n   color: #e2777a;\n }\n \n .token.function-name {\n   color: #6196cc;\n }\n \n .token.boolean,\n .token.number,\n .token.function {\n   color: #f08d49;\n }\n \n .token.property,\n .token.class-name,\n .token.constant,\n .token.symbol {\n   color: #f8c555;\n }\n \n .token.selector,\n .token.important,\n .token.atrule,\n .token.keyword,\n .token.builtin {\n   color: #cc99cd;\n }\n \n .token.string,\n .token.char,\n .token.attr-value,\n .token.regex,\n .token.variable {\n   color: #7ec699;\n }\n \n .token.operator,\n .token.entity,\n .token.url {\n   color: #67cdcc;\n }\n \n .token.important,\n .token.bold {\n   font-weight: bold;\n }\n .token.italic {\n   font-style: italic;\n }\n \n .token.entity {\n   cursor: help;\n }\n \n .token.inserted {\n   color: green;\n }"
  },
  {
    "path": "website/css/style.css",
    "content": "/*html, body {\n  margin: 0;\n  height: 100%;\n  font-family: \"Helvetica Neue\", Helvetica, Roboto, Arial, sans-serif;\n}*/\n\n*, ::before, ::after {\n  -webkit-font-smoothing: antialiased;\n  box-sizing: border-box;\n}\n\nhtml {\n  font-family: \"Helvetica Neue\", Helvetica, Arial, sans-serif;\n  color: #333333;\n  line-height: 1.375; /* 16/22 */\n  font-size: 16px;\n}\n\nbody {\n  margin: 0;\n}\n\n/* Prism.js overrides */\n\npre[class*=\"language-\"] {\n  margin: 0;\n  height: 100%;\n}\n\n:not(pre) > code[class*=\"language-\"], pre[class*=\"language-\"] {\n  background: #1c231f;\n  overflow: auto;\n}\n\n/* HEADER */\n\nheader, .repl-container {\n  left: 0;\n  right: 0;\n}\n\n.record-container{\n  height: 60px;\n  /*margin-top:60px;*/\n  padding-top: 8px;\n  /*line-height: 40px;*/\n  background: #1c1c1c;\n  color: white;\n  z-index: 10;\n}\n\n.record-container .select-record-input{\n  display: inline-block;\n  vertical-align: top;\n}\n.record-container .select-record{\n  visibility: hidden;\n}\n.record-container .select-target{\n  /*margin-left:20px;*/\n  /*height: 44px;*/\n}\n.record-container .options-input{\n  display: inline-block;\n  vertical-align: top;\n  margin-right: 20px;\n  padding: 8px 0px;\n}\n.record-container .options-menu-button{\n  display: inline-block;\n  vertical-align: top;\n  padding: 5px 20px;\n  font-size: 14px;\n  cursor: pointer;\n  border-radius: 3px;\n  -webkit-touch-callout: none;\n  -webkit-user-select: none;\n  -khtml-user-select: none;\n  -moz-user-select: none;\n  -ms-user-select: none;\n  user-select: none;\n  background-color:#505050;\n}\n.record-container .options-menu-button:hover{\n  background-color:#808080;\n}\n.record-container .options-menu-record{\n  display: none;\n  vertical-align: top;\n  z-index: 20;\n  background: #1c1c1c;\n  color: white;\n  border-radius: 3px;\n  padding: 10px;\n  border: 1px solid gray;\n  position: fixed;\n}\n.record-container .options-menu-record .prepack-option{\n  padding: 10px;\n  border-bottom: 1px solid gray;\n  font-size: 14px;\n}\n.record-container .options-menu-record .prepack-option .prepack-option-label{\n  display: inline-block;\n  max-width: 100%;\n  font-weight: bold;\n  padding-left: 5px;\n}\n.record-container .options-menu-record .prepack-option .prepack-option-description{\n  max-width: 100%;\n  font-weight: bold;\n  font-size: 12px;\n  padding-left: 5px;\n  color: #b9b9b9;\n}\n.record-container .options-menu-record input{\n  /*height: 30px;*/\n  outline: none;\n  border: 2px solid transparent;\n  border-radius: 5px;\n  width: 100px;\n  padding-left: 15px;\n  margin-right: 5px;\n}\n\n.record-container .options-menu-record input:focus{\n  outline: none;\n  border: 2px solid #63a2f1;\n}\n\n.record-container .options-menu-record:after{\n  content:'';\n  display: block;\n  clear: both;\n}\n.record-container .record-button{\n  display: inline-block;\n  vertical-align: top;\n  padding: 5px 20px;\n  vertical-align: top;\n  font-size: 14px;\n  cursor: pointer;\n  border-radius: 3px;\n}\n.record-container .record-button.save{\n  background-color:#13aa13;\n}\n.record-container .record-button.save:hover{\n  background-color:#18d818;\n}\n.record-container .record-button.delete{\n  background-color:#ea2d2d;\n}\n.record-container .record-button.delete:hover{\n  background-color:#ef5b5b;\n}\n.record-container .record-button.graphBtn{\n  background-color: blue;\n}\n\n.record-container .record-input{\n  right: 0px;\n  display: inline-block;\n  vertical-align: top;\n  margin-right: 20px;\n  padding: 8px 0px;\n  /*height: 100%;*/\n  position: fixed;\n}\n\n.record-container .record-input input{\n  height: 30px;\n  outline: none;\n  border: 2px solid transparent;\n  border-radius: 5px;\n  width: 200px;\n  padding-left: 15px;\n  margin-right: 20px;\n}\n\n.record-container .record-input input:focus{\n  outline: none;\n  border: 2px solid #63a2f1;\n}\n\n.record-container .record-input:after{\n  content:'';\n  display: block;\n  clear: both;\n}\n\n.repl-container {\n  position: absolute;\n  top: 120px;\n  bottom: 0;\n  background-color: #f7f7f7;\n  z-index: -1;\n}\n\n/* NAV */\n\n.nav-toggle {\n  cursor: pointer;\n  display: block;\n  height: 3.25rem;\n  position: relative;\n  width: 3.25rem;\n}\n\n.nav-toggle span {\n  background-color: #ffffff;\n  display: block;\n  height: 1px;\n  left: 50%;\n  margin-left: -7px;\n  position: absolute;\n  top: 50%;\n  -webkit-transition: none 86ms ease-out;\n  transition: none 86ms ease-out;\n  -webkit-transition-property: background, left, opacity, -webkit-transform;\n  transition-property: background, left, opacity, -webkit-transform;\n  transition-property: background, left, opacity, transform;\n  transition-property: background, left, opacity, transform, -webkit-transform;\n  width: 15px;\n}\n\n.nav-toggle span:nth-child(1) {\n  margin-top: -6px;\n}\n\n.nav-toggle span:nth-child(2) {\n  margin-top: -1px;\n}\n\n.nav-toggle span:nth-child(3) {\n  margin-top: 4px;\n}\n\n.nav-toggle:hover {\n  background-color: #1eb168;\n}\n\n.nav-toggle.is-active span {\n  background-color: #ffffff;\n}\n\n.nav-toggle.is-active span:nth-child(1) {\n  margin-left: -5px;\n  -webkit-transform: rotate(45deg);\n  transform: rotate(45deg);\n  -webkit-transform-origin: left top;\n  transform-origin: left top;\n}\n\n.nav-toggle.is-active span:nth-child(2) {\n  opacity: 0;\n}\n\n.nav-toggle.is-active span:nth-child(3) {\n  margin-left: -5px;\n  -webkit-transform: rotate(-45deg);\n  transform: rotate(-45deg);\n  -webkit-transform-origin: left bottom;\n  transform-origin: left bottom;\n}\n\n@media screen and (min-width: 769px), print {\n  .nav-toggle {\n    display: none;\n  }\n}\n\n.nav-item {\n  -webkit-box-align: center;\n  -ms-flex-align: center;\n  align-items: center;\n  display: -webkit-box;\n  display: -ms-flexbox;\n  display: flex;\n  -webkit-box-flex: 0;\n  -ms-flex-positive: 0;\n  flex-grow: 0;\n  -ms-flex-negative: 0;\n  flex-shrink: 0;\n  font-size: 1rem;\n  -webkit-box-pack: center;\n  -ms-flex-pack: center;\n  justify-content: center;\n  line-height: 1.5;\n  padding: 0.5rem 0.75rem;\n  text-decoration: none;\n  margin: 0 1px;\n}\n\n.nav-item a {\n  -webkit-box-flex: 1;\n  -ms-flex-positive: 1;\n  flex-grow: 1;\n  -ms-flex-negative: 0;\n  flex-shrink: 0;\n}\n\n@media screen and (max-width: 768px) {\n  .nav-item {\n    -webkit-box-pack: start;\n    -ms-flex-pack: start;\n    justify-content: flex-start;\n  }\n}\n\na.nav-item {\n  color: #ffffff;\n}\n\n@media screen and (max-width: 768px) {\n  a.nav-item {\n    margin: 0;\n  }\n}\n\na.nav-item:not(.is-brand) {\n  letter-spacing: 1px;\n  text-transform: uppercase;\n}\n\na.nav-item:hover:not(.is-brand) {\n  color: #1eb168;\n  border-bottom: 1px solid #1eb168;\n}\n\na.nav-item.is-active {\n  color: #1eb168;\n  border-bottom: 1px solid #1eb168;\n}\n\na.nav-item.is-brand {\n  color: #ffffff;\n  font-size: 24px;\n}\n\nimg.nav-logo {\n  height: 30px;\n  margin: 5px;\n}\n\n@media screen and (min-width: 1000px) {\n  a.nav-item.is-brand {\n    padding-left: 0;\n  }\n}\n\n.nav-left,\n.nav-right {\n  -webkit-box-align: stretch;\n  -ms-flex-align: stretch;\n  align-items: stretch;\n  display: -webkit-box;\n  display: -ms-flexbox;\n  display: flex;\n  -webkit-box-flex: 1;\n  -ms-flex-positive: 1;\n  flex-grow: 1;\n  -ms-flex-negative: 0;\n  flex-shrink: 0;\n  max-width: 100%;\n  overflow: auto;\n}\n\n.nav-left {\n  -webkit-box-pack: start;\n  -ms-flex-pack: start;\n  justify-content: flex-start;\n  white-space: nowrap;\n}\n\n.nav-right {\n  -webkit-box-pack: end;\n  -ms-flex-pack: end;\n  justify-content: flex-end;\n}\n\n@media screen and (max-width: 768px) {\n  .nav-menu.nav-right {\n    background-color: #101512;\n    -webkit-box-shadow: 0 4px 7px rgba(10, 10, 10, 0.1);\n    box-shadow: 0 4px 7px rgba(10, 10, 10, 0.1);\n    left: 0;\n    display: none;\n    right: 0;\n    top: 100%;\n    position: absolute;\n  }\n\n  .nav-menu.nav-right .nav-item {\n    padding: 0.75rem;\n  }\n\n  .nav-menu.nav-right .nav-item:hover {\n    padding: 0.75rem;\n    background-color: #1eb168;\n    color: #ffffff;\n  }\n\n  .nav-menu.nav-right.is-active {\n    display: block;\n  }\n}\n\n.nav {\n  margin: 0 auto;\n  -webkit-box-align: stretch;\n  -ms-flex-align: stretch;\n  align-items: stretch;\n  background-color: #101512;\n  display: -webkit-box;\n  display: -ms-flexbox;\n  display: flex;\n  position: relative;\n  text-align: center;\n  z-index: 10;\n}\n\n.nav > .content-container {\n  -webkit-box-align: stretch;\n  -ms-flex-align: stretch;\n  align-items: stretch;\n  display: -webkit-box;\n  display: -ms-flexbox;\n  display: flex;\n  min-height: 3.25rem;\n  width: 100%;\n}\n\n/* CONTENT */\n.content-container {\n  max-width: 1010px;\n  margin-left: auto;\n  margin-right: auto;\n  padding-left: 20px;\n  padding-right: 20px;\n}\n\n.content {\n  /*margin-top: 60px;*/\n  /*padding: 20px 0;*/\n}\n\n.hero {\n  background: #1c231f;\n  color: #ffffff;\n  padding: 50px 0;\n  font-weight: 200;\n  text-align: center;\n  border-bottom: solid 1px #e0e0e3;\n}\n\n.hero .text {\n  margin: 0;\n  font-size: 64px;\n  line-height: 96px;\n  color: #ffffff;\n}\n\n.hero h2.minitext {\n  font-size: 28px;\n  line-height: inherit;\n  margin: 1em 0;\n}\n\n.disclaimer {\n  width: 50%;\n  margin: auto;\n}\n\n.buttons-unit {\n  margin: 2em 0 1em;\n}\n\n.button {\n  border-radius: 4px;\n  border: solid 1px #1eb168;\n  color: #1eb168;\n  display: inline-block;\n  font-size: 20px;\n  font-weight: 400;\n  margin: 0 20px;\n  padding: 8px 24px;\n  text-decoration: none;\n}\n\n.button:hover, .button:active, .button:focus {\n  text-decoration: none;\n  box-shadow: none;\n  color: #ffffff;\n  background-color: #1eb168;\n}\n\n.section {\n  background: #fff;\n  padding: 25px 25px;\n  text-align: center;\n  border-bottom: solid 1px #e0e0e3;\n}\n\n.example {\n  display: flex;\n  flex-direction: row;\n  width: 100%;\n}\n\n.example-code {\n  height: 100%;\n}\n\n.example-input, .example-output {\n  flex: 1;\n  margin: 0 5px;\n  background-color:#1c231f;\n  width: 0;\n  display: flex;\n  flex-direction: column;\n}\n\n@media (max-width: 800px) {\n  .example {\n    flex-direction: column;\n  }\n\n  .example-code {\n    max-width: inherit;\n  }\n}\n\n.example-input::before, .example-output::before, .code-block::before {\n  background: #101512;\n  color: #ffffff;\n  display: block;\n  font-size: 11px;\n  font-weight: bold;\n  height: 34px;\n  line-height: 34px;\n  padding: 0 10px;\n  text-align: left;\n}\n\n.example-input {\n\n}\n\n.example-input::before {\n  content: 'Input';\n}\n\n.example-output {\n\n}\n\n.example-output::before {\n  content: 'Output';\n}\n\n.code-block {\n  margin: 5px;\n  background-color: #fdfaeb;\n}\n\n.code-block.language-js::before {\n  content: 'JavaScript';\n}\n\n.code-block.language-sh::before {\n  content: 'Shell';\n}\n\n.options-table {\n  border: 1px solid #ddd;\n  width: 100%;\n  max-width: 100%;\n  text-align: left;\n  border-collapse: collapse;\n  border-spacing: 0;\n}\n\n.options-table td, .options-table th {\n  padding: 8px;\n  border: 1px solid #ddd;\n}\n\n/* REPL */\n\n.input, .output, .graph {\n  position: absolute;\n  top: 0;\n  bottom: 0;\n  width: 50%;\n}\n\n.input {\n  box-sizing: border-box;\n  left: 0;\n  border-right: 1px solid #ddd;\n}\n\n.output {\n  left: 50%;\n}\n\n.graph {\n  display: none;\n  left: 66%;\n  background-color: white;\n  border-left: 1px solid #ddd;\n}\n.graphBar {\n  background-color: white;\n  height: 3%;\n  padding-top: 0;\n  vertical-align: center;\n}\n\n.graphBox {\n  background-color: #ddd;\n  height: 85%;\n}\n\n.graphLegend {\n  padding-top: 2%;\n  height: 15%;\n}\n\n.legend-header {\n  text-align: center;\n}\n\n.legend-table {\n  text-align: center;\n  margin: 0 auto;\n  padding-bottom: 3%;\n  border-spacing: 5%;\n}\n\n.repl {\n  width: 100%;\n  height: 100%;\n}\n\n.messagesContainer {\n  width: 100%;\n  height: auto;\n  position: absolute;\n  bottom: 0;\n  z-index: 5; /* one more than ace_gutter */\n  overflow-x: scroll;\n  overflow-y: hidden;\n}\n\n.messages {\n  display: inline-block;\n  min-width: 100%;\n  height: 100%;\n  font-family: \"Operator Mono\", \"Fira Code\", \"Ubuntu Mono\", \"Droid Sans Mono\", \"Liberation Mono\", \"Source Code Pro\", Menlo, Monaco, Consolas, \"Courier New\", monospace;\n  white-space: pre;\n}\n\n.message {\n  width: 100%;\n  padding: 10px;\n}\n\n.message.error {\n  color: #c7254e;\n  background-color:#ffefee;\n  border-top: 1px solid #ffe1e0;\n}\n\n.message.error > .line-link {\n  color: red;\n}\n\n.message.warning {\n  color: #8a6f40;\n  background-color:#fffae5;\n  border-top: 1px solid #fff6cc;\n}\n\n.message.warning > .line-link {\n  color: #7d7d7d;\n}\n\n.align-left {\n  text-align: left;\n}\n\n/* FOOTER */\n.footer-background {\n  background-color: #323330;\n}\n\n.footer {\n  color: white;\n  padding: 1em;\n  display: flex;\n  flex-direction: row;\n  justify-content: space-between;\n  align-items: center;\n}\n\n.oss-logo {\n  height: 45px;\n}\n\n/* TETHER SELECT */\n.select.select-theme-dark {\n  z-index: 100;\n}"
  },
  {
    "path": "website/frequently-asked-questions.html",
    "content": "<!DOCTYPE html>\n<html lang=\"en\">\n  <head>\n    <title>Prepack &middot; Partial evaluator for JavaScript</title>\n    <script src=\"js/prism.js\"></script>\n    <link rel=\"stylesheet\" href=\"css/prism.css\"/>\n    <link rel=\"stylesheet\" href=\"css/style.css\"/>\n    <script>\n      (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){\n        (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),\n        m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)\n      })(window,document,'script','https://www.google-analytics.com/analytics.js','ga');\n      ga('create', 'UA-44373548-29', 'auto');\n      ga('send', 'pageview');\n    </script>\n  </head>\n  <body>\n\n    <nav class=\"nav\">\n      <div class=\"content-container\">\n\n        <div class=\"nav-left\">\n          <a class=\"nav-item is-brand\" href=\"./\">\n            <img class=\"nav-logo\" src=\"static/images/prepack_logo.png\" alt=\"prepack logo\"/>\n            Prepack\n          </a>\n        </div>\n\n        <span id=\"nav-toggle\" class=\"nav-toggle\">\n          <span></span>\n          <span></span>\n          <span></span>\n        </span>\n\n        <div id=\"nav-menu\" class=\"nav-right nav-menu\">\n          <a href=\"./\" class=\"nav-item\">About</a>\n          <a href=\"getting-started.html\" class=\"nav-item\">Getting Started</a>\n          <a href=\"frequently-asked-questions.html\" class=\"nav-item is-active\">FAQs</a>\n          <a href=\"repl.html\" class=\"nav-item\">Try It Out</a>\n          <a href=\"https://github.com/facebook/prepack\" class=\"nav-item\">GitHub</a>\n        </div>\n\n      </div>\n    </nav>\n\n    <div class=\"content\">\n      <div class=\"section\">\n        <div class=\"content-container\">\n          <h2>Why do I get a <code>ReferenceError</code> when trying to prepack my code?</h2>\n\n          <p class=\"align-left\">\n            Trying to prepack a seemingly simple program such as <code>global.result = UnknownProperty;</code> will cause a\n            <code>ReferenceError</code>. The reason is that Prepack actually runs the global code, not knowing anything else\n            about the environment. And the semantics of JavaScript is that an unknown identifier that cannot be resolved\n            causes a <code>ReferenceError</code>. You might want to invest into modeling your environment.\n            Check out the section <i>The Environment matters!</i> on the landing page.\n          </p>\n\n          <h2>Why does <code>global.UnknownProperty</code> prepack to <code>undefined</code>?</h2>\n\n          <p class=\"align-left\">\n            Prepack actually runs the global code, and by default, any accesses to unknown properties of an object result in\n            <code>undefined</code>. Thus, <code>global.UnknownProperty</code> prepacks to <code>undefined</code>.\n            You might want to invest into modeling your environment.\n            Check out the section <i>The Environment matters!</i> on the landing page.\n          </p>\n\n          <h2>What is an <code>__IntrospectionError</code> or a PPxxxx error code?</h2>\n\n          <p class=\"align-left\">\n            Prepack actually runs the global code.\n            When functions such as <code>Date.now</code> or <code>Math.random</code> are invoked,\n            their behavior is <i>non-deterministic</i>. Prepack doesn't know which exact value they will return\n            when the resulting prepacked code will run again later in the real run-time environment.\n            (You can also directly inject such non-deterministic values using Prepack's <code>__abstract</code> built-in, or\n            other modeling built-ins described in the section <i>The Environment matters!</i> on the landing page.)\n          </p>\n          <p class=\"align-left\">\n            When the global code branches over such values,\n            it is not clear at prepack-time which branch will be taken later in the real run-time environment.\n            Therefore, Prepack tries to explore all possible behaviors, and summarize them.\n            However, Prepack is still limited in its abilities, and sometimes it just won't ever make sense to explore all possible behaviors.\n            In those cases, Prepack either throws a generic <code>__IntrospectionError</code>, or reports a specialized PPxxxx error.\n            This is not a user error, but a Prepack limitation.\n            It is sometimes possible to work around these limitations by changing your code. The easiest way to work around the limitation is to move the problematic code out of the global code path into a callback that's only invoked later, or by making the problematic part of the initialization phase lazy.\n          </p>\n          <p class=\"align-left\">\n            If you get such an error while using <code>Math.random</code>,\n            consider setting the <code>mathRandomSeed</code> option to make all random numbers queries along the global code path deterministic.\n          </p>\n          <p class=\"align-left\">\n            All PPxxxx error code are <a href=\"https://github.com/facebook/prepack/wiki/Prepack-diagnostics\">documented on the Prepack wiki</a>.\n          </p>\n\n          <h2>When will Prepack understand all DOM objects?</h2>\n\n          <p class=\"align-left\">\n            Monitor <a href=\"https://github.com/facebook/prepack/issues/24\">this GitHub issue</a>.\n          </p>\n\n          <h2>Why didn't Prepack optimize code that's in a function?</h2>\n\n          <p class=\"align-left\">\n            Prepack only optimizes code that gets executed along the global code path, the initialization phase.\n            Any code that sits behind callbacks is not optimized by default.\n            Check out the <i>Optimize More Code!</i> section on the landing page for information on how to optimize functions.\n          </p>\n\n          <h2>When is Prepack ready to be used in production?</h2>\n\n          <p class=\"align-left\">\n            Wait for our <a href=\"https://www.npmjs.com/package/prepack\">latest release</a> to reach v1.0.\n          </p>\n\n          <h2>Has Prepack been integrated with other tools?</h2>\n\n          <p class=\"align-left\">\n            The following are a few plugins to other tools.\n            They have been created and are maintained separately from Prepack itself.\n            If you run into any issues with those plugins,\n            please ask the plugin maintainers for support.\n          </p>\n          <p class=\"align-left\">\n            <b>Prepack is still in an early development stage and not ready for production use just yet.</b>\n          </p>\n\n          <ul class=\"align-left\">\n            <li>\n              <a href=\"https://www.npmjs.com/package/rollup-plugin-prepack\">A Rollup plugin for Prepack</a>\n            </li>\n            <li>\n              <a href=\"https://www.npmjs.com/package/prepack-webpack-plugin\">A webpack plugin for Prepack</a>\n            </li>\n            <li>\n              <a href=\"https://marketplace.visualstudio.com/items?itemName=RobinMalfait.prepack-vscode\">A Visual Studio code plugin for Prepack</a>\n            </li>\n            <li>\n              <a href=\"https://www.npmjs.com/package/babel-plugin-flow-prepack\">A babel plugin which transforms Flow annotations into prepack model declarations.</a>\n            </li>\n          </ul>\n\n        </div>\n      </div>\n    </div>\n\n    <div class=\"footer-background\">\n      <div class=\"content-container\">\n        <div class=\"footer\">\n          <div>\n            Copyright &copy; 2018 Facebook Inc.\n          </div>\n          <div>\n            <a href=\"https://code.facebook.com/projects/\" target=\"_blank\">\n              <img\n                class=\"oss-logo\"\n                src=\"./static/images/oss_logo.png\"\n                alt=\"Facebook Open Source\"\n                title=\"Facebook Open Source\" />\n            </a>\n          </div>\n        </div>\n      </div>\n    </div>\n\n    <script src=\"js/toggle_menu.js\"></script>\n  </body>\n</html>\n"
  },
  {
    "path": "website/getting-started.html",
    "content": "<!DOCTYPE html>\n<html lang=\"en\">\n  <head>\n    <title>Prepack &middot; Partial evaluator for JavaScript</title>\n    <script src=\"js/prism.js\"></script>\n    <link rel=\"stylesheet\" href=\"css/prism.css\"/>\n    <link rel=\"stylesheet\" href=\"css/style.css\"/>\n    <script>\n      (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){\n        (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),\n        m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)\n      })(window,document,'script','https://www.google-analytics.com/analytics.js','ga');\n      ga('create', 'UA-44373548-29', 'auto');\n      ga('send', 'pageview');\n    </script>\n  </head>\n  <body>\n\n    <nav class=\"nav\">\n      <div class=\"content-container\">\n\n        <div class=\"nav-left\">\n          <a class=\"nav-item is-brand\" href=\"./\">\n            <img class=\"nav-logo\" src=\"static/images/prepack_logo.png\" alt=\"prepack logo\"/>\n            Prepack\n          </a>\n        </div>\n\n        <span id=\"nav-toggle\" class=\"nav-toggle\">\n          <span></span>\n          <span></span>\n          <span></span>\n        </span>\n\n        <div id=\"nav-menu\" class=\"nav-right nav-menu\">\n          <a href=\"./\" class=\"nav-item\">About</a>\n          <a href=\"getting-started.html\" class=\"nav-item is-active\">Getting Started</a>\n          <a href=\"frequently-asked-questions.html\" class=\"nav-item\">FAQs</a>\n          <a href=\"repl.html\" class=\"nav-item\">Try It Out</a>\n          <a href=\"https://github.com/facebook/prepack\" class=\"nav-item\">GitHub</a>\n        </div>\n\n      </div>\n    </nav>\n\n    <div class=\"content\">\n      <div class=\"section\">\n        <div class=\"content-container\">\n          <h2>What Does Prepack Do?</h2>\n\n          <p class=\"align-left\">You can learn the basics of what Prepack does and how it works from <a href=\"https://gist.github.com/gaearon/d85dccba72b809f56a9553972e5c33c4\">this overview</a>.</p>\n\n          <p class=\"align-left\">It's not complete, but it can serve as a high-level overview while avoiding the computer science jargon.</p>\n        </div>\n      </div>\n    </div>\n\n    <div class=\"content\">\n      <div class=\"section\">\n        <div class=\"content-container\">\n          <h2>Prepack CLI</h2>\n\n          <h3>Installation</h3>\n          <div class=\"code-block language-sh\">\n            <pre><code>npm install -g prepack</code></pre>\n          </div>\n\n          <h3>Compiling a File</h3>\n\n          <p class=\"align-left\">Compile a file and print it to the console:</p>\n          <div class=\"code-block language-sh\">\n            <pre><code>prepack script.js</code></pre>\n          </div>\n\n          <p class=\"align-left\">Compile a file and output <strong>to another file</strong>:</p>\n          <div class=\"code-block language-sh\">\n            <pre><code>prepack script.js --out script-processed.js</code></pre>\n          </div>\n\n          <p class=\"align-left\">If you want to output <strong>a source map file</strong> add the <code>--srcmapOut</code>. If your bundle was generated from some other compiler, Prepack will automatically look for a <code>.map</code> file but you can also specify it using the <code>--srcmapIn</code> option:</p>\n          <div class=\"code-block language-sh\">\n            <pre><code>prepack script.js --out script-processed.js --srcmapIn script.map --srcmapOut script-processed.map</code></pre>\n          </div>\n\n          <p class=\"align-left\">\n            For advanced uses <a href=\"#options\">see the API options</a> or <code>prepack --help</code>.\n          </p>\n          <div class=\"code-block language-sh\">\n            <pre><code>prepack [ --out output.js ] [ --compatibility jsc ] [ --mathRandomSeed seedvalue ] [ --srcmapIn inputMap ] [ --srcmapOut outputMap ] [ -- | input.js ]</code></pre>\n          </div>\n\n          <h3>REPL</h3>\n          <p class=\"align-left\">\n            You can also run Prepack in REPL mode. This probably isn't very useful but it lets you test bugs in Prepack's interpreter.\n          </p>\n          <div class=\"code-block language-sh\">\n            <pre><code>prepack-repl</code></pre>\n          </div>\n        </div>\n      </div>\n\n      <div class=\"section\">\n        <div class=\"content-container\">\n          <h2>Prepack API</h2>\n\n          <p class=\"align-left\">\n            You can also use the programmatic API as a Node.js module.\n          </p>\n\n          <h3>Installation</h3>\n          <div class=\"code-block language-sh\">\n            <pre><code>npm install --save-dev prepack</code></pre>\n          </div>\n\n          <div class=\"code-block language-js\">\n            <pre><code>var Prepack = require(\"prepack\");\nimport { prepack, prepackFileSync } from 'prepack';\nimport * as Prepack from 'prepack';</code></pre>\n          </div>\n\n          <h3>String</h3>\n          <div class=\"code-block language-js\">\n            <pre><code>Prepack.prepackSources([{filePath, fileContents, sourceMapContents}], options) // returns { code: string, map: SourceMap }</code></pre>\n          </div>\n\n          <h3>File Async</h3>\n          <div class=\"code-block language-js\">\n            <pre><code>Prepack.prepackFile(filename, options, callback) // callback(error, { code: string, map: SourceMap })</code></pre>\n          </div>\n\n          <h3>File Sync</h3>\n          <div class=\"code-block language-js\">\n            <pre><code>Prepack.prepackFileSync(filenames, options) // returns { code: string, map: SourceMap }</code></pre>\n          </div>\n\n          <h3 id=\"options\">Options</h3>\n          <table class=\"options-table\">\n            <thead>\n              <tr>\n                <th>Option</th>\n                <th>Type</th>\n                <th>Default</th>\n                <th>Description</th>\n              </tr>\n            </thead>\n            <tbody>\n              <tr>\n                <td><code>filename</code></td>\n                <td><code>string</code></td>\n                <td>inferred</td>\n                <td>Filename to use in error stacks.</td>\n              </tr>\n              <tr>\n                <td><code>inputSourceMapFilename</code></td>\n                <td><code>string</code></td>\n                <td><code>null</code></td>\n                <td>If provided, this input source map file is used as the input before generating a new source map.</td>\n              </tr>\n              <tr>\n                <td><code>sourceMaps</code></td>\n                <td><code>boolean</code></td>\n                <td><code>false</code></td>\n                <td>Determines whether a source map file should be generated.</td>\n              </tr>\n              <tr>\n                <td><code>compatibility</code></td>\n                <td><code>\"browser\" | \"jsc-600-1-4-17\"</code></td>\n                <td><code>\"browser\"</code></td>\n                <td>Select a built-in environment compatibility. More built-in environments will be added in the future.</td>\n              </tr>\n              <tr>\n                <td><code>mathRandomSeed</code></td>\n                <td><code>string</code></td>\n                <td><code>null<code></td>\n                <td>If a seed string is provided, <code>Math.random()</code> can be relied on and used in concrete code paths.</td>\n              </tr>\n              <tr>\n                <td><code>trace</code></td>\n                <td><code>boolean</code></td>\n                <td><code>false</code></td>\n                <td>Logs evaluated function calls.</td>\n              </tr>\n              <tr>\n                <td><code>debugNames</code></td>\n                <td><code>boolean</code></td>\n                <td><code>false</code></td>\n                <td>If true, try to retain original variable and function names as part of the generated code.</td>\n              </tr>\n              <tr>\n                <td><code>inlineExpressions</code></td>\n                <td><code>boolean</code></td>\n                <td><code>false</code></td>\n                <td>Enables two passes in the serializer to improve code quality by avoiding intermediate variables.</td>\n              </tr>\n              <tr>\n                <td><code>logStatistics</code></td>\n                <td><code>boolean</code></td>\n                <td><code>false</code></td>\n                <td>If true, logs statistics about the number of objects, functions and ids generated.</td>\n              </tr>\n              <tr>\n                <td><code>internalDebug</code></td>\n                <td><code>boolean</code></td>\n                <td><code>false</code></td>\n                <td>If true, prints the JS stack inside of Prepack along with the stack in the Prepacked program. Useful for debugging Prepack itself.</td>\n              </tr>\n              <tr>\n                <td><code>timeout</code></td>\n                <td><code>number</code></td>\n                <td><code>Infinity</code></td>\n                <td>Number of milliseconds to run a program before it times out. Useful to avoid infinite loops in the Prepacked program.</td>\n              </tr>\n            </tbody>\n          </table>\n        </div>\n      </div>\n    </div>\n\n    <div class=\"footer-background\">\n      <div class=\"content-container\">\n        <div class=\"footer\">\n          <div>\n            Copyright &copy; 2018 Facebook Inc.\n          </div>\n          <div>\n            <a href=\"https://code.facebook.com/projects/\" target=\"_blank\">\n              <img\n                class=\"oss-logo\"\n                src=\"./static/images/oss_logo.png\"\n                alt=\"Facebook Open Source\"\n                title=\"Facebook Open Source\" />\n            </a>\n          </div>\n        </div>\n      </div>\n    </div>\n\n    <script src=\"js/toggle_menu.js\"></script>\n  </body>\n</html>\n"
  },
  {
    "path": "website/index.html",
    "content": "<!DOCTYPE html>\n<html lang=\"en\">\n  <head>\n    <title>Prepack &middot; Partial evaluator for JavaScript</title>\n    <link rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/favicon.ico\">\n    <script src=\"js/prism.js\"></script>\n    <link rel=\"stylesheet\" href=\"css/prism.css\"/>\n    <link rel=\"stylesheet\" href=\"css/style.css\"/>\n    <script>\n      (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){\n        (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),\n        m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)\n      })(window,document,'script','https://www.google-analytics.com/analytics.js','ga');\n      ga('create', 'UA-44373548-29', 'auto');\n      ga('send', 'pageview');\n    </script>\n  </head>\n  <body>\n\n    <nav class=\"nav\">\n      <div class=\"content-container\">\n\n        <div class=\"nav-left\">\n          <a class=\"nav-item is-brand\" href=\"./\">\n            <img class=\"nav-logo\" src=\"static/images/prepack_logo.png\" alt=\"prepack logo\"/>\n            Prepack\n          </a>\n        </div>\n\n        <span id=\"nav-toggle\" class=\"nav-toggle\">\n          <span></span>\n          <span></span>\n          <span></span>\n        </span>\n\n        <div id=\"nav-menu\" class=\"nav-right nav-menu\">\n          <a href=\"./\" class=\"nav-item is-active\">About</a>\n          <a href=\"getting-started.html\" class=\"nav-item\">Getting Started</a>\n          <a href=\"frequently-asked-questions.html\" class=\"nav-item\">FAQs</a>\n          <a href=\"repl.html\" class=\"nav-item\">Try It Out</a>\n          <a href=\"https://github.com/facebook/prepack\" class=\"nav-item\">GitHub</a>\n        </div>\n\n      </div>\n    </nav>\n\n    <div class=\"content\">\n      <div class=\"hero\">\n        <div class=\"content-container\">\n          <h1 class=\"text\">Prepack</h1>\n          <h2 class=\"minitext\">\n            A tool for making JavaScript code run faster.\n          </h2>\n          <div class=\"disclaimer\">\n            *Prepack is still in an early development stage and not ready for production use just yet. Please try it out, give feedback, and help fix bugs.\n          </div>\n          <div class=\"buttons-unit\">\n            <a class=\"button\" href=\"getting-started.html\">Getting Started</a>\n            <a class=\"button\" href=\"repl.html\">Try It Out</a>\n          </div>\n        </div>\n      </div>\n\n      <div class=\"section\">\n        <div class=\"content-container\">\n          <h2>What does it do?</h2>\n          <p class=\"align-left\">\n            Prepack is a tool that optimizes JavaScript source code:\n            Computations that can be done at compile-time instead of run-time get eliminated.\n            Prepack replaces the global code of a JavaScript bundle with equivalent code that is a simple sequence of assignments. This gets rid of most intermediate computations and object allocations.\n          </p>\n        </div>\n      </div>\n\n      <div class=\"section\">\n        <div class=\"content-container\">\n          <h2>Examples</h2>\n\n          <h3>Hello World</h3>\n          <div class=\"example\">\n            <div class=\"example-input\">\n              <div class=\"example-code\">\n                <pre><code class=\"language-js\">(function () {\n  function hello() { return 'hello'; }\n  function world() { return 'world'; }\n  global.s = hello() + ' ' + world();\n})();</code></pre>\n              </div>\n            </div>\n            <div class=\"example-output\">\n              <div class=\"example-code\">\n                <pre><code class=\"language-js\">s = \"hello world\";</code></pre>\n              </div>\n            </div>\n          </div>\n\n          <h3>Elimination of abstraction tax</h3>\n          <div class=\"example\">\n            <div class=\"example-input\">\n              <div class=\"example-code\">\n                <pre><code class=\"language-js\">(function () {\n  var self = this;\n  ['A', 'B', 42].forEach(function(x) {\n    var name = '_' + x.toString()[0].toLowerCase();\n    var y = parseInt(x);\n    self[name] = y ? y : x;\n  });\n})();</code></pre>\n              </div>\n            </div>\n            <div class=\"example-output\">\n              <div class=\"example-code\">\n                <pre><code class=\"language-js\">_a = \"A\";\n_b = \"B\";\n_4 = 42;</code></pre>\n              </div>\n            </div>\n          </div>\n\n\n          <h3>Fibonacci</h3>\n          <div class=\"example\">\n            <div class=\"example-input\">\n              <div class=\"example-code\">\n                <pre><code class=\"language-js\">(function () {\n  function fibonacci(x) {\n    return x <= 1 ? x : fibonacci(x - 1) + fibonacci(x - 2);\n  }\n  global.x = fibonacci(15);\n})();</code></pre>\n              </div>\n            </div>\n            <div class=\"example-output\">\n              <div class=\"example-code\">\n                <pre><code class=\"language-js\">x = 610;</code></pre>\n              </div>\n            </div>\n          </div>\n\n          <h3>Module Initialization</h3>\n          <div class=\"example\">\n            <div class=\"example-input\">\n              <div class=\"example-code\">\n                <pre><code class=\"language-js\">(function () {\n  let moduleTable = {};\n  function define(id, f) { moduleTable[id] = f; }\n  function require(id) {\n    let x = moduleTable[id];\n    return x instanceof Function ? (moduleTable[id] = x()) : x;\n  }\n  global.require = require;\n  define(\"one\", function() { return 1; });\n  define(\"two\", function() { return require(\"one\") + require(\"one\"); });\n  define(\"three\", function() { return require(\"two\") + require(\"one\"); });\n  define(\"four\", function() { return require(\"three\") + require(\"one\"); });\n})();\nthree = require(\"three\");</code></pre>\n              </div>\n            </div>\n            <div class=\"example-output\">\n              <div class=\"example-code\">\n                <pre><code class=\"language-js\">(function () {\n  var _0 = function (id) {\n    let x = _1[id];\n    return x instanceof Function ? _1[id] = x() : x;\n  };\n\n  var _5 = function () {\n    return _0(\"three\") + _0(\"one\");\n  };\n\n  var _1 = {\n    one: 1,\n    two: 2,\n    three: 3,\n    four: _5\n  };\n  require = _0;\n  three = 3;\n})();</code></pre>\n              </div>\n            </div>\n          </div>\n\n          <p>\n            Note how most computations have been pre-initialized. However, the function that computes four (_5) remains in the residual program since it was not called at initialization time.\n          </p>\n\n          <h3>Environment Interactions and Branching</h3>\n          <div class=\"example\">\n            <div class=\"example-input\">\n              <div class=\"example-code\">\n                <pre><code class=\"language-js\">(function(){\n  function fib(x) { return x <= 1 ? x : fib(x - 1) + fib(x - 2); }\n  let x = Date.now();\n  if (x === 0) x = fib(10);\n  global.result = x;\n})();</code></pre>\n              </div>\n            </div>\n            <div class=\"example-output\">\n              <div class=\"example-code\">\n              <pre><code class=\"language-js\">(function () {\n  var _$1 = this;\n  var _$0 = _$1.Date.now();\n  var _1 = 0 === _$0;\n  var _0 = _1 ? 55 : _$0;\n  result = _0;\n})();</code></pre>\n            </div>\n          </div>\n\n        </div>\n\n        <div class=\"section\">\n          <div class=\"content-container\">\n            <h2>How does it work?</h2>\n            <div class=\"align-left\">\n              <p>\n                A few things have to come together to realize Prepack:\n              </p>\n              <ul>\n                <li>\n                  <b>Abstract Syntax Tree (AST)</b>\n                  <p>\n                    Prepack operates at the AST level, using <a href=\"https://babeljs.io/\">Babel</a> to parse and generate JavaScript source code.\n                  </p>\n                </li>\n                <li>\n                  <b>Concrete Execution</b>\n                  <p>\n                    At the core of Prepack is an almost ECMAScript 5 compatible interpreter &mdash; implemented in JavaScript!\n                    The interpreter closely follows the <a href=\"http://www.ecma-international.org/ecma-262/7.0/\">ECMAScript 2016 Language Specification</a>, with a focus on correctness and spec conformance.\n                    You can think of the interpreter in Prepack as a clean reference implementation of JavaScript.\n                  </p>\n                  <p>\n                    The interpreter has the ability to track and undo all effects, including all object mutations. This enables speculative optimizations.\n                  </p>\n                </li>\n                <li>\n                  <b>Symbolic Execution</b>\n                  <p>\n                    In addition to computing over concrete values, Prepack's interpreter has the ability to operate on <b>abstract values</b> which typically arise from environment interactions. For example, <code>Date.now</code> can return an abstract value. You can also manually inject abstract values via auxiliary helper functions such as <code>__abstract()</code>. Prepack tracks all operations that are performed over abstract values. When branching over abstract values, Prepack will fork execution and explore all possibilities. Thus, Prepack implements a <a href=\"https://en.wikipedia.org/wiki/Symbolic_execution\">Symbolic Execution</a> engine for JavaScript.\n                  </p>\n                </li>\n                <li>\n                  <b>Abstract Interpretation</b>\n                  <p>\n                    Symbolic execution will fork when it encounters branches over abstract values. At control-flow merge-points, Prepack will join the diverged executions, implementing a form of <a href=\"https://en.wikipedia.org/wiki/Abstract_interpretation\">Abstract Interpretation</a>. Joining variables and heap properties may result in conditional abstract values. Prepack tracks information about value and type domains of abstract values.\n                  </p>\n                </li>\n                <li>\n                  <b>Heap Serialization</b>\n                  <p>\n                    At the end of the initialization phase when the global code returns, Prepack captures the final heap.\n                    Prepack walks the heap in order, generating fresh straightforward JavaScript code that creates and links all objects reachable in the initialized heap. Some of the values in the heap might be result of computations over abstract values. For those values, Prepack generates code that performs those computations as the original program would have done.\n                  </p>\n                </li>\n              </ul>\n            </div>\n          </div>\n        </div>\n\n        <div class=\"section\">\n          <div class=\"content-container\">\n            <h2>The Environment matters!</h2>\n            <div class=\"align-left\">\n              <p>\n                Out of the box, Prepack does not fully model a browser or node.js environment: Prepack has no built-in knowledge of <code>document</code> or <code>window</code>. In fact, when prepacking code which references such properties, they will evaluate to <code>undefined</code>. You would have to insert a model of the relevant functionality at the beginning of the code you want to prepack.\n              </p>\n              <p>The following helper functions aid in writing models.\n              <pre><code class=\"language-js\">// Assume that a certain property has a simple known value.\n__assumeDataProperty(global, \"obscure\", undefined);\n// Assume that a certain property has a simple unknown value.\n__assumeDataProperty(global, \"notSoObscure\", __abstract());\n// Assume that a richly structured value exists\n__assumeDataProperty(global, \"rich\", __abstract({\n  x: __abstract(\"number\"),\n  y: __abstract(\"boolean\"),\n  z: __abstract(\"string\"),\n  nested: __abstract({\n    x: __abstract()\n  })\n}));\n// Forbid any accesses to an object except at known positions\n__makePartial(global);\n// At this point, accessing global.obscure, global.notSoObscure, global.rich.nested.x is okay,\n// but accessing global.unknown or global.rich.unknown would cause an introspection error.\n\n// The following tells Prepack to embed and call some code in the residual program.\n// The code must not have any side effects on the reachable JavaScript heap.\n__residual(\"object\", function(delay) {\n  return global.pushSelfDestructButton(delay);\n}, \"5 minutes\");\n</code></pre>\n</p>\n            </div>\n          </div>\n        </div>\n\n        <div class=\"section\">\n          <div class=\"content-container\">\n            <h2>Optimize More Code!</h2>\n            <div class=\"align-left\">\n              <p>\n                Out of the box, Prepack only optimizes code that gets executed along the global code path, the initialization phase.\n                You can explicitly instruct Prepack to optimize particular functions as shown in the following example.\n              </p>\n              <pre><code class=\"language-js\">global.f = function() {\n  var res = 0;\n  for (var i = 0; i < 100; i++) res += i;\n  return res;\n}\n\n// A call to __optimize along the global code instructs Prepack to optimize the given function.\n__optimize(global.f);\n</code></pre>\n              <p>\n                <b>Note:</b> Prepack makes a significant assumption:\n                The optimized function (and all other functions it might transitively call) does not depend on any state that is mutated after the global code finished executing. Also, Prepack does check and reject two different optimized functions that mutate the same state.\n              </p>\n            </div>\n          </div>\n        </div>\n\n        <div class=\"section\">\n          <div class=\"content-container\">\n            <h2>Roadmap</h2>\n            <div class=\"align-left\">\n\n\n              <h3>Short Term</h3>\n              <ul>\n                <li>Stabilizing existing feature set for Prepacking of React Native bundles</li>\n                <li>Integration with React Native tool chain</Li>\n                <li>Build out optimizations based on assumptions of the module system used by React Native</li>\n              </ul>\n              <h3>Medium Term</h3>\n              <ul>\n                <li>Implement further serialization optimizations, including\n                  <ul>\n                    <li>elimination of objects whose identity isn't exposed,</li>\n                    <li>elimination of unused exported properties,</li>\n                    <li>...</li>\n                  </ul>\n                </li>\n                <li>Prepack individual functions, basic blocks, statements, expressions</li>\n                <li>Full ES6 Conformance</Li>\n                <li>Generalize support for module systems</li>\n                <li>Assuming ES6 support for certain features, delay / ignore application of <a href=\"https://en.wikipedia.org/wiki/Polyfill\">Polyfills</a></li>\n                <li>Implement further compatibility targets, in particular the web and node.js</li>\n                <li>Deeper Integration with a JavaScript VM to improve the heap deserialization process, including\n                  <ul>\n                    <li>expose a lazy object initialization concept &mdash; lazily initialize an object the moment it is touched for the first time, in a way that is not observable by JavaScript code</li>\n                    <li>efficient encoding of common object creations via specialized bytecodes</li>\n                    <li>splitting the code into two phases: 1) a non-environment dependent phase; the VM could safely capture &amp; restore the resulting heap; followed by 2) an environment dependent phase which patches up the concrete heap by performing any residual computations over values obtained from the environment</li>\n                    <li>...</li>\n                  </ul>\n                </li>\n                <li>Summarizing loops and recursion</li>\n              </ul>\n              <h3>Long Term &mdash; leveraging Prepack as a platform</h3>\n              <ul>\n                <li>JavaScript Playground &mdash; experiment with JavaScript features by tweaking a JavaScript engine written in JavaScript, all hosted just in a browser; think of it as a \"Babel VM\", realizing new JavaScript features that cannot just be compiled away</li>\n                <li>Bug Finding &mdash; finding unconditional crashes, performance issues, ...</li>\n                <li>Effect Analyzer, e.g. to detect possible side effects of module factory functions or to enforce pureness annotations</li>\n                <li>Type Analysis</li>\n                <li>Information Flow Analysis</li>\n                <li>Call Graph Inference, allowing inlining and code indexing</li>\n                <li>Automated Test Generation, leveraging the symbolic execution features in combination with a constraint solver to compute inputs that exercise different execution paths</li>\n                <li>Smart Fuzzing</li>\n                <li>JavaScript Sandbox &mdash; effectively instrument JavaScript code in a way that is not observable</li>\n              </ul>\n            </div>\n          </div>\n        </div>\n\n        <div class=\"section\">\n          <div class=\"content-container\">\n            <h2>Related Technologies</h2>\n            <div class=\"align-left\">\n\n              <p>\n                The <a href=\"https://developers.google.com/closure/compiler/\">Closure Compiler</a> also optimizes JavaScript code. Prepack goes further by truly running the global code at initialization phase, unrolling loops and recursion. Prepack focuses on runtime performance, while the Closure Compiler emphasizes JavaScript code size.\n              </p>\n            </div>\n          </div>\n        </div>\n\n        <div class=\"section\">\n          <div class=\"content-container\">\n            <h2>Contributing</h2>\n            <div class=\"align-left\">\n\n              <p>\n                You can follow the <a href=\"https://github.com/facebook/prepack/blob/master/CONTRIBUTING.md\">contributing guidelines</a>. There is also a <a href=\"https://github.com/facebook/prepack/wiki/Suggested-reading\">suggested reading list </a> to learn more about the internals of the project.\n              </p>\n            </div>\n          </div>\n        </div>\n      </div>\n    </div>\n\n    <div class=\"footer-background\">\n      <div class=\"content-container\">\n        <div class=\"footer\">\n          <div>\n            Copyright &copy; 2018 Facebook Inc.\n          </div>\n          <div>\n            <a href=\"https://code.facebook.com/projects/\" target=\"_blank\">\n              <img\n                class=\"oss-logo\"\n                src=\"./static/images/oss_logo.png\"\n                alt=\"Facebook Open Source\"\n                title=\"Facebook Open Source\" />\n            </a>\n          </div>\n        </div>\n      </div>\n    </div>\n</div>\n    <script src=\"js/toggle_menu.js\"></script>\n  </body>\n</html>\n"
  },
  {
    "path": "website/js/prism.js",
    "content": "/* http://prismjs.com/download.html?themes=prism&languages=clike+javascript */\nvar _self=\"undefined\"!=typeof window?window:\"undefined\"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope?self:{},Prism=function(){var e=/\\blang(?:uage)?-(\\w+)\\b/i,t=0,n=_self.Prism={manual:_self.Prism&&_self.Prism.manual,util:{encode:function(e){return e instanceof a?new a(e.type,n.util.encode(e.content),e.alias):\"Array\"===n.util.type(e)?e.map(n.util.encode):e.replace(/&/g,\"&amp;\").replace(/</g,\"&lt;\").replace(/\\u00a0/g,\" \")},type:function(e){return Object.prototype.toString.call(e).match(/\\[object (\\w+)\\]/)[1]},objId:function(e){return e.__id||Object.defineProperty(e,\"__id\",{value:++t}),e.__id},clone:function(e){var t=n.util.type(e);switch(t){case\"Object\":var a={};for(var r in e)e.hasOwnProperty(r)&&(a[r]=n.util.clone(e[r]));return a;case\"Array\":return e.map&&e.map(function(e){return n.util.clone(e)})}return e}},languages:{extend:function(e,t){var a=n.util.clone(n.languages[e]);for(var r in t)a[r]=t[r];return a},insertBefore:function(e,t,a,r){r=r||n.languages;var l=r[e];if(2==arguments.length){a=arguments[1];for(var i in a)a.hasOwnProperty(i)&&(l[i]=a[i]);return l}var o={};for(var s in l)if(l.hasOwnProperty(s)){if(s==t)for(var i in a)a.hasOwnProperty(i)&&(o[i]=a[i]);o[s]=l[s]}return n.languages.DFS(n.languages,function(t,n){n===r[e]&&t!=e&&(this[t]=o)}),r[e]=o},DFS:function(e,t,a,r){r=r||{};for(var l in e)e.hasOwnProperty(l)&&(t.call(e,l,e[l],a||l),\"Object\"!==n.util.type(e[l])||r[n.util.objId(e[l])]?\"Array\"!==n.util.type(e[l])||r[n.util.objId(e[l])]||(r[n.util.objId(e[l])]=!0,n.languages.DFS(e[l],t,l,r)):(r[n.util.objId(e[l])]=!0,n.languages.DFS(e[l],t,null,r)))}},plugins:{},highlightAll:function(e,t){var a={callback:t,selector:'code[class*=\"language-\"], [class*=\"language-\"] code, code[class*=\"lang-\"], [class*=\"lang-\"] code'};n.hooks.run(\"before-highlightall\",a);for(var r,l=a.elements||document.querySelectorAll(a.selector),i=0;r=l[i++];)n.highlightElement(r,e===!0,a.callback)},highlightElement:function(t,a,r){for(var l,i,o=t;o&&!e.test(o.className);)o=o.parentNode;o&&(l=(o.className.match(e)||[,\"\"])[1].toLowerCase(),i=n.languages[l]),t.className=t.className.replace(e,\"\").replace(/\\s+/g,\" \")+\" language-\"+l,o=t.parentNode,/pre/i.test(o.nodeName)&&(o.className=o.className.replace(e,\"\").replace(/\\s+/g,\" \")+\" language-\"+l);var s=t.textContent,u={element:t,language:l,grammar:i,code:s};if(n.hooks.run(\"before-sanity-check\",u),!u.code||!u.grammar)return u.code&&(u.element.textContent=u.code),n.hooks.run(\"complete\",u),void 0;if(n.hooks.run(\"before-highlight\",u),a&&_self.Worker){var g=new Worker(n.filename);g.onmessage=function(e){u.highlightedCode=e.data,n.hooks.run(\"before-insert\",u),u.element.innerHTML=u.highlightedCode,r&&r.call(u.element),n.hooks.run(\"after-highlight\",u),n.hooks.run(\"complete\",u)},g.postMessage(JSON.stringify({language:u.language,code:u.code,immediateClose:!0}))}else u.highlightedCode=n.highlight(u.code,u.grammar,u.language),n.hooks.run(\"before-insert\",u),u.element.innerHTML=u.highlightedCode,r&&r.call(t),n.hooks.run(\"after-highlight\",u),n.hooks.run(\"complete\",u)},highlight:function(e,t,r){var l=n.tokenize(e,t);return a.stringify(n.util.encode(l),r)},tokenize:function(e,t){var a=n.Token,r=[e],l=t.rest;if(l){for(var i in l)t[i]=l[i];delete t.rest}e:for(var i in t)if(t.hasOwnProperty(i)&&t[i]){var o=t[i];o=\"Array\"===n.util.type(o)?o:[o];for(var s=0;s<o.length;++s){var u=o[s],g=u.inside,c=!!u.lookbehind,h=!!u.greedy,f=0,d=u.alias;if(h&&!u.pattern.global){var p=u.pattern.toString().match(/[imuy]*$/)[0];u.pattern=RegExp(u.pattern.source,p+\"g\")}u=u.pattern||u;for(var m=0,y=0;m<r.length;y+=r[m].length,++m){var v=r[m];if(r.length>e.length)break e;if(!(v instanceof a)){u.lastIndex=0;var b=u.exec(v),k=1;if(!b&&h&&m!=r.length-1){if(u.lastIndex=y,b=u.exec(e),!b)break;for(var w=b.index+(c?b[1].length:0),_=b.index+b[0].length,P=m,A=y,j=r.length;j>P&&_>A;++P)A+=r[P].length,w>=A&&(++m,y=A);if(r[m]instanceof a||r[P-1].greedy)continue;k=P-m,v=e.slice(y,A),b.index-=y}if(b){c&&(f=b[1].length);var w=b.index+f,b=b[0].slice(f),_=w+b.length,x=v.slice(0,w),O=v.slice(_),S=[m,k];x&&S.push(x);var N=new a(i,g?n.tokenize(b,g):b,d,b,h);S.push(N),O&&S.push(O),Array.prototype.splice.apply(r,S)}}}}}return r},hooks:{all:{},add:function(e,t){var a=n.hooks.all;a[e]=a[e]||[],a[e].push(t)},run:function(e,t){var a=n.hooks.all[e];if(a&&a.length)for(var r,l=0;r=a[l++];)r(t)}}},a=n.Token=function(e,t,n,a,r){this.type=e,this.content=t,this.alias=n,this.length=0|(a||\"\").length,this.greedy=!!r};if(a.stringify=function(e,t,r){if(\"string\"==typeof e)return e;if(\"Array\"===n.util.type(e))return e.map(function(n){return a.stringify(n,t,e)}).join(\"\");var l={type:e.type,content:a.stringify(e.content,t,r),tag:\"span\",classes:[\"token\",e.type],attributes:{},language:t,parent:r};if(\"comment\"==l.type&&(l.attributes.spellcheck=\"true\"),e.alias){var i=\"Array\"===n.util.type(e.alias)?e.alias:[e.alias];Array.prototype.push.apply(l.classes,i)}n.hooks.run(\"wrap\",l);var o=Object.keys(l.attributes).map(function(e){return e+'=\"'+(l.attributes[e]||\"\").replace(/\"/g,\"&quot;\")+'\"'}).join(\" \");return\"<\"+l.tag+' class=\"'+l.classes.join(\" \")+'\"'+(o?\" \"+o:\"\")+\">\"+l.content+\"</\"+l.tag+\">\"},!_self.document)return _self.addEventListener?(_self.addEventListener(\"message\",function(e){var t=JSON.parse(e.data),a=t.language,r=t.code,l=t.immediateClose;_self.postMessage(n.highlight(r,n.languages[a],a)),l&&_self.close()},!1),_self.Prism):_self.Prism;var r=document.currentScript||[].slice.call(document.getElementsByTagName(\"script\")).pop();return r&&(n.filename=r.src,!document.addEventListener||n.manual||r.hasAttribute(\"data-manual\")||(\"loading\"!==document.readyState?window.requestAnimationFrame?window.requestAnimationFrame(n.highlightAll):window.setTimeout(n.highlightAll,16):document.addEventListener(\"DOMContentLoaded\",n.highlightAll))),_self.Prism}();\"undefined\"!=typeof module&&module.exports&&(module.exports=Prism),\"undefined\"!=typeof global&&(global.Prism=Prism);\nPrism.languages.clike={comment:[{pattern:/(^|[^\\\\])\\/\\*[\\w\\W]*?\\*\\//,lookbehind:!0},{pattern:/(^|[^\\\\:])\\/\\/.*/,lookbehind:!0}],string:{pattern:/([\"'])(\\\\(?:\\r\\n|[\\s\\S])|(?!\\1)[^\\\\\\r\\n])*\\1/,greedy:!0},\"class-name\":{pattern:/((?:\\b(?:class|interface|extends|implements|trait|instanceof|new)\\s+)|(?:catch\\s+\\())[a-z0-9_\\.\\\\]+/i,lookbehind:!0,inside:{punctuation:/(\\.|\\\\)/}},keyword:/\\b(if|else|while|do|for|return|in|instanceof|function|new|try|throw|catch|finally|null|break|continue)\\b/,\"boolean\":/\\b(true|false)\\b/,\"function\":/[a-z0-9_]+(?=\\()/i,number:/\\b-?(?:0x[\\da-f]+|\\d*\\.?\\d+(?:e[+-]?\\d+)?)\\b/i,operator:/--?|\\+\\+?|!=?=?|<=?|>=?|==?=?|&&?|\\|\\|?|\\?|\\*|\\/|~|\\^|%/,punctuation:/[{}[\\];(),.:]/};\nPrism.languages.javascript=Prism.languages.extend(\"clike\",{keyword:/\\b(as|async|await|break|case|catch|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally|for|from|function|get|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|set|static|super|switch|this|throw|try|typeof|var|void|while|with|yield)\\b/,number:/\\b-?(0x[\\dA-Fa-f]+|0b[01]+|0o[0-7]+|\\d*\\.?\\d+([Ee][+-]?\\d+)?|NaN|Infinity)\\b/,\"function\":/[_$a-zA-Z\\xA0-\\uFFFF][_$a-zA-Z0-9\\xA0-\\uFFFF]*(?=\\()/i,operator:/--?|\\+\\+?|!=?=?|<=?|>=?|==?=?|&&?|\\|\\|?|\\?|\\*\\*?|\\/|~|\\^|%|\\.{3}/}),Prism.languages.insertBefore(\"javascript\",\"keyword\",{regex:{pattern:/(^|[^\\/])\\/(?!\\/)(\\[.+?]|\\\\.|[^\\/\\\\\\r\\n])+\\/[gimyu]{0,5}(?=\\s*($|[\\r\\n,.;})]))/,lookbehind:!0,greedy:!0}}),Prism.languages.insertBefore(\"javascript\",\"string\",{\"template-string\":{pattern:/`(?:\\\\\\\\|\\\\?[^\\\\])*?`/,greedy:!0,inside:{interpolation:{pattern:/\\$\\{[^}]+\\}/,inside:{\"interpolation-punctuation\":{pattern:/^\\$\\{|\\}$/,alias:\"punctuation\"},rest:Prism.languages.javascript}},string:/[\\s\\S]+/}}}),Prism.languages.markup&&Prism.languages.insertBefore(\"markup\",\"tag\",{script:{pattern:/(<script[\\w\\W]*?>)[\\w\\W]*?(?=<\\/script>)/i,lookbehind:!0,inside:Prism.languages.javascript,alias:\"language-javascript\"}}),Prism.languages.js=Prism.languages.javascript;\n"
  },
  {
    "path": "website/js/repl-worker.js",
    "content": "self.importScripts('prepack.min.js');\n\nfunction onlyWarnings(buffer) {\n  return buffer.every(function(error) {\n    return error.severity === \"Warning\" || error.severity === \"Information\";\n  });\n}\n\nonmessage = function(e) {\n  let buffer = [];\n\n  function errorHandler(error) {\n    // Syntax errors contain their location at the end, remove that\n    if (error.errorCode === \"PP1004\") {\n      let msg = error.message;\n      error.message = msg.substring(0, msg.lastIndexOf(\"(\"));\n    }\n    buffer.push({\n      severity: error.severity,\n      location: error.location,\n      message: error.message,\n      errorCode: error.errorCode,\n    });\n    return \"Recover\";\n  }\n\n  try {\n    let sources = [{ filePath: \"dummy\", fileContents: e.data.code }];\n    let options = {\n      compatibility: \"browser\",\n      filename: \"repl\",\n      timeout: 1000,\n      serialize: true,\n      heapGraphFormat: \"VISJS\",\n      errorHandler,\n    };\n    for (let property in e.data.options) {\n      if (e.data.options.hasOwnProperty(property)) {\n        options[property] = e.data.options[property];\n      }\n    }\n\n    let result = Prepack.prepackSources(sources, options);\n    let noErrors = onlyWarnings(buffer);\n    if (result && noErrors) {\n      postMessage({ type: 'success', data: result.code, graph: result.heapGraph, messages: buffer });\n    } else {\n      // A well-defined error occurred.\n      postMessage({ type: 'error', data: buffer });\n    }\n  } catch (err) {\n    buffer.push({\n      message: err.stack || 'An unknown error occurred'\n    });\n    postMessage({ type: 'error', data: buffer });\n  }\n};\n"
  },
  {
    "path": "website/js/repl.js",
    "content": "function createEditor(elem) {\n  var editor = ace.edit(elem);\n  var session = editor.getSession();\n\n  editor.setTheme('ace/theme/tomorrow');\n  editor.setShowPrintMargin(false);\n  editor.commands.removeCommands(['gotoline', 'find']);\n\n  session.setMode('ace/mode/javascript');\n  session.setUseSoftTabs(true);\n  session.setTabSize(2);\n  session.setUseWorker(false);\n\n  editor.setOption('scrollPastEnd', 0.33);\n\n  elem.style.lineHeight = '18px';\n\n  return editor;\n}\n\nvar optionsConfig = [\n  {\n    type: \"string\",\n    name: \"mathRandomSeed\",\n    defaultVal: \"\",\n    description: \"If you want Prepack to evaluate Math.random() calls, please provide a seed.\"\n  },\n  {\n    type: \"boolean\",\n    name: \"inlineExpressions\",\n    defaultVal: true,\n    description: \"Avoids naming expressions when they are only used once, and instead inline them where they are used.\"\n  },\n  {\n    type: \"boolean\",\n    name: \"delayInitializations\",\n    defaultVal: false,\n    description: \"Delay initializations.\"\n  },\n  {\n    type: \"choice\",\n    name: \"compatibility\",\n    choices: [\"browser\", \"jsc-600-1-4-17\", \"node-source-maps\", \"node-react\"],\n    defaultVal: \"node-react\",\n    description: \"The target environment for Prepack\"\n  },\n  {\n    type: \"string\",\n    name: \"lazyObjectsRuntime\",\n    defaultVal: \"\",\n    description: \"Enable lazy objects feature and specify the JS runtime that supports this feature.\"\n  },\n  {\n    type: \"choice\",\n    name: \"invariantLevel\",\n    choices: [0, 1, 2, 3],\n    defaultVal: 0,\n    description: \"Whether and how many checks to generate that validate Prepack's assumptions about the environment.\"\n  },\n  {\n    type: \"boolean\",\n    name: \"reactEnabled\",\n    defaultVal: true,\n    description: \"Enables support for React features, such as JSX syntax.\"\n  },\n  {\n    type: \"choice\",\n    name: \"reactOutput\",\n    choices: [\"jsx\", \"create-element\"],\n    defaultVal: \"jsx\",\n    description: \"Specifies the serialization output of JSX nodes when React mode is enabled.\"\n  },\n  {\n    type: \"boolean\",\n    name: \"stripFlow\",\n    defaultVal: true,\n    description: \"Removes Flow type annotations from the output.\"\n  },\n];\n\nvar demos = [];\n/**generate select */\nfunction generateDemosSelect(obj, dom) {\n  // var keys = ['<option value='+-1+'>select demo</option>'];\n  var keys = [];\n  demos = [];\n  for (var name in obj) {\n    demos.push(name);\n    keys.push('<option value=' + name + '>' + name + '</option>');\n  }\n  dom.innerHTML = keys.join('');\n}\n\nvar worker;\nvar debounce;\n\nvar messagesOutput = document.querySelector('.input .messages');\nvar replOutput = document.querySelector('.output .repl');\n\nvar isEmpty = /^\\s*$/;\n\nfunction terminateWorker() {\n  if (worker) {\n    worker.terminate();\n    worker = null;\n  }\n}\n\nfunction createWikiLink(code) {\n  const wikiLink = document.createElement('a');\n  wikiLink.href = 'https://github.com/facebook/prepack/wiki/' + encodeURIComponent(code);\n  wikiLink.text = code;\n  wikiLink.setAttribute('target', '_blank');\n\n  return wikiLink;\n}\n\nfunction createLineLink(location) {\n  const lineLink = document.createElement('a');\n  let lineNumber = location.start ? location.start.line : location.line;\n  let colNumber = location.start ? location.start.column : location.column;\n  colNumber++;\n  let lineText = lineNumber + ':' + colNumber;\n\n  lineLink.href = '';\n  lineLink.onclick = function() {\n    input.gotoLine(lineNumber);\n    return false;\n  };\n  lineLink.text = lineText;\n  lineLink.classList.add(\"line-link\");\n\n  return lineLink;\n}\n\nfunction processMessage(messageNode, data) {\n  // TODO: syntax errors need their location stripped\n  if (data.location) {\n    const wikiLink = createWikiLink(data.errorCode);\n    const lineLink = createLineLink(data.location);\n    messageNode.appendChild(wikiLink);\n    messageNode.appendChild(document.createTextNode(' ('));\n    messageNode.appendChild(lineLink);\n    messageNode.appendChild(document.createTextNode('):  ' + data.message + '\\n'));\n  } else if (!data.code) {\n    messageNode.appendChild(document.createTextNode(data.message + '\\n'));\n  } else {\n    const wikiLink = createWikiLink(data.errorCode);\n    messageNode.appendChild(wikiLink);\n    messageNode.appendChild(document.createTextNode(': ' + data.message + '\\n'));\n  }\n}\n\nfunction getMessageClassType(severity) {\n  switch(severity) {\n    case \"FatalError\":\n      return \"error\";\n    case \"RecoverableError\":\n      return \"error\";\n    case \"Warning\":\n      return \"warning\";\n    case \"Information\":\n      return \"warning\";\n    default:\n      return \"error\";\n  }\n}\n\nfunction showMessages(messages) {\n  messagesOutput.style.display = 'inline-block';\n  \n  for (var i in messages) {\n    const message = document.createElement('div');\n    message.classList.add(\"message\", getMessageClassType(messages[i].severity));\n\n    processMessage(message, messages[i]);\n\n    messagesOutput.appendChild(message);\n  }\n}\n\nfunction getHashedDemo(hash) {\n  if (hash[0] !== '#' || hash.length < 2) return null;\n  var encoded = hash.slice(1);\n  if (encoded.match(/^[a-zA-Z0-9+/=_-]+$/)) {\n    return LZString.decompressFromEncodedURIComponent(encoded)\n  }\n  return null;\n}\n\nfunction makeDemoSharable() {\n  var encoded = LZString.compressToEncodedURIComponent(input.getValue());\n  history.replaceState(undefined, undefined, `#${encoded}`);\n}\n\nfunction showGeneratedCode(code) {\n  if (isEmpty.test(code) && !isEmpty.test(input.getValue())) {\n    code =\n      '// Your code was all dead code and thus eliminated.\\n' + '// Try storing a property on the global object.';\n  }\n  output.setValue(code, -1);\n}\n\nfunction showGenerationGraph(graph) {\n  drawGraphCallback = () => {\n    if (graph) {\n      var graphData = JSON.parse(graph);\n      var visData = {\n        nodes: graphData.nodes,\n        edges: graphData.edges,\n      };\n\n      var visOptions = {};\n      var boxNetwork = new vis.Network(graphBox, visData, visOptions);\n    }\n  };\n\n  if (showGraphDiv) drawGraphCallback();\n}\n\nfunction compile() {\n  clearTimeout(debounce);\n  terminateWorker();\n\n  messagesOutput.innerHTML = '';\n  messagesOutput.style.display = 'none';\n  replOutput.style.display = 'block';\n\n  output.setValue('// Compiling...', -1);\n\n  debounce = setTimeout(function() {\n    worker = new Worker('js/repl-worker.js');\n    worker.onmessage = function(e) {\n      const result = e.data;\n      if (result.type === 'success') {\n        const { data, graph, messages } = result;\n        showGeneratedCode(data);\n        showGenerationGraph(graph);\n        showMessages(messages);\n      } else if (result.type === 'error') {\n        const errors = result.data;\n        showMessages(errors);\n        output.setValue('// Prepack is unable to produce output for this input.\\n// Please check the left pane for diagnostic information.', -1);\n      }\n      terminateWorker();\n    };\n\n    var options = {}\n    for (var configIndex in optionsConfig) {\n      var config = optionsConfig[configIndex];\n      var domE = document.querySelector(\"#prepack-option-\" + config.name);\n      if (config.type === \"choice\") {\n        options[config.name] = domE.options[domE.selectedIndex].value;\n      } else if (config.type === \"boolean\") {\n        options[config.name] = (domE.checked === true);\n      } else if (config.type === \"string\") {\n        if (domE.value) {\n          options[config.name] = domE.value;\n        }\n      }\n    }\n\n    worker.postMessage({code: input.getValue(), options: options});\n  }, 500);\n\n}\n\nvar output = createEditor(replOutput);\noutput.setReadOnly(true);\noutput.setHighlightActiveLine(false);\noutput.setHighlightGutterLine(false);\n\nvar input = createEditor(document.querySelector('.input .repl'));\ninput.on('change', compile);\ninput.on('change', makeDemoSharable);\n\n/**record **/\nvar selectRecord = document.querySelector('select.select-record');\nvar optionsRecord = document.querySelector('#optionsMenuRecord');\nvar selectInput = document.querySelector('#recordName');\nvar optionsButton = document.querySelector('#optionsMenuButton');\nvar saveButton = document.querySelector('#saveBtn');\nvar deleteButton = document.querySelector('#deleteBtn');\nvar storage = window.localStorage;\n\n/** graph **/\nvar graphButton = document.querySelector('#graphBtn');\nvar graphBox = document.getElementById('graphBox');\nvar graphDiv = document.querySelector('#graph');\nvar inputDiv = document.getElementById('inputDiv');\nvar outputDiv = document.getElementById('outputDiv');\nvar showGraphDiv = false;\nvar drawGraphCallback = null;\n\nfunction changeDemosSelect(val) {\n  if (!val.value) return;\n  selectInput.value = val.value;\n  var localCache = getDemosCache();\n  var code = localCache[val.value] || '';\n  input.setValue(code);\n  compile();\n}\n\nvar demoSelector = new Select({\n  el: selectRecord,\n  className: 'select-theme-dark',\n});\ndemoSelector.on('change', changeDemosSelect);\n\nfunction getDemosCache() {\n  return JSON.parse(storage.getItem('prepackDemos') || '{}');\n}\n\nfunction setDemosCache(data) {\n  storage.setItem('prepackDemos', JSON.stringify(data || {}));\n}\n\nfunction addDefaultExamples() {\n  var cache = getDemosCache();\n  var code, name;\n  name = 'EliminationOfAbstractionTax';\n  code = [\n    '(function () {',\n    '  var self = this;',\n    '  [\"A\", \"B\", 42].forEach(function(x) {',\n    '    var name = \"_\" + x.toString()[0].toLowerCase();',\n    '    var y = parseInt(x);',\n    '    self[name] = y ? y : x;',\n    '  });',\n    '})();',\n  ].join('\\n');\n  cache[name] = code;\n\n  name = 'EnvironmentInteractionsAndBranching';\n  code = [\n    '(function(){',\n    '  function fib(x) { return x <= 1 ? x : fib(x - 1) + fib(x - 2); }',\n    '  let x = Date.now();',\n    '  if (x === 0) x = fib(10);',\n    '  global.result = x;',\n    '})();',\n  ].join('\\n');\n  cache[name] = code;\n\n  name = 'Fibonacci';\n  code = [\n    '(function () {',\n    '  function fibonacci(x) {',\n    '    return x <= 1 ? x : fibonacci(x - 1) + fibonacci(x - 2);',\n    '  }',\n    '  global.x = fibonacci(10);',\n    '})();',\n  ].join('\\n');\n  cache[name] = code;\n\n  name = 'HelloWorld';\n  code = [\n    '(function () {',\n    '  function hello() { return \"hello\"; }',\n    '  function world() { return \"world\"; }',\n    '  global.s = hello() + \" \" + world();',\n    '})();',\n  ].join('\\n');\n  cache[name] = code;\n\n  name = 'ModuleInitialization';\n  code = [\n    '(function () {',\n    '  let moduleTable = {};',\n    '  function define(id, f) { moduleTable[id] = f; }',\n    '  function require(id) {',\n    '    let x = moduleTable[id];',\n    '    return x instanceof Function ? (moduleTable[id] = x()) : x;',\n    '  }',\n    '  global.require = require;',\n    '  define(\"one\", function() { return 1; });',\n    '  define(\"two\", function() { return require(\"one\") + require(\"one\"); });',\n    '  define(\"three\", function() { return require(\"two\") + require(\"one\"); });',\n    '  define(\"four\", function() { return require(\"three\") + require(\"one\"); });',\n    '})();',\n    'three = require(\"three\");'\n  ].join('\\n');\n  cache[name] = code;\n\n  var hashedDemo = getHashedDemo(location.hash);\n  name = null;\n  if (hashedDemo) {\n    name = createHashedDemoName(hashedDemo, cache);\n    cache[name] = hashedDemo;\n  }\n\n  generateDemosSelect(cache, selectRecord);\n  setDemosCache(cache);\n  setTimeout(() => {\n    demoSelector.change(name || 'Fibonacci');\n  });\n}\n\nfunction createHashedDemoName(hashedDemo, cache) {\n  var name = '\\xa0';\n  for (var key in cache) {\n    if (cache[key] === hashedDemo) {\n      name = key;\n      break;\n    }\n  }\n  return name;\n}\n\nfunction addOptions() {\n  var optionStrings = [];\n  for (var configIndex in optionsConfig) {\n    var config = optionsConfig[configIndex];\n    var configId = 'prepack-option-' + config.name;\n    optionStrings.push(\"<div class='prepack-option'>\");\n    optionStrings.push(\"<label class='prepack-option-label' for='\");\n    optionStrings.push(configId);\n    optionStrings.push(\"'>\");\n    optionStrings.push(config.name);\n    optionStrings.push(\"<div class='prepack-option-description'>\");\n    optionStrings.push(config.description);\n    optionStrings.push(\"</div>\");\n    if (config.type === \"choice\") {\n      optionStrings.push(\"<select id='\");\n      optionStrings.push(configId);\n      optionStrings.push(\"'>\");\n      for (var nameIndex in config.choices) {\n        var name = config.choices[nameIndex];\n        if (name === config.defaultVal) {\n          optionStrings.push('<option value=' + name + ' selected>' + name + '</option>');\n        } else {\n          optionStrings.push('<option value=' + name + '>' + name + '</option>');\n        }\n      }\n      optionStrings.push(\"</select>\");\n    } else if (config.type === \"boolean\") {\n      optionStrings.push(\"<input type='checkbox' id='\");\n      optionStrings.push(configId);\n      if (config.defaultVal === true) {\n        optionStrings.push(\"' checked=true>\")\n      } else {\n        optionStrings.push(\"'>\");\n      }\n    } else if (config.type === \"string\") {\n      optionStrings.push(\"<input type='text' id='\");\n      optionStrings.push(configId);\n      if (config.defaultVal != null) {\n        optionStrings.push(\"' value='\");\n        optionStrings.push(config.defaultVal);\n        optionStrings.push(\"'>\");\n      } else {\n        optionStrings.push(\"'>\");\n      }\n    }\n    optionStrings.push(\"</label>\");\n    optionStrings.push(\"</div>\");\n  }\n  optionsRecord.innerHTML = optionStrings.join('');\n  for (var configIndex in optionsConfig) {\n    var config = optionsConfig[configIndex];\n    var domE = document.querySelector(\"#prepack-option-\" + config.name);\n    if (config.type === \"choice\") {\n      var demoSelector = new Select({\n        el: domE,\n        className: 'select-theme-dark',\n      });\n      domE.addEventListener('change', compile);\n    } else if (config.type === \"boolean\") {\n      domE.addEventListener('change', compile);\n    } else if (config.type === \"string\") {\n      domE.addEventListener('input', compile);\n    }\n  }\n\n  optionsButton.onclick = function() {\n    if (optionsRecord.style.display !== \"inline-block\") {\n      optionsRecord.style.display = \"inline-block\" ;\n    } else {\n      optionsRecord.style.display = \"none\" ;\n    }\n  };\n}\n\naddDefaultExamples();\n\naddOptions();\n\ndeleteButton.addEventListener('click', () => {\n  var name = selectInput.value;\n  if (name == null || name.replace(/\\s+/, '') === '') return;\n  if (demos.length === 0) {\n    selectInput.value = '';\n    return;\n  }\n  var cache = getDemosCache();\n  delete cache[name];\n  input.setValue('');\n  generateDemosSelect(cache, selectRecord);\n  setDemosCache(cache);\n  if (demos.length > 0) {\n    selectInput.value = demos[0];\n    setTimeout(() => {\n      demoSelector.change(demos[0]);\n    });\n  } else {\n    selectInput.value = '';\n    input.setValue(defaultCode);\n    compile();\n  }\n});\n\nsaveButton.addEventListener('click', () => {\n  var name = selectInput.value;\n  if (name == null || name.replace(/\\s+/, '') === '') return;\n  var code = input.getValue();\n  var cache = getDemosCache();\n  cache[name] = code;\n  generateDemosSelect(cache, selectRecord);\n  setDemosCache(cache);\n  setTimeout(() => {\n    demoSelector.change(name);\n  });\n});\n\ngraphButton.addEventListener('click', () => {\n  if (!showGraphDiv) {\n    inputDiv.style.width = \"33%\";\n    outputDiv.style.width = \"33%\";\n    graphDiv.style.width = \"34%\";\n    outputDiv.style.left = \"33%\";\n    graphDiv.style.display = \"block\";\n    showGraphDiv = true;\n    graphButton.innerHTML = \"HIDE HEAP\";\n    if (drawGraphCallback !== null) {\n      drawGraphCallback();\n      drawGraphCallback = null;\n    }\n  } else {\n    inputDiv.style.width = \"50%\";\n    outputDiv.style.width = \"50%\";\n    graphDiv.style.width = \"50%\";\n    outputDiv.style.left = \"50%\";\n    graphDiv.style.display = \"none\";\n    showGraphDiv = false;\n    graphButton.innerHTML = \"SHOW HEAP\";\n  }\n});\n"
  },
  {
    "path": "website/js/toggle_menu.js",
    "content": "var toggle = document.getElementById(\"nav-toggle\");\nvar menu = document.getElementById(\"nav-menu\");\n\ntoggle.addEventListener(\"click\", function() {\n  if (this.className === \"nav-toggle\") {\n    this.className = \"nav-toggle is-active\";\n    menu.classList.add(\"is-active\");\n  } else {\n    this.className = \"nav-toggle\";\n    menu.classList.remove(\"is-active\");\n  }\n});\n"
  },
  {
    "path": "website/package.json",
    "content": "{\n  \"name\": \"prepack\",\n  \"version\": \"0.2.4-alpha.0\",\n  \"description\": \"Execute a JS bundle, serialize global state and side effects to a snapshot that can be quickly restored.\",\n  \"homepage\": \"https://github.com/facebook/prepack\",\n  \"repository\": {\n    \"type\": \"git\",\n    \"url\": \"git://github.com/facebook/prepack.git\"\n  },\n  \"bugs\": {\n    \"url\": \"https://github.com/facebook/prepack/issues\"\n  },\n  \"scripts\": {\n    \"prettier\": \"node ./scripts/prettier/index.js write-changed\",\n    \"prettier-all\": \"node ./scripts/prettier/index.js write\"\n  },\n  \"devDependencies\": {\n    \"chalk\": \"^1.1.3\",\n    \"glob\": \"^7.1.2\",\n    \"prettier\": \"1.17.0\"\n  },\n  \"engines\": {\n    \"node\": \">=6.1.0\"\n  },\n  \"keywords\": [\n    \"prepack\"\n  ],\n  \"license\": \"BSD-3-Clause\",\n  \"author\": \"Facebook\"\n}\n"
  },
  {
    "path": "website/repl.html",
    "content": "<!DOCTYPE html>\n<html>\n  <head>\n    <title>Prepack &middot; Partial evaluator for JavaScript</title>\n    <script src=\"js/prism.js\"></script>\n    <script src=\"https://cdnjs.cloudflare.com/ajax/libs/vis/4.21.0/vis.min.js\"></script>\n    <link rel=\"stylesheet\" href=\"https://cdnjs.cloudflare.com/ajax/libs/tether-select/1.1.1/css/select-theme-dark.css\"/>\n    <link rel=\"stylesheet\" href=\"https://cdnjs.cloudflare.com/ajax/libs/vis/4.21.0/vis.min.css\"/>\n    <link rel=\"stylesheet\" href=\"css/style.css\"/>\n    <script>\n      (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){\n        (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),\n        m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)\n      })(window,document,'script','https://www.google-analytics.com/analytics.js','ga');\n      ga('create', 'UA-44373548-29', 'auto');\n      ga('send', 'pageview');\n    </script>\n  </head>\n  <body>\n\n    <nav class=\"nav\">\n      <div class=\"content-container\">\n\n        <div class=\"nav-left\">\n          <a class=\"nav-item is-brand\" href=\"./\">\n            <img class=\"nav-logo\" src=\"static/images/prepack_logo.png\" alt=\"prepack logo\"/>\n            Prepack\n          </a>\n        </div>\n\n        <span id=\"nav-toggle\" class=\"nav-toggle\">\n          <span></span>\n          <span></span>\n          <span></span>\n        </span>\n\n        <div id=\"nav-menu\" class=\"nav-right nav-menu\">\n          <a href=\"./\" class=\"nav-item\">About</a>\n          <a href=\"getting-started.html\" class=\"nav-item\">Getting Started</a>\n          <a href=\"frequently-asked-questions.html\" class=\"nav-item\">FAQs</a>\n          <a href=\"repl.html\" class=\"nav-item is-active\">Try It Out</a>\n          <a href=\"https://github.com/facebook/prepack\" class=\"nav-item\">GitHub</a>\n        </div>\n\n      </div>\n    </nav>\n    <div class=\"record-container\">\n      <div class=\"select-record-input\">\n        <select class=\"select-record\">\n          <option>1</option>\n          <option>2</option>\n          <option>3</option>\n          <option>4</option>\n        </select>\n      </div>\n      <div class=\"options-input\">\n        <div id=\"optionsMenuButton\" class=\"options-menu-button\">OPTIONS</div>\n        <div id=\"optionsMenuRecord\" class=\"options-menu-record\"></div>\n      </div>\n      <div class=\"record-input\">\n        <input id=\"recordName\" placeholder=\"demo name\"/>\n        <div id=\"saveBtn\" class=\"record-button save\">SAVE</div>\n        <div id=\"deleteBtn\" class=\"record-button delete\">DELETE</div>\n        <div id=\"graphBtn\" class=\"record-button graphBtn\">SHOW HEAP</div>\n      </div>\n    </div>\n    <div class=\"repl-container\">\n      <div id=\"inputDiv\" class=\"input\">\n        <div class=\"repl\"></div>\n        <div class=\"messagesContainer\">\n          <div class=\"messages\"></div>\n        </div>\n      </div>\n\n      <div id=\"outputDiv\" class=\"output\">\n        <div class=\"repl\"></div>\n      </div>\n      <div id=\"graph\" class =\"graph\">\n        <div id=\"graphBox\" class=\"graphBox\"></div>\n        <div class=\"graphLegend\">\n          <h3 class=\"legend-header\">Legend</h3>\n          <table class = \"legend-table\" cellspacing=\"10px\">\n            <tr>\n              <td><img src=\"static/images/red_circle.png\" height=42 width=42> <div>Function Value </div></td>\n              <td><img src=\"static/images/blue_box.png\" height=42 width=42><div>Object Value </div></td>\n              <td><img src=\"static/images/green_diamond.png\" height=42 width=42><div>Abstract Value </div></td>\n              <td><img src=\"static/images/yellow_star.png\" height=42 width=42><div>Symbol Value</div></td>\n              <td><img src=\"static/images/orange_triangle.png\" height=42 width=42><div>Proxy Value</div></td>\n              <td><img src=\"static/images/grey_ellipse.png\" height=42 width=42><div>Other</div></td>\n            </tr>\n          </table>\n        </div>\n      </div>\n    </div>\n\n\n    <script src=\"https://cdnjs.cloudflare.com/ajax/libs/ace/1.1.3/ace.js\"></script>\n    <script src=\"https://cdnjs.cloudflare.com/ajax/libs/lz-string/1.4.4/lz-string.min.js\"></script>\n    <script src=\"https://cdnjs.cloudflare.com/ajax/libs/tether/1.4.3/js/tether.min.js\"></script>\n    <script src=\"https://cdnjs.cloudflare.com/ajax/libs/tether-select/1.1.1/js/select.min.js\"></script>\n    <script src=\"js/repl.js\"></script>\n    <script src=\"js/toggle_menu.js\"></script>\n  </body>\n</html>\n"
  },
  {
    "path": "website/scripts/prettier/index.js",
    "content": "/**\n * Copyright (c) 2017-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n'use strict';\n\n// Based on similar script in Jest\n// https://github.com/facebook/jest/blob/master/scripts/prettier.js\n\nconst chalk = require('chalk');\nconst glob = require('glob');\nconst path = require('path');\nconst execFileSync = require('child_process').execFileSync;\n\nconst mode = process.argv[2] || 'check';\nconst shouldWrite = mode === 'write' || mode === 'write-changed';\nconst onlyChanged = mode === 'check-changed' || mode === 'write-changed';\n\nconst isWindows = process.platform === 'win32';\nconst prettier = isWindows ? 'prettier.cmd' : 'prettier';\nconst prettierCmd = path.resolve(\n  __dirname,\n  '../../node_modules/.bin/' + prettier\n);\nconst defaultOptions = {\n  'bracket-spacing': 'true',\n  'single-quote': 'true',\n  'jsx-bracket-same-line': 'true',\n  'trailing-comma': 'all',\n  'print-width': 120,\n};\nconst config = {\n  default: {\n    patterns: ['js/*.js'],\n    ignore: ['js/*.min.js', 'js/prism.js'],\n  },\n  scripts: {\n    patterns: ['scripts/**/*.js'],\n  },\n};\n\nfunction exec(command, args) {\n  console.log('> ' + [command].concat(args).join(' '));\n  const options = {};\n  return execFileSync(command, args, options).toString();\n}\n\nconst mergeBase = exec('git', ['merge-base', 'HEAD', 'gh-pages']).trim();\nconst changedFiles = new Set(\n  exec('git', [\n    'diff',\n    '-z',\n    '--name-only',\n    '--diff-filter=ACMRTUB',\n    mergeBase,\n  ]).match(/[^\\0]+/g)\n);\n\nObject.keys(config).forEach(key => {\n  const patterns = config[key].patterns;\n  const options = config[key].options;\n  const ignore = config[key].ignore;\n\n  const globPattern = patterns.length > 1\n    ? `{${patterns.join(',')}}`\n    : `${patterns.join(',')}`;\n  const files = glob\n    .sync(globPattern, {ignore})\n    .filter(f => !onlyChanged || changedFiles.has(f));\n\n  if (!files.length) {\n    return;\n  }\n\n  const args = Object.keys(defaultOptions).map(\n    k => `--${k}=${(options && options[k]) || defaultOptions[k]}`\n  );\n  args.push(`--${shouldWrite ? 'write' : 'l'}`);\n\n  try {\n    exec(prettierCmd, [...args, ...files]);\n  } catch (e) {\n    if (!shouldWrite) {\n      console.log(\n        '\\n' +\n          chalk.red(\n            `  This project uses prettier to format all JavaScript code.\\n`\n          ) +\n          chalk.dim(`    Please run `) +\n          chalk.reset('yarn prettier') +\n          chalk.dim(` and add changes to files listed above to your commit.`) +\n          `\\n`\n      );\n      process.exit(1);\n    }\n    throw e;\n  }\n});\n"
  }
]